Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » 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 #127193] Sun, 08 March 2009 20:38 Go to next message
Anders W. Tell is currently offline Anders W. TellFriend
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 #127257 is a reply to message #127193] Wed, 11 March 2009 08:57 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
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 #127522 is a reply to message #127257] Fri, 13 March 2009 06:35 Go to previous message
Anders W. Tell is currently offline Anders W. TellFriend
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:Mysterious p2 error message - please help explain it
Next Topic:Service Activation (Bundle-ActivationPolicy: lazy)
Goto Forum:
  


Current Time: Wed Apr 24 20:15:58 GMT 2024

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

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

Back to the top