• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Trouble running Applet that uses the AS400JDBCDriver

Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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(ClassLoader.java:599)
at java.lang.ClassLoader.defineClass(ClassLoader.java:532)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:157)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:123)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at AS400QueryApplet.init(AS400QueryApplet.java:33)
at sun.applet.AppletPanel.run(AppletPanel.java:353)
at java.lang.Thread.run(Thread.java:534)
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 java.net.NetPermission "ppcdev", "resolve, connect";

A reference to this policy file has been added to my java.security 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 java.net.NetPermission entry nor does it grant access to a signer alias. Rather is has the follwing entry:
permission java.security.AllPermission;
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
You don't like waffles? Well, do you like this tiny ad?
Garden Master Course kickstarter
    Bookmark Topic Watch Topic
  • New Topic