Hi !

>From the jconsole i get connection failed, but from the code i get
connection refused.
I will be very grateful for help, cause we need to access the JMS
functionality in
ActiveMQ. Thanks in advance.

Regards 

Daniel Förberg

Here is the error message from client:

INFO 2009-10-19 13:27:08,176
se.arbetsformedlingen.gemensam.util.PropertyLister - 
-----------------------------------------------------
  Listing contents of the following property files:
   
file:/C:/daniel/snapshotsvy/forda_view2/tjansteplattform/tjanster/Gemensam/target/test-classes/application.properties
  Property values:
    expiration.time=1
    jdbc.password=***** (hidden)
   
jdbc.url=jdbc:oracle:thin:@tp-ledigtarbete-v1-db.abetsformedlingen.se:1521/gdbforetag
    jdbc.username=gdbledigtarbete
    jms.brokerurl=tcp://L7700046.ws.ams.se:61616
    jmx.url=service:jmx:rmi:///jndi/rmi://L7700046.ws.ams.se:1616/jmxrmi
  End of property values.
-----------------------------------------------------
ERROR 2009-10-19 13:27:12,769
org.springframework.test.context.TestContextManager - Caught exception while
allowing TestExecutionListener
[org.springframework.test.context.support.dependencyinjectiontestexecutionliste...@9b688e]
to prepare test instance
[se.arbetsformedlingen.gemensam.activemqtopict...@ed5d9d]
java.lang.IllegalStateException: Failed to load ApplicationContext
        at
org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:201)
        at
org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
        at
org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
        at
org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:255)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:111)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:148)
        at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
        at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
        at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
        at 
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
        at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:97)
        at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
        at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'clientConnector' defined in class path resource
[activemq-jms-test.xml]: Invocation of init method failed; nested exception
is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested
exception is: 
        java.net.ConnectException: Connection refused: connect
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
        at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
        at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
        at
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)
        at
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:42)
        at
org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:173)
        at
org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:197)
        ... 17 more
Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1;
nested exception is: 
        java.net.ConnectException: Connection refused: connect
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
        at 
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
        at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown 
Source)
        at
javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2327)
        at 
javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:279)
        at
javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
        at
org.springframework.jmx.support.MBeanServerConnectionFactoryBean.connect(MBeanServerConnectionFactoryBean.java:128)
        at
org.springframework.jmx.support.MBeanServerConnectionFactoryBean.afterPropertiesSet(MBeanServerConnectionFactoryBean.java:116)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
        ... 33 more
Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:519)
        at java.net.Socket.connect(Socket.java:469)
        at java.net.Socket.<init>(Socket.java:366)
        at java.net.Socket.<init>(Socket.java:180)
        at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
        at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
        ... 44 more




Gary Tully wrote:
> 
> Just re JMX, on Linux, ensure the jmxremote port property is specified in
> the start script and that requests are not being blocked by a firewall:
>   SUNJMX="-Dcom.sun.management.jmxremote.port=1099
> -Dcom.sun.management.jmxremote.authenticate=false
> -Dcom.sun.management.jmxremote.ssl=false"
> 
> You may also want to try the statistics plugin that is new in 5.3, it
> allows
> you to obtain the metric you require through the jms api, which will
> automatically deal with failover. Rob has recently blogged about this
> feature:
> http://rajdavies.blogspot.com/2009/10/query-statistics-for-apache-activemq.html
> 
> 
> 2009/10/16 forda <daniel.forb...@bredband.net>
> 
>>
>> Hi !
>>
>> From a UnitTest accessing a Broker via Spring and a BrokerviewBean in
>> order
>> to manage
>> the setup and cleanup functions. For that BrokerviewBean is used. It
>> works
>> fine at localhost
>> as well as connecting a remote Broker in a windows network, but while
>> trying
>> to the same thing
>> in Linux network a connection refused is issued.
>>
>> On the Linux box(RedHat), the Broker is started through the Java Service
>> Wrapper, and the jmx rows are enabled at a specific port, and the
>> property
>> useJmx=true is default because the ActiveMQ 5.2 version is used. The
>> wrapper.conf will be attached to this message.
>>
>> It is important to make this work because i design
>> a solution for a reminderagent sending SMS to unemployed remind them of
>> meetings with Job coaches. Using the DestinationViewBean to ask for the
>> Queuesize on a specific Queue in this case a send SMS queue which be used
>> by
>> a consumer/Messagelistener, if the this Queue is empty another listener
>> starts to consume messages in another queue used for resending SMS
>> message
>> a
>> number of times or until delivered. So i need to get this work on Linux
>> too,
>> it works perfectly fine on wnidows. I think this a smoth solution. I do
>> know
>> that the QueBrowser class also can be used but this is not the best
>> solution
>> i think.
>>
>> And for failover reason i assume that the jmx.uris can be used like this
>> setting a property on the client like this jmx.url=uri1,uri2...uriN or ?
>> Do
>> i need to use the failover protocol like for the connecting to the
>> broker. And is there a way to configure the DestinationViewBean so that
>> it
>> uses the actual master Broker.
>> Or how do i do this ?
>>
>> Any better solutions ? Thanks in advance
>>
>> Regards
>> Daniel
>>
>> http://www.nabble.com/file/p25926940/wrapper.conf wrapper.conf
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Error-while-connecting-via-JMX-to-a-Broker-located-on-RHEL-5-tp25926940p25926940.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> http://blog.garytully.com
> 
> Open Source Integration
> http://fusesource.com
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Error-while-connecting-via-JMX-to-a-Broker-located-on-RHEL-5-tp25926940p25956781.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to