This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes Retrieve WL command-line (-Dname=value) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Retrieve WL command-line (-Dname=value)" Watch "Retrieve WL command-line (-Dname=value)" New topic

Retrieve WL command-line (-Dname=value)

David W Brown

Joined: Feb 13, 2008
Posts: 12
Hello BEA/WL gurus and users, I have the dubious task of including a command-line argument to the startWeblogic.(cmd|sh) script such that at run-time I can retrived the value of name from a servlet deployed as a .war on the same WL instance.

Please advise, David.

Yet some, not wise, go to the other side of the globe, to barbarous and unhealthy regions, and devote ten or twenty years, in that they may live,-that is, keep comfortably warm,- and die in New England at last. Henry David Thoreau - Walden - 1845
Joe Ess

Joined: Oct 29, 2001
Posts: 8836

-D sets a system property. One retrieves a system property with the aptly named System.getProperty method.

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
David W Brown

Joined: Feb 13, 2008
Posts: 12
Hello Joe, thanks for the reply. I tried: -Dtempdir=TEMP as follows:

startWeblogic.cmd -Dtempdir=TEMP

This is the exception I get:

JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX ermSize=48m -XX:MaxPermSize=128m
WLS Start Mode=Development
rogram Files\Windows Resource Kits\Tools\;C:\Program Files\Subversion\bin;C:\java\bin;C:\Documents and Settings\dwbrown\My Documents\dev\java\apache-a
nt-1.7.0\bin;C:\Program Files\CVSNT\;C:\Documents and Settings\dwbrown\My Documents\dev\java\apache-maven-2.0.9\bin;C:\Program Files\SSH Communication
s Security\SSH Secure Shell;C:\Documents and Settings\dwbrown\My Documents\dev\java\apache-ant-1.7.0\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Sys
tem32\Wbem;C:\Program Files\Common Files\OTG;C:\Program Files\Support Tools\;C:\WINDOWS\system32\nls;C:\WINDOWS\system32\nls\ENGLISH;C:\Program Files\
Xythos\Xythos Enterprise Document Manager Evaluation\pgsql\bin;C:\Program Files\Xythos\Xythos Enterprise Document Manager Evaluation\pgsql\lib;C:\Prog
ram Files\QuickTime\QTSystem\;C:\java\bin;C:\Documents and Settings\dwbrown\My Documents\dev\java\apache-ant-1.7.0\bin;C:\Program Files\CVSNT\;C:\Docu
ments and Settings\dwbrown\My Documents\dev\java\apache-maven-2.0.9\bin;C:\Program Files\SSH Communications Security\SSH Secure Shell;C:\Documents and
Settings\dwbrown\My Documents\dev\java\apache-ant-1.7.0\bin;Y:.;Z:.;;C:\bea\WEBLOG~1\server\native\win\32\oci920_8
* To start WebLogic Server, use a username and *
* password assigned to an admin-level user. For *
* server administration, use the WebLogic Server *
* console at http:\\hostname ort\console *
starting weblogic with Java version:
java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)
Starting WLS with line:
C:\java\bin\java -client -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX ermSize=48m -XX:MaxPermSize=128m -Xverify:none -da -Dplatform.home=C:\b
ea\WEBLOG~1 -Dwls.home=C:\bea\WEBLOG~1\server -Dwli.home=C:\bea\WEBLOG~1\integration -Dwlw.iterativeDev= -Dwlw.t
estConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=C:\bea\patch_weblogic923\profiles\default\sysext_manifest_classpath -Dweblogic.Name=fcservic
ing92-online-adminServer\bea\WEBLOG~1\server\lib\weblogic.policy -Dtempdir TEMP weblogic.Server
Exception in thread "main" java.lang.NoClassDefFoundError: TEMP
Joe Ess

Joined: Oct 29, 2001
Posts: 8836

It looks like either you forgot the equals sign between -Dtempdir and TEMP or the startup scripts dropped it.
[ October 21, 2008: Message edited by: Joe Ess ]
subject: Retrieve WL command-line (-Dname=value)
Similar Threads
JNI Problem
My web based admin console froze -- how to restart?
How to get this directory into my classpath?
Passed WL7.0 Server Cert..
log4j not working in Weblogic 9.2