-->
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: Hiber8IDE installation info. ???
PostPosted: Wed Nov 10, 2004 12:42 pm 
Regular
Regular

Joined: Thu Aug 19, 2004 9:28 am
Posts: 63
Hi,

I'm running Hiber8IDE in JBuilder 2005 in it's own project. The HibernIDE window appears but I can't figure out how to set it up. Where should I put the Class files and the Hbm.Xml files? I tried the Hibern8IDE installation root but when I click the Apply button I get the following message in a popup window: java.lang.NoClassDefFoundError: Person(Wrong name: Hibernate/Person). The Person.class and Person.Java are in .../hibernate folder there's also a copy of the same file right at the root of Hibern8IDE.

Could someone please give me a concrete and complete example of a setup for one table? I tried so many different scenarios, I don't know what to try anymore :(

I'm wondering how Hiber8IDE uses the field values we fill up, like, Mapping files, Class path and Properties. If we have to put the mapping files in the config file, why do we have to input them again in the Hibern8IDE?

Thanks in advance.

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

<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin

http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->

<class
name="Person"
table="PERSON"
>

<id
name="cid"
type="java.lang.Integer"
column="CID"
>
<generator class="assigned" />
</id>

<property
name="familyName"
type="java.lang.String"
column="Family_Name"
length="30"
/>
<property
name="givenName"
type="java.lang.String"
column="Given_Name"
length="30"
/>
<property
name="initials"
type="java.lang.String"
column="Initials"
length="4"
/>
<property
name="salutation"
type="java.lang.Integer"
column="Salutation"
length="4"
/>

<!-- associations -->

</class>
</hibernate-mapping>


Hibernate version:
2.2.3
Hibern8IDE version:
2.1.2
Mapping documents:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.sybase.jdbc2.jdbc.SybDriver</property>
<property name="hibernate.connection.url">jdbc:sybase:Tds:999.999.999.999:1234/MyDB</property>
<property name="hibernate.connection.username">UserName</property>
<property name="hibernate.connection.password">password</property>
<property name="dialect">net.sf.hibernate.dialect.SybaseDialect</property>
<!-- Mapping files -->
<mapping resource="Person.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Name and version of the database you are using:
ASE (Sybase) 12


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2004 3:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
You don't need to specify mapping files.

Just think of the configuration as how you would configure hibernate.

If you have it all defined in a hibernate.cfg.xml then that is all you need to specify.

regarding classpath then you just need to tell hibernate console (its new name) which classpath to use.

I can recommend using the current version of hibernate console in v21branch.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2004 3:43 pm 
Regular
Regular

Joined: Thu Aug 19, 2004 9:28 am
Posts: 63
Thanks Max.

I was just about to go look in the source code. So, if I understand, for one class called Person in package hibernate (hibernate.Person), I just have to declare the mapping in my hibernate.cfg.xml file like this:

<mapping resource="Person.hbm.xml"/>

Here the full path to my Hibern8IDE installation:
C:\Documents and Settings\xxx\jbproject\Hibern8IDE

Here the full path to my Hibernate class folder:
C:\Documents and Settings\xxx\jbproject\Hibern8IDE\hibernate

I've put my hibernate.cfg.xml in C:\Documents and Settings\xxx\jbproject\Hibern8IDE

I've put my Person.hbm.xml in C:\Documents and Settings\xxx\jbproject\Hibern8IDE\hibernate

I've put my Person.class in C:\Documents and Settings\xxx\jbproject\Hibern8IDE\hibernate

With this setup, when I click the Apply button, I get "java.lang.NoClassDefFoundError: Person (wrong name: hibernate/Person)"


Please, tell me how I should do this. I tried all kind of variations and can't figure it out. It should be simple.

P.S.: I'll be downloading the new Hibernate console tonight. I took this version because I wasn't sure the most recent one was compatible with my Hibernate version.


Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2004 3:52 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it looks like you have a .class file in a hibernate package, but have not added a package declaration to you Person.java file.

Besides, i would suggest that you separate your own code from the tools you want to use on them - makes it much easier to debug

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2004 4:44 pm 
Regular
Regular

Joined: Thu Aug 19, 2004 9:28 am
Posts: 63
Max, the person.hbm.xml, person.java and person.class file are all working fine in my development project. Yes, Person.java is in a package called Hibernate and the package declaration is there. That's why I have a Hibernate folder where my Hibern8ide's installed.

It must be a problem with my classpath. What's the minimum classpath I need to have my setup working (see setup in previous post)? In which folder does Hibern8IDE look for the hbm.xml files and Class files?

Thx


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2004 5:17 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i looks EXACTLY where you tell it to.

You configure it with absolute paths, so it looks there...

_________________
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.