Skip to Content

Web Dynpro | EJB | JNDI lookup

Hi Folks,

I've written a Sales Order application that uses an ejb to communicate with a R/3 system over JCO. Initially, I used a J2EE Web module for the presentation layer. Within this Web module a proxy class calls the ejb using JNDI. Everything works fine.

Now, I want to implement a Web Dynpro presentation layer. I used the following sdn post to do the implementation: accessing-session-bean

My code looks somethine like this:

**Code Start***

InitialContext ctx = new InitialContext();

Object obj = ctx.lookup("sap.com/SalesOrderEar/SalesOrderBean");

SalesOrderHome home = (SalesOrderHome) PortableRemoteObject.narrow(obj, SalesOrderHome.class);

//Initialize the enterprise bean

so = home.create();

**Code End***

Unfortunately, I am facing some JNDI lookup problems. When I call the Web Dynpro application I get a pop-up window with the following error message:

**Error Start***

An error has occurred:

"Failed to process the request."

Error stacktrace:

java.lang.NoClassDefFoundError: com.elvez.salesorder.SalesOrderHome

at com.elvez.wd.salesorder.beans.SalesOrderProxy.init(SalesOrderProxy.java:34)

at com.elvez.wd.salesorder.beans.SalesOrderProxy.<init>(SalesOrderProxy.java:43)

at com.elvez.wd.salesorder.SalesOrderResultView.onPlugFromSearchView(SalesOrderResultView.java:155)

at com.elvez.wd.salesorder.wdp.InternalSalesOrderResultView.wdInvokeEventHandler(InternalSalesOrderResultView.java:137)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.navigate(ClientApplication.java:768)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:350)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:635)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)

at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:249)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)

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

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

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

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

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

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

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

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

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

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

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:162)

**Error End***

Any help is appreciated.

Thank YOU!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 17, 2005 at 11:16 AM

    Hi Elvez,

    did you add the Sharing Reference to "sap.com/SalesOrderEar" to the Web Dynpro References like described in the posting?

    Right click on project node->Properties->Web Dynpro References, Tab Sharing Reference.

    Hope that helps.

    Regards

    Stefan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 17, 2005 at 11:20 AM

    Hi Elvez,

    Have you added all the needed references as described some posts above the one you mentioned:

    accessing-session-bean

    Best regards,

    Vladimir

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 17, 2005 at 11:30 AM

    Hi Elvez,

    Did you specify Project reference in the property of the webdynpro application or whether did you add jar file of EJB in webdynpro application.

    If not then add JAR file or add project reference under Java build path in the property of the webdynpro application.

    It will help You.

    If it works fine the rewards it and close the thread.

    Regards,

    Bhavik

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 17, 2005 at 12:17 PM

    I forgot to check my spelling when writing the SharingReference!

    Thanks

    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.