[JBoss Microcontainer] - How to handle character arrays in xml
by Ben Schofield
Ben Schofield [http://community.jboss.org/people/dbschofield] created the discussion
"How to handle character arrays in xml"
To view the discussion, visit: http://community.jboss.org/message/550497#550497
--------------------------------------------------------------
<bean name="ValueBean">
<constructor>
<parameter>someValue</parameter>
</constructor>
</bean>
<bean name="StringBean" class="java.lang.String">
<constructor>
<parameter>
<value-factory bean="ValueBean" method="toCharArray"/>
</parameter>
</constructor>
</bean>
I am trying to create String named StringBean that gets created using the toCharArray method of the ValueBean. The toCharArray method returns a char[] with value "someValue". When I start JBoss I get the following error.
java.lang.IllegalArgumentException: Wrong arguments. new for target java.lang.reflect.Constructor expected=[java.lang.String] actual=[[C]
at org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:395)
at org.jboss.reflect.plugins.introspection.ReflectionUtils.newInstance(ReflectionUtils.java:153)
at org.jboss.reflect.plugins.introspection.ReflectConstructorInfoImpl.newInstance(ReflectConstructorInfoImpl.java:106)
at org.jboss.joinpoint.plugins.BasicConstructorJoinPoint.dispatch(BasicConstructorJoinPoint.java:80)
at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.createTarget(AOPConstructorJoinpoint.java:295)
at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.dispatch(AOPConstructorJoinpoint.java:116)
...
How do I properly handle a character array to initialize a string object in xml? I am using version 2.0.9.GA shipped with JBoss EAP 5.0.1.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/550497#550497]
Start a new discussion in JBoss Microcontainer at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 6 months