This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I'm using jsf with richfaces, jpa, hibernate, JBoss 4.2 and MySQL.
I get an error when i try to access a specific page, but the error aren't guiding me to problem root.
Detail: class "br/com/inforen/model/GrupoFamiliar" exists and is there!
To start, the exception message at its own is already odd.
I would expect the full qualified class name here, but it shows a file system path. Aren't you specifying file system paths instead of class names somewhere in the Hibernate configuration?
* One more information, i'm using a Mac OS Leopard.
I looked for something odd and didn't find anything.
I mapped class like this: <mapping class="br.com.inforen.model.GrupoFamiliar"/>
Bauke Scholtz wrote:To start, the exception message at its own is already odd.
I would expect the full qualified class name here, but it shows a file system path. Aren't you specifying file system paths instead of class names somewhere in the Hibernate configuration?
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
Oh, I now see that you're using JPA. Where is the persistence.xml located? It should be in WEB-INF/classes/META-INF.
Rodrigo Del Bianco
Greenhorn
Joined: Jan 09, 2009
Posts: 6
posted
0
Yes, my first application using JPA.
It is located in WEB-INF/classes/META-INF.
I don't know what is wrong!
Some idea?
thanks
Rodrigo
Bauke Scholtz wrote:Oh, I now see that you're using JPA. Where is the persistence.xml located? It should be in WEB-INF/classes/META-INF.
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
Don't you have the persistence.xml duplicated at another locations?
Edit: you have a hibernate.cfg.xml file around as well? You shouldn't be using it when you use JPA.
Which tutorial/book are you using while implementing this?
Rodrigo Del Bianco
Greenhorn
Joined: Jan 09, 2009
Posts: 6
posted
0
i used an IDE generated application for test.
i removed hibernate.cfg.xml, but this shouldn't be a problem, right? If my application have a part using hibernate sessions?
I put my persistence.xml in WebContent/META-INF. If i put in WEB-INF/classes/META-INF i get another exception because EntityManagerFactory can't find the persistence unit.
Bauke Scholtz wrote:Don't you have the persistence.xml duplicated at another locations?
Edit: you have a hibernate.cfg.xml file around as well? You shouldn't be using it when you use JPA.
Which tutorial/book are you using while implementing this?
Try by putting persistence.xml in src/META-INf folder. your entity manager should find atleast from here.
Actually it should work even if its there in WEB-INF/classes/META-INF foler. I've also faced the same prob in IDE.
SCJP 1.5
Rodrigo Del Bianco
Greenhorn
Joined: Jan 09, 2009
Posts: 6
posted
0
Ok, putting persistence.xml in src/META-INf folder i got the last exception with paths, opposite to full qualified class name.
Srini Jadcherla wrote:Try by putting persistence.xml in src/META-INf folder. your entity manager should find atleast from here.
Actually it should work even if its there in WEB-INF/classes/META-INF foler. I've also faced the same prob in IDE.
Srini Mutpur
Greenhorn
Joined: Mar 29, 2008
Posts: 24
posted
0
Could you paste the exact exception which you are getting?
Rodrigo Del Bianco wrote:Ok, putting persistence.xml in src/META-INf folder i got the last exception with paths, opposite to full qualified class name.
Rodrigo Del Bianco
Greenhorn
Joined: Jan 09, 2009
Posts: 6
posted
0
The exception:
I didn't find a cause for this exception occur.
javax.servlet.ServletException: Servlet execution threw an exception
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
Srini Jadcherla wrote:Could you paste the exact exception which you are getting?
Rodrigo Del Bianco wrote:Ok, putting persistence.xml in src/META-INf folder i got the last exception with paths, opposite to full qualified class name.