-->
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.  [ 14 posts ] 
Author Message
 Post subject: Hibernate Tools alpha 4 issues
PostPosted: Thu Jun 09, 2005 11:26 am 
Newbie

Joined: Thu Jun 09, 2005 10:34 am
Posts: 10
Hello. I'm relatively new to Eclipse and Hibernate, so I appologize if should be able to sort this out myself.

I recently upgraded to Alpha 4 of hibernate tools from Alpha 2, and I'm having some issues. I'm using a fresh install of Eclipse 3.1RC1. Initially I had only the hibernate-tools plugin installed, although I've since installed JBoss IDE 1.5m1 and Eclipse WTP 0.7M4 (and it's dependencies) in the hope that it might correct some of my issues. This didn't seem to make a difference though.

Issue 1 - Ant Task

I have the following Ant task in my build.xml, which runs fine (even now) when I have alpha 2 hibernate-tools.jar in my project's libs directory. Replacing this with alpha 4 causes it to break.

The taskdef:

<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="class.path" />

The task:

<target name="hibernate" depends="clean" description="Build Java files from HBM">
<hibernatetool destdir="${dir.src}" classpath="${dir.src}/mappings">
<configuration configurationfile="src/hibernate.cfg.xml" />
<hbm2java />
<hbm2ddl drop="false" />
</hibernatetool>
</target>

The error:

...ProjectPath\build.xml:46: org.hibernate.tool.hbm2x.ExporterException: Error while processing template pojo/javaclass.vm

Initially I only replaced hibernate-tools.jar. However, I've since copied the entire contents of eclipse\plugins\org.hibernate.eclipse_3.0.0.alpha4\lib into my project's lib directory, with no effect.

Issue 2 - Mapping Editor

The mapping editor plugin doesn't seem to be loading. Only the Core, Console, and Help plugins are showing up in "About Eclipse Platform Plugins", and I don't see anything that looks like a hibernate mapping plugin when I try to associate hbm files in File Associations.

I know this probably isn't enough information to tell me anything useful. What else should I be providing?


Finally, does Alpha 4 require JBoss IDE or not? The new and noteworthy notes led me to believe that it was using WTP now, and included all that was required. However, the page http://www.hibernate.org/hib_docs/tools ... index.html says I need it.

Thank you very much.

Scott


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 1:08 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Starting from the back:

alpha 4 does not require JBossIDE - if the docs mention it then thats a "bug". please report in jira.

alpha 4 is just using WTP and if you install it from the download or updatesite you also get the minimal set of jars from WTP you need to run alpha4.

The mapping editor is now a WTP editor, meaning it is automatically activated if you use the standard XML editor. One way to see its activated is that the outline view now contain the first attribute of each xml line (normal WTP xml outline does not do this).
Furthermore you should get the code completion for class/field/property names etc.

Ant issue - you example looks very much like what our unit test does so i'm surprised it does not work. Could you please report it to the jira with full classpath refs ?

Thank you !

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 2:59 pm 
Newbie

Joined: Thu Jun 09, 2005 10:34 am
Posts: 10
Thanks for the quick reply.

I'm still not having any luck with the mapping editor. It doesn't look like the WTP xml editor is active.

I'm doing the following:

-Extract fresh copy of Eclipse3.1RC1 for Win32 into a new folder
-Launch eclipse, and create new workspace
-Add update site http://downloads.jboss.com/jbosside/upd ... velopment/
-Install hibernate tools alpha 4 from update site
-Restart eclipse
-Add *.hbm to Text/XML in "Content Types"

Hbm files are still being opened as normal text, and I don't appear to have XML Editor or XML Source Page Editor available in the File Associations section, which I would normally have after installing WTP.

If perform a full install of WTP M4 prior to installing hibernate tools alpha 4, I do then of course get XML Editor and XML Source Page Editor. It doesn't show the first attribute along side the tag in the outline view however, nor do I seem to have any of the extra mapping editor features.

Thanks again.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 4:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
what if the file is just named something.hbm.xml ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 5:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Damn - some plugin must be missing.... damn i hate dynamic loading of plugins in eclipse ,)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 5:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Installing WTP will solve you problem AFAIK (but then again you say that doesnt help either)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 5:12 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
install wtp and start eclipse with -clean options

It work fine, except if you have mixed version - wtp 4 doesn't work with eclipse rc1 - choose newer wtp build

regards


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 5:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I haven't use any newer build from WTP and it works fine here ,)

at least for the editing stuff

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 5:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ok - got it (i think ;)

org.eclipse.draw2d is missing in the download.

Get that and it should work. i'll add it to the updatesite ASAP (tomorrow)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 2:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Hi guys,

I have just realized that WTP does not update their plugin version numbers between Milestones (my bad), so currently the plugins you get from the updatesite is older than WTP M4.

Installing WTP M4 and using the download from sf.net should work.

Will try and get a alpha4a out to make it clean.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 7:03 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
we have uploaded a alpha4a to the sf.net download.

this download contain all the dependencies needed to run on a clean RC1.

unfortunately the updatesite won't work for this.

-max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 8:08 am 
Newbie

Joined: Thu Jun 09, 2005 10:34 am
Posts: 10
Thanks a lot max, that's great. Keep up the fantastic work.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 1:05 pm 
Newbie

Joined: Thu Jun 09, 2005 10:34 am
Posts: 10
Works great Max. Thanks again.

I think I found my issue with the ant task. The following mapping snippet will break it with the error mentioned in my first post:

<set name="sites" cascade="save-update">
<key column="customer_id" not-null="true" />
<one-to-many class="Site" />
</set>

Removing the not-null="true" causes the problem to go away. I'll try to get it logged in the jira this weekend.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 2:15 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ok - when you do please add/show the full stacktrace.

with ant that is easiest by calling it with -debug or -verbose

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