wlst error
650156Feb 16 2009 — edited Mar 12 2009hi i wrote the wlst code to autodeploy alsb project into production environment... when i compile this code i am getting the following eror...
C:\bea\user_projects\domains\Local_Dev>java weblogic.WLST basic.py
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 "C:\bea\user_projects\domains\Local_Dev\basic.py", line 58
SyntaxError: invalid syntax
The wlst code is as follows :
from com.bea.wli.sb.management.configuration import SessionManagementMBean
from com.bea.wli.sb.management.configuration import ALSBConfigurationMBean
from java.io import File
from java.util import List
from com.bea.wli.config import Ref
from com.bea.wli.config import TypeIds
from java.io import FileInputStream
from java.io import FileOutputStream
from java.util import ArrayList
from java.util import Collections
from com.bea.wli.sb.util import EnvValueTypes
from com.bea.wli.config.env import EnvValueQuery;
from com.bea.wli.config.customization import Customization
from com.bea.wli.config.customization import FindAndReplaceCustomization
import sys
try:
def connectToServer():
connect("weblogic", "weblogic", "t3://localhost:7001")
domainRuntime()
def importConfig(jarfilename):
infile = File(jarfilename)
infile = infile.getAbsoluteFile()# enables server to find the file
# find the deployment mbean
mbean = findService("Deployment","com.bea.wli.management.DeploymentMBean")
# all changes to Service Bus configuration must be done in a session
session = mbean.openImportSession()# import the whole jar file into the session.
mbean.importIntoSession(session, infile)
# typically you will change certain values that are environment dependent
# here we are changing "localhost:7001" to "productionserver:7001"
mbean.findAndReplaceEnvValues(session, TypeIds.URI_ENV_VALUE_TYPE,"localhost:7001", "productionserver:7001")
# finally commit the session. The changes will be submitted to the
# core state and the session will be destroyed
mbean.commitImportSession(session)
# exports all resources in
#def exportConfig(jms_sbconfig.jar, projectname, exportDependencies):
outfile = File(jarfilename)
outfile = outfile.getAbsoluteFile() # enables server to find the file
# find the deployment mbean
mbean = findService("Deployment","com.bea.wli.management.DeploymentMBean")
# export all resources in the given project. If exportDependencies
# is true, any other resources that these resources depend on will
# also be exported. If false, only the resources in the given project
# will be exported.
mbean.export(outfile, [projectname], [], exportDependencies)
# call the defined functions here.
try:
# connect to running server
connectToServer()
# import configuration
importConfig(sys.argv[1])
# export all resources in the default project and their dependencies
#exportConfig("temp.jar", "default", true)
except:
print ("Unexpected error: ", sys.exc_info()[0])
dumpStack()
raise RuntimeError(RuntimeError)
Can anybody tell me ..where the problem is
Thanks in advence: