• Post Reply Bookmark Topic Watch Topic
  • New Topic

SOS! hibernate error

 
Jielen
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I'm rookie for hibernate,learn it by the its document. but there are some errors puzzle me. It is very great for you to help me.

I use eclipse + tomcat(4.1)+ hibernate 2.1.4 + mysql

All the code and setting are get from first chapter of hibernate document.

I create a simple servlet to test it, get the following message:

(these message is getted from eclipse out put)

00:33:46,270 INFO Environment:462 - Hibernate 2.1.4
00:33:46,280 INFO Environment:491 - hibernate.properties not found
00:33:46,300 INFO Environment:522 - using CGLIB reflection optimizer
00:33:46,310 INFO Configuration:872 - configuring from resource: /hibernate.cfg.xml
00:33:46,320 INFO Configuration:844 - Configuration resource: /hibernate.cfg.xml
00:33:46,580 INFO Configuration:328 - Mapping resource: Cat.hbm.xml
00:33:46,860 INFO Binder:229 - Mapping class: com.jielen.quickstart.Cat -> cat
00:33:47,131 INFO Configuration:1030 - Configured SessionFactory: null
00:33:47,131 INFO Configuration:613 - processing one-to-many association mappings
00:33:47,131 INFO Configuration:622 - processing one-to-one association property references
00:33:47,141 INFO Configuration:647 - processing foreign key constraints
00:33:47,221 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.MySQLDialect
00:33:47,241 INFO SettingsFactory:62 - Use outer join fetching: false
00:33:47,261 INFO NamingHelper:26 - JNDI InitialContext properties:{}
00:33:47,271 INFO DatasourceConnectionProvider:51 - Using datasource: java:comp/env/jdbc/quickstart
00:33:47,301 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)

(these message is getted from ie )

java.lang.AbstractMethodError: org.gjt.mm.mysql.DatabaseMetaData.supportsResultSetType(I)Z
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:75)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)
at com.jielen.quickstart.HibernateUtil.(HibernateUtil.java:21)
at com.jielen.quickstart.PlayCat.addCat(PlayCat.java:18)
at com.jielen.quickstart.CatServlet.service(CatServlet.java:28)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
at java.lang.Thread.run(Thread.java:536)

 
Don Stadler
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like you have a missing hibernate.properties file. In your directory structure should exist a hibernate.properties file in the src directory. The contents of this file should look like this (for the open-source HSQLDB database):

hibernate.dialect=net.sf.hibernate.dialect.HSQLDialect
hibernate.connection.driver_class=org.hsqldb.jdbcDriver
hibernate.connection.url=jdbc:hsqldb:<data-dir>/music
hibernate.connection.username=sa
hibernate.connection.password
[ July 16, 2004: Message edited by: Don Stadler ]
 
pascal betz
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

if it is about a missing ibernate.property file, then yours should look like this (since you use mysql)


change all YOUR_XYZ occurences to reflect your environment.
if this does not help:
change logging level

cheers

pascal
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Jielen"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it

here.

Thanks! and welcome to the JavaRanch!

Mark
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!