activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "liwen zhang (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AMQ-704) ActiveIO compromises java.lang.System.properties
Date Thu, 05 Apr 2007 07:46:35 GMT

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

liwen zhang commented on AMQ-704:
---------------------------------

The same problem  occur in ActiveMQ 4.1.( SUSE Linux 9.2 + Jboss 4.0.3SP1).  I add the option
"JAVA_OPTS="-Dorg.apache.activeio.journal.active.DisableLocking=true"  in Jboss's run.sh,
and it work. 

I deploy two application on jboss:  daemon.war  & activemq-server.war,  the daemon.war
 deploy fail.  When I remove the activemq-server.war, the daemon.war  deploy ok. 

The failure message is :

21:25:25,604 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.access.BootstrapException: Unable to return specified BeanFactory
instance: factory key [beanRefFactory], from group with resource name [classpath*:springContext/beanRefFactory.xml];
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'beanRefFactory' defined in URL [jar:file:/export/home/jboss-4.0.3SP1/server/default/deploy/daemon.war/WEB-INF/lib/biz-v2.0-lib.jar!/springContext/beanRefFactory.xml]:
Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException:
Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]:
Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory' defined in class path resource [springContext/daoServiceContext.xml]:
Initialization of bean failed; nested exception is java.lang.ClassCastException: java.util.HashSet
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beanRefFactory'
defined in URL [jar:file:/export/home/jboss-4.0.3SP1/server/default/deploy/daemon.war/WEB-INF/lib/biz-v2.0-lib.jar!/springContext/beanRefFactory.xml]:
Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException:
Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]:
Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory' defined in class path resource [springContext/daoServiceContext.xml]:
Initialization of bean failed; nested exception is java.lang.ClassCastException: java.util.HashSet
org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]:
Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory' defined in class path resource [springContext/daoServiceContext.xml]:
Initialization of bean failed; nested exception is java.lang.ClassCastException: java.util.HashSet
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory'
defined in class path resource [springContext/daoServiceContext.xml]: Initialization of bean
failed; nested exception is java.lang.ClassCastException: java.util.HashSet
java.lang.ClassCastException: java.util.HashSet
        at org.hibernate.util.PropertiesHelper.resolvePlaceHolders(PropertiesHelper.java:88)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1173)
        at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:825)
        at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:751)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
        at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:537)
        at com.yeepay.common.entity.Incrementer.afterPropertiesSet(Incrementer.java:25)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:283)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:87)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:72)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
.....




> 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
>         Assigned To: 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.


Mime
View raw message