activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Javier Leyba" <xle...@gmail.com>
Subject jmx and jndi problem
Date Wed, 22 Mar 2006 16:15:16 GMT
Hi

I've two simple questions:


1 - if I've  more than one broker in the same machine and enable jmx,
I receive an error related port 1099. How should I configure this port
?

Also, is possible two define a jmx server that unite all brokers to
allow administrative tasks ? I would like to start/stop brokers from a
jmx console but I noticed if enable jmx in a broker and it is stopped
I can't start it from jmx.

May be what I want is not allowed, sorry, but I never worked with jmx !!  :)


2 - I'm trying to bind a topic to jndi but I received a message like this:

[code]

Caught: javax.naming.OperationNotSupportedException
javax.naming.OperationNotSupportedException
	at org.apache.activemq.jndi.ReadOnlyContext.bind(ReadOnlyContext.java:312)
	at javax.naming.InitialContext.bind(InitialContext.java:355)
	at com.bs.proteo.notifications.transaction.HelloWorldProducer.main(HelloWorldProducer.java:37)
	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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
[/code]


When I tried to do:


[code]

Properties props = new Properties();
            props.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
            props.setProperty(Context.PROVIDER_URL, "tcp://172.31.112.9:62002");
            javax.naming.Context ctx = new InitialContext(props);

            // Create a ConnectionFactory
            ActiveMQConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("failover://(tcp://172.31.112.9:62002,tcp://172.30.27.1:62003)?randomize=false");
            System.out.println("Factory");

            // Create a Connection
            Connection connection = connectionFactory.createConnection();
            connection.start();
            System.out.println("Started");

            // Create a Session
            Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
            System.out.println("created session");

            // Create the destination (Topic or Queue)
            Topic destination = session.createTopic("foo");
            System.out.println("topic created");

            ctx.bind("foo", (Topic) destination);
            ctx.close();

[/code]


Is a real error or I'm missing some config setting ?

Thanks in advance

J

Mime
View raw message