3 Replies Latest reply on Sep 1, 2004 1:24 PM by kedaar ghanekar

    Lookup remote connection factory

    kedaar ghanekar Newbie

      Hi,

      Im trying to lookup a remote ConnectionFactory from within a local JBoss service. It works fine if I lookup the Connection Factory using a local JNDI Context but fails on the looking up a ConnectionFactoryusing a remote Context. I think it has something to do with the security configuration but I do not know how to configure this yet. Thanks in advance for your useful advice.

      Here is my code:
      // Get the connection factory
      topicFactory =
      (TopicConnectionFactory) context.lookup("ConnectionFactory");


      And here is the stack trace:
      11:48:29,407 INFO [ServiceConfigurator] Problem configuring service com.crisys.sf.framework.link:service=LinkInputService
      org.jboss.deployment.DeploymentException: Exception setting attribute javax.management.Attribute: name=JndiName value=LinkInputService on mbean com.crisys.sf.framework.link:service=LinkInputService; - nested throwable: (com.crisys.sf.framework.jms.exceptions.SubscriptionGeneratorException: JNDI_LOOKUP_FAILED)
      at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:472)
      at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:326)
      at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:176)
      at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:118)
      at org.jboss.system.ServiceController.install(ServiceController.java:225)
      at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy5.install(Unknown Source)
      at org.jboss.deployment.SARDeployer.create(SARDeployer.java:183)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:784)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:639)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:613)
      at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:200)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:211)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:190)
      Caused by: com.crisys.sf.framework.jms.exceptions.SubscriptionGeneratorException: JNDI_LOOKUP_FAILED
      at com.crisys.sf.framework.jms.SubscriptionGenerator.init(Unknown Source)
      at com.crisys.sf.framework.jms.SubscriptionGenerator.(Unknown Source)
      at com.crisys.sf.framework.link.LinkInputService.start(Unknown Source)
      at com.crisys.sf.framework.link.LinkInputService.setJndiName(Unknown Source)
      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 org.jboss.mx.capability.ReflectedMBeanDispatcher.setAttribute(ReflectedMBeanDispatcher.java:186)
      at org.jboss.mx.server.MBeanServerImpl.setAttribute(MBeanServerImpl.java:503)
      at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:468)
      ... 27 more
      Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
      java.net.ConnectException: Connection refused]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:611)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      ... 38 more
      Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
      java.net.ConnectException: Connection refused
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
      at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
      at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492)
      ... 40 more
      Caused by: java.net.ConnectException: Connection refused
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
      at java.net.Socket.connect(Socket.java:452)
      at java.net.Socket.connect(Socket.java:402)
      at java.net.Socket.(Socket.java:309)
      at java.net.Socket.(Socket.java:124)
      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:562)
      ... 45 more
      11:48:29,435 INFO [MainDeployer] Deployed package: file:/SF/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/SF_LinkService.sar
      11:48:29,504 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean operation 'checkIncompleteDeployments()'
      Cause: Incomplete Deployment listing:
      Packages waiting for a deployer:

      Incompletely deployed packages:

      MBeans waiting for classes:

      MBeans waiting for other MBeans:
      [ObjectName: com.crisys.sf.framework.link:service=LinkInputService
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: Exception setting attribute javax.management.Attribute: name=JndiName value=LinkInputService on mbean com.crisys.sf.framework.link:service=LinkInputService; - nested throwable: (com.crisys.sf.framework.jms.exceptions.SubscriptionGeneratorException: JNDI_LOOKUP_FAILED)]