activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "matt hoffman (JIRA)" <>
Subject [jira] Created: (AMQ-704) ActiveIO compromises
Date Tue, 02 May 2006 13:54:38 GMT
ActiveIO compromises

         Key: AMQ-704
     Project: ActiveMQ
        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
     Fix For: 4.0 RC2

When using the ActiveIO journal, it's putting a java.util.HashSet into the
(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 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; 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.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message