Stuart McCulloch wrote:
On 09/04/2008, Tim Moloney <[EMAIL PROTECTED]> wrote:
I'm currently developing a set of bundles using Java SE 6, Maven, Eclipse,
and Q4E.  At the command line, everything appears to be working fine.
 However, I get some odd  errors inside Eclipse (errors concerning generics
and missing symbols which are in JAXB generated code).  One of the good
people on the Q4E mailing list said that these errors are probably due to
org.osgi.foundation providing some java.* classes which are version 1.4 or
earlier.

- What is the purpose of org.osgi.foundation since the framework needs to
be run by a JRE that provides the java.* classes?


I haven't had much experience of actually using the foundation jar

AFAIK it's mainly used to compile against - to check whether you're
using any API calls outside of the foundation execution environment

but you're free to ignore this and compile against a different JVM EE
such as Java5 if that's what you want - ie. foundation is just another
spec'd execution environment like Java5 SE or Java1.4 EE

I wasn't intentionally using the foundation jar. I was only vaguely aware of its existence. I am using the compendium jar which has the foundation jar as a dependency. Apparently, this is causing Eclipse/Q4E/Maven to put the foundation jar earlier in the classpath. As a result, Eclipse is using the java.* classes that don't have generics. Since my bundles will be running in a Java SE 6 execution environment, I'd like to not use the foundation jar (even for compiling) but the dependencies are there regardless.

- Is it possible to create bundles that use Java 5+ features (like generics,
additional collections classes, etc.)?


certainly, we have several Java5 bundles at OPS4J and even some
that we provide for both 5 and 1.4 runtimes by using retrotranslator

- How can I correctly build and run bundles using these newer features?


it's mostly just a matter of configuring the maven-compile-plugin to
use the right source and target (ie. 1.5) and then ensuring you use
a Java5 runtime to deploy it on - you should also pick the right EE
in Eclipse (not sure which panel this is on)

I did verify that I do have this correct in the Eclipse project properties.

I realize that these are fundamental questions but I appear to be missing
the fundamentals.  Is there is documentation available that can help be get
a good understanding of exactly what's going on here?


perhaps you could post the exception/error you're seeing and which
tool it comes from (maven plugin / Eclipse / Felix) - I can't quite see
how the foundation jar could cause errors in JAXB generated code...


Here are the relevant links.

http://groups.google.com/group/q4e-users/browse_thread/thread/35ee3462e7e59182

http://code.google.com/p/q4e/issues/detail?id=328&can=4&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary%20Patch
- Comment 6 mentions org.osgi.core but I believe he meant org.osgi.foundation

Thanks,
 Tim

--
Cheers, Stuart


Reply via email to