Guest User

Untitled

a guest
Jan 19th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. -Dmy.property=%USERPROFILE%someDirsomeJar.jar
  2.  
  3. <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason: [Management:141266]Parsing failure in config.xml: java.lang
  4. .IllegalArgumentException: Arguments may not contain '"'.>
  5.  
  6. customServerList="server1,server2" #this serverList should be taken as input
  7. isCurrServerCustom=$(echo ${customServerList} | tr ',' 'n' | grep ${SERVER_NAME} | wc -l)
  8. if [ $isCurrServerCustom -gt 0 ]; then
  9. # add customJavaArg
  10. JAVA_OPTIONS="-Dmy.property=${USERPROFILE}/someDir/someJar.jar"
  11. fi
  12.  
  13. import os
  14. from java.io import File
  15. from java.io import FileInputStream
  16.  
  17. # extract properties from properties file.
  18. print 'Loading input properties...'
  19.  
  20. propsFile = sys.argv[1]
  21. propInputStream = FileInputStream(propsFile)
  22. configProps = Properties()
  23. configProps.load(propInputStream)
  24. domainDir = configProps.get("domainDir")
  25.  
  26. # serverList in properties file should be comma seperated
  27. serverList = configProps.get("serverList")
  28.  
  29. # 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.
  30. # 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.
  31. currMachineName = configProps.get("machineName")
  32. jarDir = os.environ("USERPROFILE")
  33. argToAdd = '-Dmy.property=' + jarDir + File.separator + 'someDir' + File.separator + 'someJar.jar'
  34. readDomain(domainDir)
  35. for srvr in serverList.split(",") :
  36. cd('/Server/' + srvr)
  37. listenAddr = get('ListenAddress')
  38. if listenAddr != currMachineName :
  39. # Only change current host's servers
  40. continue
  41. cd('/Server/' + srvr + '/ServerStart/' + srvr)
  42. argsOld = get('Arguments')
  43. if argsOld is not None :
  44. set('Arguments', argsOld + ' ' + argToAdd)
  45. else:
  46. set('Arguments', argToAdd)
  47. updateDomain()
  48. closeDomain()
  49. # now restart all affected servers (i.e serverList)
  50. # one way is to connect to adminserver and shutdown them and then start again
Add Comment
Please, Sign In to add comment