JuddiRMIService: avax.naming.ServiceUnavailableException when using the binding manager
---------------------------------------------------------------------------------------
Key: JBESB-2906
URL:
https://jira.jboss.org/jira/browse/JBESB-2906
Project: JBoss ESB
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Rosetta
Reporter: Daniel Bevenius
Priority: Critical
Fix For: 4.7
I ran into this issue when trying the twoservers quickstart on AS 5.1 and starting the
server like described in readme.txt:
./run.sh -c first -Djboss.service.binding.set=ports-01
Stacktrace:
17:03:49,877 INFO [JuddiRMIService] starting juddi RMI service
17:03:49,897 INFO [JuddiRMIService] ProviderURL : + jnp://localhost:1099
17:03:49,897 INFO [JuddiRMIService] InitialContextFactory :
org.jnp.interfaces.NamingContextFactory
17:03:49,897 INFO [JuddiRMIService] InitialContextFactoryPgks : org.jboss.naming
17:03:54,957 ERROR [STDERR] javax.naming.CommunicationException: Could not obtain
connection to any of these urls: localhost:1099 and discovery failed with error:
javax.naming.CommunicationException: Receive timed out [Root exception is
java.net.SocketTimeoutException: Receive timed out] [Root exception is
javax.naming.CommunicationException: Failed to connect to server localhost/127.0.0.1:1099
[Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server
localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection
refused]]]
17:03:54,959 ERROR [STDERR] at
org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1763)
17:03:54,961 ERROR [STDERR] at
org.jnp.interfaces.NamingContext.rebind(NamingContext.java:547)
17:03:54,961 ERROR [STDERR] at
org.jnp.interfaces.NamingContext.rebind(NamingContext.java:540)
17:03:54,961 ERROR [STDERR] at
javax.naming.InitialContext.rebind(InitialContext.java:367)
17:03:54,961 ERROR [STDERR] at
org.apache.juddi.registry.rmi.JNDIRegistration.register(JNDIRegistration.java:95)
17:03:54,961 ERROR [STDERR] at
org.jboss.internal.soa.esb.dependencies.JuddiRMIService.startService(JuddiRMIService.java:138)
17:03:54,962 ERROR [STDERR] at
org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:376)
17:03:54,962 ERROR [STDERR] at
org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:322)
17:03:54,962 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown
Source)
17:03:54,962 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
17:03:54,962 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
17:03:54,963 ERROR [STDERR] at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
17:03:54,963 ERROR [STDERR] at
org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
17:03:54,963 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
17:03:54,963 ERROR [STDERR] at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
17:03:54,963 ERROR [STDERR] at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
17:03:54,963 ERROR [STDERR] at
org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:189)
17:03:54,964 ERROR [STDERR] at $Proxy38.start(Unknown Source)
17:03:54,964 ERROR [STDERR] at
org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
17:03:54,964 ERROR [STDERR] at
org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
17:03:54,964 ERROR [STDERR] at
org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
17:03:54,964 ERROR [STDERR] at
org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
17:03:54,965 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
17:03:54,965 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
17:03:54,965 ERROR [STDERR] at
org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
17:03:54,965 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
17:03:54,965 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
17:03:54,965 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
17:03:54,966 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
17:03:54,966 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
17:03:54,966 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
17:03:54,966 ERROR [STDERR] at
org.jboss.system.ServiceController.doChange(ServiceController.java:688)
17:03:54,966 ERROR [STDERR] at
org.jboss.system.ServiceController.start(ServiceController.java:460)
17:03:54,967 ERROR [STDERR] at
org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
17:03:54,967 ERROR [STDERR] at
org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
17:03:54,967 ERROR [STDERR] at
org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
17:03:54,967 ERROR [STDERR] at
org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
17:03:54,967 ERROR [STDERR] at
org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
17:03:54,968 ERROR [STDERR] at
org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
17:03:54,968 ERROR [STDERR] at
org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
17:03:54,968 ERROR [STDERR] at
org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
17:03:54,968 ERROR [STDERR] at
org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
17:03:54,968 ERROR [STDERR] at
org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
17:03:54,968 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
17:03:54,969 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
17:03:54,969 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
17:03:54,969 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
17:03:54,969 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
17:03:54,969 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
17:03:54,970 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
17:03:54,970 ERROR [STDERR] at
org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
17:03:54,970 ERROR [STDERR] at
org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
17:03:54,970 ERROR [STDERR] at
org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
17:03:54,970 ERROR [STDERR] at
org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
17:03:54,970 ERROR [STDERR] at
org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
17:03:54,971 ERROR [STDERR] at
org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
17:03:54,971 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
17:03:54,971 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
17:03:54,971 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
17:03:54,971 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
17:03:54,971 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
17:03:54,972 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
17:03:54,972 ERROR [STDERR] at
org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
17:03:54,972 ERROR [STDERR] at
org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
17:03:54,972 ERROR [STDERR] at
org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
17:03:54,972 ERROR [STDERR] at
org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
17:03:54,973 ERROR [STDERR] at org.jboss.Main.boot(Main.java:221)
17:03:54,973 ERROR [STDERR] at org.jboss.Main$1.run(Main.java:556)
17:03:54,973 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
17:03:54,974 ERROR [STDERR] Caused by: javax.naming.CommunicationException: Failed to
connect to server localhost/127.0.0.1:1099 [Root exception is
javax.naming.ServiceUnavailableException: Failed to connect to server
localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection
refused]]
17:03:54,974 ERROR [STDERR] at
org.jnp.interfaces.NamingContext.getServer(NamingContext.java:335)
17:03:54,974 ERROR [STDERR] at
org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1734)
17:03:54,975 ERROR [STDERR] ... 68 more
17:03:54,976 ERROR [STDERR] Caused by: javax.naming.ServiceUnavailableException: Failed to
connect to server localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException:
Connection refused]
17:03:55,009 ERROR [STDERR] at
org.jnp.interfaces.NamingContext.getServer(NamingContext.java:305)
17:03:55,010 ERROR [STDERR] ... 69 more
17:03:55,011 ERROR [STDERR] Caused by: java.net.ConnectException: Connection refused
17:03:55,011 ERROR [STDERR] at java.net.PlainSocketImpl.socketConnect(Native Method)
17:03:55,011 ERROR [STDERR] at
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
17:03:55,011 ERROR [STDERR] at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
17:03:55,012 ERROR [STDERR] at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
17:03:55,012 ERROR [STDERR] at
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
17:03:55,012 ERROR [STDERR] at java.net.Socket.connect(Socket.java:520)
17:03:55,012 ERROR [STDERR] at
org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:97)
17:03:55,012 ERROR [STDERR] at
org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:82)
17:03:55,013 ERROR [STDERR] at
org.jnp.interfaces.NamingContext.getServer(NamingContext.java:301)
17:03:55,013 ERROR [STDERR] ... 69 more
Troubleshooting:
I think this might have to do with the removal of the system properties related to
java.naming. Previously we set these in JuddiRMIService but this overwrote them for the
entire JVM.
Now this is the only thing we do in startService()
System.setProperty("juddi.propertiesFile",
juddiPropertyFile.getAbsolutePath());
System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
JNDIRegistration.register();
Now, JNDIRegistraion.register()
(
http://ws.apache.org/juddi/xref/org/apache/juddi/registry/rmi/JNDIRegistr...)
first checks the system properties and if they don't exist will default to ones
specified in it's configuration. I thought that that would be the properties that we
specify with "juddi.propertiesFile" above but they do not seem to get set.
I tried setting them explicitly like this:
Config.setStringProperty(RegistryEngine.PROPNAME_JAVA_NAMING_PROVIDER_URL,
xmlProperties.getProperty("java.naming.provider.url"));
Config.setStringProperty(RegistryEngine.PROPNAME_JAVA_NAMING_FACTORY_INITIAL,
xmlProperties.getProperty(RegistryEngine.PROPNAME_JAVA_NAMING_FACTORY_INITIAL));
Config.setStringProperty(RegistryEngine.PROPNAME_JAVA_NAMING_FACTORY_URL_PKGS,
xmlProperties.getProperty(RegistryEngine.PROPNAME_JAVA_NAMING_FACTORY_URL_PKGS));
And this worked for me but I we should look into this to see if there are other options
availabe. But hopefully this will help with investigating this issue.
I'll attach a modified (debug statements) of JuddiRMIService to this jira.
--
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