1 Reply Latest reply on Aug 28, 2012 2:28 PM by thinksteep thinksteep

    jmx in jboss 7.1

    sarahfr Newbie

      Hi;

      I try to deploy my application in jboss 7.1 but I have this error:

      14:22:23,447 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 2276ms - Started 249 of 346 services (8 services failed or missing dependencies, 85 services are passive or on-demand)

      14:22:23,557 ERROR [stderr] (Thread-74) java.lang.UnsupportedOperationException: JBAS011859: Naming context is read-only

       

       

      14:22:23,557 ERROR [stderr] (Thread-74)           at org.jboss.as.naming.WritableServiceBasedNamingStore.requireOwner(WritableServiceBasedNamingStore.java:126)

       

       

      14:22:23,558 ERROR [stderr] (Thread-74)           at org.jboss.as.naming.WritableServiceBasedNamingStore.bind(WritableServiceBasedNamingStore.java:56)

       

       

      14:22:23,558 ERROR [stderr] (Thread-74)           at org.jboss.as.naming.NamingContext.bind(NamingContext.java:221)

       

       

      14:22:23,559 ERROR [stderr] (Thread-74)           at org.jboss.as.naming.InitialContext.bind(InitialContext.java:161)

       

       

      14:22:23,559 ERROR [stderr] (Thread-74)           at org.jboss.as.naming.NamingContext.bind(NamingContext.java:230)

       

       

      14:22:23,560 ERROR [stderr] (Thread-74)           at javax.naming.InitialContext.bind(InitialContext.java:400)

       

       

      14:22:23,560 ERROR [stderr] (Thread-74)           at javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:625)

       

       

      14:22:23,560 ERROR [stderr] (Thread-74)           at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:412)

       

       

      14:22:23,561 ERROR [stderr] (Thread-74)           at com.hello.JmxAgent.main(JmxAgent.java:40)

       

       

      14:22:23,561 ERROR [stderr] (Thread-74)           at com.hello.JmxThread.run(JmxThread.java:7)

       

       

      this is my class java:

       

      JmxAgent.java


      package com.hello;

      import java.lang.management.ManagementFactory;

      import java.rmi.RemoteException;

      import java.rmi.registry.LocateRegistry;

      import javax.management.MBeanServer;

      import javax.management.ObjectName;

      import javax.management.remote.JMXConnectorServer;

      import javax.management.remote.JMXConnectorServerFactory;

      import javax.management.remote.JMXServiceURL;

       

       

      public class JmxAgent{

       

       

                /**

                 * @param args

                 */

                public static void main(String[] args) {

                          // TODO Auto-generated method stub

                          try

                          {

                                    //javax.management.MBeanServerConnection  mbs=null;

                 // mbs = ManagementFactory.getPlatformMBeanServer();

           

                  MBeanServer mbs1= ManagementFactory.getPlatformMBeanServer();

                  

                         LocateRegistry.createRegistry(9999);

       

                   ObjectName name= new ObjectName("Hello:service=HelloObject");

                   Hello h=new Hello();

                   h.setHelloWorld("Bonjour");

                   mbs1.registerMBean(h,name);

                  JMXServiceURL  url = new  JMXServiceURL ("service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi//server");

                   JMXConnectorServer cs=    JMXConnectorServerFactory.newJMXConnectorServer(url,null,mbs1);

       

                   cs.start();

                   System.out.println("ecoute;;;;");

                   while (true)

                   {

                             System.out.println(h.getHelloWorld());

                             Thread.sleep(3000);

                   }

                 

                  

                  

                  

       

                }catch (Exception e)

                {

                          e.printStackTrace();

                }

                }

                

      }

       

      can you help me please??????

      thanks