Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Accessing EJB from Remote WebApp using JNDI

Hi,

Here is my problem
==============

My target is to
------
1. Deploy EJBs onto - Server1 as .jar
2. Deploy WEB-APP onto - Server2 as .war
3. When i request a WEB-APP (which is in server2), it should able to access EJBs on server1.

My status
---
1. Deployed EJBs jar onto the server1
2. Generated Client version for EJBs using command (java weblogic.appc -output <outputclient.jar> <inputejbs.jar> ) for EJB stubs
3. By placing the client.jar ( client . jar ) into the LIB folder of WEB-APP create .war file again and deployed it into the server2

Errors
---
After the above steps. I try to execute the WebApp. It is exiting the execution with an exception... "NameingException", When it is about to access EjbHome. It is not able to find the specified class.

I have kept client.jar in LIB folder of WEB-APP
I have kept client.jar in classpath of the local system
I have kept client.jar in setEnv.cmd to load at startup of weblogic.

Questions
---
I have kept the client.jar in all the places. Why it is not able to access EjbHome ?
Even after acceing EjbHome, it wil look for JNDI. How can I show the path to server1's JNDI name from server2?
Is JMS is useful to do this ?
In JBoss App. there is a possbility to specify remote remote reference in property file. How to give the remore EJB refere in weblogic?

I should not edit the code. Code is alreday compiled. Now using DDs and other environment settings. I should do it.

The app alreday developed in JBoss. In JBoss using jndi.properties file. They have mentioned JNDI properties like this..

### JBossNS propertiesjava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://sgcsgsupts01.csminc.com:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

And they kept the file at WEB APP's WEB-INF > classes folder

But similary how to do it in WebLogic ?

Waiting for your response.

Regards,

- Siva Prasad
[2143 byte] By [nnv_sivaprasad] at [2007-11-11 10:09:32]