Hi there,
I am going to get Hibernate working on SAP WAS 6.20 (there, within enterprise portal, which, seen from WAS perspective, is a web application, which holds it's own portal applications).
If I put all the Hibernate stuff (JARs) as well as the xml files into the portal application project so that it gets deployed as part of my portal application, everything works fine.s
Now this is not very nice, one whishes to lay the Hibernate -- application independent -- stuff on the base of the WAS, so that each application -- especially, but not restricted to -- also each portal applications can use it.
With this, the xml files (hibernate.cfg.xml and mapping files) are to be seen as part of the application.
They shouldn't be anywhere except within the to be deployed PAR file (Portal Archive). The same holds for the mapping classes.
So I put all libs under .../cluster/server/additional-libs and made the necesary entries within reference.txt and library.txt. This works in the meaning of: The classes are found from within the portal application. Also the xml files are found.
Now the pain looks like this:
Hibernate version: 2.1.6
Full stack trace of any exception that occurs:
Quote:
net.sf.hibernate.MappingException: Error reading resource: services/servlet_jsp/work/jspTemp/irj/root/WEB-INF/portal/portalapps/HibernateTest/resources/myprojects.hbm.xml
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:339)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:1013)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:969)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:931)
at com.btexx.hibernate.HibernateTestComponent.doContent(HibernateTestComponent.java:22)
at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:301)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:191)
at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:217)
at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:580)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:301)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:191)
at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:670)
at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:229)
at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:532)
at java.security.AccessController.doPrivileged(Native Method)
at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.inqmy.services.servlets_jsp.server.RunServlet.runSerlvet(RunServlet.java:149)
at com.inqmy.services.servlets_jsp.server.ServletsAndJspImpl.startServlet(ServletsAndJspImpl.java:832)
at com.inqmy.services.httpserver.server.RequestAnalizer.checkFilename(RequestAnalizer.java:666)
at com.inqmy.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:313)
at com.inqmy.services.httpserver.server.Response.handle(Response.java:173)
at com.inqmy.services.httpserver.server.HttpServerFrame.request(HttpServerFrame.java:1288)
at com.inqmy.core.service.context.container.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:36)
at com.inqmy.core.cluster.impl5.ParserRunner.run(ParserRunner.java:55)
at com.inqmy.core.thread.impl0.ActionObject.run(ActionObject.java:46)
at java.security.AccessController.doPrivileged(Native Method)
at com.inqmy.core.thread.impl0.SingleThread.run(SingleThread.java:148)
Caused by: net.sf.hibernate.MappingException: persistent class [com.btexx.hibernate.Project] not found
at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:84)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1256)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:252)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:288)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:336)
... 33 more
Caused by: java.lang.ClassNotFoundException: com.btexx.hibernate.Project
at com.sapportals.portal.prt.util.AutoClassLoader.loadClass(AutoClassLoader.java:1458)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:115)
at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:102)
at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:81)
... 38 more
The strange thing is that I used SysInternals File Monitor to check where the classloader looks for the mapping class file. In each case -- independent if the Hibernate stuff lays at WAS base or gets deployed as part of the portal application -- the file monitor only shows (unsuccessful) attempts to read from .../cluster/server as well as from ../cluster/server/services/servlet_jsp/work/jspTemp/irj/work.
Nevertheless, as said, it works if the Hibernate stuff is within the portal app...
Any hints?!
Thanks in advance
Detlev