Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JNDI - Lookup Problem  RSS feed

 
Kris Reid
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Guys

Still battling along getting this application to work: http://www.coderanch.com/t/317865/EJB-JEE/java/InitialContext

But now I have a new problem. I never solved the last problem but couldn't afford to spend any more time on it so I moved the EJB I couldn't connect to from the weblogic server, so it is local on the same Sun App Server.

I can now connect from my EJB to this other EJB fine. But it throws an error when connect to a JDBC resource. I Decompiled the class file and found the line of code. I then replicated then problem.

After that long winded intro here is the problem



The commented out line works perfect and the bottom doesn't work. However the bottom line is what is in the EJB and I can't recompile it. What can I do to make it work? Hopefully I can configure something in the server. I don't really understand why it doesn't work.

Thanks guys you've been a great help over the past week or so

Kris
 
Kris Reid
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you think it has something to do with the InitialContext being different on Weblogic and Sun App Server? Such as there directory location

e.g. The Sun App Server you don't need at add "java:comp/env/"
[ March 21, 2006: Message edited by: Kris Reid ]
 
Andreas Schaefer
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any JNDI name starting with "java:comp/env" means that the ejb-jar.xml contains a EJB-Ref or Resource-Ref entry that is then pointing to the actual target. The "java:comp" JDNI namespace is private to the EJB and therefore the same name can appear in different EJBs pointing to different objects.
Please make sure that you have a Resource-Ref set up correctly in the Sun's app. server when using the "java:comp/env" JNDI name.

-Andy
 
Kris Reid
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Andy - you're a CHAMP!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!