Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Python script to connect with weblogic Admin server

Posted on 2008-06-26
5
Medium Priority
?
3,453 Views
Last Modified: 2013-12-10
I have written a python script to connect with weblogic Admin server through WLST script. I have used storeUserConfig() funxtion in WLST to store username and password in a file. So I dont want to specify it when I run connect function. I am getting below error when I run my code. I have attached the code. The "wl" which I have imported is the file contains WLST functions imported as Jython module. If I specify command as connect('weblogic', 'weblogic', t3://localhost:7001) it works.
import wl
 
serverName = 't3://localhost:7001'
 
userconfig = '/usr/local/bea/bea-WebLogicConfig.properties'
userkey = '/usr/local/bea/bea-WebLogicKey.properties'
 
wl.connect(userConfigFile=userconfig, userKeyFile=userkey, serverName)

Open in new window

0
Comment
Question by:Jayamurugan83
  • 2
  • 2
5 Comments
 
LVL 17

Expert Comment

by:ramrom
ID: 21880458
The error is almost self-explanatory: you have a non-keyword argument (serverName) following a keyword argument (userKeyFile=userkey).

I don't know what wl.connect expects, but you can't do it that way!
0
 

Author Comment

by:Jayamurugan83
ID: 21880581
Ok. Then I tried with this command.

wl.connect(userConfigFile=userconfig, userKeyFile=userkey, t3://localhost:7001)

it doesnt work as well

wl is another python file which got all WLST functions imported as Jython module.
 
0
 
LVL 35

Accepted Solution

by:
girionis earned 2000 total points
ID: 21883060
What happens if you do this

wl.connect(userConfigFile=userconfig, userKeyFile=userkey, url=serverName)

or even

wl.connect(userConfigFile='/usr/local/bea/bea-WebLogicConfig.properties', userKeyFile='/usr/local/bea/bea-WebLogicKey.properties', url='t3://localhost:7001')
0
 

Author Closing Comment

by:Jayamurugan83
ID: 31471122
Thank you so much. I used url=serverName and it works.
0
 
LVL 35

Expert Comment

by:girionis
ID: 21888212
Nice one, thanks for accepting :)
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question