I'll ask the question a different way.
My objective is to deploy Axis in it's own dedicated VM/servlet container and have it talk to an EJB deployment in seperate VM/EJB container. My reason for doing this is to improve scalability. Axis consumes a large amount of memory under load and I'd like to distribute this to another physical tier.
My question is, can this be accomplished without writing any code. Is Axis capable of talking to a remote EJB container? This may be a question that belongs in the Axis lists but I thought I would try here as well.
I've never done this, but I think this is actually pretty easy.
Look at the web-service.xml file that is in your .wsr file. It'll have a line such as this:
That "value" is the JNDI name. In this case, it's the local name, but I don't see any reason it couldn't work with the remote name.
I believe the line you are referring to is:
I tried pointing jndiURL to a remote Jboss deployment running the same components. It appears to have worked. I have two identical jboss deployments with one exception, the web services on box 1 are redirected to box 2.
WS client ==> Jboss Web Services (box 1) ==> Jboss EJBs (box 2)
Next task will be to get a clean deployment on box 1 that is hosting web services only and no ejb components.
Thanks for your reply.
XML seems to get stripped on posts. That line is:
parameter name="jndiURL" value="jnp://localhost:1099"
Actually, this does not work.
It appeared to work because I started with a full WS/EJB deployment on box 1 and the jndi lookups would work apparently still going against the local container.
Once I trimmed the deployment on box 1 down to WS only I get javax.naming.NameNotFoundExceptions on the WS client side. Simply specifying a different jndiURL in the web-service.xml file is not sufficient to get Axis to point to a different box for EJB calls.
I'll keep looking for a working solution.
Hmm.. I'm not sure any solution without the client-side EJB components will work for you. I understand your desire for tiers, but why not have the client-side EJB stubs running in your Axis tier?
All of the required classes do reside on the WS only tier. They are in the same ear as the wsr just simply not deployed as EJB components.
The classes seem to load ok. If I don't include the classes in the WS ear deployment I get ClassNotFoundExceptions before an attempt to lookup the EJB.
Is that what you mean by client-side stubs running in the Axis only tier?
I've also tried making changes to jndi.properties to point to the EJB tier instead of local. That did not work. Also tried updating the JNDI section in jboss-service.xml to bind to the EJB tier; this caused other problems at startup and the EJB lookups still failed.
I looked at the EJBProvider source code from JBoss and Axis. Looks like they are doing a new InitialContext() before the lookup. The JNDI properties must be coming from an external source. I've tried the obvious and it doesn't appear to work.
I haven't actually messed much with jndi.properties (on my one try, I didn't get it to work either). You may want to ask on one of the other forums.
The only question I can think of is "are you modifying the jndi.properties in jboss-net?"