Issue Type: Feature Request Feature Request
Assignee: Rob Cernich
Components: component-bean
Created: 06/Sep/13 3:26 PM
Description:

Weld calls toString() methods for debugging purposes on CDI beans. Unfortunately if it tries to call it on SY Service bean an exception is thrown that can jeopardize the whole flow.

Here is an example of an exception thrown when a bean service is undeployed.

It is probably wise ti implement toString() to prived a meaningful information.

Also equals and hashCode might be considered.

15:23:15,782 WARN  [org.jboss.msc.service.fail] (MSC service thread 1-15) MSC000004: Failure during stop of service jboss.deployment.unit."bean-simple-service-client-test.jar".WeldBootstrapService: java.lang.reflect.UndeclaredThrowableException                              
        at org.jboss.weld.context.SerializableContextualInstanceImpl.toString(SerializableContextualInstanceImpl.java:60)
        at java.lang.String.valueOf(String.java:2854) [rt.jar:1.7.0_11]
        at java.lang.StringBuilder.append(StringBuilder.java:128) [rt.jar:1.7.0_11]
        at java.util.AbstractMap.toString(AbstractMap.java:523) [rt.jar:1.7.0_11]
        at java.lang.String.valueOf(String.java:2854) [rt.jar:1.7.0_11]
        at java.lang.StringBuilder.append(StringBuilder.java:128) [rt.jar:1.7.0_11]
        at org.jboss.weld.context.beanstore.ConcurrentHashMapBeanStore.toString(ConcurrentHashMapBeanStore.java:56)
        at org.jboss.weld.context.AbstractSharedContext.toString(AbstractSharedContext.java:74)
        at java.text.MessageFormat.subformat(MessageFormat.java:1271) [rt.jar:1.7.0_11]
        at java.text.MessageFormat.format(MessageFormat.java:860) [rt.jar:1.7.0_11]
        at java.text.Format.format(Format.java:157) [rt.jar:1.7.0_11]
        at java.text.MessageFormat.format(MessageFormat.java:836) [rt.jar:1.7.0_11]
        at ch.qos.cal10n.MessageConveyor.getMessage(MessageConveyor.java:89)
        at org.jboss.weld.logging.WeldMessageConveyor.getMessage(WeldMessageConveyor.java:66)
        at org.slf4j.cal10n.LocLogger.trace(LocLogger.java:75)
        at org.jboss.weld.context.AbstractContext.destroy(AbstractContext.java:135)
        at org.jboss.weld.context.AbstractSharedContext.destroy(AbstractSharedContext.java:61)
        at org.jboss.weld.context.AbstractSharedContext.invalidate(AbstractSharedContext.java:56)
        at org.jboss.weld.bootstrap.WeldBootstrap.shutdown(WeldBootstrap.java:463)
        at org.jboss.as.weld.WeldBootstrapService.stop(WeldBootstrapService.java:128)
        at org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:1911) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
        at org.jboss.msc.service.ServiceControllerImpl$StopTask.run(ServiceControllerImpl.java:1874) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_11]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_11]
        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_11]
Caused by: org.switchyard.component.bean.BeanComponentException: Bean Component invocation failure.  Operation 'toString' is not defined on Service 'SimpleService'.
        at org.switchyard.component.bean.ClientProxyBean$ClientProxyInvocationHandler.createExchange(ClientProxyBean.java:326)
        at org.switchyard.component.bean.ClientProxyBean$ClientProxyInvocationHandler.invoke(ClientProxyBean.java:281)
        ... 28 more
Fix Versions: 1.1
Project: SwitchYard
Priority: Major Major
Reporter: Rob Cernich
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira