Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java applet served from tomcat container -- bad magic number (Now no DB access)



On Tuesday, July 29, 2003, at 08:44 PM, I wrote:

I recently began work on a project that is to extend a web application
that is deployed under tomcat (4.1.24). I am running tomcat locally on
my powerbook and this seems to be working -- the JSP pages and servlets
run as expected.

It also includes a Java 1.4 applet for some of its functionality.

I just got to testing the applet-based piece and this fails -- the
applet does not appear (tried Safari and Mozilla) and my system console
shows the log messages:

java.lang.ClassFormatError: com/gestalt/sgs/client/MapAsset (Bad magic
number)


I will follow up on this myself -- I got some helpful replies off-list (thanks!). And report a further problem

The immediate source of this issue was a <security-constraint> that had been specified in the web application's web.xml config file. The applet's file name was matched by the <web-resource-collection> pattern and for whatever reason, the applet could not be loaded when using Mozilla or Safari. The applet is not signed. But I could run the applet in spite of this pattern when accessing my tomcat container from IE on my Windows XP desktop (using Sun's latest Java plug-in: 1.4.1_04). By moving the applet to another location in my application tree under tomcat, the applet loads under browsers for both Windows and Mac (Safari and Mozilla).

BUT... it still does not work on the Mac (works from Windows/IE!). The applet needs to connect to a Postgresql data source that is also available on my Powerbook (usual Postgresql port). Apparently the Apple Java plug-in used by Mozilla and Safari (identified as 1.4.1_01 in the Java Console window in Safari) enforces yet another unexpected security constraint that requires authorization to use this data source. This constraint is either not in effect or not enforced by the Sun/Windows plugin since the applet gets the expected data just fine when run on IE 6. On the Mac I get an exception that indicates that the data does not get passed to the applet from the data source. If I by-pass the data retrieval and stuff some local data into the string that is supposed to be initialized from the data source, the applet does appear.

I saw some application property-setting examples in tomcat's catalina.policy file and I am going to experiment with defining some properties there in the hope that I can overcome this glitch.

It may be that the Java plug-in is just more picky on the Mac side compared to the Windows side. Any advice or tips about what would be the best strategy to maximize cross-platform compatibility are welcomed.

Jim
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.