0 Replies Latest reply on Oct 18, 2007 3:26 PM by prashanthvvbabu

    Deployment using JSR88

    prashanthvvbabu

      Hi,

      I have been working on JSR88 API for Deploy/Undeploy/Stop/Start of an EJB on JBossASv4.0.2. I was able to deploy/undeploy an EJB, but I was not able to start/stop an app. Later I found out that start/stop were not implemented in that version.

      So, I moved to 4.0.5.GA and later to 4.2.1.GA. But, there were some changes in the URI and others. Now, am not even able to connect to the JBossAS. Am I doing something basically wrong..

      public class Main {
       public static void main(String[] args) {
       try {
       javax.enterprise.deploy.spi.factories.DeploymentFactory df = new org.jboss.deployment.spi.factories.DeploymentFactoryImpl();
       javax.enterprise.deploy.spi.DeploymentManager dm;
       dm = df.getDeploymentManager("http://org.jboss.deployment/jsr88", null, null);
       javax.enterprise.deploy.spi.Target[] targets = dm.getTargets();
       javax.enterprise.deploy.spi.TargetModuleID[] modules;
       modules = dm.getAvailableModules(javax.enterprise.deploy.shared.ModuleType.EJB, targets);
      
       System.out.println(targets.length + " " + targets[0]);
       System.out.println(modules);
      
       } catch (javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException ex) {
       ex.printStackTrace();
       } catch (javax.enterprise.deploy.spi.exceptions.TargetException ex) {
       ex.printStackTrace();
       }
       }
      }
      


      The error I get is :

      Caused by: javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
      [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099
      [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect
      ]
      ]
      ]


      I tried with a different URI ("jnp://localhost:1099") also. But, it does not fetch me any modules. Iam unable to understand, what Iam doing wrong.
      Please let me know. Am badly stuck. Any pointers to any documentation/examples will also be helpful.

      TIA...

      Thanks and Regards,

      Prashanth Babu.