-->
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.  [ 13 posts ] 
Author Message
 Post subject: Hibernate Tools: Eclipse: SessionFactory creation error
PostPosted: Wed Oct 12, 2005 10:56 pm 
Newbie

Joined: Wed Oct 12, 2005 3:59 pm
Posts: 12
I'm using the Hibernate Tools in Eclipse and have successfully generate HBM.XML' and Java Classes for all my components, however I'm getting an error creating the SessionFactory in my Hibernate Configurations panel. I check the class (InvestigativeElement) and it compiles fine, as well as all it's immediate listed dependencies. Anyone know where I should start looking for an error?

Hibernate version:3.x, Tools version: 3alpha5

[b]Mapping documents:

InvestigativeElement.hbm.xml:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<!--
        Auto-generated mapping file from
        the hibernate.org cfg2hbm engine
-->
    <class name="x.InvestigativeElement" table="INVESTIGATIVE_ELEMENT" schema="XXXXXXX">
        <id name="invElmtId" type="integer">
            <column name="INV_ELMT_ID" precision="9" scale="0" />
            <generator class="assigned" />
        </id>
        <property name="invElmtName" type="string">
            <column name="INV_ELMT_NAME" length="64" not-null="true" />
        </property>
        <property name="invElmtDesc" type="string">
            <column name="INV_ELMT_DESC" length="2000" not-null="true" />
        </property>
        <property name="createUser" type="string">
            <column name="CREATE_USER" length="32" not-null="true" />
        </property>
        <property name="createDt" type="timestamp">
            <column name="CREATE_DT" length="7" not-null="true" />
        </property>
        <property name="updateUser" type="string">
            <column name="UPDATE_USER" length="32" />
        </property>
        <property name="updateDt" type="timestamp">
            <column name="UPDATE_DT" length="7" />
        </property>
        <set name="loiInvElmts" inverse="true">
            <key>
                <column name="INV_ELMT_ID" precision="9" scale="0" not-null="true" />
            </key>
            <one-to-many class="x.LoiInvElmt" />
        </set>
        <set name="invElmtPointSchedules" inverse="true">
            <key>
                <column name="INV_ELMT_ID" precision="9" scale="0" not-null="true" />
            </key>
            <one-to-many class="x.InvElmtPointSchedule" />
        </set>
    </class>
</hibernate-mapping>


Full stack trace of any exception that occurs:
Error Log Error: entity class not found: x.InvestigativeElement... details:
java.lang.ClassNotFoundException: x.InvestigativeElement
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:403)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:350)
at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:78)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:95)
at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:163)
at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:43)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:114)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:410)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:219)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1126)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:209)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:71)
at org.hibernate.console.ConsoleConfiguration.initSessionFactory(ConsoleConfiguration.java:207)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:24)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:68)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)

Name and version of the database you are using:
Oracle9i

The generated SQL (show_sql=true):
N/A

Debug level Hibernate log excerpt:
N/A


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 12, 2005 11:01 pm 
Newbie

Joined: Wed Oct 12, 2005 3:59 pm
Posts: 12
I should also mention that it appears that most, if not all, the classes appear in the "Configuration" group in the Hibernate Configuration panel.

Thanks,

David


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 1:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the configuration node just shows what information it was possible to extract from the configuration files - the sessionfactory need the actual classes to work; thus check if you have the eclipse build path in classpath of the console configuration.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 8:58 am 
Newbie

Joined: Wed Oct 12, 2005 3:59 pm
Posts: 12
OK, that seems reasonable-- but how do I add the build path the configuration... I don't see any "button" in the configuration window that allows me to add a path, only JARs and External JARs.

Is there a file I need to edit manually to get the build path to appear?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 9:04 am 
Newbie

Joined: Wed Oct 12, 2005 3:59 pm
Posts: 12
OK, so Add JARs also lets me add a Path -- very unintuitive... suggest a name change for the button -- "Add JAR/Directory"

Thanks,

David


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 10:59 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
use a more recent version ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 11:01 am 
Newbie

Joined: Fri Feb 20, 2004 1:39 pm
Posts: 16
Location: Norway
Had the same issue before, and took me a while to figure out how to add the directory. Should change the name for sure..

One other thing that i find too well hidden is the HQL-editor! The icon did seem greyed out most of the time.

Just an idea, but maybe it could just been a "view panel" with a listbox or tabs with the consol config.
Or at least be able to click on the icon when i am on any subelements in the tree. (should not be too hard to find the parent from the code, right ;)

Erik


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 11:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yeah i know the hql editor is not the most obvious ui wise ;)

I don't get your message in:

"Just an idea, but maybe it could just been a "view panel" with a listbox or tabs with the consol config." ...what does that mean ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 11:12 am 
Newbie

Joined: Fri Feb 20, 2004 1:39 pm
Posts: 16
Location: Norway
:)

I mean like an element u you can find in the WINDOW>SHOW VIEW>OTHER... etc.

Hmm have a feeling i am mixing something here :P

If it were like a "panel" u could only select the right consol config in some sort of list maybe..?

(i think it would be easier to find for many users. that is why i said that.)

Well bottomline is.. for me it was hard to find. The first thing i did was looking for it as a view..
Anyone else did the same?

-Erik


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 11:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and that wasn't just because it *used* to be a view ?

now its a true editor with its advantages (& some disadvantages)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 11:37 am 
Newbie

Joined: Fri Feb 20, 2004 1:39 pm
Posts: 16
Location: Norway
:P ok maybe.

I can see the advantages too. (and i think i like that to be honest.)

But what do u think about my idea of making it visable on very sub node in the tree?

can it be misguiding or would it make it easier to get starting?

I think atleast it should be "pushed" up in documentation.

(I know where it are now though, just hoping to help some newcomers here)

Erik

(Wow we have a good speed in posting :P)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 11:40 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it should/will be available on the other nodes (basically anything that has any remote chance of being a "link" to a hibernate console configuration)

I just haven't had time to get around it (added more urgent stuff ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 11:46 am 
Newbie

Joined: Fri Feb 20, 2004 1:39 pm
Posts: 16
Location: Norway
Great! =)

Keep up the good work


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.