This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Remote EJB3.0 access from Spring

 
Nitin Gaur
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 2 applications - one EAR containing EJB3.0 and other its Spring client. Both deployed on same Websphere app server 7 instance i.e. same JVM.

Here are couple of client parts:

applicationContext.xml:



Client code snippet:



This works fine. EJB access deployed in other application in same container, works.

But it does not work if I move that client to other machine in same network and just change provider URL and give remote server IP instead of localhost. JNDI lookup problem occurs

Exact Error: Error 500: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ruleService' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Context: CFSDDVM2399Node01Cell/nodes/CFSDDVM2399Node01/servers/server1, name: com.ecrd.ruleservice.Customer_Management_Service_JavaBusiness: First component in name com.ecrd.ruleservice.Customer_Management_Service_JavaBusiness not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDLmg.org/CosNaming/NamingContext/NotFound:1.0]

I can't figure out what changes (and where) are required to connect to EJB hosted in different server JVM. Any help or suggestion are welcome.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have to look at the WebSphere docs to figure out the jndi properties that need to be set for accessing the JNDI Tree in Websphere. So this is a WebSphere question. Meaning if you weren't using Spring, you would still have this issue.

I am going to move this to WebSphere and let them help you because they are the experts on WebSphere.

Good Luck

Mark
 
Nitin Gaur
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Error is resolved. I work on virtual machine. All developer images were copied from a particular VM and that brought over WAS configs (hostname, cell, node etc) with it. Remote access worked after fixing all occurances of hostnames in serverindex.xml of the server hosting EJB.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic