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:
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.
I managed to overcome this issue with the following syntax when using Sun System Java Application Server PE 9.0:
The Client output from Netbeans is:
no cabin should be null: null Master Suite 1 1 3 Updating detached cabin instance with new bed count of 4 Finding cabin to see it has been updated with a merge() on server new bed count is: 4 Set up transaction persistence context stateful bean Cabin bed count will still be 4: 4 Set up extended persistence context stateful bean Cabin bed count will be 5: 5
However, I still could not find a solution when running in JBoss AS 4.0.5.
Joined: Oct 20, 2006
Could someone please help me with this issue on the JBoss platform?
I still could not identify what the problem for so many weeks.
I did not have any problem running them using SJAS PE 9.0 by modifying the JNDI lookup to use "travelagent.TransactionPersistenceContextRemote" as opposed to "TransactionPersistenceContextBean/remote".
The Client code looks like this:
The main() method in amy1client runs first to setup the Cabin table prior to running amy2client.