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: ExceptionInInitalizerError
PostPosted: Wed Apr 13, 2005 10:00 am 
Newbie

Joined: Wed Apr 13, 2005 8:26 am
Posts: 2
Hibernate version 3.0
I was walking throught the QuickStart with Tomcat and followed the instructions as closely as possible.
Creation of the SessionFactory produces the ExceptionInInitializerError.
sessionFactory = new Configuration().configure().buildSessionFactory();
I am using all the latest JAR files that came with the download.

I am also using Oracles' JDBC JAR file
ojdbc14.jar

The only difference I am doing is that I am not using Tomcats DBCP... I have configured the hibernate.cfg.xml file with the following:
<hibernate-configuration>

<session-factory>
<!-- properties -->
<property name="hibernate.connection.username">eric</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@ds11.dev.gbl.chase.com:1521:GIBDEV9</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.connection.password">123xxx</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.pool.OracleConnectionPoolDataSource</property>

<!-- mapping files -->
<!-- The following mapping element was auto-generated in -->
<!-- order for this file to conform to the Hibernate DTD -->
<mapping resource="Cat.hbm.xml"/>

</session-factory>

</hibernate-configuration>




Below is the error stack:

java.lang.ExceptionInInitializerError
at net.home.villaruz.HibernateUtil.<clinit>(HibernateUtil.java:36)
at net.home.villaruz.CatAction.catAdmin(CatAction.java:55)
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:324)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)
at net.home.villaruz.CatAction.execute(CatAction.java:46)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
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:534)
Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/Type
at net.sf.cglib.core.TypeUtils.parseType(TypeUtils.java:180)
at net.sf.cglib.core.KeyFactory.<clinit>(KeyFactory.java:66)
at org.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:308)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1054)
at net.home.villaruz.HibernateUtil.<clinit>(HibernateUtil.java:31)
...

Any help you could provide is greatly appreciated.

Thank You
Eric Villaruz


Top
 Profile  
 
 Post subject: Re: ExceptionInInitalizerError
PostPosted: Wed Apr 13, 2005 10:25 am 
Regular
Regular

Joined: Thu Nov 13, 2003 2:55 am
Posts: 71
Location: Sweden
ericvillaruz wrote:
Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/Type

Add asm.jar to classpath / lib directory.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 13, 2005 2:57 pm 
Newbie

Joined: Wed Apr 13, 2005 8:26 am
Posts: 2
Thank You... asm.jar was one of the additional JARS I needed to add.

However after adding that I also had to add jta.jar because I was getting the following error.

Code:
Caused by: java.lang.NoClassDefFoundError: javax/transaction/SystemException
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:141)
   at org.hibernate.id.IdentifierGeneratorFactory.class$(IdentifierGeneratorFactory.java:25)
   at org.hibernate.id.IdentifierGeneratorFactory.<clinit>(IdentifierGeneratorFactory.java:71)
   at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:135)
   at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:166)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1054)
   at net.home.villaruz.HibernateUtil.<clinit>(HibernateUtil.java:31)
   ... 37 more

Anyway... for anyone else following the Getting Started, make sure you also add asm.jar and jta.jar

Happy Coding.
Eric Villaruz


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.