3 Replies Latest reply on Jul 30, 2008 10:14 PM by srikanth_vals

    Deploy app from Remote File URL

    srikanth_vals

      Hi,
      I have machine A and machine B. I have jboss server running on A. I have java utility to deploy on B. When i try to deploy app on A where as the app is on B.

      below is URL i am
      Object[] params = new Object[]{new URL("file://B/C:/hsqldb-ds.xml")};

      I feel the JBoss on A could not connect to B and get the file to deploy...Its very urgent and show stopper for me..please help....

      -Sri

        • 1. Re: Deploy app from Remote File URL
          peterj

          That is not a proper UNC name for accessing a file on a share on another Windows system.

          First, on host B you need to define a network share. For this example lets call that share myapps. You need to place the apps you want to deploy into the local directory identified by the network share. For example, on B you have a directory c:/myapps and you share it as myapps. Then copy the app (hsqldb-ds.xml in this case) to that directory - it then appears in the share. Then you need to ensure that the account that is being used to run JBossAS on host A has access rights to that share. Then you can use this URL to deploy the app:

          "file://B/myapps/hsqldb-ds.xml"

          • 2. Re: Deploy app from Remote File URL
            srikanth_vals

            Yes i did try that too and i made sure that "myapps" folder on B is accessible to everyone with all rights including A. I even tried to open the file \\B\work\hsqldb-ds.xml and file://B/work/hsqldb-ds.xml in A's browser and i could open it directly.. when i run my utility i get following error...

            javax.management.MBeanException
             at org.jboss.mx.interceptor.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:180)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:163)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             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:585)
             at org.jboss.jmx.connector.invoker.InvokerAdaptorService.invoke(InvokerAdaptorService.java:266)
             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:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
             at org.jboss.jmx.connector.invoker.SerializableInterceptor.invoke(SerializableInterceptor.java:74)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:179)
             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:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
             at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
             at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:818)
             at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:419)
             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:585)
             at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
             at sun.rmi.transport.Transport$1.run(Transport.java:153)
             at java.security.AccessController.doPrivileged(Native Method)
             at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
             at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
             at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
             at java.lang.Thread.run(Thread.java:595)
            Caused by: org.jboss.deployment.DeploymentException: url file://B/work/hsqldb-ds.xml could not be opened, does it exist?
             at org.jboss.deployment.DeploymentInfo.<init>(DeploymentInfo.java:214)
             at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:781)
             at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
             ... 48 more
            
            


            • 3. Re: Deploy app from Remote File URL
              srikanth_vals

              what i see the code running inside VM could not lookup to remote machine and read the file....

              Below is sample code from DeploymentInfo class in org.jboss.deployment

               if (!isDirectory)
               {
               try
               {
               url.openStream().close();
               }
               catch (Exception e)
               {
               throw new DeploymentException("url " + url + " could not be opened, does it exist?");
               }
              
              


              Below is sample code in same utility in which i can read the file contents..
              
               try{
               URL test = new URL("file://B/work/hsqldb-ds.xml");
               System.out.println(test.openStream().toString());
               BufferedReader in
               = new BufferedReader(new InputStreamReader(test.openStream()));
               System.out.println(in.readLine());
               }catch(Exception e){
               e.printStackTrace();
               }