my dog learned polymorphism
The moose likes Applets and the fly likes Trouble running Applet that uses the AS400JDBCDriver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Trouble running Applet that uses the AS400JDBCDriver" Watch "Trouble running Applet that uses the AS400JDBCDriver" New topic

Trouble running Applet that uses the AS400JDBCDriver

Chad Schmidt

Joined: Nov 04, 2003
Posts: 16
I am really having a difficult time getting an applet that uses the AS400JDBCDriver class to run in Internet Explorer 6 SP1.
I have the code that creates the database connection class object in the init() method of my applet class wrapped in the following code in order run the applet our of the sandbox.
NOTE: I�m not sure I need to do this but this was the only way to make the AccessController errors disappear from the stack trace.
This code compiles and does not generate errors of any kind.
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
// My code here � it works
return null;
My problem seems to be with the signed jar files I create and reference in my applet�s APPLET tag ARCHIVE attribute. I have the jt400.jar file copied to my working directory. When I create a policy file that grants all access and use this policy file to run the applet in appletviewer, my reference to this local jt400.jar works fine. I assuming there are no socket security issues when running an applet locally in appletviewer.
When I attempt to run this applet in IE6 SP1 I get the following stack trace:
java.lang.SecurityException: class "AS400QueryApplet$1"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(
at java.lang.ClassLoader.defineClass(
at sun.applet.AppletClassLoader.findClass(
at java.lang.ClassLoader.loadClass(
at sun.applet.AppletClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(
at AS400QueryApplet.init(
Here�s my applet code:
<applet code="AS400QueryApplet.class"
archive="sAS400QueryApplet.jar, jt400.jar"
width=500 height=300>
The sAS400QueryApplet.jar is a signed jar file the contains the following two files:
Here�s what my policy file reads:
keystore "file:/C:/Temp/JavaTestStuff/userstore";
grant signedBy "chad" {
permission "ppcdev", "resolve, connect";

A reference to this policy file has been added to my file located in my �C:\j2sdk1.4.2_02\jre\lib\security� directory.
NOTE: ppcdev is the AS400 host I am attempting to connect to.
The policy file that I use to connect when using appletviewer does not have this entry nor does it grant access to a signer alias. Rather is has the follwing entry:
Does anyone have experience with this type of applet???
Any help on this would be greatly appreciated since this is my first attempt to create and run an applet that actually does anything useful.
Thanks much

Chad Schmidt<br />ctschmidt
Have you tried LearnNowOnline?
subject: Trouble running Applet that uses the AS400JDBCDriver