Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

jsr 88: Problem getting instance of DeploymentManager on websphere

 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I have the following program for getting the instance of DeploymentManager on websphere 6.1.

import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager;
import javax.enterprise.deploy.spi.DeploymentManager;
import javax.enterprise.deploy.spi.factories.DeploymentFactory;
import java.util.jar.JarFile;
import java.io.*;
import java.util.jar.*;

class WebSphere
{
public static void main(String args[]) throws Exception
{
// Get the DeploymentFactory implementation class from the MANIFEST.MF file.
JarFile wjmxappJar = new JarFile(new File("wjmxapp.jar"));
java.util.jar.Manifest manifestFile = wjmxappJar.getManifest();
Attributes attributes = manifestFile.getMainAttributes();
String key = "J2EE-DeploymentFactory-Implementation-Class";
String className = attributes.getValue(key);
System.out.println("The class name is...."+className);

// Get an instance of the DeploymentFactoryManager
DeploymentFactoryManager dfm = DeploymentFactoryManager.getInstance();

// Create an instance of the WebSphere Application Server DeploymentFactory.
Class deploymentFactory = Class.forName(className);
DeploymentFactory deploymentFactoryInstance = (DeploymentFactory) deploymentFactory.newInstance();

// Register the DeploymentFactory instance with the DeploymentFactoryManager.
dfm.registerDeploymentFactory(deploymentFactoryInstance);

// Provide WebSphere Application Server URL, user ID, and password.
// For more information, see the step that follows.

System.setProperty("com.ibm.SOAP.ConfigURL", "C:\\Program Files\\IBM\\WebSphere\\AppServer\\profiles\\default\\properties\\soap.client.props");
//System.out.println("property value..."+System.getProperty("com.ibm.SOAP.ConfigURL"));

DeploymentFactory[] dfs=dfm.getDeploymentFactories();

DeploymentManager deploymentManager= dfs[0].getDeploymentManager("deployer:WebSphere:localhost:8880","admin","admin");

// DeploymentManager deploymentManager= dfs[0].getDeploymentManager("deployer:Websphere:localhost:2809?connectorType=RMI","","");


System.out.println("Successfull...");
}

}



The exception I am getting is:


Exception in thread "main" javax.enterprise.deploy.spi.exceptions.DeploymentMana
gerCreationException: ADMJ1002E: An error occurred creating the application depl
oyment manager. com.ibm.websphere.management.exception.ConnectorException: Could
not create SOAP Connector to connect to host <<host-name>> at port
8880 with SOAP Connector security enabled

Can anyone help me out how to rectify this?
Thanks,
Guru
 
Ever since I found this suit I've felt strange new needs. And a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic