This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Something wrong for hibernate!" Watch "Something wrong for hibernate!" New topic

Something wrong for hibernate!

Peter Song

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(
at org.hibernate.exception.JDBCExceptionHelper.convert(
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(
at org.hibernate.impl.SessionImpl.fireSave(
at com.lovo.epet.dao.impl.PetInfo.insertPet(
at com.lovo.epet.service.impl.AddPet.addPetInfo(
at com.lovo.epet.struts.action.RegisterAction.execute(
at org.apache.struts.action.RequestProcessor.processActionPerform(
at org.apache.struts.action.RequestProcessor.process(
at org.apache.struts.action.ActionServlet.process(
at org.apache.struts.action.ActionServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Caused by: java.sql.SQLException: Object 'PetInfo' is futile。
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(
... 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

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

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 ?

<generator class="assigned"/>
Paul Sturrock

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:
subject: Something wrong for hibernate!
It's not a secret anymore!