-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Error when trying tutorial java.lang.AbstractMethodError
PostPosted: Sun May 02, 2004 11:06 pm 
Newbie

Joined: Thu Apr 29, 2004 5:49 pm
Posts: 8
Hi all,
I was trying to execute my first persistance example. Which I got from here(The cat class and all)

http://www.hibernate.org/hib_docs/refer ... rt-mapping

I using sequence for id generation. I used diffrent postgress jdbc driver class for version 7.3 and 7.4 both resulted in error given below. I am giving the details below. Can any one help.

Hibernate Version= 2.1.3
Database=Postgress 7.4.2
Web server =Tomcat 5.0.19
Java Level = 1.4.2
OS=Windows XP

Error

java.lang.AbstractMethodError: org.postgresql.jdbc1.Jdbc1DatabaseMetaData.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 test.HibernateUtil.<clinit>(HibernateUtil.java:13)
at com.ftg.ft.action.MyAccountAction.execute(MyAccountAction.java:25)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
at java.lang.Thread.run(Thread.java:536)



------------------------------------------------------------------------
hibernate.cfg.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>

<session-factory>

<property name="connection.datasource">java:comp/env/jdbc/ftconn</property>
<property name="show_sql">true</property>
<property name="dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>
<property name="jdbc.use_get_generated_keys">false</property>

<!-- Mapping files -->
<mapping resource="Cat.hbm.xml"/>

</session-factory>

</hibernate-configuration>

------------------------------------------------------------------------
Cat.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>

<class name="test.Cat" table="cat">


<id name="id" type="long" column="cat_id" unsaved-value="-1">
<generator class="sequence">
<param name="sequence">cat_sequence</param>
</generator>
</id>
<!-- A cat has to have a name, but it shouldn' be too long. -->
<property name="name">
<column name="name" length="16" not-null="true" />
</property>

<property name="sex" />

<property name="weight" />

</class>

</hibernate-mapping>

------------------------------------------------------------------------
cat classs
package test;

public class Cat {

private long id;
private String name;
private char sex;
private float weight;

public Cat() {
}

public long getId() {
return id;
}

private void setId(long id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public char getSex() {
return sex;
}

public void setSex(char sex) {
this.sex = sex;
}

public float getWeight() {
return weight;
}

public void setWeight(float weight) {
this.weight = weight;
}

}
----------------------------------------------------------------


Top
 Profile  
 
 Post subject: I could do this on RHL 9.0
PostPosted: Tue May 04, 2004 8:18 am 
Newbie

Joined: Thu Apr 29, 2004 5:49 pm
Posts: 8
I could run these same code on a Linux (Rh9.0) os which runs and all the other configuration is the same. But I still could't figure out the problem. Does this ring a bell. I am still confused.


Top
 Profile  
 
 Post subject: Same codes work on linux rh9.0 but not on windows 2000 or XP
PostPosted: Tue May 04, 2004 10:36 am 
Newbie

Joined: Thu Apr 29, 2004 5:49 pm
Posts: 8
Same codes work on linux rh9.0 but not on windows 2000 or XP
webcontainer is same tomcat 5.0.19
Database is the same postgress 7.4.x


Log from tomcat 5.0.19 on windows
-----------------------------------------------------------
10:22:50,466 INFO Environment:462 - Hibernate 2.1.3
10:22:50,496 INFO Environment:491 - hibernate.properties not found
10:22:50,516 INFO Environment:519 - using CGLIB reflection optimizer
10:22:50,556 INFO Configuration:872 - configuring from resource: /hibernate.cfg.xml
10:22:50,556 INFO Configuration:844 - Configuration resource: /hibernate.cfg.xml
10:22:51,257 INFO Configuration:328 - Mapping resource: Cat.hbm.xml
10:22:51,728 INFO Binder:229 - Mapping class: test.Cat -> cat
10:22:52,319 INFO Configuration:1030 - Configured SessionFactory: null
10:22:52,319 INFO Configuration:613 - processing one-to-many association mappings
10:22:52,329 INFO Configuration:622 - processing one-to-one association property references
10:22:52,329 INFO Configuration:647 - processing foreign key constraints
10:22:52,479 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.PostgreSQLDialect
10:22:52,489 INFO SettingsFactory:62 - Use outer join fetching: true
10:22:52,529 INFO NamingHelper:26 - JNDI InitialContext properties:{}
10:22:52,539 INFO DatasourceConnectionProvider:51 - Using datasource: java:comp/env/jdbc/ftconn
10:22:52,569 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)



Log from tomcat 5.0.19 on rh 9.0
------------------------------------------------------------------------------------------------------
10:09:32,474 INFO Environment:462 - Hibernate 2.1.3
10:09:32,524 INFO Environment:491 - hibernate.properties not found
10:09:32,539 INFO Environment:519 - using CGLIB reflection optimizer
10:09:32,582 INFO Configuration:872 - configuring from resource: /hibernate.cfg.xml
10:09:32,586 INFO Configuration:844 - Configuration resource: /hibernate.cfg.xml
10:09:33,195 INFO Configuration:328 - Mapping resource: Cat.hbm.xml
10:09:34,114 INFO Binder:229 - Mapping class: test.Cat -> cat
10:09:34,613 INFO Configuration:1030 - Configured SessionFactory: null
10:09:34,629 INFO Configuration:613 - processing one-to-many association mappings
10:09:34,633 INFO Configuration:622 - processing one-to-one association property references
10:09:34,640 INFO Configuration:647 - processing foreign key constraints
10:09:34,757 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.PostgreSQLDialect
10:09:34,769 INFO SettingsFactory:62 - Use outer join fetching: true
10:09:34,813 INFO NamingHelper:26 - JNDI InitialContext properties:{}
10:09:34,890 INFO DatasourceConnectionProvider:51 - Using datasource: java:comp/env/jdbc/ftconn
10:09:34,920 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
10:09:35,638 INFO SettingsFactory:102 - Use scrollable result sets: true
10:09:35,642 INFO SettingsFactory:105 - Use JDBC3 getGeneratedKeys(): false
10:09:35,645 INFO SettingsFactory:108 - Optimize cache for minimal puts: false
10:09:35,649 INFO SettingsFactory:114 - echoing all SQL to stdout
10:09:35,675 INFO SettingsFactory:117 - Query language substitutions: {}
10:09:35,679 INFO SettingsFactory:128 - cache provider: net.sf.ehcache.hibernate.Provider
10:09:35,698 INFO Configuration:1093 - instantiating and configuring caches
10:09:36,354 INFO SessionFactoryImpl:119 - building session factory
10:09:38,114 INFO SessionFactoryObjectFactory:82 - no JNDI name configured


Error on tomcat 5.0.19 on Windows.


2004-05-04 10:22:52 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
java.lang.AbstractMethodError: org.postgresql.jdbc1.Jdbc1DatabaseMetaData.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 test.HibernateUtil.<clinit>(HibernateUtil.java:13)
at com.ftg.ft.action.MyAccountAction.execute(MyAccountAction.java:25)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
at java.lang.Thread.run(Thread.java:534)


How can this happen?
We where almost ready to commit to hybernate than jdo. But now we are loosing heart.
How can we get some help.


Top
 Profile  
 
 Post subject: Can any one help on this error:supportsResultSetType(I)Z
PostPosted: Wed May 05, 2004 4:35 pm 
Newbie

Joined: Thu Apr 29, 2004 5:49 pm
Posts: 8
Hello all,
Can any one give me some pointers to look on wat portion to correct this error.


Top
 Profile  
 
 Post subject: I have solved it
PostPosted: Wed May 05, 2004 11:54 pm 
Newbie

Joined: Thu Apr 29, 2004 5:49 pm
Posts: 8
I went through the source code of hybernate loading the configuration. That code pointed to the capablities of the driver. Finally I found that I have copied all the drivers that came with postggress.
Now I have copied only pg74.1jdbc3.jar

It works fine. You guys are doing really good work. This could potentially bets the whole JDO group.

Bravo


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.