Subject | error with hibernate: generator |
---|---|
Author | Cristiano M. Magalhães |
Post date | 2005-05-10T11:16:07Z |
My metadata file is something like this:
<class name="com.expert.pojos.Usuario">
<id
name="id"
column="ID"
type="int"
unsaved-value="null">
<generator class="native">
</generator>
</id>
...
</class>
Well, I wrote the java code inside a try block and the "catch" block
print a exception like this:
ERROR http-8080-Processor25
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/expert].[action]
- Servlet.service() for servlet action threw exception
java.lang.NoClassDefFoundError: javax/transaction/SystemException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at
org.hibernate.id.IdentifierGeneratorFactory.class$(IdentifierGeneratorFactory.ja\
va:25)
at
org.hibernate.id.IdentifierGeneratorFactory.<clinit>(IdentifierGeneratorFactory.\
java:71)
at
org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:135\
)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:166)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1054)
at com.expert.dao.HibernateUtil.<clinit>(HibernateUtil.java:34)
at com.expert.dao.DUsuarios.<init>(DUsuarios.java:22)
at com.expert.servicos.SUsuarios.getUsuario(SUsuarios.java:72)
at com.expert.struts.login.LogonAction.execute(LogonAction.java:31)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.\
java:421)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt\
erChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.\
java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2\
13)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1\
78)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107\
)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnectio\
n(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:52\
7)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorker\
Thread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:68\
4)
at java.lang.Thread.run(Thread.java:595)
What's going on with the hibernate? What did I write wrong?
I think firebird and hibernate have some problem with "native" id
declaration. But I don't know if I'm right.
I'm using Hibernate 3.0 with JDK 1.5
Please, can you help-me?
Cristiano Meira
<class name="com.expert.pojos.Usuario">
<id
name="id"
column="ID"
type="int"
unsaved-value="null">
<generator class="native">
</generator>
</id>
...
</class>
Well, I wrote the java code inside a try block and the "catch" block
print a exception like this:
ERROR http-8080-Processor25
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/expert].[action]
- Servlet.service() for servlet action threw exception
java.lang.NoClassDefFoundError: javax/transaction/SystemException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at
org.hibernate.id.IdentifierGeneratorFactory.class$(IdentifierGeneratorFactory.ja\
va:25)
at
org.hibernate.id.IdentifierGeneratorFactory.<clinit>(IdentifierGeneratorFactory.\
java:71)
at
org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:135\
)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:166)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1054)
at com.expert.dao.HibernateUtil.<clinit>(HibernateUtil.java:34)
at com.expert.dao.DUsuarios.<init>(DUsuarios.java:22)
at com.expert.servicos.SUsuarios.getUsuario(SUsuarios.java:72)
at com.expert.struts.login.LogonAction.execute(LogonAction.java:31)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.\
java:421)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt\
erChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.\
java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2\
13)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1\
78)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107\
)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnectio\
n(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:52\
7)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorker\
Thread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:68\
4)
at java.lang.Thread.run(Thread.java:595)
What's going on with the hibernate? What did I write wrong?
I think firebird and hibernate have some problem with "native" id
declaration. But I don't know if I'm right.
I'm using Hibernate 3.0 with JDK 1.5
Please, can you help-me?
Cristiano Meira