Forums Register Login

org.hibernate.MappingException: Unknown entity: com.hp.ExamRegister in a struts2 tiles integration

+Pie Number of slices to send: Send
I am trying to display a layout here as is given in Layout.jsp. But I get an exception as mentioned in the subject. ExamRegister is a table in my database and i have its POJO also in package com.hp. When i run the project i get the login form i.e. index.jsp. When i enter the details in the form and click the login button the exception is reported.
Please could anybody tell me what is missing and where.
Thanks !!

tiles.xml


web.xml


struts.xml


Layout.jsp



LoginAction.java


exception
+Pie Number of slices to send: Send
Welcome to the Ranch

You appear to have arrived in the wrong forum; I shall try moving you to the Struts forum.
+Pie Number of slices to send: Send
Thanks . Well, I posted again in the correct framework.
+Pie Number of slices to send: Send
This exception:

leads me to believe that this is a Hibernate issue. What is the full stack trace of the error from the Tomcat log file?
Do you have ExamRegister configured as a Hibernate entity? You don't show us the source or the Hibernate config files.
+Pie Number of slices to send: Send
Following is the stack trace and the cfg file respectively.I would also like to mention that I am using Netbeans ide.



cfg


+Pie Number of slices to send: Send
The exception there seems pretty straightforward:



I'd like to know why it mentions an insert to an "employee" table when your class you are fetching in LoginAction is ExamRegister. This leads me to believe that you are not showing us the full stack trace from your first post.
How did you set up ExamRegister with Hibernate? A mapping file or annotations? Can you show us the ExamRegister class and the mapping file (if any).
+Pie Number of slices to send: Send
I am sorry I posted the wrong stack trace.The correct one is as follows:


exam_register is a table in my database. ExamRegister is the corresponding POJO for the table.ExamRegister class and the corresponding XML are as follows:


ExamRegister.java



ExamRegister.hbm.xml



+Pie Number of slices to send: Send
So how is Hibernate supposed to find out about ExamRegister.hbm.xml?
+Pie Number of slices to send: Send
From the configuration file??
+Pie Number of slices to send: Send
in configuration refer your hbm file

cfg
+Pie Number of slices to send: Send
I did as you said Arun, but I got an exception:
+Pie Number of slices to send: Send
The mapping tag should go inside the session-factory tag.
+Pie Number of slices to send: Send
Still getting the following exception:

+Pie Number of slices to send: Send
When Arun wrote "file-path", he meant for you to put in the relative path from the Hibernate config file to the ExamRegister.hbm.xml
+Pie Number of slices to send: Send
Ohh such a dumb mistake! Well, thanks for your help. Much appreciated.
This guy is skipping without a rope. At least, that's what this tiny ad said:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2070 times.
Similar Threads
first struts + tiles application
FreeMarker template error!
Struts2 Filter and Includes
Struts 2: Populating an array of java beans in action classes
The requested list key 'atypes' could not be resolved as a collection/array/map/enumeration/iterator
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:50:37.