on 01-11-2007 4:48 PM
Hi,
I'm trying to create a webservice of an EJB that has JCo code to call an RFC.
The EJB has no syntactical errors. The WebService generation as well as the EAR deployment is successful.
When trying to test the WebService from WebServices Navigator, I'm getting an exception (SOAP response)
"com.sap.engine.services.ejb.exceptions.BaseEJBException" within the (WS) method.
What can be the possible cause for the JCo code that throws this exception when running in an EJB?
I tried the same method from a standalone JCo Client class and it connects the RFC successfully.
Also when the definition of the method is empty with only one statement as return "hai"; then webservice has no errors.
This is my code... only with "mConnection.connect();" throwing the exception
-
import com.sap.mw.jco.*;
public class JCo_Connect extends Object {
JCO.Client mConnection;
JCO.Repository mRepository;
public JCo_Connect() {
try {
// Change the logon information to your own system/user
mConnection =
JCO.createClient("001", // SAP client
"<userid>", // userid
"****", // password
"en", // language
"<hostname>", // application server host name
"00"); // system number
mConnection.connect();
mRepository = new JCO.Repository("SAP", mConnection);
}
catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
}
mConnection.disconnect();
}
public static void main (String args[]) {
JCo_Connect app = new JCo_Connect();
}
}
Any help is highly appreciated.
Thanks in advance.
Regards,
Vijay Kalyan G.
It seems that your code is throwing a runtime exception that you don't catch. So the session bean throws an BaseEJBException.
Try to catch full Exceptions in the EJB code and throw a new EJBException with the full trace, so you can look for the real cause.
try {
<jco code>
} catch (Exception e) {
throw new EJBException(e.getLocalizedMessage(), e);
}
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oops, I have pasted my client code program... with the main() method.
Kindly look into the JCo_Connect() method which is actually causing problem in EJB.
Thanks,
Vijay Kalyan G.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.