ExceptionInitializerError caused by java.security.AccessControlException

We are getting an Exception condition on Solaris 10 (08/07) that does not occur on Suse Linux Enterprise Server or a Red Hat Server. It occurs in both a servlet or a Session Bean from the Java Application Server 8.2 Platform Edition. We are using JavaPOS to access a receipt printer from a servlet or from a Session Bean. The error occurs when the printer driver attempts to open a port to a network printer. The exception at the top of the message stack in the Application Server log file is ExceptionInitializerError at jpos.BaseJposControl.open(Unkown Source) and later in the stack there is a message "Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)". We have the source code for JavaPOS and have begun to walk through it to discover the problem. However, this is the same *.ear file that is running on SLES and also Red Hat without the exception and has done so for several months. I got to ask what is the difference with Solaris 10. We have tried several different additions to the java.policy file in the jre/lib/security directory but it is basically the same file as used with SLES and Red Hat.
I have hammered on this problem for several hours and would appreciate any suggestions or more experienced insight into this problem.

One more point. The receipt printer can be accessed and used if the code is in a Desktop Application on the Solaris 10 system. The problem only occurs when the Application Server is involved.

Similar Messages

  • Java.security.AccessControlException: access denied (java.util.PropertyPerm

    Hi All,
    I try to run an applet from Solaris 8 server on some client machine using IE5 and NetScape 6.2 ( I installed JRE 1.4, I also try other JRE versions) but I get the following errors again and agian,
    I even try to use appletviewer on the Solaris Box itself to open the applet but it makes no difference same errors
    could somebody please help or give me a hint how should I start tracing what the problem might be ?
    this applet comes with Solaris Bandwidth Manager as a gui administration tool ( webbased ) it supposed to change the configurations remotly over the web. I asure there is no solaris permission problem exist.
    I use Tomcat on the server side.Installed JDK 1.3 on Solaris 8 with all the default settings.
    i suppose something should be done with java.policy or java.security files i know nothing about java security please at least give me some URL's to find out more about this matter i searched a lot but couldn't find good documents about java default security restrictions
    java.lang.ExceptionInInitializerError
    at com.sun.ba.common.QConfiguration.loadPredefServices(QConfiguration.java:617)
    at com.sun.ba.common.QConfiguration.getPredefServices(QConfiguration.java:630)
    at com.sun.ba.tool.MainPanel.<init>(MainPanel.java:95)
    at com.sun.ba.tool.QoSFrame.<init>(QoSFrame.java:48)
    at com.sun.ba.tool.baApplet.init(baApplet.java:46)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission console read)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
    at java.lang.System.getProperty(Unknown Source)
    at com.sun.ba.common.QDebug.<clinit>(QDebug.java:39)
    ... 7 more
    any help would be appriciated so much.
    thanks
    mehmad

    I dont know, but It may be that an Applet can only access the local machine. ie. If you run the applet on computer A and you want to edit the config on computer B, I do not believe you can. The applet can only talk to Computer A. You would have to:
    1) Run an application on computer A and the applet would tell the application what to change.
    2)Maybe sign the applet in a JAR File
    You will probably have to do #1.
    US101

  • Java.security.AccessControlException: access denied (java.util.PropertyPer

    Hi All,
    I try to run an applet from Solaris 8 server on some client machine using IE5 and NetScape 6.2 ( I installed JRE 1.4, I also try other JRE versions) but I get the following errors again and agian,
    I even try to use appletviewer on the Solaris Box itself to open the applet but it makes no difference same errors
    could somebody please help or give me a hint how should I start tracing what the problem might be ?
    this applet comes with Solaris Bandwidth Manager as a gui administration tool ( webbased ) it supposed to change the configurations remotly over the web. I asure there is no solaris permission problem exist.
    I use Tomcat on the server side.Installed JDK 1.3 on Solaris 8 with all the default settings.
    i suppose something should be done with java.policy or java.security files i know nothing about java security please at least give me some URL's to find out more about this matter i searched a lot but couldn't find good documents about java default security restrictions
    java.lang.ExceptionInInitializerError
         at com.sun.ba.common.QConfiguration.loadPredefServices(QConfiguration.java:617)
         at com.sun.ba.common.QConfiguration.getPredefServices(QConfiguration.java:630)
         at com.sun.ba.tool.MainPanel.<init>(MainPanel.java:95)
         at com.sun.ba.tool.QoSFrame.<init>(QoSFrame.java:48)
         at com.sun.ba.tool.baApplet.init(baApplet.java:46)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission console read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
         at java.lang.System.getProperty(Unknown Source)
         at com.sun.ba.common.QDebug.<clinit>(QDebug.java:39)
         ... 7 more
    any help would be appriciated so much.
    thanks
    mehmad

    Hi,
    Please make changes in the java.security files present in the jdk1.3/lib/jre/security/java.security.There you make the changes in the property which gives you the error.See if this helps..
    regards vickyk

  • Java.security.AccessControlException: access denied when loading from a jar

    Hello!
    I am trying to deploy an applet into a browser but I have encountered a security problem.
    The name of the applet is SWTInBrowser(not exactly mine, it's an example from the web).
    package my.applet;
    import org.eclipse.swt.awt.SWT_AWT;
    import java.applet.Applet;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.Canvas;
    import org.eclipse.swt.widgets.Shell;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.widgets.Listener;
    import org.eclipse.swt.widgets.Event;
    import org.eclipse.swt.graphics.Point;
    import org.eclipse.swt.layout.FillLayout;
    public class SWTInBrowser extends Applet implements Runnable{
         public void init () {
               /* Create Example AWT and Swing widgets */
               java.awt.Button awtButton = new java.awt.Button("AWT Button");
               add(awtButton);
               awtButton.addActionListener(new ActionListener () {
                public void actionPerformed (ActionEvent event) {
                 showStatus ("AWT Button Selected");
               javax.swing.JButton jButton = new javax.swing.JButton("Swing Button");
               add(jButton);
               jButton.addActionListener(new ActionListener () {
                public void actionPerformed (ActionEvent event) {
                 showStatus ("Swing Button Selected");
               Thread swtUIThread = new Thread (this);
               swtUIThread.start ();
              public void run() {
               /* Create an SWT Composite from an AWT canvas to be the parent of the SWT
              widgets.
                * The AWT Canvas will be layed out by the Applet layout manager.  The
              layout of the
                * SWT widgets is handled by the application (see below).
               Canvas awtParent = new Canvas();
               add(awtParent);
               Display display = new Display();
               Shell swtParent = SWT_AWT.new_Shell(display, awtParent);
    //           Display display = swtParent.getDisplay();
               swtParent.setLayout(new FillLayout());
               /* Create SWT widget */
               org.eclipse.swt.widgets.Button swtButton = new
              org.eclipse.swt.widgets.Button(swtParent, SWT.PUSH);
               swtButton.setText("SWT Button");
               swtButton.addListener(SWT.Selection, new Listener() {
                public void handleEvent(Event event){
                 showStatus("SWT Button selected.");
               swtButton.addListener(SWT.Dispose, new Listener() {
                public void handleEvent(Event event){
                 System.out.println("Button was disposed.");
               // Size AWT Panel so that it is big enough to hold the SWT widgets
               Point size = swtParent.computeSize (SWT.DEFAULT, SWT.DEFAULT);
               awtParent.setSize(size.x + 2, size.y + 2);
               // Need to invoke the AWT layout manager or AWT and Swing
               // widgets will not be visible
               validate();
               // The SWT widget(s) require an event loop
               while (!swtParent.isDisposed()) {
                if (!display.readAndDispatch()) display.sleep ();
    }It works perfectly in the Applet Viewer, but not in the browser. In the browser, I only get two buttons working, the SWT button doesn't appear, because of this error:
    Exception in thread "Thread-21" java.lang.ExceptionInInitializerError
         at org.eclipse.swt.widgets.Display.<clinit>(Display.java:130)
         at my.applet.SWTInBrowser.run(SWTInBrowser.java:52)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission sun.arch.data.model read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
         at java.lang.System.getProperty(Unknown Source)
         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:167)
         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:151)
         at org.eclipse.swt.internal.C.<clinit>(C.java:21)
         ... 3 moreI have exported the application in a jar, and in that jar I have put the swt.jar that the application need for the displaying of the third button, swt button.
    Here is also the HTML file:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=Cp1252"/>
        <title>
          Test
        </title>
      </head>
      <body>
        <p>
              <applet code="my.applet.SWTInBrowser"
                        archive="Test.jar"
                        width="1400" height="800">
              </applet>
        </p>
      </body>
    </html>Could anyone please help me solve this problem?

    This is in reply to the first post. I don't know what happened after.
    Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission sun.arch.data.model read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
         at java.lang.System.getProperty(Unknown Source)
         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:167)
         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:151)
         at org.eclipse.swt.internal.C.<clinit>(C.java:21)
    If you read the above trace from bottom to top, it shows none of you classes, only classes from that Eclipse library, which seems to loadLibrary() a native DLL. In order to do this, it needs to call System.getProperty( "sun.arch.data.model" ). This call is not allowed from un unsigned applet. So I guess you need to sign the applet and this problem will go away. Many other problems may follow. Just read very very carefully all the related documentation, which I did not.

  • HTTP tunneling T3 when using WebStart - java.security.AccessControlException: access denied

    Hi !
    WLS version: 5.1 with SP10
    Server OS: NT4
    Client distr.: Java WebStart
    Client OS: Windows 2000
    I get the following exception when I try to create a T3 connection
    (tunnelled through HTTP) to my WLS server:
    java.security.AccessControlException: access denied
    (java.util.PropertyPermission proxyHost read)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
    at java.lang.System.getProperty(Unknown Source)
    at weblogic.net.http.HttpClient.resetProperties(HttpClient.java:62)
    at weblogic.net.http.HttpClient.openServer(HttpClient.java:186)
    at weblogic.net.http.HttpClient.<init>(HttpClient.java:85)
    at weblogic.net.http.HttpClient.New(HttpClient.java:117)
    at weblogic.net.http.HttpURLConnection.connect(HttpURLConnection.java:97)
    at
    weblogic.net.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1
    44)
    at weblogic.socket.JVMSocketHTTPClient.sendMsg(JVMSocketHTTPClient.java:260)
    at weblogic.socket.JVMAbbrevSocket.sendOutMsg(JVMAbbrevSocket.java:348)
    at weblogic.socket.JVMAbbrevSocket.sendMsg(JVMAbbrevSocket.java:237)
    at weblogic.rjvm.ConnectionManager.sendMsg(ConnectionManager.java:420)
    at weblogic.rjvm.RJVMImpl.send(RJVMImpl.java:564)
    at
    weblogic.rjvm.MsgAbbrevOutputStream.flushAndSendRaw(MsgAbbrevOutputStream.ja
    va:155)
    at
    weblogic.rjvm.MsgAbbrevOutputStream.flushAndSend(MsgAbbrevOutputStream.java:
    163)
    at
    weblogic.rjvm.MsgAbbrevOutputStream.sendRecv(MsgAbbrevOutputStream.java:186)
    at
    weblogic.rmi.internal.BasicOutgoingRequest.sendRecv(BasicOutgoingRequest.jav
    a:23)
    at
    weblogic.rmi.extensions.AbstractRequest.sendReceive(AbstractRequest.java:73)
    at
    com.unitor.message.server.UserInformationServiceBeanHomeImpl_WLStub.create(U
    serInformationServiceBeanHomeImpl_WLStub.java:151)
    at
    com.unitor.message.server.UserInformationServiceBeanHomeImpl_ServiceStub.cre
    ate(UserInformationServiceBeanHomeImpl_ServiceStub.java:121)
    at
    com.unitor.message.beans.gui.MessageLogic.getUserInformationService(MessageL
    ogic.java:230)
    at
    com.unitor.message.beans.gui.MessageLogic.addUserInformation(MessageLogic.ja
    va:186)
    at com.unitor.message.beans.gui.MessageLogic.<init>(MessageLogic.java:104)
    at
    com.unitor.message.beans.gui.MessageApplication.internalStartApplication(Mes
    sageApplication.java:64)
    at
    com.unitor.ifs.util.gui.UnitorApplication.startApplication(UnitorApplication
    .java:167)
    at
    com.unitor.ifs.util.gui.DesktopApplication$ApplicationLoader.run(DesktopAppl
    ication.java:676)
    at
    com.unitor.ifs.util.gui.DesktopApplication.startApplication(DesktopApplicati
    on.java:303)
    at
    com.unitor.ifs.util.gui.UnitorDesktopAppStarter$SwingEventCall.run(UnitorDes
    ktopAppStarter.java:294)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    The strange thing is that I can connect to my server if I run the client on
    NT4 !!!
    I solved the problem by modifying my local java.policy file with the
    following settings:
    // Test with HTTP tunnelling. 18.10.2001
    [email protected]
    permission java.util.PropertyPermission "proxyHost", "read";
    permission java.util.PropertyPermission "proxyPort", "read";
    permission java.util.PropertyPermission "http.proxyHost", "read";
    permission java.util.PropertyPermission "http.proxyPort", "read";
    permission java.net.SocketPermission "*","connect,resolve";
    // Test with HTTP tunnelling. 18.10.2001
    [email protected]
    Have someone else experienced the same or similar problems ?
    How can I make sure that the client gets access to read the properties
    http.proxyHost, http.proxyPort, proxyHost and proxyPort without telling the
    users of the client application to modify their java.policy files ?
    Any leads will be greatly appreciated !
    Regards
    Sten Richard

    This is in reply to the first post. I don't know what happened after.
    Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission sun.arch.data.model read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
         at java.lang.System.getProperty(Unknown Source)
         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:167)
         at org.eclipse.swt.internal.Library.loadLibrary(Library.java:151)
         at org.eclipse.swt.internal.C.<clinit>(C.java:21)
    If you read the above trace from bottom to top, it shows none of you classes, only classes from that Eclipse library, which seems to loadLibrary() a native DLL. In order to do this, it needs to call System.getProperty( "sun.arch.data.model" ). This call is not allowed from un unsigned applet. So I guess you need to sign the applet and this problem will go away. Many other problems may follow. Just read very very carefully all the related documentation, which I did not.

  • Java.security.AccessControlException: access denied (java.lang.RuntimePerm

    Hi, I am receiving the following error when I attempt to add a crypto provider.
    java.lang.ExceptionInInitializerError
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.security.jca.ProviderConfig$3.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.security.jca.ProviderConfig.doLoadProvider(Unknown Source)
         at sun.security.jca.ProviderConfig.getProvider(Unknown Source)
         at sun.security.jca.ProviderList.loadAll(Unknown Source)
         at sun.security.jca.ProviderList.removeInvalid(Unknown Source)
         at sun.security.jca.Providers.getFullProviderList(Unknown Source)
         at java.security.Security.removeProvider(Unknown Source)
         at com.gro.applet.GROAuthenticateApplet$2.run(GROAuthenticateApplet.java:192)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.gro.applet.GROAuthenticateApplet.validateUser(GROAuthenticateApplet.java:181)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.javascript.JSInvoke.invoke(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
         at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
    Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.sunmscapi)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkLink(Unknown Source)
         at java.lang.Runtime.loadLibrary0(Unknown Source)
         at java.lang.System.loadLibrary(Unknown Source)
         at sun.security.mscapi.SunMSCAPI$1.run(SunMSCAPI.java:34)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.security.mscapi.SunMSCAPI.<clinit>(SunMSCAPI.java:32)
         ... 32 more
    java.lang.Exception: java.lang.ExceptionInInitializerError
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)I read somewhere that it is "Due to an additional dll that needs to be loaded for the Sun Java SE 6 JVM we get an exception during initialization"
    Does anyone have any other information on this bug?

    I have just bumped into this with a Webstart application.
    It seems to happen only on certain machines.
    Is there a solution to this problem?

  • Java.security.AccessControlException: access denied ( CredentialAccessPermi

    Hello,
    I am using JDev 11g TP4 for WCS (web center). I just created an application using WebCenter template and added a new page with only Output text. I tried to run it, I got the following error:
    SEVERE: Server start failed processing configuration
    java.security.AccessControlException: access denied ( CredentialAccessPermission credstoressp.credstore.default.systemuser read)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
    at java.security.AccessController.checkPermission(AccessController.java:427)
    at oracle.security.jps.util.JpsAuth$AuthorizationMechanism$3.checkPermission(JpsAuth.java:256)
    at oracle.security.jps.util.JpsAuth$Diagnostic.checkPermission(JpsAuth.java:180)
    at oracle.security.jps.util.JpsAuth$AuthorizationMechanism$6.checkPermission(JpsAuth.java:280)
    at oracle.security.jps.util.JpsAuth.checkPermission(JpsAuth.java:315)
    at oracle.security.jps.util.JpsAuth.checkPermission(JpsAuth.java:338)
    at oracle.security.jps.internal.credstore.util.CsfUtil.checkPermission(CsfUtil.java:527)
    at oracle.security.jps.internal.credstore.ssp.SspCredentialStore.getCredential(SspCredentialStore.java:420)
    at oracle.security.jps.fmw.util.JpsFmwUtil.makeJpsSystemUser(JpsFmwUtil.java:221)
    at oracle.security.jps.fmw.JpsUserManager.initSystemUser(JpsUserManager.java:270)
    at oracle.security.jps.fmw.JpsUserManager.init(JpsUserManager.java:238)
    at oracle.security.jps.fmw.JpsUserManager.<init>(JpsUserManager.java:250)
    at oracle.security.jps.fmw.JpsUserManagerFactory$JpsUserManagerFactoryI.create(JpsUserManagerFactory.java:257)
    at com.evermind.server.deployment.UserManagerConfig$JAZN.construct(UserManagerConfig.java:635)
    at com.evermind.server.deployment.UserManagerConfig.delegatee(UserManagerConfig.java:253)
    at com.evermind.security.IndirectUserManager.getAdminUser(IndirectUserManager.java:126)
    at com.evermind.security.IndirectUserManager.getAdminUser(IndirectUserManager.java:126)
    at com.evermind.server.XMLApplicationServerConfig.setPassword(XMLApplicationServerConfig.java:3170)
    at com.evermind.server.XMLApplicationServerConfig.<init>(XMLApplicationServerConfig.java:246)
    at com.evermind.server.ApplicationServer.createConfig(ApplicationServer.java:661)
    at oracle.oc4j.server.ServerFactory$Worker.prepareConfig(ApplicationServerFactory.java:225)
    at oracle.oc4j.server.ServerFactory$Worker.start(ApplicationServerFactory.java:244)
    at oracle.oc4j.server.ServerFactory$Worker.run(ApplicationServerFactory.java:259)
    at java.lang.Thread.run(Thread.java:595)
    Jun 2, 2008 2:35:36 PM oracle.oc4j.util.SystemLog logNoStack
    SEVERE: Server exiting: ApplicationServer entered state FAILED_IN_CONFIG
    Anybody has experienced this before? Workaround?
    Thanks.

    I think I figured this out. Since I installed the TP4, I used this for developing other apps without WC enabled. I noticed that when I started JDev for the first time, it creates the embedded server (?) in a directory you specified in JDEV_USER_DIR env var automatically. When I changed my TP4 to use WC, the required libraries, etc. were not copied or built for WC. I think this caused the problem I had. By closing JDev and deleting the created embedded server and restarting JDev, it solved my problem.
    For TP4, the server directory looks like:
    system11.1.1.0.22.49.49
    I hope this will be useful for others that experience the same problem that I had.

  • Applet Error:java.security.AccessControlException: access denied

    Hi,
    I just successful deploy an business component project to oralce 8.1.6 as an EJB Session bean, and
    the test of application module is successful. In the same workspace, I create an new project with
    an applet(which contains only an grid control)as a client of the business component. Everything works
    fine within the Applet viewer, however, when I trying to load the applet in IE5.5 I got the following
    error message in java console:
    Java(TM) Plug-in
    Using JRE version 1.2.1
    User home directory = D:\Documents and Settings\ERic
    Proxy Configuration: no proxy
    JAR cache enabled.
    Failed to query environment: 'access denied (java.util.PropertyPermission jbo.debugoutput read)'
    Diagnostics: Silencing all diagnostic output (use -Djbo.debugoutput=console to see it)
    Failed to query environment: 'access denied (java.util.PropertyPermission jbo.logging.show.timing read)'
    Failed to query environment: 'access denied (java.util.PropertyPermission jbo.logging.show.function read)'
    Failed to query environment: 'access denied (java.util.PropertyPermission jbo.logging.show.level read)'
    Failed to query environment: 'access denied (java.util.PropertyPermission jbo.logging.show.linecount read)'
    Failed to query environment: 'access denied (java.util.PropertyPermission jbo.logging.trace.threshold read)'
    Failed to query environment: 'access denied (java.util.PropertyPermission jbo.jdbc.driver.verbose read)'
    java.lang.ExceptionInInitializerError: java.security.AccessControlException: access denied (java.util.PropertyPermission org.omg.CORBA.ORBClass read)
    at java.security.AccessControlContext.checkPermission(Compiled Code)
    at oracle.aurora.jndi.orb_dep.Orb.<clinit>(Orb.java:24)
    at oracle.aurora.jndi.sess_iiop.sess_iiopURLContext.<clinit>(sess_iiopURLContext.java:9)
    at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:588)
    at javax.naming.spi.NamingManager.getURLContext(NamingManager.java:537)
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:274)
    at javax.naming.InitialContext.lookup(InitialContext.java:349)
    at oracle.jbo.client.remote.ejb.aurora.AuroraEJBAmHomeImpl.connectToService(AuroraEJBAmHomeImpl.java:179)
    at oracle.jbo.client.remote.ejb.aurora.AuroraEJBAmHomeImpl.createSession(AuroraEJBAmHomeImpl.java:152)
    at oracle.jbo.client.remote.ejb.aurora.AuroraEJBAmHomeImpl.initRemoteHome(AuroraEJBAmHomeImpl.java:123)
    at oracle.jbo.client.remote.ejb.aurora.AuroraEJBAmHomeImpl.<init>(AuroraEJBAmHomeImpl.java:59)
    at oracle.jbo.client.remote.ejb.aurora.AuroraEJBInitialContext.createJboHome(AuroraEJBInitialContext.java:47)
    at oracle.jbo.common.JboInitialContext.lookup(JboInitialContext.java:72)
    at javax.naming.InitialContext.lookup(InitialContext.java:349)
    at oracle.dacf.dataset.SessionInfo._createAppModule(SessionInfo.java:2330)
    at oracle.dacf.dataset.SessionInfo.connect(SessionInfo.java:1799)
    at oracle.dacf.dataset.SessionInfo.openProducerObject(SessionInfo.java:1848)
    at oracle.dacf.dataset.ProducerObject.open(ProducerObject.java:94)
    at oracle.dacf.dataset.SessionInfo.publishSession(SessionInfo.java:1305)
    at oracle.dacf.dataset.SessionInfo.publishSession(SessionInfo.java:1287)
    at broadcastapplet.myBroadCastApplet.init(myBroadCastApplet.java:70)
    at sun.applet.AppletPanel.run(Compiled Code)
    at java.lang.Thread.run(Thread.java:479)
    The Oracle 8.1.6 runs on Win2000, I put the JAR & related zip files in the same machine's IIS webserver.
    Is anyone can help?
    ERic

    Hi Shaji,
    Are you calling a webservice from within an Xacute Query for your applet?  On first glance, it looks like a web service call is being rejected due to security permissions.  If you have a webservice call (or HTTP post/get), can you test it separately with the same credentials as the webpage is using?
    Regards,
    Mike

  • How can i deal with java.security.AccessControlException?

    Hi all, I need to implement JavaMail using Servlet and deploy throught J2EE deployment tool. But when i test out the servlet i will always encounter this exception thrown. How can i solve this?
    java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)
    This is the servlet i am testing. Please advise. Thanks in advance!
    * @(#)JavaMailServlet.java     1.3 99/12/06
    * Copyright 1998, 1999 Sun Microsystems, Inc. All Rights Reserved.
    * This software is the proprietary information of Sun Microsystems, Inc.
    * Use is subject to license terms.
    import java.io.*;
    import java.util.*;
    import java.text.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    * This is a servlet that demonstrates the use of JavaMail APIs
    * in a 3-tier application. It allows the user to login to an
    * IMAP store, list all the messages in the INBOX folder, view
    * selected messages, compose and send a message, and logout.
    * <p>
    * Please note: This is NOT an example of how to write servlets!
    * This is simply to show that JavaMail can be used in a servlet.
    * <p>
    * For more information on this servlet, see the
    * JavaMailServlet.README.txt file.
    * <p>
    * For more information on servlets, see
    * * http://java.sun.com/products/java-server/servlets/index.html
    * @author Max Spivak
    public class JavaMailServlet extends HttpServlet implements SingleThreadModel {
    String protocol = "POP3";
    String mbox = "INBOX";
    * This method handles the "POST" submission from two forms: the
    * login form and the message compose form. The login form has the
    * following parameters: <code>hostname</code>, <code>username</code>,
    * and <code>password</code>. The <code>send</code> parameter denotes
    * that the method is processing the compose form submission.
    public void doPost(HttpServletRequest req, HttpServletResponse res)
         throws ServletException, IOException {
    // get the session
         HttpSession ssn = req.getSession(true);
         String send = req.getParameter("send");
    String host = req.getParameter("hostname");
    String user = req.getParameter("username");
    String passwd = req.getParameter("password");
    URLName url = new URLName(protocol, host, -1, mbox, user, passwd);
    ServletOutputStream out = res.getOutputStream();
         res.setContentType("text/html");
         out.println("<html><body bgcolor=\"#CCCCFF\">");
         if (send != null) {
         // process message sending
         send(req, res, out, ssn);
         } else {
         // initial login
         // create
         MailUserData mud = new MailUserData(url);
         ssn.putValue("javamailservlet", mud);
         try {
              Properties props = System.getProperties();
              System.out.println("url");
              props.put("mail.smtp.host", host);
              Session session = Session.getDefaultInstance(props, null);
              session.setDebug(false);
              Store store = session.getStore(url);
              store.connect();
              Folder folder = store.getDefaultFolder();
              if (folder == null)
              throw new MessagingException("No default folder");
              folder = folder.getFolder(mbox);
              if (folder == null)
              throw new MessagingException("Invalid folder");
              folder.open(Folder.READ_WRITE);
              int totalMessages = folder.getMessageCount();
              Message[] msgs = folder.getMessages();
              FetchProfile fp = new FetchProfile();
              fp.add(FetchProfile.Item.ENVELOPE);
              folder.fetch(msgs, fp);
              // track who logged in
              System.out.println("Login from: " + store.getURLName());
              // save stuff into MUD
              mud.setSession(session);
              mud.setStore(store);
              mud.setFolder(folder);
              // splash
              out.print("<center>");
              out.print("<font face=\"Arial,Helvetica\" font size=+3>");
              out.println("<b>Welcome to JavaMail!</b></font></center><p>");
              // folder table
              out.println("<table width=\"50%\" border=0 align=center>");
              // folder name column header
              out.print("<tr><td width=\"75%\" bgcolor=\"#ffffcc\">");
              out.print("<font face=\"Arial,Helvetica\" font size=-1>");
              out.println("<b>FolderName</b></font></td><br>");
              // msg count column header
              out.print("<td width=\"25%\" bgcolor=\"#ffffcc\">");
              out.print("<font face=\"Arial,Helvetica\" font size=-1>");
              out.println("<b>Messages</b></font></td><br>");
              out.println("</tr>");
              // folder name
              out.print("<tr><td width=\"75%\" bgcolor=\"#ffffff\">");
              out.print("<a href=\"" + HttpUtils.getRequestURL(req) + "\">" +
                   "Inbox" + "</a></td><br>");
              // msg count
              out.println("<td width=\"25%\" bgcolor=\"#ffffff\">" +
                   totalMessages + "</td>");
              out.println("</tr>");
              out.println("</table");
         } catch (Exception ex) {
              out.println(ex.toString());
         } finally {
              out.println("</body></html>");
              out.close();
    * This method handles the GET requests for the client.
    public void doGet (HttpServletRequest req, HttpServletResponse res)
         throws ServletException, IOException {
    HttpSession ses = req.getSession(false); // before we write to out
    ServletOutputStream out = res.getOutputStream();
         MailUserData mud = getMUD(ses);
         if (mud == null) {
         res.setContentType("text/html");
         out.println("<html><body>Please Login (no session)</body></html>");
         out.close();
         return;
         if (!mud.getStore().isConnected()) {
         res.setContentType("text/html");
         out.println("<html><body>Not Connected To Store</body></html>");
         out.close();
         return;
         // mux that takes a GET request, based on parameters figures
         // out what it should do, and routes it to the
         // appropriate method
         // get url parameters
         String msgStr = req.getParameter("message");
    String logout = req.getParameter("logout");
         String compose = req.getParameter("compose");
         String part = req.getParameter("part");
         int msgNum = -1;
         int partNum = -1;
         // process url params
         if (msgStr != null) {
         // operate on message "msgStr"
         msgNum = Integer.parseInt(msgStr);
         if (part == null) {
              // display message "msgStr"
    res.setContentType("text/html");
              displayMessage(mud, req, out, msgNum);
         } else if (part != null) {
              // display part "part" in message "msgStr"
              partNum = Integer.parseInt(part);
    displayPart(mud, msgNum, partNum, out, res);
         } else if (compose != null) {
         // display compose form
         compose(mud, res, out);
    } else if (logout != null) {
         // process logout
    try {
    mud.getFolder().close(false);
    mud.getStore().close();
              ses.invalidate();
    out.println("<html><body>Logged out OK</body></html>");
    } catch (MessagingException mex) {
    out.println(mex.toString());
         } else {
         // display headers
         displayHeaders(mud, req, out);
    /* main method to display messages */
    private void displayMessage(MailUserData mud, HttpServletRequest req,
                        ServletOutputStream out, int msgNum)
         throws IOException {
         out.println("<html>");
    out.println("<HEAD><TITLE>JavaMail Servlet</TITLE></HEAD>");
         out.println("<BODY bgcolor=\"#ccccff\">");
         out.print("<center><font face=\"Arial,Helvetica\" ");
         out.println("font size=\"+3\"><b>");
         out.println("Message " + (msgNum+1) + " in folder " +
              mud.getStore().getURLName() +
              "/INBOX</b></font></center><p>");
         try {
         Message msg = mud.getFolder().getMessage(msgNum);
         // first, display this message's headers
         displayMessageHeaders(mud, msg, out);
         // and now, handle the content
         Object o = msg.getContent();
         //if (o instanceof String) {
         if (msg.isMimeType("text/plain")) {
              out.println("<pre>");
              out.println((String)o);
              out.println("</pre>");
         //} else if (o instanceof Multipart){
         } else if (msg.isMimeType("multipart/*")) {
              Multipart mp = (Multipart)o;
              int cnt = mp.getCount();
              for (int i = 0; i < cnt; i++) {
              displayPart(mud, msgNum, mp.getBodyPart(i), i, req, out);
         } else {
              out.println(msg.getContentType());
         } catch (MessagingException mex) {
         out.println(mex.toString());
         out.println("</BODY></html>");
         out.close();
    * This method displays a message part. <code>text/plain</code>
    * content parts are displayed inline. For all other parts,
    * a URL is generated and displayed; clicking on the URL
    * brings up the part in a separate page.
    private void displayPart(MailUserData mud, int msgNum, Part part,
                   int partNum, HttpServletRequest req,
                   ServletOutputStream out)
         throws IOException {
         if (partNum != 0)
         out.println("<p><hr>");
    try {
         String sct = part.getContentType();
         if (sct == null) {
              out.println("invalid part");
              return;
         ContentType ct = new ContentType(sct);
         if (partNum != 0)
              out.println("<b>Attachment Type:</b> " +
                   ct.getBaseType() + "<br>");
         if (ct.match("text/plain")) {
              // display text/plain inline
              out.println("<pre>");
              out.println((String)part.getContent());
              out.println("</pre>");
         } else {
              // generate a url for this part
              String s;
              if ((s = part.getFileName()) != null)
              out.println("<b>Filename:</b> " + s + "<br>");
              s = null;
              if ((s = part.getDescription()) != null)
              out.println("<b>Description:</b> " + s + "<br>");
              out.println("<a href=\"" +
                   HttpUtils.getRequestURL(req) +
                   "?message=" +
                   msgNum + "&part=" +
                   partNum + "\">Display Attachment</a>");
         } catch (MessagingException mex) {
         out.println(mex.toString());
    * This method gets the stream from for a given msg part and
    * pushes it out to the browser with the correct content type.
    * Used to display attachments and relies on the browser's
    * content handling capabilities.
    private void displayPart(MailUserData mud, int msgNum,
                   int partNum, ServletOutputStream out,
                   HttpServletResponse res)
         throws IOException {
         Part part = null;
    try {
         Message msg = mud.getFolder().getMessage(msgNum);
         Multipart mp = (Multipart)msg.getContent();
         part = mp.getBodyPart(partNum);
         String sct = part.getContentType();
         if (sct == null) {
              out.println("invalid part");
              return;
         ContentType ct = new ContentType(sct);
         res.setContentType(ct.getBaseType());
         InputStream is = part.getInputStream();
         int i;
         while ((i = is.read()) != -1)
              out.write(i);
         out.flush();
         out.close();
         } catch (MessagingException mex) {
         out.println(mex.toString());
    * This is a utility message that pretty-prints the message
    * headers for message that is being displayed.
    private void displayMessageHeaders(MailUserData mud, Message msg,
                        ServletOutputStream out)
         throws IOException {
         try {
         out.println("<b>Date:</b> " + msg.getSentDate() + "<br>");
    Address[] fr = msg.getFrom();
    if (fr != null) {
    boolean tf = true;
    out.print("<b>From:</b> ");
    for (int i = 0; i < fr.length; i++) {
    out.print(((tf) ? " " : ", ") + getDisplayAddress(fr));
    tf = false;
    out.println("<br>");
    Address[] to = msg.getRecipients(Message.RecipientType.TO);
    if (to != null) {
    boolean tf = true;
    out.print("<b>To:</b> ");
    for (int i = 0; i < to.length; i++) {
    out.print(((tf) ? " " : ", ") + getDisplayAddress(to[i]));
    tf = false;
    out.println("<br>");
    Address[] cc = msg.getRecipients(Message.RecipientType.CC);
    if (cc != null) {
    boolean cf = true;
    out.print("<b>CC:</b> ");
    for (int i = 0; i < cc.length; i++) {
    out.print(((cf) ? " " : ", ") + getDisplayAddress(cc[i]));
              cf = false;
    out.println("<br>");
         out.print("<b>Subject:</b> " +
              ((msg.getSubject() !=null) ? msg.getSubject() : "") +
              "<br>");
    } catch (MessagingException mex) {
         out.println(msg.toString());
    * This method displays the URL's for the available commands and the
    * INBOX headerlist
    private void displayHeaders(MailUserData mud,
                        HttpServletRequest req,
    ServletOutputStream out)
         throws IOException {
    SimpleDateFormat df = new SimpleDateFormat("EE M/d/yy");
    out.println("<html>");
    out.println("<HEAD><TITLE>JavaMail Servlet</TITLE></HEAD>");
         out.println("<BODY bgcolor=\"#ccccff\"><hr>");
         out.print("<center><font face=\"Arial,Helvetica\" font size=\"+3\">");
         out.println("<b>Folder " + mud.getStore().getURLName() +
              "/INBOX</b></font></center><p>");
         // URL's for the commands that are available
         out.println("<font face=\"Arial,Helvetica\" font size=\"+3\"><b>");
    out.println("<a href=\"" +
              HttpUtils.getRequestURL(req) +
              "?logout=true\">Logout</a>");
    out.println("<a href=\"" +
              HttpUtils.getRequestURL(req) +
              "?compose=true\" target=\"compose\">Compose</a>");
         out.println("</b></font>");
         out.println("<hr>");
         // List headers in a table
    out.print("<table cellpadding=1 cellspacing=1 "); // table
         out.println("width=\"100%\" border=1>"); // settings
         // sender column header
         out.println("<tr><td width=\"25%\" bgcolor=\"ffffcc\">");
         out.println("<font face=\"Arial,Helvetica\" font size=\"+1\">");
         out.println("<b>Sender</b></font></td>");
         // date column header
         out.println("<td width=\"15%\" bgcolor=\"ffffcc\">");
         out.println("<font face=\"Arial,Helvetica\" font size=\"+1\">");
         out.println("<b>Date</b></font></td>");
         // subject column header
         out.println("<td bgcolor=\"ffffcc\">");
         out.println("<font face=\"Arial,Helvetica\" font size=\"+1\">");
         out.println("<b>Subject</b></font></td></tr>");
         try {
         Folder f = mud.getFolder();
         int msgCount = f.getMessageCount();
         Message m = null;
         // for each message, show its headers
         for (int i = 1; i <= msgCount; i++) {
    m = f.getMessage(i);
              // if message has the DELETED flag set, don't display it
              if (m.isSet(Flags.Flag.DELETED))
              continue;
              // from
    out.println("<tr valigh=middle>");
    out.print("<td width=\"25%\" bgcolor=\"ffffff\">");
              out.println("<font face=\"Arial,Helvetica\">" +
                   ((m.getFrom() != null) ?
                   m.getFrom()[0].toString() :
                   "" ) +
                   "</font></td>");
              // date
    out.print("<td nowrap width=\"15%\" bgcolor=\"ffffff\">");
              out.println("<font face=\"Arial,Helvetica\">" +
    df.format((m.getSentDate()!=null) ?
                        m.getSentDate() : m.getReceivedDate()) +
                   "</font></td>");
              // subject & link
    out.print("<td bgcolor=\"ffffff\">");
              out.println("<font face=\"Arial,Helvetica\">" +
              "<a href=\"" +
                   HttpUtils.getRequestURL(req) +
    "?message=" +
    i + "\">" +
    ((m.getSubject() != null) ?
                   m.getSubject() :
                   "<i>No Subject</i>") +
    "</a>" +
    "</font></td>");
    out.println("</tr>");
         } catch (MessagingException mex) {
         out.println("<tr><td>" + mex.toString() + "</td></tr>");
         mex.printStackTrace();
         out.println("</table>");
         out.println("</BODY></html>");
         out.flush();
         out.close();
    * This method handles the request when the user hits the
    * <i>Compose</i> link. It send the compose form to the browser.
    private void compose(MailUserData mud, HttpServletResponse res,
                   ServletOutputStream out)
         throws IOException {
         res.setContentType("text/html");
         out.println(composeForm);
         out.close();
    * This method processes the send request from the compose form
    private void send(HttpServletRequest req, HttpServletResponse res,
              ServletOutputStream out, HttpSession ssn)
         throws IOException {
    String to = req.getParameter("to");
         String cc = req.getParameter("cc");
         String subj = req.getParameter("subject");
         String text = req.getParameter("text");
         try {
         MailUserData mud = getMUD(ssn);
         if (mud == null)
              throw new Exception("trying to send, but not logged in");
         Message msg = new MimeMessage(mud.getSession());
         InternetAddress[] toAddrs = null, ccAddrs = null;
         if (to != null) {
              toAddrs = InternetAddress.parse(to, false);
              msg.setRecipients(Message.RecipientType.TO, toAddrs);
         } else
              throw new MessagingException("No \"To\" address specified");
         if (cc != null) {
              ccAddrs = InternetAddress.parse(cc, false);
              msg.setRecipients(Message.RecipientType.CC, ccAddrs);
         if (subj != null)
              msg.setSubject(subj);
         URLName u = mud.getURLName();
         msg.setFrom(new InternetAddress(u.getUsername() + "@" +
                             u.getHost()));
         if (text != null)
              msg.setText(text);
         Transport.send(msg);
         out.println("<h1>Message sent successfully</h1></body></html>");
         out.close();
         } catch (Exception mex) {
         out.println("<h1>Error sending message.</h1>");
         out.println(mex.toString());
         out.println("<br></body></html>");
    // utility method; returns a string suitable for msg header display
    private String getDisplayAddress(Address a) {
    String pers = null;
    String addr = null;
    if (a instanceof InternetAddress &&
    ((pers = ((InternetAddress)a).getPersonal()) != null)) {
         addr = pers + " "+"<"+((InternetAddress)a).getAddress()+">";
    } else
    addr = a.toString();
    return addr;
    // utility method; retrieve the MailUserData
    // from the HttpSession and return it
    private MailUserData getMUD(HttpSession ses) throws IOException {
         MailUserData mud = null;
         if (ses == null) {
         return null;
         } else {
         if ((mud = (MailUserData)ses.getValue("javamailservlet")) == null){
              return null;
         return mud;
    public String getServletInfo() {
    return "A mail reader servlet";
    * This is the HTML code for the compose form. Another option would
    * have been to use a separate html page.
    private static String composeForm = "<HTML><HEAD><TITLE>JavaMail Compose</TITLE></HEAD><BODY BGCOLOR=\"#CCCCFF\"><FORM ACTION=\"/servlet/JavaMailServlet\" METHOD=\"POST\"><input type=\"hidden\" name=\"send\" value=\"send\"><P ALIGN=\"CENTER\"><B><FONT SIZE=\"4\" FACE=\"Verdana, Arial, Helvetica\">JavaMail Compose Message</FONT></B><P><TABLE BORDER=\"0\" WIDTH=\"100%\"><TR><TD WIDTH=\"16%\" HEIGHT=\"22\">     <P ALIGN=\"RIGHT\"><B><FONT FACE=\"Verdana, Arial, Helvetica\">To:</FONT></B></TD><TD WIDTH=\"84%\" HEIGHT=\"22\"><INPUT TYPE=\"TEXT\" NAME=\"to\" SIZE=\"30\"> <FONT SIZE=\"1\" FACE=\"Verdana, Arial, Helvetica\"> (separate addresses with commas)</FONT></TD></TR><TR><TD WIDTH=\"16%\"><P ALIGN=\"RIGHT\"><B><FONT FACE=\"Verdana, Arial, Helvetica\">CC:</FONT></B></TD><TD WIDTH=\"84%\"><INPUT TYPE=\"TEXT\" NAME=\"cc\" SIZE=\"30\"> <FONT SIZE=\"1\" FACE=\"Verdana, Arial, Helvetica\"> (separate addresses with commas)</FONT></TD></TR><TR><TD WIDTH=\"16%\"><P ALIGN=\"RIGHT\"><B><FONT FACE=\"Verdana, Arial, Helvetica\">Subject:</FONT></B></TD><TD WIDTH=\"84%\"><INPUT TYPE=\"TEXT\" NAME=\"subject\" SIZE=\"55\"></TD></TR><TR><TD WIDTH=\"16%\"> </TD><TD WIDTH=\"84%\"><TEXTAREA NAME=\"text\" ROWS=\"15\" COLS=\"53\"></TEXTAREA></TD></TR><TR><TD WIDTH=\"16%\" HEIGHT=\"32\"> </TD><TD WIDTH=\"84%\" HEIGHT=\"32\"><INPUT TYPE=\"SUBMIT\" NAME=\"Send\" VALUE=\"Send\"><INPUT TYPE=\"RESET\" NAME=\"Reset\" VALUE=\"Reset\"></TD></TR></TABLE></FORM></BODY></HTML>";
    * This class is used to store session data for each user's session. It
    * is stored in the HttpSession.
    class MailUserData {
    URLName url;
    Session session;
    Store store;
    Folder folder;
    public MailUserData(URLName urlname) {
         url = urlname;
    public URLName getURLName() {
         return url;
    public Session getSession() {
         return session;
    public void setSession(Session s) {
         session = s;
    public Store getStore() {
         return store;
    public void setStore(Store s) {
         store = s;
    public Folder getFolder() {
         return folder;
    public void setFolder(Folder f) {
         folder = f;

    You posted a thousand lines of badly-formatted code and didn't have the sense to say which one had the exception.
    My guess is that it was this one:Session session = Session.getDefaultInstance(props, null);because that happened to me. I fixed it by calling getInstance instead of getDefaultInstance.
    However if that isn't the problem, how about spending a few seconds to post a less useless question?

  • Java.security.AccessControlException when calling web service from applet

    I have an applet that calls a webservce (Xmethods' delayed stock quote service). When I run the applet in appletviewer, I get the following:
    [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket: java.security.AccessControlException: access denied (java.net.SocketPermission 66.28.98.121:9090 connect,resolve); targetException=java.lang.IllegalArgumentException:
    Error opening socket: java.security.AccessControlException:
    access denied
    etc.....
    My code works fine as an application, but not as an applet. (This was after I eventually had to extract the necessary SOAP .jar files into the same directory as my applet, but that's another topic...or maybe not?)
    Help!
    Regards,
    John Kirksey                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    The default security settings does not give an applet to connect to any other server apart from the one from which it was downloaded. This is your problem. To mitigate that you have to change the security setting of the applet conatiner i.e the JVM in the browser.
    Ironluca

  • Java.lang.Exception:java.security.accesscontrolException:access denied

    good afternoon to all experts
    i am getting the following exception when i am going to read file
    java.lang.Exception:java.security.accesscontrolException:accessdenied(java.io.FilePermission c:\premiji.rar)
    my applet as follows
    import java.io.*;
    import java.applet.*;
    import java.awt.*;
    import java.security.*;
    import javax.crypto.Cipher;
    import javax.crypto.KeyGenerator;
    import javax.crypto.SecretKey;
    import javax.crypto.spec.*;
    import java.io.IOException;
    public class TestApp extends Applet
         public static TextField t;
         public static String key;
        public Label l;
    public  void init()
       setBackground(Color.GRAY);
       setLayout(null);
       t=new TextField("  ");
       t.setEchoChar('*');
       l=new Label("Enter ur key");
       l.setBounds(0,2,75,20);
       t.setForeground(Color.RED);
       t.setBounds(78,2,150,20);
    add(l);
       add(t);
    public static String eFile(String plainFile)throws Exception
    {String cFile="c://suri.rar";
         key=t.getText();
        byte[]raw=key.getBytes("UTF8");
        SecretKeySpec skeySpec = new SecretKeySpec(raw, "Blowfish");
        Cipher cipher = Cipher.getInstance("Blowfish");
        Cipher cipher2=Cipher.getInstance("Blowfish");
        cipher2.init(Cipher.DECRYPT_MODE,skeySpec);
        cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
        InputStream fis,dis;
        FileOutputStream fos,dos;
        fis = new FileInputStream("c://premji.rar");
        fis = new javax.crypto.CipherInputStream(fis, cipher);
        fos = new FileOutputStream(cFile);
        byte[] b = new byte[8];
        int i = fis.read(b);
        while (i != -1) {
            fos.write(b, 0, i);
            i = fis.read(b);
    dis = new FileInputStream(cFile);
    dis = new javax.crypto.CipherInputStream(dis, cipher2);
    dos=new FileOutputStream("c://madhu.rar");
    byte[] c=new byte[8];
    int j=dis.read(c);
    while(j!=-1)
         dos.write(c,0,j);
         j=dis.read(c);
       fis.close() ;
       fos.close();
       return cFile;
    }my html as follows
    html>
    <script language="JavaScript">
      function pass()
        document.myForm.uname.value=document.myApp.eFile(document.myForm.upfile.value);
    </script>
    <applet name="myApp" code="TestApp.class" archive="TestApp.jar" width=600 height=80></applet>
    <body>
    <form name="myForm" >
    Name
    <input type="text" name="uname"/>
    File
    <input type="file" name="upfile"/>
    <input type=button value="click" onClick="pass();">
    <input type="submit"/>
    </form>
    </body>
    </html>note:
    i signed my applet like
    keytool -genkey -alias sgsits -validity 365
    jarsigner TestApp.jar sgsitshave we to modify polacy file also?
    if so how & which one modify
    any suggestion would be greatly appreciated
    thanks in advance

    I assume your signature is correct.
    Signing the applet enables privileges (like file IO) whenever all the calls on the stack leading
    to the sensitive operation (in your case fis = new FileInputStream("c://premji.rar")) originate
    from the signed jar. It is not your case, as you come into the applet from javascript.
    The solution is to use AccessController.doPrivileged...(). It was designed with this situation in mind.

  • Java.security.AccessControlException in a RMI application

    Hello,
    I have the following error, while I'm launching my RMI application :
    access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
    java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
    at java.security.AccessController.checkPermission(AccessController.java:399)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
    at java.lang.SecurityManager.checkConnect(SecurityManager.java:1044)
    at java.net.Socket.<init>(Socket.java:262)
    I was trying the following instruction :
    if (System.getSecurityManager() == null)
    System.setSecurityManager(new RMISecurityManager());
    try{
    Recepteur obj = new Recepteur();
    Naming.rebind("//localhost/Recepteur", obj);
    However, I have written in the java.policy file :
    grant codeBase "http://127.0.0.1:1099/-" {
         permission java.security.AllPermission;
    Does anyone know how to solve this problem ?
    Thx

    Help him please or he would be obliged to give me the dukes...

  • Signed applet not working in firefox - java.security.AccessControlException

    Hello,
    I have a signed applet that works fine in IE 7 but in Firefox I'm getting this exception in the java console:
    java.security.AccessControlException: access denied (java.net.SocketPermission myhost.com resolve)
    I already tried to run the applet with different JRE versions in Firefox with the same result: 1.6.0_01, 1.6.0_02, 1.6.0_03, 1.6.0_05
    I'll appreciate your help.

    thanx 4 replying
    using the browser to view Applet is not recomended that is because if u change the the source-code and recompile the applet then run it using the broswer it will run the old-version
    Also i've found the solution here
    http://www.cs.utah.edu/classes/cs1021/notes/lecture03/eclipse_help.html

  • Java.security.AccessControlException while trying to run the server app

    ok, pretty new with java and rmi, so I wanted to run the application from the sun rmi tutorial
    http://java.sun.com/docs/books/tutorial/rmi/TOC.html.
    It all builds ok, i run the rmiregistry ,but when i try to run the server i get :
    java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
         at java.security.AccessController.checkPermission(AccessController.java:546)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)
         at java.net.Socket.connect(Socket.java:513)
         at java.net.Socket.connect(Socket.java:469)
         at java.net.Socket.<init>(Socket.java:366)
         at java.net.Socket.<init>(Socket.java:180)
         at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
         at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
         at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
         at engine.ComputeEngine.main(ComputeEngine.java:30)
    what i noticed is that this output is similar to not running rmiregistry at all, so i guess the problem is with the way i'm running rmiregistry
    thx in advance

    You're running the server with a SecurityManager. There's no need to do that at first. Get rid of it. When you have it working, write yourself a .policy file that grants that permission, and any others you discover it needs, and name that as your security policy file, e.g.
    java -Djava.security.policy=my.policy -Djava.security.manager mypackage.MyServer ...

  • Can't fix a java.security.AccessControlException exception

    Hi.
    I have a webapp running under j2ee with a ContextListener that performs some initialization tasks.
    One of these tasks consists in querying a database and putting the results in a xml file according to an existing xml file that acts as a map for it maps the rows and columns of the result set to elements and attributes in the xml doc (this task is really performed by an EJB that the ContextListener instantiates).
    To do this, at some point the EJB tries to instantiate a new org.w3c.dom.Document object pointing to the xml map file witch, like I said, will be used to 'massaje' the data in the query into a xml format.
    Here's the revelant portion of the code:
    mapDoc = docbuilder.parse(mapfilepath);
    When the EJB tries to do this, the following exception is thrown:
    java.security.AccessControlException: access denied (java.io.FilePermission c:\j2sdkee1.3.1\public_html\iFAQs\xml\temas-map.xml read)
    I've checked the server.policy file and it seems ok, it has a grant section that makes me believe I should have read and write access to all files under public_html:
    grant codeBase "file:${com.sun.enterprise.home}/public_html/-" {
    permission java.lang.RuntimePermission "loadLibrary.*";
    permission java.lang.RuntimePermission "accessClassInPackage.*";
    permission java.lang.RuntimePermission "createClassLoader";
    permission java.lang.RuntimePermission "queuePrintJob";
    permission java.lang.RuntimePermission "modifyThreadGroup";
    permission java.io.FilePermission "<<ALL FILES>>", "read,write";
    Any help will be much appreciated!
    Thanks!
    Best regards,
    Piponline, Portugal

    hi piponline,
    thanx for the question details u have specified, part of ur details are used to solve my problem. i have just copied the permissions statements for servlets to j2ee server section in server.pliciy file
    bye
    kireet

Maybe you are looking for