[JBoss Seam] - Re: is it possible to complete JBPM task and update entity a
by rainhust
"vladimir.kovalyuk" wrote : In my case jBPM persistence is configured to use EntityManagerFactory, I use sessionFactoryJndiName property to point to it.
|
hi, can you describe how you do this.
i use seam with jbpm , and i config files is :
seam persistence file
persistence.xml
| <persistence xmlns="http://java.sun.com/xml/ns/persistence"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
| version="1.0">
|
| <persistence-unit name="seambpm">
|
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/seambpmDatasource</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="create-drop" />
| <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
| <property name="hibernate.show_sql" value="true"/>
| <property name="hibernate.format_sql" value="true"/>
| <property name="jboss.entity.manager.factory.jndi.name" value="java:/seambpmEntityManagerFactory"/>
| </properties>
| </persistence-unit>
|
| </persistence>
|
and jbpm.cfg.xml:
| <jbpm-configuration>
|
| <jbpm-context>
| <service name="persistence">
| <factory>
| <bean
| class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
| <field name="isTransactionEnabled">
| <false />
| </field>
| <field name="sessionFactoryJndiName">
| <string value="java:/seambpmEntityManagerFactory" />
| </field>
|
| </bean>
| </factory>
but i got error:
| 09:39:33,178 INFO [Configuration] Configured SessionFactory: null
| 09:39:33,272 WARN [JpdlXmlReader] process xml warning: couldn't fetch 'java:/seambpmEntityManagerFactory' from jndi
| 09:39:33,272 ERROR [[/seambpm]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
| java.lang.RuntimeException: could not deploy a process definition
| at org.jboss.seam.bpm.Jbpm.installProcessDefinitions(Jbpm.java:258)
| at org.jboss.seam.bpm.Jbpm.startup(Jbpm.java:72)
| 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.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
| at org.jboss.seam.Component.callComponentMethod(Component.java:2074)
| at org.jboss.seam.Component.callCreateMethod(Component.java:1997)
| at org.jboss.seam.Component.newInstance(Component.java:1968)
| at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
| at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
| at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:95)
| at org.jboss.seam.init.Initialization.init(Initialization.java:555)
| at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
| at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
| at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
| at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
| at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
| at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
| 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.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
| at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
| 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.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
| at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
| at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
| at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
| at org.jboss.web.WebModule.startModule(WebModule.java:83)
| at org.jboss.web.WebModule.startService(WebModule.java:61)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| 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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy44.start(Unknown Source)
| at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
| 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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
| at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
| at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy45.start(Unknown Source)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy9.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
| Caused by: org.jbpm.util.JndiLookupException: couldn't fetch 'java:/seambpmEntityManagerFactory' from jndi
| at org.jbpm.util.JndiUtil.lookup(JndiUtil.java:41)
| at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:87)
| at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:94)
| at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98)
| at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:336)
| at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:571)
| at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
| at org.jboss.seam.bpm.Jbpm.deployProcess(Jbpm.java:274)
| at org.jboss.seam.bpm.Jbpm.installProcessDefinitions(Jbpm.java:252)
| ... 106 more
| Caused by: java.lang.ClassCastException
| at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
| at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
| at org.jbpm.util.JndiUtil.lookup(JndiUtil.java:37)
| ... 114 more
| Caused by: java.lang.ClassCastException: org.jboss.ejb3.entity.InjectedEntityManagerFactory
| at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212)
| ... 116 more
| 09:39:33,272 ERROR [StandardContext] Error listenerStart
| 09:39:33,272 ERROR [StandardContext] Context [/seambpm] startup failed due to previous errors
| 09:39:33,491 WARN [ServiceController] Problem starting service jboss.web.deployment:war=seambpm.war,id=-372015086
| org.jboss.deployment.DeploymentException: URL file:/D:/tools/jboss-4.2.2.GA/server/default/deploy/seambpm.ear/seambpm.war/ deployment failed
| at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:379)
| at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
| at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
| at org.jboss.web.WebModule.startModule(WebModule.java:83)
| at org.jboss.web.WebModule.startService(WebModule.java:61)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| 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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy44.start(Unknown Source)
| at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
| 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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
| at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
| at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy45.start(Unknown Source)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy9.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
| 09:39:33,491 ERROR [MainDeployer] Could not start deployment: file:/D:/tools/jboss-4.2.2.GA/server/default/deploy/seambpm.ear/seambpm.war/
| org.jboss.deployment.DeploymentException: URL file:/D:/tools/jboss-4.2.2.GA/server/default/deploy/seambpm.ear/seambpm.war/ deployment failed
| at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:379)
| at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
| at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
| at org.jboss.web.WebModule.startModule(WebModule.java:83)
| at org.jboss.web.WebModule.startService(WebModule.java:61)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| 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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy44.start(Unknown Source)
| at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
| 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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
| at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
| at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy45.start(Unknown Source)
|
how to solve this. thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117773#4117773
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117773
18 years, 3 months
[JBoss Seam] - SelectItems - Error - No active event scope
by M4darasz
Hi!
I'm using SeamSelectItems (1.1.1beta4) and I have recently run into a problem.
I get "No active event scope" error when I try to render my JSF page
JSF page
...
| <h:selectOneMenu value="#{projekt.vezeto}">
| <si:selectItems value="#{projektvezetok}" var="pvezeto" label="#{pvezeto.username}" config="#{mySelectItemsConfig}"/>
| </h:selectOneMenu>
| ...
components.xml
<factory name="projektvezetok" value="#{qry_pv.resultList}" scope="PAGE" />
| <framework:entity-query name="qry_pv" ejbql="select pv from Dolgozo pv" />
stack trace
java.lang.IllegalStateException: No active event scope
| at org.jboss.seam.selectitems.Config.instance(Config.java:59)
| at org.jboss.seam.selectitems.ui.UISeamSelectItems.getConfig(UISeamSelectItems.java:48)
| at org.jboss.seam.selectitems.ui.UISeamSelectItems.isHideNoSelection(UISeamSelectItems.java:134)
| at org.jboss.seam.selectitems.ui.UISeamSelectItems.addNoSelectionLabel(UISeamSelectItems.java:294)
| at org.jboss.seam.selectitems.ui.UISeamSelectItems.createSelectItems(UISeamSelectItems.java:274)
| at org.jboss.seam.selectitems.ui.UISeamSelectItems.getValue(UISeamSelectItems.java:258)
| at com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:323)
| at com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(MenuRenderer.java:675)
| at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:793)
| at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:335)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
| at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:571)
| at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
| at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
| at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
| at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
| at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Unknown Source)
Please help! Thank you!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117766#4117766
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117766
18 years, 3 months
[JBoss Seam] - hello world example failing at postgres sequence...help
by sameerc1
Hello,
I'm going through the hello world example from the seam book, and I'm getting an error I cannot resolve, that with an auto generated sql statement, that's not valid for postgres 8.1, the database I'm on. Here's my error:
......
17:40:31,370 INFO [STDOUT] Hibernate: select next value for person_id_seq from dual_person_id_seq
17:40:31,394 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: 42601
17:40:31,394 ERROR [JDBCExceptionReporter] ERROR: syntax error at or near "value"
17:40:31,396 FATAL [application] javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not get next sequence value
javax.faces.el.EvaluationException: javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not get next sequence value
Here's the table definition
- create table Person (id bigint not null, name varchar(255), primary key (id))
- create table dual_person_id_seq (zero integer)
- create sequence person_id_seq start with 1 increment by 1
and here's the entity bean:
@Entity
@Name("person")
@Table(name="person")
@SequenceGenerator(name="person_sequence", sequenceName="person_id_seq")
public class Person implements Serializable {
private long id;
private String name;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="person_sequence")
public long getId() { return id;}
public void setId(long id) { this.id = id; }
public String getName() { return name; }
public void setName(String name) { this.name = name; }
}
How do I get it to generate a valid sql statement for postgres?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117763#4117763
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117763
18 years, 3 months
[EJB 3.0] - Returning a class with OneToMany mappings causes infinite XM
by mjhammel
I've managed to create my first Web Services interface that retrieves a record from a MySQL db via an EJB3.0 bean generated by Hibernate using reverse engineering. However, I can't return this object to the remote client because I get the following error:
15:22:47,324 INFO [STDOUT] Subscriber.find(): em is not null; returning subscriber for guid = CRUNCH-DEFAULT-SUPERUSER
| 15:22:47,339 INFO [STDOUT] Count : 7
| 15:22:47,339 INFO [STDOUT] Subscriber name : SuperUser
| 15:22:47,340 INFO [STDOUT] Subscriber email: admin@localhost
| 15:22:47,406 ERROR [RequestHandlerImpl] Error processing web service request
| org.jboss.ws.WSException: javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException
| - with linked exception:
| [com.sun.istack.SAXException2: A cycle is detected in the object graph. This will cause infinitely deep XML: com.cei.crunch.ejb.Subscriber@1e51549 -> com.cei.crunch.ejb.Crunchroles@538af7 -> com.cei.crunch.ejb.Subscriber@1e51549]
It seems that if your returned object includes a OneToMany mapping you get this problem. I can reference the object on the server side and return individual fields from it to the remote client, but I can't return the whole object. Since the class is being automatically generated with Hibernate, I'm wondering how I can return any db objects to callers? In fact, what if I wanted to create a new class, one that doesn't represent a table in the db, and return that? How does the client reference this class? Note that I'm using wsconsume to generate the client side classes used to interact with the Web Service. I know this latter is a WS question and not an EJB question, but my initial problem still stands - what can I do to return this EJB that has OneToMany mappings in it without getting the infinite XML error?
This is what my Web Services/Session Bean looks like:
package com.cei.crunch.server.ws.SubscriberServices;
|
| import javax.ejb.*;
| import javax.jws.WebService;
| import javax.jws.WebMethod;
| import javax.jws.soap.SOAPBinding;
| import javax.persistence.*;
| import javax.naming.InitialContext;
| import javax.transaction.UserTransaction;
| import javax.annotation.Resource;
|
| import com.cei.crunch.ejb.Subscriber;
| import com.cei.crunch.ejb.SubscriberHome;
|
| /* Make this an EJB3 service endpoint. */
| @Stateless
| @Remote(SubscriberServices.class)
|
| /* Make this an Web Services endpoint. */
| @WebService(
| name = "SubscriberWS",
| endpointInterface = "com.cei.crunch.server.ws.SubscriberServices.SubscriberServicesEndpoint"
| )
| @SOAPBinding(style = SOAPBinding.Style.RPC)
|
| /**
| * The .Crunch interface to Subscriber Services
| */
| public class SubscriberServices implements SubscriberServicesEndpoint {
|
| private UserTransaction utx;
| private EntityManager em;
|
| @WebMethod
| public String findSubscriber(String guid)
| {
| Subscriber s = null;
|
| InitialContext ctx = null;
| EntityManager em = null;
| try {
| ctx = new InitialContext();
| em = (EntityManager) ctx.lookup("java:/CrunchPersistence");
| utx = (UserTransaction) ctx.lookup("java:/comp/UserTransaction");
| }
| catch (Exception e)
| {
| // throw new WebServiceException(ex);
| System.out.println("Subscriber.find(): context lookup failure.");
| e.printStackTrace();
| return null;
| }
|
| if ( em == null )
| {
| System.out.println("Subscriber.find(): em is null; can't find subscriber");
| }
| else
| {
| System.out.println("Subscriber.find(): em is not null; returning subscriber for guid = " + guid);
| try {
| utx.begin();
| s = em.find(Subscriber.class, guid);
| int count = s.getCrunchroleses().size();
| if ( s != null )
| {
| System.out.println("Count : " + count);
| System.out.println("Subscriber name : " + s.getFirstname());
| System.out.println("Subscriber email: " + s.getEmailAddress());
| }
| utx.commit();
| }
| catch (Exception e)
| {
| System.out.println("Subscriber.find(): find problem.");
| e.printStackTrace();
| }
| }
| if ( s != null )
| return s.getGuid();
| else
| return null;
| }
|
| }
Some notes on this. First, injection is not working under Web Services in 4.2.2GA (see my previous posts in the WS forum - http://www.jboss.com/index.html?module=bb&op=viewtopic&t=126927) so the context and transaction have to be created manually. Second, if you don't reference the size of one of the Set's in this EJB before referencing the fields you get LazyInitializationException errors.
The Subscriber table looks like this - note that there are no foreign key references here, but other tables have foreign key references back to this table which causes the EJB for this table (as generated by Hibernate) to include the foreign key methods.
create table Subscriber (
| guid varchar(50) not null,
| Username varchar(256), -- The login id for this subscriber
| password varchar(256), -- The password for this subscriber; will need encryption set for this
|
| addr1 varchar(256), -- Home address
| addr2 varchar(256), -- Home address
| city varchar(256), -- City or Town of origin
| province varchar(256), -- State or Province
|
| country varchar(256), --
| postalCode varchar(50), --
| emailAddress varchar(1024), --
| phone varchar(50), --
| latitude float, -- Used only to place subscribers on a map
| longitude float, -- Used only to place subscribers on a map
|
| firstname varchar(256), -- The subscriber first name
| lastname varchar(256), -- The subscriber last name
| organizationGuid varchar(50), -- The organization this subscriber belongs to, if any
| groupGuid varchar(50), -- The group within the organization, if any
| teamGuid varchar(50), -- The team the subscriber chose, if any
| viewLevelGuid varchar(50), -- The view level this subscriber has
| viewAccessGuid varchar(50), -- The view level this subscriber can see
| lastLogin varchar(50), -- When the subscriber last logged in
| state int, -- 0: new, 1: active, 2: inactive, 3: deleted, 4: banned
| priority int, -- Higher values have higher priority
|
| PRIMARY KEY(guid)
| )
The EJB generated by hbm2java looks like this:
package com.cei.crunch.ejb;
| // Generated Jan 7, 2008 3:51:39 PM by Hibernate Tools 3.2.0.CR1
|
|
| import java.util.HashSet;^M
| import java.util.Set;^M
| import javax.persistence.Column;^M
| import javax.persistence.Entity;^M
| import javax.persistence.FetchType;^M
| import javax.persistence.Id;^M
| import javax.persistence.OneToMany;^M
| import javax.persistence.Table;^M
|
| /**
| * Subscriber generated by hbm2java
| */
| @Entity
| @Table(name="subscriber"
| ,catalog="crunch"
| )
| public class Subscriber implements java.io.Serializable {
|
|
| private String guid;
| private String username;
| private String password;
| private String addr1;
| private String addr2;
| private String city;
| private String province;
| private String country;
| private String postalCode;
| private String emailAddress;
| private String phone;
| private Float latitude;
| private Float longitude;
| private String firstname;
| private String lastname;
| private String organizationGuid;
| private String groupGuid;
| private String teamGuid;
| private String viewLevelGuid;
| private String viewAccessGuid;
| private String lastLogin;
| private Integer state;
| private Integer priority;
| private Set<Subscribersession> subscribersessions = new HashSet<Subscribersession>(0);
| private Set<Crunchroles> crunchroleses = new HashSet<Crunchroles>(0);
|
|
| public Subscriber() {
| }
|
|
| public Subscriber(String guid) {
| this.guid = guid;
| }
| public Subscriber(String guid, String username, String password, String addr1, String addr2, String city, String province, String country, String postalCode, String emailAddress, String phone, Float latitude, Float longitude, String firstname, String lastname, String organizationGuid, String groupGuid, String teamGuid, String viewLevelGuid, String viewAccessGuid, String lastLogin, Integer state, Integer priority, Set<Subscribersession> subscribersessions, Set<Crunchroles> crunchroleses) {
| this.guid = guid;
| this.username = username;
| this.password = password;
| this.addr1 = addr1;
| this.addr2 = addr2;
| this.city = city;
| this.province = province;
| this.country = country;
| this.postalCode = postalCode;
| this.emailAddress = emailAddress;
| this.phone = phone;
| this.latitude = latitude;
| this.longitude = longitude;
| this.firstname = firstname;
| this.lastname = lastname;
| this.organizationGuid = organizationGuid;
| this.groupGuid = groupGuid;
| this.teamGuid = teamGuid;
| this.viewLevelGuid = viewLevelGuid;
| this.viewAccessGuid = viewAccessGuid;
| this.lastLogin = lastLogin;
| this.state = state;
| this.priority = priority;
| this.subscribersessions = subscribersessions;
| this.crunchroleses = crunchroleses;
| }
|
| @Id
|
| @Column(name="guid", nullable=false, length=50)
| public String getGuid() {
| return this.guid;
| }
|
|
| public void setGuid(String guid) {
| this.guid = guid;
| }
|
| @Column(name="Username", length=256)
| public String getUsername() {
| return this.username;
| }
|
| public void setUsername(String username) {
| this.username = username;
| }
|
| @Column(name="password", length=256)
| public String getPassword() {
| return this.password;
| }
|
| public void setPassword(String password) {
| this.password = password;
| }
|
| @Column(name="addr1", length=256)
| public String getAddr1() {
| return this.addr1;
| }
|
| public void setAddr1(String addr1) {
| this.addr1 = addr1;
| }
|
| @Column(name="addr2", length=256)
| public String getAddr2() {
| return this.addr2;
| }
|
| public void setAddr2(String addr2) {
| this.addr2 = addr2;
| }
|
| @Column(name="city", length=256)
| public String getCity() {
| return this.city;
| }
|
| public void setCity(String city) {
| this.city = city;
| }
|
| @Column(name="province", length=256)
| public String getProvince() {
| return this.province;
| }
|
| public void setProvince(String province) {
| this.province = province;
| }
|
| @Column(name="country", length=256)
| public String getCountry() {
| return this.country;
| }
|
| public void setCountry(String country) {
| this.country = country;
| }
|
| @Column(name="postalCode", length=50)
| public String getPostalCode() {
| return this.postalCode;
| }
|
| public void setPostalCode(String postalCode) {
| this.postalCode = postalCode;
| }
|
| @Column(name="emailAddress", length=1024)
| public String getEmailAddress() {
| return this.emailAddress;
| }
|
| public void setEmailAddress(String emailAddress) {
| this.emailAddress = emailAddress;
| }
|
| @Column(name="phone", length=50)
| public String getPhone() {
| return this.phone;
| }
|
| public void setPhone(String phone) {
| this.phone = phone;
| }
|
| @Column(name="latitude", precision=12, scale=0)
| public Float getLatitude() {
| return this.latitude;
| }
|
| public void setLatitude(Float latitude) {
| this.latitude = latitude;
| }
|
| @Column(name="longitude", precision=12, scale=0)
| public Float getLongitude() {
| return this.longitude;
| }
|
| public void setLongitude(Float longitude) {
| this.longitude = longitude;
| }
|
| @Column(name="firstname", length=256)
| public String getFirstname() {
| return this.firstname;
| }
|
| public void setFirstname(String firstname) {
| this.firstname = firstname;
| }
|
| @Column(name="lastname", length=256)
| public String getLastname() {
| return this.lastname;
| }
|
| public void setLastname(String lastname) {
| this.lastname = lastname;
| }
|
| @Column(name="organizationGuid", length=50)
| public String getOrganizationGuid() {
| return this.organizationGuid;
| }
|
| public void setOrganizationGuid(String organizationGuid) {
| this.organizationGuid = organizationGuid;
| }
|
| @Column(name="groupGuid", length=50)
| public String getGroupGuid() {
| return this.groupGuid;
| }
|
| public void setGroupGuid(String groupGuid) {
| this.groupGuid = groupGuid;
| }
|
| @Column(name="teamGuid", length=50)
| public String getTeamGuid() {
| return this.teamGuid;
| }
|
| public void setTeamGuid(String teamGuid) {
| this.teamGuid = teamGuid;
| }
|
| @Column(name="viewLevelGuid", length=50)
| public String getViewLevelGuid() {
| return this.viewLevelGuid;
| }
|
| public void setViewLevelGuid(String viewLevelGuid) {
| this.viewLevelGuid = viewLevelGuid;
| }
|
| @Column(name="viewAccessGuid", length=50)
| public String getViewAccessGuid() {
| return this.viewAccessGuid;
| }
|
| public void setViewAccessGuid(String viewAccessGuid) {
| this.viewAccessGuid = viewAccessGuid;
| }
|
| @Column(name="lastLogin", length=50)
| public String getLastLogin() {
| return this.lastLogin;
| }
|
| public void setLastLogin(String lastLogin) {
| this.lastLogin = lastLogin;
| }
|
| @Column(name="state")
| public Integer getState() {
| return this.state;
| }
|
| public void setState(Integer state) {
| this.state = state;
| }
|
| @Column(name="priority")
| public Integer getPriority() {
| return this.priority;
| }
|
| public void setPriority(Integer priority) {
| this.priority = priority;
| }
| @OneToMany(fetch=FetchType.LAZY, mappedBy="subscriber")
| public Set<Subscribersession> getSubscribersessions() {
| return this.subscribersessions;
| }
|
| public void setSubscribersessions(Set<Subscribersession> subscribersessions) {
| this.subscribersessions = subscribersessions;
| }
| @OneToMany(fetch=FetchType.LAZY, mappedBy="subscriber")
| public Set<Crunchroles> getCrunchroleses() {
| return this.crunchroleses;
| }
|
| public void setCrunchroleses(Set<Crunchroles> crunchroleses) {
| this.crunchroleses = crunchroleses;
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117758#4117758
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117758
18 years, 3 months