[EJB 3.0] - Newbie GenericGenerator from stored procedureProblem
by slavosk
Hi,
i have problems to get id from a stored procedure. I'm getting allways the "NOK" value from my Generator. (Problem with persistence context ?)
Is it possible, or what am I doing wrong?
| @GenericGenerator(name="next_id", strategy="com.myapp.DBSequenceGenerator")
| @Id @GeneratedValue(generator="next_id")
| @Column(name = "product_id", unique = true, nullable = false, length = 20)
| @NotNull
| @Length(max = 20)
| public String getProductId() {
| return this.productId;
| }
|
|
| @Stateless
| public class DBSequenceGenerator implements IdentifierGenerator {
|
| @PersistenceContext
| EntityManager em;
|
| public DBSequenceGenerator() {
| // empty constructor
| }
|
| public Serializable generate(SessionImplementor arg0, Object arg1) throws HibernateException {
| try {
| Query q = em.createNativeQuery("select get_next_id from get_next_id('nativequery')");
| //........
| } catch (Exception e) {
| return "NOK";
| }
| return "OK";
| }
| }
|
Thank you!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024939#4024939
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024939
19Â years, 1Â month
[JBoss Seam] - Seam 1.2 Errors on Build in Eclipse
by gzoller
Hello,
Just trying out Seam 1.2.0 Patch 1 and ran into a bump.
I generated a basic application w/seamgen. Nothing fancy--same one I've successfully used w/1.1.6.
I did:
seam setup
seam new-project
seam generate-entities
Everything ran w/no problems.
Added new Java project in Eclipse as I've done before, but this time I got this message:
Errors during build.
Errors running builder "Integrated External Tool Builder" on project Spurs4.
Launch configuration .exploded at C:\Documents and Settings\gzoller\workspace\Spurs4\.exploded.launch does not exist.
In fact .exploded.launch does exist in the given directory. The exploded directory is not created and of course its not deployed into my JBoss server directory.
Previous (1.1.6) seamgen projects exist in this instance of Eclipse w/no problems.
Any ideas?
Thanks!
Greg
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024937#4024937
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024937
19Â years, 1Â month
[JBoss Seam] - Re: Documentation on how to set up Seam together with Trinid
by lschaffer
Hello,
I have tried to integrate trinidad with seam 1.2 following the instructions found in http://wiki.apache.org/myfaces/TrinidadSeamAjax4JsfFaceletDetail
First at all I have created a small seam project with seam gen, that is worked.
Then I have replaced web.xml, faces-config.xml downloaded and copied the jars into lib etc...
But I have got this exception (using jboss 4.0.5)
21:56:31,421 INFO [FacesConfigurator] Reading config jar:file:/C:/jboss45/server/default/./tmp/depl
oy/tmp16804msservice3.ear-contents/msservice3-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/faces-c
onfig.xml
21:56:31,421 INFO [FacesConfigurator] Reading config jar:file:/C:/jboss45/server/default/./tmp/depl
oy/tmp16804msservice3.ear-contents/msservice3-exp.war/WEB-INF/lib/trinidad-impl-1.0.1-incubating-SNA
PSHOT.jar!/META-INF/faces-config.xml
21:56:32,718 INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml
21:56:33,015 ERROR [StartupServletContextListener] Error initializing ServletContext
java.lang.IllegalArgumentException: Class org.jboss.seam.jsf.SeamApplicationFactory is no javax.face
s.application.ApplicationFactory
at javax.faces.FactoryFinder.newFactoryInstance(FactoryFinder.java:132)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:107)
at org.apache.myfaces.config.FacesConfigurator.configureApplication(FacesConfigurator.java:4
39)
at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:141)
at org.apache.myfaces.webapp.StartupServletContextListener.initFaces(StartupServletContextLi
stener.java:69)
at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServlet
ContextListener.java:52)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024936#4024936
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024936
19Â years, 1Â month
[JBoss Seam] - Can't pass action successfully to custom source tag
by steveant
Hi,
I was debating whether this was a facelets or Seam question:
I've created a custom commandLink tag and I'm using it in a seam pageflow. The id & value attributes are passed successfully but the action attribute is not. Here are the pertinent code segments:
bdex.taglib.xml
| . . .
| <tag>
| <tag-name>commandButton</tag-name>
| <source>tags/commandButton.xhtml</source>
| </tag>
| . . .
|
| tags/commandButton.xhtml:
| . . .
| <h:commandLink id="#{id}" action="#{action}" value="#{value}"
| styleClass="bdexCommandButtonLink" style="font-weight: bold; #{style}" />
|
| client file - login.xhtml:
|
| <bdex:commandButton id="loginButton" value="Login" action="login-user" />
|
|
The following errors are reported in the log once the button is clicked:
javax.faces.FacesException: Error calling action method of component with id loginForm:loginButton
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
at javax.faces.component.UICommand.broadcast(UICommand.java:106)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.renderCycle(BlockingServlet.java:456)
at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.receiveUpdates(BlockingServlet.java:444)
at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.executeRequest(BlockingServlet.java:324)
at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:186)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.faces.el.EvaluationException: /WEB-INF/tags/commandButton.xhtml @17,79 action="#{action}": Identity 'action' does not reference a MethodExpression instance, returned type: java.lang.String
at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
Any help would be greatly appreciated. I'm new to Seam/JSF/Seam so I apologize if this turns out to be a trivial issue.
Regards,
Steve
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024935#4024935
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024935
19Â years, 1Â month