You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Zerbst, Carsten" <Ca...@PROSTEP.com> on 2007/08/03 17:52:26 UTC

axis / hibernate woes

Hello, 

I'm trying to persist some objects using hibernate in an axis2 context but fail terribly.

The setup using the config.xml works outside of axis2, I load hibernate.cfg.xml 
from the jar (this seems to work) and loading of the mapping files works as well. 
But in the initialisation of the SessionFactory I get an java.lang.ExceptionInInitializerError error 

Could someone give me hint what is going wrong here ?

Thanks, Carsten 


LOG:

03.08.2007 17:36:34 org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.5
03.08.2007 17:36:34 org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
03.08.2007 17:36:34 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
03.08.2007 17:36:34 org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
03.08.2007 17:36:34 org.hibernate.cfg.Configuration configure
INFO: configuring from url: jar:file:/C:/Dokumente und Einstellungen/zerbst.PSAD/.netbeans/5.5/apache-tomcat-5.5.17_base/work/Catalina/localhost/axis2/axis212941SSRMServices2.aar!/net/eads/space/ssrm/model/persistence/hibernate.cfg.xml
03.08.2007 17:36:35 org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : net/eads/space/ssrm/model/persistence/ElementDefinitionDB.hbm.xml
03.08.2007 17:36:35 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: net.eads.space.ssrm.model.persistence.ElementDefinitionDB -> ElementDefinition
03.08.2007 17:36:35 org.hibernate.cfg.HbmBinder bindCollection
INFO: Mapping collection: net.eads.space.ssrm.model.persistence.ElementDefinitionDB.listContainedElements -> ElementDefinitionContainedElements
03.08.2007 17:36:35 org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : net/eads/space/ssrm/model/persistence/ElementOccurenceDB.hbm.xml
03.08.2007 17:36:35 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: net.eads.space.ssrm.model.persistence.ElementOccurenceDB -> ElementOccurence
03.08.2007 17:36:35 org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : net/eads/space/ssrm/model/persistence/ElementUsageDB.hbm.xml
03.08.2007 17:36:35 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: net.eads.space.ssrm.model.persistence.ElementUsageDB -> ElementUsage
03.08.2007 17:36:35 org.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null


... displaying many default settings

INFO: Deleted entity synthetic identifier rollback: disabled
03.08.2007 17:36:36 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
03.08.2007 17:36:36 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Named query checking : enabled
03.08.2007 17:36:36 org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Initial SessionFactory creation failed.java.lang.ExceptionInInitializerError
03.08.2007 17:36:36 org.apache.axis2.transport.http.AxisServlet doPost
SCHWERWIEGEND: java.lang.ExceptionInInitializerError





___
Dr.-Ing. Carsten Zerbst 

PROSTEP ITS  GmbH
Hein-Saß-Weg 19, D-21129 Hamburg

Tel: +49 40 209 1608 12
Mobil: +49 178 950 9468
E-Mail: carsten.zerbst@prostep.com
http://www.prostep.com
________________________________________________
PROSTEP ITS GmbH, Dolivostr.11, D-64293 Darmstadt
HR: Amtsgericht Darmstadt, HRB 8805
Geschäftsführung: Dr. Markus Sachers, Reinhard Betz 
________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: AW: axis / hibernate woes

Posted by robert lazarski <ro...@gmail.com>.
Putting hibernate in the AAR is a special case. It can be done, but
its far easier - as you found out - to put the files under
WEB-INF/classes and the jars in WEB-INF/lib

You can't put hibernate config files inside the AAR because those
config files need to be on the classpath, per the way hibernate loads
those files by default. You can exapnd the AAR though...

What you can do, per Spring is add directories to the classpath, ie,
expand the AAR in WEB-INF/services or WEB-INF/classes/myConfigs

http://www.springframework.org/docs/api/org/springframework/orm/hibernate/LocalSessionFactoryBean.html#setMappingDirectoryLocations(org.springframework.core.io.Resource[])

You of course don't need Spring to run Hibernate - there probably is a
way to do the same thing via just hibernate - you'll have to google on
that though since I prefer to use Spring to configure Hibernate.

HTH,
Robert

On 8/3/07, Zerbst, Carsten <Ca...@prostep.com> wrote:
> Hello Tammy,
>
> when I put the complete set of hibernate jars into the Axis2/WEB-INF/lib, then
> hibernate is not able to access my mapping descriptions located in the aar.
> This could be resolved by putting my application itself into Axis2/WEB-INF/lib
> and then everything works (alas).
>
> But IHMO there must be a sane solution to have hibernate and my application
> and my mappings files in the aar and not distributed around the Axis2/WEB-INF/lib and Axis2/WEB-INF/classes ?
>
> Thanks so far, Carsten
>
> ________________________________________________
> PROSTEP ITS GmbH, Dolivostr.11, D-64293 Darmstadt
> HR: Amtsgericht Darmstadt, HRB 8805
> Geschäftsführung: Dr. Markus Sachers, Reinhard Betz
> ________________________________________________
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


AW: AW: axis / hibernate woes

Posted by "Zerbst, Carsten" <Ca...@PROSTEP.com>.
Hello Tammy, 

when I put the complete set of hibernate jars into the Axis2/WEB-INF/lib, then 
hibernate is not able to access my mapping descriptions located in the aar.
This could be resolved by putting my application itself into Axis2/WEB-INF/lib 
and then everything works (alas).

But IHMO there must be a sane solution to have hibernate and my application
and my mappings files in the aar and not distributed around the Axis2/WEB-INF/lib and Axis2/WEB-INF/classes ?

Thanks so far, Carsten 

________________________________________________
PROSTEP ITS GmbH, Dolivostr.11, D-64293 Darmstadt
HR: Amtsgericht Darmstadt, HRB 8805
Geschäftsführung: Dr. Markus Sachers, Reinhard Betz 
________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: AW: axis / hibernate woes

Posted by Tammy Dugan <td...@regenstrief.org>.
You might try putting your dependent jars in the axis2 lib directory.

Tammy

Zerbst, Carsten wrote:
> Hello, 
>
> I enhanced the error report, the real cause is 
>
> 2007-08-03 17:59:08,455 ERROR net.eads.space.ssrm.model.persistence.HibernateUtil - Initial SessionFactory creation failed.
> java.lang.ExceptionInInitializerError
>         at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:117)
>         at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
>         at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
>         at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
>         at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
>         at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
>         at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295)
>         at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
>         at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
>         at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
>         at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
>         at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
>         at net.eads.space.ssrm.model.persistence.HibernateUtil.<clinit>(HibernateUtil.java:24)
>
> Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class Not found : net.sf.cglib.proxy.Enhancer$EnhancerKey$$KeyFactoryByCGLIB$$7fb24d72
>         at org.apache.axis2.deployment.DeploymentClassLoader.findClass(DeploymentClassLoader.java:88)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:210)
>         at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
>         at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
>         at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
>         at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
>         at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
>         ... 38 more
> Caused by: java.lang.ClassNotFoundException: Class Not found : net.sf.cglib.proxy.Enhancer$EnhancerKey$$KeyFactoryByCGLIB$$7fb24d72
>
> The cglib is in the /lib directory of my aar, alongside the hibernate and other libraries.
>
> What is going wrong in the axis2 environment ?
>
> Thanks, Carsten 
>
>
> ________________________________________________
> PROSTEP ITS GmbH, Dolivostr.11, D-64293 Darmstadt
> HR: Amtsgericht Darmstadt, HRB 8805
> Geschäftsführung: Dr. Markus Sachers, Reinhard Betz 
> ________________________________________________
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>   

-- 
Tammy Dugan
Computer Programmer

Regenstrief Institute, Inc.
Medical Informatics
Health Information and Translational Sciences (HITS) Building
410 West 10th Street, Suite 2000
Indianapolis, IN 46202
Main: 317.423.5500
Fax: 317.423.5695
IU campus mail address: HS, 2000

(317) 423 - 5541

Confidentiality Notice: The contents of this message and any files transmitted with it may contain confidential and/or privileged information and are intended solely for the use of the named addressee(s). Additionally, the information contained herein may have been disclosed to you from medical records with confidentiality protected by federal and state laws. Federal regulations and State laws prohibit you from making further disclosure of such information without the specific written consent of the person to whom the information pertains or as otherwise permitted by such regulations. A general authorization for the release of medical or other information is not sufficient for this purpose.
 
If you have received this message in error, please notify the sender by return e-mail and delete the original message. Any retention, disclosure, copying, distribution or use of this information by anyone other than the intended recipient is strictly prohibited.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


AW: axis / hibernate woes

Posted by "Zerbst, Carsten" <Ca...@PROSTEP.com>.
Hello, 

I enhanced the error report, the real cause is 

2007-08-03 17:59:08,455 ERROR net.eads.space.ssrm.model.persistence.HibernateUtil - Initial SessionFactory creation failed.
java.lang.ExceptionInInitializerError
        at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:117)
        at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
        at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
        at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
        at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
        at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
        at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295)
        at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
        at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
        at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
        at net.eads.space.ssrm.model.persistence.HibernateUtil.<clinit>(HibernateUtil.java:24)

Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class Not found : net.sf.cglib.proxy.Enhancer$EnhancerKey$$KeyFactoryByCGLIB$$7fb24d72
        at org.apache.axis2.deployment.DeploymentClassLoader.findClass(DeploymentClassLoader.java:88)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:210)
        at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
        at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
        at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
        at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
        at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
        ... 38 more
Caused by: java.lang.ClassNotFoundException: Class Not found : net.sf.cglib.proxy.Enhancer$EnhancerKey$$KeyFactoryByCGLIB$$7fb24d72

The cglib is in the /lib directory of my aar, alongside the hibernate and other libraries.

What is going wrong in the axis2 environment ?

Thanks, Carsten 


________________________________________________
PROSTEP ITS GmbH, Dolivostr.11, D-64293 Darmstadt
HR: Amtsgericht Darmstadt, HRB 8805
Geschäftsführung: Dr. Markus Sachers, Reinhard Betz 
________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org