aspose file tools*
The moose likes Object Relational Mapping and the fly likes Something wrong for hibernate! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Something wrong for hibernate!" Watch "Something wrong for hibernate!" New topic
Author

Something wrong for hibernate!

Peter Song
Greenhorn

Joined: Oct 27, 2010
Posts: 4
Now! I copy two Exceptions:
org.hibernate.exception.SQLGrammarException: could not fetch initial value for increment generator
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.id.IncrementGenerator.getNext(IncrementGenerator.java:107)
at org.hibernate.id.IncrementGenerator.generate(IncrementGenerator.java:44)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:91)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:530)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:518)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:514)
at com.lovo.epet.dao.impl.PetInfo.insertPet(PetInfo.java:45)
at com.lovo.epet.service.impl.AddPet.addPetInfo(AddPet.java:22)
at com.lovo.epet.struts.action.RegisterAction.execute(RegisterAction.java:57)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Object 'PetInfo' is futile。
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:477)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:777)
at org.hibernate.id.IncrementGenerator.getNext(IncrementGenerator.java:85)
... 31 more
This is a hibernate project.
But I was scaned agin and agin,I have found nothing wrong from my project!
HELP........ Thank you!
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


Caused by: java.sql.SQLException: Object 'PetInfo' is futile。


Does a table called PetInfo exist?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Peter Song
Greenhorn

Joined: Oct 27, 2010
Posts: 4
Yes! One table 'PetInfo' in my database!Do you help me?
Rajan Chinna
Ranch Hand

Joined: Jul 01, 2004
Posts: 320
Does the PetInfo entity has primary id key ?

<id
column="PET_ID"
name="Id"
type="java.lang.Long"
>
<generator class="assigned"/>
</id>
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


Caused by: java.sql.SQLException: Object 'PetInfo' is futile。

Not sure what language you are working in, but what does futile。mean? I don't know of SQL Server ever returning this message in English, so I'm assuming its not English your server is running in?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Something wrong for hibernate!
 
Similar Threads
hibernate3.3-spring3 project
Error :- when inserting values in Database thorugh hibernate
hibernate3 save method exception
JDBC Driver class not found
hibernate exception SQLGrammarException could not fetch initial value for increment