-->
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.  [ 7 posts ] 
Author Message
 Post subject: java.lang.ClassNotFoundException: javassist.util.proxy.Metho
PostPosted: Thu Oct 16, 2008 7:13 pm 
Newbie

Joined: Fri Jul 15, 2005 4:21 am
Posts: 14
I have used Hibernate for several years, and recently tried to upgrade to the latest version, including the annotations package.

However, there seems to be something wrong with the dependencies, that is the different jar files that need to be included to make it work.

The files in the distribution, in the \lib\required folder, are obviously not enough, so I added some more. These are the files in my classpath right now:

Code:
antlr-2.7.6.jar
commons-collections-3.1.jar
jta-1.1.jar
hibernate3.jar
ehcache-1.2.3.jar
log4j-1.2.15.jar
hibernate-commons-annotations.jar
ejb3-persistence.jar
hibernate-annotations.jar
dom4j-1.6.1.jar
jtds-1.2.2.jar
slf4j-api-1.5.3.jar
slf4j-simple-1.5.3.jar
commons-logging-1.1.1.jar
javassist-3.4.GA.jar


When I start my application and try to build the SessionFactory, I get this strange error, even though I do have the javassist jar file in the classpath:

Code:
[#|2008-10-17T00:02:15.190+0200|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=17;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=1931c1bf-4d85-4a4d-8478-e796817f65cf;|StandardWrapperValve[StartaHibernate]: PWC1406: Servlet.service() for servlet StartaHibernate threw exception
java.lang.ExceptionInInitializerError
   at recept.ramverk.verktyg.HibernateUtil.<clinit>(HibernateUtil.java:62)
   at recept.servlets.StartaHibernate.doGet(StartaHibernate.java:34)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
   at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
   at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
   at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
   at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
   at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
   at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
   at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
   at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
   at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
   at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
   at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
   at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
   at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
   at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
   at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
   at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
   at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:380)
   at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
   at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: java.lang.NoClassDefFoundError: javassist/util/proxy/MethodFilter
   at org.hibernate.bytecode.javassist.BytecodeProviderImpl.getProxyFactoryFactory(BytecodeProviderImpl.java:49)
   at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactoryInternal(PojoEntityTuplizer.java:203)
   at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:181)
   at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:158)
   at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:76)
   at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:80)
   at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:325)
   at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:457)
   at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:131)
   at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
   at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
   at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
   at recept.ramverk.verktyg.HibernateUtil.<clinit>(HibernateUtil.java:56)
   ... 30 more
Caused by: java.lang.ClassNotFoundException: javassist.util.proxy.MethodFilter
   at com.sun.enterprise.loader.EJBClassLoader.findClassData(EJBClassLoader.java:741)
   at com.sun.enterprise.loader.EJBClassLoader.findClass(EJBClassLoader.java:631)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
   ... 44 more
|#]


I was thinking that perhaps I am using wrong versions of the different jar files, that don't fit with each other, but then, which ones should I use?

Please help! :)


Last edited by Kristoffer on Fri Oct 17, 2008 5:27 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 17, 2008 5:23 am 
Newbie

Joined: Fri Jul 15, 2005 4:21 am
Posts: 14
When I included the javassist jar file in the global classpath for the server, everything worked out okay. But that's really ugly and not what I want to do. :(


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 20, 2008 5:34 am 
Newbie

Joined: Fri Jul 15, 2005 4:21 am
Posts: 14
This is interesting. I have narrowed down the problem to only exist when I run the application on the SunAppServer from within Eclipse. If I export the EAR and deployt it on the appserver the normal way, everything works ...

Anybody has any clue?


Top
 Profile  
 
 Post subject: Re: java.lang.ClassNotFoundException: javassist.util.proxy.Metho
PostPosted: Fri Dec 18, 2009 12:22 pm 
Newbie

Joined: Wed Jul 09, 2008 7:38 pm
Posts: 2
I also experience this. I use JUnit and Spring. Everything in default integration config by documentation.


Top
 Profile  
 
 Post subject: Re: java.lang.ClassNotFoundException: javassist.util.proxy.Metho
PostPosted: Mon Feb 01, 2010 6:43 am 
Beginner
Beginner

Joined: Fri Jan 23, 2009 10:34 am
Posts: 25
Location: Switzerland
I've got the same exception when migrating from Javassist 3.4 to Javassist 3.11. Javassist 3.4 JAR was removed and Javassist 3.11 JAR was added. There was still some references to Javassist 3.4 JAR in some classpath, so the class could obviously not be found.

I solved the problem by replacing every occurence of "javassist-3.4" by "javassist-3.11" in the project.


Top
 Profile  
 
 Post subject: Re: java.lang.ClassNotFoundException: javassist.util.proxy.Metho
PostPosted: Thu Feb 04, 2010 6:33 pm 
Newbie

Joined: Wed Jan 19, 2005 10:23 pm
Posts: 1
I have the same problem when using hibernate-core 3.3.2.GA and hibernate-annotations 3.4.0.GA. I'm pulling the dependencies using maven2 from the jboss release repo: http://repository.jboss.com/maven2.
I wish the release notes are better documented, and easier to find out from the hiberate.org/downloads website. The release upgrade and dependency configuration is a project on into itself. I simply wanted to upgrade from hibernate 3.2.6.GA to 3.3.2GA. This was just one of the problems I ran into. The fix was that you are now required to add a maven dependency to either javassist or the repacked cglib. hibernate 3.3x defaults to javassist for the bytecode provider, so if you've never configured this in the past, it was an unpleasant surprise to find you're required to add the dependency with no evident (or sufficient) information on the release notes. I ultimately found the details by reading through various blogs. I hope this process is improved for future releases -- perhaps have an easy to find 'Upgrading from 3.2.x to 3.3.x guide' that's posted right on hibernate.org's website (not on separate blogs).


Top
 Profile  
 
 Post subject: Re: java.lang.ClassNotFoundException: javassist.util.proxy.Metho
PostPosted: Wed Nov 14, 2012 4:04 pm 
Newbie

Joined: Wed Nov 14, 2012 3:48 pm
Posts: 1
I have been using the hibernate setup since few months . i recently faced same exception when i tried to add one more hbm file to my application. The point i obeserved is ,i didnt upgrade my hibernate jar . To moveforward with my task the quick solution i have got is, Adding lazy="false" to the class tag in hbm file .

<class name="class name" table="table_name" lazy="false">


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.