Python / WLST Piping WLST Output
Hello,
i got an "small" deploy script and want to channel/pipe die Output of WLST. (not of the whole script!)
e.g
def adminServer(user, passwort, servername)
print 'LOGGING [DEBUG] --- connecting to admin server....'
connect(user, passwort, servername, adminServerName='AdminServer')
Now i dont want this output on the console:"
LOGGING [DEBUG] --- connecting to admin server....
Connecting to t3://abc-xy2:11001 with userid weblogic ...
Successfully connected to Admin Server "AdminServer" that belongs to domain "weblo
I want to channel the output of the WLST command in an variable and just want to print it if an Error occurs.
Does someone got an Solution for me, or is it impossible?
greets,
Jens
To avoid the outputs in Terminal you can use a '+' symbol in the Script.
You can use a Try, catch and Exception block. In Exception you can print your errors in Terminal.
Thanks,
Karthik
Similar Messages
-
WLST output/error redirection
Hi, I am practicing WLST commands. I want to redirect both output and error messages to a file instead of stdOut. So I am using redirect command with log file name and boolean value to disable stdout. if my WLST command is successful output is redirect to log file which is fine. But if command is not successful output is displayed on stdout even though I disabled it. error messages not redirected to file. what should i do to redirect error messages to file? below is the output of my commads for your reference. any suggessions will be appriciated.
wls:/offline>
wls:/offline> redirect('C:/oracle/Middleware/user_projects/wlst1_output.log','false')
wls:/offline> help('online')
wls:/offline> help('offline)
Traceback (innermost last):
(no code object) at line 0
File "<console>", line 2
SyntaxError: Lexical error at line 2, column 0. Encountered: <EOF> after : ""
wls:/offline>
wls:/offline>at org.python.core.PyTableCode.call(Unknown Source)
at org.python.core.PyTableCode.call(Unknown Source)
at org.python.core.PyTableCode.call(Unknown Source)
at org.python.core.PyFunction.__call__(Unknown Source)
at org.python.pycode._pyx1638.f$0(<console>:1)
at org.python.pycode._pyx1638.call_function(<console>)
at org.python.core.PyTableCode.call(Unknown Source)
at org.python.core.PyCode.call(Unknown Source)
at org.python.core.Py.runCode(Unknown Source)
at org.python.core.Py.exec(Unknown Source)
at org.python.util.PythonInterpreter.exec(Unknown Source)
at org.python.util.InteractiveInterpreter.runcode(Unknown Source)
at org.python.util.InteractiveInterpreter.runsource(Unknown Source)
at org.python.util.InteractiveInterpreter.runsource(Unknown Source)
at weblogic.management.scripting.WLST.main(WLST.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.WLST.main(WLST.java:29)
Caused by: weblogic.management.scripting.ScriptException: Error occured while pe
rforming configToScript : Exception occurred while walking the tree.
Use dumpStack() to view the full stacktrace
at weblogic.management.scripting.ExceptionHandler.handleException(Except
ionHandler.java:50)
at weblogic.management.scripting.WLSTUtils.throwWLSTException(WLSTUtils.
java:181)
at weblogic.management.scripting.ConfigToScript.walkTheTree(ConfigToScri
pt.java:555)
at weblogic.management.scripting.ConfigToScript.walkTheTree(ConfigToScri
pt.java:403)
at weblogic.management.scripting.ConfigToScript.convert(ConfigToScript.j
ava:202)
at weblogic.management.scripting.WLScriptContext.callc2s(WLScriptContext
.java:185)
... 30 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.management.scripting.ConfigToScript.walkTheTree(ConfigToScri
pt.java:435)
at weblogic.management.scripting.ConfigToScript.walkTheTree(ConfigToScri
pt.java:403)
at weblogic.management.scripting.ConfigToScript.convert(ConfigToScript.j
ava:201)
at weblogic.management.scripting.WLScriptContext.callc2s(WLScriptContext
.java:184)
... 30 more
Caused by: weblogic.management.ManagementRuntimeException: weblogic.descriptor.D
escriptorException: Unmarshaller failed
at weblogic.management.mbeans.custom.ConfigurationExtension.getExtension
Root(ConfigurationExtension.java:202)
at weblogic.management.mbeans.custom.WLDFSystemResource.getWLDFResource(
WLDFSystemResource.java:54)
at weblogic.management.configuration.WLDFSystemResourceMBeanImpl.getWLDF
Resource(WLDFSystemResourceMBeanImpl.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.management.scripting.ConfigToScript.walkTheTree(ConfigToScri
pt.java:435)
at weblogic.management.scripting.ConfigToScript.walkTheTree(ConfigToScri
pt.java:403)
at weblogic.management.scripting.ConfigToScript.convert(ConfigToScript.j
ava:202)
at weblogic.management.scripting.WLScriptContext.callc2s(WLScriptContext
.java:185)
... 30 more
Caused by: weblogic.descriptor.DescriptorException: Unmarshaller failed
at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(Mar
shallerFactory.java:161)
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDesc
riptorManager.java:323)
at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescript
orBeanFromReader(AbstractDescriptorLoader2.java:788)
at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescr
iptorBean(AbstractDescriptorLoader2.java:409)
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescrip
torBeanWithoutPlan(AbstractDescriptorLoader2.java:759)
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescrip
torBean(AbstractDescriptorLoader2.java:768)
at weblogic.management.mbeans.custom.WLDFSystemResource.loadDescriptor(W
LDFSystemResource.java:76)
at weblogic.management.mbeans.custom.ConfigurationExtension.getExtension
Root(ConfigurationExtension.java:178)
... 40 more
Caused by: com.bea.xml.XmlException: java.lang.RuntimeException: java.lang.NullP
ointerException
at com.bea.staxb.runtime.internal.util.ReflectionUtils.invokeMethod(Refl
ectionUtils.java:54)
at com.bea.staxb.runtime.internal.RuntimeBindingType$BeanRuntimeProperty
.setValue(RuntimeBindingType.java:539)
at com.bea.staxb.runtime.internal.MultiIntermediary.setValue(MultiInterm
ediary.java:81)
at com.bea.staxb.runtime.internal.ByNameRuntimeBindingType$ElementQNameP
roperty.fill(ByNameRuntimeBindingType.java:348)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.extractAndFillE
lementProp(LiteralUnmarshalResult.java:159)
at com.bea.staxb.runtime.internal.ByNameUnmarshaller.deserializeContents
(ByNameUnmarshaller.java:51)
at com.bea.staxb.runtime.internal.AttributeUnmarshaller.unmarshalIntoInt
ermediary(AttributeUnmarshaller.java:47)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.unmarshalElemen
tProperty(LiteralUnmarshalResult.java:184)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.extractAndFillE
lementProp(LiteralUnmarshalResult.java:156)
at com.bea.staxb.runtime.internal.ByNameUnmarshaller.deserializeContents
(ByNameUnmarshaller.java:51)
at com.bea.staxb.runtime.internal.AttributeUnmarshaller.unmarshalIntoInt
ermediary(AttributeUnmarshaller.java:47)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.unmarshalElemen
tProperty(LiteralUnmarshalResult.java:184)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.extractAndFillE
lementProp(LiteralUnmarshalResult.java:156)
at com.bea.staxb.runtime.internal.ByNameUnmarshaller.deserializeContents
(ByNameUnmarshaller.java:51)
at com.bea.staxb.runtime.internal.AttributeUnmarshaller.unmarshalIntoInt
ermediary(AttributeUnmarshaller.java:47)
at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalBindingType(U
nmarshalResult.java:199)
at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalDocument(Unma
rshalResult.java:169)
at com.bea.staxb.runtime.internal.UnmarshallerImpl.unmarshal(Unmarshalle
rImpl.java:65)
at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(Mar
shallerFactory.java:150)
... 47 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at weblogic.diagnostics.harvester.internal.BeanTreeHarvesterImpl$BeanTre
eHarvesterImplFactory.createBeanTreeHarvesterImpl(BeanTreeHarvesterImpl.java:32)
at weblogic.diagnostics.harvester.internal.BeanTreeHarvesterImpl$BeanTre
eHarvesterImplFactory.getInstance(BeanTreeHarvesterImpl.java:38)
at weblogic.diagnostics.harvester.internal.BeanTreeHarvesterImpl.getInst
ance(BeanTreeHarvesterImpl.java:44)
at weblogic.diagnostics.harvester.internal.Validators.isTypeHandled(Vali
dators.java:263)
at weblogic.diagnostics.harvester.internal.Validators.validateConfigured
Type(Validators.java:79)
at sun.reflect.GeneratedMethodAccessor435.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.diagnostics.harvester.Validators.validateConfiguredType(Vali
dators.java:61)
at weblogic.diagnostics.descriptor.WLDFHarvestedTypeBeanImpl.setName(WLD
FHarvestedTypeBeanImpl.java:108)
at sun.reflect.GeneratedMethodAccessor434.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.staxb.runtime.internal.util.ReflectionUtils.invokeMethod(Refl
ectionUtils.java:48)
at com.bea.staxb.runtime.internal.RuntimeBindingType$BeanRuntimeProperty
.setValue(RuntimeBindingType.java:539)
at com.bea.staxb.runtime.internal.MultiIntermediary.setValue(MultiInterm
ediary.java:82)
at com.bea.staxb.runtime.internal.ByNameRuntimeBindingType$ElementQNameP
roperty.fill(ByNameRuntimeBindingType.java:348)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.extractAndFillE
lementProp(LiteralUnmarshalResult.java:159)
at com.bea.staxb.runtime.internal.ByNameUnmarshaller.deserializeContents
(ByNameUnmarshaller.java:51)
at com.bea.staxb.runtime.internal.AttributeUnmarshaller.unmarshalIntoInt
ermediary(AttributeUnmarshaller.java:48)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.unmarshalElemen
tProperty(LiteralUnmarshalResult.java:184)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.extractAndFillE
lementProp(LiteralUnmarshalResult.java:156)
at com.bea.staxb.runtime.internal.ByNameUnmarshaller.deserializeContents
(ByNameUnmarshaller.java:51)
at com.bea.staxb.runtime.internal.AttributeUnmarshaller.unmarshalIntoInt
ermediary(AttributeUnmarshaller.java:48)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.unmarshalElemen
tProperty(LiteralUnmarshalResult.java:184)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.extractAndFillE
lementProp(LiteralUnmarshalResult.java:156)
at com.bea.staxb.runtime.internal.ByNameUnmarshaller.deserializeContents
(ByNameUnmarshaller.java:51)
at com.bea.staxb.runtime.internal.AttributeUnmarshaller.unmarshalIntoInt
ermediary(AttributeUnmarshaller.java:48)
... 51 more
Caused by: java.lang.NullPointerException
at weblogic.diagnostics.harvester.internal.BeanTreeRegistrationManager.i
nitKnownTypes(BeanTreeRegistrationManager.java:210)
at weblogic.diagnostics.harvester.internal.BeanTreeRegistrationManager.<
init>(BeanTreeRegistrationManager.java:64)
at weblogic.diagnostics.harvester.internal.BeanTreeHarvesterImpl.<init>(
BeanTreeHarvesterImpl.java:52)
at weblogic.diagnostics.harvester.internal.BeanTreeHarvesterImpl.<init>(
BeanTreeHarvesterImpl.java:20)
at weblogic.diagnostics.harvester.internal.BeanTreeHarvesterImpl$BeanTre
eHarvesterImplFactory.createBeanTreeHarvesterImpl(BeanTreeHarvesterImpl.java:30)
at weblogic.diagnostics.harvester.internal.BeanTreeHarvesterImpl$BeanTre
eHarvesterImplFactory.getInstance(BeanTreeHarvesterImpl.java:38)
at weblogic.diagnostics.harvester.internal.BeanTreeHarvesterImpl.getInst
ance(BeanTreeHarvesterImpl.java:44)
at weblogic.diagnostics.harvester.internal.Validators.isTypeHandled(Vali
dators.java:262)
at weblogic.diagnostics.harvester.internal.Validators.validateConfigured
Type(Validators.java:79)
at sun.reflect.GeneratedMethodAccessor435.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.diagnostics.harvester.Validators.validateConfiguredType(Vali
dators.java:61)
at weblogic.diagnostics.descriptor.WLDFHarvestedTypeBeanImpl.setName(WLD
FHarvestedTypeBeanImpl.java:108)
at sun.reflect.GeneratedMethodAccessor434.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.staxb.runtime.internal.util.ReflectionUtils.invokeMethod(Refl
ectionUtils.java:48)
at com.bea.staxb.runtime.internal.RuntimeBindingType$BeanRuntimeProperty
.setValue(RuntimeBindingType.java:539)
at com.bea.staxb.runtime.internal.MultiIntermediary.setValue(MultiInterm
ediary.java:81)
at com.bea.staxb.runtime.internal.ByNameRuntimeBindingType$ElementQNameP
roperty.fill(ByNameRuntimeBindingType.java:348)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.extractAndFillE
lementProp(LiteralUnmarshalResult.java:159)
at com.bea.staxb.runtime.internal.ByNameUnmarshaller.deserializeContents
(ByNameUnmarshaller.java:51)
at com.bea.staxb.runtime.internal.AttributeUnmarshaller.unmarshalIntoInt
ermediary(AttributeUnmarshaller.java:47)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.unmarshalElemen
tProperty(LiteralUnmarshalResult.java:184)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.extractAndFillE
lementProp(LiteralUnmarshalResult.java:156)
at com.bea.staxb.runtime.internal.ByNameUnmarshaller.deserializeContents
(ByNameUnmarshaller.java:51)
at com.bea.staxb.runtime.internal.AttributeUnmarshaller.unmarshalIntoInt
ermediary(AttributeUnmarshaller.java:47)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.unmarshalElemen
tProperty(LiteralUnmarshalResult.java:184)
at com.bea.staxb.runtime.internal.LiteralUnmarshalResult.extractAndFillE
lementProp(LiteralUnmarshalResult.java:156)
at com.bea.staxb.runtime.internal.ByNameUnmarshaller.deserializeContents
(ByNameUnmarshaller.java:51)
at com.bea.staxb.runtime.internal.AttributeUnmarshaller.unmarshalIntoInt
ermediary(AttributeUnmarshaller.java:47)
at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalBindingType(U
nmarshalResult.java:199)
at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalDocument(Unma
rshalResult.java:169)
at com.bea.staxb.runtime.internal.UnmarshallerImpl.unmarshal(Unmarshalle
rImpl.java:65)
at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(Mar
shallerFactory.java:150)
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDesc
riptorManager.java:323)
at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescript
orBeanFromReader(AbstractDescriptorLoader2.java:788)
at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescr
iptorBean(AbstractDescriptorLoader2.java:409)
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescrip
torBeanWithoutPlan(AbstractDescriptorLoader2.java:759)
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescrip
torBean(AbstractDescriptorLoader2.java:768)
at weblogic.management.mbeans.custom.WLDFSystemResource.loadDescriptor(W
LDFSystemResource.java:76)
at weblogic.management.mbeans.custom.ConfigurationExtension.getExtension
Root(ConfigurationExtension.java:178)
at weblogic.management.mbeans.custom.WLDFSystemResource.getWLDFResource(
WLDFSystemResource.java:54)
at weblogic.management.configuration.WLDFSystemResourceMBeanImpl.getWLDF
Resource(WLDFSystemResourceMBeanImpl.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.management.scripting.ConfigToScript.walkTheTree(ConfigToScri
pt.java:435)
at weblogic.management.scripting.ConfigToScript.walkTheTree(ConfigToScri
pt.java:403)
at weblogic.management.scripting.ConfigToScript.convert(ConfigToScript.j
ava:201)
at weblogic.management.scripting.WLScriptContext.callc2s(WLScriptContext
.java:184)
... 30 more
weblogic.management.scripting.ScriptException: Error occured while performing co
nfigToScript : Exception occurred while walking the tree. : Error occured while
performing configToScript : Exception occurred while walking the tree.
Use dumpStack() to view the full stacktrace
Use dumpStack() to view the full stacktrace
wls:/offline> -
WLST output in printable format
Hi All,
I need to mail the output of WLST script.
I am calling wlst script from a .sh file and tried below command:
eval '"${JAVA_HOME}/bin/java"' ${JVM_ARGS} weblogic.WLST 'JMSMonitoring.py' > output.txt
but this command populates output.txt with below output before actual output of the script:
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Connecting to t3://<host>:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'aia_domain'.
Warning: An insecure protocol was used to connect to the server. To ensure on-the-wire security, the SSL port or Admin port should be used instead.
I only need the actual output of the script i am running as the mail body.
Please suggest if it is possible.
Thanks in AdvancePrabhu
adding to above post
first fix -- No corresponding LOB data found
then follow the steps in below post for excel output
Excel output in EBS? -
Hi I am running WLS in script mode as
java weblogic.WLST script.py
Along with output of my print commands I get a lot of output of WLST commands like connecting to server, location change etc. How do I disable these outputs in script mode.
Thanks.Hi,
there are few thing that wecannot do for now (We can but it would be more complex to change thing) but we can make sure to remove print option with in .py file.
It will avoid few things.
But still if you want to remove those status echo which do while doing connecting server crating a services or shutdown server for all those operation I appreciate to raise ticket and check with support further.
Regards,
Kal -
Hi All,
I am wondering how to check which python and its version wlst uses in executing a script file? Can I specify which one to use?
Thanks a lot.Inside WLST interactive:
import sys
sys.version_info
This code prints the jython version use, which is equal to the Phyton version on which jython is based.
On WebLogic 9.2 the jython/python version is 2.1.0.
I think you cannot change it unless you try to override jython classes included in weblogic jars...
Bye
Mariano -
Python script named in output of ps -u user
Does anyone here know how I can have a Python script report it's name in the output of "ps -u user", instead of just showing up as "Python"?
Reason I'm asking is that I just found this nifty little menu program called pytmenu on the Ubuntu forums, and I want it to start in the center of my screen. Problem is, I'm using Evilwm, so I can do it either with switches passed to Evilwm or Devil's Pie, but I need to know the programs name to do it. Passing "Python" as the name will probably not get me the results I want.oh. also.. if you want to change the process name from within python..
http://davyd.livejournal.com/166352.html -
Can any one suggest if there is any method to pass variables from python (wlst script ) to Unix Shell Script?
Example.
in startWeblogic.sh we use timing script which is .py script, we want to get the varibales from python to again startWeblogic.sh
in simple from python to the shell Script the variables are needed to be passedHi Eden,
In one of the Thread *"Faisal Khan"* replied a way to read the data from properties file... So u can use that method like:
Syntax:
from java.io import FileInputStream
inputStream = FileInputStream("some file")
If u want to read from a properties file then... So u can put all the variables in a Separate properties file and then u can read it in your WLST script through *.sh file.......like below
<b><font color=maroon>
propInputStream = FileInputStream(propFile)
configProps = Properties()
configProps.load(propInputStream)
adminUrl = configProps.get("admin.url")
user = configProps.get("user")
password = configProps.get("password")
</font></b>
But i dont think that there is a Direct Way to Pass the Variable values from WLST to Shell Script.....because WLST runs on it's Own JVM. But u can do the following: U can try the following link: http://weblogic-wonders.com/weblogic/2010/04/22/using-wlst-ant-task-to-get-serverdetails/#comment-762
This link says that using redirect("/some/file.txt") WLST function u can redirect the output of WLST output to a separate file and then May be u can use Grep on that file to get the Values which u want to read in your Shell Script...later.
Thanks
Jay SenSharma
http://weblogic-wonders.com/weblogic (WebLogic Wonders Are Here) -
WLST start managed server throws error but the server was successf. started
Hello,
I have a funny problem.
We are already using long time the WLST feature to startup managed servers via WLST connected to the Admin Console.
Normally when we start a managed server it looks WLST output like this:
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Successfully connected to Admin Server 'xxx_admin' that belongs to domain 'xxx_domain'.
Starting server xxx_001 .................................................................................
Disconnect from Admin server
This was working without any errors when inside your nodemanager.properties file the following is set:
StartScriptEnabled=false
Unfortunately I'm now forced to use:
StartScriptEnabled=true
and specified a custom "+StartScriptName+" (startWebLogicCustomScript.sh) as well.
What happen now is the following. WLST starts the script set at "StartScriptName" and once this script is finished (The script do not generate errors and returns return code 0) I get an error:
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Successfully connected to Admin Server 'xxx_admin' that belongs to domain 'xxx_domain'.
Starting server xxx_001 .................................................................................
Exception while starting server 'xxx_001'
No stack trace available.
This Exception occurred at Thu Mar 03 01:01:40 CET 2011.
weblogic.management.scripting.ScriptException: Error occured while performing start : Server with name xxx_001 failed to be started
at weblogic.management.scripting.ExceptionHandler.handleException(ExceptionHandler.java:48)
at weblogic.management.scripting.LifeCycleHandler.startServer(LifeCycleHandler.java:502)
at weblogic.management.scripting.WLScriptContext.start(WLScriptContext.java:523)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
The funny thing now is that the managed server which WLST is given the error above is RUNNING so the everything is fine.
So in the Admin Console everything is shown running.
I don't would be normally worry about this since i can get around this with additional checks in my WLST script but what I'm worry about are the entries in the NodeManager log file which are generated (Especially the bold marked):
+<INFO> <xxx_domain> <xxx_001> <Starting WebLogic server with command line: <just removed>/domains/xxx_domain/startWebLogicCustomScript.sh >+
+<INFO> <xxx_domain> <xxx_001> <Working directory is '<just removed>/domains/xxx_domain'>+
+<INFO> <xxx_domain> <xxx_001> <Rotated server output log to "<just removed>/domains/xxx_domain/servers/xxx_001/logs/xxx_001.out00025">+
+<INFO> <xxx_domain> <xxx_001> <Server error log also redirected to server log>+
+<INFO> <xxx_domain> <xxx_001> <Server output log file is '<just removed>/domains/xxx_domain/servers/xxx_001/logs/xxx_001.out'>+
++<INFO> <xxx_domain> <xxx_001> <Server failed during startup so will not be restarted>++
+<WARNING> <Exception while starting server 'xxx_001'>+
java.io.IOException: Server failed to start up. See server output log for more details.
at weblogic.nodemanager.server.ServerManager.start(ServerManager.java:331)
at weblogic.nodemanager.server.Handler.handleStart(Handler.java:567)
at weblogic.nodemanager.server.Handler.handleCommand(Handler.java:118)
at weblogic.nodemanager.server.Handler.run(Handler.java:70)
at java.lang.Thread.run(Thread.java:662)
Checking the server output log everything looks ok.
Does anyone have an idea why WLST / NodeManager is trowing errors here and how to solve this problem ?
Does maybe my custom script needs to return a special return code ?
WLS version used is 10.3.3.0.
Thx a lot.Does nobody have an idea ?
-
How do we redirect WLST stdout ?
Hi,
How do we redirect or suppress the stdout messages displayed when weblogic.WLST is entered.
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Any help is appreciated.
-agrwls:/offline> help("redirect")
Description:
Redirects WLST output to the specified filename. In the event of
an error, the command returns a WLSTException.
Syntax:
redirect(outputFile, [toStdOut])
- outputFile = Name of the file to which you want to redirect WLST output. The filename can be absolute or relative to the directory
from which you enter the command.
- toStdOut = Optional. Boolean value specifying whether the output
should be sent to stdout. This argument defaults to true, indicating
that the output will be sent to stdout.
Example:
wls:/mydomain/serverConfig> redirect('./logs/wlst.log')
wls:/offline>
thanks,
-satya -
Hi All,
I find that with SQL 2012 and SQL 2014 I get the following types of WARNING: messages displayed when I import the sqlps module.
WARNING: The local computer does not have an active instance of Analysis Services.
WARNING: Could not obtain SQL Server Service information. An attempt to connect to WMI on 'Microsoft.WindowsAzure.Commands.SqlDatabase.Types.ps1xml' failed with the following error: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
I've tried adding -WarningAction SilentlyContinue and I've tried piping the output to null by adding | Out-Null but I still get this garbage that I don't care about on the servers I'm running these scripts on. Do any of you know how to suppress these
warnings?
Joe
Joe MoyleHi
These errors have nothing to do with the loading of the SQLPS CmdLets/Functions/etc...... They are because of a general failure when you try and locate the Azure modules and therefore this only occurs when you install the Azure PowerShell modules.... let
me explain
But before I do, a warning, DO NOT MODIFY THE FILES I MENTION!!!
When you run: Import-Module SQLPS
PowerShell loads up the Module Mainfest C:\Program Files (x86)\Microsoft SQL Server\120\Tools\PowerShell\Modules\SQLPS\SQLPS.PSD1
This references the script file SqlPsPostScript.PS1 in the same path..... here is where the problem lies.
This script has a step which is designed to import the SQLASCmdlets module and it is this step which is throwing the warnings. However, again it has nothing to do with the SQL module. The problem actually even happens if you just run: Get-Module -ListAvailable
Now this is where we get stuck as the Azure SQL module is a Binary Module (aka it loads .dlls). Best option is to live with the warnings, because if you suppress them and another module starts to give you warnings then you won't know something is going wrong.
And finally I just checked and there is a new Azure PowerShell SDK released on the 2nd October so it would be worth downloading that as this might be fixed.
P.S. I am going to blog about this and will update with a link when I do. -
Bash function/script to execute multiple commands on same output
Occasionally, I come across the need to pass the output of a single command to multiple others (without piping each to the next), so today, I wrote a [very] simple Bash script to accomplish the task. Piping the output of a command to `tree' is much like piping it to `tee', except `tree' allows you to execute multiple commands on the same output, rather than only writing to log files:
#!/bin/bash
# tree -- pipes the output of one command to >= 1 other
# Usage: command | tree 'command 1' 'command 2'
doc=$( cat - )
for arg in "$@"; do
bash -c "${arg}" <<EOF
${doc}
EOF
done
An example of its usage:
$ echo -e "1 2 3\n4 5 6" | tree 'grep 1' 'grep 4' "grep 1 | tee grep.log | awk '{print \$2}'"
1 2 3
4 5 6
2
$ cat grep.log
1 2 3
Though not elaborate, the script gets the job done.
Last edited by deltaecho (2009-03-10 20:34:01)Xyne wrote:
You could always call it "the Ukrainian Pipe"
(if you can't laugh at this, you either need to loosen up or make a point to follow (annual) current events)
That was a good one -
Hello,
With an automated shell script I wish to create an encrypted disk image that requires sudo access and encryption password.
So I tried with the following command lines but it stills ask me to enter an administrator password.
Thanks in advance for helping
#!/bin/bash
MY_PASS="xyz"
echo $MY_PASS | sudo -S printf $MY_PASS | hdiutil create -encryption -stdinpass -srcfolder "/myfolder" -volname "name" "/destination/name.dmg"Why are you piping the output from the sudo command to hdiutil? Maybe you need to do something like this:
#!/bin/bash
MY_PASS="xyz"
echo $MY_PASS | sudo -S hdiutil create -encryption -stdinpass
-srcfolder "/myfolder" -volname "name" "/destination/name.dmg"
OR
#!/bin/bash
MY_PASS="xyz"
echo $MY_PASS | sudo -vS # Updates the sudo timestamp
sudo hdiutil create -encryption -stdinpass -srcfolder "/myfolder"
-volname "name" "/destination/name.dmg" -
Acroread -toPostScript output not printable
Solaris 10 SPARC, Acroread 8.1.7
I am trying to print PDF files from the command line by using the -toPostScript flag and then piping the output to lpr (or lp). I have this
cat filename.pdf | acroread -toPostScript | lpr -Pprinter
and all I get is the banner page. What seems to be happening is that acroread -toPostScript does indeed generate the PostScript, but it just isn't printable on our printers (Lexmark Optra T644). If I do this
cat filename.pdf | acroread -toPostScript > filename.ps
I can view the filename.ps in ghostview just fine, but when I try to print it nothing comes out. Interestingly, if I print it to another printer (HP LaserJet P2015dn) it prints fine. So, it's as if something is amiss with the PostScript code that the Optra T644 doesn't like.
I've tried various different flags ( -level2, -level3, -optimizeForSpeed, -shrink) to try to cause the PostScript output to be somehow different, but I still can't print it.
Is there something that I am missing?
Thanks!
Mike V.Hello Andrew,<br /><br />Unfortunately piping of PS content is not supported in Acrobat 7. When you use the -toPostScript option alongwith a PDF filename, a PS of the same name would be generated (as was observed by you).<br />Also, since acroread expects the entire file to be available to it before it performs any operations on it, you wouldn't be able to have it read it from the input stream (cat <filename> | acroread ...)<br /><br />However, Acrobat 8.1 supports the first scenario. It allows you to dump the PS content to stdout which can then be piped. (for instance - acroread -toPostScript <PDF filename> - | lp ). <br /><br />Hope that would help solve your problem.<br /><br />Sincerely,<br />Neha
-
Running python script with system arguments from applescript
Hi,
I am trying to run a python code from within applescript. A string should be passed as an argument to the python script, i.e. from the terminal, I would do the following
cd /Users/thatsme/Library/Scripts/myfolder
python my_python_file.py abcdefg
There are two ways I figure I could do this in applescript. "abcdefg" are contained in the variable strNote
a) directly:
do shell script "cd /Users/thatsme/Library/Scripts/myfolder; python my_python_file.py " & strNote
b) calling Terminal
tell application "Terminal"
activate
do script "cd /Users/claushaslauer/Library/Scripts/OO_latex; python my_python_file.py " & strNote
end tell
I would prefer option a) as I don't really want to have Terminal windows popping up. The strange thing is, that I see in the applescript results window the result of the print statements in the python script, but no output is generated (the python script contains a few os.system() commands.
Option b) does what it is supposed to be doing, however, applescript does not wait until the script is finished running.
Why does option a) nor work, and what do I need to change to make it work?Thank you guys for your help, this is really weird.
Here is my full applescript
set strNoteQ to "1+1=2"
(* for whatever reason, this does not work *)
do shell script "cd /Users/claushaslauer/Library/Scripts/OO_latex; python create_latex_pdf.py " & strNoteQ
Below is my python skript.
When I call it as
python create_latex_pdf.py 1+1=2
it creates a wonderful pdf.
With the applescript above, it prints the print statements, it also generates the latex file temp.tex -- correctly, so I assume the string in this example is ok.
However, it does not execute the latex related commands (the three os.system calls)
Is it not a good idea / not possible to execute os.system in a python script that is called from applescript? <sorry if I had brought all the attention to the string issue>
here is the python script:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import datetime
import time
def main():
str_latex_note = sys.argv[1]
print "%s" % str_latex_note
preamble = """\documentclass{article}
\usepackage{amsmath,amssymb}
\pagestyle{empty}
\\begin{document}
{\huge
%s
\end{document}"""% (str_latex_note)
## write latex file
cur_path = r'/Users/mypath/Library/Scripts/OO_latex'
cur_file = "temp.tex"
fobj = open(os.path.join(cur_path, cur_file), 'w')
fobj.writelines(preamble)
fobj.close()
## process latex file
print cur_path
os.chdir(cur_path)
cmd = 'latex temp.tex'
print cmd
print "running latex"
os.system(cmd)
cmd2 = 'dvips -E -f -X 1200 -Y 1200 temp.dvi > temp.ps'
print "running dvips"
os.system(cmd2)
cmd3 = 'epstopdf temp.ps'
print "running epstopdf"
os.system(cmd3)
print "done!"
if __name__ == '__main__':
main() -
Bash: command not found after piping
Hi,
I'm trying something quite commonly found in an Unix environment, namely piping the output of one command into the input of a subsequent one, eg.
bash$ ps ax | grep -i bash
But unfortunately I'm receiving--and now comes the most curious part--most of the times (not always!!) an error message
bash: grep: command not found
When calling grep directly
bash$ grep
the resulting output is
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
"which"-ing the commands
bash$ which bash ps grep
results in
/bin/bash
/bin/ps
/usr/bin/grep
Cheers,
MMHeinGood, you tried a different shell. sh and bash are essentially the same executable on Mac OS X.
Did you try a new user account? What were those results?
Have you tried installing your own bash? Either build from sources, or use something like MacPorts.org to install one already configured for Mac OS X.
You also have ksh and zsh if they happen to rock your boat (see /etc/shells for a list of installed shells).
I think both Linc an dI agree that we have never seen this situation before either, which is why we suspect something has become corrupt. The "Nuke and Pave" approach tends to eliminate that possibility. But since you have lots of Unix experience (even though you missed a few Unix flavors ), and want to find the root cause, then you need to start doing tests that eliminate components.
The shells on my Mac OS X 10.7.2 Lion system have the following chksum's
cksum /bin/*sh
188949626 1371648 /bin/bash
1672788767 772992 /bin/csh
4164734636 2180736 /bin/ksh
1711289041 1371712 /bin/sh
1672788767 772992 /bin/tcsh
2366092939 1103984 /bin/zsh
I would expect yours to be identical. But that does not take into account any libraries used. And if you have the same values, then you need to look at something else (again, a new account can go a long way to eliminating things in your environment, or pointing to a system component).
Maybe you are looking for
-
ITunes opens to "Albums" rather than "Songs"
Hello to all. I am new to this community. I recently updated iTunes on my Macbook Pro. It now always opens up to "Albums" rather than to "Songs" and I can't find a way to change that setting so that it opens to the ""Songs" list. Is there a way t
-
Keeping track of oracle E-Business Suite Customization(Personalization/Cus)
Hi, I am preparing a document to keep track of all the customizations done an oracle E-Business Suite. This will be useful for the team during upgrade to higher versions to track down the customization. Kindly let me know what are the things we shoul
-
PC; When I launch Adobe Photoshop CC, that I bought, the app "locks" down. It disables my power to create new files, etc. I have contacted multiple times, and all technicians failed to fix it. Any ideas? P.S. Happy Holidays.
-
Extractors for Warehouse Management
Is anyone aware if there are any extractors for Warehouse Management. I am working on a Retail project? Thanks
-
I want to remove whats on this laptop's iTunes, how?
My hubs let me have his old MacBook Pro so I want to get rid of his stuff on iTunes and put my awesome heavy metal noise on it, where do I start? I had everything on my MacMini but the HDD had a heart attack and died lol...i just wanna get my stuff h