-->
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.  [ 9 posts ] 
Author Message
 Post subject: Porting JBoss application to websphere
PostPosted: Tue Sep 07, 2004 4:39 am 
Beginner
Beginner

Joined: Thu May 06, 2004 5:30 am
Posts: 45
Hibernate version:
2.1.4
Full stack trace of any exception that occurs:
Environment I net.sf.hibernate.cfg.Environment Hibernate 2.1.4
Environment I net.sf.hibernate.cfg.Environment hibernate.properties not found
Environment I net.sf.hibernate.cfg.Environment using CGLIB reflection optimizer
Environment I net.sf.hibernate.cfg.Environment JVM does not support Statement.getGeneratedKeys()
Environment I net.sf.hibernate.cfg.Environment JVM does not support LinkedHasMap, LinkedHashSet - ordered maps and sets disabled
Environment I net.sf.hibernate.cfg.Environment using workaround for JVM bug in java.sql.Timestamp

Configuration I net.sf.hibernate.cfg.Configuration configuring from resource: /hibernate.cfg.xml
Configuration I net.sf.hibernate.cfg.Configuration Configuration resource: /hibernate.cfg.xml
Configuration W net.sf.hibernate.cfg.Configuration /hibernate.cfg.xml not found

I already successfully ported my mySQL-DB to DB2-DB, but I'm still having troubles in Websphere.
Does anybody have an idea what could be wrong?

The hibernate.hbm.xml is situated in the root of my WAR-file (inside my EAR).


Top
 Profile  
 
 Post subject: Re: Porting JBoss application to websphere
PostPosted: Tue Sep 07, 2004 11:41 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
-FoX- wrote:
The hibernate.hbm.xml is situated in the root of my WAR-file (inside my EAR).

Not sure the root of a War is on the CP.

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: Porting JBoss application to websphere
PostPosted: Tue Sep 07, 2004 5:40 pm 
Beginner
Beginner

Joined: Thu May 06, 2004 5:30 am
Posts: 45
emmanuel wrote:
-FoX- wrote:
The hibernate.hbm.xml is situated in the root of my WAR-file (inside my EAR).

Not sure the root of a War is on the CP.

But the same ear worked perfectly on JBoss. What should I do than, to fix this problem?


Top
 Profile  
 
 Post subject: Re: Porting JBoss application to websphere
PostPosted: Tue Sep 07, 2004 6:39 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
-FoX- wrote:
But the same ear worked perfectly on JBoss. What should I do than, to fix this problem?

1. repect the WAR structure as defined by the J2EE spec
2. show me the detailed structure, I'll help you

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: Porting JBoss application to websphere
PostPosted: Wed Sep 08, 2004 4:02 am 
Beginner
Beginner

Joined: Thu May 06, 2004 5:30 am
Posts: 45
emmanuel wrote:
-FoX- wrote:
But the same ear worked perfectly on JBoss. What should I do than, to fix this problem?

1. repect the WAR structure as defined by the J2EE spec
2. show me the detailed structure, I'll help you


Hmmm, I thought I had respected that structure and everything works just fine on JBoss... But Websphere just can't find the hibernate.hbm.xml config file...


OK, here is my WAR-Structure:

WAR-Root:
08/09/2004 09:41 <DIR> config
08/09/2004 09:41 <DIR> images
08/09/2004 09:41 <DIR> META-INF
08/09/2004 09:41 <DIR> pages
08/09/2004 09:41 <DIR> resources
08/09/2004 09:41 <DIR> tiles
08/09/2004 09:41 <DIR> WEB-INF
06/09/2004 14:18 151 index.jsp

config directory
<images of config>

images folder
<images>

META-INF folder
06/09/2004 14:18 93 MANIFEST.MF

pages folder
08/09/2004 09:41 <DIR> exceptions
08/09/2004 09:41 <DIR> login
08/09/2004 09:41 <DIR> usermanagement
06/09/2004 14:18 4.936 disclaimer.html
06/09/2004 14:18 2.116 uploadForm.jsp
06/09/2004 14:18 1.590 welcomeUser.jsp
... <more jsp files> ...

resources folder
08/09/2004 09:41 <DIR> styles

resources\styles folder
06/09/2004 14:18 4.898 default.css

tiles
08/09/2004 09:41 <DIR> layouts
06/09/2004 14:18 104 footer.jsp
06/09/2004 14:18 482 header.jsp
06/09/2004 14:18 2.542 leftMenu.jsp
06/09/2004 14:18 905 menu.jsp

tiles\layouts folder
06/09/2004 14:18 1.122 PortalLayout.jsp
06/09/2004 14:18 681 SimpleLayout.jsp

WEB-INF folder
08/09/2004 09:41 <DIR> classes
08/09/2004 09:41 <DIR> lib
06/09/2004 14:18 8.868 struts-bean.tld
06/09/2004 14:18 13.038 struts-config.xml
06/09/2004 14:18 66.192 struts-html.tld
06/09/2004 14:18 126.503 struts-layout.tld
06/09/2004 14:18 14.511 struts-logic.tld
06/09/2004 14:18 64.659 struts-nested.tld
06/09/2004 14:18 1.631 struts-template.tld
06/09/2004 14:18 7.850 struts-tiles.tld
06/09/2004 14:18 1.652 tiles-config.dtd
06/09/2004 14:18 3.215 tiles-defs.xml
06/09/2004 14:18 2.990 validation.xml
06/09/2004 14:18 44.722 validator-rules.xml
06/09/2004 14:18 5.003 web.xml

WEB-INF\classes folder
08/09/2004 09:41 <DIR> com
08/09/2004 09:41 <DIR> resources
06/09/2004 14:18 1.390 hibernate.cfg.xml
06/09/2004 14:18 347 hibernate.properties
06/09/2004 14:18 1.580 log4j.properties


WEB-INF\classes\com\reddragon\dms\config folder
08/09/2004 09:41 <DIR> ear
08/09/2004 09:41 <DIR> hibernate

WEB-INF\classes\com\reddragon\dms\config\hibernate folder
06/09/2004 14:18 1.007 Company.hbm.xml
06/09/2004 14:18 1.759 UserAccount.hbm.xml
.... <mapping files> ...

WEB-INF\classes\resources folder
06/09/2004 14:18 6.584 application.properties

WEB-INF\lib folder
06/09/2004 14:18 14.411 common.jar
06/09/2004 14:18 118.726 commons-beanutils.jar
06/09/2004 14:18 165.119 commons-collections.jar
06/09/2004 14:18 109.096 commons-digester.jar
06/09/2004 14:18 22.379 commons-fileupload.jar
06/09/2004 14:18 63.980 commons-lang.jar
06/09/2004 14:18 31.605 commons-logging.jar
06/09/2004 14:18 46.865 commons-validator.jar
06/09/2004 14:18 65.368 jakarta-oro.jar
06/09/2004 14:18 344.741 jasper-compiler.jar
06/09/2004 14:18 106.156 jasper-runtime.jar
06/09/2004 14:18 48.725 jsp-api.jar
06/09/2004 14:18 68.021 menu.jar
06/09/2004 14:18 498.051 struts.jar


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 08, 2004 5:27 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you must put hibernate2.jar in your WEb-INF/lib, to be sure the same classloader load hibernate and its cfg file.

It works on JBoss because it has some magic CL maganement, but this is not the strict Java2 classloading strategy

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 08, 2004 7:17 am 
Beginner
Beginner

Joined: Thu May 06, 2004 5:30 am
Posts: 45
emmanuel wrote:
you must put hibernate2.jar in your WEb-INF/lib, to be sure the same classloader load hibernate and its cfg file.

It works on JBoss because it has some magic CL maganement, but this is not the strict Java2 classloading strategy

Hmmm.. that could have been the case. So I simply added the hibernate2.jar to my WEB-INF/lib folder and build my application again.

But this tip could not resolve my problem and it's still showing the "/hibernate.cfg.xml not found" message.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 08, 2004 8:31 am 
Beginner
Beginner

Joined: Thu May 06, 2004 5:30 am
Posts: 45
Ok, I managed to solve this problem by placing the hibernate.hbm.xml file in the ejb.jar file.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 09, 2004 1:40 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
-FoX- wrote:
Hmmm.. that could have been the case. So I simply added the hibernate2.jar to my WEB-INF/lib folder and build my application again.

But this tip could not resolve my problem and it's still showing the "/hibernate.cfg.xml not found" message.

This is expected: the hibernate2.jar used was in another place and thus not the Webapp classloader

_________________
Emmanuel


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