Hi Everyone,
I have stucked on workbook ex05_2 that makes comparison between using the same entity bean in TransactionPersistenceContext & ExtendedPersistenceContext. Anyhow, the following error occurred when trying to access either of these contexts:
javax.naming.NamingException: Could not dereference object [Root exception is java.lang.reflect.UndeclaredThrowableException] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1150)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at client.Main.main(Main.java:33)
Caused by: java.lang.reflect.UndeclaredThrowableException
at $Proxy1.createProxy(Unknown Source)
at org.jboss.ejb3.JndiProxyFactory.getObjectInstance(JndiProxyFactory.java:52)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1125)
at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1142)
... 4 more
This message make sense considering the jndi listing as follows:
+- ExtendedPersistenceContextBean (class: org.jnp.interfaces.NamingContext)
| +- remote (class: java.lang.Object)
| +- remoteStatefulProxyFactory (proxy: $Proxy76 implements interface org.jboss.ejb3.ProxyFactory)
+- TravelAgentBean (class: org.jnp.interfaces.NamingContext)
| +- remote (proxy: $Proxy81 implements interface travelagent.TravelAgentRemote,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
+- TransactionPersistenceContextBean (class: org.jnp.interfaces.NamingContext)
| +- remote (class: java.lang.Object)
| +- remoteStatefulProxyFactory (proxy: $Proxy76 implements interface org.jboss.ejb3.ProxyFactory)
To call TravelAgentRemote interface, use jndiContext.lookup("
TravelAgentBean/remote"). However, it appears that
I would not get anything by calling either jndiContext.lookup("
TransactionPersistenceContextBean/remote") or jndiContext.lookup("
ExtendedPersistenceContextBean/remote") according to the above jndi table.
The client code are as follows:
This exercise does not work as delivered on the command prompt.
I am running Netbeans 5.5,
JBoss 4.0.5GA & JDK1.6.0 on Windows XP platform.
The workbook is from
EJB 3.0 by Bill Burke.
Any assistance would be greatly appreciated.
Thanks,
Henry