Solved

Python script to connect with weblogic Admin server

Posted on 2008-06-26
5
3,100 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 500 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
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 …

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now