Solved

Python script to connect with weblogic Admin server

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ElasticSearch Filter Query 1 257
how to check case insensitive substring 5 63
Python Assistance 7 86
How can I do this in Pyhton? 12 131
Variable is a place holder or reserved memory locations to store any value. Which means whenever we create a variable, indirectly we are reserving some space in the memory. The interpreter assigns or allocates some space in the memory based on the d…
A set of related code is known to be a Module, it helps us to organize our code logically which is much easier for us to understand and use it. Module is an object with arbitrarily named attributes which can be used in binding and referencing. …
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 modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…

821 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