4 Replies Latest reply on Sep 16, 2005 3:24 PM by Scott Stark

    Starting failed jboss:service=Naming java.lang.ClassCastExce

    Bruno Beloff Newbie

      Hi

      I've got a serious problem deploying an application to JBoss 4.0.2. The application ran fine on JBoss 3.2.6.

      Without the application deployed, JBoss 4.0.2 runs fine, with MySQL. With my application library JAR files in server/default/lib, startup always fails. The following is a snippet from the console.

      What could be going on?

      Thanks for your help

      Bruno.


      12:23:07,425 DEBUG [ServiceController] Starting dependent components for: jboss.system:service=ThreadPool dependent components: [ObjectName: jboss:service=Naming
      State: CREATED
      I Depend On:
      jboss.system:service=ThreadPool
      ]
      12:23:07,426 DEBUG [ServiceController] starting service jboss:service=Naming
      12:23:07,428 DEBUG [NamingService] Starting jboss:service=Naming
      12:23:07,431 DEBUG [NamingService] System.setProperty, key=java.naming.factory.initial, value=org.jnp.interfaces.NamingContextFactory
      12:23:07,432 DEBUG [NamingService] System.setProperty, key=java.naming.provider.url, value=jnp://localhost:1099
      12:23:07,432 DEBUG [NamingService] System.setProperty, key=java.naming.factory.url.pkgs, value=org.jboss.naming:org.jnp.interfaces
      12:23:07,483 DEBUG [NamingService] Creating NamingServer stub, theServer=org.jnp.server.NamingServer@40d57b,rmiPort=1098,clientSocketFactory=null,serverSocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
      12:23:07,588 DEBUG [NamingService] NamingServer stub: org.jnp.server.NamingServer_Stub[RemoteStub [ref: [endpoint:[10.0.0.8:1098,org.jboss.net.sockets.DefaultSocketFactory@ad093076](local),objID:[0]]]]
      12:23:07,622 INFO [NamingService] Started jndi bootstrap jnpPort=1099, rmiPort=1098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
      12:23:07,940 DEBUG [NamingService] InitialContext Environment:
      12:23:07,944 ERROR [NamingService] Starting failed jboss:service=Naming
      java.lang.ClassCastException
      at org.jboss.naming.NamingService.startService(NamingService.java:235)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:418)
      at org.jboss.system.ServiceController.start(ServiceController.java:440)
      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.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
      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.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:434)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:315)
      at org.jboss.Main.boot(Main.java:195)
      at org.jboss.Main$1.run(Main.java:463)
      at java.lang.Thread.run(Thread.java:552)


        • 1. Re: Starting failed jboss:service=Naming java.lang.ClassCast
          Ohad Raz Newbie

          Hi Bruno,

          I am having a similar problem.
          Have you found the solution yet?
          If so, would you mind sharing it?...
          Thanks.

          • 2. Re: Starting failed jboss:service=Naming java.lang.ClassCast
            Joost van Gils Newbie

            Hi all,

            I have almost exactly the same problem. Any help is much appreciated.

            14:53:33,708 ERROR [NamingService] Starting failed jboss:service=Naming
            java.lang.ClassCastException: javax.naming.CompoundName
             at org.jboss.naming.NamingService.startService(NamingService.java:235)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
             at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
             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)
            ...
            

            I'm messing around with the original installation, and am probably missing some thing (or possibly using a 4.0.0 artefact). I get this exception at the very beginning of JBoss' startup.

            On line 235 of NamingService, there's the following:
            String value = (String) env.get(key);

            This seems the suggest that there's a problem with the enviroment. This is also what I've been tinkering with, but I'm having a tough time localizing the cause. I don't know why I'm getting a CompoundName instead of a String.

            Thanks!

            • 3. Re: Starting failed jboss:service=Naming java.lang.ClassCast
              Joost van Gils Newbie

              I did the following to get this working (JBoss 4.0.2). I'm still hoping for a better way though, or an explanation why it failed in the first place.

              In NamingService.java (\server\src\main\org\jboss\naming), change the line:

              String value = (String) env.get(key);

              into:
              String value = env.get(key).toString();




              • 4. Re: Starting failed jboss:service=Naming java.lang.ClassCast
                Scott Stark Master

                More details about the jdk are required. On your jdk the default InitialContext environment is seen to contain entries other than the expected string/string key/value properties from the server conf/jndi.properties file. Create a bug report in jira with the details. Since you have already done some hacking, simply dump the env by updating the "InitialContext Environment: " debug line:

                 Hashtable env = iniCtx.getEnvironment();
                 if (debug)
                 log.debug("InitialContext Environment: "+env);
                
                


                and attach the jdk and debug info to the following jira issue:
                http://jira.jboss.com/jira/browse/JBAS-2265