5 Replies Latest reply on May 29, 2006 3:29 AM by jaikiran

    Remote Client unable to get connection from a DataSource

    jlevine47

      I need to be able to access a DataSource from outside the JBoss JVM. I
      coded <use-java-context>false</use-java-context> in the DataSource per the instructions in the wiki. The remote client can lookup the data source but fails when it tries to get a connection:

      java.lang.reflect.UndeclaredThrowableException
      at $Proxy0.getConnection(Unknown Source)
      at com.jta.Sample4.doTran(Sample4.java:52)
      at com.jta.Sample4.main(Sample4.java:91)
      Caused by: java.rmi.ConnectException: Connection refused to host: 10.128.49.75;
      nested exception is:
      java.net.ConnectException: Connection timed out: connect
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
      at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
      at sun.rmi.server.UnicastRef.invoke(Unknown Source)
      at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Sour
      ce)
      at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvo
      kerProxy.java:119)
      at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerIntercep
      tor.java:227)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.jav
      a:167)
      at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodIntercepto
      r.java:59)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
      ... 3 more
      Caused by: java.net.ConnectException: Connection timed out: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(Unknown Source)
      at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
      at java.net.PlainSocketImpl.connect(Unknown Source)
      at java.net.SocksSocketImpl.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at java.net.Socket.(Unknown Source)
      at java.net.Socket.(Unknown Source)
      at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
      ource)
      at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
      ource)
      ... 13 more

      I have using the -Djava.rmi.server.hostname= property in my run.bat
      and the java.policy file has
      permission java.net.SocketPermission "localhost:1024-", "listen, connect, accept, resolve";

      Any ideas?

      Thanks,

      Jason



























        • 1. Re: Remote Client unable to get connection from a DataSource
          jlevine47

          I'm running JBoss-4.0.3SP1 with JAva 1.5.0-05. Client is on WinXP, Server is Windows 2000 server.

          • 2. Re: Remote Client unable to get connection from a DataSource
            shreikanth

            Has any one got solution for this

            • 3. Re: Remote Client unable to get connection from a DataSource
              weston.price

              For a year old post that wasn't even properly written? Probably not. Are you having issues with this feature in JBoss? If so, please post this again.

              • 4. Re: Remote Client unable to get connection from a DataSource
                shreikanth

                Yes I do have the same problem,
                I am using jboss-4.0.4.CR2 the latest candidate release. I can tell you this seems to coming in an inconsistent pattern

                The exception i got was
                java.lang.reflect.UndeclaredThrowableException
                at $Proxy0.getConnection(Unknown Source)
                at com.nazcasolutions.kernel.common.utilities.XChangeServiceLocator.getNewConnection(XChangeServiceLocator.java:98)
                Line 7
                at nz.example.XChangeConnection.main(XChangeConnection.java:73)
                Caused by: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
                java.lang.ClassNotFoundException: com.mysql.jdbc.CommunicationsException (no security manager: RMI class loader disabled)
                at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:217)
                at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
                at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
                at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:133)
                at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:348)
                at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
                at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
                at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
                ... 3 more
                Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.CommunicationsException (no security manager: RMI class loader disabled)
                at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:371)
                at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
                at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
                at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
                at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
                at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
                at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
                at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)Line 8
                Sucks
                at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
                at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
                at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
                at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
                at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
                at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
                at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
                at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
                at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
                at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
                at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:215)
                ... 10 more

                • 5. Re: Remote Client unable to get connection from a DataSource
                  jaikiran

                   

                  java.lang.ClassNotFoundException: com.mysql.jdbc.CommunicationsException


                  The above class is not present in the classpath. Place the jar containing this class in the classpath to resolve the issue.