I have been working with Hibernate, bought the books and read the forums and I am faced with a problem I cannot surmount. :-(
I have created a 'core.jar' with my back-end persistence layers encapsulated by DAOs. This jar has had JUnit tests run against it with ~20 unit tests that cover all of the CRUD operations for the User class in question. This 'core.jar' is then embedded within a WAR file, used by my servlets, and then deployed into Tomcat 5.0.28. For the most part, all of the mappings work great and have given little problems.
followed by a rollback. This same code outside the WAR file passes the same test with the same data contained within. I have a constraint that I am not allowed to keep the password within the session and therefore it may not be contained within a member variable of the User object.
2005-04-30 15:29:47,015 [http-8080-Processor23] DEBUG net.sf.hibernate.persister.EntityPersister - Dehydrating entity: [com.esi.base.address.StreetAddress#<null>]
2005-04-30 15:29:47,015 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding 'Mesa' to parameter: 1
2005-04-30 15:29:47,031 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding 'AZ' to parameter: 2
2005-04-30 15:29:47,031 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding 'E' to parameter: 3
2005-04-30 15:29:47,031 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding '55th' to parameter: 4
2005-04-30 15:29:47,031 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding '555' to parameter: 5
2005-04-30 15:29:47,031 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding 'WAY' to parameter: 6
2005-04-30 15:29:47,046 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding '555' to parameter: 7
2005-04-30 15:29:47,046 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding '85555' to parameter: 8
2005-04-30 15:29:47,046 [http-8080-Processor23] DEBUG net.sf.hibernate.type.TimestampType - binding '2005-04-30 15:29:46' to parameter: 9
2005-04-30 15:29:47,062 [http-8080-Processor23] DEBUG net.sf.hibernate.type.TimestampType - binding '2005-04-30 15:29:46' to parameter: 10
2005-04-30 15:29:47,125 [http-8080-Processor23] DEBUG net.sf.hibernate.persister.AbstractEntityPersister - Natively generated identity: 464
2005-04-30 15:29:47,125 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.BatcherImpl - done closing: 0 open PreparedStatements, 0 open ResultSets
2005-04-30 15:29:47,125 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.BatcherImpl - closing statement
2005-04-30 15:29:47,125 [http-8080-Processor23] DEBUG net.sf.hibernate.engine.Cascades - done processing cascades for: com.esi.base.contact.Contact
2005-04-30 15:29:47,125 [http-8080-Processor23] DEBUG net.sf.hibernate.persister.EntityPersister - Inserting entity: com.esi.base.contact.Contact (native id)
2005-04-30 15:29:47,140 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.BatcherImpl - about to open: 0 open PreparedStatements, 0 open ResultSets
2005-04-30 15:29:47,140 [http-8080-Processor23] DEBUG net.sf.hibernate.SQL - insert into contact (l_name, m_init, f_name, phone, web_addr, street_addr, email, fax, company, insert_date, update_date) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2005-04-30 15:29:47,140 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.BatcherImpl - preparing statement
2005-04-30 15:29:47,140 [http-8080-Processor23] DEBUG net.sf.hibernate.persister.EntityPersister - Dehydrating entity: [com.esi.base.contact.Contact#<null>]
2005-04-30 15:29:47,140 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding 'test' to parameter: 1
2005-04-30 15:29:47,156 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding 'S' to parameter: 2
2005-04-30 15:29:47,156 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding 'ms' to parameter: 3
2005-04-30 15:29:47,156 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding '(480)555-5555' to parameter: 4
2005-04-30 15:29:47,156 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding 'www.mstest.com' to parameter: 5
2005-04-30 15:29:47,171 [http-8080-Processor23] DEBUG net.sf.hibernate.type.LongType - binding '464' to parameter: 6
2005-04-30 15:29:47,171 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding '
[email protected]' to parameter: 7
2005-04-30 15:29:47,171 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding '(480)555-5556' to parameter: 8
2005-04-30 15:29:47,171 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding 'mstest co' to parameter: 9
2005-04-30 15:29:47,187 [http-8080-Processor23] DEBUG net.sf.hibernate.type.TimestampType - binding '2005-04-30 15:29:46' to parameter: 10
2005-04-30 15:29:47,187 [http-8080-Processor23] DEBUG net.sf.hibernate.type.TimestampType - binding '2005-04-30 15:29:46' to parameter: 11
2005-04-30 15:29:47,296 [http-8080-Processor23] DEBUG net.sf.hibernate.persister.AbstractEntityPersister - Natively generated identity: 260
2005-04-30 15:29:47,296 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.BatcherImpl - done closing: 0 open PreparedStatements, 0 open ResultSets
2005-04-30 15:29:47,296 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.BatcherImpl - closing statement
2005-04-30 15:29:47,296 [http-8080-Processor23] DEBUG net.sf.hibernate.engine.Cascades - processing cascades for: com.esi.base.contact.Contact
2005-04-30 15:29:47,296 [http-8080-Processor23] DEBUG net.sf.hibernate.engine.Cascades - done processing cascades for: com.esi.base.contact.Contact
2005-04-30 15:29:47,312 [http-8080-Processor23] DEBUG net.sf.hibernate.engine.Cascades - done processing cascades for: com.esi.base.security.User
2005-04-30 15:29:47,328 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.WrapVisitor - Wrapped collection in role: com.esi.base.security.User.roles
2005-04-30 15:29:47,328 [http-8080-Processor23] DEBUG net.sf.hibernate.persister.EntityPersister - Inserting entity: com.esi.base.security.User (native id)
2005-04-30 15:29:47,328 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.BatcherImpl - about to open: 0 open PreparedStatements, 0 open ResultSets
2005-04-30 15:29:47,328 [http-8080-Processor23] DEBUG net.sf.hibernate.SQL - insert into edmap_users (username, contact_id, insert_date, update_date) values (?, ?, ?, ?)
2005-04-30 15:29:47,328 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.BatcherImpl - preparing statement
2005-04-30 15:29:47,343 [http-8080-Processor23] DEBUG net.sf.hibernate.persister.EntityPersister - Dehydrating entity: [com.esi.base.security.User#<null>]
2005-04-30 15:29:47,343 [http-8080-Processor23] DEBUG net.sf.hibernate.type.StringType - binding 'mstest' to parameter: 1
2005-04-30 15:29:47,343 [http-8080-Processor23] DEBUG net.sf.hibernate.type.IntegerType - binding '260' to parameter: 2
2005-04-30 15:29:47,343 [http-8080-Processor23] DEBUG net.sf.hibernate.type.TimestampType - binding '2005-04-30 15:29:46' to parameter: 3
2005-04-30 15:29:47,375 [http-8080-Processor23] DEBUG net.sf.hibernate.type.TimestampType - binding '2005-04-30 15:29:46' to parameter: 4
2005-04-30 15:29:47,421 [http-8080-Processor23] DEBUG net.sf.hibernate.persister.AbstractEntityPersister - Natively generated identity: 83
2005-04-30 15:29:47,421 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.BatcherImpl - done closing: 0 open PreparedStatements, 0 open ResultSets
2005-04-30 15:29:47,421 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.BatcherImpl - closing statement
2005-04-30 15:29:47,437 [http-8080-Processor23] DEBUG net.sf.hibernate.engine.Cascades - processing cascades for: com.esi.base.security.User
2005-04-30 15:29:47,437 [http-8080-Processor23] DEBUG net.sf.hibernate.engine.Cascades - cascading to collection: com.esi.base.security.User.roles
2005-04-30 15:29:47,437 [http-8080-Processor23] DEBUG net.sf.hibernate.engine.Cascades - cascading to saveOrUpdate()
2005-04-30 15:29:47,437 [http-8080-Processor23] DEBUG com.esi.base.realty.HibernateUtil - Tyring to rollback database transaction of this thread.
2005-04-30 15:29:47,453 [http-8080-Processor23] DEBUG net.sf.hibernate.transaction.JDBCTransaction - rollback
2005-04-30 15:29:47,484 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.SessionImpl - transaction completion
2005-04-30 15:29:47,484 [http-8080-Processor23] DEBUG com.esi.base.realty.HibernateUtil - Closing Session of this thread.
2005-04-30 15:29:47,484 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.SessionImpl - closing session
2005-04-30 15:29:47,484 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.SessionImpl - disconnecting session
2005-04-30 15:29:47,500 [http-8080-Processor23] DEBUG net.sf.hibernate.impl.SessionImpl - transaction completion
[b][color=red]2005-04-30 15:29:47,515 [http-8080-Processor23] ERROR com.esi.web.edmap.action.CreateUserAction - Attempt failed to save the User information for user mstest
com.esi.base.exception.InfrastructureException: net.sf.hibernate.MappingException: No persister for: java.lang.String[/color][/b]
at com.esi.base.security.dao.UserDAO.save(UserDAO.java:111)
at com.esi.base.security.dao.UserDAO.saveUserPass(UserDAO.java:314)
at com.esi.web.edmap.action.CreateUserAction.execute(CreateUserAction.java:59)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Caused by: net.sf.hibernate.MappingException: No persister for: java.lang.String
at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:347)
at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2690)
at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2697)
at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1382)
at net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:114)
at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:436)
at net.sf.hibernate.engine.Cascades.cascadeCollection(Cascades.java:526)
at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:452)
at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:503)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:952)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:857)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:775)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1388)
at com.esi.base.security.dao.UserDAO.save(UserDAO.java:109)
... 34 more
2005-04-30 15:29:47,531 [http-8080-Processor23] DEBUG com.esi.web.edmap.action.CreateUserAction - execute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) - end
See the log and stack trace above in the Stack Trace section.
See the log and stack trace above in the Stack Trace section.