Skip to Content
author's profile photo Former Member
Former Member

Accessing BAPI using EJB.

Hi,

i am not able to access the BAPI using EJB. I have written the code for accessing the BAPI inside the a business method in Bean.

Though the same peice of code works fine if i make a simple class file.

Can any one help me out in this case to resolve the problem

I ma getting the following exception :

Remote Exception java.rmi.RemoteException: com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception thrown by the com.lti.rfc.TestingRfcObjectImpl0.createPartner(java.lang.String,java.lang.String) method.

at com.lti.rfc.TestingRfcObjectImpl0.createPartner(TestingRfcObjectImpl0.java:152)

at com.lti.rfc.TestingRfc_Stub.createPartner(TestingRfc_Stub.java:55)

at com.lti.rfcClient.RfcTesting.doGet(RfcTesting.java:34)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:373)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:250)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:319)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:297)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:696)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:221)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:146)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)

at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:140)

Caused by: java.lang.NoClassDefFoundError

at com.lti.rfc.rfcClass.callRfc(rfcClass.java:30)

at com.lti.rfc.TestingRfcBean.createPartner(TestingRfcBean.java:48)

at com.lti.rfc.TestingRfcObjectImpl0.createPartner(TestingRfcObjectImpl0.java:135)

... 18 more

; nested exception is:

java.lang.NoClassDefFoundError

Thanks in advance

Alok Sahu

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Jan 10, 2005 at 06:21 PM

    Hi,

    according to the stack trace logged by the EJB Container, the createPartner(java.lang.String,java.lang.String) business method of the bean has thrown java.lang.NoClassDefFoundError when calling the RFC. Probably this is a class loader problem, e.g. the parameters classes that are passed during the RFC call are not loaded with the proper class loader.

    It will be helpful to check exactly which class causes the problem and which class loader has loaded it.

    I hope this will help you.

    Regards,

    Svetoslav

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 24, 2005 at 11:48 AM

    Hi David,

    You need to create the JCO Client connection to call BAPI from Java Class.You can store the logon properties in a properties file,XML file or in Database and try using them.

    Regards,

    Uma.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 27, 2005 at 06:26 PM

    Hi Alok,

    Did you try Svetoslav's tips? Do you still get the NoClassDefFoundError? If yes, another reason could be that your EJB application is missing some classloader references. Is the com.lti.rfc.rfcClass part of the application or is it located in some external library? Did you check what exactly is done on line 30 of this class? It would also be helpful if you provided the code from the callRfc() method.

    Best regards,

    Vladimir

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.