Solved

Python script to connect with weblogic Admin server

Posted on 2008-06-26
5
3,234 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 …
Here I am using Python IDLE(GUI) to write a simple program and save it, so that we can just execute it in future. Because when we write any program and exit from Python then program that we have written will be lost. So for not losing our program we…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
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 …

738 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