I have a Java Applet that was running fine using an early version of Java 7 but now on Java 8 I'm having permission issues. Here is the specific error I'm getting:
May 28, 2015 12:57:15 PM [com.sun.xml.internal.ws.assembler.MetroConfigLoader] init
WARNING: MASM0010: Unable to unmarshall metro config file from location [ jar:file:/C:/Program%20Files/Java/jre1.8.0_45/lib/resources.jar!/com/sun/xml/internal/ws/assembler/jaxws-tubes-default.xml ]
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")
It seems that due to a permissions issue it can't access the xml file to load the configuration. I've tried updating my java policy files to allow that permission but it doesn't seem to be helping. In javaws.policy & java.policy for both my JDK and JRE I've added the following inside the 'grant {' and at the top inside 'grant codeBase "file:${{java.ext.dirs}}/*" {':
permission java.lang.RuntimePermission "accessDeclaredMembers";
The above line doesn't seem to make any difference though.
I'm also signing my main JAR and all the supporting library JARs using an Ant build script. Here is the part of my Ant
<mkdir dir="H:/Eclipse Projects/myProgram/dist/myProgram_lib"/>
<copy file="D:/Users/user/.ivy2/cache/org.apache.wink/wink-client/jars/wink-client-1.1-incubating.jar" todir="H:/Eclipse Projects/myProgram/dist/myProgram_lib"/>
<copy file="D:/Users/user/.ivy2/cache/org.apache.wink/wink-common/jars/wink-common-1.1-incubating.jar" todir="H:/Eclipse Projects/myProgram/dist/myProgram_lib"/>
<copy file="D:/Users/user/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.5.11.jar" todir="H:/Eclipse Projects/myProgram/dist/myProgram_lib"/>
<copy file="D:/Users/user/.ivy2/cache/org.slf4j/slf4j-jdk14/jars/slf4j-jdk14-1.5.11.jar" todir="H:/Eclipse Projects/myProgram/dist/myProgram_lib"/>
<copy file="D:/Users/user/.ivy2/cache/javax.xml.bind/jaxb-api/jars/jaxb-api-2.1.jar" todir="H:/Eclipse Projects/myProgram/dist/myProgram_lib"/>
<copy file="D:/Users/user/.ivy2/cache/javax.xml.stream/stax-api/jars/stax-api-1.0-2.jar" todir="H:/Eclipse Projects/myProgram/dist/myProgram_lib"/>
<copy file="D:/Users/user/.ivy2/cache/javax.activation/activation/jars/activation-1.1.jar" todir="H:/Eclipse Projects/myProgram/dist/myProgram_lib"/>
<copy file="D:/Users/user/.ivy2/cache/com.sun.xml.bind/jaxb-impl/jars/jaxb-impl-2.1.4.jar" todir="H:/Eclipse Projects/myProgram/dist/myProgram_lib"/>
<copy file="D:/Users/user/.ivy2/cache/javax.ws.rs/jsr311-api/jars/jsr311-api-1.1.jar" todir="H:/Eclipse Projects/myProgram/dist/myProgram_lib"/>
<copy file="D:/Users/user/.ivy2/cache/commons-codec/commons-codec/jars/commons-codec-1.3.jar" todir="H:/Eclipse Projects/myProgram/dist/myProgram_lib"/>
<copy file="D:/Users/user/.ivy2/cache/xpp3/xpp3_min/jars/xpp3_min-1.1.4c.jar" todir="H:/Eclipse Projects/myProgram/dist/myProgram_lib"/>
<signjar alias="xxxxxxxxxxxxxxxxx" keystore="xxxxxxxxxxxxxx" storepass="xxxxxx" lazy="true">
<path>
<fileset dir="dist" includes="**/*.jar" />
</path>
</signjar>
I've got this inside the part of the Ant script that updates the manifest file:
<manifest>
<attribute name="Permissions" value="all-permissions"/>
<attribute name="Main-Class" value="myProgram.MainFrame"/>
</manifest>
Does anyone know what I can to to get rid of this permissions issue so my code can get the necessary configuration file and run?
Thanks!