This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Could not insert

 
kwyap me
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

This is my first time trying out hibernate. I am attempting to insert a new record via a servlet call in IE. This servlet would in turn invoke a javabean that does the actual work of insertion.

I believe there is something wrong with my deployment. Pls help to check




Details:
------------
App Server: Tomcat 4
Database: SQL Server 2000
Hibernate ver: 2
Error Msg: could not insert: [spectra.commons.hibernate.AppLabs#2]


File Breakdown
----------------
AppLabs.java: This is the persistent POJO
hibernate.cfg.xml: This is located in my tomcat web-inf/classes
Additional remarks: All other library files are located in web-inf/classes


Database Script







 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If Hibernate has got as far as trying to make this insert then there is probably nothing wrong with your deployment.


Error Msg: could not insert: [spectra.commons.hibernate.AppLabs#2]


What else does the error message tell you? There should be some more information from SQL Server as to why it could not insert this record.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"spectra/commons/hibernate/applabs.hbm.xml"

What does this file look like?

Also check your web server console to see if you get a stack trace of an exception, that might give you more information like something like "inserted value for field to long", It should be an SQLException in cases like that.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic