You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 27 Members of 4060 |
| Forum: Seam Users |
07. Jul 2008, 14:05 CET | Link |
Hi!
Im trying to test my stateful session bean with SeamTest (testng). I got an Exception when running the following line in my Testclass:
setValue("#{c_musterprodukt.newMprName}", "MyName");
//c_musterprodukt is the name of my session bean
java.lang.RuntimeException: Unable to inject jndi dependency: env/org.mydomain.musterprodukt.impl.MusterproduktConversationBean/ctx into property org.mydomain.musterprodukt.impl.MusterproduktConversationBean.ctx: EJBContext not bound at org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:77) at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:89)
What can be the cause of this?
Thanks in advance,
Andreas
when you deploy the app, view the console/log to see if the SFSB in question is being deployed properly and its JNDI reference is available. Then check the JNDI address to see if matches the above or not (you can also use jboss jmx-console I think to check).
Thanks for your answer.
The deployment works without errors, the deployed application works too (well, not perfect, but runs).
Thats the corresponding output during deployment:
Thats the corresponding output of jndiview of the jmx-console:
Can anyone help?
I found the cause of the Exception. It is the following code in my SessionBean:
I commented this and all occurences of ctx out, and the test runs now. But I need the SessionContext for Rollbacktransactions by calling:
How can I inject SessionContext without @Resource, or how can I use rollBack Transactions without SessionCentext? How can I solve this problem?
Thanks in advance!
Andreas
Have you tried this?
@In private Context sessionContext;
This would be the wrong Context.
The context Andreas ist looking for is javax.ejb.SessionContext
and not
org.jboss.seam.contexts.Context