Skip to main content

Problem Loading a Jnlp-href'd Applet

3 replies [Last post]
mikeazzi
Offline
Joined: 2003-08-11
Points: 0

Hi,

I am stuck again trying to load, and run a JavaFX applet using the applet tag's jnlp-href attribute. I have been struggling with this for a whole day, and still I haven't been to able figure it out, and I could really use a little help. I have also enabled all the debugging and tracing flags, but the error messages don't seem to giving me any helpful clues. One thing I could tell from the logs is that the plugin is not being able to load the jar files specified in the jnlp file. Why? I don't know. It does not to tell me enough to figure out why. I tried diiferent values for the applet's codebase attribute, moving the jars around. Nothing helped. The one thing that's unique with this test case is that the applet tag is placed in a jsp file, and the web server does some kind of url mapping between the physical, and the logical location of these jsp files. So here's what the applet tag looks like in the jsp:

And here's what the plugin error log looks like:

Java Plug-in 1.6.0_10-rc
Using JRE version 1.6.0_10-rc Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Administrator
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to
----------------------------------------------------

security: property package.access value sun.
security: property package.access new value sun.,com.sun.javaws
security: property package.access value sun.,com.sun.javaws
security: property package.access new value sun.,com.sun.javaws,com.sun.deploy
security: property package.definition value null
security: property package.definition new value com.sun.javaws
security: property package.definition value com.sun.javaws
security: property package.definition new value com.sun.javaws,com.sun.deploy
security: property package.definition value com.sun.javaws,com.sun.deploy
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access value sun.,com.sun.javaws,com.sun.deploy
security: property package.access new value sun.,com.sun.javaws,com.sun.deploy,org.mozilla.jss
security: property package.definition value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
network: Created version ID: 1.4.2.13
network: Created version ID: 1.4
network: Created version ID: 1.6.0.10.rc
network: Created version ID: 1.6
network: Created version ID: 1.6.0.10.rc
network: Created version ID: 1.6
network: Created version ID: 1.6.0.10.rc
network: Created version ID: 1.6
network: Cache entry found [url: http://localhost:7001/maximo/LinearCtrl.jnlp, version: null]
network: Connecting http://localhost:7001/maximo/LinearCtrl.jnlp with proxy=DIRECT
network: Connecting http://localhost:7001/ with proxy=DIRECT
network: Connecting http://localhost:7001/maximo/LinearCtrl.jnlp with cookie "JSESSIONID=82hkLZ3GDvFh67KjkJJ0k81WhhWzWCVJ01LlJrl814SnlX2TY81L!-368072417"
network: ResponseCode for http://localhost:7001/maximo/LinearCtrl.jnlp : 200
network: Encoding for http://localhost:7001/maximo/LinearCtrl.jnlp : null
network: Disconnect connection to http://localhost:7001/maximo/LinearCtrl.jnlp
network: Connecting http://localhost:7001/maximo/LinearCtrl.jnlp with proxy=DIRECT
network: Connecting http://localhost:7001/ with proxy=DIRECT
network: Connecting http://localhost:7001/maximo/LinearCtrl.jnlp with cookie "JSESSIONID=82hkLZ3GDvFh67KjkJJ0k81WhhWzWCVJ01LlJrl814SnlX2TY81L!-368072417"
network: ResponseCode for http://localhost:7001/maximo/LinearCtrl.jnlp : 200
network: Encoding for http://localhost:7001/maximo/LinearCtrl.jnlp : null
network: Sever response: (length: 1263, lastModified: Wed Aug 06 10:34:41 EDT 2008, downloadVersion: null, mimeType: application/x-java-jnlp-file)
basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@a8c488
basic: APPLET tag missing CODE parameter.
APPLET tag missing CODE parameter.
network: Downloading resource: http://localhost:7001/maximo/LinearCtrl.jnlp
Content-Length: 1,263
Content-Encoding: null
network: Wrote URL http://localhost:7001/maximo/LinearCtrl.jnlp to File C:\Documents and Settings\Administrator\Application Data\Sun\Java\Deployment\cache\6.0\27\7dfa1c1b-4c6601e0-temp
network: Disconnect connection to http://localhost:7001/maximo/LinearCtrl.jnlp
network: Cache: Enable a new CacheEntry: http://localhost:7001/maximo/LinearCtrl.jnlp
network: Remove cache entry: http://localhost:7001/maximo/LinearCtrl.jnlp
network: CleanupThread used 43332 us
temp: new XMLParser with source:
temp: <?xml version="1.0" encoding="UTF-8"?>

Applet HTML Page
My Company, Inc

temp:

returning ROOT as follows:

Applet HTML Page
My Company, Inc

jnlp

network: Created version ID: 1.6.0.10.rc
network: Created version ID: 1.6
network: Created version ID: 1.6+
network: Created version ID: 1.6.0.10.rc
temp: returning LaunchDesc from XMLFormat.parse():

Applet HTML Page
My Company, Inc

Exception in thread "AWT-EventQueue-3" java.lang.InternalError: couldn't create component peer
at sun.awt.windows.WComponentPeer.checkCreation(Unknown Source)
at sun.awt.windows.WComponentPeer.(Unknown Source)
at sun.awt.windows.WCanvasPeer.(Unknown Source)
at sun.awt.windows.WPanelPeer.(Unknown Source)
at sun.awt.windows.WWindowPeer.(Unknown Source)
at sun.awt.windows.WFramePeer.(Unknown Source)
at sun.awt.windows.WEmbeddedFramePeer.(Unknown Source)
at sun.awt.windows.WToolkit.createEmbeddedFrame(Unknown Source)
at sun.awt.windows.WEmbeddedFrame.addNotify(Unknown Source)
at sun.plugin2.main.client.PluginEmbeddedFrame.addNotify(Unknown Source)
at sun.awt.windows.WEmbeddedFrame.(Unknown Source)
at sun.plugin2.main.client.PluginEmbeddedFrame.(Unknown Source)
at sun.plugin2.main.client.PluginMain$StartAppletRunner.run(Unknown Source)
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 would really appreciate it if some one can tell me what's going on. I am using b28 on Win XP.

Thanks,
Mike

Message was edited by: mikeazzi

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gemsbond
Offline
Joined: 2007-08-31
Points: 0

I found this helpful and it solved my problem:

There are two main problems here:
1) Files under WEB-INF can not be accessed through HTTP requests. The WEB-INF
directory is intended for resources used by the server application only,
such as class files for beans you use in your JSP pages. So you must place
the applet classes in a directory that's "public" (can be accessed through
HTTP), for instance in a subdirectory named "classes" in the directory
where you have the JSP page (<...>jsp\EditTables in your case). The
"codebase"
attribute must contain the path to this directory, i.e. codebase="classes"
in this case.
2) The directory structure for the directory where you store the class
files must mirror the package structure. For instance, if your class
belongs to a package named com.foo, you need to place it in a subdirectory
to your "classes" directory named "com\foo". The "code" attribute must
contain the complete class name, including the package name. In your
case, it doesn't look like you use a package name (you seem to incorrectly
use the directory name as a package name).

So, after you have moved the class files to a "classes" subdirectory in the
directory where you have the JSP page, try something like this:

codebase="classes" jreversion="1.3" width="500" height="500" >

Plugin tag OBJECT or EMBED not supported by browser.

mikeazzi
Offline
Joined: 2003-08-11
Points: 0

OK, here's an update, I was able to get it to partially work: If I do ctrl-F5 in the page the applet loads, and run fine. So let me ask this question then. Please take a look at this part of the console output from above:

Particularly take a look at the documentbase attribute. My question is how does the plugin compute, or get the value of this attribute, and what's its role? I have a sneaky suspicion that this attribute might have something to do with my problem. The reason I am saying this is when I do the Ctrl-F5 trick in the page, and when the applet loads fine, the value of this attribute changes to :

So now there is a uisessionid parameter as part of the documentbase. I wonder what's the significance of this, but it seems that its presence may have something to do with it being working. If that's the case how do I always force this value in the documentbase attribute. Please also note that the site I am testing with is a login protected site. Could that be also part of the problem?

Thanks,
Mike

Message was edited by: mikeazzi

sanjograina
Offline
Joined: 2009-09-05
Points: 0

Hi Mikeazzi,

I am trying to do something similar in maximo 6. I need to create an applet and want the applet to use the mbo classes so the db connection is managed by maximo. I later need to be able to open this applet from select action. Could you point me towards a solution?

Regards,

-Sanjog