Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Duplicate
-
Affects Version/s: 3.0
-
Fix Version/s: 4.3
-
Component/s: None
-
Labels:None
-
Environment:JDK 1.6u7, Windows XP SP2, IExplorer 8 or FireFox 3.x
-
ICEsoft Forum Reference:
Description
Hi! I am evaluating IcePdf to use it for an applet that will print the PDF referenced by an URL, but it does not work, and I get this error:
Code:
java.lang.StackOverflowError
at java.lang.ref.ReferenceQueue.poll(Unknown Source)
at java.util.WeakHashMap.expungeStaleEntries(Unknown Source)
at java.util.WeakHashMap.getTable(Unknown Source)
at java.util.WeakHashMap.get(Unknown Source)
at java.util.Collections$SynchronizedMap.get(Unknown Source)
at sun.security.provider.PolicyFile.implies(Unknown Source)
at java.security.ProtectionDomain.implies(Unknown Source)
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.icepdf.core.util.Defs.property(Unknown Source)
at org.icepdf.core.util.Defs.property(Unknown Source)
at org.icepdf.core.util.Defs.property(Unknown Source)
The problem seems to be at org.icepdf.core.util.Defs.property:
Code:
public static String property(String paramString1, String paramString2)
{
try
{
return System.getProperty(paramString1, paramString2);
}
catch (SecurityException localSecurityException)
{
property(paramString1, paramString2);
}
return paramString2;
}
If a SecurityException is produced, the catch will recursively call the property "ad infinitum" an eventually that will cause an StackOverflowError, what it should do is present me with the error message of the SecurityException.
Code:
java.lang.StackOverflowError
at java.lang.ref.ReferenceQueue.poll(Unknown Source)
at java.util.WeakHashMap.expungeStaleEntries(Unknown Source)
at java.util.WeakHashMap.getTable(Unknown Source)
at java.util.WeakHashMap.get(Unknown Source)
at java.util.Collections$SynchronizedMap.get(Unknown Source)
at sun.security.provider.PolicyFile.implies(Unknown Source)
at java.security.ProtectionDomain.implies(Unknown Source)
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.icepdf.core.util.Defs.property(Unknown Source)
at org.icepdf.core.util.Defs.property(Unknown Source)
at org.icepdf.core.util.Defs.property(Unknown Source)
The problem seems to be at org.icepdf.core.util.Defs.property:
Code:
public static String property(String paramString1, String paramString2)
{
try
{
return System.getProperty(paramString1, paramString2);
}
catch (SecurityException localSecurityException)
{
property(paramString1, paramString2);
}
return paramString2;
}
If a SecurityException is produced, the catch will recursively call the property "ad infinitum" an eventually that will cause an StackOverflowError, what it should do is present me with the error message of the SecurityException.
Activity
Francisco Peredo
created issue -
Patrick Corless
made changes -
Field | Original Value | New Value |
---|---|---|
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Duplicate [ 3 ] |
Patrick Corless
made changes -
Salesforce Case | [] | |
Fix Version/s | 4.3 [ 10266 ] |
Patrick Corless
made changes -
Salesforce Case | [] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
The solution is (AFAIK) very simple:
Code:
public static String property(String paramString1, String paramString2)
{ return System.getProperty(paramString1, paramString2); }{
try
catch (SecurityException localSecurityException)
{ throw new RuntimeException(localSecurityException.getMessage(),localSecurityException); }return paramString2;
}