Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -Dmy.property=%USERPROFILE%someDirsomeJar.jar
- <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason: [Management:141266]Parsing failure in config.xml: java.lang
- .IllegalArgumentException: Arguments may not contain '"'.>
- customServerList="server1,server2" #this serverList should be taken as input
- isCurrServerCustom=$(echo ${customServerList} | tr ',' 'n' | grep ${SERVER_NAME} | wc -l)
- if [ $isCurrServerCustom -gt 0 ]; then
- # add customJavaArg
- JAVA_OPTIONS="-Dmy.property=${USERPROFILE}/someDir/someJar.jar"
- fi
- import os
- from java.io import File
- from java.io import FileInputStream
- # extract properties from properties file.
- print 'Loading input properties...'
- propsFile = sys.argv[1]
- propInputStream = FileInputStream(propsFile)
- configProps = Properties()
- configProps.load(propInputStream)
- domainDir = configProps.get("domainDir")
- # serverList in properties file should be comma seperated
- serverList = configProps.get("serverList")
- # The current machine's logical name as mentioned while creating the domain has to be given. Basically the machine name on which NM for current host is configured on.
- # This param may not be required as an input if the machine name is configured as same as the hostname , in which case , socket module can be imported and socket.getHostName can be used.
- currMachineName = configProps.get("machineName")
- jarDir = os.environ("USERPROFILE")
- argToAdd = '-Dmy.property=' + jarDir + File.separator + 'someDir' + File.separator + 'someJar.jar'
- readDomain(domainDir)
- for srvr in serverList.split(",") :
- cd('/Server/' + srvr)
- listenAddr = get('ListenAddress')
- if listenAddr != currMachineName :
- # Only change current host's servers
- continue
- cd('/Server/' + srvr + '/ServerStart/' + srvr)
- argsOld = get('Arguments')
- if argsOld is not None :
- set('Arguments', argsOld + ' ' + argToAdd)
- else:
- set('Arguments', argToAdd)
- updateDomain()
- closeDomain()
- # now restart all affected servers (i.e serverList)
- # one way is to connect to adminserver and shutdown them and then start again
Add Comment
Please, Sign In to add comment