Hi all,

I don't know what the heck happened..but I was able to get the object..now I
can't. Here is what I changed. First, I had a servlet that did a jndi lookup
like so:

Context context = new InitialContext();
Object obj = context.lookup("java:comp/enb/ejb/Login");
LoginHome lh = (LoginHome) PortableRemoteObject.narrow(obj,
LoginHome.class);
Login login = lh.create();
login.login("name","password");

The web.xml had the <ejb-ref> tag in it to use the com.company.ejb.Login and
so on classes. I recently changed my package structure to be
com.company.ejb.session.login, com.company.ejb.entity.* etc. I jarred up the
EJB and I see Orion is deploying it, and I checked all sources to make sure
their package statement is set to the correct package name, and so on. I
changed the <ejb-ref> tag in the web.xml descriptor as well to point to the
added two levels of packaging. For some reason, I am now getting a
NamingException thrown.

I saw that someone posted they finally figured out that apparently Orion
doesn't place objects in the java:comp/env/ejb but instead in just java: for
the jndi lookup. Is this the case? Or is there some setting somewhere that
specifically dictates what context all EJBs are put into by Orion?

Also, I am reading in this EJB book that supposedly the lookup location is
different for every vendor? How can this be if supposedly you can package
your EJB into any vendor app server with no changes? Now..from the looks of
it the code they are referring to is on the client side, but that would also
suck if the client side app had to know the specific vendor being used for
the ejb server. Supposedly you need to do a Properties properties = new
Properties(), then add in a few properties for each vendor. However, I am
unclear what specifically that is about.

Anyways..if anyone knows why this might be happening now..when all I changed
was the package name of the ejb classes, that would be great. Oh..I did try
to reference another EJB from my Login ejb, using JNDI in there..but the
first ejb (Login) isn't even being found by my servlet this time around..and
I can't see anything other than web.xml and the name of the classes that are
changed..so why it wouldn't show up is beyond me.

Thanks.



Reply via email to