Skip to main content

An strange issue happend when trying to run wonderland in Applet

6 replies [Last post]
hhuang
Offline
Joined: 2009-11-17

I am trying to put wonderland application to run as an Applet, but some errors block my progress :

************************************
2010-2-2 14:56:00 org.jdesktop.wonderland.client.modules.ModuleUtils fetchModuleList
Warning: [MODULES] FETCH MODULE INFO Failed
java.net.MalformedURLException
at java.net.URL.(Unknown Source)
at java.net.URL.(Unknown Source)
at java.net.URL.(Unknown Source)
at org.jdesktop.wonderland.client.modules.ModuleUtils.fetchModuleList(ModuleUtils.java:76)
at org.jdesktop.wonderland.client.modules.ServerCache.reload(ServerCache.java:136)
at org.jdesktop.wonderland.client.modules.ServerCache.(ServerCache.java:58)
at org.jdesktop.wonderland.client.modules.ServerCache.getServerCache(ServerCache.java:81)
at org.jdesktop.wonderland.client.assetmgr.modules.ModuleAssetRepositoryFactory.getCachedModule

(ModuleAssetRepositoryFactory.java:119)
at org.jdesktop.wonderland.client.assetmgr.modules.ModuleAssetRepositoryFactory.getDesiredChecksum

(ModuleAssetRepositoryFactory.java:53)
at org.jdesktop.wonderland.client.assetmgr.AssetManager.getAsset(AssetManager.java:206)
at org.jdesktop.wonderland.client.protocols.wlj.WljURLConnection.getInputStream(WljURLConnection.java:106)
at com.sun.deploy.net.DownloadEngine.getJarFileWithoutCache(Unknown Source)
at com.sun.deploy.net.DownloadEngine.downloadJarWithoutCache(Unknown Source)
at sun.plugin.PluginURLJarFileCallBack$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(Unknown Source)
at sun.misc.URLClassPath$JarLoader.getJarFile(Unknown Source)
at sun.misc.URLClassPath$JarLoader.access$600(Unknown Source)
at sun.misc.URLClassPath$JarLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath$JarLoader.ensureOpen(Unknown Source)
at sun.misc.URLClassPath$JarLoader.(Unknown Source)
at sun.misc.URLClassPath$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath.getLoader(Unknown Source)
at sun.misc.URLClassPath.getLoader(Unknown Source)
at sun.misc.URLClassPath.access$000(Unknown Source)
at sun.misc.URLClassPath$1.next(Unknown Source)
at sun.misc.URLClassPath$1.hasMoreElements(Unknown Source)
at java.net.URLClassLoader$3$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader$3.next(Unknown Source)
at java.net.URLClassLoader$3.hasMoreElements(Unknown Source)
at sun.misc.CompoundEnumeration.next(Unknown Source)
at sun.misc.CompoundEnumeration.hasMoreElements(Unknown Source)
at sun.misc.Service$LazyIterator.hasNext(Unknown Source)
at org.jdesktop.wonderland.common.utils.ScannedClassLoader$2.hasNext(ScannedClassLoader.java:191)
at org.jdesktop.wonderland.client.login.ServerSessionManager.initPlugins(ServerSessionManager.java:715)
at org.jdesktop.wonderland.client.login.ServerSessionManager.access$500(ServerSessionManager.java:65)
at org.jdesktop.wonderland.client.login.ServerSessionManager$LoginControl.loginComplete

(ServerSessionManager.java:876)
at org.jdesktop.wonderland.client.login.ServerSessionManager$WebServiceLoginControl.loginComplete

(ServerSessionManager.java:983)
at org.jdesktop.wonderland.client.login.ServerSessionManager$WebServiceLoginControl.authenticate

(ServerSessionManager.java:973)
at org.jdesktop.wonderland.client.login.ServerSessionManager$NoAuthLoginControl.authenticate

(ServerSessionManager.java:1006)
at org.jdesktop.wonderland.client.jme.login.NoAuthLogin.doLogin(NoAuthLogin.java:99)
at org.jdesktop.wonderland.client.jme.login.JmeLoginUI$1.run(JmeLoginUI.java:90)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
************************************

I track the issue log and find the root cause is the URL format is changed by jdk level source, not by wonderland level.

Suppose the correct URL provide to WljURLConnection is like "wlj://hud@localhost:8080/client/hud-client.jar", but as my

tracking result, it turn to be "wlj://localhost:8080/client/hud-client.jar", missing "[module name]@"...

Does anybody has some experience about this issue in Applet, any answer is appreciated ! This issue freak me out for a long time...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bernard_horan
Offline
Joined: 2007-06-04

Hi

can I just check what client platform what you're running this on? And do you really mean Applet? Or are you using the java web start client?

regards

Bernard

hhuang
Offline
Joined: 2009-11-17

yes, I hope it can run in Applet smootly, and I just find the root cause : it is becaused when applet start at the beginning, sun.plugin2.applet.Applet2Environment will invoke URLJarFile.setCallBack(new PluginURLJarFileCallBack()) to set a callback for URLJarFile, when URLJarFile.retrieve, then it will invoke PluginURLJarFileCallBack.retrieve, so the URL is changed in here.

and there is a solution for reference :
URLJarFile.setCallBack(null) in Applet init() .

jagwire
Offline
Joined: 2008-06-21

hhuang,

I'm curious about your applet's architecture. My best guess is that you're hoping to run the client in the applet, and the server....locally on the same webserver as the applet? Are you altering the glassfish build to allow for a page with the applet included?

thanks,
jW

paulby
Offline
Joined: 2003-06-13

Are the protocol handlers for wlj getting installed ? There is a VM option that sets them up at startup, you'll have to google on how to do that for applets.

hhuang
Offline
Joined: 2009-11-17

Hi jagwire , my idea is split the client and server into 2 parts, client will run in an applet, and there is no impact for server part .

Hi paulby , for the WLJ protocol, it really take me a lot of time to fix in applet, and now I get a temporary solution for everybody`s reference : create protocal handler by myself when applet init, the below is the Pseudocode :

****************************************
java.net.URL.setURLStreamHandlerFactory(new java.net.URLStreamHandlerFactory() {

public URLStreamHandler createURLStreamHandler(String protocol) {
if(protocol != null && protocol.compareTo("wlj") == 0) {
return new org.jdesktop.wonderland.client.protocols.wlj.Handler();
}
return null;
}
});
****************************************

nnjones
Offline
Joined: 2006-09-26

Did you ever get the applet working?