Hi All

Here is a sample of what i implemented.This bit of code does work for
local deployment but fails for remote deployment.

----------------------------------------------------------------
try {

   //sampleFile : is some file in the local machine
   File sampleFile = new File("d:/backup/cart.jar");

   //host : is the remote host name
   URL deploymentURL = sampleFile.toURL();
   Hashtable env = new Hashtable();
   env.put("java.naming.factory.initial",
           "org.jnp.interfaces.NamingContextFactory");
   env.put("java.naming.provider.url",
           "jnp://"+host+":1099");
   env.put("java.naming.factory.url.pkgs",
           "org.jboss.naming:org.jnp.interfaces");

   InitialContext ctx = new InitialContext(env);

   Object o = ctx.lookup("jmx:"+host+":rmi");
   ObjectName containerFactory =
    new ObjectName("jboss.system:service=MainDeployer");

   ((RMIAdaptorImpl_Stub)o).invoke(containerFactory,"deploy",
    new Object[] { deploymentURL.toString() },
    new String[] { "java.lang.String" });

  }
  catch(Exception ex) {
   ex.printStackTrace();
  }
----------------------------------------------------------------

Here is the stack trace when i try to remotely deploy
???????????????????????????????????????????????????????

log4j:WARN No appenders could be found for logger
(org.jboss.util.NestedThrowable).
log4j:WARN Please initialize the log4j system properly.
MBeanException: Exception in MBean operation 'deploy(,java.lang.String)'

Cause: org.jboss.deployment.DeploymentException: url
file:/d:/backup/cart.jar could not be opened, does it exist?
        at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)

        at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)

        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
        at org.jboss.jmx.adaptor.rmi.RMIAdaptorImpl_Stub.invoke(Unknown
Source)
        at Sample.<init>(Sample.java:35)
        at Sample.main(Sample.java:47)

???????????????????????????????????????????????????????

Can anyone help me on the above issue?
Thanks in Advance,
Regds,
--Jagan.
--
_________________________________
L.S.JAGANATHAN
SIP Technologies & Exports Limited   http://www.siptech.com/
Elnet Software City, Taramani
Chennai - 600 113.
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
_________________________________




-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to