Hibernate 3.0:
I am using hibernate with portal bean portlets on VAP (Vignette Application Portal 7.2.1). Following logs hibernate application is generating while initializing the hibernate session. This exception is not thrown with JSR-168 portlets.We have investigated the problem and found out that this problem is occuring due to different jars (jakarta logging and commons logging frameworks) used by VAP and hibernate respectively.
-------------------------------------------------------------------------------
Code:
java.lang.ExceptionInInitializerError
at com.hp.dspp.common.util.HibernateUtil.<clinit>()V(HibernateUtil.java:44)
at jrockit.vm.RNI.getRunnableCode(I)I(Unknown Source)
at jrockit.vm.RNI.trampoline()V(Unknown Source)
at com.hp.dspp.common.util.HibernateUtil.currentSession()Lorg.hibernate.Session;(HibernateUt
il.java:???)
at com.hp.dspp.common.crud.RetreiveObject.getData(Ljava.lang.String;)Ljava.util.Iterator;(Re
treiveObject.java:27)
at jsp_servlet._beans._companyproductsearch._jsp.__view._jspService(Ljavax.servlet.http.Http
ServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(__view.java:239)
at weblogic.servlet.jsp.JspBase.service(Ljavax.servlet.ServletRequest;Ljavax.servlet.Servlet
Response;)V(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava.lang.Object;
(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Lja
vax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImpl;)V(ServletStubImpl.java:419)
at weblogic.servlet.internal.TailFilter.doFilter(Ljavax.servlet.ServletRequest;Ljavax.servle
t.ServletResponse;Ljavax.servlet.FilterChain;)V(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax.servlet.ServletRequest;Ljavax.s
ervlet.ServletResponse;)V(FilterChainImpl.java:27)
at com.vignette.portal.website.internal.SingleInvocationFilter.doFilter(Ljavax.servlet.Servl
etRequest;Ljavax.servlet.ServletResponse;Ljavax.servlet.FilterChain;)V(SingleInvocationFilter.java:5
7)
at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax.servlet.ServletRequest;Ljavax.s
ervlet.ServletResponse;)V(FilterChainImpl.java:27)
at com.vignette.portal.website.internal.SingleInvocationFilter.doFilter(Ljavax.servlet.Servl
etRequest;Ljavax.servlet.ServletResponse;Ljavax.servlet.FilterChain;)V(SingleInvocationFilter.java:5
7)
at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax.servlet.ServletRequest;Ljavax.s
ervlet.ServletResponse;)V(FilterChainImpl.java:27)
at weblogic.servlet.internal.RequestDispatcherImpl.include(Ljavax.servlet.ServletRequest;Lja
vax.servlet.ServletResponse;Z)V(RequestDispatcherImpl.java:628)
at weblogic.servlet.internal.RequestDispatcherImpl.include(Ljavax.servlet.ServletRequest;Lja
vax.servlet.ServletResponse;)V(RequestDispatcherImpl.java:412)
at com.epicentric.portalbeans.beans.jspbean.JSPView.serviceHTML()V(JSPView.java:147)
at com.vignette.portal.portlet.management.internal.implementation.provider.portalbean.Portal
BeanPortletSpiImpl.doRender(Lcom.vignette.portal.portlet.management.external.invocationspi.PortletRe
nderRequest;Lcom.vignette.portal.portlet.management.external.invocationspi.PortletRenderResponse;)V(
PortalBeanPortletSpiImpl.java:258)
at com.vignette.portal.portlet.management.internal.implementation.standard.StandardPortlet.d
oRender(Lcom.vignette.portal.portlet.management.external.invocationspi.PortletRenderRequest;Lcom.vig
nette.portal.portlet.management.external.invocationspi.PortletRenderResponse;)V(StandardPortlet.java
:602)
at com.vignette.portal.portlet.invocation.internal.StandardPortletInvocationAgent.renderPort
let(Lcom.vignette.portal.portlet.management.external.Portlet;Lcom.vignette.portal.portlet.invocation
.external.PortletDisplayRequestContext;)Lcom.vignette.portal.portlet.invocation.external.PortletRend
erResult;(StandardPortletInvocationAgent.java:150)
at com.vignette.portal.portlet.invocation.internal.InSerialPortletRequestBroker.render(Lcom.
vignette.portal.portlet.invocation.external.PortletDisplayRequestContext;)Lcom.vignette.portal.portl
et.invocation.external.PortletDisplayRequestResult;(InSerialPortletRequestBroker.java:39)
at com.epicentric.page.website.internal.PagePortletRequestBrokerImpl.renderPortlets(Lcom.epi
centric.page.website.external.PageRequestContext;)Ljava.util.Map;(PagePortletRequestBrokerImpl.java:
29)
at com.epicentric.page.website.internal.PageBuilderImpl.buildPage(Lcom.vignette.portal.websi
te.enduser.PortalContext;Lcom.epicentric.page.Page;Ljava.util.Collection;)Lcom.vignette.portal.websi
te.enduser.PortalURI;(PageBuilderImpl.java:197)
at com.vignette.portal.website.enduser.components.page.display.PageBuilderPredisplayAction.p
ortletRender(Lcom.epicentric.page.Page;Lcom.vignette.portal.website.enduser.PortalContext;)Lcom.vign
ette.portal.website.enduser.PortalURI;(PageBuilderPredisplayAction.java:94)
at com.vignette.portal.website.enduser.components.page.display.PageBuilderPredisplayAction.e
xecute(Lcom.vignette.portal.website.enduser.PortalContext;)Lcom.vignette.portal.website.enduser.Port
alURI;(PageBuilderPredisplayAction.java:54)
at com.vignette.portal.website.enduser.internal.requestprocessing.system.DefaultRequestProce
ssor.process(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;Ljavax.s
ervlet.ServletContext;)Lcom.vignette.portal.website.enduser.PortalURI;(DefaultRequestProcessor.java:
131)
at com.vignette.portal.website.enduser.internal.ControllerServlet.service(Ljavax.servlet.htt
p.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(ControllerServlet.java:152)
at javax.servlet.http.HttpServlet.service(Ljavax.servlet.ServletRequest;Ljavax.servlet.Servl
etResponse;)V(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava.lang.Object;
(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Lja
vax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImpl;)V(ServletStubImpl.java:419)
at weblogic.servlet.internal.TailFilter.doFilter(Ljavax.servlet.ServletRequest;Ljavax.servle
t.ServletResponse;Ljavax.servlet.FilterChain;)V(TailFilter.java:28)
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfi
gurationException: org.apache.commons.logging.LogConfigurationException:
Invalid class loader hierar
chy. You have more than one version of 'org.apache.commons.logging.Log'
visible, which is not allow
ed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.
You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.) (Caused by org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConf
igurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.c ommons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigur
ationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commo ns.logging.Log' visible, which is not allowed.))
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(Ljava.lang.String;)Lorg.apache
.commons.logging.Log;(LogFactoryImpl.java:543)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(Ljava.lang.String;)Lorg.apache
.commons.logging.Log;(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(Ljava.lang.Class;)Lorg.apache.
commons.logging.Log;(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(Ljava.lang.Class;)Lorg.apache.commons.loggin
g.Log;(LogFactory.java:351)
at org.hibernate.cfg.Configuration.<clinit>()V(Configuration.java:110)
at jrockit.vm.RNI.initializeClassFromJava(II)V(Unknown Source)
at jrockit.vm.RNI.clinitTrampoline()V(Unknown Source)
at com.hp.dspp.common.util.HibernateUtil.<clinit>()V(HibernateUtil.java:44)
at jrockit.vm.RNI.getRunnableCode(I)I(Unknown Source)
at jrockit.vm.RNI.trampoline()V(Unknown Source)
at com.hp.dspp.common.util.HibernateUtil.currentSession()Lorg.hibernate.Session;(HibernateUt
il.java:???)
at com.hp.dspp.common.crud.RetreiveObject.getData(Ljava.lang.String;)Ljava.util.Iterator;(Re
treiveObject.java:27)
at jsp_servlet._beans._companyproductsearch._jsp.__view._jspService(Ljavax.servlet.http.Http
ServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(__view.java:239)
at weblogic.servlet.jsp.JspBase.service(Ljavax.servlet.ServletRequest;Ljavax.servlet.Servlet
Response;)V(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava.lang.Object;
(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Lja
vax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImpl;)V(ServletStubImpl.java:419)
at weblogic.servlet.internal.TailFilter.doFilter(Ljavax.servlet.ServletRequest;Ljavax.servle
t.ServletResponse;Ljavax.servlet.FilterChain;)V(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax.servlet.ServletRequest;Ljavax.s
ervlet.ServletResponse;)V(FilterChainImpl.java:27)
at com.vignette.portal.website.internal.SingleInvocationFilter.doFilter(Ljavax.servlet.Servl
etRequest;Ljavax.servlet.ServletResponse;Ljavax.servlet.FilterChain;)V(SingleInvocationFilter.java:5
7)
at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax.servlet.ServletRequest;Ljavax.s
ervlet.ServletResponse;)V(FilterChainImpl.java:27)
at com.vignette.portal.website.internal.SingleInvocationFilter.doFilter(Ljavax.servlet.Servl
etRequest;Ljavax.servlet.ServletResponse;Ljavax.servlet.FilterChain;)V(SingleInvocationFilter.java:5
7)
at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax.servlet.ServletRequest;Ljavax.s
ervlet.ServletResponse;)V(FilterChainImpl.java:27)
at weblogic.servlet.internal.RequestDispatcherImpl.include(Ljavax.servlet.ServletRequest;Lja
vax.servlet.ServletResponse;Z)V(RequestDispatcherImpl.java:628)
at weblogic.servlet.internal.RequestDispatcherImpl.include(Ljavax.servlet.ServletRequest;Lja
vax.servlet.ServletResponse;)V(RequestDispatcherImpl.java:412)
at com.epicentric.portalbeans.beans.jspbean.JSPView.serviceHTML()V(JSPView.java:147)
at com.vignette.portal.portlet.management.internal.implementation.provider.portalbean.Portal
BeanPortletSpiImpl.doRender(Lcom.vignette.portal.portlet.management.external.invocationspi.PortletRe
nderRequest;Lcom.vignette.portal.portlet.management.external.invocationspi.PortletRenderResponse;)V(
PortalBeanPortletSpiImpl.java:258)
at com.vignette.portal.portlet.management.internal.implementation.standard.StandardPortlet.d
oRender(Lcom.vignette.portal.portlet.management.external.invocationspi.PortletRenderRequest;Lcom.vig
nette.portal.portlet.management.external.invocationspi.PortletRenderResponse;)V(StandardPortlet.java
:602)
at com.vignette.portal.portlet.invocation.internal.StandardPortletInvocationAgent.renderPort
let(Lcom.vignette.portal.portlet.management.external.Portlet;Lcom.vignette.portal.portlet.invocation
.external.PortletDisplayRequestContext;)Lcom.vignette.portal.portlet.invocation.external.PortletRend
erResult;(StandardPortletInvocationAgent.java:150)
at com.vignette.portal.portlet.invocation.internal.InSerialPortletRequestBroker.render(Lcom.
vignette.portal.portlet.invocation.external.PortletDisplayRequestContext;)Lcom.vignette.portal.portl
et.invocation.external.PortletDisplayRequestResult;(InSerialPortletRequestBroker.java:39)
at com.epicentric.page.website.internal.PagePortletRequestBrokerImpl.renderPortlets(Lcom.epi
centric.page.website.external.PageRequestContext;)Ljava.util.Map;(PagePortletRequestBrokerImpl.java:
29)
at com.epicentric.page.website.internal.PageBuilderImpl.buildPage(Lcom.vignette.portal.websi
te.enduser.PortalContext;Lcom.epicentric.page.Page;Ljava.util.Collection;)Lcom.vignette.portal.websi
te.enduser.PortalURI;(PageBuilderImpl.java:197)
at com.vignette.portal.website.enduser.components.page.display.PageBuilderPredisplayAction.p
ortletRender(Lcom.epicentric.page.Page;Lcom.vignette.portal.website.enduser.PortalContext;)Lcom.vign
ette.portal.website.enduser.PortalURI;(PageBuilderPredisplayAction.java:94)
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfi
gurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.co mmons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigura
tionException: Invalid class loader hierarchy. You have more than one version of 'org.apache.common s.logging.Log' visible, which is not allowed.)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor()Ljava.lang.reflect.Cons
tructor;(LogFactoryImpl.java:397)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(Ljava.lang.String;)Lorg.apache
.commons.logging.Log;(LogFactoryImpl.java:529)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(Ljava.lang.String;)Lorg.apache
.commons.logging.Log;(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(Ljava.lang.Class;)Lorg.apache.
commons.logging.Log;(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(Ljava.lang.Class;)Lorg.apache.commons.loggin
g.Log;(LogFactory.java:351)
at org.hibernate.cfg.Configuration.<clinit>()V(Configuration.java:110)
at jrockit.vm.RNI.initializeClassFromJava(II)V(Unknown Source)
at jrockit.vm.RNI.clinitTrampoline()V(Unknown Source)
at com.hp.dspp.common.util.HibernateUtil.<clinit>()V(HibernateUtil.java:44)
at jrockit.vm.RNI.getRunnableCode(I)I(Unknown Source)
at jrockit.vm.RNI.trampoline()V(Unknown Source)
at com.hp.dspp.common.util.HibernateUtil.currentSession()Lorg.hibernate.Session;(HibernateUt
il.java:???)
at com.hp.dspp.common.crud.RetreiveObject.getData(Ljava.lang.String;)Ljava.util.Iterator;(Re
treiveObject.java:27)
at jsp_servlet._beans._companyproductsearch._jsp.__view._jspService(Ljavax.servlet.http.Http
ServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(__view.java:239)
at weblogic.servlet.jsp.JspBase.service(Ljavax.servlet.ServletRequest;Ljavax.servlet.Servlet
Response;)V(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava.lang.Object;
(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Lja
vax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImpl;)V(ServletStubImpl.java:419)
at weblogic.servlet.internal.TailFilter.doFilter(Ljavax.servlet.ServletRequest;Ljavax.servle
t.ServletResponse;Ljavax.servlet.FilterChain;)V(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax.servlet.ServletRequest;Ljavax.s
ervlet.ServletResponse;)V(FilterChainImpl.java:27)
at com.vignette.portal.website.internal.SingleInvocationFilter.doFilter(Ljavax.servlet.Servl
etRequest;Ljavax.servlet.ServletResponse;Ljavax.servlet.FilterChain;)V(SingleInvocationFilter.java:5
7)
at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax.servlet.ServletRequest;Ljavax.s
ervlet.ServletResponse;)V(FilterChainImpl.java:27)
at com.vignette.portal.website.internal.SingleInvocationFilter.doFilter(Ljavax.servlet.Servl
etRequest;Ljavax.servlet.ServletResponse;Ljavax.servlet.FilterChain;)V(SingleInvocationFilter.java:5
7)
at weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax.servlet.ServletRequest;Ljavax.s
ervlet.ServletResponse;)V(FilterChainImpl.java:27)
at weblogic.servlet.internal.RequestDispatcherImpl.include(Ljavax.servlet.ServletRequest;Lja
vax.servlet.ServletResponse;Z)V(RequestDispatcherImpl.java:628)
at weblogic.servlet.internal.RequestDispatcherImpl.include(Ljavax.servlet.ServletRequest;Lja
vax.servlet.ServletResponse;)V(RequestDispatcherImpl.java:412)
at com.epicentric.portalbeans.beans.jspbean.JSPView.serviceHTML()V(JSPView.java:147)
at com.vignette.portal.portlet.management.internal.implementation.provider.portalbean.Portal
BeanPortletSpiImpl.doRender(Lcom.vignette.portal.portlet.management.external.invocationspi.PortletRe
nderRequest;Lcom.vignette.portal.portlet.management.external.invocationspi.PortletRenderResponse;)V(
PortalBeanPortletSpiImpl.java:258)
at com.vignette.portal.portlet.management.internal.implementation.standard.StandardPortlet.d
oRender(Lcom.vignette.portal.portlet.management.external.invocationspi.PortletRenderRequest;Lcom.vig
nette.portal.portlet.management.external.invocationspi.PortletRenderResponse;)V(StandardPortlet.java
:602)
at com.vignette.portal.portlet.invocation.internal.StandardPortletInvocationAgent.renderPort
let(Lcom.vignette.portal.portlet.management.external.Portlet;Lcom.vignette.portal.portlet.invocation
.external.PortletDisplayRequestContext;)Lcom.vignette.portal.portlet.invocation.external.PortletRend
erResult;(StandardPortletInvocationAgent.java:150)
at com.vignette.portal.portlet.invocation.internal.InSerialPortletRequestBroker.render(Lcom.
vignette.portal.portlet.invocation.external.PortletDisplayRequestContext;)Lcom.vignette.portal.portl
et.invocation.external.PortletDisplayRequestResult;(InSerialPortletRequestBroker.java:39)
at com.epicentric.page.website.internal.PagePortletRequestBrokerImpl.renderPortlets(Lcom.epi
centric.page.website.external.PageRequestContext;)Ljava.util.Map;(PagePortletRequestBrokerImpl.java:
29)
at com.epicentric.page.website.internal.PageBuilderImpl.buildPage(Lcom.vignette.portal.websi
te.enduser.PortalContext;Lcom.epicentric.page.Page;Ljava.util.Collection;)Lcom.vignette.portal.websi
te.enduser.PortalURI;(PageBuilderImpl.java:197)
Caused by: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. Yo u have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor()Ljava.lang.reflect.Cons
tructor;(LogFactoryImpl.java:385)
... 31 more
------------------------------------------------------------------------------------
After seeing this message, I removed commons-logging jar file from the class path of hibernate and tried to use the same VAP jakarta-logging jar for hibernate also, but it then showed the exception that:
[i][b]Log4jImpl doesnot implement Log:[/b][/i]
After that I tried to remove jakarta-logging jar file from the VAP classpath and tried to use commons-logging jar for both (Hibernate as well as VAP).
But then it showed diffrerent exception message that:
[i][b]NoClassDefFoundError: org.apache.commons.logging.LogFactory[/b][/i]
Please help now what should I do?
[b]Full stack trace of any exception that occurs:[/b]
[b]MS-SQL Server 2000 on WIndows XP[/b]
[b]The generated SQL (show_sql=true):[/b]