You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "David Spitzer (JIRA)" <ji...@apache.org> on 2007/05/29 11:46:33 UTC

[jira] Reopened: (AMQ-704) ActiveIO compromises java.lang.System.properties

     [ https://issues.apache.org/activemq/browse/AMQ-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Spitzer reopened AMQ-704:
-------------------------------


I just encountered the same problem with ActiveMQ 4.1.1. It broke my Grails installation and it took me more than 2 hours to find out what's wrong.

This is clearly a bug, as setting other values than strings is forbidden. 

Just try to do a System.getProperties().list(System.out) and you'll get an exception.

This workaround is not a fix and the problems that arise from this issue are extremely difficult to track down as it will most likely break application server startup.

> ActiveIO compromises java.lang.System.properties
> ------------------------------------------------
>
>                 Key: AMQ-704
>                 URL: https://issues.apache.org/activemq/browse/AMQ-704
>             Project: ActiveMQ
>          Issue Type: Bug
>         Environment: ActiveMQ 4.0RC2 (confirmed still around in the current ActiveIO SVN),  Java 1.5 on Windows (but should be a problem anywhere).
>            Reporter: matt hoffman
>            Assignee: Hiram Chirino
>             Fix For: 4.0
>
>
> When using the ActiveIO journal, it's putting a java.util.HashSet into the System.properties (using a properties.put() call that circumvents the  normal System.putProperty() method, that only allows strings).   This isn't allowed, according to java.util.Properties' contract, and therefore breaks other packages that rely on System.properties adhering to its contract.  Most notably, it chokes Hibernate; however, anything that iterates through the System properties will fail after ActiveIO has compromised it with a non-String value.
> Honestly, I don't know why Properties doesn't allow non-String values, but oh well.  From the java.lang.Properties docs: 
> "Because Properties inherits from Hashtable, the put and putAll methods can be applied to a Properties object. Their use is strongly discouraged as they allow the caller to insert entries whose keys or values are not Strings. The setProperty method should be used instead. If the store or save method is called on a "compromised" Properties object that contains a non-String key or value, the call will fail."
> The call is being made in org.apache.activeio.journal.active.ControlFile; I suppose a hack could be created that stringifies the HashSet before placing it in the properties and recreates it before getting it out again; atlernately, a simple singleton or static set could be used.  I'd be happy to implement either one, if you'd like. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.