473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Syntax error in my script

Hi,

This might be more relevant for another group, but since this is a
Python script, thought I'd start here. I'm trying to write a WLST
script for WebLogic 9.2. I coped one directly from WebLogic's site
(http://e-docs.bea.com/wls/docs90/config_scripting/
using_WLST.html#1078952), but I'm getting errors. Specifically, I'm
getting

$HOSTNAME:"$PWD"->sh run_setup_cluster.sh

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Problem invoking WLST - Traceback (innermost last):
(no code object) at line 0
File "/export/third-party/etsbea/home/etsbea/tests/npsconfig/
createcluster.py", line 2
from javax.management import *
^
SyntaxError: invalid syntax
Below is my script. I know nothing about Python but cutting and
pasting from BEA's site isn't cutting it.

============Begin createcluster.py file=======================
from java.util import *
from javax.management import *
import javax.management.Attribute

print 'starting the script .... '

connect('system','weblogic','t3://localhost:7001')
clusters = "NPSCONFIG_GUI_Cluster"
ms1 = {'managed1':7019:8020,'managed2':7020:8021}

clustHM = HashMap()
edit()
startEdit()

for c in clusters:
print 'creating cluster '+c
clu = create(c,'Cluster')
clustHM.put(c,clu)
cd('Clusters/' + c)
set('MulticastAddress', '237.0.0.101')
set('MulticastPort', 9200)
set('WeblogicPluginEnabled', 'true')

cd('..\..')

clus1 = clustHM.get(clusters[0])

for m, lp, ssl_lp in ms1.items():
managedServer = create(m,'Server')
print 'creating managed server '+m
managedServer.setListenAddress('10.61.6.134')
managedServer.setListenPort(lp)
managedServer.setEnabled(0)
cd('SSL/cgServer')
managedServer.setEnabled(1)
managedServer.setListenPort(ssl_lp)
managedServer.setCluster(clus1)

save()
activate(block="true")
disconnect()
print 'End of script ...'
exit()
==============End cretaecluster.py file=======================
Jul 30 '08 #1
0 893

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Josh | last post by:
Hi All, I know this is a novice question that I should be able to solve through searching but I have Googled my fingers off and not found anything that seems to help. I have the following...
1
by: barry | last post by:
Hi I have the following code in a code behind file Dim sString As System.Text.StringBuilder sString = New System.Text.StringBuilder sString.Append("<script language=""Javascript"">" & vbCrLf)...
6
by: Robin | last post by:
Hello! I am useing ASP scripts with PERL and IIS 6.0 (Internet Information Server). The scripts are useing the 'Response.Redirect "xxx.asp"' cmd. Beside this there is a form which calls another...
12
by: Brad Baker | last post by:
I am trying to write a simple ASP.net/C# page which allows users to select some values and produce a report based on a SQL query. I have a self posting dropdown form which allows users to select...
1
by: Hari Sekhon | last post by:
I've written an except hook into a script as shown below which works well for the most part and catches exceptions. import sys def myexcepthook(type,value,tb): do something ...
4
by: muwie | last post by:
I'm failry new to this. I created this script, and first it was working like intended. But then I somehow changed something, and I keep getting this syntax error I type the name of the script ...
9
by: bill | last post by:
I just started a new project on a new virtual server. If I write a small script, it executes fine. If there is an error in the small script, I get no output at all, but the browser shows "done."...
37
by: miken32 | last post by:
In PHP, if a function returns an array it's fairly common to capture its return values like this: <?php list($foo, $bar, $baz) = some_function_that_return_an_array(); ?> In Javascript, would...
10
by: bobf | last post by:
I am using a program 'My Contact Table' which is a code generator program. It allows you to easily create a PHP/MySQL web application without writing any code. I am trying to create an additional...
9
akohistani
by: akohistani | last post by:
I am having Parse error problem with my newly purchased Php upload script I have uploaded the script and I get the error below Parse error: syntax error, unexpected $end in URL/functions.php on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.