on 11-24-2008 3:26 PM
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Hi,
Try giving the reference of Proxy project in webdynpro project.
RightClick on Webdynpro project -> Properties -> webdynpro references -> sharing references.
Regards,
VJR.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.