Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7886765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:24:12+00:00 2026-06-03T05:24:12+00:00

I’m having the following method in an applet which is called via JavaScript public

  • 0

I’m having the following method in an applet which is called via JavaScript

public String getAString()
    {
        Object rc = AccessController.doPrivileged(
        new java.security.PrivilegedAction() 
        {
            public Object run()
            {
                try
                {
                    return "OK";
                }
                catch (Throwable t)
                {
                    t.printStackTrace();
                    return "ERROR: " + t.getMessage() + " " + t.getCause();
                }
            }
        });


        // Return value
        return rc.toString();
    }

The applet is signed using a certificate created with keytool

When I call getAString() if throws the InvocationTargetException.
If I call other methods which don’t use the AccessController class, I’m not having this problem.

Also, each time I open the browser I’m asked to allow the applet to run even the the applet is signed.

How can I fix this?

edit

I added a button and now I’m getting more info:

signer information does not match signer information of other classes
in the same package

I’m using a third party archive. In the original form is unsigned, but I signed it using the same cert (although with different commands).

edit 2
Here is how I sign the jars

keytool -genkey -keystore vkeystore -keyalg rsa -dname "CN=XXX, OU=XXX, O=XXX, L=Atlanta, ST=GA,C=NL" -alias printer -validity 3600 -keypass XXX-storepass XXX

jarsigner -keystore vkeystore -storepass XXX -keypass XXX -signedjar JSPrintS.jar JSPrint.jar printer

jarsigner -keystore vkeystore -storepass XXX -keypass XXX -signedjar jPDFPrintS.jar jPDFPrint.jar printer

JSPrint.jar contains the applet

edit 3

the applet definition is (located in JSPrint.jar)

package Eplatforms;

import java.net.URL;
import java.security.AccessController;

import javax.swing.JApplet;
import java.awt.event.*;
import java.awt.*;

import com.XXX.pdfPrint.PDFPrint;

public class JSPrint extends JApplet implements ActionListener
....

jPDFPrint.jar is a third party jar

EDIT 4

I tried to minimize the problem a bit and I found out that when calling AccessControler.doPrivileged from a jar file (even signed one), I get the following exception:

Exception in thread "main" java.lang.NoClassDefFoundError: TestPrivileges$1
        at TestPrivileges.getAString(TestPrivileges.java:14)
        at TestPrivileges.main(TestPrivileges.java:7)
Caused by: java.lang.ClassNotFoundException: TestPrivileges$1
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)

Here is a testing class:

http://pastebin.com/EgmdwuqL

Notice that calling other methods doesn’t raise this exception.

Here is how I compile and run it:

javac TestPrivileges.java
java TestPrivileges
jar cvf TestPrivileges.jar TestPrivileges.class
jarsigner -keystore vkeystore -storepass My0Company -keypass My0Company -signedjar TestPrivilegesS.jar TestPrivileges.jar printer
copy TestPrivilegesS.jar x /Y
copy TestPrivileges.jar x /Y
cd x
java -classpath TestPrivilegesS.jar TestPrivileges
java -classpath TestPrivileges.jar TestPrivileges
cd ..

A quick for vkeystore:

keytool -genkey -keystore vkeystore -keyalg rsa -dname "CN=MyCompany, OU=MyCompany, O=MyCompany, L=Atlanta, ST=GA,C=NL" -alias printer -validity 3600 -keypass My0Company -storepass My0Company

The first run works ok (probably because the class file is in the same directory).
Then I create to archives, one signed and another unsigned. When I run them, I got those errors. Notice the jars are in a separate folder which contains only those jars and no class file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:24:14+00:00Added an answer on June 3, 2026 at 5:24 am

    I am with Andrew on this.

    I’ve created an app that should help us find the code signing issue.

    https://gist.github.com/2596125

    (Since we don’t want to Spam Andrew I’ve created this.)

    With more information that finally came out it seems that you are not packing the TestPrivileges$1 class with the jar.

    To fix this do this for jar packing:

    jar cvf TestPrivileges.jar TestPrivileges.class TestPrivileges$1.class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
i got an object with contents of html markup in it, for example: string
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.