Java.util.PropertyPermission...not granted to ProtectionDomain(Stored Proc)

I'm trying to develop a java stored procedure on Oracle 10.1.2 that makes use of many other libraries, (Axis, WSIF, custom libs), and I'm stuck on this permissions error. I've loaded all of the libs into the same schema under the same user, (with JAVA_ADMIN), and several other privileges. I loaded the files using the following command, "loadjava -verbose -debug -recursivejars -genmissing -resolve -time -fileout loadJava.log -user {userID}/{pwd}@{SID} someJar.jar". The error occurs when a call to WSIFProperties.getProperty attempts to access the org.apache.wsif.mapper or org.apache.wsif.mappingconvention properties.
In a normal java2 environment, I'd simply edit the java.policy file to provide permissions to the codebase (file:/C:/spi4j2.5.4_J2ee1.4/coreLib/fsgWsif1.1.jar). Since Oracle doesn't have ProtectionDomains, if I add read permissions for those properties using the following command, "call dbms_java.grant_permission( 'SCHEMANAME', 'SYS:java.util.PropertyPermission', 'org.apache.wsif.mapper', 'read' )", it seems as if all of the other classes in the schema should be able to read the property, right? It appears the logfile dump below is showing the permissions that the classloader recognizes. Where did he get those? If they came from the DBA_JAVA_POLICY view, then why can't it pick up on the fact that I've granted read permission to the property it's trying to read? When I tried loading the classes without using the -recursivejars option, I got all kinds of ClassDefNotFound errors and couldn't even start the program, (I guess because it'd loaded the other jars as resources instead of unpacking the classes, the resolver couldn't look into the jars and locate the classes that it needed). The program works just fine outside of the database, (even without me adding read permissions for the codebase to access the properties in the java.policy file). Any help would be greatly appreciated. Thanks in advance.
Error shown below:
[2008-03-20 18:23:18.144] [DEBUG] [Root Thread] [org.apache.wsif.*][org.apache.wsif.logging.Trc] [traceIt] [Trc.java:1308] EVENT WSIFMapperFactory.newMapper Caught and handled throwable: java.security.AccessControlException: the Permission (java.util.PropertyPermission org.apache.wsif.mapper read) has not been granted to ProtectionDomain (file:/C:/spi4j2.5.4_J2ee1.4/coreLib/fsgWsif1.1.jar <no certificates>)
com.fds.classloader.ParentLastUrlClassLoader@e87f10c1
<no principals>
java.security.Permissions@c5dd7492 (
(java.io.FilePermission \C:\spi4j2.5.4_J2ee1.4\coreLib\fsgWsif1.1.jar read)
(java.net.SocketPermission localhost:1024- listen,resolve)
(java.util.PropertyPermission java.version read)
(java.util.PropertyPermission java.vm.name read)
(java.util.PropertyPermission java.vm.vendor read)
(java.util.PropertyPermission os.name read)
(java.util.PropertyPermission java.vendor.url read)
(java.util.PropertyPermission java.vm.specification.vendor read)
(java.util.PropertyPermission java.specification.vendor read)
(java.util.PropertyPermission os.version read)
(java.util.PropertyPermission java.specification.name read)
(java.util.PropertyPermission java.class.version read)
(java.util.PropertyPermission file.separator read)
(java.util.PropertyPermission java.vm.version read)
(java.util.PropertyPermission os.arch read)
(java.util.PropertyPermission java.vm.specification.name read)
(java.util.PropertyPermission java.vm.specification.version read)
(java.util.PropertyPermission java.specification.version read)
(java.util.PropertyPermission java.vendor read)
(java.util.PropertyPermission path.separator read)
(java.util.PropertyPermission line.separator read)
)

hi rzander,
I am in a situation similar to your :
{color:#ff0000}Caused by: java.security.AccessControlException: the Permission (java.io.FilePermission /home/neogeo/Java_Resources.jrxml read) has not been granted to ProtectionDomain (file:/home/neogeo/lib/jasperreports-3.0.0.jar &lt;no signer certificates&gt;)
AppClassLoader: file:/home/neogeo/lib/xml-apis.jar file:/home/neogeo/lib/jpa.jar file:/home/neogeo/lib/jdt-compiler-3.1.1.jar file:/home/neogeo/lib/png-encoder-1.5.jar file:/home/neogeo/lib/ant-1.5.1.jar file:/home/neogeo/lib/jaxen-1.1.1.jar file:/home/neogeo/lib/mondrian-2.3.2.8944.jar file:/home/neogeo/lib/commons-javaflow-20060411.jar file:/home/neogeo/lib/batik-bridge.jar file:/home/neogeo/lib/antlr-2.7.5.jar file:/home/neogeo/lib/batik-parser.jar file:/home/neogeo/lib/hibernate3.jar file:/home/neogeo/lib/batik-ext.jar file:/home/neogeo/lib/commons-logging-1.0.2.jar file:/home/neogeo/lib/jasperreports-3.0.0.jar file:/home/neogeo/lib/batik-svggen.jar file:/home/neogeo/lib/batik-xml.jar file:/home/neogeo/lib/xml-apis-ext.jar file:/home/neogeo/lib/batik-dom.jar file:/home/neogeo/lib/jakarta-bcel-20050813.jar file:/home/neogeo/lib/servlet.jar file:/home/neogeo/lib/hsqldb-1.7.1.jar file:/home/neogeo/lib/batik-gvt.jar file:/home/neogeo/lib/batik-svg-dom.jar file:/home/neogeo/lib/jxl-2.6.jar file:/home/neogeo/lib/groovy-all-1.5.5.jar file:/home/neogeo/lib/xercesImpl.jar file:/home/neogeo/lib/batik-awt-util.jar file:/home/neogeo/lib/bsh-2.0b4.jar file:/home/neogeo/lib/commons-digester-1.7.jar file:/home/neogeo/lib/batik-css.jar file:/home/neogeo/lib/commons-logging-api-1.0.2.jar file:/home/neogeo/lib/jfreechart-1.0.0.jar file:/home/neogeo/lib/itext-1.3.1.jar file:/home/neogeo/lib/poi-3.0.1-FINAL-20070705.jar file:/home/neogeo/lib/batik-util.jar file:/home/neogeo/lib/commons-beanutils-1.7.jar file:/home/neogeo/lib/jcommon-1.0.0.jar file:/home/neogeo/lib/saaj-api-1.3.jar file:/home/neogeo/lib/batik-script.jar file:/home/neogeo/lib/xalan.jar file:/home/neogeo/lib/batik-anim.jar file:/home/neogeo/lib/commons-collections-2.1.jar
&lt;no principals&gt;
java.security.Permissions@1aebb385 (
(java.io.FilePermission /home/neogeo/lib/jasperreports-3.0.0.jar read)
(java.util.PropertyPermission user.language write)
(java.util.PropertyPermission * read)
(java.lang.RuntimePermission modifyThreadGroup)
(java.lang.RuntimePermission createSecurityManager)
(java.lang.RuntimePermission modifyThread)
(java.lang.RuntimePermission preferences)
(java.lang.RuntimePermission exitVM)
(oracle.aurora.security.JServerPermission LoadClassInPackage.*)
{color}
{color:#ff0000}
at java.security.AccessControlContext.checkPermission(AccessControlContext.java)
at java.security.AccessController.checkPermission(AccessController.java)
at java.lang.SecurityManager.checkPermission(SecurityManager.java)
at oracle.aurora.rdbms.SecurityManagerImpl.checkPermission(SecurityManagerImpl.java)
at java.lang.SecurityManager.checkRead(SecurityManager.java)
at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:167)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:150)
... 9 more{color}
I followed your help creating the file  "ORACLE_HOME/javavm/lib/security / java.policy", but I still get the same exception.
Please, can you post the contents of your java.policy to understand how  you set the permissions ?
Edited by: NeOGeO on 11-nov-2008 6.43

Similar Messages

  • (java.util.PropertyPermission * read,write) has not been granted

    I've been getting the following error:
    java.security.AccessControlException:
    the Permission (java.util.PropertyPermission * read,write)
    has not been granted by dbms_java.grant_permission to
    SchemaProtectionDomain(ROVER|PolicyTableProxy(ROVER))
    So to fix it I did the flowing as system:
    SQL> EXEC DBMS_JAVA.GRANT_PERMISSION('ROVER','SYS:java.util.PropertyPermission', '*', 'read,write');
    PL/SQL procedure successfully completed.
    SQL> COMMIT;
    Commit complete.
    But their is no change.
    What am I missing?
    I'm using 8.1.6 on linux.

    I'm also in this situation:
    I got this error:
    [1]: (Error): ORA-29532: Java call terminated by uncaught Java exception:
    java.security.AccessControlException: the Permission
    (java.net.SocketPermission mailhost resolve) has not been granted by
    dbms_java.grant_permission to
    SchemaProtectionDomain(TOLKIEN|PolicyTableProxy(TOLKIEN)) ORA-06512: at line
    14
    I believe I must use the dbms_java.grant_permission procedure to grant the
    procedure to resolve hostname. But I don't know how to use this procedure.
    I tried with
    'dbms_java.grant_permission(SchemaOfMyJavaClass,'java.net.SocketPermission',
    'mailhost','resolve',intRet);'
    and a record is been appended to dba_java_policy, but Oracle complaines again.
    Someone can help us?
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Oracle Support():
    Can you see the permission in dba_java_policy table?
    <HR></BLOCKQUOTE>
    null

  • Java.lang.ExceptionInInitializerError: java.security.AccessControlException: access denied (java.util.PropertyPermission weblogic.kernel.allowQueueThrottling read)

    We are in the process of migrating from Weblogic 6.1 SP2 to SP5. We have an applet
    that
    subscribes to a JMS Topic. The applet is throwing the following exception with
    SP5:
    java.lang.ExceptionInInitializerError: java.security.AccessControlException: access
    denied
    (java.util.PropertyPermission weblogic.kernel.allowQueueThrottling 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.kernel.Kernel.initAllowThrottleProp(Kernel.java:79)
    at weblogic.kernel.Kernel.<clinit>(Kernel.java:54)
    at weblogic.jndi.WLInitialContextFactoryDelegate.<init>(WLInitialContextFactoryDelegate.java:166)
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Unknown Source)
    at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:147)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at com.fedex.efm.frontend.model.JMSMessageProcessor.<init>(JMSMessageProcessor.java:266)
    at com.fedex.efm.frontend.view.EFMAbstractApplet.startMessageProcessor(EFMAbstractApplet.java:81)
    at com.fedex.efm.frontend.view.EFMAbstractApplet.start(EFMAbstractApplet.java:187)
    at com.fedex.efm.frontend.view.EFMApplet.start(EFMApplet.java:430)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Any ideas as to what I am missing?
    Thanks,
    Ram

    Prasad,
    It's one thing not to have to modify the security policy on the server,
    but on a client and applets have even bigger restrictions this might
    very well be the only way since the default applet restrictions would
    not allow a lot of permissions granted by default for normal Java
    applications.
    Dejan
    Prasad Peddada wrote:
    Deyan D. Bektchiev wrote:
    Ram,
    You are missing a permission grant in your policy file and the
    SecurityManager doesn't allow the code to read that property.
    You have either configured a different security manager or have the
    wrong file in use.
    For applets this file might be in the user's home directory and named
    .java.policy
    you need to have the following line somethere in it:
    grant {
    permission java.util.PropertyPermission "*", "read,write";
    Which will allow any applet to read and write any JVM property.
    Look at Java permissions is you need more info:
    http://java.sun.com/j2se/1.3/docs/guide/security/permissions.html
    --dejan
    Ram Gopal wrote:
    We are in the process of migrating from Weblogic 6.1 SP2 to SP5. We
    have an applet
    that
    subscribes to a JMS Topic. The applet is throwing the following
    exception with
    SP5:
    java.lang.ExceptionInInitializerError:
    java.security.AccessControlException: access
    denied
    (java.util.PropertyPermission weblogic.kernel.allowQueueThrottling
    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.kernel.Kernel.initAllowThrottleProp(Kernel.java:79) at
    weblogic.kernel.Kernel.<clinit>(Kernel.java:54) at
    weblogic.jndi.WLInitialContextFactoryDelegate.<init>(WLInitialContextFactoryDelegate.java:166)
    at java.lang.Class.newInstance0(Native Method) at
    java.lang.Class.newInstance(Unknown Source) at
    weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:147)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) at
    javax.naming.InitialContext.init(Unknown Source) at
    javax.naming.InitialContext.<init>(Unknown Source) at
    com.fedex.efm.frontend.model.JMSMessageProcessor.<init>(JMSMessageProcessor.java:266)
    at
    com.fedex.efm.frontend.view.EFMAbstractApplet.startMessageProcessor(EFMAbstractApplet.java:81)
    at
    com.fedex.efm.frontend.view.EFMAbstractApplet.start(EFMAbstractApplet.java:187)
    at com.fedex.efm.frontend.view.EFMApplet.start(EFMApplet.java:430)
    at sun.applet.AppletPanel.run(Unknown Source) at
    java.lang.Thread.run(Unknown Source)
    Any ideas as to what I am missing?
    Thanks,
    Ram
    This is a WLS bug. You shouldn't have to modify security policy.
    Please approach support for a fix.
    Cheers,
    -- Prasad

  • Java.util.PropertyPermission * read,write

    on tryieng to call my function i am getting this error .
    the Permission (java.util.PropertyPermission * read,write)
    has not been granted by dbms_java.grant_permission to
    SchemaProtectionDomain(JAVA|PolicyTableProxy(JAVA))
    what should i do to remove this error.
    null

    i got it running by executing
    DBMS_JAVA.GRANT_PERMISSION('JAVA','SYS:java.util.PropertyPermission', '*', 'read,write')
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Sherry:
    on tryieng to call my function i am getting this error .
    the Permission (java.util.PropertyPermission * read,write)
    has not been granted by dbms_java.grant_permission to
    SchemaProtectionDomain(JAVA|PolicyTableProxy(JAVA))
    what should i do to remove this error.
    <HR></BLOCKQUOTE>
    null

  • Java.util.PropertyPermission problem

    Hello All.
    I get the following exception from code in my bean (accessed by a JSP page).
    java.security.AccessControlException: access denied (java.util.PropertyPermission com.test.util.ClassOne.PropertiesFilename write)
    The line of code responsible:
    System.setProperty(com.test.util.ClassOne.PropertiesFilename, "myfile.txt");
    I have set the following permission for the app in the server.policy file:
    permission java.util.PropertyPermission "*", "read,write";
    And it still doesnt work.
    Any deas?
    Thanks
    Sawan

    You are probably not setting the permission for the correct code base.
    I think you have two options.
    (1) Grant the property permission to all code with a statement like
    grant {
      permission java.util.PropertyPermission "*", "read,write";
    };in the server.policy file
    (2) Find the specific policy file for your java bean which is not the same as server.policy. Easiest way is to search directories where your EJB is deployed for files that match something like "*olicy*". When you find that file, add the same permission entry as above to it. Even though you grant globally it will only affect your specific bean (at least, that is how it works for the J2EE server).
    Good luck.

  • Access denied ("java.util.PropertyPermission" "user.timezone" "write") [WINDOWS 7 64bit]

    Hello,
    we got on several computers the error message
    access denied (java.util.PropertyPermission" "user.timezone" "write")
    when we try to open an internal website. Until today everything worked fine.
    An update on Java for windows 7 64, Version 7 Update 45 didnt solve the problem.
    I tried to set the Java security permissions in the control panel to middle but it also didnt work after this change.
    We also got this problem on another computer when we try to open an external site which also use Java.
    Did anyone have an idea how to fix this problem?

    Hi Guys.
    I solved the problem adding a rule in the following file
    $JAVA_HOME\lib\security\java.policy
    grant {
        permission java.util.PropertyPermission "user.timezone", "write";
    After I killed the java process and restarted. The problem dissapeared

  • Access denied (java.util.PropertyPermission oracle.jserver.version read)

    friendz...
    Plz let me know about the above exception...
    When i want to use oracle xml utilities from Aglets which is nothing like applet, i m getting exception like
    access denied (java.util.PropertyPermission oracle.jserver.version read)
    Thanks in Advance

    Hi
    If you are trying to access a local resource from an applet, then is not possible due to security reasons.
    Regards,
    Prasanth.C

  • Permission check failed: java.util.PropertyPermission

    Hello guys,
    I am working on JME8 for Raspberry Pi and I am facing a problem with java.util.PropertyPermission.
    I have added permission java.util.PropertyPermission "*:*" "read,write"; in appdb/_policy.txt but it does not seem to solve the problem.
    Here is a log capture when I run it.
    [19:20:55.144] INFO - VM - [SECURITY] iso=1:Blacklist Client: initialized
    [19:20:55.144] INFO - VM - [SECURITY] iso=1:Authentication Provider: com.oracle.meep.security.DefaultAuthenticationProvider
    [19:20:55.144] INFO - VM - [SECURITY] iso=1:Policy: com.oracle.meep.security.DefaultSecurityPolicy
    [19:20:55.145] INFO - VM - [SECURITY] iso=1:Using policy file: /home/pi/jme8ea2/bin/../appdb/_policy.txt
    [19:20:55.281] INFO - VM - [SECURITY] iso=1:Application assigned to the client "untrusted"
    [19:20:56.056] FATAL - VM - [SECURITY] iso=3:Permission check failed: java.util.PropertyPermission "fileconn.dir.private" "read"
    Any ideas is much appreciated.
    Thanks in advance.
    CheeSeng

    Hello Petr,
    Initially I added java.util.PropertyPermission into "ProjectProperties->Application Descriptor->API Permissions" in NetBeans 8.0 but did not specify "Protected Resource Name" and "Actions Requested".
    After seeing the JAD containing this, MIDlet-Permission-Opt-1: java.util.PropertyPermission "" "",
    I added fileconn.dir.private into "Protected Resource Name" and read into "Actions Requested" and it works!!
    Thank you very much for your hints that made me look into the JAD.
    Regards,
    CheeSeng

  • "java.util.PropertyPermission user.language write" in my javafx application

    Hello Everybody.
    I developed javafx application that has to run in web application under apache tomcat server.
    There is a line of code that changes the Locale ( Locale.setDefault(new Locale("iw", "IL")); ).
    When running this application in stand-alone it works fine, but when i try to run it from browser, it throws excaption "java.security.AccessControlException: access denied (java.util.PropertyPermission user.language write)"
    I know that javafx (when it is running in browser) is no more then applet, and it is necessary to grant the access to user.language property in "something.policy" file. But it is only theory for me, and in practice i don't know how to do this.
    Thank you.
    Igor.

    Adding this to your jnlp file should also work:
         <security>
         <all-permissions/>
         </security>
    Doing so should work for any user that accesses your application from the web. Sign the jar first though (use the NetBeans sign option when generating your webstart application).
    Here is a [great JNLP|http://download.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html] reference that shows the other options.

  • Error:Class java.util.date not found

    i have installed 9iAS on my computer.And i want to develop program on JSP.i tried the url below
    http://eyuksel/servlet/IsItWorking
    and i got "it is working" message.when i try to execute my first jsp file i get the error:
    Errors compiling:d:\ias\apache\apache\htdocs\_pages\\_first.java
    d:\ias\apache\apache\htdocs\_pages\_first.java:55: Class java.util.date not found.
    out.print( new java.util.date() );
    ^
    1 error
    what must i do or how can i install the java classes.
    kind regards...
    null

    Thank you very much.It worked:)
    Java is case-sensitive.
    try
    java.util.Date
    instead of
    java.util.date
    null

  • Re: java.security.AccessControlException: access denied (java.util.PropertyPermission weblogic.kernel.allowQueueThrottling read)

    This looks like it might be a bug in 6.1SP5,
              weblogic/kernel/Kernel.java at line 85.
              It's trying to do the right thing to ignore an exception if in
              an applet but it's ignoring the wrong exception
              (SecurityException, when it looks like the stack
              trace is throwing a java.security.AccessControlException).
              If you need a fix, this would need to go through support
              and be filed as a problem with WLS Core.
              "Ram Gopal" <[email protected]> wrote in message
              news:[email protected]...
              >
              > We are in the process of migrating from Weblogic 6.1 SP2 to SP5. We have
              an applet
              > that subscribes to a JMS Topic.
              > The applet is throwing the following exception with SP5:
              >
              > java.lang.ExceptionInInitializerError:
              java.security.AccessControlException: access
              > denied (java.util.PropertyPermission weblogic.kernel.allowQueueThrottling
              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.kernel.Kernel.initAllowThrottleProp(Kernel.java:79)
              >
              > at weblogic.kernel.Kernel.<clinit>(Kernel.java:54)
              >
              > at
              weblogic.jndi.WLInitialContextFactoryDelegate.<init>(WLInitialContextFactory
              Delegate.java:166)
              >
              > at java.lang.Class.newInstance0(Native Method)
              >
              > at java.lang.Class.newInstance(Unknown Source)
              >
              > at
              weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
              ory.java:147)
              >
              > at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
              >
              > at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
              >
              > at javax.naming.InitialContext.init(Unknown Source)
              >
              > at javax.naming.InitialContext.<init>(Unknown Source)
              >
              > at
              com.fedex.efm.frontend.model.JMSMessageProcessor.<init>(JMSMessageProcessor.
              java:266)
              >
              > at
              com.fedex.efm.frontend.view.EFMAbstractApplet.startMessageProcessor(EFMAbstr
              actApplet.java:81)
              >
              > at
              com.fedex.efm.frontend.view.EFMAbstractApplet.start(EFMAbstractApplet.java:1
              87)
              >
              > at com.fedex.efm.frontend.view.EFMApplet.start(EFMApplet.java:430)
              >
              > at sun.applet.AppletPanel.run(Unknown Source)
              >
              > at java.lang.Thread.run(Unknown Source)
              >
              >
              > Any ideas as to what I am missing?
              >
              > Thanks,
              > Ram
              

    I suggest going through customer support, I don't know what
              the resolution was. You might also try the security newsgroup,
              as no JMS code has been called by the application yet at
              the point the exception is thrown.
              Tom
              lee wrote:
              > All:
              > We are upgrading weblogic 6.0 to weblogic 6.1 and encounted exactly the same error. Just wondering if you guys were able to fix the issue with bea.
              >
              > Your response is highly appreciated.
              >
              > Thanks!
              >
              > Li
              

  • Java.security.AccessControlException: access denied (java.util.PropertyPermission weblogic.kernel.allowQueueThrottling read)

              We are in the process of migrating from Weblogic 6.1 SP2 to SP5. We have an applet
              that subscribes to a JMS Topic.
              The applet is throwing the following exception with SP5:
              java.lang.ExceptionInInitializerError: java.security.AccessControlException: access
              denied (java.util.PropertyPermission weblogic.kernel.allowQueueThrottling 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.kernel.Kernel.initAllowThrottleProp(Kernel.java:79)
                   at weblogic.kernel.Kernel.<clinit>(Kernel.java:54)
                   at weblogic.jndi.WLInitialContextFactoryDelegate.<init>(WLInitialContextFactoryDelegate.java:166)
                   at java.lang.Class.newInstance0(Native Method)
                   at java.lang.Class.newInstance(Unknown Source)
                   at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:147)
                   at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
                   at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
                   at javax.naming.InitialContext.init(Unknown Source)
                   at javax.naming.InitialContext.<init>(Unknown Source)
                   at com.fedex.efm.frontend.model.JMSMessageProcessor.<init>(JMSMessageProcessor.java:266)
                   at com.fedex.efm.frontend.view.EFMAbstractApplet.startMessageProcessor(EFMAbstractApplet.java:81)
                   at com.fedex.efm.frontend.view.EFMAbstractApplet.start(EFMAbstractApplet.java:187)
                   at com.fedex.efm.frontend.view.EFMApplet.start(EFMApplet.java:430)
                   at sun.applet.AppletPanel.run(Unknown Source)
                   at java.lang.Thread.run(Unknown Source)
              Any ideas as to what I am missing?
              Thanks,
              Ram
              

    I don't know what is happening. JMS hasn't been called yet -
              the applet is still setting up its initial context. You might want
              to try posting to the jndi (and perhaps rmi) newsgroup.
              Tom
              Ram Gopal wrote:
              > We are in the process of migrating from Weblogic 6.1 SP2 to SP5. We have an applet
              > that subscribes to a JMS Topic.
              > The applet is throwing the following exception with SP5:
              >
              > java.lang.ExceptionInInitializerError: java.security.AccessControlException: access
              > denied (java.util.PropertyPermission weblogic.kernel.allowQueueThrottling 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.kernel.Kernel.initAllowThrottleProp(Kernel.java:79)
              >
              >      at weblogic.kernel.Kernel.<clinit>(Kernel.java:54)
              >
              >      at weblogic.jndi.WLInitialContextFactoryDelegate.<init>(WLInitialContextFactoryDelegate.java:166)
              >
              >      at java.lang.Class.newInstance0(Native Method)
              >
              >      at java.lang.Class.newInstance(Unknown Source)
              >
              >      at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:147)
              >
              >      at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
              >
              >      at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
              >
              >      at javax.naming.InitialContext.init(Unknown Source)
              >
              >      at javax.naming.InitialContext.<init>(Unknown Source)
              >
              >      at com.fedex.efm.frontend.model.JMSMessageProcessor.<init>(JMSMessageProcessor.java:266)
              >
              >      at com.fedex.efm.frontend.view.EFMAbstractApplet.startMessageProcessor(EFMAbstractApplet.java:81)
              >
              >      at com.fedex.efm.frontend.view.EFMAbstractApplet.start(EFMAbstractApplet.java:187)
              >
              >      at com.fedex.efm.frontend.view.EFMApplet.start(EFMApplet.java:430)
              >
              >      at sun.applet.AppletPanel.run(Unknown Source)
              >
              >      at java.lang.Thread.run(Unknown Source)
              >
              >
              > Any ideas as to what I am missing?
              >
              > Thanks,
              > Ram
              

  • Java.util.PropertyPermission swing.aatext write

    Hi,
    I have been working on an applet for a while now. In a sudden I started getting the following exception that I never got or seen before. I do have this line of code System.setProperty("swing.aatext", "true");
    I am using java 6 on my browser. Need your help. I have no clue why I am getting it or how to avoid it.
    java.security.AccessControlException: access denied (java.util.PropertyPermission swing.aatext write)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.System.setProperty(Unknown Source)
         at com.behr.colorsmart.pyp.PYPApplet.init(PYPApplet.java:35)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    basic: Exception: java.security.AccessControlException: access denied (java.util.PropertyPermission swing.aatext write)
    java.security.AccessControlException: access denied (java.util.PropertyPermission swing.aatext write)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.System.setProperty(Unknown Source)
         at com.behr.colorsmart.pyp.PYPApplet.init(PYPApplet.java:35)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

    Adding this to your jnlp file should also work:
         <security>
         <all-permissions/>
         </security>
    Doing so should work for any user that accesses your application from the web. Sign the jar first though (use the NetBeans sign option when generating your webstart application).
    Here is a [great JNLP|http://download.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html] reference that shows the other options.

  • Java.util.zip not handling Unicode filenames

    I have a zip file that contains files with Asian filenames. java.util.zip.ZipFile opens it, but the filenames are garbled. Is there any way to handle filenames that contain unicode characters?

    Of course, compression works on bytes, not some higher level constructs like Strings or files.
    You can use the ZipOutputStream or DeflaterOutputStream for compression.
    And the javadoc for Deflater even has a code example of compressing a String.
    Edited by: Kayaman on May 22, 2011 5:04 PM

  • Java.util.Locale not thread-safe !

    In multithreading programming, we know that double-checking idiom is broken. But lots of code, even in sun java core libraries, are written using this idiom, like the class "java.util.Locale".
    I have submitted this bug report just now,
    but I wanted to have your opinion about this.
    Don't you think a complete review of the source code of the core libraries is necessary ?
    java.util.Locale seems not to be thread safe, as I look at the source code.
    The static method getDefault() is not synchronized.
    The code is as follows:
    public static Locale getDefault() {
    // do not synchronize this method - see 4071298
    // it's OK if more than one default locale happens to be created
    if (defaultLocale == null) {
    // ... do something ...
    defaultLocale = new Locale(language, country, variant);
    return defaultLocale;
    This method seems to have been synchronized in the past, but the bug report 4071298 removed the "synchronized" modifier.
    The problem is that for multiprocessor machines, each processor having its own cache, the data in these caches are never synchronized with the main memory.
    The lack of a memory barrier, that is provided normally by the "synchronized" modifier, can make a thread read an incompletely initialized Locale instance referenced by the static private variable "defaultlocale".
    This problem is well explained in http://www.javaworld.com/javaworld/jw-02-2001/jw-0209-double.html and other documents about multithreading.
    I think this method must just be synchronized again.

    Shankar, I understand that this is something books and articles about multithreading don't talk much about, because for marketing reasons, multithreading is supposed to be very simple.
    It absolutely not the case.
    Multithreading IS a most difficult topic.
    First, you must be aware that each processor has its own high-speed cache memory, much faster than the main memory.
    This cache is made of a mixture of registers and L1/L2/L3 caches.
    Suppose we have a program with a shared variable "public static int a = 0;".
    On a multiprocessor system, suppose that a thread TA running on processor P1 assign a value to this variable "a=33;".
    The write is done to the cache of P1, but not in the main memory.
    Now, a second thread TB running on processor P2 reads this variable with "System.out.prinln(a);".
    The value of "a" is retrieved from main memory, and is 0 !
    The value 33 is in the cache of P1, not in main memory where its value is still 0, because the cache of P1 has not been flushed.
    When you are using BufferedOutputStream, you use the "flush()" method to flush the buffer, and the "synch()" method to commit data to disk.
    With memory, it is the same thing.
    The java "synchronized" keyword is not only a streetlight to regulate traffic, it is also a "memory barrier".
    The opening brace "{" of a synchronized block writes the data of the processor cache into the main memory.
    Then, the cache is emptied, so that stale values of other data don't remain here.
    Inside the "synchronized" block, the thread must thus retrieve fresh values from main memory.
    At the closing brace "}", data in the processor cache is written to main memory.
    The word "synchronized" has the same meaning as the "sync()" method of FileDescriptor class, which writes data physically to disk.
    You see, it is really a cache communication problem, and the synchronized blocks allows us to devise a kind of data transfer protocol between main memory and the multiple processor local caches.
    The hardware does not do this memory reconciliation for you. You must do it yourself using "synchronized" block.
    Besides, inside a synchronized block, the processor ( or compiler ) feels free to write data in any order it feels most appropriate.
    It can thus reorder assignments and instruction.
    It is like the elevator algorithm used when you store data into a hard disk.
    Writes are reordered so that they can be retrieved more efficiently by one sweep or the magnetic head.
    This reordering, as well as the arbitrary moment the processor decides to reconciliate parts of its cache to main memory ( if you don't use synchronized ) are the source of the problem.
    A thread TB on processor P2 can retrieve a non-null pointer, and retrieve this object from main memory, where it is not yet initialized.
    It has been initialized in the cache of P1 by TA, though, but TB doen't see it.
    To summarize, use "synchronized" every time you access to shared variables.
    There is no other way to be safe.
    You get the problem, now ?
    ( Note that this problem has strictly nothing to do with the atomicity issue, but most people tend to mix the two topics...
    Besides, as each access to a shared variable must be done inside a synchronized block, the issue of atomicity is not important at all.
    Why would you care about atomicity if you can get a stale value ?
    The only case where atomicity is important is when multiple threads access a single shared variable not in synchronized block. In this case, the variable must be declared volatile, which in theory synchronizes main and cache memory, and make even long and double atomic, but as it is broken in lots of implementation, ... )

Maybe you are looking for