• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Trouble running Applet that uses the AS400JDBCDriver

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
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>
</applet>
The sAS400QueryApplet.jar is a signed jar file the contains the following two files:
AS400QueryApplet.class
ResultSetTableModel.class
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
Chad
 
She'll be back. I'm just gonna wait here. With this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic