[jboss-jira] [JBoss JIRA] Commented: (JGRP-1042) Provide better reporting of ChannelExceptions when debugging

Bela Ban (JIRA) jira-events at lists.jboss.org
Thu Apr 22 10:20:10 EDT 2010


    [ https://jira.jboss.org/jira/browse/JGRP-1042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12527068#action_12527068 ] 

Bela Ban commented on JGRP-1042:
--------------------------------

I don't see this ! If I start the unit test you referred to above with -Djgroups.bind_addr=MyUnknownHost, I get:


================ Starting test testBasicOperations ================

org.jgroups.ChannelException: unable to setup the protocol stack
	at org.jgroups.JChannel.init(JChannel.java:1713)
	at org.jgroups.JChannel.<init>(JChannel.java:243)
	at org.jgroups.JChannel.<init>(JChannel.java:226)
	at org.jgroups.tests.ChannelTestBase$DefaultChannelTestFactory.createChannel(ChannelTestBase.java:255)
	at org.jgroups.tests.ChannelTestBase$DefaultChannelTestFactory.createChannel(ChannelTestBase.java:216)
	at org.jgroups.tests.ChannelTestBase.createChannel(ChannelTestBase.java:171)
	at org.jgroups.tests.ChannelTest.testBasicOperations(ChannelTest.java:23)
	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:597)
	at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
	at org.testng.TestRunner.runWorkers(TestRunner.java:759)
	at org.testng.TestRunner.privateRun(TestRunner.java:592)
	at org.testng.TestRunner.run(TestRunner.java:486)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
	at org.testng.SuiteRunner.run(SuiteRunner.java:204)
	at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:867)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:832)
	at org.testng.TestNG.run(TestNG.java:748)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
	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:597)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.lang.Exception: Property assignment of bind_addr in UDP with original property value MyUnknownHost and converted to null could not be assigned. Exception is java.lang.Exception: Conversion of bind_addr in UDP with original property value MyUnknownHost failed. Exception is java.net.UnknownHostException: MyUnknownHost
	at org.jgroups.stack.Configurator.resolveAndAssignField(Configurator.java:949)
	at org.jgroups.stack.Configurator$ProtocolConfiguration.createLayer(Configurator.java:1261)
	at org.jgroups.stack.Configurator$ProtocolConfiguration.access$000(Configurator.java:1134)
	at org.jgroups.stack.Configurator.createProtocols(Configurator.java:369)
	at org.jgroups.stack.Configurator.setupProtocolStack(Configurator.java:90)
	at org.jgroups.stack.Configurator.setupProtocolStack(Configurator.java:56)
	at org.jgroups.stack.ProtocolStack.setup(ProtocolStack.java:453)
	at org.jgroups.JChannel.init(JChannel.java:1709)
	... 33 more
Caused by: java.lang.Exception: Conversion of bind_addr in UDP with original property value MyUnknownHost failed. Exception is java.net.UnknownHostException: MyUnknownHost
	at org.jgroups.conf.PropertyHelper.getConvertedValue(PropertyHelper.java:88)
	at org.jgroups.stack.Configurator.resolveAndAssignField(Configurator.java:943)
	... 40 more
Caused by: java.net.UnknownHostException: MyUnknownHost
	at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
	at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849)
	at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1200)
	at java.net.InetAddress.getAllByName0(InetAddress.java:1153)
	at java.net.InetAddress.getAllByName(InetAddress.java:1083)
	at java.net.InetAddress.getAllByName(InetAddress.java:1019)
	at java.net.InetAddress.getByName(InetAddress.java:969)
	at org.jgroups.conf.PropertyConverters$Default.convert(PropertyConverters.java:188)
	at org.jgroups.conf.PropertyHelper.getConvertedValue(PropertyHelper.java:85)
	... 41 more

===============================================
Custom suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================



> Provide better reporting of ChannelExceptions when debugging
> ------------------------------------------------------------
>
>                 Key: JGRP-1042
>                 URL: https://jira.jboss.org/jira/browse/JGRP-1042
>             Project: JGroups
>          Issue Type: Feature Request
>            Reporter: Richard Achmatowicz
>            Assignee: Bela Ban
>            Priority: Minor
>             Fix For: 2.10
>
>
> I spent a lot of time recently trying to track down some testsuite failures, where tests were failing with:
> "failed to start protocol stack"
> org.jgroups.ChannelException at org.jgroups.JChannel.startStack(JChannel.java:1766) at org.jgroups.JChannel.connect(JChannel.java:407) at org.jgroups.JChannel.connect(JChannel.java:382) at org.jgroups.tests.ChannelTest.testBasicOperations(ChannelTest.java:27) 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:597) at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580) at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:49) at org.testng.internal.InvokeMethodRunnable.run(InvokeMethodRunnable.java:40) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) 
> Turning on DEBUG level logging didn't help. I finally tracked the error down to an UnknownHostException which was getting raised in UDP.createSockets() during a call to InetAddress.getByname(). This checked exception was then passing through the following methods:
> UDP.createSockets() throws Exception ;
> UDP.start() throws Exception ;
> ProtocolStack.startStack() throws Exception ;
> JChannel.startStack() throws ChannelException ;
> There are a lot of potential exceptions which can occur when starting a stack, and these are getting masked to a large extent. It makes debugging stack startup problems painful, as the only way to get more information about the problem is to write code to unpack the ChannelException and print out its cause.
> I'd like to add some simple logging statements to the exception handler in JChannel.startStack() to make debugging the startup of stacks easier.
>  

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

       



More information about the jboss-jira mailing list