Showing results for 
Search instead for 
Did you mean: 

java.lang.NoClassDefFoundError: com/sapportals/portal/prt/service/IService

Former Member
0 Kudos

I am trying to Call a dc Portal Service from within a Web Dynpro DC

following the steps I did,

1. Created a DC "Portal Application Standalone" project by the name myservice.

2. Created a portal service inside myservice by the name TestService.

3. Exposed ITestService.class in the public part.

4 Build and deployed the DC on server and tested it through an abstract portal component and it worked FINE !!


5. Created anoter DC of type WebDynPro

6. Added SAP_JTECHS -> epbc.prtapi._api as a "Used DC" with dependency build time and runtime

7. Added ITestService.class from the public part of portal Service as Used DC

8. Tried to reference the service using the following code..

ITestService portalservice=(ITestService)WDPortalUtils.getServiceReference(ITestService.KEY);

9.Build and deployed the DC.

10. When I run the application I am getting the following error

Processing HTTP request to servlet [dispatcher] finished with error.

The error is:

The initial exception that caused the request to fail, was:

java.lang.NoClassDefFoundError: com/sapportals/portal/prt/service/IService -

Loader Info -

ClassLoader name: [] Parent loader name: [Frame ClassLoader] References: common:service:http;service:servlet_jsp service:ejb common:service:iiop;service:naming;service:p4;service:ts service:jmsconnector library:jsse library:servlet common:library:IAIKSecurity;library:activation;library:mail;library:tcsecssl library:ejb20 library:j2eeca library:jms library:opensql;;library:security.class;library:webservices_lib;service:adminadapter;service:basicadmin;;service:configuration;service:connector;service:dbpool;service:deploy;service:jmx;service:jmx_notification;service:keystore;service:security;service:userstore interface:resourcecontext_api interface:webservices interface:ejbserialization service:webdynpro service:sld library:tcddicddicservices library:tcgraphicsigs library:sapxmltoolkit library:tcddicddicruntime library:tccolapi library:tccmi library:tccolruntime Resources: F:\usr\sap\RCP\JC00\j2ee\cluster\server0\apps\\pocserviceproject\webdynpro\public\lib\sap.comserviceprojecttest.jar F:\usr\sap\RCP\JC00\j2ee\cluster\server0\apps\\pocserviceproject\webdynpro\public\lib\sap.comserviceproject~testservice.jar F:\usr\sap\RCP\JC00\j2ee\cluster\server0\apps\\pocserviceproject\src\java\ F:\usr\sap\RCP\JC00\j2ee\cluster\server0\apps\\pocserviceproject\webdynpro\public\lib\app.jar Loading model: {parent,references,local} -

The error occurred while trying to load "com.test.poc.service.ITestService".


Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Rajit,

In DC based developments one can make use of use dc functionilaty and add "prtapi.jar" by adding epbc.prtapi._api (inside SAP-J2EE) which is provided by SAP by default. After adding this the dc component gets builed & deployed without any errors but once I run the component I get this runtime error " java.lang.NoClassDefFoundError: com/sapportals/portal/prt/service/IService" Please let me know if there is any other way out.

Thanks and Regards,


Former Member
0 Kudos

Hi Umesh,

Try declaring a runtime reference for the service you are using in the project properties.

Please explore the options:

Project properties -> WebDynpro References -> Service References & Sharing References

For ex:In my application, i use KM functionality.Even though Ive KM jars in the classpath (as external lib DCs), I mentioned a runtime reference in "Sharing References" as

Similarly, I remember seeing somewhere mentioning the service you're trying to access as a Service Reference in the DC properties.

something like:

A common portal service that is used in WebDynpro DCs is URLGenerator service. Probably if you search on it, you might find a clue.


Rajit Srinivas

Former Member
0 Kudos

Hi Umesh,

It seems you need to have prtapi.jar in the webdynpro DC's classpath which contains the IService class. Try to create a External Library DC with prtapi.jar and declare a dependency for this dc in WebDynpro DC.

Hope that helps,


Rajit Srinivas