You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ns...@agl.com.au on 2003/09/25 06:04:01 UTC

axis, oc4j and a local stateless EJB

Hi,

I'm trying to make a local stateless session EJB available as a web service
through axis and would appreciate any help.

I'm using oc4j903, axis1.1.

I've packaged the axis war and the ejb jar in an ear file and successfully
deployed it to the container. I have successfully accessed the EJB from a
remote client.

I linked axis with the ejb using the following WSDD file:

<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java
="http://xml.apache.org/axis/wsdd/providers/java">
    <service name="ServiceEngine" provider="java:EJB">
        <parameter name="beanJndiName" value="local/ServiceEngineEJB"/>
        <parameter name="homeInterfaceName" value
="application.solo.serviceengine.session.ServiceEngineLocalHome"/>
        <parameter name="remoteInterfaceName" value
="application.solo.serviceengine.session.ServiceEngine"/>
        <parameter name="className" value
="application.solo.serviceengine.session.ServiceEngineEJB"/>
        <parameter name="allowedMethods" value="*"/>
        <parameter name="jndiURL" value
="ormi://localhost:23791/serviceengine"/>
        <parameter name="jndiContextClass" value
="com.evermind.server.ApplicationClientInitialContextFactory"/>
    </service>
</deployment>

I can see my EJB as a service in axis and I can autogenerate the wsdl file.
But when I try and run the autogenerated Junit test from axis-wsdl2java, it
complains that:

                                                                                                                                
                                                                                                                                
   javax.naming.NamingException: META-INF/application-client.xml resource not found (see J2EE spec, application-client chapter  
   for requirements and format of the file)                                                                                     
                                                                                                                                
   AxisFault                                                                                                                    
   faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException                                                   
   faultSubcode:                                                                                                                
   faultString: javax.naming.NamingException: META-INF/application-client.xml resource not found (see J2EE spec,                
   application-client chapter for requirements and format of the file)                                                          
   faultActor:                                                                                                                  
   faultNode:                                                                                                                   
   faultDetail:                                                                                                                 
   {http://xml.apache.org/axis/}stackTrace: AxisFault                                                                           
   faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException                                                   
   faultSubcode:                                                                                                                
   faultString: javax.naming.NamingException: META-INF/application-client.xml resource not found (see J2EE spec,                
   application-client chapter for requirements and format of the file)                                                          
   faultActor:                                                                                                                  
   faultNode:                                                                                                                   
   faultDetail:                                                                                                                 
                                                                                                                                
                                                                                                                                



I also tried it using the RMIInitialContextFactory as the jndiContextClass
in the WSDD but it complained about an AuthenticationException. this is ok
because I did not privide an admin username or password. Plus, I don''t
really want to use RMI to access a local ejb.


Any thoughts or ideas? I would appreciate any help any help you can
provide.

Cheers,
Nim

Cheers,
Nim




**********************************************************************
This  email  is  intended  solely  for the use of the addressee
and may contain information that is confidential or privileged.
If you receive this email in error please notify the sender and
delete the email immediately.
**********************************************************************


Re: axis, oc4j and a local stateless EJB

Posted by Jens Schumann <je...@void.fm>.
On 9/25/03 06:04 AM Nsathiamoorthy@agl.com.au <Ns...@agl.com.au>
wrote:

> Hi,
> 
> I'm trying to make a local stateless session EJB available as a web service
> through axis and would appreciate any help.
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java
> ="http://xml.apache.org/axis/wsdd/providers/java">
>   <service name="ServiceEngine" provider="java:EJB">
>       <parameter name="beanJndiName" value="local/ServiceEngineEJB"/>
>       <parameter name="homeInterfaceName" value
> ="application.solo.serviceengine.session.ServiceEngineLocalHome"/>
>       <parameter name="remoteInterfaceName" value
> ="application.solo.serviceengine.session.ServiceEngine"/>
>       <parameter name="className" value
> ="application.solo.serviceengine.session.ServiceEngineEJB"/>
>       <parameter name="allowedMethods" value="*"/>
>       <parameter name="jndiURL" value
> ="ormi://localhost:23791/serviceengine"/>
>       <parameter name="jndiContextClass" value
> ="com.evermind.server.ApplicationClientInitialContextFactory"/>
>   </service>
> </deployment>


The problem are your JNDI Properties. You use application client properties
(which usually do not reside in the same VM as the EJB itself).

You could either

A) Don't provide jndi properties, this way the VM properties (which are set
by the app server anyway) should be used.

B) Use the correct JNDI Context Factory Class. Don't know out of my head
which class should be used, but it wasn't
ApplicationClientInitialContextFactory for sure.

Jens