Hi,

John Langley schrieb:
> I ran into a similar problem, but it was ages (months) ago. 
> My guess is that you tried to use the maven eclipse plugin to import the
> sling project. 
> Instead I would use the mvn eclipse:eclipse goal first and then "import
> existing projects". 
> 
> The heart of the problem lies in eclipse not really resolving libraries
> in the order that maven does, so you see these sorts of
> "discontinuities" from time to time. Also, there was a change in "felix"
> a few months ago that triggered the problem, I forget the details now,
> but you may see something in the mailing lists about it (with my name on
> it). 
> 
> I'm not sure if the above suggestion will fix your problem, but it's
> certainly worth a try. 

Yes, this is the problem. The Felix framework jar file contains updated
OSGi interfaces (you ran into an issue with the updated Constants
interface). The interfaces contain the updates defined by the upcoming
4.2 release of the OSGi framework API. This contrasts with the osgi-core
libraries, which still contain the definitions from the R4.1 specification.

To fix this issue in Eclipse, I think it suffices it to ensure the Felix
framework libary is listed before the osgi-core library in the Eclipse
build configuration.

Hope this helps.

Regards
Felix

> 
> -- Langley 
> 
> 
> On Thu, 2009-04-23 at 06:57 -0400, Aaron Zeckoski wrote:
> 
>> Anyone else seeing the following compile errors when viewing sling
>> trunk in eclipse?
>> Description  Resource        Path    Location        Type
>> Constants.FRAMEWORK_BEGINNING_STARTLEVEL cannot be resolved  
>> Sling.java    
>> sling-trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl
>>   line
>> 406  Java Problem
>> Constants.FRAMEWORK_BEGINNING_STARTLEVEL cannot be resolved  
>> Sling.java    
>> sling-trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl
>>   line
>> 407  Java Problem
>> Constants.FRAMEWORK_STORAGE cannot be resolved       Sling.java      
>> sling-trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/impl
>>         line
>> 396  Java Problem
>>
>> Here is the code where the errors occur (starts line 395):
>>         // migrate old properties to new properties
>>         migrateProp(staticProps, "felix.cache.profiledir",
>> Constants.FRAMEWORK_STORAGE);
>>         migrateProp(staticProps, "sling.osgi-core-packages",
>> "osgi-core-packages");
>>         migrateProp(staticProps, "sling.osgi-compendium-services",
>> "osgi-compendium-services");
>>
>>         // migrate initial start level property: Felix used to have
>>         // felix.startlevel.framework, later moved to
>> org.osgi.framework.startlevel
>>         // and finally now uses org.osgi.framework.startlevel.beginning as
>>         // speced in the latest R 4.2 draft (2009/03/10). We first check the
>>         // intermediate Felix property, then the initial property, thus 
>> allowing
>>         // the older (and more probable value) to win
>>         migrateProp(staticProps, "org.osgi.framework.startlevel",
>> Constants.FRAMEWORK_BEGINNING_STARTLEVEL);
>>         migrateProp(staticProps, "felix.startlevel.framework",
>> Constants.FRAMEWORK_BEGINNING_STARTLEVEL);
>>
>> The values do not appear to be in the constants file but I don't see
>> any failure when building with maven so I am not sure what is going on
>> here. I am willing to chalk it up to weirdness in my eclipse
>> installation but I thought I might ask if anyone else sees this also
>> before I dig deeper.
>> -AZ
>>
>>
> 

Reply via email to