[jboss-dev-forums] [Design of POJO Server] - Re: MainDeployer MBean methods in JBoss 5

Wolfgang Knauf do-not-reply at jboss.com
Thu Jul 3 04:57:01 EDT 2008


I'm stuck. I found the deployment manager, but now I don't know how to continue. Google does not help, either. 

How do I deploy an application and wait for deployment? Has anybody a small code snippet?

My code up to now (to get the EAR deployer):
try {
  | 	System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
  | 	System.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
  | 	System.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
  | 
  | 	DeploymentFactoryManager dfm = DeploymentFactoryManager.getInstance();
  | 
  | 	DeploymentFactory[] factories = dfm.getDeploymentFactories();
  | 	System.out.println(factories.length);
  | 	for (int i = 0; i < factories.length; i++) {
  | 		System.out.println("Factory: " + factories);
  | 	}
  | 	DeploymentManager dm = dfm.getDeploymentManager(DeploymentManagerImpl.DEPLOYER_URI, null, null);
  | 
  | 	System.out.println("DeploymentManager: " + dm);
  | 
  | 	Target[] targets = dm.getTargets();
  | 
  | 	javax.enterprise.deploy.spi.TargetModuleID[] modules;
  | 	modules = dm.getAvailableModules(javax.enterprise.deploy.shared.ModuleType.EAR, targets);
  | 
  | 	System.out.println(targets.length + " " + targets[0]);
  | 	System.out.println(modules);
  | } catch (Exception e) {
  | 	e.printStackTrace();
  | }

"getAvailableModules" returns always null (http://jira.jboss.org/jira/browse/JBAS-4078).

The only hint I found is this: http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/trunk/testsuite/src/main/org/jboss/test/deployment/BaseDeploymentTestCase.java?revision=62584&view=markup. But I'm not sure whether all those lines of code are required, so I would be glad if someone could help me without having to dig through all this code.

Hope someone can help

Wolfgang

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162266#4162266

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162266



More information about the jboss-dev-forums mailing list