#1767 XidFactory creation does not fail gracefully

v3.2
closed-invalid
Adrian Brock
JBossTX (39)
5
2004-03-03
2004-02-27
negge
No

If the hostname cannot be resolved (e.g., /etc/hosts
does not have a line defining hostname as localhost)
then when the XidFactory service is created, the JBoss
boot process deadlocks!

A timeout should used so that when the hostname does
not resolve either an error message is produced, or
localhost is used by default.

I have reproduced this error with JBoss 3.2.1 and
3.2.3, but it should exist in the entire 3.2.x line.

Below is a thread dump when the app server is deadlocked:

Full thread dump Java HotSpot(TM) Client VM
(Blackdown-1.4.1-01 mixed mode):

"Thread-1" daemon prio=5 tid=0x8501668 nid=8800 in
Object.wait() [0x4d5ab000..0x4d5ab814]
at java.lang.Object.wait(Native Method)
- waiting on <0x447b1778> (a java.util.TaskQueue)
at java.lang.Object.wait(Object.java:426)
at java.util.TimerThread.mainLoop(Timer.java:403)
- locked <0x447b1778> (a java.util.TaskQueue)
at java.util.TimerThread.run(Timer.java:382)

"DestroyJavaVM" prio=5 tid=0x8052f10 nid=8789 waiting
on condition [0..0xbfffd380]

"main" prio=5 tid=0x8146988 nid=8798 in Object.wait()
[0x4c6f7000..0x4c6f8814]
at java.lang.Object.wait(Native Method)
- waiting on <0x446c0708> (a java.util.HashMap)
at java.lang.Object.wait(Object.java:426)
at
java.net.InetAddress.checkLookupTable(InetAddress.java:1046)
- locked <0x446c0708> (a java.util.HashMap)
at
java.net.InetAddress.getAddressFromNameService(InetAddress.java:985)
at
java.net.InetAddress.getLocalHost(InetAddress.java:1125)
at
org.jboss.tm.XidFactory.<init>(XidFactory.java:74)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at
org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:847)
at
org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:291)
at
org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:318)
at
org.jboss.system.ServiceCreator.install(ServiceCreator.java:98)
at
org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:151)
at
org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:114)
at
org.jboss.system.ServiceController.install(ServiceController.java:225)
- locked <0x446cf930> (a
org.jboss.system.ServiceController)
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:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at
org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy4.install(Unknown Source)
at
org.jboss.deployment.SARDeployer.create(SARDeployer.java:183)
at
org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)
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:324)
at
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at
org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
at $Proxy5.deploy(Unknown Source)
at
org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)
at
org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
at org.jboss.Main.boot(Main.java:150)
at org.jboss.Main.run(Main.java:395)
at java.lang.Thread.run(Thread.java:536)

"Signal Dispatcher" daemon prio=5 tid=0x808d9d0
nid=8796 waiting on condition [0..0]

"Finalizer" daemon prio=5 tid=0x80877d8 nid=8793 in
Object.wait() [0x4c382000..0x4c382814]
at java.lang.Object.wait(Native Method)
- waiting on <0x4468b400> (a
java.lang.ref.ReferenceQueue$Lock)
at
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
- locked <0x4468b400> (a
java.lang.ref.ReferenceQueue$Lock)
at
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
at
java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=5 tid=0x8086c28
nid=8792 in Object.wait() [0x4c301000..0x4c301814]
at java.lang.Object.wait(Native Method)
- waiting on <0x4468b1e0> (a
java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:426)
at
java.lang.ref.Reference$ReferenceHandler.run(Reference.java:113)
- locked <0x4468b1e0> (a
java.lang.ref.Reference$Lock)

"VM Thread" prio=5 tid=0x80839d0 nid=8791 runnable

"VM Periodic Task Thread" prio=5 tid=0x808c640 nid=8794
waiting on condition
"Suspend Checker Thread" prio=5 tid=0x808cf88 nid=8795
runnable

Discussion

  • Adrian Brock
    Adrian Brock
    2004-03-03

    • assigned_to: nobody --> ejort
    • status: open --> closed-invalid
     
  • Adrian Brock
    Adrian Brock
    2004-03-03

    Logged In: YES
    user_id=9459

    This is not a JBoss bug.

    First a reverse DNS lookup should never take forever.
    There should be a timeout configured somewhere.

    More importantly, if you look at the source for InetAddress
    it shouldn't
    be stuck at that wait() unless there is another thread also
    performing
    the same operation.

    Contact your JRE supplier.

    Regards,
    Adrian