It was a problem with the deployment descriptor. I had an extra character in the Context factory name.
Here is my current error
In TemplateProvider.locate()
URI: urn:CanDEDataMgr
DD.ServiceClass: org.apache.soap.providers.StatelessEJBProvider
DD.ProviderClass: null
Call.MethodName: isUserValid
Exception caught: java.lang.ClassNotFoundException: com.lilly.javaatg.catd.ejb.CanDEDataMgrHome
Ouch, the call failed:
Fault Code = SOAP-ENV:Server
Fault String = Error in connecting to EJB
The dreaded Class not found. I've seen some messages in the archive that suggest that this is because the soap.jar files do not know about my home and remote interfaces. I'm trying to figure out if this is the correct problem and how to solve it on the Orion app server.
Jonathan Bricker
Lilly Research Labs
Java ATG
| Darius Cooper <[EMAIL PROTECTED]>
04/08/02 01:10 PM
|
To: [EMAIL PROTECTED] cc: Subject: Re: SOAP->EJB example/problem -- Many questions |
Jonathan
It is curious that the error message you get says "iiop://localhost:900",
when it ought to say "ormi://duke1.d51.lilly.com:8088/catd"
>From the message, it is almost certain that the point of failure is the
locate() method of the StatelessEJBProvider.
The snippet of code in the locate() method is:
public void locate(DeploymentDescriptor dd,
Envelope env,
Call call,
String methodName,
String targetObjectURI,
SOAPContext reqContext)
throws org.apache.soap.SOAPException {
HttpServlet servlet = (HttpServlet) reqContext.getProperty(
Constants.BAG_HTTPSERVLET );
HttpSession session = (HttpSession) reqContext.getProperty(
Constants.BAG_HTTPSESSION );
System.err.println( "=============================================" );
System.err.println( "In TemplateProvider.locate()" );
System.err.println( "URI: " + targetObjectURI );
System.err.println( "DD.ServiceClass: " + dd.getServiceClass() );
System.err.println( "DD.ProviderClass: " + dd.getProviderClass() );
System.err.println( "Call.MethodName: " + call.getMethodName() );
this.dd = dd ;
this.envelope = env ;
this.call = call ;
this.methodName = methodName ;
this.targetObjectURI = targetObjectURI ;
this.servlet = servlet ;
this.session = session ;
Hashtable props = dd.getProps();
String ContxtProviderURL = (String) props.get("ContextProviderURL");
String ContxtFactoryName = (String) props.get("FullContextFactoryName");
if ((ContxtProviderURL != null) && (ContxtFactoryName != null))
initialize(ContxtProviderURL, ContxtFactoryName);
else
initialize();
etc.
For some reason, the test ((ContxtProviderURL != null) && (ContxtFactoryName
!= null)) seems to be failing.
Your deployment descriptor looks fine... but that it the place I would
re-check.
Regards,
- Darius Cooper
----- Original Message -----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, April 07, 2002 1:06 PM
Subject: Re: SOAP->EJB example/problem -- Many questions
My EJB is deploying. I wrote a jsp to bring it up so it is deploying in the
app.
Jonathan Bricker
Lilly Research Labs
Java ATG
Brian BBA41 Bannister <[EMAIL PROTECTED]>
04/02/02 07:31 PM
Please respond to soap-user
To: [EMAIL PROTECTED]
cc:
Subject: Re: SOAP->EJB example/problem -- Many questions
Sounds obvious, but are you sure that you are deploying your EJB? I would
write a test harness in Java that runs on your application server to check
that. It looks to me like you can't call the EJB at all, either through EJB
deployment, or maybe you've got your JNDI properties set up incorrectly.
BRICKER_JONATHAN_
[EMAIL PROTECTED] To:
[EMAIL PROTECTED]
cc:
03/04/2002 03:26 Subject: SOAP->EJB
example/problem -- Many questions
Please respond to
soap-user
Hello,
I'm new to SOAP and was trying to tackle setting up a SOAP service to a
Stateless Session Bean. I have a simple method to test this out that takes
2 strings and returns a Boolean. When I run my test client I get the
following error:
In TemplateProvider.locate()
URI: urn:CanDEDataMgr
DD.ServiceClass: org.apache.soap.providers.StatelessEJBProvider
DD.ProviderClass: null
Call.MethodName: isUserValid
Naming Exception caught during InitialContext creation @
iiop://localhost:900
Ouch, the call failed:
Fault Code = SOAP-ENV:Server
Fault String = Unable to initialize context
First question: What does this mean. The next is realted to the first, do
I have to change the localhost:900 to match my servers port that the
service will be running from? If so where do I change it( a small example
would be great).
Here is my deployment descriptor for the service:
<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment" id
="urn:CanDEDataMgr">
<isd:provider type="org.apache.soap.providers.StatelessEJBProvider" scope
="Application" methods="create isUserValid">
<isd:option key="JNDIName" value="java:comp/env/ejb/CanDEDataMgr" />
<isd:option key="FullHomeInterfaceName" value
="com.lilly.javaatg.catd.ejb.CanDEDataMgrHome"/>
<isd:option key="ContextProviderURL" value
="ormi://duke1.d51.lilly.com:8088/catd"/>
<isd:option key="FullContextFactoryName" value
="com.evermain.server.ApplicationInitialContextFactory"/>
</isd:provider>
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListene
r>
</isd:service>
On the methods...Do I have to call the create method? I expose it as per
some examples but do not call it as per the examples.
And my test code:
URL url = new URL("http://foo.bar.lilly.com:8088/soap/servlet/rpcrouter");
// Build the call.
Call call = new Call ();
call.setTargetObjectURI ("urn:CanDEDataMgr");
call.setMethodName ("isUserValid");
Vector params = new Vector ();
params.addElement (new Parameter("userID", String.class, userID,
Constants.NS_URI_SOAP_ENC));
params.addElement (new Parameter("password", String.class, password,
Constants.NS_URI_SOAP_ENC));
call.setParams (params);
// make the call: note that the action URI is empty because the
// XML-SOAP rpc router does not need this. This may change in the
// future.
Response resp = call.invoke (/* router URL */ url, /* actionURI */ ""
);
// Check the response.
if (resp.generatedFault ()) {
Fault fault = resp.getFault ();
System.out.println ("Ouch, the call failed: ");
System.out.println (" Fault Code = " + fault.getFaultCode ());
System.out.println (" Fault String = " + fault.getFaultString ());
} else {
Parameter result = resp.getReturnValue ();
System.out.println ( "result ="+result.toString() );
System.out.println ( "Done" );
And the method call in the SSB:
public boolean isUserValid(String userID, String password) throws
CanDEException {
String encryptedPassword = null;
String userPasswd = null;
try {
UserVO user = getUser(userID);
encryptedPassword = pesEncrypt(null, password);
userPasswd = user.getPassword();
}catch( RemoteException rex) {
if(Log.isOn()) {Log.log("ejb.CanDEDataMgrBean", ".isUserValid
(): RemoteException on isUserValid", rex); }
throw new CanDEException("Error in
lisUserValid",rex);
}
if(userPasswd.equals(encryptedPassword)){
return true;
} else {
return false;
}
}
Jonathan Bricker
Lilly Research Labs
Java ATG
Qantas
