Joined: Tue Feb 08, 2005 12:04 pm Posts: 11 Location: London
|
Hi,
I have to deploy my existing Hibernate code on JBoss. Its perfectly working standalone but giving exceptions on JBoss.
Configuration cfg = new Configuration();
SessionFactory factory = cfg.configure().buildSessionFactory();
Session sessions = factory.openSession();
Transaction t = sessions.beginTransaction();
sessions.save(c);
sessions.save(p);
t.commit();
sessions.close();
////////////// HIBERNATE.CFG.XML //////////////////////////////
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory >
<property name="show_sql">true</property>
<mapping resource="org/ultimania/dto/Contact.hbm.xml"/>
<mapping resource="org/ultimania/dto/Person.hbm.xml"/>
<mapping resource="org/ultimania/dto/ContactMethod.hbm.xml"/>
<mapping resource="org/ultimania/dto/EntityType.hbm.xml"/>
<mapping resource="org/ultimania/dto/Gender.hbm.xml"/>
</session-factory>
</hibernate-configuration>
///////////////// STACK TRACE ///////////////////////////////
javax.servlet.ServletException: Resource: org/ultimania/dto/Contact.hbm.xml not found
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.test_jsp._jspService(test_jsp.java:117)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
root cause
net.sf.hibernate.MappingException: Resource: org/ultimania/dto/Contact.hbm.xml not found
net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:334)
net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:1013)
net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:969)
net.sf.hibernate.cfg.Configuration.configure(Configuration.java:897)
net.sf.hibernate.cfg.Configuration.configure(Configuration.java:883)
org.apache.jsp.test_jsp._jspService(test_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
_________________ Regards,
Ahsan
|
|