-->
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.  [ 3 posts ] 
Author Message
 Post subject: java.lang.NoSuchMethodError on BasicEntityPersister
PostPosted: Thu Nov 10, 2005 4:49 am 
Newbie

Joined: Thu Nov 10, 2005 4:24 am
Posts: 8
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
INFO Environment:464 - Hibernate 3.0.5

(JDK version: 1.3.1_09)
Mapping documents:

XDoclet generated:
Quote:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping
>
<class
name="cec.beaumkr.tests.hibernate.per.model.Person"
table="sp2_persons"
proxy="cec.beaumkr.tests.hibernate.per.model.Person"
mutable="true"
>

<id
name="perId"
column="per_id"
type="java.lang.Integer"
unsaved-value="null"
>
<generator class="sequence">
<param name="sequence">SP2_PER_SEQ</param>
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-Person.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>

<property
name="firstName"
type="java.lang.String"
update="true"
insert="true"
column="USUAL_GIVEN_NAME"
not-null="true"
unique="false"
/>

<property
name="lastName"
type="java.lang.String"
update="true"
insert="true"
column="USUAL_FAMILY_NAME"
not-null="true"
unique="false"
/>

<property
name="email"
type="java.lang.String"
update="true"
insert="true"
column="EMAIL"
not-null="true"
unique="true"
/>

<property
name="login"
type="java.lang.String"
update="true"
insert="true"
column="LOGIN"
not-null="false"
unique="true"
/>

<property
name="birthDate"
type="java.sql.Date"
update="true"
insert="true"
column="BIRTH_DATE"
not-null="true"
unique="false"
/>

<property
name="graCd"
type="java.lang.String"
update="true"
insert="true"
column="GRA_CD"
not-null="false"
unique="false"
/>

<property
name="slkCd"
type="java.lang.String"
update="true"
insert="true"
column="SLK_CD"
not-null="false"
unique="false"
/>

<property
name="sex"
type="java.lang.Integer"
update="true"
insert="true"
column="OTH_ID_SEX"
not-null="true"
unique="false"
/>

<property
name="ouId"
type="java.lang.Integer"
update="true"
insert="true"
column="OU_ID"
not-null="false"
unique="false"
/>

<property
name="languageCode"
type="java.lang.String"
update="true"
insert="true"
column="LANG_CD"
not-null="true"
unique="false"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Person.xml
containing the additional properties and place it in your merge dir.
-->

</class>

<query name="findAll"><![CDATA[
from Person per
]]></query>
<query name="findPersonsInUnit"><![CDATA[
from Person per where per.ouId = :ouId
]]></query>

</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():
none :)

This is my first hibernate intro, everything went well with XDoclet creating my mapping files, hibernate getting my mapping from a JAR and so, but the exception I got blocked me in actually trying to use it.

Full stack trace of any exception that occurs:

Quote:
09:31:55,375 INFO SettingsFactory:279 - Default entity-mode: pojo
09:31:55,750 INFO SessionFactoryImpl:152 - building session factory

java.lang.NoSuchMethodError: org.hibernate.persister.entity.BasicEntityPersister: method fromTableFragment(Ljava/lang/String;)Ljava/lang/String; not found
at org.hibernate.persister.entity.BasicEntityPersister.generateSnapshotSelectString(BasicEntityPersister.java:955)
at org.hibernate.persister.entity.BasicEntityPersister.postConstruct(BasicEntityPersister.java:2414)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:375)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
at cec.beaumkr.tests.hibernate.per.manager.PersonManager.<clinit>(PersonManager.java:16)
at cec.beaumkr.tests.hibernate.per.manager.TestPersonManager.setUp(TestPersonManager.java:19)
at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)

09:31:56,656 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:oracle:thin:@devsol2.cc.cec.eu.int:1532:sp2admd

Process finished with exit code -1



Name and version of the database you are using:

Oracle (thin driver)
Oracle9Dialect

Quote:
SQL Statement which produced this data:
select * from v$version

Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
PL/SQL Release 9.2.0.3.0 - Production
CORE 9.2.0.3.0 Production
TNS for Solaris: Version 9.2.0.3.0 - Production
NLSRTL Version 9.2.0.3.0 - Production


and from hibernate log:

Quote:
09:31:54,156 INFO SettingsFactory:77 - RDBMS: Oracle, version: Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.3.0 - Production
09:31:54,187 INFO SettingsFactory:78 - JDBC driver: Oracle JDBC driver, version: 9.0.1.3.0
09:31:54,296 INFO Dialect:92 - Using dialect: org.hibernate.dialect.Oracle9Dialect
09:31:54,359 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)


The generated SQL (show_sql=true):


09:31:55,265 INFO SettingsFactory:257 - Echoing all SQL to stdout

no SQL generated




I hope I have provided enough information.
Google was not very helpfull on the NoSuchMethodError (neither groups or web search). Tried some combinations, found nothing.

Since it's really a Hibernate class I don't believe my libs are fawlty (wrong versions, ..)

Does anybody know what this could be?
(it's not urgent, it's a little "finally get yourself to teach hibernate project" and I quite liked starting it, but I've got no immediate use for it...

thx in advance


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 10, 2005 4:52 am 
Newbie

Joined: Thu Nov 10, 2005 4:24 am
Posts: 8
This is the personmanager (quick&dirty because a first result is always very motivating :))

Code:
public class PersonManager {
    Session sess;

    private static final SessionFactory SESSION_FACTORY = new Configuration().configure().buildSessionFactory();

    public PersonManager() {
        sess = SESSION_FACTORY.openSession();       //todo: use hibernateutil with threadlocal!!!

    }

    public Person getPerson(Integer perId) {
        return (Person) sess.load(Person.class, perId);
    }
}



Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 10, 2005 7:03 am 
Newbie

Joined: Thu Nov 10, 2005 4:24 am
Posts: 8
Consider this item closed.

I use Intellij IDEA, and debugged (not 'run'ned) a TestPersonManager, and the exception was thrown.

When I used the "run" everything worked fine!! Don't ask me why (and if you know why, tell me please) but it's real!

I'm gonne post a link to this on ITN so people might help me there...

thx anyway... now I know why I did not found this problem using google...


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