Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » JNLP Classloader Visibility Error when launching RCP application
JNLP Classloader Visibility Error when launching RCP application [message #449864] Tue, 23 May 2006 10:19 Go to next message
Eclipse UserFriend
Originally posted by: mntbiknfool.yahoo.com

Hi!

I have been trying for days to make my RCP application work via JNLP with no luck...I give up!! I need help...please! Here are the facts.

<ul>
<li>Eclipse Version 3.2.0 RC4
<li>The application works fine both WITHIN Eclipse AND when exported as a standalone product.
<li>I am attemping to create a proxy object via Spring for use with the Spring HTTPInvoker when the error occurs
<li>The required Spring jars are wrapped in the plugin (see MANIFEST.MF below)
<li>When I export as a deployable JNLP feature and try to start it up, I get the exception shown below
</ul>

My confusion is this. As I understand it, all classes in a bundle share the same class loader. The <b>com.bofa.esm.bpass.BpassServiceIfc</b> interface is contained within the same plugin as the Spring classes (found in the plugin JAR files) that are trying to use it. If that is the case, how can he possibly complain that the class "is not visible from class loader"? Also, why does this work as a standalone app, but not when launched from JNLP? I know the launcher is different and I did see where there was a JNLP classloader bug in earlier versions of Eclipse, but the bug report said it was fixed in 3.2.0 RC2.

Thanks in advance for your help,
--Jim

DEBUG javawsApplicationMain com.bofa.esm.bpa.client.bpass.Application - Starting up...
INFO javawsApplicationMain org.springframework.aop.framework.DefaultAopProxyFactory - CGLIB2 not available: proxyTargetClass feature disabled
INFO javawsApplicationMain org.springframework.core.CollectionFactory - JDK 1.4+ collections available
DEBUG javawsApplicationMain org.springframework.core.CollectionFactory - Creating [java.util.IdentityHashMap]
DEBUG javawsApplicationMain org.springframework.aop.framework.ProxyFactory - Added new aspect interface: com.bofa.esm.bpass.BpassServiceIfc
DEBUG javawsApplicationMain org.springframework.aop.framework.JdkDynamicAopProxy - Creating JDK dynamic proxy
ERROR javawsApplicationMain com.bofa.esm.bpa.client.bpass.Application - IllegalArgumentException
java.lang.IllegalArgumentException: <b>interface com.bofa.esm.bpass.BpassServiceIfc is not visible from class loader</b> at java.lang.reflect.Proxy.getProxyClass(Unknown Source)
at java.lang.reflect.Proxy.newProxyInstance(Unknown Source)
at org.springframework.aop.framework.JdkDynamicAopProxy.getProx y(JdkDynamicAopProxy.java:104)
at org.springframework.aop.framework.JdkDynamicAopProxy.getProx y(JdkDynamicAopProxy.java:94)
at org.springframework.aop.framework.ProxyFactory.getProxy(Prox yFactory.java:70)
at org.springframework.aop.framework.ProxyFactory.getProxy(Prox yFactory.java:99)
at org.springframework.remoting.httpinvoker.HttpInvokerProxyFac toryBean.afterPropertiesSet(HttpInvokerProxyFactoryBean.java :63)
at com.bofa.esm.bpa.client.bpass.model.Session.<init>(Session.java:56)
at com.bofa.esm.bpa.client.bpass.model.Session.getInstance(Sess ion.java:28)
at com.bofa.esm.bpa.client.bpass.Application.run(Application.ja va:50)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
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.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.WebStartMain.basicRun(WebStartMain .java:59)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.WebStartMain.main(WebStartMain.jav a:40)
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 com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

MANIFEST.MF File contents:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: HTTP Invocation Model
Bundle-SymbolicName: com.bofa.esm.bpa.client.model
Bundle-Version: 1.0.0
Bundle-Vendor: Someone somewhere
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime;visibility:=reexport
Export-Package: com.bofa.esm.bpa.client.bpass.model,
com.bofa.esm.dataaccess.bpass,
com.bofa.esm.dataaccess.bpass.vo,
org.apache.commons.logging,
org.apache.log4j
Bundle-ClassPath: commons-logging-1.1.jar,
log4j-1.2.13.jar,
spring-aop.jar,
spring-beans.jar,
spring-core.jar,
spring-remoting.jar,
.
Re: JNLP Classloader Visibility Error when launching RCP application [message #449875 is a reply to message #449864] Tue, 23 May 2006 17:27 Go to previous messageGo to next message
Eclipse UserFriend
Jim,

ClassLoading in JNLP apps is particularly tricky. That's because WebStart
creates a special thread context classloader called JNLPClassLoader which
has visibility of all of the downloaded JARs - ie all of the plugins -
which can really mess up libraries that go by default to the thread
context classloader, eg java.lang.reflect.Proxy.

Fortunately there is a solution - set the system property
"osgi.contextClassLoaderParent" to "boot". You can do this with a
<property> entry in your JNLP file. You'll need to be on 3.2 RC2 or later
for this to work.

See the following bug for the details:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=136860

Regards,
Neil
Re: JNLP Classloader Visibility Error when launching RCP application [message #449894 is a reply to message #449864] Wed, 24 May 2006 08:16 Go to previous message
Eclipse UserFriend
Originally posted by: mntbiknfool.yahoo.com

Neil,

You are a prayer answered!! Your suggestion works like a champ. I had seen the bug report, but must confess my ignorance in understanding what value to set the property osgi.contextClassLoaderParent to. Before RCP I never even considered class loading contexts so this is all new to me. I am still uncertain what the values app, boot, ext, fwk and ccl imply for any given deployment scenario (ie Webstart, native launcher, embedded, etc). Regardless, thank you so much for your help!!

--Jim
Previous Topic:Removing "Restore Defaults" and "Apply" buttons on Preference pages
Next Topic:Action in Coolbar
Goto Forum:
  


Current Time: Sat Aug 30 14:16:36 EDT 2025

Powered by FUDForum. Page generated in 0.03979 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top