File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Servlet getting record from MySQL through hibernate. Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet getting record from MySQL through hibernate. Exception" Watch "Servlet getting record from MySQL through hibernate. Exception" New topic
Author

Servlet getting record from MySQL through hibernate. Exception

Vladimir Svydenko
Greenhorn

Joined: Jul 03, 2010
Posts: 4

Hi

I am newbie in Java, and it is my first project.
I have developed a servlet. This servlet is receiving and inserting record into MySQL through hibernate using eclispe ide.
I have developed the following code:
Servlet UserManagerServlet


class HibUtil


When I run my code then I find the following exception.


UserManagerServlet.java:56


UserManagerServlet.java:87
List result =


Pleas tell me that where I have done the mistake and how can I resolove the error.
I am sorry for my English

Note:
For test i have wrote new class DelMe2 and object arn was succesfull added to MySQL

vijin das
Ranch Hand

Joined: Jun 07, 2010
Posts: 129



where is your utilis package ? is it get imported properly.... and remember your HibUti is a singleton .....


just check this link hibernatesamples.....



VIJINDAS
Vladimir Svydenko
Greenhorn

Joined: Jul 03, 2010
Posts: 4

My project after deploying


C:\apache-tomcat-6.0.26\webapps\servlet_db\
|
---META-INF
|...............|
|................-----MANIFEST.MF
---WEB-INF
|...............|
|................-----classes
|...............|...............|
|...............|................-org
|...............|...............|.....|
|...............|...............|......-test
|...............|...............|...........|
|...............|...............|...........-UserManagerServlet.class, DelMe2.class, users.class
|...............|...............|
|...............|................-utils
|...............|.....................|
|...............|......................-HibUtil.class
|...............|
|............... ---- lib(*.jars)
|...............|
|............... --web.xml
|
-index.jsp

Servlet



Exception:


org.test.UserManagerServlet.listUsers(UserManagerServlet.java:91)
is
Vladimir Svydenko
Greenhorn

Joined: Jul 03, 2010
Posts: 4

I have solved my problem.
Thanks for everyone...
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 510

If you post here, what you did to solve the problem, i mean solution, it will be helpful for others, who might face the problem or facing the problem.. Anyway, glad you solved your problem.. By, the by welcome to javaranch..


Regards, Prasad
SCJP 5 (93%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet getting record from MySQL through hibernate. Exception