cancel
Showing results for 
Search instead for 
Did you mean: 

NoClassDefFoundError

Former Member
0 Kudos

Hi All,

I have developed a custom Portal component. Getting the below error.

I have already added the JAR com.sap.portal.pcd.roleservice_core to the classpath. Please if someone can suggest what is missing.

java.lang.NoClassDefFoundError: com/sapportals/portal/pcd/pcm/roles/AbstractPortalRoleServiceContext

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:221)

at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.getInstanceInternal(PortalComponentItemFacade.java:228)

at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.getComponentInstance(PortalComponentItemFacade.java:160)

at com.sapportals.portal.prt.core.broker.PortalComponentItem.getComponentInstance(PortalComponentItem.java:732)

at com.sapportals.portal.prt.component.PortalComponentContext.getComponent(PortalComponentContext.java:103)

at com.sapportals.portal.prt.component.PortalComponentContext.init(PortalComponentContext.java:242)

at com.sapportals.portal.prt.core.broker.PortalComponentContextItem.refresh(PortalComponentContextItem.java:271)

at com.sapportals.portal.prt.core.broker.PortalComponentContextItem.getContext(PortalComponentContextItem.java:316)

at com.sapportals.portal.prt.component.PortalComponentRequest.getComponentContext(PortalComponentRequest.java:387)

at com.sapportals.portal.prt.connection.PortalRequest.getRootContext(PortalRequest.java:488)

at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:607)

at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)

at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:556)

at java.security.AccessController.doPrivileged(Native Method)

at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:423)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1060)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)

Caused by: java.lang.ClassNotFoundException: com.sapportals.portal.pcd.pcm.roles.AbstractPortalRoleServiceContext

Found in negative cache

------------------------- Loader Info -------------------------

ClassLoader name: [com.sapportals.portal.prt.util.ApplicationClassLoader@84c9bf8]

Parent loader name: [com.sapportals.portal.prt.util.ApplicationClassLoader@1d38fc8d]

References:

   not registered!

Thanks,

Nikhil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nikhil,

When you add the JAR to the Classpath you are only providing a so-called design time reference so that the IDE (eclipse) can build your project. When you actually run the code (on the server) it also needs to be able to resolve the class and you do that by telling it in the portalapp.xml that it needs to reference the class at runtime.

In the portalapp.xml you will see a SharingReferences area where you can specify runtime references. This is where you need to provide the reference for this Role Service you want to use. In this case I think you would need to reference com.sap.portal.pcd.roleservice_core

Here is more info on the SharingReferences property:


http://help.sap.com/saphelp_nw73/helpdata/en/49/d822aa79cf0e80e10000000a42189b/frameset.htm

Hope this helps,

Simon

Former Member
0 Kudos

Thanks Simon.

I have added the reference com.sap.portal.pcd.roleservice.

Portalapp.xml looks as follows.

<?xml version="1.0" encoding="UTF-8"?>

<application>

  <application-config>

    <property name="startup" value="true"/>

    <property name="SharingReference" value="com.sap.portal.pcd.roleservice,htmlb,com.sap.portal.pcd.glservice,com.sap.portal.pcmbuilderservice,usermanagement"/>

    <property name="ServicesReference" value="com.sap.portal.ivs.api_iview, com.sap.portal.ivs.api_landscape"/>

  </application-config>

  <components>

    <component name="test">

      <component-config>

        <property name="ClassName" value="test"/>

      </component-config>

      <component-profile/>

    </component>

  </components>

  <services/>

</application>

The error persists. I have checked and found that class file ROOT/WEB-INF/portal/portalapps/com.sap.portal.pcd.roleservice/private/lib/com.sap.portal.pcd.roleservice_core.jar

Thanks,

Nikhil

Answers (0)