Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Python script to connect with weblogic Admin server

Posted on 2008-06-26
5
Medium Priority
?
3,376 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 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

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

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

"The time has come," the Walrus said, "To talk of many things: Of sets--and lists--and dictionaries-- Of variable kinks-- And why you see it changing not-- And why so strange are strings." This part describes how variables and references (see …
Strings in Python are the set of characters that, once defined, cannot be changed by any other method like replace. Even if we use the replace method it still does not modify the original string that we use, but just copies the string and then modif…
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 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…
Suggested Courses

715 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