Hello,
There is the following problem.
Thread 1 does the following :
JMXConnectorFactory.connect(jmxurl, null);
Which leads to :
at org.eclipse.gemini.naming.ServiceAwareContextFactory$DefaultServiceAwareInvocationHandler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;(ServiceAwareContextFactory.java:76)
- locked <0x0000000049af1e10> (a org.eclipse.gemini.naming.OSGiInitialContextFactoryBuilder)
[b]- locked <0x00000003b39435e0> (a org.eclipse.gemini.naming.ServiceAwareContextFactory$DefaultServiceAwareInvocationHandler)[/b]
at com.sun.proxy.$Proxy0.lookup(Ljava/lang/String;)Ljava/lang/Object;(Unknown Source)
at sun.reflect.GeneratedMethodAccessor251.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Method.java:597)
at org.eclipse.gemini.naming.ReflectionUtils.invokeMethodOnObject(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(ReflectionUtils.java:77)
at org.eclipse.gemini.naming.ReflectionUtils.invokeMethodOnContext(Ljava/lang/reflect/Method;Ljavax/naming/Context;[Ljava/lang/Object;)Ljava/lang/Object;(ReflectionUtils.java:58)
at org.eclipse.gemini.naming.TraditionalInitialContextFactoryBuilder$TraditionalContextInvocationHandler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;(TraditionalInitialContextFactoryBuilder.java:142)
at com.sun.proxy.$Proxy0.lookup(Ljava/lang/String;)Ljava/lang/Object;(Unknown Source)
at javax.naming.InitialContext.lookup(Ljava/lang/String;)Ljava/lang/Object;(InitialContext.java:392)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(Ljava/lang/String;Ljava/util/Map;Z)Ljavax/management/remote/rmi/RMIServer;(RMIConnector.java:1888)
at javax.management.remote.rmi.RMIConnector.findRMIServer(Ljavax/management/remote/JMXServiceURL;Ljava/util/Map;)Ljavax/management/remote/rmi/RMIServer;(RMIConnector.java:1858)
at javax.management.remote.rmi.RMIConnector.connect(Ljava/util/Map;)V(RMIConnector.java:257)
- locked <0x0000000079a0f5d8> (a javax.management.remote.rmi.RMIConnector)
at javax.management.remote.JMXConnectorFactory.connect(Ljavax/management/remote/JMXServiceURL;Ljava/util/Map;)Ljavax/management/remote/JMXConnector;(JMXConnectorFactory.java:249)
On the other hand in another thread is called which leads to the following :
- waiting to lock <0x0000000049af1e10> (a org.eclipse.gemini.naming.OSGiInitialContextFactoryBuilder)
at org.eclipse.gemini.naming.SecurityAwareContextManagerImpl$NewInitialContextWithEnvironmentAction.run()Ljava/lang/Object;(SecurityAwareContextManagerImpl.java:122)
at java.security.AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction;)Ljava/lang/Object;(Native Method)
at org.eclipse.gemini.naming.SecurityUtils.invokePrivilegedAction(Ljava/security/PrivilegedExceptionAction;)Ljava/lang/Object;(SecurityUtils.java:45)
at org.eclipse.gemini.naming.SecurityAwareContextManagerImpl.invokePrivilegedAction(Ljava/security/PrivilegedExceptionAction;)Ljava/lang/Object;(SecurityAwareContextManagerImpl.java:73)
at org.eclipse.gemini.naming.SecurityAwareContextManagerImpl.newInitialContext(Ljava/util/Map;)Ljavax/naming/Context;(SecurityAwareContextManagerImpl.java:53)
at org.eclipse.gemini.naming.TraditionalInitialContextFactoryBuilder$TraditionalInitialContextFactory.getInitialContext(Ljava/util/Hashtable;)Ljavax/naming/Context;(TraditionalInitialContextFactoryBuilder.java:98)
at javax.naming.spi.NamingManager.getInitialContext(Ljava/util/Hashtable;)Ljavax/naming/Context;(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx()Ljavax/naming/Context;(InitialContext.java:288)
at javax.naming.InitialContext.init(Ljava/util/Hashtable;)V(InitialContext.java:223)
at javax.naming.InitialContext.<init>()V(InitialContext.java:175)
So we hit the same lock just to get InitialContext . But the first thread is doing a remote network operation.
Please advise us how to proceed?
Best regards, Daniel.