Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

wscpCommand in Java

0 views
Skip to first unread message

Dana

unread,
Dec 17, 2002, 5:10:51 AM12/17/02
to
I have the following test program that gives the message that can be
seen after the program.
I believe I have to do something with "Context".
What I have to do there I am not sure of.
I also specify all the JAR Files in the lib directory in the CLASSPATH
as well as the local directory.
----------------- pgm----------------
import com.ibm.ejs.sm.ejscp.wscpcommand.WscpCommand;
import com.ibm.ejs.sm.ejscp.wscpcommand.WscpResult;
public class eWSCPtest
{
public static void main(String args[])
{ try
{ WscpCommand wscpCommand = new
WscpCommand("localhost","900");
String cmd = "ApplicationServer list";
WscpResult results = wscpCommand.evalCommand(cmd);
if (!results.success())
{ System.out.println("command failed: " +
results.getErrorInfo());
}
}
catch (Exception e)
{ e.printStackTrace(System.out);
}
}
}
----------------------------------------
---------- error message----------------
Unable to read required resource: /com/ibm/websphere/product.xml
java.io.IOException: server.root system property not set
at
com.ibm.websphere.product.WASProduct.loadFromFile(WASProduct.java:264)
at
com.ibm.websphere.product.WASProduct.<clinit>(WASProduct.java:153)
at
com.ibm.ejs.sm.ejscp.ClientRepository.getSystemProperties(ClientRepository.java:817)
at
com.ibm.ejs.sm.ejscp.ClientRepository.<init>(ClientRepository.java:146)
at
com.ibm.ejs.sm.ejscp.EjscpExtension.init(EjscpExtension.java:126)
at tcl.lang.JavaLoadCmd.cmdProc(JavaLoadCmd.java:129)
at tcl.lang.AutoloadStub.cmdProc(Extension.java:144)
at tcl.lang.Parser.evalObjv(Parser.java(Compiled Code))

GoodGuy

unread,
Dec 17, 2002, 11:00:54 AM12/17/02
to
I would try the following:

include package at the top of your program like
package usr.websphere.appserver; // the path from where the com.ibm can be
reached.

Add the path in the classpath.

Goodguy


"Dana" <danasc...@web.de> wrote in message
news:3DFEF82B...@web.de...

Dana

unread,
Dec 19, 2002, 1:59:03 AM12/19/02
to
This also doesn't work.
Is there anyone who has gotten WscpCommand to work who can give some tips.

Thanks.

Ben_

unread,
Dec 19, 2002, 3:19:24 AM12/19/02
to
If you look at wscp.bat, you'll see there is -Dserver.root that resolves to
%WAS_HOME%. You have to specify as well it I suppose.


0 new messages