Home » Eclipse Projects » Remote Application Platform (RAP) » ClassNotFoundException in OSGi but jars included (Problem resolving classes that apparently are included)
| ClassNotFoundException in OSGi but jars included [message #989723] |
Fri, 07 December 2012 07:50  |
 |
John Gymer Messages: 77 Registered: November 2012 Location: UK |
Member |
|
|
Trying to execute a RAP application from Eclipse 4.2.1 with RAP 2.0 M3 under OSGi but having problems persuading it to find all of my referenced classes.
The application runs ok as SWT Standalone.
Firstly, here is the error reported in the console:
2012-12-07 12:25:37.033:WARN:oejs.ServletHandler:ERROR: Error for /rapide;jsessionid=k3ooqc2qng501m3x93hh6xkcv
java.lang.NoClassDefFoundError: com/ca/gen80/abrt/ABBase
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at iet.co.uk.rapide.RapideInstance.initialisePStep(RapideInstance.java:2299)
at iet.co.uk.rapide.RapideMain.GenGUILoadPStep(RapideMain.java:194)
at iet.co.uk.rapide.RapideMain.begin(RapideMain.java:76)
at iet.co.uk.rapide.RapideMain.start(RapideMain.java:35)
at iet.co.uk.rapide.RapideEntryPoint.createUI(RapideEntryPoint.java:52)
at iet.co.uk.rapide.RapideApplication.start(RapideApplication.java:8)
at org.eclipse.rap.ui.internal.application.EntryPointApplicationWrapper.createUI(EntryPointApplicationWrapper.java:38)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:186)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:298)
at java.lang.Thread.run(Thread.java:662)
at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)
Caused by:
java.lang.ClassNotFoundException: com.ca.gen80.abrt.ABBase
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at iet.co.uk.rapide.RapideInstance.initialisePStep(RapideInstance.java:2299)
at iet.co.uk.rapide.RapideMain.GenGUILoadPStep(RapideMain.java:194)
at iet.co.uk.rapide.RapideMain.begin(RapideMain.java:76)
at iet.co.uk.rapide.RapideMain.start(RapideMain.java:35)
at iet.co.uk.rapide.RapideEntryPoint.createUI(RapideEntryPoint.java:52)
at iet.co.uk.rapide.RapideApplication.start(RapideApplication.java:8)
at org.eclipse.rap.ui.internal.application.EntryPointApplicationWrapper.createUI(EntryPointApplicationWrapper.java:38)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:186)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:298)
at java.lang.Thread.run(Thread.java:662)
at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:102)
My RAP application is the 'iet.co.uk.rapide' one, which references a set of classes starting 'ca.com.gen80.*'. These are in a single JAR called 'gen80rt.jar'.
Where should I be specifying the gen80rt.jar so that my RAP app can find it at runtime? gen80rt.jar is not a Plug-in or a Bundle, just a totally stand-alone JAR file. There doesn't appear to be a concept of a CLASSPATH for RAP applications (apart from the Bundle's Classpath that I've included further down in this post), which sort of makes sense since they have to define precisely what they export and what they import in the manifest, but how to actually reference this JAR?
Perhaps this is very basic, and I'm missing something fundamental, so please be patient while I get my head around it all!
I've placed gen80rt.jar into WEB-INF/lib by the way.
Basic project structure as below:

ss from OSGi in the console gives:
ss
"Framework is launched."
id State Bundle
0 ACTIVE org.eclipse.osgi_3.9.0.v20121026-132713
Fragments=7
1 ACTIVE org.eclipse.equinox.preferences_3.5.0.v20120918-182152
2 ACTIVE org.eclipse.core.databinding.observable_1.4.1.v20120521-2329
3 ACTIVE org.apache.felix.gogo.shell_0.8.0.v201110170705
4 ACTIVE org.eclipse.equinox.app_1.3.100.v20120522-1841
5 ACTIVE org.eclipse.rap.ui.workbench_2.0.0.20121106-1948
6 ACTIVE org.eclipse.equinox.console_1.0.100.v20121001-124408
7 RESOLVED org.eclipse.equinox.servletbridge.extensionbundle_1.2.100.v20120522-2049
Master=0
8 ACTIVE org.apache.felix.gogo.command_0.8.0.v201108120515
9 ACTIVE org.eclipse.core.commands_3.6.1.v20120814-150512
10 ACTIVE org.eclipse.rap.jface.databinding_2.0.0.20121031-1050
11 ACTIVE org.eclipse.rap.rwt.osgi_2.0.0.20121031-1050
12 ACTIVE org.eclipse.jetty.security_8.1.3.v20120522
13 ACTIVE org.eclipse.equinox.http.jetty_3.0.0.v20120522-1841
14 ACTIVE org.eclipse.equinox.http.registry_1.1.200.v20120912-125810
15 ACTIVE org.eclipse.core.databinding_1.4.1.v20120912-132807
16 ACTIVE org.eclipse.equinox.common_3.6.100.v20120522-1841
17 ACTIVE org.eclipse.core.runtime_3.9.0.v20121004-163638
18 ACTIVE javax.servlet_3.0.0.v201112011016
19 ACTIVE org.eclipse.rap.ui_2.0.0.20121105-1706
20 ACTIVE org.eclipse.core.databinding.beans_1.2.200.v20120523-1955
21 ACTIVE org.eclipse.equinox.registry_3.5.300.v20120731-134527
22 ACTIVE org.eclipse.core.expressions_3.4.401.v20120912-155018
23 ACTIVE org.eclipse.jetty.util_8.1.3.v20120522
24 ACTIVE iet.co.uk.rapide.runtime_1.0.0.qualifier
25 ACTIVE org.eclipse.osgi.services_3.3.100.v20120522-1822
26 ACTIVE org.eclipse.jetty.server_8.1.3.v20120522
27 ACTIVE org.eclipse.core.contenttype_3.4.200.v20120523-2004
28 ACTIVE com.ibm.icu.base_4.4.2.v20110831
29 ACTIVE org.eclipse.jetty.http_8.1.3.v20120522
30 ACTIVE org.eclipse.help_3.6.0.v20120521-2344
31 ACTIVE org.eclipse.core.databinding.property_1.4.200.v20120824-092539
32 ACTIVE org.eclipse.rap.design.example_1.5.100.20121109-0718
33 ACTIVE org.apache.felix.gogo.runtime_0.8.0.v201108120515
34 ACTIVE org.eclipse.jetty.continuation_8.1.3.v20120522
35 ACTIVE org.eclipse.rap.jface_2.0.0.20121031-1050
36 ACTIVE org.eclipse.equinox.http.servlet_1.1.300.v20120912-125810
37 ACTIVE org.eclipse.jetty.io_8.1.3.v20120522
38 ACTIVE org.eclipse.rap.ui.forms_1.5.100.20121105-1308
39 ACTIVE org.eclipse.rap.rwt_2.0.0.20121112-1148
40 ACTIVE org.eclipse.core.jobs_3.5.300.v20120912-155018
41 ACTIVE org.eclipse.jetty.servlet_8.1.3.v20120522
42 ACTIVE javax.xml_1.3.4.v201005080400
43 ACTIVE org.eclipse.rap.ui.views_1.5.100.20121031-1050
osgi>
So I can see my Bundle as ACTIVE at number 24 in this case.
My Manifest looks like this:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: iet.co.uk.rapide.runtime;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: %Bundle-Vendor
Import-Package: iet.co.uk.rapide,
org.eclipse.rap.rwt.application;version="2.0.0",
org.eclipse.rap.rwt.lifecycle;version="2.0.0",
org.eclipse.rap.rwt.widgets;version="2.0.0",
org.eclipse.swt,
org.eclipse.swt.events,
org.eclipse.swt.graphics,
org.eclipse.swt.layout,
org.eclipse.swt.widgets
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: iet.co.uk.rapide;
uses:="com.ca.gen80.vwrt.vdf,
eu.jgen.gen.invoke.ab.base,
org.eclipse.swt.events,
org.eclipse.rap.rwt.application,
org.w3c.dom,
org.eclipse.swt.ole.win32,
com.ca.gen80.abrt,
com.ca.gen80.csu.exception,
com.ca.gen80.vwrt,
org.eclipse.rap.rwt.lifecycle,
org.eclipse.equinox.app,
org.eclipse.swt.graphics,
org.eclipse.swt.widgets"
Require-Bundle: org.eclipse.rap.ui
Bundle-ClassPath: .,
WEB-INF/lib/gen80rt.jar
I'm not sure that I understand where the 'uses' come from, or if they are relevant?
Any suggestions as to how to get the class loader to see the Classes in gen80rt.jar?
Thanks, John
---
Just because you can doesn't mean you should
[Updated on: Fri, 07 December 2012 07:51] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Thu May 23 03:52:37 EDT 2013
Powered by FUDForum. Page generated in 0.02417 seconds
|