Hi,
I am trying to debug why I am getting an annoying MappingExceptionthat I have been unable to debug thus far. Unfortunately, we have had a very large, often changing schema that I am doing the hibernate mappings for (using xdoclet to create the mappings). The exception that I am getting is:
Code:
net.sf.hibernate.MappingException: No persister for: java.lang.String
at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:344)
at net.sf.hibernate.type.EntityType.toString(EntityType.java:79)
at net.sf.hibernate.type.ObjectType.toString(ObjectType.java:169)
at net.sf.hibernate.impl.Printer.toString(Printer.java:68)
at net.sf.hibernate.engine.QueryParameters.traceParameters(QueryParameters.java:109)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1520)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at org.audubon.iba.db.BaseDataAccessObject.find(Unknown Source)
at org.audubon.iba.db.BaseDataAccessObject.find(Unknown Source)
at org.audubon.iba.action.LocationIndexAction.execute(Unknown Source)
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.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
at java.lang.Thread.run(Thread.java:536)
When trying to load instances of one class, I get a MappingException, even though I have gotten rid of all the properties of this class except the id and three small properties. Reading other messages on this forum, I saw that this issue has to do with basically a class that is expected to be mapped not being the class presented. I set the log4j logger to debug and it said nothing about , I am wondering the following:
1) Does Hibernate test out all the mappings to see that they are correct upon first load or is this definately an issue with the given class that I am trying to load?
2) Is there any way to get more information about why a mapping exception occurs? (i.e. what property of what class hibernate was trying to map when this exception was thrown)
3) Is there any place in the source that I could insert a log4j debug message that would allow me to find out the information in number 2?
4) Is there any other recommended way of debugging these MappingExceptions?
Any help would be extremely appreciated.
Thanks,
Gabe[/code]