-->
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: Help with MappingException debugging
PostPosted: Fri Apr 30, 2004 3:09 pm 
Beginner
Beginner

Joined: Wed Dec 03, 2003 2:43 pm
Posts: 22
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]


Top
 Profile  
 
 Post subject: Re: Help with MappingException debugging
PostPosted: Sat May 01, 2004 3:38 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
1. Hibernate load every single mapping at init time and check them.
4. Simplify your mapping to find the offending part is usually the best solution.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 01, 2004 10:02 am 
Beginner
Beginner

Joined: Wed Dec 03, 2003 2:43 pm
Posts: 22
Thanks for the help. I will try that. Also sounds like a good idea for a JUnit test eventually as well.


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.