Galera, tenho uma aplicação JMS que está configurada para rodar no servidor JBoss.
Agora estou precisando roda-lá no Jonas, mas continuar consumindo a fila no Jboss.
Estou tendo problemas na configuaração do jndi.properties, no jboss tinha assim:
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>
<prop key="java.naming.provider.url">jnp://172.16.1.151:1099</prop>
<prop key="java.naming.factory.url.pkgs">org.jnp.interfaces:org.jboss.naming</prop>
</props>
</property>
</bean>
Agora queria saber como configurar no Jonas, pq ele não está aceitando o protocolo JNP. Adicionei um jnp.jar na aplicação e até um no servidor e não adianta, ele não reconhece esse protocolo.
Alguém já configurou o Jonas ?
Consegui fazer a configuração da seguinte forma:
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">fr.dyade.aaa.jndi2.client.NamingContextFactory</prop>
<prop key="java.naming.provider.host">172.16.1.151</prop>
<prop key="java.naming.provider.port">1099</prop>
<prop key="java.naming.factory.url.pkgs">org.objectweb.jonas.naming</prop>
</props>
</property>
</bean>
Porém agora gera essa exceção:
2010-05-07 10:32:55,312 : SEVERE : http-9000-Processor22 : ContextLoader.initWebApplicationContext : Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsConnectionFactory' defined in ServletContext resource [/WEB-INF/spring-jms.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
Caused by: javax.naming.NamingException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
at fr.dyade.aaa.jndi2.client.SimpleNamingConnection.open(SimpleNamingConnection.java:157)
at fr.dyade.aaa.jndi2.client.SimpleNamingConnection.invoke(SimpleNamingConnection.java:122)
at fr.dyade.aaa.jndi2.client.NamingContextImpl.lookup(NamingContextImpl.java:123)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:123)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:146)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:93)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:197)
at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:184)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3795)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
at org.objectweb.jonas.web.catalina55.JOnASStandardContext.start(JOnASStandardContext.java:255)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:122)
at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:144)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:738)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.objectweb.jonas.web.catalina55.CatalinaJWebContainerServiceImpl.doRegisterWar(CatalinaJWebContainerServiceImpl.java:596)
at org.objectweb.jonas.web.AbsJWebContainerServiceImpl.registerWar(AbsJWebContainerServiceImpl.java:969)
at org.objectweb.jonas.web.AbsJWebContainerServiceImpl.registerWarMBean(AbsJWebContainerServiceImpl.java:1053)
at org.objectweb.jonas.web.catalina55.CatalinaJWebContainerServiceImpl.registerWarMBean(CatalinaJWebContainerServiceImpl.java:1182)
at sun.reflect.GeneratedMethodAccessor255.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at org.objectweb.jonas.jmx.ManagementReprImplJSR160.invoke(ManagementReprImplJSR160.java:177)
at org.objectweb.jonas.jmx.JonasManagementRepr.invoke(JonasManagementRepr.java:136)
at org.objectweb.jonas.webapp.jonasadmin.deploy.BaseDeployAction.deploy(BaseDeployAction.java:441)
at org.objectweb.jonas.webapp.jonasadmin.deploy.ApplyDeployConfirmAction.executeAction(ApplyDeployConfirmAction.java:86)
at org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction.execute(JonasBaseAction.java:116)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:262)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:52)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:171)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:167)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
at org.objectweb.jonas.web.catalina55.ResetAuthenticationValve.invoke(ResetAuthenticationValve.java:107)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:619)
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:525)
at fr.dyade.aaa.common.SocketFactory14.createSocket(SocketFactory14.java:64)
at fr.dyade.aaa.jndi2.client.SimpleNamingConnection.open(SimpleNamingConnection.java:151)
... 84 more
Alguém tem alguma sugestão agora ?