You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Ch...@emc.com on 2012/06/26 18:57:12 UTC
compiling with felix 4.0.2 and java 7
I just migrated from java6 --> java7.
During compilation, I get a lot of errors pertaining to generic typing on classes from felix, version 4.0.2; I've put the compilation errors at the bottom of this message.
Here's something I found that suggests that the felix source might not be compiled with java 1.7?
https://github.com/osgi/bindex/issues/11
Any thoughts?
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
/support/FakeBundleContext.java:[28,31] error: type ServiceRegistration does not take parameters
/support/FakeBundleContext.java:[39,39] error: type ServiceReference does not take parameters
/support/FakeBundleContext.java:[45,28] error: type ServiceReference does not take parameters
/support/FakeBundleContext.java:[19,7] error: FakeBundleContext is not abstract and does not override abstract method getServiceReferences(Class,String) in BundleContext
/support/FakeBundleContext.java:[28,35] error: name clash: <S>registerService(Class<S>,S,Dictionary<String,?>) in FakeBundleContext and registerService(Class,Object,Dictionary) in BundleContext have the same erasure, yet neither overrides the other
where S is a type-variable:
S extends Object declared in method <S>registerService(Class<S>,S,Dictionary<String,?>)
/support/FakeBundleContext.java:[27,1] error: method does not override or implement a method from a supertype
/support/FakeBundleContext.java:[39,44] error: name clash: <S>getServiceReferences(Class<S>,String) in FakeBundleContext and getServiceReferences(Class,String) in BundleContext have the same erasure, yet neither overrides the other
where S is a type-variable:
S extends Object declared in method <S>getServiceReferences(Class<S>,String)
/support/FakeBundleContext.java:[38,1] error: method does not override or implement a method from a supertype
/support/FakeBundleContext.java:[45,32] error: name clash: <S>getServiceReference(Class<S>) in FakeBundleContext and getServiceReference(Class) in BundleContext have the same erasure, yet neither overrides the other
where S is a type-variable:
S extends Object declared in method <S>getServiceReference(Class<S>)
/support/FakeBundleContext.java:[44,1] error: method does not override or implement a method from a supertype
/support/FakeBundle.java:[17,7] error: FakeBundle is not abstract and does not override abstract method adapt(Class) in Bundle
/support/FakeBundle.java:[186,1] error: method does not override or implement a method from a supertype
/support/FakeBundle.java:[191,14] error: name clash: <A>adapt(Class<A>) in FakeBundle and adapt(Class) in Bundle have the same erasure, yet neither overrides the other
where A is a type-variable:
A extends Object declared in method <A>adapt(Class<A>)
/support/FakeBundle.java:[190,1] error: method does not override or implement a method from a supertype
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Tue Jun 26 10:51:00 MDT 2012
[INFO] Final Memory: 45M/510M
[INFO] ------------------------------------------------------------------------
RE: compiling with felix 4.0.2 and java 7
Posted by "Davis, Chad" <Ch...@emc.com>.
> > Any word on when the 4.2.0 release will be out?
>
> Still working on it. Sorry. I'll try to find the time to get it. Maybe I'll scale back
> some things so I can get something out quicker.
>
Don't lose any sleep ;)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: compiling with felix 4.0.2 and java 7
Posted by "Richard S. Hall" <he...@ungoverned.org>.
On Aug 30, 2012, at 10:30 AM, "Davis, Chad" <Ch...@emc.com> wrote:
>
>>>> The coming framework 4.2.0 release will target Java 5 instead of
>>>> jsr14, so this issue should go away in the future.
>>> Any idea of the timeframe here?
>>
>> Not in the next couple days, but hopefully in the next couple of weeks.
>>
>
> Any word on when the 4.2.0 release will be out?
Still working on it. Sorry. I'll try to find the time to get it. Maybe I'll scale back some things so I can get something out quicker.
-> richard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
RE: compiling with felix 4.0.2 and java 7
Posted by "Davis, Chad" <Ch...@emc.com>.
> >> The coming framework 4.2.0 release will target Java 5 instead of
> >> jsr14, so this issue should go away in the future.
> > Any idea of the timeframe here?
>
> Not in the next couple days, but hopefully in the next couple of weeks.
>
Any word on when the 4.2.0 release will be out?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: compiling with felix 4.0.2 and java 7
Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 6/26/12 13:45 , Chad.Davis@emc.com wrote:
>
>> The Felix framework targets jsr14, which allowed it to take advantage of
>> generics, but still have byte code compatible with JDK 1.4. If you are
>> compiling against the framework JAR file in Java 7, then you need to
>> recompile the framework using Java 7 (i.e., get rid of target jsr14). Of course,
>> you could just get an OSGi API JAR compiled for Java 5 or above, since you
>> likely don't need to compile against Felix framework internals...
> By "OSGi API JAR", what exactly do you mean? I'm not familiar with the packaging of the OSGi world. The jar I have is org.apache.felix.framework-4.0.2.jar. I would expect that this contains both the OSGi interfaces that are the specification based API, as well as the felix implementation classes. Does the felix project also distribute a jar that has ONLY the API?
We don't, but the OSGi Alliance does...although currently, they compile
it for jsr14 too, so you'd still need to recompile it either way for
now. :-(
>> The coming framework 4.2.0 release will target Java 5 instead of jsr14, so this
>> issue should go away in the future.
> Any idea of the timeframe here?
Not in the next couple days, but hopefully in the next couple of weeks.
-> richard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
RE: compiling with felix 4.0.2 and java 7
Posted by Ch...@emc.com.
> The Felix framework targets jsr14, which allowed it to take advantage of
> generics, but still have byte code compatible with JDK 1.4. If you are
> compiling against the framework JAR file in Java 7, then you need to
> recompile the framework using Java 7 (i.e., get rid of target jsr14). Of course,
> you could just get an OSGi API JAR compiled for Java 5 or above, since you
> likely don't need to compile against Felix framework internals...
By "OSGi API JAR", what exactly do you mean? I'm not familiar with the packaging of the OSGi world. The jar I have is org.apache.felix.framework-4.0.2.jar. I would expect that this contains both the OSGi interfaces that are the specification based API, as well as the felix implementation classes. Does the felix project also distribute a jar that has ONLY the API?
>
> The coming framework 4.2.0 release will target Java 5 instead of jsr14, so this
> issue should go away in the future.
Any idea of the timeframe here?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: compiling with felix 4.0.2 and java 7
Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 6/26/12 12:57 , Chad.Davis@emc.com wrote:
> I just migrated from java6 --> java7.
>
> During compilation, I get a lot of errors pertaining to generic typing on classes from felix, version 4.0.2; I've put the compilation errors at the bottom of this message.
>
> Here's something I found that suggests that the felix source might not be compiled with java 1.7?
>
> https://github.com/osgi/bindex/issues/11
The Felix framework targets jsr14, which allowed it to take advantage of
generics, but still have byte code compatible with JDK 1.4. If you are
compiling against the framework JAR file in Java 7, then you need to
recompile the framework using Java 7 (i.e., get rid of target jsr14). Of
course, you could just get an OSGi API JAR compiled for Java 5 or above,
since you likely don't need to compile against Felix framework internals...
The coming framework 4.2.0 release will target Java 5 instead of jsr14,
so this issue should go away in the future.
-> richard
>
> Any thoughts?
>
>
>
> [ERROR] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Compilation failure
>
> /support/FakeBundleContext.java:[28,31] error: type ServiceRegistration does not take parameters
> /support/FakeBundleContext.java:[39,39] error: type ServiceReference does not take parameters
> /support/FakeBundleContext.java:[45,28] error: type ServiceReference does not take parameters
> /support/FakeBundleContext.java:[19,7] error: FakeBundleContext is not abstract and does not override abstract method getServiceReferences(Class,String) in BundleContext
> /support/FakeBundleContext.java:[28,35] error: name clash: <S>registerService(Class<S>,S,Dictionary<String,?>) in FakeBundleContext and registerService(Class,Object,Dictionary) in BundleContext have the same erasure, yet neither overrides the other
> where S is a type-variable:
> S extends Object declared in method <S>registerService(Class<S>,S,Dictionary<String,?>)
> /support/FakeBundleContext.java:[27,1] error: method does not override or implement a method from a supertype
> /support/FakeBundleContext.java:[39,44] error: name clash: <S>getServiceReferences(Class<S>,String) in FakeBundleContext and getServiceReferences(Class,String) in BundleContext have the same erasure, yet neither overrides the other
> where S is a type-variable:
> S extends Object declared in method <S>getServiceReferences(Class<S>,String)
> /support/FakeBundleContext.java:[38,1] error: method does not override or implement a method from a supertype
> /support/FakeBundleContext.java:[45,32] error: name clash: <S>getServiceReference(Class<S>) in FakeBundleContext and getServiceReference(Class) in BundleContext have the same erasure, yet neither overrides the other
> where S is a type-variable:
> S extends Object declared in method <S>getServiceReference(Class<S>)
> /support/FakeBundleContext.java:[44,1] error: method does not override or implement a method from a supertype
> /support/FakeBundle.java:[17,7] error: FakeBundle is not abstract and does not override abstract method adapt(Class) in Bundle
> /support/FakeBundle.java:[186,1] error: method does not override or implement a method from a supertype
> /support/FakeBundle.java:[191,14] error: name clash: <A>adapt(Class<A>) in FakeBundle and adapt(Class) in Bundle have the same erasure, yet neither overrides the other
> where A is a type-variable:
> A extends Object declared in method <A>adapt(Class<A>)
> /support/FakeBundle.java:[190,1] error: method does not override or implement a method from a supertype
>
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 5 seconds
> [INFO] Finished at: Tue Jun 26 10:51:00 MDT 2012
> [INFO] Final Memory: 45M/510M
> [INFO] ------------------------------------------------------------------------
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org