3

Some users report a ClassNotFoundException error with our Java applet, but others are able to use the applet without issue.

We have observed that the problem seems correlated to the system's operating system.

The users who can successfully use the applet have newer computers whereas the ones who cannot are using Windows XP Home SP3. We verified the ability to directly download the applet by typing the applet URL into the browser. A firewall doesn't appear to be the issue.

We asked everyone to use Chrome to remove the browser as a variable.

Do we need to sign the applet in a different way or reference the applet differently within the HTML?

We know the applet tag is deprecated, but that doesn't explain why it's generating this error for some users and not others.

Another relevant detail: if you use the IP address directly, not the domain name, the applet loads fine.

Reproduce:

1) Visit http://www.cengraving.com/s/item?itemId=CH003

2) Tap Customize.

3) On XP machines, the page generates the ClassNotFoundException error saying that com.designapplet.ui.DesignApplet is not found. (We have also referenced com.designapplet.ui.DesignApplet.class but that also fails.)

4) If you try again the IP addr, the applet loads fine on those same XP machines: 67.212.167.170/s/item?itemId=CH003. We can load the applet directly from the browser with www.cengraving.com/SecureApplet.jar, so firewall rules don't appear to be an issue.

HTML:

<applet name="app" archive="/SecureApplet.jar" code="com.designapplet.ui.DesignApplet" width="770" height="800">
        <param name="itemId" value="CH003">
        <param name="layoutId" value="CH0031395363931437.lay">
        <param name="process" value="Engraving">
        <param name="qty" value="1">
        <param name="id" value="171">
        <param name="sessionId" value="3BF3610C74B4BB5CC5193E479CD1D930">
        (HTML)
</applet>
Crashalot
  • 33,605
  • 61
  • 269
  • 439
  • 1
    *"We know the `applet` tag is deprecated, but that doesn't explain why it's generating this error for some users and not others."* Maybe, maybe not. In either case, I recommend using the [Deployment Toolkit Script](http://docs.oracle.com/javase/tutorial/deployment/deploymentInDepth/depltoolkit_index.html). It will write the HTML element that browser is expecting. By the way, stick with `com.designapplet.ui.DesignApplet` for the `code` attribute. The other form is tolerated, rather than correct. – Andrew Thompson Mar 21 '14 at 04:01
  • @AndrewThompson somehow i suspected you would post something here. :) beyond this, have any clue on what's causing the issue? – Crashalot Mar 21 '14 at 05:18
  • *"have any clue on what's causing the issue?"* Sure. Maybe it is that the browser does not understand that HTML. To fix that, follow the advice I put in the first comment. **Tip** I'll devout no more time to this until you tell me I can visit the page that is now using the script. – Andrew Thompson Mar 21 '14 at 05:21
  • @AndrewThompson hahaha ok ok. Adding the script now ... – Crashalot Mar 21 '14 at 05:56
  • @AndrewThompson any ideas? we added the script but still not working. – Crashalot Mar 21 '14 at 20:11
  • Have you confirmed it is still failing on some machines? – Andrew Thompson Mar 22 '14 at 00:46
  • Yes, we have confirmed it still dies on the XP Home SP3 machines. So bizarre. – Crashalot Mar 22 '14 at 01:24
  • Hmm.. sorry, but changing to the script was my only idea on this one. I'd add this to the ever growing list (i.e. a bug report) of *"f_ckin' applet problems"*.. :( – Andrew Thompson Mar 22 '14 at 01:33
  • Are users using the same JVM version? Any chance of running this applet with [appletviewer](http://docs.oracle.com/javase/7/docs/technotes/tools/windows/appletviewer.html) and debug / take some memory dumps in affected machines? – Anthony Accioly Mar 27 '14 at 02:42
  • How many versions of Java do your guys support? *included into your testing phase?JDK JRE ..etc* – Mohammed Joraid Mar 27 '14 at 03:32
  • @AnthonyAccioly, we updated the question with more relevant details regarding the IP addr and domain name. – Crashalot Mar 27 '14 at 04:17
  • @joraid, we updated the question with more relevant troubleshooting details. – Crashalot Mar 27 '14 at 04:17
  • You haven't really answered any of my questions, so this is also my last input on the subject. Anyway, how about setting the full path to the archive using the IP address? – Anthony Accioly Mar 27 '14 at 14:47
  • Sorry for the delay, @AnthonyAccioly. That's exactly what we're testing right now. Will let you know if it works. – Crashalot Mar 27 '14 at 17:18
  • @AnthonyAccioly all users are using the newest JVM (7u51). – Crashalot Mar 27 '14 at 17:19
  • Could it be because the path to archive contains slash? archive="/SecureApplet.jar" I checked the documentation and the example given doesn't have slash: archive is the name of jar file containing the applet and its resources –  Apr 02 '14 at 18:32
  • @Mimi, we just tried that, but it unfortunately also fails. any other ideas? – Crashalot Apr 03 '14 at 01:08

2 Answers2

2

Could it be an inconsistency between the versions of Java on the different versions of Windows? These other places I've looked seem to have similar issues with the result being the wrong version of Java is being used. The error message itself seems to refer to a missing component.

http://developer.appcelerator.com/question/15151/windows-xp-and-classnotfoundexception-with-titanium-dev-121

http://discussions.blackboard.com/forums/t/43951.aspx

JamesH
  • 279
  • 2
  • 6
  • thanks, but it doesn't appear like an issue of different java versions as we're running the same java (the newest) on xp and non-xp machines. only the xp machines fail. – Crashalot Mar 27 '14 at 04:13
  • we also updated the question with more relevant information regarding the domain name, which reinforces the notion that it's not related to incompatible java versions. – Crashalot Mar 27 '14 at 04:14
  • Just want to make sure that the newest version of Java is the same version on both XP and non-XP machines. – JamesH Mar 27 '14 at 04:18
  • yes that's a good thought, but as you can see from the updated question, it doesn't appear to be a Java compatibility issue since the applet loads fine if we use the IP address instead of the domain name. – Crashalot Mar 27 '14 at 04:19
  • Then I'm confused. I'm tempted to say it's related to a same-origin policy since it works if you just use the ip address.. but then I have no idea why it would work on non-xp machines but not work on xp machines. See this question: http://stackoverflow.com/questions/19037659/can-i-violate-the-same-origin-policy-with-a-java-applet – JamesH Mar 27 '14 at 04:30
  • Join the club. :) Are you able to access the applet okay? What kind of machine are you using? – Crashalot Mar 27 '14 at 06:23
  • hi @jamesh, any other ideas? – Crashalot Apr 03 '14 at 01:22
  • I really want to say it has something to do with same-origin policy. I tested this on an XP machine today and had the same results as you, despite it working fine on my Windows 7 machine. Does it load resources from other domains than www.cengraving.com? Even if it's just a different subdomain or none at all. cengraving.com and www.cengraving.com are two different places according to same-origin policy. Might explain why it works when you use the IP address. Again, I have no clue why this would be the case under XP and not 7. – JamesH Apr 08 '14 at 19:21
0

In my opinion there is a problem with applet tag (missing attribute or a bit wrong value). Change way to publish your applet on the website, I will give you some example here.

You have to pay attention to values of some attributes like codebase or java_codebase - they have to contains full url to jar (without extension) - I had a lot of problems with publishing applet (different browsers and systems) and in my answer (link above) is essence of my hard work.

Community
  • 1
  • 1
Tomasz Dzięcielewski
  • 3,829
  • 4
  • 33
  • 47