-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: ClassNotFoundException referring to composite id class
PostPosted: Fri Sep 02, 2005 4:52 pm 
Newbie

Joined: Tue Aug 30, 2005 1:44 pm
Posts: 3
Hello,

on creating the session factory (using caveat emptor HibernateUtil) in our JSF (myFaces) project, we get a ClassNotFoundException referring to a class containig the composit id of a trinary relation. Couriously, this error only occors when we create the session factory in our jsf project.

For debugging reasons, we have created the session factory with the same configuration files and pojos using a static void main class - and there, the session factory is started without any problem and returns every result perfectly. But every time we create a SessionFactory inn a managed bean, the ClassNotFoundException is thrown. (When we delete the hbm [and the associations to the associated classes] of the class the ClassNotFoundException refers to the exception is not thrown any more.)

We have been searching for the reason for this courious behaviour the whole day with four persons, but we have no idea how to solve the problem. Has anybody of you had a similar problem or at least an idea where to search for the reason?

Here still some information:
- the class NutzerrechtPK is the class containig the trinary ID
- NutzerrechtPK implements the interface serializable and the methods equals(NutzerrechtPK) and hashCode()
- we use tomcat 5.0
- we use hibernate 3.0
- we use jsf implemented by myFaces

Although, this is not very beautiful, I post the stack trace at the end of this message.

javax.faces.el.EvaluationException: java.lang.ExceptionInInitializerError

at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)

at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:62)

at javax.faces.component.UICommand.broadcast(UICommand.java:312)

at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)

at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)

at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)

at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)

at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)

at java.lang.Thread.run(Thread.java:595)

Caused by: java.lang.ExceptionInInitializerError

at de.unimuenster.wi.picture.persistenz.utilities.HibernateUtil.<clinit>(HibernateUtil.java:45) (<-- this is Caveat Emptor HibernateUtil)

at de.unimuenster.wi.picture.persistenz.DAO.DAO.<init>(DAO.java:27)

at de.unimuenster.wi.picture.persistenz.DAO.PersonDAO.<init>(PersonDAO.java:25)

at Test.createSession(Test.java:28) (<-- this is JSF managed bean)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)

... 32 more

Caused by: org.hibernate.MappingException: component class not found: de.unimuenster.wi.picture.persistenz.persistenteKlassen.NutzerrechtPK (<-- this is a class containig the primary key of the trinary relation "Nutzerrecht". Of course, this class DOES exist. And it is found, if the sessionfactory is not created a JSF managed bean.)

at org.hibernate.mapping.Component.getComponentClass(Component.java:101)

at org.hibernate.tuple.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:105)

at org.hibernate.tuple.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:40)

at org.hibernate.tuple.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:112)

at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:68)

at org.hibernate.mapping.Component.getType(Component.java:156)

at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:252)

at org.hibernate.mapping.RootClass.validate(RootClass.java:189)

at org.hibernate.cfg.Configuration.validate(Configuration.java:839)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1000)

at de.unimuenster.wi.picture.persistenz.utilities.HibernateUtil.<clinit>(HibernateUtil.java:36)

... 40 more

Caused by: java.lang.ClassNotFoundException: de.unimuenster.wi.picture.persistenz.persistenteKlassen.NutzerrechtPK

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

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

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

at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)

at org.hibernate.mapping.Component.getComponentClass(Component.java:98)

... 50 more

22:09:00,030 ERROR InvokeApplicationPhase:80 - java.lang.ExceptionInInitializerError

javax.faces.el.EvaluationException: java.lang.ExceptionInInitializerError

at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)

at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:62)

at javax.faces.component.UICommand.broadcast(UICommand.java:312)

at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)

at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)

at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)

at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)

at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)

at java.lang.Thread.run(Thread.java:595)

Caused by: java.lang.ExceptionInInitializerError

at de.unimuenster.wi.picture.persistenz.utilities.HibernateUtil.<clinit>(HibernateUtil.java:45)

at de.unimuenster.wi.picture.persistenz.DAO.DAO.<init>(DAO.java:27)

at de.unimuenster.wi.picture.persistenz.DAO.PersonDAO.<init>(PersonDAO.java:25)

at Test.createSession(Test.java:28)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)

... 32 more

Caused by: org.hibernate.MappingException: component class not found: de.unimuenster.wi.picture.persistenz.persistenteKlassen.NutzerrechtPK

at org.hibernate.mapping.Component.getComponentClass(Component.java:101)

at org.hibernate.tuple.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:105)

at org.hibernate.tuple.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:40)

at org.hibernate.tuple.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:112)

at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:68)

at org.hibernate.mapping.Component.getType(Component.java:156)

at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:252)

at org.hibernate.mapping.RootClass.validate(RootClass.java:189)

at org.hibernate.cfg.Configuration.validate(Configuration.java:839)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1000)

at de.unimuenster.wi.picture.persistenz.utilities.HibernateUtil.<clinit>(HibernateUtil.java:36)

... 40 more

Caused by: java.lang.ClassNotFoundException: de.unimuenster.wi.picture.persistenz.persistenteKlassen.NutzerrechtPK

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

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

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

at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)

at org.hibernate.mapping.Component.getComponentClass(Component.java:98)

... 50 more

StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception

javax.faces.el.EvaluationException: java.lang.ExceptionInInitializerError

javax.faces.el.EvaluationException: java.lang.ExceptionInInitializerError

at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)

at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:62)

at javax.faces.component.UICommand.broadcast(UICommand.java:312)

at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)

at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)

at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)

at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)

at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)

at java.lang.Thread.run(Thread.java:595)

Caused by: java.lang.ExceptionInInitializerError

at de.unimuenster.wi.picture.persistenz.utilities.HibernateUtil.<clinit>(HibernateUtil.java:45)

at de.unimuenster.wi.picture.persistenz.DAO.DAO.<init>(DAO.java:27)

at de.unimuenster.wi.picture.persistenz.DAO.PersonDAO.<init>(PersonDAO.java:25)

at Test.createSession(Test.java:28)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)

... 32 more

Caused by: org.hibernate.MappingException: component class not found: de.unimuenster.wi.picture.persistenz.persistenteKlassen.NutzerrechtPK

at org.hibernate.mapping.Component.getComponentClass(Component.java:101)

at org.hibernate.tuple.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:105)

at org.hibernate.tuple.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:40)

at org.hibernate.tuple.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:112)

at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:68)

at org.hibernate.mapping.Component.getType(Component.java:156)

at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:252)

at org.hibernate.mapping.RootClass.validate(RootClass.java:189)

at org.hibernate.cfg.Configuration.validate(Configuration.java:839)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1000)

at de.unimuenster.wi.picture.persistenz.utilities.HibernateUtil.<clinit>(HibernateUtil.java:36)

... 40 more

Caused by: java.lang.ClassNotFoundException: de.unimuenster.wi.picture.persistenz.persistenteKlassen.NutzerrechtPK

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

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

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

at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)

at org.hibernate.mapping.Component.getComponentClass(Component.java:98)

... 50 more


Top
 Profile  
 
 Post subject: Problem sidestept
PostPosted: Sun Sep 04, 2005 3:46 am 
Newbie

Joined: Tue Aug 30, 2005 1:44 pm
Posts: 3
Hello,

we have sidestept the problem by not using a composite key any more. When we have a trinary key or a double key with (at least) one additional attribute, we add a single id and declare the old id-combination unique. So, we do not need the key-class any more, and the Exception is not thrown.

This is, of course, not a beautiful solution. But after having spent more than six man-days on this problem, we have not found any other solution.

If anybody knows a better solution for the problem, he/she is welcome to post it - even if it is only vague idea where we could search for the problem.

Thanks a lot,

Christian


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.