voyent
Stackoverflow bug found on 3.0.0_27 when running as applet  XML
Forum Index -> ICEpdf General
Author Message
franciscoperedo

Joined: 15/Jun/2009 00:00:00
Messages: 2
Offline


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. The solution is simple:

Code:
 
 public static String property(String paramString1, String paramString2)
   {
     try
     {
       return System.getProperty(paramString1, paramString2);
     }
     catch (SecurityException localSecurityException)
     {
       throw new RuntimeException(localSecurityException.getMessage(),localSecurityException);
     }
     return paramString2;
   }
 
 


Do you have a public JIRA system where I can file this bug?
franciscoperedo

Joined: 15/Jun/2009 00:00:00
Messages: 2
Offline


Yes you do ;-) , I have created issue PDF-25.
chained2plastic

Joined: 28/Sep/2009 00:00:00
Messages: 15
Offline


Sorry to bump an old issue. How can I get an updated version of IcePdf to use on my site? I am also trying to use IcePdf in an applet, and I can not load a pdf using either setUrl or setInputStream.

I get the same error as franciscoperedo, with a million errors following a StackOverflow error.

I'm afraid I am fairly new at Java, so recompiling IcePdf is a bit daunting, but I will attempt it if necessary.
lkraav

Joined: 09/Apr/2010 00:00:00
Messages: 1
Offline


this doesn't seem to be fixed in 4.0.1 i just downloaded and i also cannot login nor register into JIRA with this account.
 
Forum Index -> ICEpdf General
Go to:   
Powered by JForum 2.1.7ice © JForum Team