Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF][Teneo][Hibernate](nullpointer while generating hibernate.hbm.xml)  () 1 Vote
[EMF][Teneo][Hibernate] [message #827444] Fri, 23 March 2012 10:39 Go to next message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
Quote:

org.eclipse.emf.teneo.classloader.ClassLoaderResolver setClassLoaderStrategy
Information: Class loader strategy set to: org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy
Exception in thread "main" java.lang.NullPointerException
at org.eclipse.emf.teneo.annotations.parser.EAnnotationParserImporter.removeCommentLines(EAnnotationParserImporter.java:172)
at org.eclipse.emf.teneo.annotations.parser.EAnnotationParserImporter.process(EAnnotationParserImporter.java:163)
at org.eclipse.emf.teneo.annotations.parser.EAnnotationParserImporter.processAnnotatedModelElement(EAnnotationParserImporter.java:97)
at org.eclipse.emf.teneo.annotations.parser.EAnnotationParserImporter.process(EAnnotationParserImporter.java:75)
at org.eclipse.emf.teneo.annotations.parser.EAnnotationParserImporter.process(EAnnotationParserImporter.java:68)
at org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingBuilder.buildMapping(PersistenceMappingBuilder.java:142)
at org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingBuilder.buildMapping(PersistenceMappingBuilder.java:64)
at org.eclipse.emf.teneo.hibernate.mapper.GenerateHBM.createORMapperFile(GenerateHBM.java:112)
at org.eclipse.emf.teneo.hibernate.mapper.GenerateHBM.main(GenerateHBM.java:82)



Versions:
EMF SDK 2.7.2
EMF Teneo Hibernate 1.2.0
Hibernate 3.6.0
javax persistence 2.0.1

note that the hibernate.hbm.xml is totally empty.

[Updated on: Fri, 23 March 2012 10:40]

Report message to a moderator

Re: [EMF][Teneo][Hibernate] [message #827483 is a reply to message #827444] Fri, 23 March 2012 11:45 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ludwig,
I try to be a nice guy :-), but I really think it is better/nicer/more polite to also add some explanatory or
introductionary words in your post. Something like this:

>>>>
Hi,
I am trying Teneo but encountered an issue, see below the stacktrace and versions of Teneo I use. Help is appreciated.
Thanks for spending the time.

gr. Ludwig
<<<<

Can you do a repost with an actual question, so I feel that a real human being is behind the post :-)

Thanks

gr. Martin

On 03/23/2012 11:39 AM, Ludwig Moser wrote:
> Quote:
>> org.eclipse.emf.teneo.classloader.ClassLoaderResolver setClassLoaderStrategy
>> Information: Class loader strategy set to: org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy
>> Exception in thread "main" java.lang.NullPointerException
>> at
>> org.eclipse.emf.teneo.annotations.parser.EAnnotationParserImporter.removeCommentLines(EAnnotationParserImporter.java:172)
>> at org.eclipse.emf.teneo.annotations.parser.EAnnotationParserImporter.process(EAnnotationParserImporter.java:163)
>> at
>> org.eclipse.emf.teneo.annotations.parser.EAnnotationParserImporter.processAnnotatedModelElement(EAnnotationParserImporter.java:97)
>>
>> at org.eclipse.emf.teneo.annotations.parser.EAnnotationParserImporter.process(EAnnotationParserImporter.java:75)
>> at org.eclipse.emf.teneo.annotations.parser.EAnnotationParserImporter.process(EAnnotationParserImporter.java:68)
>> at org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingBuilder.buildMapping(PersistenceMappingBuilder.java:142)
>> at org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingBuilder.buildMapping(PersistenceMappingBuilder.java:64)
>> at org.eclipse.emf.teneo.hibernate.mapper.GenerateHBM.createORMapperFile(GenerateHBM.java:112)
>> at org.eclipse.emf.teneo.hibernate.mapper.GenerateHBM.main(GenerateHBM.java:82)
>
>
> Versions:
> EMF SDK 2.7.2
> EMF Teneo Hibernate 1.2.0
> Hibernate 3.6.0
> javax persistence 2.0.1


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [EMF][Teneo][Hibernate] [message #827502 is a reply to message #827483] Fri, 23 March 2012 12:14 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
sorry for the short throw in.

some very nice guy told me that teneo with eclipselink does not create annotations, so i switched to teneo with hibernate.
i still have my EMF ecore model and try to generate the mapping for this model.

while executing the generate stuff i encounter the exception above.
i am not sure if i do anything right, because i cannot find any working step by step examples or better tutorials.

i tried to download an example of you via GIT, but somehow my eclipse cant receive data (probably blocked by our hardware firewall)
so i tried to download each and every single file by rightclick saveas but also this failed, as eclipse says opening project but hangs at 4%.

probably thats why i lost my patience and threw in this post too fast...

sorry Smile
Re: [EMF][Teneo][Hibernate] [message #827734 is a reply to message #827502] Fri, 23 March 2012 18:32 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ludwig,
Not sure why this exception happens, but normally I would not recommend using the GenerateHBM class for this. It is used
in eclipse ide/plugin environments.

Did you see this:
http://wiki.eclipse.org/Teneo/Hibernate/EMF_Hibernate_Integration_Details#Manual_Generation_of_OR_Mapping

Or better create a datastore, initialize it and then call getMappingXML on the datastore. But in any case most of the
time you don't the mapping xml at all. Just let Teneo do it in memory at runtime, as is shown here:
http://wiki.eclipse.org/Teneo/Hibernate/QuickStart

gr. Martin

On 03/23/2012 01:14 PM, Ludwig Moser wrote:
> sorry for the short throw in.
>
> some very nice guy told me that teneo with eclipselink does not create annotations, so i switched to teneo with hibernate.
> i still have my EMF ecore model and try to generate the mapping for this model.
>
> while executing the generate stuff i encounter the exception above.
> i am not sure if i do anything right, because i cannot find any working step by step examples or better tutorials.
>
> i tried to download an example of you via GIT, but somehow my eclipse cant receive data (probably blocked by our
> hardware firewall)
> so i tried to download each and every single file by rightclick saveas but also this failed, as eclipse says opening
> project but hangs at 4%.
>
> probably thats why i lost my patience and threw in this post too fast...
>
> sorry :)


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [EMF][Teneo][Hibernate] [message #828937 is a reply to message #827444] Sun, 25 March 2012 15:25 Go to previous message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
i just downloaded the example @ home - here git is working fine Wink
and put it up on my svn @ work so i can check the stuff on monday

thanks!
Previous Topic:[Teneo] Strange hibernate mapping for one-to-one conteinment reference
Next Topic:EcoreUtil.copy doesn't copy Implementation of operation
Goto Forum:
  


Current Time: Fri Apr 26 14:44:13 GMT 2024

Powered by FUDForum. Page generated in 0.03263 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top