Unable to access class from required plugin dependency [message #140610] |
Fri, 17 July 2009 00:35 |
Christoph Messages: 55 Registered: July 2009 |
Member |
|
|
Hello,
I have modified the "RAP application with a view" template by adding a
required plugin dependency that contains a class called Backend. The
View class calls a method in the Backend class. However, when I attempt
to run the modified rap application, I get the following error:
java.lang.ClassNotFoundException: com.manager.backend.Backend
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:489)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:405)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:393)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320 )
at test_rap_2.View$ViewContentProvider.getElements(View.java:36 )
at
org.eclipse.jface.viewers.StructuredViewer.getRawChildren(St ructuredViewer.java:935)
[...]
The program runs without error, as expected, if I don't call Backend
from View.
Here is the Manifest.MF file:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Test_rap_2
Bundle-SymbolicName: test_rap_2; singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: test_rap_2.Activator
Require-Bundle: org.eclipse.rap.ui,
com_manager_model;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: javax.servlet;version="2.4.0",
javax.servlet.http;version="2.4.0"
The osgi console shows the required plugin is active, as follows:
com_manager_model_1.0.0 [25]
Id=25, Status=ACTIVE Data
Root=/[...]/.plugins/org.eclipse.pde.core/test_rap_2/org.ecl ipse.osgi/bundles/25/data
No registered services.
No services in use.
I'm using eclipse 3.5, RAP 1.2.
Any assistance would be much appreciated.
Thank you,
Christoph
|
|
|
|
Re: Unable to access class from required plugin dependency [message #140707 is a reply to message #140620] |
Sun, 19 July 2009 23:44 |
Christoph Messages: 55 Registered: July 2009 |
Member |
|
|
Thanks, Chris, this may be a class loading issue as you said. When I
create a separate test backend plugin with a single-method TestBackend
class, I can access that TestBackend class. I may just need to
incrementally re-create my backend plugin and test it as I go (it works
for the RCP version).
The "real" com_manager_model bundle does export the com.manager.backend
package. Here is the MANIFEST.MF:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: com_manager_model
Bundle-SymbolicName: com_manager_model; singleton:=true
Bundle-Version: 1.0.0
Bundle-ClassPath: com_manager_model.jar
Eclipse-RegisterBuddy: com.manager.database
Export-Package: com.manager.backend,
com.manager.model,
com.manager.model.test
Require-Bundle: com.manager.database
As you can see, this bundle is dependent on a com.manager.database
bundle and that bundle could be the source of the problem (...?). If you
see any obvious problems here, please let me know. Otherwise, I'll just
take a closer look at the backend plugin itself, which seems to be
causing the troubles.
Thanks,
Christoph
On 07/16/2009 06:51 PM Chris Aniszczyk wrote:
> Does the 'com_manager_model' bundle export the 'com.manager.backend'
> package?
>
> Can you post the MANIFEST.MF of that class?
>
> Also, are you doing anything in the constructor of that class that could
> throw an exception and cause problems during class loading?
>
> Cheers,
>
> Chris Aniszczyk | EclipseSource Austin | +1 860 839 2465
> http://twitter.com/eclipsesource | http://twitter.com/caniszczyk
|
|
|
Powered by
FUDForum. Page generated in 0.02634 seconds