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

Error using a standalone ws proxy

Hi there,

I'm trying to create a client application which calls a webservice but I'm getting an error during the client run.

So Here is what I've done:

- Created /Deployed a WebServcie (running correctly)

- Created a Standalone Web Service Proxy.

- Deployed the Standalone WSProxy

- Included the Jar (from the generated Proxy) into my client app

- Added the created bin files from the proxy to the client app

- Added all classpath variables to my client project (I got from the proxy project)

- Trying to run the WS test client

Getting follwing error message:

=============================

Exception in thread "main" java.lang.NoClassDefFoundError: com/dcx/mcg/itp/aa/projects/eeim/proxy/EEIMDataServiceImpl

C:\workspace\eeim\bin>java com.TestWS

Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.SessionProtocol

] could not be loaded (NoClassDefFoundError) !

Error Message is :com/sap/engine/interfaces/webservices/client/ClientFeatureProvider

Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtoc

ol] could not be loaded (NoClassDefFoundError) !

Error Message is :com/sap/engine/interfaces/webservices/client/ClientFeatureProvider

Warning ! Protocol Implementation [com.sap.security.core.client.ws.SecurityProtocol] could not be loaded (ClassNotFound)

!

Error Message is :com.sap.security.core.client.ws.SecurityProtocol

Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.SoapHeadersProt

ocol] could not be loaded (NoClassDefFoundError) !

Error Message is :com/sap/engine/interfaces/webservices/client/ClientFeatureProvider

Exception in thread "main" java.lang.NoClassDefFoundError: com/sap/engine/interfaces/webservices/runtime/component/Compo

nentInstantiationException

at com.sap.engine.services.webservices.jaxrpc.wsdl2java.ServiceBase.getLPFactory(ServiceBase.java:51)

at com.sap.engine.services.webservices.jaxrpc.wsdl2java.ServiceBase.init(ServiceBase.java:78)

at com.dcx.mcg.itp.aa.projects.eeim.proxy.EEIMDataServiceImpl.<init>(EEIMDataServiceImpl.java:11)

at com.TestWS.main(TestWS.java:34)

=============================

What am I doing wrong?

Why can't the libraries be loaded?

Regards

Daniel

Add a comment
10|10000 characters needed characters exceeded

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 01, 2005 at 09:58 AM

    HI,

    thanks for your answer.

    Are you sure?

    Here are my eclipse classpath settings:

    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
        <classpathentry kind="src" path="src"/>
        <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP-JEE/DCs/sap.com/IAIKSecurity/_comp/gen/default/public/default/lib/java/iaik_jce_export.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP-JEE/DCs/sap.com/IAIKSecurity/_comp/gen/default/public/default/lib/java/iaik_jsse.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP-JEE/DCs/sap.com/IAIKSecurity/_comp/gen/default/public/default/lib/java/iaik_smime.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP-JEE/DCs/sap.com/IAIKSecurity/_comp/gen/default/public/default/lib/java/iaik_ssl.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP-JEE/DCs/sap.com/IAIKSecurity/_comp/gen/default/public/default/lib/java/w3c_http.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP-JEE/DCs/sap.com/activation/_comp/gen/default/public/default/lib/java/activation.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP-JEE/DCs/sap.com/com.sap.exception/_comp/gen/default/public/default/lib/java/exception.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP-JEE/DCs/sap.com/mail/_comp/gen/default/public/default/lib/java/mail.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP-JEE/DCs/sap.com/sapxmltoolkit/_comp/gen/default/public/default/lib/java/sapxmltoolkit.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP_JTECHS/DCs/sap.com/webservices/_comp/gen/default/public/default/lib/java/jaxm-api.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP_JTECHS/DCs/sap.com/webservices/_comp/gen/default/public/default/lib/java/jaxrpc-api.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP_JTECHS/DCs/sap.com/webservices/_comp/gen/default/public/default/lib/java/saaj-api.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP_JTECHS/DCs/sap.com/webservices/_comp/gen/default/public/default/lib/java/sapxmltoolkit.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP_JTECHS/DCs/sap.com/webservices/_comp/gen/default/public/default/lib/java/webservices_api.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP-JEE/DCs/sap.com/webservices_lib/_comp/gen/default/public/default/lib/java/boot.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP-JEE/DCs/sap.com/webservices_lib/_comp/gen/default/public/default/lib/java/iq-lib.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP-JEE/DCs/sap.com/webservices_lib/_comp/gen/default/public/default/lib/java/tc_sec_wssec_lib.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP-JEE/DCs/sap.com/webservices_lib/_comp/gen/default/public/default/lib/java/util.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_SYSTEM_ADD_LIBS/comp/SAP-JEE/DCs/sap.com/webservices_lib/_comp/gen/default/public/default/lib/java/webservices_lib.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_LOGGING_LIB_HOME/lib/logging.jar"/>
        <classpathentry exported="true" kind="var" path="SAP_LOGGING_LIB_HOME/lib/loggingStandard.jar"/>
        <classpathentry exported="true" kind="lib" path="/EEIMSProxy/EEIMSProxyClientAPI.jar"/>
        <classpathentry kind="output" path="bin"/>
    </classpath>

    Following additional libraries are loaded in my lib/ext directory (

    C:j2sdk1.4.2_07jrelibext

    ):

        activation.jar
        axis-ant.jar
        axis.jar
        com.ibm.mq.jar
        com.ibm.mq.pcf.jar
        com.ibm.mqbind.jar
        com.ibm.mqjms.jar
        commons-discovery-0.2.jar
        commons-logging-1.0.4.jar
        compilation_lib.jar
        connector.jar
        connector1.0.jar
        dnsns.jar
        ejb20.jar
        exception.jar
        fscontext.jar
        guidgenerator.jar
        idl.jar
        j2ee.jar
        jaas.jar
        jARM.jar
        jaxm-api.jar
        jaxm.jar
        jaxrpc-api.jar
        jaxrpc.jar
        jcert.jar
        jdbc20.jar
        jdom.jar
        jms.jar
        jndi.jar
        jnet.jar
        jperflib.jar
        jsse.jar
        jta.jar
        jts.jar
        junit.jar
        ldap.jar
        ldapsec.jar
        localedata.jar
        log4j-1.2.8.jar
        log4j.properties
        logging.jar
        log_api.jar
        mail.jar
        postcard.jar
        providerutil.jar
        rmm.jar
        saaj-api.jar
        saaj.jar
        sapj2eeclient.jar
        sapjco.jar
        sapni.jar
        sapxmltoolkit.jar
        servlet.jar
        sunjce_provider.jar
        webservices_lib.jar
        wsdl4j-1.5.1.jar
        xerces.jar

    Do you still think it depends on the classpath?

    I can also import files like:

    com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.SessionProtocol

    so there shouldn't be a classpath prob I guess.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 01, 2005 at 09:49 AM

    Hi Daniel,

    This is surely a classpath problem, check again that all

    Library(.jar's) files are in classpath.

    Regards,

    Narinder Hartala

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 01, 2005 at 09:51 AM

    My code of the client app:

    import java.rmi.RemoteException;
    
    import javax.xml.rpc.ServiceException;
    
    import com.dcx.mcg.itp.aa.projects.eeim.proxy.EEIMDataService;
    import com.dcx.mcg.itp.aa.projects.eeim.proxy.EEIMDataServiceImpl;
    import com.dcx.mcg.itp.aa.projects.eeim.proxy.EEIMDataServiceViDocument;
    
    public class TestWS
    {
    
    	public static void main(String[] args)
    	{
    
    
    
    		try
    		{
    			EEIMDataService service = new EEIMDataServiceImpl();				
    			EEIMDataServiceViDocument port = 
    				(EEIMDataServiceViDocument) 
    				service.getLogicalPort("EEIMDataServiceConfPort_Document",EEIMDataServiceViDocument.class);
    			
    			String result = port.sayHello();
    							
    			System.out.println( "result  [.echoString]:" +result);
    		}
    		catch (RemoteException e)
    		{
    			e.printStackTrace();
    		}
    		catch (ServiceException e)
    		{
    			e.printStackTrace();
    		}
    		catch (Exception e)
    		{
    			e.printStackTrace();
    		}
    	}
    }

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 01, 2005 at 01:26 PM

    Still get the same error...

    Got all required files in my classpath (wouldn't be able to build the project without them).

    Still don't understand it.

    Thanks for the try.

    I really hope someone can help me out.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 01, 2005 at 02:39 PM

    Yes...

    It is working now.

    And?

    Yes you have been right all the time.

    The problem is: A single reference in the classpath is not sufficiently. After putting all files into my lib/ext directory it was working.

    Thanks again.

    Regards

    Daniel

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 01, 2005 at 02:44 PM

    Hi Daniel,

    What do you mean by "deployed the Standalone Proxy"?

    Standalone proxies are meant to be used in standalone applications, i.e. applications that do not run on the engine.

    If you need to deploy a WS Client Proxy on the engine you have to use a Deployable Proxy for that purpose.

    If you want to use a proxy, the steps you should follow are:

    1. Generate the proxy

    2. Go to the WS Perspective, the appropriate explorer view where the application that will use the proxy is. For standalone proxies this is the Java Explorer.

    3. Right click and select "Add Client API" and select the WS Proxy project in the popup - this will add classpath references to all required JAR files

    After this you should not receive any further classpath problems.

    More information how to work with WS Proxies can be found in the development manual:

    For standalone proxies:

    http://help.sap.com/saphelp_nw04/helpdata/en/77/1484b9ecb98c41af4a01131d8d46d3/frameset.htm

    For deployable proxies:

    http://help.sap.com/saphelp_nw04/helpdata/en/2d/b9766df88f4a24967dae38cb672fe1/frameset.htm

    Best regards,

    Alexander

    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.