Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
[b]Hibernate version: 3.2.2.GA [/b]
[b]Mapping documents: [/b]
[b]Code between sessionFactory.openSession() and session.close():
[code] [quote]
<session-factory name="HibernateSesionFactory">
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.password">fin1</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@172.31.1.4:1521:isfms</property>
<property name="hibernate.connection.username">fin1</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="show.query">true</property>
<mapping resource="com/cmcltd/itms/security/beans/MmGenUser.hbm.xml"/>
<mapping resource="com/cmcltd/itms/security/beans/MdGenRole.hbm.xml"/>
<mapping resource="com/cmcltd/itms/admin/beans/MmGenMenu.hbm.xml"/>
<mapping resource="com/cmcltd/itms/admin/beans/MmGenSubsystem.hbm.xml"/>
<mapping resource="com/cmcltd/itms/admin/beans/MdGenActivity.hbm.xml"/>
<mapping resource="com/cmcltd/itms/admin/beans/MdGenModule.hbm.xml"/>
<mapping resource="com/cmcltd/itms/admin/beans/MdGenUserRole.hbm.xml"/>
<mapping resource="com/cmcltd/itms/admin/beans/MdGenRoleActivity.hbm.xml"/>
<mapping resource="com/cmcltd/itms/admin/beans/MdGenActivityUrl.hbm.xml"/>
<mapping resource="com/cmcltd/itms/accoundhead/beans/MmGenDemandNumber.hbm.xml"/>
<mapping resource="com/cmcltd/itms/accoundhead/beans/MmGenMajorhead.hbm.xml"/>
<mapping resource="com/cmcltd/itms/accoundhead/beans/MdGenSubmajorhead.hbm.xml"/>
<mapping resource="com/cmcltd/itms/accoundhead/beans/MdGenMinorhead.hbm.xml"/>
<mapping resource="com/cmcltd/itms/accoundhead/beans/MmGenHoaLevel4.hbm.xml"/>
<mapping resource="com/cmcltd/itms/accoundhead/beans/MmGenHoaLevel5.hbm.xml"/>
<mapping resource="com/cmcltd/itms/accoundhead/beans/MdGenHoaLevel6.hbm.xml"/>
<mapping resource="com/cmcltd/itms/accoundhead/beans/MmGenPlanstatus.hbm.xml"/>
<mapping resource="com/cmcltd/itms/accoundhead/beans/MmGenHoa.hbm.xml"/>
<mapping resource="com/cmcltd/itms/master/payment/beans/MmGenRejection.hbm.xml"/>
<mapping resource="com/cmcltd/itms/master/payment/beans/MmGenBillType.hbm.xml"/>
<mapping resource="com/cmcltd/itms/master/payment/beans/MdGenBillType.hbm.xml"/>
<mapping resource="com/cmcltd/itms/master/payment/beans/MmPayBytransferHead.hbm.xml"/>
<mapping resource="com/cmcltd/itms/master/general/beans/MmGenCo.hbm.xml"/>
<mapping resource="com/cmcltd/itms/master/general/beans/MmGenDdo.hbm.xml"/>
<mapping resource="com/cmcltd/itms/master/general/beans/MmGenDepartment.hbm.xml"/>
</session-factory>[/quote]
[/code][/b]
[b]Full stack trace of any exception that occurs: [quote]
17:27:57,515 INFO Configuration:1460 - configuring from resource: /resources/hibernate.cfg.xml
17:27:57,515 INFO Configuration:1437 - Configuration resource: /resources/hibernate.cfg.xml
17:27:57,515 INFO Configuration:586 - Reading mappings from resource : com/cmcltd/itms/security/beans/MmGenUser.hbm.xml
17:27:57,531 INFO Mappings:161 - duplicate import: com.cmcltd.itms.security.beans.MmGenUser->com.cmcltd.itms.security.beans.MmGenUser
17:27:57,531 INFO Mappings:161 - duplicate import: com.cmcltd.itms.security.beans.MmGenUser->MmGenUser
17:27:57,531 INFO HbmBinder:322 - Mapping class: com.cmcltd.itms.security.beans.MmGenUser -> MM_GEN_USER
HibernateSessionFactory :: Error Creating SessionFactory
org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/cmcltd/itms/security/beans/MmGenUser.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:602)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1621)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1589)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1568)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1542)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at com.cmcltd.itms.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:61)
at com.cmcltd.itms.HibernateSessionFactory.getSession(HibernateSessionFactory.java:45)
at com.cmcltd.itms.security.LoginInitializedAction.execute(LoginInitializedAction.java:50)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
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:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:670)
at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:54)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping com.cmcltd.itms.security.beans.MmGenUser
at org.hibernate.cfg.Mappings.addClass(Mappings.java:141)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:167)
at org.hibernate.cfg.Configuration.add(Configuration.java:702)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:537)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:599)
... 43 more
17:27:57,531 WARN RequestProcessor:516 - Unhandled Exception thrown: class java.lang.NullPointerException
17:27:57,546 ERROR [action]:704 - Servlet.service() for servlet action threw exception
java.lang.NullPointerException
at com.cmcltd.itms.security.LoginInitializedAction.execute(LoginInitializedAction.java:51)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
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:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:670)
at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:54)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
17:27:57,562 ERROR [jsp]:253 - Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at com.cmcltd.itms.security.LoginInitializedAction.execute(LoginInitializedAction.java:51)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
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:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:670)
at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:54)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
[/b][/quote]
[b]Name and version of the database you are using:
The database I am using is Oracle 10g . Server is Tomcat 6.0
[/b]
Problem is very confusing. THey r showing the problem is with table mmGenUser, whether I am working with the table MdGenActivityUrl. Wheneever I am trying to map this table, a duplicate entry problem is coming as the exeption. That error I cant solve.
Read this:
http://hibernate.org/42.html