-->
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.  [ 6 posts ] 
Author Message
 Post subject: NoSuchMethodError:getTableName() for AbstractEntityPersiste
PostPosted: Thu Jan 01, 2004 12:42 pm 
Beginner
Beginner

Joined: Thu Jan 01, 2004 11:36 am
Posts: 23
Location: Belgium
Hello,

I am trying to get hibernate at work using one table and trying to insert records, but I cannot get around the error

"java.lang.NoSuchMethodError: net.sf.hibernate.persister.AbstractEntityPersister: method getTableName()Ljava/lang/String"


weblogic server 6.1 sp 3
Oracle 8.1.7
hibernate 2.1

I defined a datasource in the weblogic server (hibtestDatasource) and got the logging at work; this datasource works as I have already tested it using entity beans.
In my console the following messages are logged (see below)

I already have rebuild hibernate2.jar using build.xml (java 1.3.1_02)
I changed use_outer_join to false as done by some messages on this forum
I changed Oracle9Dialect to OracleDialect

Any hint would be welcome; I would really like to use hibernate for my next project; the test is based on the basic sample in the documentation (getting started);
the content of hibernate.cfg.xml and cat.hbm.xml are listed below

Thanks in advance,

Jan

log:

17:23:38,375 INFO Environment:432 - Hibernate 2.1.1
17:23:38,406 INFO Environment:461 - hibernate.properties not found
17:23:38,437 INFO Environment:481 - using CGLIB reflection optimizer
17:23:38,468 INFO Environment:504 - JVM does not support LinkedHasMap, LinkedHashSet - ordered maps and sets disabled
17:23:38,500 INFO Environment:507 - using workaround for JVM bug in java.sql.Timestamp
17:23:38,546 INFO Configuration:843 - configuring from resource: /hibernate.cfg.xml
17:23:38,562 INFO Configuration:815 - Configuration resource: /hibernate.cfg.xml
17:23:38,843 INFO Configuration:300 - Mapping resource: cat.hbm.xml
17:23:39,203 INFO Binder:225 - Mapping class: eu.cec.admin.hibtest.services.person.Person -> EPES_PERSONNES
17:23:39,406 INFO Configuration:998 - Configured SessionFactory: null
17:23:39,437 INFO Configuration:584 - processing one-to-many association mappings
17:23:39,468 INFO Configuration:593 - processing one-to-one association property references
17:23:39,500 INFO Configuration:618 - processing foreign key constraints
17:23:39,578 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.OracleDialect
17:23:39,625 INFO SettingsFactory:62 - Use outer join fetching: false
17:23:39,703 INFO NamingHelper:26 - JNDI InitialContext properties:{}
17:23:39,750 INFO DatasourceConnectionProvider:51 - Using datasource: hibtestDatasource
17:23:39,796 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
17:23:39,828 INFO SettingsFactory:89 - Use scrollable result sets: true
17:23:39,859 INFO SettingsFactory:90 - JDBC 2 max batch size: 15
17:23:39,890 INFO SettingsFactory:99 - Query language substitutions: {}
17:23:39,921 INFO SettingsFactory:110 - cache provider: net.sf.ehcache.hibernate.Provider
17:23:39,968 INFO Configuration:1057 - instantiating and configuring caches
17:23:40,203 INFO SessionFactoryImpl:119 - building session factory
<01-janv.-04 17:23:40 PST> <Info> <EJB> <EJB Exception during invocation from home: eu.cec.admin.hibtest.services.person.PersonServiceEJB_4rqufb_HomeImpl@ff037886 threw exception: java.lang.NoSuchMethodError: net.sf.hibernate.persister.AbstractEntityPersister: method getTableName()Ljava/lang/String;
not found
java.lang.NoSuchMethodError: net.sf.hibernate.persister.AbstractEntityPersister: method getTableName()Ljava/lang/String; not found
at net.sf.hibernate.persister.AbstractEntityPersister.generateSelectVersionString(AbstractEntityPersister.java:1256)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:878)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:41)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:137)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:739)
at eu.cec.admin.hibtest.util.HibernateUtil.<clinit>(HibernateUtil.java:20)
at eu.cec.admin.hibtest.services.person.PersonServiceEJB.createHibernatePerson(PersonServiceEJB.java:92)
at eu.cec.admin.hibtest.services.person.PersonServiceEJB_4rqufb_EOImpl.createHibernatePerson(PersonServiceEJB_4rqufb_EOImpl.java:37)
at eu.cec.admin.hibtest.services.person.PersonServiceEJB_4rqufb_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

hibernate.cfg.xml:

<hibernate-configuration>

<session-factory>

<property name="connection.datasource">hibtestDatasource</property>
<property name="show_sql">false</property>
<property name="dialect">net.sf.hibernate.dialect.OracleDialect</property>
<property name="use_outer_join">false</property>
<!-- Mapping files -->
<mapping resource="cat.hbm.xml"/>

</session-factory>

</hibernate-configuration>

cat.hbm.xml:

<hibernate-mapping>

<class name="eu.cec.admin.hibtest.services.person.Person" table="EPES_PERSONNES">

<id name="id" type="long" unsaved-value="null" >
<column name="ID" sql-type="NUMBER" not-null="true"/>
<generator class="sequence">
<param name="sequence">epes_sequence</param>
</generator>
</id>

<!-- A cat has to have a name, but it shouldn' be too long. -->
<property name="nom_usuel">
<column name="NOM_USUEL" sql-type="varchar2(100)" not-null="true"/>
</property>

<property name="prenom">
<column name="PRENOM" sql-type="varchar2(50)" not-null="true"/>
</property>

</class>

</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 01, 2004 12:50 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
This sounds really strange, are you sure you don't have two different hibernate jars in the classpath somehow?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 01, 2004 12:56 pm 
Beginner
Beginner

Joined: Thu Jan 01, 2004 11:36 am
Posts: 23
Location: Belgium
the hibernate2.jar is packaged in my ear file;


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 01, 2004 2:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
try for a start to searh on www.hibernate.org after "NoSuchMethodError", and see if that faq entry that pops up is any usefull to ya' ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 02, 2004 12:59 pm 
Beginner
Beginner

Joined: Thu Jan 01, 2004 11:36 am
Posts: 23
Location: Belgium
OK, this problem is solved; after doing a search on "NoSuchMethodError" and looking at some other messages, someone solved the problem by adding target=1.1 to the compiler.

So I recompiled hibernate by adding to build.xml, target "compile", task javac, the attribute target=1.1; then I added this new hibernate2.jar to my .ear file and redeployed; it worked !!

so my build.xml (target compile) is looking like appended at the end of this message, using jdk 1.3.1_02; I got one warning during execution of the build.xml: "could not load definitions from resource clovertasks; it could not be found."

I don't know what "clovertasks" is but I hope to dig in it further.

Thanks for your help

Jan

build.xml:

<target name="compile" depends="init" description="Compile the Java source code">
<available
classname="org.eclipse.core.launcher.Main"
property="build.compiler"
value="org.eclipse.jdt.core.JDTCompilerAdapter"
classpath="${java.class.path}"/>
<javac
target="1.1"
srcdir="${src.dir}"
destdir="${build.dir}"
classpathref="lib.class.path"
debug="${javac.debug}"
optimize="${javac.optimize}"
nowarn="on">
</javac>
</target>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 02, 2004 1:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
The clovertasks warning is just a warning about clover is not available to you because of a missing clover license. Hibernate team got an open source license to get nice reports about test coverage and such ;)

http://www.thecortex.net/clover/

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.