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

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jun 22, 2011 at 08:51 AM

    Hello,

    sorry, I think I was a little bit confused yesterday.

    The problem seems to be, that the jar files, which are included in the sda file are not deployed to the server. In the Visual Admin I can't see any JAR files in the field "JARs Contained" and I can't find them on the file system. Any ideas on that? They are definitly included in the sda file.

    Thanks and best regards,

    Dominik

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello,

      in the meantime I managed to deploy the Library project properly (at least now I can see the Jars in the field "JARs Contained" and see them on the filesystem).

      However I still get a java.lang.NoClassDefFoundError.

      Any further recommendations?

      Best regards,

      Dominik

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.