-->
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: Problem loading mapping
PostPosted: Thu Dec 07, 2006 7:30 am 
Newbie

Joined: Tue Oct 24, 2006 6:04 am
Posts: 3
Location: Italy
Hi to everyone,
Few month ago I have developed a web application (using hibernate) that is currently running on an Oracle Application Server 10g without any problems...
Now I have to make this application executable on a Oracle9iAS Containers for J2EE 1.0.2.2 using Java 1.3.1.
In order to do this I have recompiled the hibernate3.jar with a 1.4 jdk setting the target="1.3" and that worked fine.
After this I have included this library in my application and re-compiled everything with JDK 1.3.1 obtaining a .WAR package.
The problem arise after the deploy, when a page reaches the instruction below:

// Init Hibernate
if (sessionFactory == null)
sessionFactory = new Configuration()
.configure(conf.getProperty(PARAM_HIBERNATE_CONFIG_FILE))
.buildSessionFactory();

This instruction refers to the hibernate.cfg.xml file listed below:

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.aggressive_release">true</property>
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="connection.datasource">jdbc/GE_Loaders</property>

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>
<property name="hibernate.jdbc.batch_size">30</property>


<!-- Echo all executed SQL to stdout -->
<property name="show_sql">false</property>

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>

<!-- Mapping files -->
<mapping resource="DMGE_Loaders/model/adeguamento/Adeguamento.hbm.xml"/>
<mapping resource="DMGE_Loaders/model/pesiAnnoCCF/PesiAnnoCCF.hbm.xml"/>
<mapping resource="DMGE_Loaders/model/pesiAnnoMeseCCF/PesiAnnoMeseCCF.hbm.xml"/>
<mapping resource="DMGE_Loaders/model/pesiGestionale/PesiGestionale.hbm.xml"/>
<mapping resource="DMGE_Loaders/model/cambiValuta/CambiValuta.hbm.xml"/>
</session-factory>
</hibernate-configuration>

This works perfectly under Oracle AS 10g but now on the 9i AS when calling that instruction it gives back what follows:

org.hibernate.MappingException: Could not read mappings from resource: events/Event.hbm.xml

at org.hibernate.cfg.Configuration.addResource(Configuration.java:485)

at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465)

at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)

at org.hibernate.cfg.Configuration.configure(Configuration.java:1310)

at DMGE_Loaders.Resources.init(Resources.java:134)

at DMGE_Loaders.Resources.init(Resources.java:140)

at /readPAram.jsp._jspService(/readPAram.jsp.java:43) (JSP page line 13)

at com.orionserver[Oracle9iAS (1.0.2.2.1) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:54)

at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.HttpApplication.serviceJSP(HttpApplication.java:5459)

at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.JSPServlet.service(JSPServlet.java:31)

at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:508)

at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:177)

at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:576)

at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:189)

at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:62)

Caused by: org.hibernate.MappingException: class events.Event not found while looking for property: id

at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:80)

at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:276)

at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:410)

at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:343)

at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:282)

at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:153)

at org.hibernate.cfg.Configuration.add(Configuration.java:386)

at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)

at org.hibernate.cfg.Configuration.addResource(Configuration.java:482)

... 16 more

Caused by: java.lang.ClassNotFoundException: events.Event

at com.evermind[Oracle9iAS (1.0.2.2.1) Containers for J2EE].naming.ContextClassLoader.findClass(ContextClassLoader.java:173)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)

at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:76)

... 24 more

It seems a usual ClassNotFoundException but I don't use any class called Event!
Any idea?
Thanks in advance
Regards
Paolo


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 8:29 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
Somehow you are loading the mapping file events/Event.hbm.xml

Quote:
org.hibernate.MappingException: Could not read mappings from resource: events/Event.hbm.xml


This file may reference the event class.
Perhaps you are using differenthibernate.cfg.xml as you thought ?

_________________
dont forget to rate !


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 11:24 am 
Newbie

Joined: Tue Oct 24, 2006 6:04 am
Posts: 3
Location: Italy
steckemetz wrote:
Somehow you are loading the mapping file events/Event.hbm.xml

Quote:
org.hibernate.MappingException: Could not read mappings from resource: events/Event.hbm.xml


This file may reference the event class.
Perhaps you are using differenthibernate.cfg.xml as you thought ?


Hi,
I'm sure I'm not using a different xml file because I have buildt the WAR package using Netbeans as IDE and including exactly that xml file.
What it's strange to me is that my application works well on tha Application Server Oracle 10g but not in the 9i one. Maybe is still not compiant the re-compiled hibernate.jar library?
Has no one experienced this phenomenon?
Should I use another hibernate version, an older one for example?
Thanks bye
Paolo


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.