[JBoss Seam] - LIE and accessing collections in next request
by raja05
I have a simple Seam app that displays the list of categories as a datatable and selecting a category from that. All works fine till that point. In the next request(i.e. after a category has been selected), Im trying to get the books that are associated with the category . The relation between Category to Books is OneToMany.
When trying to access the books for that category, I get the following LIE
| Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.rajasaur.bookxchange.model.Category.books, no session or session was closed
| at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
| at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
| at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
| at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
| at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:138)
| at com.rajasaur.bookxchange.action.CategoryActionsBean.updateCategory(CategoryActionsBean.java:112)
| 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.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
| at org.jboss.seam.interceptors.ValidationInterceptor.validateTargetComponent(ValidationInterceptor.java:64)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
|
CategoryActionsBean(Which is a Session Scoped Stateful bean) contains the following mappings.
@In(create=true)
| private EntityManager em;
| @In(required=false) @Valid
| private Category category;
| @DataModel
| private List<Category> categories;
| @DataModelSelection(value="categories") @Out(required=false, scope=ScopeType.CONVERSATION)
| private Category selectedCategory;
|
The Category Entity Bean also has 2 roles, category and selectedCategory, both of them in the Conversation Scope. Im totally at a loss as to why this is happening.
According to the forums, if a component is in Conversational Scope and if we use the Seam managed PC, it should work , but I cant get this to work. If I put in a em.refresh before accessing the collection , then it works fine, but I thought Seam should be able to keep the collections intact from the previous request (as per Section 9.4 in the Seam Docs).
If someone can point me to some docs or the problem, greatly appreciate it. Ive been debugging this for almost a few hours now, but cant get anywhere.
Thanks
Raja
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969043#3969043
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969043
19 years, 7 months
[JBoss jBPM] - Re: advanced examples
by stibrian
I agree with the first response - many of the "advanced" things in jBPM are really customizations/extensions that are revealed as you read the user guide and come to understand the possibilities.
for example we've built:
emailing on task assignment that is configurable at runtime (not based on a process definition)
a really flexible form generation and input validation system
much better handling of group assigned tasks for long running processes
several other extension points that are hinted at and available by seeing how embeddable and extensible the engine really is...
so the question stands - what do you want to do? is there some capability you're wondering if jBPM has/can be made to support, or is this just a general question? If the latter, I understand. We've done most of the interesting things through trial and error, testing, reading and re-reading the guides, and the best guide of all, the source. jBPM builds easy, and if you pull down the source you can plug it right into eclipse for debugging whilst you're working. If the former, you'll have to be more specific.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969031#3969031
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969031
19 years, 7 months
[JBoss jBPM] - ant run-test throws a error
by hiaihua2005
E:\jbpm-bpel\doc\examples\hello>ant run-test
Buildfile: build.xml
compile-test:
run-test:
[junit] Testsuite: org.jbpm.bpel.tutorial.hello.ClientTest
[junit] Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 1.063 sec
[junit] ------------- Standard Output ---------------
[junit] 13:43:45,828 ERROR ServiceObjectFactory : Cannot create service
[junit] javax.naming.NamingException: Cannot unmarshall service ref meta dat
a, cause: java.io.InvalidClassException: javax.xml.namespace.QName; local class
incompatible: stream classdesc serialVersionUID = 4418622981026545151, local cla
ss serialVersionUID = -9120448754896609940
[junit] at org.jboss.ws.jaxrpc.ServiceObjectFactory.getObjectInstance(Se
rviceObjectFactory.java:127)
[junit] at javax.naming.spi.NamingManager.getObjectInstance(NamingManage
r.java:304)
[junit] at org.jnp.interfaces.NamingContext.getObjectInstance(NamingCont
ext.java:1125)
[junit] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure
(NamingContext.java:1142)
[junit] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:70
5)
[junit] at org.jboss.naming.client.java.javaURLContextFactory$EncContext
Proxy.invoke(javaURLContextFactory.java:135)
[junit] at $Proxy0.lookup(Unknown Source)
[junit] at javax.naming.InitialContext.lookup(InitialContext.java:351)
[junit] at org.jbpm.bpel.tutorial.hello.ClientTest.setUp(ClientTest.java
:28)
[junit] at junit.framework.TestCase.runBare(TestCase.java:125)
[junit] at junit.framework.TestResult$1.protect(TestResult.java:106)
[junit] at junit.framework.TestResult.runProtected(TestResult.java:124)
[junit] at junit.framework.TestResult.run(TestResult.java:109)
[junit] at junit.framework.TestCase.run(TestCase.java:118)
[junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
[junit] at junit.framework.TestSuite.run(TestSuite.java:203)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
run(JUnitTestRunner.java:297)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
eInVM(JUnitTask.java:1072)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java:682)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
eOrQueue(JUnitTask.java:1434)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java:632)
[junit] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:275)
[junit] at org.apache.tools.ant.Task.perform(Task.java:364)
[junit] at org.apache.tools.ant.Target.execute(Target.java:341)
[junit] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[junit] at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
a:1216)
[junit] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[junit] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
faultExecutor.java:40)
[junit] at org.apache.tools.ant.Project.executeTargets(Project.java:1068
)
[junit] at org.apache.tools.ant.Main.runBuild(Main.java:668)
[junit] at org.apache.tools.ant.Main.startAnt(Main.java:187)
[junit] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
[junit] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
[junit] 13:43:45,890 ERROR ServiceObjectFactory : Cannot create service
[junit] javax.naming.NamingException: Cannot unmarshall service ref meta dat
a, cause: java.io.InvalidClassException: javax.xml.namespace.QName; local class
incompatible: stream classdesc serialVersionUID = 4418622981026545151, local cla
ss serialVersionUID = -9120448754896609940
[junit] at org.jboss.ws.jaxrpc.ServiceObjectFactory.getObjectInstance(Se
rviceObjectFactory.java:127)
[junit] at javax.naming.spi.NamingManager.getObjectInstance(NamingManage
r.java:304)
[junit] at org.jnp.interfaces.NamingContext.getObjectInstance(NamingCont
ext.java:1125)
[junit] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure
(NamingContext.java:1142)
[junit] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:70
5)
[junit] at org.jboss.naming.client.java.javaURLContextFactory$EncContext
Proxy.invoke(javaURLContextFactory.java:135)
[junit] at $Proxy0.lookup(Unknown Source)
[junit] at javax.naming.InitialContext.lookup(InitialContext.java:351)
[junit] at org.jbpm.bpel.tutorial.hello.ClientTest.setUp(ClientTest.java
:28)
[junit] at junit.framework.TestCase.runBare(TestCase.java:125)
[junit] at junit.framework.TestResult$1.protect(TestResult.java:106)
[junit] at junit.framework.TestResult.runProtected(TestResult.java:124)
[junit] at junit.framework.TestResult.run(TestResult.java:109)
[junit] at junit.framework.TestCase.run(TestCase.java:118)
[junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
[junit] at junit.framework.TestSuite.run(TestSuite.java:203)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
run(JUnitTestRunner.java:297)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
eInVM(JUnitTask.java:1072)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java:682)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
eOrQueue(JUnitTask.java:1434)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java:632)
[junit] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:275)
[junit] at org.apache.tools.ant.Task.perform(Task.java:364)
[junit] at org.apache.tools.ant.Target.execute(Target.java:341)
[junit] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[junit] at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
a:1216)
[junit] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[junit] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
faultExecutor.java:40)
[junit] at org.apache.tools.ant.Project.executeTargets(Project.java:1068
)
[junit] at org.apache.tools.ant.Main.runBuild(Main.java:668)
[junit] at org.apache.tools.ant.Main.startAnt(Main.java:187)
[junit] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
[junit] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
[junit] ------------- ---------------- ---------------
[junit] Testcase: testSayHello_proxy(org.jbpm.bpel.tutorial.hello.ClientTest
): Caused an ERROR
[junit] Cannot unmarshall service ref meta data, cause: java.io.InvalidClass
Exception: javax.xml.namespace.QName; local class incompatible: stream classdesc
serialVersionUID = 4418622981026545151, local class serialVersionUID = -9120448
754896609940
[junit] javax.naming.NamingException: Cannot unmarshall service ref meta dat
a, cause: java.io.InvalidClassException: javax.xml.namespace.QName; local class
incompatible: stream classdesc serialVersionUID = 4418622981026545151, local cla
ss serialVersionUID = -9120448754896609940
[junit] at org.jboss.ws.jaxrpc.ServiceObjectFactory.getObjectInstance(Se
rviceObjectFactory.java:127)
[junit] at javax.naming.spi.NamingManager.getObjectInstance(NamingManage
r.java:304)
[junit] at org.jnp.interfaces.NamingContext.getObjectInstance(NamingCont
ext.java:1125)
[junit] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure
(NamingContext.java:1142)
[junit] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:70
5)
[junit] at org.jboss.naming.client.java.javaURLContextFactory$EncContext
Proxy.invoke(javaURLContextFactory.java:135)
[junit] at $Proxy0.lookup(Unknown Source)
[junit] at javax.naming.InitialContext.lookup(InitialContext.java:351)
[junit] at org.jbpm.bpel.tutorial.hello.ClientTest.setUp(ClientTest.java
:28)
[junit] Testcase: testSayHello_dii(org.jbpm.bpel.tutorial.hello.ClientTest):
Caused an ERROR
[junit] Cannot unmarshall service ref meta data, cause: java.io.InvalidClass
Exception: javax.xml.namespace.QName; local class incompatible: stream classdesc
serialVersionUID = 4418622981026545151, local class serialVersionUID = -9120448
754896609940
[junit] javax.naming.NamingException: Cannot unmarshall service ref meta dat
a, cause: java.io.InvalidClassException: javax.xml.namespace.QName; local class
incompatible: stream classdesc serialVersionUID = 4418622981026545151, local cla
ss serialVersionUID = -9120448754896609940
[junit] at org.jboss.ws.jaxrpc.ServiceObjectFactory.getObjectInstance(Se
rviceObjectFactory.java:127)
[junit] at javax.naming.spi.NamingManager.getObjectInstance(NamingManage
r.java:304)
[junit] at org.jnp.interfaces.NamingContext.getObjectInstance(NamingCont
ext.java:1125)
[junit] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure
(NamingContext.java:1142)
[junit] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:70
5)
[junit] at org.jboss.naming.client.java.javaURLContextFactory$EncContext
Proxy.invoke(javaURLContextFactory.java:135)
[junit] at $Proxy0.lookup(Unknown Source)
[junit] at javax.naming.InitialContext.lookup(InitialContext.java:351)
[junit] at org.jbpm.bpel.tutorial.hello.ClientTest.setUp(ClientTest.java
:28)
[junit] Test org.jbpm.bpel.tutorial.hello.ClientTest FAILED
BUILD SUCCESSFUL
Total time: 3 seconds
????????????? - end
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969029#3969029
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969029
19 years, 7 months