[esb-issues] [JBoss JIRA] Created: (JBESB-1798) Error message for Notifier is misleading if exception is thrown in Notifier class constructor

Jiri Pechanec (JIRA) jira-events at lists.jboss.org
Mon Jun 9 02:39:48 EDT 2008


Error message for Notifier is misleading if exception is thrown in Notifier class constructor
---------------------------------------------------------------------------------------------

                 Key: JBESB-1798
                 URL: http://jira.jboss.com/jira/browse/JBESB-1798
             Project: JBoss ESB
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: Rosetta
            Reporter: Jiri Pechanec


See log file
14:17:19,281 ERROR [STDERR] java.lang.reflect.InvocationTargetException
14:17:19,281 ERROR [STDERR]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Met
hod)
14:17:19,281 ERROR [STDERR]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConst
ructorAccessorImpl.java:39)
14:17:19,281 ERROR [STDERR]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delegat
ingConstructorAccessorImpl.java:27)
14:17:19,281 ERROR [STDERR]     at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
14:17:19,281 ERROR [STDERR]     at org.jboss.soa.esb.notification.NotificationTarget.fromParams(Noti
ficationTarget.java:144)
14:17:19,281 ERROR [STDERR]     at org.jboss.soa.esb.notification.NotificationList.notifyAll(Notific
ationList.java:162)
14:17:19,281 ERROR [STDERR]     at org.jboss.soa.esb.actions.Notifier.notifyOK(Notifier.java:93)
14:17:19,282 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:17:19,282 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorI
mpl.java:39)
14:17:19,282 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodA
ccessorImpl.java:25)
14:17:19,282 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:585)
14:17:19,282 ERROR [STDERR]     at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.pro
cessSuccess(ActionProcessorMethodInfo.java:165)
14:17:19,282 ERROR [STDERR]     at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProc
essor.processSuccess(OverriddenActionLifecycleProcessor.java:108)
14:17:19,282 ERROR [STDERR]     at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.noti
fySuccess(ActionProcessingPipeline.java:610)
14:17:19,282 ERROR [STDERR]     at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.proc
ess(ActionProcessingPipeline.java:384)
14:17:19,282 ERROR [STDERR]     at org.jboss.soa.esb.listeners.message.MessageAwareListener$Transact
ionalRunner.run(MessageAwareListener.java:530)
14:17:19,282 ERROR [STDERR]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPool
Executor.java:650)
14:17:19,282 ERROR [STDERR]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExec
utor.java:675)
14:17:19,282 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:595)
14:17:19,282 ERROR [STDERR] Caused by: org.jboss.internal.soa.esb.rosetta.pooling.ConnectionExceptio
n: Unexpected exception accessing Naming Context
14:17:19,282 ERROR [STDERR]     at org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool.getS
ession(JmsConnectionPool.java:165)
14:17:19,282 ERROR [STDERR]     at org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool.getS
ession(JmsConnectionPool.java:229)
14:17:19,282 ERROR [STDERR]     at org.jboss.soa.esb.notification.NotifyJMS.setUpProducers(NotifyJMS
.java:403)
14:17:19,282 ERROR [STDERR]     at org.jboss.soa.esb.notification.NotifyQueues.<init>(NotifyQueues.java:71)
14:17:19,282 ERROR [STDERR]     ... 19 more
14:17:19,283 ERROR [STDERR] Caused by: org.jboss.soa.esb.helpers.NamingContextException: Failed to c
reate Naming Context
14:17:19,283 ERROR [STDERR]     at org.jboss.soa.esb.helpers.NamingContextPool.createContext(NamingC
ontextPool.java:358)
14:17:19,283 ERROR [STDERR]     at org.jboss.soa.esb.helpers.NamingContextPool.getContext(NamingCont
extPool.java:296)
14:17:19,283 ERROR [STDERR]     at org.jboss.soa.esb.helpers.NamingContextPool.getContext(NamingCont
extPool.java:151)
14:17:19,283 ERROR [STDERR]     at org.jboss.soa.esb.helpers.NamingContextPool.getNamingContext(Nami
ngContextPool.java:402)
14:17:19,283 ERROR [STDERR]     at org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool.init
Connection(JmsConnectionPool.java:408)
14:17:19,283 ERROR [STDERR]     at org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool.getS
ession(JmsConnectionPool.java:163)
14:17:19,283 ERROR [STDERR]     ... 22 more
14:17:19,283 ERROR [STDERR] Caused by: javax.naming.CommunicationException: Could not obtain connect
ion to any of these urls: localhost:7222 and discovery failed with error: javax.naming.Communication
Exception: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] 
[Root exception is javax.naming.CommunicationException: Failed to retrieve stub from server localhos
t:7222 [Root exception is java.io.StreamCorruptedException: invalid stream header]]
14:17:19,289 ERROR [STDERR]     at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562
)
14:17:19,289 ERROR [STDERR]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634)
14:17:19,289 ERROR [STDERR]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
14:17:19,289 ERROR [STDERR]     at javax.naming.InitialContext.lookup(InitialContext.java:351)
14:17:19,289 ERROR [STDERR]     at org.jboss.soa.esb.helpers.NamingContextPool.createContext(NamingC
ontextPool.java:342)
14:17:19,289 ERROR [STDERR]     ... 27 more
14:17:19,289 ERROR [STDERR] Caused by: javax.naming.CommunicationException: Failed to retrieve stub 
from server localhost:7222 [Root exception is java.io.StreamCorruptedException: invalid stream heade
r]
14:17:19,289 ERROR [STDERR]     at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:268
)
14:17:19,289 ERROR [STDERR]     at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533
)
14:17:19,289 ERROR [STDERR]     ... 31 more
14:17:19,289 ERROR [STDERR] Caused by: java.io.StreamCorruptedException: invalid stream header
14:17:19,290 ERROR [STDERR]     at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java
:764)
14:17:19,290 ERROR [STDERR]     at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
14:17:19,290 ERROR [STDERR]     at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:255
)
14:17:19,290 ERROR [STDERR]     ... 32 more
14:17:19,298 ERROR [NotificationList] Can't instantiate target <target class="NotifyQueues">
                         <messageProp name="quetest" value="some test property"/>
                         <queue jndi-URL="localhost:7222" jndiName="QUICKSTART_NOTIFIER_QUETEST_GW">
                         </queue>                         
                       </target>
org.jboss.soa.esb.ConfigurationException: NotifyQueues  does not extend NotificationTarget
        at org.jboss.soa.esb.notification.NotificationTarget.fromParams(NotificationTarget.java:151)

        at org.jboss.soa.esb.notification.NotificationList.notifyAll(NotificationList.java:162)
        at org.jboss.soa.esb.actions.Notifier.notifyOK(Notifier.java:93)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processSuccess(ActionProces
sorMethodInfo.java:165)
        at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.processSuccess(Ove
rriddenActionLifecycleProcessor.java:108)
        at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.notifySuccess(ActionProcessi
ngPipeline.java:610)
        at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipe
line.java:384)
        at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageA
wareListener.java:530)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)

The issue is caused by the code from NotificationTarget.java
                Object oRet = null;
                try
                {
                        oRet = oCons.newInstance(new Object[] { p_oP });
                }
                catch (Exception e)
                {
                        e.printStackTrace();
                }
                if (null == oRet || (!(oRet instanceof NotificationTarget)))
                        throw new ConfigurationException(sClass + "  does not extend NotificationTarget");

                return (NotificationTarget) oRet;

The problem is that for some Notifiers it is allowed to throw exception in constructor (e.g. NotifyQueue) and in such case the variable oRet has still value set to null but it is due to completely different reason then that class is not subclass of NotificationTarget.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the esb-issues mailing list