-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate BasicTypeRegistry INSTANCE problem on Tomcat
PostPosted: Thu Feb 17, 2011 7:01 pm 
Newbie

Joined: Thu Feb 17, 2011 6:42 pm
Posts: 2
Hello. We are making some application for school project and we are stuck. We use Hibernate JPA (with JSF 2.0 and MySql) and recently we changed Hibernate 3.2.5g.a to 3.6.1 to use JPA 2.0 and latest Hibernate search 3.3.0. After that deploying project on Tomcat 6.0.26 or Tomcat 7.0.8 became a nightmare. I can not find anywhere what can cause this problem. I think this is connected with deploying project on Tomcat, because creating Entity Manager Factory with JUnit tests goes without any problem.

This exception is thrown when there is first call to create entity manager factory. Tomcat is deploying project, but when we try to register or login in our website it throws this:

Code:
javax.faces.el.EvaluationException: java.lang.NoSuchFieldError: INSTANCE
   at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
   at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
   at javax.faces.component.UICommand.broadcast(UICommand.java:315)
   at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
   at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
   at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
   at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
   at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
   at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NoSuchFieldError: INSTANCE
   at org.hibernate.type.BasicTypeRegistry.<init>(BasicTypeRegistry.java:94)
   at org.hibernate.type.TypeResolver.<init>(TypeResolver.java:59)
   at org.hibernate.cfg.Configuration.<init>(Configuration.java:249)
   at org.hibernate.cfg.Configuration.<init>(Configuration.java:300)
   at org.hibernate.cfg.AnnotationConfiguration.<init>(AnnotationConfiguration.java:108)
   at org.hibernate.ejb.Ejb3Configuration.<clinit>(Ejb3Configuration.java:107)
   at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:124)
   at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
   at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
   at com.tripper.dao.HibernateDaoFactory.<init>(HibernateDaoFactory.java:99)
   at com.tripper.dao.HibernateDaoFactory$SingletonHolder.<clinit>(HibernateDaoFactory.java:121)
   at com.tripper.dao.HibernateDaoFactory.getInstance(HibernateDaoFactory.java:131)
   at com.tripper.logic.Register.InitUserDao(Register.java:90)
   at com.tripper.logic.Register.FastAddUser(Register.java:106)
   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:597)
   at org.apache.el.parser.AstValue.invoke(AstValue.java:262)
   at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)
   at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)
   at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
   ... 24 more


com.tripper.dao.HibernateDaoFactory (GenericDaoFactory is only abstract class):

Code:
public class HibernateDaoFactory  extends GenericDaoFactory {

  private static final Logger log = LoggerFactory.getLogger(HibernateDaoFactory.class);

  public static final String DEFAULT_PU = "tripperPU";

  protected HibernateDaoFactory() {
    HibernateDaoFactory.emf = Persistence.createEntityManagerFactory(HibernateDaoFactory.DEFAULT_PU);
  }

  private static class SingletonHolder {
    public final static HibernateDaoFactory SINGLETON = new HibernateDaoFactory();
    private SingletonHolder() {
    }
  }

  public static HibernateDaoFactory getInstance() {
    return SingletonHolder.SINGLETON;
  }
...

Log4j logs do not show anything interesting...
I have even checked source code but this did not take me enywhere...
So does someone have any idea how to solve this? Thanks for any help...


Top
 Profile  
 
 Post subject: Re: Hibernate BasicTypeRegistry INSTANCE problem on Tomcat
PostPosted: Fri Feb 18, 2011 4:35 am 
Newbie

Joined: Thu Feb 17, 2011 6:42 pm
Posts: 2
I solved my problem.
I had to delete hibernate-annotations.jar, because I had it already in hibernate3.jar...


Top
 Profile  
 
 Post subject: Re: Hibernate BasicTypeRegistry INSTANCE problem on Tomcat
PostPosted: Mon Oct 24, 2011 6:36 pm 
Newbie

Joined: Mon Oct 24, 2011 6:32 pm
Posts: 1
Thanks a lot for posting the solution mleczey this made me earn lots of time!


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