cancel
Showing results for 
Search instead for 
Did you mean: 

WS Proxy lookup via JNDI results in java.lang.NoClassDefFoundError

Former Member
0 Kudos

Hello,

I have created and deployed an Web Service Deployable Proxy to the WebAS. There is no problem looking up the proxy via JNDI and calling its methods from a J2EE application - I successfully did this via a servlet.

However, a JNDI lookup from a Web Dynpro application (implemented without Model but referencing Proxy project) - on the same server - results in a java.lang.NoClassDefFoundError error.

A web dynpro view instances a object that calls a method that implemets the following lookup:

public callServices() throws NamingException, ServiceException{

InitialContext ctx = new InitialContext();

ESB_BIW_SYS_DW_TLManagementService service = (ESB_BIW_SYS_DW_TLManagementService) ctx.lookup("java:comp/env/proxy_test");

port = (TLManagementPpt) service.getLogicalPort("__soap_BIW_SYS_DW_TLManagement_TLManagement_ppt", TLManagementPpt.class);

}

Where have I configure "java:comp/env/proxy_test" into WebDynpro Application????

In J2EE application I configure it in web-j2ee-engine.xml:

<web-j2ee-engine>

<server-component-ref>

<description>

</description>

<name>proxy_test</name>

<type>interface</type>

<jndi-name>/wsclients/proxies/sap.com/proxy_test/com.sap.test.proxy.proxy_test</jndi-name>

</server-component-ref>

</web-j2ee-engine>

The code for the JNDI lookup is identical in either case.

Any thoughts?

Accepted Solutions (0)

Answers (5)

Answers (5)

siddharth_jain
Active Contributor
0 Kudos

Hi,

Did you tried to lookup the WS proxy by its Default JNDI name as mentioned in the following thread :

Also make sure that EAR project is deployed if it contains the Deployable proxy reference before making the WS call.

Siddharth

Former Member
0 Kudos

Yes but we cannot edit by hand the application-j2ee-engine.xml of WD in order to add the reference to proxy... In this file there is no references...

We have put the reference into project's "Properties"->"Web Dynprop Sharing References"->"Sharing References...

Cristina

p_2_5_6_9_6_0
Active Participant
0 Kudos

Hi,

In case you have not yet resolved this problem. Here are some things that you need to do prior to using the EJB / WSDL in a WDJ project.

1.) Add the ejb20 to the Web Dynpro Project's "Used DC" section.

2.) Locate the "client" and "ejbjar" for the EJB project (it will be in the Public Parts of the said EJB project). Add both to the Used DCs section of the Web Dynpro Project.

3.) Go to your WDJ project's "Properties"->"Web Dynprop Sharing References"->"Sharing References". Add a New Entry that will be of the form

<vendor>/<software component>~<eap project>

for example

sap.com/appl~myeap

Note that there is no .jar extension to the above eap project. It is not required.

4.) The above eap project will be thee one you attached and deployed for the EJB project you created.

After all this, you will have a trouble free lookup.

There are additional instructions that are performed if you are using a GP process. These I will not include in the post. Let me know if you need them.

Hope that this will help you.

Thanks.

p256960

P.S: Also - please note that the entry for your java:comp/env will be in the ejb-j2ee-engine.xml file of EJB project. It is added directly to your EAP and that's why we use the EAP.

Former Member
0 Kudos

Thaks but our proxy projetc is not an EJB project...

Edited by: CRISTINA SERAFINO on Nov 25, 2008 11:34 AM

Former Member
0 Kudos

We have created a Web service proxy project (Deployable Proxy Project) and a client servlet (Web Module Project). Then we have created Enterprise Application Project...

In web dynpro we want use the created proxy...

Thanks,

regards,

Cristina

siddharth_jain
Active Contributor
0 Kudos

Hi,

Have a look on following thread:

Siddharth

Former Member
0 Kudos

Thanks everybody.

I have added the JAR file of the Proxy to the Dynpro project, under Project properties-> Java Build Path -> Libraries tab -> Add External Jars.

I have referenced proxy project in webdynpro project on Webdynpro project -> Properties -> webdynpro references -> sharing references with the name of the proxy project (proxy_test)

The web dympro starts with initial view, but when I call a method of web service I get the following:

NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/proxy_test. at.....

Thanks,

best regards,

Cristina

Edited by: CRISTINA SERAFINO on Nov 25, 2008 10:19 AM

Former Member
0 Kudos

Hi,

Try giving the reference of Proxy project in webdynpro project.

RightClick on Webdynpro project -> Properties -> webdynpro references -> sharing references.

Regards,

VJR.

Former Member
0 Kudos

Hi Cristina,

To use the classes of the Deployable Proxy, you will need to refer its project in your Web Dynpro project.

-- If you are doing DC development, then you can create public parts of the Deployable proxy project and then add it to the Used DC of ur Web Dynpro DC.

-- If its a local development, add the JAR file of the Proxy to the Dynpro project, under Project properties-> Java Build Path -> Libraries tab -> Add External Jars.

Regards,

Alka.