Home
Analytics
Launching from Eclipse is fine, while Maven/tycho Build is raising ClassNotFoundException
lumo
<p>Hello Folks (i write this post the second time, got lost on last one - doh!)</p>
<p> </p>
<p>i'm using BIRT 4.3 for my RCP Application (Eclipse 4.3)</p>
<p>when i run the application from within the IDE (launch product) birt reports are displaying fine in the viewer.</p>
<p> </p>
<p>but when i now run an export (via Maven/Tycho pom.xml) all builds finish as Sucess!</p>
<p>BUT when i launch the exported application and go to the birt viewer i get the following exception:</p>
<pre class="_prettyXprint _lang-">
java.lang.ClassNotFoundException: org.mozilla.javascript.ScriptOrFnNode cannot be found by org.eclipse.birt.data_4.3.2.v20140211-1400
</pre>
<p>my target definition is a subset of what i got in my parent pom.xml, so there should be even more stuff available.</p>
<p> </p>
<p>i'm including the BIRT update site as repository in my pom</p>
<pre class="_prettyXprint _lang-">
<repository>
<id>birt</id>
<layout>p2</layout>
<url>http://download.eclipse.org/birt/update-site/4.3</url>
</repository>
</pre>
<p>same in my target def.</p>
<p> </p>
<p>side-note: if i add a line to test in my ViewerView - just to see if its available - its fine, no errors nor warnings:</p>
<pre class="_prettyXprint _lang-">
ScriptOrFnNode testNode = new ScriptOrFnNode(ScriptOrFnNode.ATTRIBUTE_FLAG);
</pre>
<p>EDIT: compiling with tycho fails if i add this line! ^^^ (obvious, but i do not need to launch the app to see the exception from birt then)</p>
<p> </p>
<p>the feature <strong>org.eclipse.birt.chart</strong> is included in my feature definition, so the org.mozilla.javascript should be included, as its included in this feature.</p>
<p> </p>
<p>what am i doing wrong/missing? (afaik the update site should include all birt needs to be run?!)</p>
<p>iff you need more information let me know!</p>
Find more posts tagged with
Comments
mwilliams
I won't claim to be a maven expert, so forgive me if I'm way off base, but wouldn't you want to use the runtime artifact from maven vs pointing to the update site? Something like:<br><br><pre class="_prettyXprint _lang-auto _linenums:0">
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.birt.runtime</artifactId>
<version>4.3.0</version>
</dependency>
</pre>
lumo
<p>thanks for your reply.</p>
<p> </p>
<p>afaik i have to specify the repository so maven knows where to search for the birt files/bundles</p>
<p> </p>
<p>further i now added the dependency to my birt feature for the application.</p>
<p> </p>
<p>seems maven is not able to resolve the complete birt runtime (shouldnt this included in the birt update site i specified??)</p>
<p> </p>
<p>so my parent pom.xml includes (NOTE: same result if i uncomment these lines - seems the birt update site is already included in one of my other repositories - probebly the kepler one)</p>
<pre class="_prettyXprint _lang-">
<repository>
<id>birt</id>
<layout>p2</layout>
<url>http://download.eclipse.org/birt/update-site/4.3</url>
</repository>
</pre>
<p>and my birt.feature pom.xml includes</p>
<pre class="_prettyXprint _lang-">
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.birt.runtime</artifactId>
<version>4.3.0</version>
</dependency>
</pre>
<p>when running the build i get the log on end of this post.</p>
<p> </p>
<p>Q: does the birt runtime include ALL libs needed or do i need to include the org.apache.poi myself (As its called runtime i'd guess its all included) so no clue why something is missing...</p>
<pre class="_prettyXprint _lang-">
[WARNING] Missing POM for org.eclipse.birt.runtime:org.apache.poi:jar:3.9.0.v201303080712
[WARNING] Missing POM for milyn:flute:jar:1.3
[ERROR] Internal error: java.lang.RuntimeException: Could not resolve project dependencies: Missing:
[ERROR]
[ERROR] 1) org.eclipse.birt.runtime:org.apache.poi:jar:3.9.0.v201303080712
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.eclipse.birt.runtime -DartifactId=org.apache.poi -Dversion=3.9.0.v201303080712 -Dpackaging=jar -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.eclipse.birt.runtime -DartifactId=org.apache.poi -Dversion=3.9.0.v201303080712 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR] Path to dependency:
[ERROR] 1) biooffice:at.biooffice.feature.birt:pom:1.0.0-SNAPSHOT
[ERROR] 2) org.eclipse.birt.runtime:org.eclipse.birt.runtime:jar:4.3.0
[ERROR] 3) org.eclipse.birt.runtime:org.apache.poi:jar:3.9.0.v201303080712
[ERROR]
[ERROR]
[ERROR] 1 required artifact is missing.
[ERROR]
[ERROR] for artifact:
[ERROR] biooffice:at.biooffice.feature.birt:pom:1.0.0-SNAPSHOT
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] kepler (http://download.eclipse.org/releases/kepler, releases=false, snapshots=false),
[ERROR] orbit (http://download.eclipse.org/tools/orbit/downloads/drops/R20140525021250/repository/, releases=false, snapshots=false),
[ERROR] e4-tools (http://download.vogella.com/kepler/e4tools, releases=false, snapshots=false),
[ERROR] eclipse-link (http://download.eclipse.org/rt/eclipselink/updates, releases=false, snapshots=false),
[ERROR] nat-table (file:T:/TargetPlatform/e44.luna/NatTable-1.1.0, releases=false, snapshots=false),
[ERROR] gem-jpa (http://download.eclipse.org/gemini/jpa/updates, releases=false, snapshots=false),
[ERROR] gem-dba (http://download.eclipse.org/gemini/updates/dbaccess/1.1.0, releases=false, snapshots=false),
[ERROR] gem-ext (file:T:/TargetPlatform/tycho/org.eclipse.gemini.ext.di/updatesite, releases=false, snapshots=false),
[ERROR] birt (http://download.eclipse.org/birt/update-site/4.3, releases=false, snapshots=false),
[ERROR] central (http://repo.maven.apache.org/maven2, releases=true, snapshots=false)
[ERROR] -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not resolve project dependencies
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:167)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.RuntimeException: Could not resolve project dependencies
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.collectPomDependencies(P2DependencyResolver.java:268)
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.computePreliminaryTargetPlatform(P2DependencyResolver.java:197)
at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject(DefaultTychoResolver.java:99)
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:75)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
... 11 more
Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:
1) org.eclipse.birt.runtime:org.apache.poi:jar:3.9.0.v201303080712
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.eclipse.birt.runtime -DartifactId=org.apache.poi -Dversion=3.9.0.v201303080712 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.eclipse.birt.runtime -DartifactId=org.apache.poi -Dversion=3.9.0.v201303080712 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) biooffice:at.biooffice.feature.birt:pom:1.0.0-SNAPSHOT
2) org.eclipse.birt.runtime:org.eclipse.birt.runtime:jar:4.3.0
3) org.eclipse.birt.runtime:org.apache.poi:jar:3.9.0.v201303080712
1 required artifact is missing.
for artifact:
biooffice:at.biooffice.feature.birt:pom:1.0.0-SNAPSHOT
from the specified remote repositories:
kepler (http://download.eclipse.org/releases/kepler, releases=false, snapshots=false),
orbit (http://download.eclipse.org/tools/orbit/downloads/drops/R20140525021250/repository/, releases=false, snapshots=false),
e4-tools (http://download.vogella.com/kepler/e4tools, releases=false, snapshots=false),
eclipse-link (http://download.eclipse.org/rt/eclipselink/updates, releases=false, snapshots=false),
nat-table (file:T:/TargetPlatform/e44.luna/NatTable-1.1.0, releases=false, snapshots=false),
gem-jpa (http://download.eclipse.org/gemini/jpa/updates, releases=false, snapshots=false),
gem-dba (http://download.eclipse.org/gemini/updates/dbaccess/1.1.0, releases=false, snapshots=false),
gem-ext (file:T:/TargetPlatform/tycho/org.eclipse.gemini.ext.di/updatesite, releases=false, snapshots=false),
birt (http://download.eclipse.org/birt/update-site/4.3, releases=false, snapshots=false),
central (http://repo.maven.apache.org/maven2, releases=true, snapshots=false)
at org.apache.maven.artifact.resolver.DefaultResolutionErrorHandler.throwErrors(DefaultResolutionErrorHandler.java:71)
at org.apache.maven.DefaultProjectDependenciesResolver.resolveImpl(DefaultProjectDependenciesResolver.java:162)
at org.apache.maven.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:75)
at org.apache.maven.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:59)
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.collectPomDependencies(P2DependencyResolver.java:255)
... 16 more
</pre>
lumo
<p>update:</p>
<p> </p>
<p>solved the POI problem by using <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/files/file/925-using-birt-430-with-maven/'>this</a> article.</p>
;
<p> </p>
<p>still the problem with this in the built/exported version via maven.</p>
<pre class="_prettyXprint _lang-">
java.lang.ClassNotFoundException: org.mozilla.javascript.ScriptOrFnNode cannot be found by org.eclipse.birt.core_4.3.2.v20140211-1400
</pre>
<p>UPDATE:</p>
<p>org.eclipse.birt.chart includes the needed jar, but somehow its not found!</p>
<p> </p>
<p>i googled how to include the required libs from other sources, and noticed the jar rhino.js-1.7R2.jar would include the class needed too so i added:</p>
<p> </p>
<div>
<pre class="_prettyXprint">
<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<version>1.7R2</version>
</dependency> </pre>
<p>which includes the requested file (i downloaded the jar from the repository and looked at its content - which is correct!</p>
</div>
<p> </p>
<p>still the Class ScriptOrFnNode cannot be resolved</p>
<p> </p>
<p>how come i am the only one facing this problem - everybody should get this problem, as i do not do anything special!</p>
mwilliams
Sorry for the delay. I was at Big Data TechCon, this week. So, is everything solved or are you still stuck somewhere?
lumo
<p>i was not able to resolve this issue.</p>
<p>no clue whats going wrong. to me it seems the files needed are available (otherwise maven would not build it) - as the BIRT update page includes the needed jar. still on runtime it does not find it.</p>
<p>iff you need any more information / screens let me know.</p>
mwilliams
If I install Tycho and Maven, can you give me steps to reproduce this? Or is it too complex to reproduce?
lumo
<p>sorry for the delay but i had an accident and will not be able to check until 17th may.</p>
mwilliams
Good luck with everything. If I figure something else out for you on this, I'll post in here.
ashadale
<p>I am having similar problem.. i am trying to add <a data-ipb='nomediaparse' href='
http://download.eclipse.org/birt/update-site/4.4'>http://download.eclipse.org/birt/update-site/4.4</a>to
my tycho features but was unsuccesful in doing it. I did not find any documentation on how to do that. </p>
<p> </p>
<p>If anybody resolved similar issue please let me know, I really need some help.</p>
cmalnoe
<p>i do have similar issue to using tycho/mvn and deploy it to glassfish 3.1.2.2
</p>
<p> </p>
<p>Here is my post : <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/36893-runtime-error-while-using-birt-xml-plugin/'>http://developer.actuate.com/community/forum/index.php?/topic/36893-runtime-error-while-using-birt-xml-plugin/</a></p>
;
<p> </p>
<p>Do you think it deals with osgi issues?</p>
<p> </p>
<p>thanks</p>
<p> </p>
<p>Caroline</p>