I have problem about applet deployment with jar files.

C

crazytazo

I'm developing java applet. but I have faced one problem.
My code running very well, on applet viewer.
but my webserver didn't.

html code is follow.
<html>
<body>
applet test page.

<applet name = "myApplet" code="BizApplet" width=400 height=500
archive="Applet1.jar, swingx-0.9.3.jar,
org.apache.commons.logging_1.0.4.v20080605-1930.jar, axis.jar, commons-
discovery-0.2.jar, javax.wsdl_1.5.1.v200806030408.jar, jaxrpc.jar,
saaj.jar">
</applet>

<INPUT type="button" value="call Java Applet method"
onClick = "document.myApplet.test()"></INPUT>

</body>
</html>

My applet load very well. but when applet code import xml parse
library, it comes error.

I'm analize packet.
208 16.991003 10.30.1.115 10.30.1.81 HTTP GET /applet1.htm HTTP/1.1
957 56.727367 10.30.1.115 10.30.1.81 HTTP GET /Applet1.jar HTTP/1.1
962 57.031786 10.30.1.115 10.30.1.81 HTTP GET /swingx-0.9.3.jar HTTP/
1.1
1558 100.337243 10.30.1.115 10.30.1.81 HTTP GET /
org.apache.commons.logging_1.0.4.v20080605-1930.jar HTTP/1.1
1560 100.379605 10.30.1.115 10.30.1.81 HTTP GET /axis.jar HTTP/1.1
1564 100.595306 10.30.1.115 10.30.1.81 HTTP GET /commons-
discovery-0.2.jar HTTP/1.1
1566 100.681340 10.30.1.115 10.30.1.81 HTTP GET /
javax.wsdl_1.5.1.v200806030408.jar HTTP/1.1
1568 100.765584 10.30.1.115 10.30.1.81 HTTP GET /jaxrpc.jar HTTP/1.1
1571 100.817318 10.30.1.115 10.30.1.81 HTTP GET /saaj.jar HTTP/1.1
1573 100.871653 10.30.1.115 10.30.1.81 HTTP GET /META-INF/services/
org.xml.sax.driver HTTP/1.1 <--------------- 404!!!!

Every requests work well. Except last one.

..
Follow lines is trace.
network: ij½Ã Ç׸ñÀÌ ÀÖ½À´Ï´Ù. [url: http://10.30.1.81/axis.jar, ¹öÀü: null]
network: http://10.30.1.81/axis.jarÀ»(¸¦) proxy=DIRECT°ú(¿Í) ¿¬°á Áß
network: http://10.30.1.81/axis.jar ÀÀ´ä ÄÚµå: 304
network: http://10.30.1.81/axis.jar ÀÎÄÚµù: null
network: http://10.30.1.81/axis.jar°ú(¿Í) ¿¬°á ²÷±â
network: ij½Ã Ç׸ñÀÌ ÀÖ½À´Ï´Ù. [url: http://10.30.1.81/commons-discovery-0.2.jar,
¹öÀü: null]
network: http://10.30.1.81/commons-discovery-0.2.jarÀ»(¸¦) proxy=DIRECT°ú
(¿Í) ¿¬°á Áß
network: http://10.30.1.81/commons-discovery-0.2.jar ÀÀ´ä ÄÚµå: 304
network: http://10.30.1.81/commons-discovery-0.2.jar ÀÎÄÚµù: null
network: http://10.30.1.81/commons-discovery-0.2.jar°ú(¿Í) ¿¬°á ²÷±â
network: ij½Ã Ç׸ñÀÌ ÀÖ½À´Ï´Ù. [url: http://10.30.1.81/javax.wsdl_1.5.1.v200806030408.jar,
¹öÀü: null]
network: http://10.30.1.81/javax.wsdl_1.5.1.v200806030408.jarÀ»(¸¦)
proxy=DIRECT°ú(¿Í) ¿¬°á Áß
network: http://10.30.1.81/javax.wsdl_1.5.1.v200806030408.jar ÀÀ´ä ÄÚµå:
304
network: http://10.30.1.81/javax.wsdl_1.5.1.v200806030408.jar ÀÎÄÚµù:
null
network: http://10.30.1.81/javax.wsdl_1.5.1.v200806030408.jar°ú(¿Í) ¿¬°á ²÷
±â
network: ij½Ã Ç׸ñÀÌ ÀÖ½À´Ï´Ù. [url: http://10.30.1.81/jaxrpc.jar, ¹öÀü: null]
network: http://10.30.1.81/jaxrpc.jarÀ»(¸¦) proxy=DIRECT°ú(¿Í) ¿¬°á Áß
network: http://10.30.1.81/jaxrpc.jar ÀÀ´ä ÄÚµå: 304
network: http://10.30.1.81/jaxrpc.jar ÀÎÄÚµù: null
network: http://10.30.1.81/jaxrpc.jar°ú(¿Í) ¿¬°á ²÷±â
network: ij½Ã Ç׸ñÀÌ ÀÖ½À´Ï´Ù. [url: http://10.30.1.81/saaj.jar, ¹öÀü: null]
network: http://10.30.1.81/saaj.jarÀ»(¸¦) proxy=DIRECT°ú(¿Í) ¿¬°á Áß
network: http://10.30.1.81/saaj.jar ÀÀ´ä ÄÚµå: 304
network: http://10.30.1.81/saaj.jar ÀÎÄÚµù: null
network: http://10.30.1.81/saaj.jar°ú(¿Í) ¿¬°á ²÷±â
network: ij½Ã Ç׸ñÀÌ ÀÖ½À´Ï´Ù. [url: http://10.30.1.81/META-INF/services/org.xml.sax.driver,
¹öÀü: null]
network: http://10.30.1.81/META-INF/services/org.xml.sax.driverÀ»(¸¦)
proxy=DIRECT°ú(¿Í) ¿¬°á Áß
network: http://10.30.1.81/META-INF/services/org.xml.sax.driver ÀÀ´ä ÄÚµå:
200
network: http://10.30.1.81/META-INF/services/org.xml.sax.driver ÀÎÄÚµù:
null
network: http://10.30.1.81/META-INF/services/org.xml.sax.driver°ú(¿Í) ¿¬°á
²÷±â
network: http://10.30.1.81/META-INF/services/org.xml.sax.driverÀ»(¸¦)
proxy=DIRECT°ú(¿Í) ¿¬°á Áß
network: ÀÚ¿ø ´Ù¿î·Îµå: http://10.30.1.81/META-INF/services/org.xml.sax.driver
Content-Length: 3,763
Content-Encoding: null
network: ÆÄÀÏ C:\Users\crazytazo\AppData\LocalLow\Sun\Java\Deployment
\cache\6.0\17\587e4ad1-52380579-temp¿¡ URL http://10.30.1.81/META-INF/services/org.xml.sax.driver
¾²±â
network: ij½Ã Ç׸ñÀÌ ÀÖ½À´Ï´Ù. [url:
http://10.30.1.81/<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4/0 Transitional//EN">.class,
¹öÀü: null]
network: http://10.30.1.81/<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4/0 Transitional//EN">.classÀ»(¸¦)
proxy=DIRECT°ú(¿Í) ¿¬°á Áß
network: http://10.30.1.81/<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4/0 Transitional//EN">.class
ÀÀ´ä ÄÚµå: 200
network: http://10.30.1.81/<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4/0 Transitional//EN">.class
ÀÎÄÚµù: null
network: http://10.30.1.81/<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4/0 Transitional//EN">.class°ú(¿Í)
¿¬°á ²÷±â
network: http://10.30.1.81/<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4/0 Transitional//EN">.classÀ»(¸¦)
proxy=DIRECT°ú(¿Í) ¿¬°á Áß
network: ÀÚ¿ø ´Ù¿î·Îµå: http://10.30.1.81/<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4/0 Transitional//EN">.class
Content-Length: 3,763
Content-Encoding: null
network: ÆÄÀÏ C:\Users\crazytazo\AppData\LocalLow\Sun\Java\Deployment
\cache\6.0\40\16d02a8-4b6aecd1-temp¿¡ URL
http://10.30.1.81/<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4/0 Transitional//EN">.class
¾²±â
Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError:
IllegalName: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//
EN">
at java.lang.ClassLoader.preDefineClass(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.xml.sax.helpers.NewInstance.newInstance(Unknown Source)
at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown
Source)
at DownloadXMLParser.CreateDownloadTree(DownloadXMLParser.java:19)
at BizApplet.actionPerformed(BizApplet.java:64)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(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)


Java try find class through wrong response.

Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError:
IllegalName: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//
EN">

Why is this happen?
My applet was code signed correctly.
 
A

Andrew Thompson

I'm developing java applet.

You poor thing.
..but I have faced one problem.

Ha! Famous last words.

I expect you have actually faced your *first* applet problem,
more will come when you fix that one, then still more when
the applet reaches its end users. ;-)
My code running very well, on applet viewer.

Never trust applet viewer. On some versions of Java,
it does not even behave remotely the same as an applet
in a browser.
but my webserver didn't.

html code is follow.

<html>
<body>
applet test page.

<applet name = "myApplet" code="BizApplet" width=400 height=500
archive="Applet1.jar, swingx-0.9.3.jar,
org.apache.commons.logging_1.0.4.v20080605-1930.jar, axis.jar, commons-
discovery-0.2.jar, javax.wsdl_1.5.1.v200806030408.jar, jaxrpc.jar,
saaj.jar">
</applet>

<INPUT type="button" value="call Java Applet method"
onClick = "document.myApplet.test()"></INPUT>

</body>
</html>

The JS interaction should not work, as the applet element does not
declare the MAYSCRIPT flag. But I am going to bet you are using IE?
It is the only browser I know that will allow JS interaction short of
declaring the MAYSCRIPT attribute.
IllegalName: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//
EN">
at java.lang.ClassLoader.preDefineClass(Unknown Source) ....
Java try find class through wrong response.

By 'response', do you mean the applet is reading this information
from somewhere else? Where and how?
Why is this happen?

Not sure, but make sure all the HTML used is validated against a
DTD. Note that while your applet HTML seems logical to my eye, it
is not valid.
My applet was code signed correctly.

Many applets that are signed do not need to be signed. If the applet
does not need to be signed, it adds extra hassle to deploy, and will
not fix the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top