It's all about the answers!

Ask a question

RTC and Websphere Jython scripts error


Francisco Burgos (5157) | asked Oct 08 '12, 5:52 a.m.
retagged Oct 09 '12, 3:33 p.m. by Ralph Earle (25739)
I am following the documentation for installing RTC using Websphere (http://pic.dhe.ibm.com/infocenter/clmhelp/v4r0/index.jsp) but when I tried to use Jython script for configure websphere it doesn't work.

I am in the part of documentation:
Installing / Installing the Rational solution for CLM / Deploying and starting the server / Deploying and starting WebSphere Application Server / Administering WebSphere Application Server by using Jython / Setting up a WebSphere application Server

For now I did:

1. Install RTC
2. Install DB2
  2.2 Create DB for QM, JTS, etc...
3. Install WebSphere

Error that I get (Output):
WASX7209I: Connected to process "server1" on node vmuseridxxxNode03 using SOAP connector;  The type of process is: UnManagedProcess
WASX7487E: Failed to import script libraries modules: C:\Program Files\IBM\WebSphere\AppServer\scriptLibraries\perfTuning\V70\
applyPerfTuningTemplate.py; Examine the wsadmin log file to determine the problem.
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the
 argv variable: "[C:\Progra~1\IBM\JazzTeamServer\conf]"
Disabled Java2 Security
Enabled Application Security
Enabled Administrative Security
Enabled Unprotected URI
Setting configuration for Application Server server1
Set initial and max heap size to 4096
Set JVM args -Xmx1200m
WASX7017E: Exception received while running file "C:\Progra~1\IBM\JazzTeamServer\server\was\clm_was_config.py"; exception info
rmation: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  File "<string>", line 315, in ?
IndexError: index out of range: 2

WASX7341W: No "save" was performed before the interactive scripting session exited; configuration changes will not be saved.

Steps:
1. I create a profile from Profile Management Tool (Environment: Applicaton Server): "AppSrv03"
2. Start server
3. Open cmd:
3.1 cd C:\Program Files\IBM\WebSphere\AppServer\bin
3.2 Input command: wsadmin.bat -lang jython -profileName AppSrv03 -user myuser -password mypass -f C:\Progra~1\IBM\JazzTeamServer\server\was\clm_was_config.py C:\Progra~1\IBM\JazzTeamServer\conf

I am using:

WebSphere 7.0.0.23


Comments
Karl Weinert commented Oct 17 '12, 11:55 a.m.
JAZZ DEVELOPER

Did you deploy the applications yet? That can be done manually or done with the clm_deploy.py script.


Francisco Burgos commented Oct 18 '12, 3:49 a.m.

I did it manually with the console of WAS, but I couldn't do it with the script.

4 answers



permanent link
Karl Weinert (2.0k52736) | answered Oct 18 '12, 7:38 a.m.
JAZZ DEVELOPER
edited Oct 18 '12, 9:06 a.m.

Edit:
It seems that using language instead of lang makes the difference.
So running wsadmin.bat -language jython ..... returns
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[-language, jython, C:/OPT/IBM/RTC/40forWAS/server/conf]"

Where
running wsadmin.bat -lang jython ..... returns
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[C:/OPT/IBM/RTC/40forWAS/server/conf]"

Note using lang works as I have a number of scripts that use it that way. It just seems to change what arguments get passed into the script. So my previous workaround should also work.

Previous comment:

Based on the error: IndexError: index out of range: 2
And the line of code that the error points to
File "<string>", line 315, in ? which equals appcontextconfPath = "file:///"+ sys.argv[2] in the py file. It looks like there are 3 arguments required to run the script.

But based on the admin guide and the usage statement you appear to be running it correctly with only one.

Try adding in two bogus arguments before the one pointing to the conf directory.
i.e -f 
<path>\clm_was_config.py null null C:\Progra~1\IBM\JazzTeamServer\conf

I'll haven't used these scripts specifically so I'll try to test out them out later today or tomorrow as time permits.





Comments
Francisco Burgos commented Oct 21 '12, 4:09 p.m.

I did it, but I get same result.

I changed to WAS 8.0.0.3 and the scripts (clm_was_config.py and clm_deploy.py) seem work fine. But with WAS 7.0.0.23 I didn't succeed.


Karl Weinert commented Oct 22 '12, 6:42 a.m.
JAZZ DEVELOPER

Francisco did you try using -language argument instead of -lang or adding null null to the command?   What is the command line that works in 8.0.0.3? I tested on 8 no patches and 7.0.0.21 which showed the same issue with which arguments are passed to the script. Are you sure the error is the same each time?  Is moving to 8.0.0.3 going to be your resolution or are you going to try to use 7.0.x still? If you are going to continue to try and resolve this with 7.0 then please post the error you get when using the full -language argument.


permanent link
Dinesh Kumar B (4.1k413) | answered Oct 08 '12, 6:25 a.m.
JAZZ DEVELOPER
edited Oct 08 '12, 6:38 a.m.
run the command from the profile bin directory and not App Server bin

In you case its possibly
      C:\IBM\WebSphere\AppServer\profiles\AppSrv03\bin
which removes the params
      profileName <value>
and that should make the script pick the values rightly

hope it helps

Comments
Francisco Burgos commented Oct 08 '12, 6:49 a.m.

I have done it and I get same error exactly, with same output.


Dinesh Kumar B commented Oct 08 '12, 8:43 a.m.
JAZZ DEVELOPER

when i got this same error, three things took care of it
1.  to use the profile bin to run the script
2.  using forward slashes in the argument paths
3.  to use the wsadmin which is available in the profile bin


Francisco Burgos commented Oct 08 '12, 11:29 a.m.

Nothing happen. I have done this:

1. From: C:\IBM\WebSphere\AppServer\bin
wsadmin.bat -lang jython -profileName AppSrv03 -user myuser -password mypass -f C:\Progra~1\IBM\JazzTeamServer\server\was\clm_was_config.py C:\Progra~1\IBM\JazzTeamServer\conf

2 & 3. From:
C:\IBM\WebSphere\AppServer\bin
&
C:\IBM\WebSphere\AppServer\profiles\AppSrv03\bin

wsadmin.bat -lang jython -user myuser -password mypass -f C:/Progra~1/IBM/JazzTeamServer/server/was/clm_was_config.py C:/Progra~1/IBM/JazzTeamServer/conf


Dinesh Kumar B commented Oct 08 '12, 12:49 p.m.
JAZZ DEVELOPER

one more difference is the space in the path and usage of Progra~1 for resolving it. my installation does not have spaces in its path and so the short names are not required when I run the script. 

I would also try to use the long name but with double quotes around it.

the first error also suggests issues with spaces :
http://www-01.ibm.com/support/docview.wss?uid=swg1PM60715

also there is one more error related to UTF-8 usage, you may want to check with the suggestions given in :
http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Frtrb_wsadminprobs.html


permanent link
Indradri Basu (1.8k1514) | answered Oct 21 '12, 4:57 p.m.

 Use Forward slashes "/" instead of backward slash "\" when mentioning any path throughout in the command line.

Also if you have multiple profiles, I would add "-profileName <profilename>" param in the command or run the command from the <profilename>/bin (which Dinnesh also pointed) otherwise your command will fire against the default profile as set in WAS.

And if you still get the error, please post back.


permanent link
Indradri Basu (1.8k1514) | answered Oct 21 '12, 5:20 p.m.
Oops it looks like I have missed reading one of your old posts. :-)
Assuming you are trying this in a test environment, you can try the following but take precautions as necessary.

Take a backup of the .py file. Then open it with windows notepad (I would recommend that as other text editors can do harm)
Change the line appcontextconfPath = "file:///"+ sys.argv[2]  to     appcontextconfPath = "file:///"+ sys.argv[0]        and save it and run the command.

Hope this might help!

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.