Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Usage of a J2EE library project in Portal Application

Hello,

I have a Portal Component in which I use Hibernate. I had the librarys included in the lib folder of the Application and it worked fine.

Now I want to put the Hibernate related libraries in a Library Project. I created one, deployed it and set a sharing reference to it like this:

<application-config>
    <property name="PublicSharingReference" value="SAPJ2EE::library:com.myproject.hibernate"/>
  </application-config>

Anyway I get a ClassNotFound Exception all the time

[EXCEPTION]
 java.lang.NoClassDefFoundError: org/hibernate/Session 
at java.lang.Class.forName0(Native Method) 
at java.lang.Class.forName(Class.java:219) 
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:235) 
at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:541) 
at java.security.AccessController.doPrivileged(Native Method) 
at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:430) 
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:1039) 
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)

When I enter a wrong name for the library in the SharingReference I get a java.lang.NoClassDefFoundError: org/hibernate/Session Exception. That shows me, that at least the reference to the library seems to be correct, but anyway my Portal Component can't use the classes at runtime. Does anybody have an idea on that?

Thanks and best regards,

Dominik

Edited by: Dominik Fried on Jun 21, 2011 6:51 PM

Former Member
Not what you were looking for? View more on this topic or Ask a question