-
1. Re: JNDI Lookup Confusion
adrian.brock Jul 10, 2002 7:20 AM (in response to scooter42)Each ejb has a global name "giftcert/Validate"
this can be accessed from anywhere.
You can also specify a local name "java:comp/env/ in your
ejb-jar.xml or web.xml that can only be used from
beans/servlets/jsp in the jar with that deployment
descriptor (the xml)
The idea is that you can code your jsp with the
java:comp/env name without having to worry about where
in jndi the bean is located. e.g. You could move it to
a different name or even a different machine and you only
have to change the deployment descriptor not the code.
Which version of JBoss/JVM are you using?
Is your jsp redeployed with the ejb?
Are you holding onto the result of the first lookup
inside the jsp after the redeploy?
Regards,
Adrian -
2. Re: JNDI Lookup Confusion
scooter42 Jul 10, 2002 6:13 PM (in response to scooter42)Actually, the more I poke into this, the more I think I'm having a Jetty problem rather than a jndi problem. The issue that I'm trying to track down is that when I redeploy an ear I run into a message like this...
"java.lang.ClassCastException at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject narrow", etc...
The failure when doing a PortableRemoteObject call *only* happens when redeploying a JSP making a connection using the "giftcert/Validate" jndi lookup... it works fine after a redeploy if I use "java:comp/env/ejb/Validate".
The reason I think it's a jetty problem is that I setup a test where I have JSP being served up by machine A, and the EJB running on machine B, so A talks to B. If I redeploy the ear on machine B the JSP still works fine. However, if I redeploy on machine A, then I get the error with the PortableRemoteObject call.
And, I'm not sure how to answer the "am I holding the result in JSP" question. I've tried this w/ and w/o an object.remove call, and the API that I'm calling only returns a BOOL. Shouldn't any JSP cleanup any references past that, or do I need to explicitly clean something up I'm not?