Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Annotation gets lost when switch from Junit testing to OSGI (Eclipse application)?
Annotation gets lost when switch from Junit testing to OSGI (Eclipse application)? [message #334895] Sun, 08 March 2009 16:38 Go to next message
Anders W. Tell is currently offline Anders W. Tell
Messages: 69
Registered: July 2009
Member
Hi,

not sure which list this problem belongs to so sorry for the initial cross posting.

Im using Hibernate 3.3.1 and using the annotation configuration mechanism.

When I run a small test code as Junit 3 test cases a call to
"AnnotationConfiguration.buildSessionFactory()" behaves ok and picks up the java annotations such an
"@Entity"

BUT when I call exactly the same code from a Exclipse Application (ViewPart) then the
AnnotationConfiguration:buildSessionFactory() does NOT pick up the annotations in my entity classes??
The AnnotationConfiguration:secondPassCompile() reports that there are no annotation available(in
the class, which it apparently found) ??!

Some information on the plugin structure
-----------------------------------
The hibernate jar are located in one plugin
The Entity classes are in onother plugin
The manager code, that, keep track of hibernate configuration and session are located in one plugin
The UI code is in a fourth plugin.

is this a known problem?

thanks
/anders
Re: Annotation gets lost when switch from Junit testing to OSGI (Eclipse application)? [message #334946 is a reply to message #334895] Wed, 11 March 2009 04:57 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
Anders W.Tell wrote:
> Hi,
>
> not sure which list this problem belongs to so sorry for the initial
> cross posting.
>
> Im using Hibernate 3.3.1 and using the annotation configuration
> mechanism.
>
> When I run a small test code as Junit 3 test cases a call to
> "AnnotationConfiguration.buildSessionFactory()" behaves ok and picks
> up the java annotations such an "@Entity"
>
> BUT when I call exactly the same code from a Exclipse Application
> (ViewPart) then the AnnotationConfiguration:buildSessionFactory() does
> NOT pick up the annotations in my entity classes??
> The AnnotationConfiguration:secondPassCompile() reports that there are
> no annotation available(in the class, which it apparently found) ??!
>
> Some information on the plugin structure
> -----------------------------------
> The hibernate jar are located in one plugin
> The Entity classes are in onother plugin
> The manager code, that, keep track of hibernate configuration and
> session are located in one plugin
> The UI code is in a fourth plugin.
>
> is this a known problem?
I suggest you ask on eclipse.tools.jdt.

Dani
>
> thanks
> /anders
Re: Annotation gets lost when switch from Junit testing to OSGI (Eclipse application)? [message #334975 is a reply to message #334946] Fri, 13 March 2009 02:35 Go to previous message
Anders W. Tell is currently offline Anders W. Tell
Messages: 69
Registered: July 2009
Member
Finally I found the issue, its was plugin problem. The Entity plugin needed to buddy up with the
hibernate plugin.

/anderd

Daniel Megert wrote:
> Anders W.Tell wrote:
>> Hi,
>>
>> not sure which list this problem belongs to so sorry for the initial
>> cross posting.
>>
>> Im using Hibernate 3.3.1 and using the annotation configuration
>> mechanism.
>>
>> When I run a small test code as Junit 3 test cases a call to
>> "AnnotationConfiguration.buildSessionFactory()" behaves ok and picks
>> up the java annotations such an "@Entity"
>>
>> BUT when I call exactly the same code from a Exclipse Application
>> (ViewPart) then the AnnotationConfiguration:buildSessionFactory() does
>> NOT pick up the annotations in my entity classes??
>> The AnnotationConfiguration:secondPassCompile() reports that there are
>> no annotation available(in the class, which it apparently found) ??!
>>
>> Some information on the plugin structure
>> -----------------------------------
>> The hibernate jar are located in one plugin
>> The Entity classes are in onother plugin
>> The manager code, that, keep track of hibernate configuration and
>> session are located in one plugin
>> The UI code is in a fourth plugin.
>>
>> is this a known problem?
> I suggest you ask on eclipse.tools.jdt.
>
> Dani
>>
>> thanks
>> /anders
Previous Topic:java perspective disappeared after update
Next Topic:Problems View - custom attribute column
Goto Forum:
  


Current Time: Wed Aug 20 10:50:24 EDT 2014

Powered by FUDForum. Page generated in 0.01481 seconds