ADSM-L

[ADSM-L] problem accessing TSM APi from java client

2010-11-02 07:32:48
Subject: [ADSM-L] problem accessing TSM APi from java client
From: Andrei Medan <andrei.medan AT LMSINTL DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Tue, 2 Nov 2010 12:28:49 +0100
Hello,

I need to run archive, retrieve commands on selected files on a html page
The requested files end on jboss server and I try to run dsmc command on a 
process using Runtime

I used the following code:

                  String cmdExec = getLocation("cmd.exe");

                  String env[] = { "PATH=%PATH%;E:\\Program 
Files(x86)\\Tivoli\\TSM\\baclient",
                                           "DSM_CONFIG=E:\\Program 
Files(x86)\\Tivoli\\TSM\\baclient\\dsm.opt",
                                           "DSM_LOG=E:\\Program 
Files(x86)\\Tivoli\\TSM\\baclient",
                                           "DSM_DIR=E:\\Program 
Files(x86)\\Tivoli\\TSM\\baclient"
                                           };

                  String cmds[] = {cmdExec, "/C", "\" dsmc \"" };
                  Process prc = Runtime.getRuntime().exec(cmds, env);
                  BufferedReader stdInput = new BufferedReader(new 
InputStreamReader(prc.getInputStream()));
                  BufferedReader stdError = new BufferedReader(new 
InputStreamReader(prc.getErrorStream()));

                  String s = null;
                  System.out.println("Here is the standard output of the 
command:\n");
                  StringBuffer ss = new StringBuffer();
                  while ((s = stdInput.readLine()) != null) {
                        System.out.println(s);
                        ss.append(s);
                        ss.append("\n");
                  }

                  // read any errors from the attempted command
                  System.out.println("Here is the standard error of the command 
(if any):\n");
                  StringBuffer errorS = new StringBuffer();
                  while ((s = stdError.readLine()) != null) {
                        System.out.println(s);
                        errorS.append(s);
                        errorS.append("\n");
                  }

                  stdInput.close();
                  stdError.close();
Problem is that I get back:

12:03:52,902 INFO  [STDOUT] Here is the standard output of the command:
12:03:55,652 INFO  [STDOUT] IBM Tivoli Storage Manager
12:03:57,246 INFO  [STDOUT] Command Line Backup/Archive Client Interface
12:03:58,433 INFO  [STDOUT]   Client Version 5, Release 5, Level 2.12
12:03:59,949 INFO  [STDOUT]   Client date/time: 11/02/2010 12:03:52
12:04:02,058 INFO  [STDOUT] (c) Copyright by IBM Corporation and other(s) 1990, 
2010. All Rights Reserved.
12:04:04,871 INFO  [STDOUT] Node Name: BRA-W10-023-X64
12:04:06,793 INFO  [STDOUT] ANS1017E Session rejected: TCP/IP connection failure

If I open a command prompt only and I run separately set
Set PATH=%PATH%;E:\\Program Files(x86)\\Tivoli\\TSM\\baclient
Set DSM_CONFIG=E:\\Program Files(x86)\\Tivoli\\TSM\\baclient\\dsm.opt
Set DSM_LOG=E:\\Program Files(x86)\\Tivoli\\TSM\\baclient
Set DSM_DIR=E:\\Program Files(x86)\\Tivoli\\TSM\\baclient
And then dsmc everything goes as should.

On error log I get
11/02/2010 12:03:52 TcpOpen(): socket(): errno = 10106
11/02/2010 12:03:52 TcpOpen: Error creating TCP/IP socket.
11/02/2010 12:03:52 ANS9020E Could not establish a session with a TSM server or 
client agent.  The TSM return code is -50.
11/02/2010 12:03:52 ANS1017E Session rejected: TCP/IP connection failure

Any help it would be appreciated.

Andrei Meda

<Prev in Thread] Current Thread [Next in Thread>