Announcement Announcement Module
Collapse
No announcement yet.
Error while trying to configure Remote jmx Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error while trying to configure Remote jmx

    Hi,
    I am using Spring3.1 in a standalone env.

    I am trying to upgrade my jmx configuration to be remotly accessed (by rmi)

    but I am getting this exception:

    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.rmi.RmiRegistryFactoryBean#0' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.rmi.server.ExportException: Port already in use: 1099; nested exception is: 
    	java.net.BindException: Address already in use: JVM_Bind
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    	at com.fixgw.daemon.FeedDaemon.start(FeedDaemon.java:78)
    	at com.fixgw.daemon.FeedDaemon.main(FeedDaemon.java:97)
    Caused by: java.rmi.server.ExportException: Port already in use: 1099; nested exception is: 
    	java.net.BindException: Address already in use: JVM_Bind
    	at sun.rmi.transport.tcp.TCPTransport.listen(Unknown Source)
    	at sun.rmi.transport.tcp.TCPTransport.exportObject(Unknown Source)
    	at sun.rmi.transport.tcp.TCPEndpoint.exportObject(Unknown Source)
    	at sun.rmi.transport.LiveRef.exportObject(Unknown Source)
    	at sun.rmi.server.UnicastServerRef.exportObject(Unknown Source)
    	at sun.rmi.registry.RegistryImpl.setup(Unknown Source)
    	at sun.rmi.registry.RegistryImpl.<init>(Unknown Source)
    	at java.rmi.registry.LocateRegistry.createRegistry(Unknown Source)
    	at org.springframework.remoting.rmi.RmiRegistryFactoryBean.getRegistry(RmiRegistryFactoryBean.java:267)
    	at org.springframework.remoting.rmi.RmiRegistryFactoryBean.getRegistry(RmiRegistryFactoryBean.java:236)
    	at org.springframework.remoting.rmi.RmiRegistryFactoryBean.getRegistry(RmiRegistryFactoryBean.java:193)
    	at org.springframework.remoting.rmi.RmiRegistryFactoryBean.afterPropertiesSet(RmiRegistryFactoryBean.java:164)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
    	... 13 more
    Caused by: java.net.BindException: Address already in use: JVM_Bind
    	at java.net.PlainSocketImpl.socketBind(Native Method)
    	at java.net.PlainSocketImpl.bind(Unknown Source)
    	at java.net.ServerSocket.bind(Unknown Source)
    	at java.net.ServerSocket.<init>(Unknown Source)
    	at java.net.ServerSocket.<init>(Unknown Source)
    	at sun.rmi.transport.proxy.RMIDirectSocketFactory.createServerSocket(Unknown Source)
    	at sun.rmi.transport.proxy.RMIMasterSocketFactory.createServerSocket(Unknown Source)
    	at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(Unknown Source)
    	... 27 more

    thats my applicationContext.xml:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
    	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
    
    
    	xsi:schemaLocation="http://www.springframework.org/schema/beans 
    	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    	http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/aop 
        http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
    
    
    
    	<context:annotation-config />
    
    
    	<context:component-scan base-package="com.fixgw">
    	</context:component-scan>
    
    	<bean id="TriggerBean" class="com.fixgw.test.TriggerBean">
    	</bean>
    
    
    
    
    
    	<!--	start a JMX Server 	-->
    	<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean" />
    
    
    	<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
    		<property name="beans">
    			<map>
    				<entry key="Server:name=HttpAdaptor">
    					<bean class="mx4j.tools.adaptor.http.HttpAdaptor">
    						<property name="port" value="8000" />
    						<property name="host" value="0.0.0.0" />
    						<property name="processor">
    							<bean class="mx4j.tools.adaptor.http.XSLTProcessor" />
    						</property>
    					</bean>
    				</entry>
    				<entry key="bean:name=TriggerBean" value-ref="TriggerBean" />
    
    			</map>
    		</property>
    		<property name="listeners">
    			<list>
    				<!--
    					let the HttpAdapter be started after it is registered in the
    					MBeanServer
    				-->
    				<bean class="com.fixgw.jmx.HttpAdaptorMgr">
    					<property name="mbeanServer" ref="mbeanServer" />
    				</bean>
    			</list>
    		</property>
    	</bean>
    
    	<bean class="org.springframework.remoting.rmi.RmiRegistryFactoryBean"
    		p:port="1099" />
    
    
    
    	<bean class="org.springframework.jmx.support.ConnectorServerFactoryBean"
    		p:serviceUrl="service:jmx:rmi://localhost/jndi/rmi://localhost:1099/triggerBean" />
    
    
    	<bean name="namingServerImpl" class="org.jnp.server.NamingBeanImpl"
    		init-method="start" destroy-method="stop" />
    
    	<bean name="namingServer" class="org.jnp.server.Main" init-method="start"
    		destroy-method="stop">
    		<property name="namingInfo" ref="namingServerImpl" />
    		<property name="port" value="1099" />
    		<property name="bindAddress" value="localhost" />
    		<property name="rmiPort" value="1098" />
    		<property name="rmiBindAddress" value="localhost" />
    	</bean>
    
    
    
    	<bean name="fileConfiguration" class="org.hornetq.core.config.impl.FileConfiguration"
    		init-method="start" destroy-method="stop" />
    
    	<bean name="hornetQSecurityManagerImpl"
    		class="org.hornetq.spi.core.security.HornetQSecurityManagerImpl" />
    
    	<!-- The core server -->
    	<bean name="hornetQServerImpl" class="org.hornetq.core.server.impl.HornetQServerImpl">
    		<constructor-arg ref="fileConfiguration" />
    		<constructor-arg ref="mbeanServer" />
    		<constructor-arg ref="hornetQSecurityManagerImpl" />
    	</bean>
    
    	<!-- The JMS server -->
    	<bean name="jmsServerManagerImpl" class="org.hornetq.jms.server.impl.JMSServerManagerImpl"
    		init-method="start" destroy-method="stop" depends-on="namingServer">
    		<constructor-arg ref="hornetQServerImpl" />
    	</bean>
    
    	<bean name="connectionFactory" class="org.hornetq.jms.client.HornetQJMSConnectionFactory">
    		<constructor-arg name="ha" value="false" />
    		<constructor-arg>
    			<bean class="org.hornetq.api.core.TransportConfiguration">
    				<constructor-arg
    					value="org.hornetq.integration.transports.netty.NettyConnectorFactory" />
    				<constructor-arg>
    					<map key-type="java.lang.String" value-type="java.lang.Object">
    						<entry key="port" value="5445"></entry>
    					</map>
    				</constructor-arg>
    			</bean>
    		</constructor-arg>
    	</bean>
    
    	<bean id="notificationsQueue" class="org.springframework.jndi.JndiObjectFactoryBean"
    		depends-on="jmsServerManagerImpl">
    		<property name="jndiName">
    			<value>/queue/Notifications</value>
    		</property>
    	</bean>
    
    	<bean id="inVMConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"
    		depends-on="jmsServerManagerImpl">
    		<property name="jndiName">
    			<value>java:/ConnectionFactory</value>
    		</property>
    	</bean>
    
    </beans>

    What's wrong?
    thanks,
    ray.
    Last edited by ray.frid; Jul 4th, 2012, 04:30 AM.
Working...
X