cancel
Showing results for 
Search instead for 
Did you mean: 

Error using a standalone ws proxy

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Daniel,

According to my knowledge, we can only import those classes which either itself or JAR file containing them are in classpath.

Regards,

Narinder Hartala

Answers (5)

Answers (5)

zubev
Employee
Employee
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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();
		}
	}
}

Former Member
0 Kudos

Hi Daniel,

This is surely a classpath problem, check again that all

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

Regards,

Narinder Hartala