Discussion:
javax.persistence class cannot be resolved - It is indirectly referenced from required .class files
(too old to reply)
Jay Jay Billings
2012-06-01 21:00:43 UTC
Permalink
Everyone,

I get the error below when trying to use EclipseLink in an RCP application
with Tycho 0.14 -OR- Tycho 0.13. It is resolved by adding javax.persistence
to the imported package list of all of my bundles, even those that do not
explicitly use it.

I think this is a regression of this bug:

http://dev.eclipse.org/mhonarc/lists/tycho-user/msg00030.html

The DataComponent class mentioned below is annotated with JPA annotations
and it is class that is used by almost all of the other bundles. I would
expect the dependency to be resolved transitively.

Is there a way to fix this in Tycho?

Jay

-----

[ERROR] Failed to execute goal
org.eclipse.tycho:tycho-compiler-plugin:0.14.0:compile (default-compile) on
project gov.ornl.nice.niceclient: Compilation failure: Compilation failure:
[ERROR]
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.niceclient/src/gov/ornl/nice/niceclient/iniceclient/uiwidgets/IExtraInfoWidget.java:[1,0]
[ERROR] package gov.ornl.nice.niceclient.iniceclient.uiwidgets;
[ERROR] ^
[ERROR] The type javax.persistence.CascadeType cannot be resolved. It is
indirectly referenced from required .class files
[ERROR]
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.niceclient/src/gov/ornl/nice/niceclient/iniceclient/uiwidgets/IExtraInfoWidget.java:[1,0]
[ERROR] package gov.ornl.nice.niceclient.iniceclient.uiwidgets;
[ERROR] ^
[ERROR] The type javax.persistence.FetchType cannot be resolved. It is
indirectly referenced from required .class files
[ERROR]
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.niceclient/src/gov/ornl/nice/niceclient/eclipseuiwidgets/NiCEDataComponentSectionPart.java:[92,0]
[ERROR] System.out.println("DataComponent " + dataComp.getName() + ":");
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The type javax.persistence.GenerationType cannot be resolved. It is
indirectly referenced from required .class files
[ERROR]
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.niceclient/src/gov/ornl/nice/niceclient/eclipseuiwidgets/NiCEDataComponentSectionPart.java:[92,0]
[ERROR] System.out.println("DataComponent " + dataComp.getName() + ":");
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The type javax.persistence.InheritanceType cannot be resolved. It
is indirectly referenced from required .class files
[ERROR] 4 problems (4 errors)
[ERROR] -> [Help 1]
Jay Jay Billings
2012-06-01 21:09:39 UTC
Permalink
This also seems to cause the tests to fail:

Jay

!SESSION 2012-06-01 17:03:53.103
-----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_22
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -application
org.eclipse.tycho.surefire.osgibooter.headlesstest -testproperties
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.nicedatastructures.test/target/surefire.properties
Command-line arguments: -data
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.nicedatastructures.test/target/work/data
-dev
file:/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.nicedatastructures.test/target/dev.properties
-application org.eclipse.tycho.surefire.osgibooter.headlesstest
-testproperties
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.nicedatastructures.test/target/surefire.properties

!ENTRY org.eclipse.osgi 4 0 2012-06-01 17:03:54.285
!MESSAGE Application error
!STACK 1
org.apache.maven.surefire.util.SurefireReflectionException:
java.lang.reflect.InvocationTargetException; nested exception is
java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
at
org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:84)
at
org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.NullPointerException
at java.lang.Class.getAnnotation(Class.java:3048)
at
org.apache.maven.surefire.common.junit4.JUnit4TestChecker.isValidJUnit4Test(JUnit4TestChecker.java:63)
at
org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:52)
at
org.apache.maven.surefire.util.DefaultDirectoryScanner.locateTestClasses(DefaultDirectoryScanner.java:80)
at
org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:174)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:83)
... 28 more


On Fri, Jun 1, 2012 at 5:00 PM, Jay Jay Billings
Post by Jay Jay Billings
Everyone,
I get the error below when trying to use EclipseLink in an RCP application
with Tycho 0.14 -OR- Tycho 0.13. It is resolved by adding javax.persistence
to the imported package list of all of my bundles, even those that do not
explicitly use it.
http://dev.eclipse.org/mhonarc/lists/tycho-user/msg00030.html
The DataComponent class mentioned below is annotated with JPA annotations
and it is class that is used by almost all of the other bundles. I would
expect the dependency to be resolved transitively.
Is there a way to fix this in Tycho?
Jay
-----
[ERROR] Failed to execute goal
org.eclipse.tycho:tycho-compiler-plugin:0.14.0:compile (default-compile) on
[ERROR]
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.niceclient/src/gov/ornl/nice/niceclient/iniceclient/uiwidgets/IExtraInfoWidget.java:[1,0]
[ERROR] package gov.ornl.nice.niceclient.iniceclient.uiwidgets;
[ERROR] ^
[ERROR] The type javax.persistence.CascadeType cannot be resolved. It is
indirectly referenced from required .class files
[ERROR]
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.niceclient/src/gov/ornl/nice/niceclient/iniceclient/uiwidgets/IExtraInfoWidget.java:[1,0]
[ERROR] package gov.ornl.nice.niceclient.iniceclient.uiwidgets;
[ERROR] ^
[ERROR] The type javax.persistence.FetchType cannot be resolved. It is
indirectly referenced from required .class files
[ERROR]
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.niceclient/src/gov/ornl/nice/niceclient/eclipseuiwidgets/NiCEDataComponentSectionPart.java:[92,0]
[ERROR] System.out.println("DataComponent " + dataComp.getName() + ":");
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The type javax.persistence.GenerationType cannot be resolved. It
is indirectly referenced from required .class files
[ERROR]
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.niceclient/src/gov/ornl/nice/niceclient/eclipseuiwidgets/NiCEDataComponentSectionPart.java:[92,0]
[ERROR] System.out.println("DataComponent " + dataComp.getName() + ":");
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The type javax.persistence.InheritanceType cannot be resolved. It
is indirectly referenced from required .class files
[ERROR] 4 problems (4 errors)
[ERROR] -> [Help 1]
Igor Fedorenko
2012-06-01 21:50:01 UTC
Permalink
Are you able to provide complete standalone example that demonstrates
the problem?

--
Regards,
Igor
Post by Jay Jay Billings
Everyone,
I get the error below when trying to use EclipseLink in an RCP
application with Tycho 0.14 -OR- Tycho 0.13. It is resolved by adding
javax.persistence to the imported package list of all of my bundles,
even those that do not explicitly use it.
http://dev.eclipse.org/mhonarc/lists/tycho-user/msg00030.html
The DataComponent class mentioned below is annotated with JPA
annotations and it is class that is used by almost all of the other
bundles. I would expect the dependency to be resolved transitively.
Is there a way to fix this in Tycho?
Jay
-----
[ERROR] Failed to execute goal
org.eclipse.tycho:tycho-compiler-plugin:0.14.0:compile (default-compile)
on project gov.ornl.nice.niceclient: Compilation failure: Compilation
[ERROR]
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.niceclient/src/gov/ornl/nice/niceclient/iniceclient/uiwidgets/IExtraInfoWidget.java:[1,0]
[ERROR] package gov.ornl.nice.niceclient.iniceclient.uiwidgets;
[ERROR] ^
[ERROR] The type javax.persistence.CascadeType cannot be resolved. It is
indirectly referenced from required .class files
[ERROR]
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.niceclient/src/gov/ornl/nice/niceclient/iniceclient/uiwidgets/IExtraInfoWidget.java:[1,0]
[ERROR] package gov.ornl.nice.niceclient.iniceclient.uiwidgets;
[ERROR] ^
[ERROR] The type javax.persistence.FetchType cannot be resolved. It is
indirectly referenced from required .class files
[ERROR]
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.niceclient/src/gov/ornl/nice/niceclient/eclipseuiwidgets/NiCEDataComponentSectionPart.java:[92,0]
[ERROR] System.out.println("DataComponent " + dataComp.getName() + ":");
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The type javax.persistence.GenerationType cannot be resolved. It
is indirectly referenced from required .class files
[ERROR]
/home/bkj/research/NiCE/NiCEWorkspace/gov.ornl.nice.niceclient/src/gov/ornl/nice/niceclient/eclipseuiwidgets/NiCEDataComponentSectionPart.java:[92,0]
[ERROR] System.out.println("DataComponent " + dataComp.getName() + ":");
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The type javax.persistence.InheritanceType cannot be resolved.
It is indirectly referenced from required .class files
[ERROR] 4 problems (4 errors)
[ERROR] -> [Help 1]
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Jay Jay Billings
2012-06-01 22:19:22 UTC
Permalink
Igor,

I do not have examples of this happening that are independent of my code
base, but my code is relatively small and completely open-source. Is that
sufficient for a standalone example?

Access and build instructions:
http://sourceforge.net/apps/mediawiki/niceproject/index.php?title=Getting_NiCE#Regular_Command_Line_SVN_Access
Repo: https://niceproject.svn.sourceforge.net/svnroot/niceproject/trunk

The current build has each plugin importing javax.persistence in their
MANIFEST.mf files, which would have to be removed from at least one of the
bundles to produce "[ERROR] The type javax.persistence.CascadeType cannot
be resolved. It is indirectly referenced from required .class files."

If you need something smaller, I can try to put it together for you over
the weekend.

One point that may be important: we are using EclipseLink
(org.eclipse.persistence).

Thanks!

Jay
Post by Igor Fedorenko
Are you able to provide complete standalone example that demonstrates
the problem?
--
Regards,
Igor
Post by Jay Jay Billings
Everyone,
I get the error below when trying to use EclipseLink in an RCP
application with Tycho 0.14 -OR- Tycho 0.13. It is resolved by adding
javax.persistence to the imported package list of all of my bundles,
even those that do not explicitly use it.
http://dev.eclipse.org/**mhonarc/lists/tycho-user/**msg00030.html<http://dev.eclipse.org/mhonarc/lists/tycho-user/msg00030.html>
The DataComponent class mentioned below is annotated with JPA
annotations and it is class that is used by almost all of the other
bundles. I would expect the dependency to be resolved transitively.
Is there a way to fix this in Tycho?
Jay
-----
[ERROR] Failed to execute goal
org.eclipse.tycho:tycho-**compiler-plugin:0.14.0:compile
(default-compile)
on project gov.ornl.nice.niceclient: Compilation failure: Compilation
[ERROR]
/home/bkj/research/NiCE/**NiCEWorkspace/gov.ornl.nice.**
niceclient/src/gov/ornl/nice/**niceclient/iniceclient/**
uiwidgets/IExtraInfoWidget.**java:[1,0]
[ERROR] package gov.ornl.nice.niceclient.**iniceclient.uiwidgets;
[ERROR] ^
[ERROR] The type javax.persistence.CascadeType cannot be resolved. It is
indirectly referenced from required .class files
[ERROR]
/home/bkj/research/NiCE/**NiCEWorkspace/gov.ornl.nice.**
niceclient/src/gov/ornl/nice/**niceclient/iniceclient/**
uiwidgets/IExtraInfoWidget.**java:[1,0]
[ERROR] package gov.ornl.nice.niceclient.**iniceclient.uiwidgets;
[ERROR] ^
[ERROR] The type javax.persistence.FetchType cannot be resolved. It is
indirectly referenced from required .class files
[ERROR]
/home/bkj/research/NiCE/**NiCEWorkspace/gov.ornl.nice.**
niceclient/src/gov/ornl/nice/**niceclient/eclipseuiwidgets/**
NiCEDataComponentSectionPart.**java:[92,0]
[ERROR] System.out.println("**DataComponent " + dataComp.getName() +
":");
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The type javax.persistence.**GenerationType cannot be resolved.
It
is indirectly referenced from required .class files
[ERROR]
/home/bkj/research/NiCE/**NiCEWorkspace/gov.ornl.nice.**
niceclient/src/gov/ornl/nice/**niceclient/eclipseuiwidgets/**
NiCEDataComponentSectionPart.**java:[92,0]
[ERROR] System.out.println("**DataComponent " + dataComp.getName() +
":");
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] The type javax.persistence.**InheritanceType cannot be resolved.
It is indirectly referenced from required .class files
[ERROR] 4 problems (4 errors)
[ERROR] -> [Help 1]
______________________________**_________________
tycho-user mailing list
https://dev.eclipse.org/**mailman/listinfo/tycho-user<https://dev.eclipse.org/mailman/listinfo/tycho-user>
______________________________**_________________
tycho-user mailing list
https://dev.eclipse.org/**mailman/listinfo/tycho-user<https://dev.eclipse.org/mailman/listinfo/tycho-user>
Igor Fedorenko
2012-06-01 23:57:50 UTC
Permalink
I don't have the time to investigate problems with source tree this big,
but your target platform configuration does not look right. I do not
believe Tycho supports target file with location type="Directory", only
type="InstallableUnit" is supported.
Jay Jay Billings
2012-06-02 00:09:55 UTC
Permalink
Thanks Igor. I will let you know what I find and if I get a chance I will
make a smaller example program.

Jay
Post by Igor Fedorenko
I don't have the time to investigate problems with source tree this big,
but your target platform configuration does not look right. I do not
believe Tycho supports target file with location type="Directory", only
Jay Jay Billings
2012-06-02 14:10:58 UTC
Permalink
Igor,

Changing the repository and running mvn clean seems to fix the problem with
the JPA annotations, but now it produces the second error I reported when
it tries to run the tests (see below). These tests run fine in Eclipse.

Any thoughts? I've confirmed that this happens with both 0.14 and 0.15. It
doesn't say what class it is trying to launch or anything - it just fails
as soon as it tries to launch the tests.

Jay


!ENTRY org.eclipse.osgi 4 0 2012-06-02 10:06:28.190
!MESSAGE Application error
!STACK 1
org.apache.maven.surefire.util.SurefireReflectionException:
java.lang.reflect.InvocationTargetException; nested exception is
java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
at
org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:84)
at
org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.NullPointerException
at java.lang.Class.getAnnotation(Class.java:3048)
at
org.apache.maven.surefire.common.junit4.JUnit4TestChecker.isValidJUnit4Test(JUnit4TestChecker.java:63)
at
org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:52)
at
org.apache.maven.surefire.util.DefaultDirectoryScanner.locateTestClasses(DefaultDirectoryScanner.java:80)
at
org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:174)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:83)
... 28 more



On Fri, Jun 1, 2012 at 8:09 PM, Jay Jay Billings
Post by Jay Jay Billings
Thanks Igor. I will let you know what I find and if I get a chance I will
make a smaller example program.
Jay
Post by Igor Fedorenko
I don't have the time to investigate problems with source tree this big,
but your target platform configuration does not look right. I do not
believe Tycho supports target file with location type="Directory", only
Jay Jay Billings
2012-06-04 18:44:54 UTC
Permalink
Igor,

I had some more time to look at this today. Can you answer a quick question
for me?

If bundle A depends on bundle B and bundle C depends on A, shouldn't Tycho
include bundle B in the class path in addition to bundle A when it is
building bundle C?

I have the case above with JPA (EclipseLink) and I ran the build with the
-X flag. The transitive dependency described above is not satisfied.

Jay

On Sat, Jun 2, 2012 at 10:10 AM, Jay Jay Billings
Post by Jay Jay Billings
Igor,
Changing the repository and running mvn clean seems to fix the problem
with the JPA annotations, but now it produces the second error I reported
when it tries to run the tests (see below). These tests run fine in Eclipse.
Any thoughts? I've confirmed that this happens with both 0.14 and 0.15. It
doesn't say what class it is trying to launch or anything - it just fails
as soon as it tries to launch the tests.
Jay
!ENTRY org.eclipse.osgi 4 0 2012-06-02 10:06:28.190
!MESSAGE Application error
!STACK 1
java.lang.reflect.InvocationTargetException; nested exception is
java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
at
org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:84)
at
org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.NullPointerException
at java.lang.Class.getAnnotation(Class.java:3048)
at
org.apache.maven.surefire.common.junit4.JUnit4TestChecker.isValidJUnit4Test(JUnit4TestChecker.java:63)
at
org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:52)
at
org.apache.maven.surefire.util.DefaultDirectoryScanner.locateTestClasses(DefaultDirectoryScanner.java:80)
at
org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:174)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:83)
... 28 more
Post by Jay Jay Billings
Thanks Igor. I will let you know what I find and if I get a chance I will
make a smaller example program.
Jay
Post by Igor Fedorenko
I don't have the time to investigate problems with source tree this big,
but your target platform configuration does not look right. I do not
believe Tycho supports target file with location type="Directory", only
Igor Fedorenko
2012-06-04 19:44:51 UTC
Permalink
C -> A -> B

OSGi dependencies are not transitive. C will not "see" any packages from
B, you need to add explicit Require-Bundle or Import-Package.

--
Regards,
Igor
Post by Jay Jay Billings
Igor,
I had some more time to look at this today. Can you answer a quick
question for me?
If bundle A depends on bundle B and bundle C depends on A, shouldn't
Tycho include bundle B in the class path in addition to bundle A when it
is building bundle C?
I have the case above with JPA (EclipseLink) and I ran the build with
the -X flag. The transitive dependency described above is not satisfied.
Jay
On Sat, Jun 2, 2012 at 10:10 AM, Jay Jay Billings
Igor,
Changing the repository and running mvn clean seems to fix the
problem with the JPA annotations, but now it produces the second
error I reported when it tries to run the tests (see below). These
tests run fine in Eclipse.
Any thoughts? I've confirmed that this happens with both 0.14 and
0.15. It doesn't say what class it is trying to launch or anything -
it just fails as soon as it tries to launch the tests.
Jay
!ENTRY org.eclipse.osgi 4 0 2012-06-02 10:06:28.190
!MESSAGE Application error
!STACK 1
java.lang.reflect.InvocationTargetException; nested exception is
java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
at
org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:84)
at
org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.NullPointerException
at java.lang.Class.getAnnotation(Class.java:3048)
at
org.apache.maven.surefire.common.junit4.JUnit4TestChecker.isValidJUnit4Test(JUnit4TestChecker.java:63)
at
org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:52)
at
org.apache.maven.surefire.util.DefaultDirectoryScanner.locateTestClasses(DefaultDirectoryScanner.java:80)
at
org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:174)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:83)
... 28 more
On Fri, Jun 1, 2012 at 8:09 PM, Jay Jay Billings
Thanks Igor. I will let you know what I find and if I get a
chance I will make a smaller example program.
Jay
On Fri, Jun 1, 2012 at 7:57 PM, Igor Fedorenko
I don't have the time to investigate problems with source
tree this big,
but your target platform configuration does not look right.
I do not
believe Tycho supports target file with location
type="Directory", only
type="InstallableUnit" is supported.
Jay Jay Billings
2012-06-04 20:33:42 UTC
Permalink
Yes, that's what I meant. If I have an explicit Require-Bundle, shouldn't
Tycho be picking it up? I have a bundle with an explicit Import-Package on
javax.persistence and that package is in turn explicitly required with
Require-Bundle. Tycho doesn't seem to navigate the dependency.

The chain is NiCECore -> NiCE Data Structures -> JPA. I was able to get it
to build by also adding the EclipseLink jars as explicit Required-Bundles
to the NiCE Data Structures plugin. Previously I only had javax.persistence
as an Import-Package. I suppose this makes sense - they are JEE and we are
building outside of a JEE container.

However, this reveals a second problem, one that I mentioned in an early
email. The tests for NiCE Data Structures do not run and they produce an
InvocationTargetException (see attached log). I've also included the output
from the build, run with -X.

Any thoughts?

Jay
Post by Igor Fedorenko
C -> A -> B
OSGi dependencies are not transitive. C will not "see" any packages from
B, you need to add explicit Require-Bundle or Import-Package.
--
Regards,
Igor
Post by Jay Jay Billings
Igor,
I had some more time to look at this today. Can you answer a quick
question for me?
If bundle A depends on bundle B and bundle C depends on A, shouldn't
Tycho include bundle B in the class path in addition to bundle A when it
is building bundle C?
I have the case above with JPA (EclipseLink) and I ran the build with
the -X flag. The transitive dependency described above is not satisfied.
Jay
On Sat, Jun 2, 2012 at 10:10 AM, Jay Jay Billings
Igor,
Changing the repository and running mvn clean seems to fix the
problem with the JPA annotations, but now it produces the second
error I reported when it tries to run the tests (see below). These
tests run fine in Eclipse.
Any thoughts? I've confirmed that this happens with both 0.14 and
0.15. It doesn't say what class it is trying to launch or anything -
it just fails as soon as it tries to launch the tests.
Jay
!ENTRY org.eclipse.osgi 4 0 2012-06-02 10:06:28.190
!MESSAGE Application error
!STACK 1
java.lang.reflect.**InvocationTargetException; nested exception is
java.lang.reflect.**InvocationTargetException: null
java.lang.reflect.**InvocationTargetException
at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native
Method)
at
sun.reflect.**NativeMethodAccessorImpl.**invoke(**
NativeMethodAccessorImpl.java:**57)
at
sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
DelegatingMethodAccessorImpl.**java:43)
at java.lang.reflect.Method.**invoke(Method.java:616)
at
org.apache.maven.surefire.**util.ReflectionUtils.**
invokeMethodWithArray(**ReflectionUtils.java:164)
at
org.apache.maven.surefire.**booter.ProviderFactory$**
ProviderProxy.invoke(**ProviderFactory.java:110)
at
org.apache.maven.surefire.**booter.SurefireStarter.**invokeProvider(**
SurefireStarter.java:175)
at
org.apache.maven.surefire.**booter.SurefireStarter.**
runSuitesInProcess(**SurefireStarter.java:123)
at
org.eclipse.tycho.surefire.**osgibooter.OsgiSurefireBooter.**
run(OsgiSurefireBooter.java:**84)
at
org.eclipse.tycho.surefire.**osgibooter.**HeadlessTestApplication.run(
**HeadlessTestApplication.java:**21)
at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native
Method)
at
sun.reflect.**NativeMethodAccessorImpl.**invoke(**
NativeMethodAccessorImpl.java:**57)
at
sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
DelegatingMethodAccessorImpl.**java:43)
at java.lang.reflect.Method.**invoke(Method.java:616)
at
org.eclipse.equinox.internal.**app.EclipseAppContainer.**
callMethodWithException(**EclipseAppContainer.java:587)
at
org.eclipse.equinox.internal.**app.EclipseAppHandle.run(**
EclipseAppHandle.java:198)
at
org.eclipse.core.runtime.**internal.adaptor.**EclipseAppLauncher.**
runApplication(**EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.**internal.adaptor.**
EclipseAppLauncher.start(**EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.**adaptor.EclipseStarter.run(**
EclipseStarter.java:353)
at
org.eclipse.core.runtime.**adaptor.EclipseStarter.run(**
EclipseStarter.java:180)
at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native
Method)
at
sun.reflect.**NativeMethodAccessorImpl.**invoke(**
NativeMethodAccessorImpl.java:**57)
at
sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
DelegatingMethodAccessorImpl.**java:43)
at java.lang.reflect.Method.**invoke(Method.java:616)
at
org.eclipse.equinox.launcher.**Main.invokeFramework(Main.**java:622)
at org.eclipse.equinox.launcher.**
Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.**Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.**Main.main(Main.java:1386)
Caused by: java.lang.NullPointerException
at java.lang.Class.getAnnotation(**Class.java:3048)
at
org.apache.maven.surefire.**common.junit4.**JUnit4TestChecker.**
isValidJUnit4Test(**JUnit4TestChecker.java:63)
at
org.apache.maven.surefire.**common.junit4.**JUnit4TestChecker.accept(*
*JUnit4TestChecker.java:52)
at
org.apache.maven.surefire.**util.DefaultDirectoryScanner.**
locateTestClasses(**DefaultDirectoryScanner.java:**80)
at
org.apache.maven.surefire.**junit4.JUnit4Provider.**
scanClassPath(JUnit4Provider.**java:174)
at
org.apache.maven.surefire.**junit4.JUnit4Provider.invoke(**
JUnit4Provider.java:83)
... 28 more
On Fri, Jun 1, 2012 at 8:09 PM, Jay Jay Billings
Thanks Igor. I will let you know what I find and if I get a
chance I will make a smaller example program.
Jay
On Fri, Jun 1, 2012 at 7:57 PM, Igor Fedorenko
I don't have the time to investigate problems with source
tree this big,
but your target platform configuration does not look right.
I do not
believe Tycho supports target file with location
type="Directory", only
Sievers, Jan
2012-06-04 21:33:43 UTC
Permalink
your exception during test execution below

Caused by: java.lang.NullPointerException
at java.lang.Class.getAnnotation(Class.java:3048)
at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.isValidJUnit4Test(JUnit4TestChecker.java:63)

is most probably caused by surefire bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=369266

See bug for workaround instructions.

Regards,
Jan



From: tycho-user-***@eclipse.org [mailto:tycho-user-***@eclipse.org] On Behalf Of Jay Jay Billings
Sent: Montag, 4. Juni 2012 22:34
To: Tycho user list
Subject: Re: [tycho-user] javax.persistence class cannot be resolved - It is indirectly referenced from required .class files

Yes, that's what I meant. If I have an explicit Require-Bundle, shouldn't Tycho be picking it up? I have a bundle with an explicit Import-Package on javax.persistence and that package is in turn explicitly required with Require-Bundle. Tycho doesn't seem to navigate the dependency.

The chain is NiCECore -> NiCE Data Structures -> JPA. I was able to get it to build by also adding the EclipseLink jars as explicit Required-Bundles to the NiCE Data Structures plugin. Previously I only had javax.persistence as an Import-Package. I suppose this makes sense - they are JEE and we are building outside of a JEE container.

However, this reveals a second problem, one that I mentioned in an early email. The tests for NiCE Data Structures do not run and they produce an InvocationTargetException (see attached log). I've also included the output from the build, run with -X.

Any thoughts?

Jay
On Mon, Jun 4, 2012 at 3:44 PM, Igor Fedorenko <***@ifedorenko.com> wrote:
C -> A -> B

OSGi dependencies are not transitive. C will not "see" any packages from
B, you need to add explicit Require-Bundle or Import-Package.

--
Regards,
Igor


On 12-06-04 2:44 PM, Jay Jay Billings wrote:
Igor,
I had some more time to look at this today. Can you answer a quick
question for me?

If bundle A depends on bundle B and bundle C depends on A, shouldn't
Tycho include bundle B in the class path in addition to bundle A when it
is building bundle C?

I have the case above with JPA (EclipseLink) and I ran the build with
the -X flag. The transitive dependency described above is not satisfied.

Jay

On Sat, Jun 2, 2012 at 10:10 AM, Jay Jay Billings
<***@gmail.com <mailto:***@gmail.com>> wrote:

Igor,

Changing the repository and running mvn clean seems to fix the
problem with the JPA annotations, but now it produces the second
error I reported when it tries to run the tests (see below). These
tests run fine in Eclipse.

Any thoughts? I've confirmed that this happens with both 0.14 and
0.15. It doesn't say what class it is trying to launch or anything -
it just fails as soon as it tries to launch the tests.

Jay


!ENTRY org.eclipse.osgi 4 0 2012-06-02 10:06:28.190
!MESSAGE Application error
!STACK 1
org.apache.maven.surefire.util.SurefireReflectionException:
java.lang.reflect.InvocationTargetException; nested exception is
java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
at
org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:84)
at
org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.NullPointerException
at java.lang.Class.getAnnotation(Class.java:3048)
at
org.apache.maven.surefire.common.junit4.JUnit4TestChecker.isValidJUnit4Test(JUnit4TestChecker.java:63)
at
org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:52)
at
org.apache.maven.surefire.util.DefaultDirectoryScanner.locateTestClasses(DefaultDirectoryScanner.java:80)
at
org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:174)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:83)
... 28 more



On Fri, Jun 1, 2012 at 8:09 PM, Jay Jay Billings
<***@gmail.com <mailto:***@gmail.com>> wrote:

Thanks Igor. I will let you know what I find and if I get a
chance I will make a smaller example program.

Jay


On Fri, Jun 1, 2012 at 7:57 PM, Igor Fedorenko
<***@ifedorenko.com <mailto:***@ifedorenko.com>> wrote:

I don't have the time to investigate problems with source
tree this big,
but your target platform configuration does not look right.
I do not
believe Tycho supports target file with location
type="Directory", only
type="InstallableUnit" is supported.
Jay Jay Billings
2012-06-05 14:09:10 UTC
Permalink
Jan,

Thanks very much! The workarounds fixed the test problems.

So, to summarize the fixes to the JPA and test problems (for those who will
search the archives in the future):
*javax.persistence and the EclipseLink bundles need to be included as
Require-Bundle, not Import-Package and if the bundle that requires them is
used by another, it also needs to be included with Require-Bundle
*Surefire currently has a bug with junit, described here,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=369266 , and worked around by

Require-Bundle: org.junit;bundle-version="4.8.1"


I've run into one final problem when building our product with 0.14 or 0.15
that I think may be a bug. Building the product works fine with 0.13. With
0.14 or 0.15, everything, including the features, builds fine with "mvn
install," but the product build fails with the following message:

[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: nice.product 2.0.0
[ERROR] Missing requirement: nice.product 2.0.0 requires
'gov.ornl.nice.feature.feature.group [2.0.0,2.0.1)' but it could not be
found

and:

[ERROR] Failed to execute goal
org.eclipse.tycho:tycho-p2-publisher-plugin:0.15.0:publish-products
(default-publish-products) on project gov.ornl.nice.repository: Execution
default-publish-products of goal
org.eclipse.tycho:tycho-p2-publisher-plugin:0.15.0:publish-products failed:
"No solution found because the problem is unsatisfiable.": ["Unable to
satisfy dependency from gov.ornl.nice.repository 2.0.0 to
gov.ornl.nice.feature.feature.group [2.0.0,2.0.1).", "Unable to satisfy
dependency from nice.product 2.0.0 to gov.ornl.nice.feature.feature.group
[2.0.0,2.0.1).", "No solution found because the problem is unsatisfiable."]
-> [Help 1]

The product is the last thing built.

If I run "mvn install -rf :gov.ornl.nice.repository" immediately after the
build, then the products are assembled, packaged and installed perfectly.
Any thoughts on that one?

Jay
Post by Sievers, Jan
your exception during test execution below
Caused by: java.lang.NullPointerException
at java.lang.Class.getAnnotation(Class.java:3048)
at
org.apache.maven.surefire.common.junit4.JUnit4TestChecker.isValidJUnit4Test(JUnit4TestChecker.java:63)
is most probably caused by surefire bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=369266
See bug for workaround instructions.
Regards,
Jan
Sent: Montag, 4. Juni 2012 22:34
To: Tycho user list
Subject: Re: [tycho-user] javax.persistence class cannot be resolved - It
is indirectly referenced from required .class files
Yes, that's what I meant. If I have an explicit Require-Bundle, shouldn't
Tycho be picking it up? I have a bundle with an explicit Import-Package on
javax.persistence and that package is in turn explicitly required with
Require-Bundle. Tycho doesn't seem to navigate the dependency.
The chain is NiCECore -> NiCE Data Structures -> JPA. I was able to get
it to build by also adding the EclipseLink jars as explicit
Required-Bundles to the NiCE Data Structures plugin. Previously I only had
javax.persistence as an Import-Package. I suppose this makes sense - they
are JEE and we are building outside of a JEE container.
However, this reveals a second problem, one that I mentioned in an early
email. The tests for NiCE Data Structures do not run and they produce an
InvocationTargetException (see attached log). I've also included the output
from the build, run with -X.
Any thoughts?
Jay
C -> A -> B
OSGi dependencies are not transitive. C will not "see" any packages from
B, you need to add explicit Require-Bundle or Import-Package.
--
Regards,
Igor
Igor,
I had some more time to look at this today. Can you answer a quick
question for me?
If bundle A depends on bundle B and bundle C depends on A, shouldn't
Tycho include bundle B in the class path in addition to bundle A when it
is building bundle C?
I have the case above with JPA (EclipseLink) and I ran the build with
the -X flag. The transitive dependency described above is not satisfied.
Jay
On Sat, Jun 2, 2012 at 10:10 AM, Jay Jay Billings
Igor,
Changing the repository and running mvn clean seems to fix the
problem with the JPA annotations, but now it produces the second
error I reported when it tries to run the tests (see below). These
tests run fine in Eclipse.
Any thoughts? I've confirmed that this happens with both 0.14 and
0.15. It doesn't say what class it is trying to launch or anything -
it just fails as soon as it tries to launch the tests.
Jay
!ENTRY org.eclipse.osgi 4 0 2012-06-02 10:06:28.190
!MESSAGE Application error
!STACK 1
java.lang.reflect.InvocationTargetException; nested exception is
java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:123)
at
org.eclipse.tycho.surefire.osgibooter.OsgiSurefireBooter.run(OsgiSurefireBooter.java:84)
at
org.eclipse.tycho.surefire.osgibooter.HeadlessTestApplication.run(HeadlessTestApplication.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.NullPointerException
at java.lang.Class.getAnnotation(Class.java:3048)
at
org.apache.maven.surefire.common.junit4.JUnit4TestChecker.isValidJUnit4Test(JUnit4TestChecker.java:63)
at
org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:52)
at
org.apache.maven.surefire.util.DefaultDirectoryScanner.locateTestClasses(DefaultDirectoryScanner.java:80)
at
org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:174)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:83)
... 28 more
On Fri, Jun 1, 2012 at 8:09 PM, Jay Jay Billings
Thanks Igor. I will let you know what I find and if I get a
chance I will make a smaller example program.
Jay
On Fri, Jun 1, 2012 at 7:57 PM, Igor Fedorenko
I don't have the time to investigate problems with source
tree this big,
but your target platform configuration does not look right. I do not
believe Tycho supports target file with location
type="Directory", only
Sievers, Jan
2012-06-05 14:32:29 UTC
Permalink
*javax.persistence and the EclipseLink bundles need to be included as Require-Bundle, not Import-Package
and if the bundle that requires them is used by another, it also needs to be included with Require-Bundle
this is just a guess - p2 bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=360659

may be related. AFAICT p2 does not support attributes in Import/Export-Package such as ;jpa="2.0" in

Export-Package: javax.persistence;version="2.0.3";jpa="2.0"

Regards
Jan
Jay Jay Billings
2012-06-05 15:28:46 UTC
Permalink
Thanks Jan! I'll check that out. Since we're able to build again with 0.13,
we will probably just continue using it for now we have some time to come
back to 0.15.

Thanks to you and Igor for all your help!

Jay
Post by Jay Jay Billings
Post by Jay Jay Billings
*javax.persistence and the EclipseLink bundles need to be included as
Require-Bundle, not Import-Package
Post by Jay Jay Billings
and if the bundle that requires them is used by another, it also needs
to be included with Require-Bundle
this is just a guess - p2 bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=360659
may be related. AFAICT p2 does not support attributes in
Import/Export-Package such as ;jpa="2.0" in
Export-Package: javax.persistence;version="2.0.3";jpa="2.0"
Regards
Jan
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Loading...