aspose file tools*
The moose likes BEA/Weblogic and the fly likes how to add character '&' in system property value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "how to add character Watch "how to add character New topic
Author

how to add character '&' in system property value

ya ji
Ranch Hand

Joined: Jul 14, 2008
Posts: 40
I set following system property in weblogic setDomainEnv.cmd, the part after '&' is missed, do you know how to modify it to set '&' character in value?

-Dportal.url=https://abc.com/cp?tab=CTab&url=
or
-Dportal.url=https://abc.com/cp?tab=CTab&url=



I got below result by System.getProperty("portal.url"):

https://abc.com/cp?tab=CTab

expected result is : https://abc.com/cp?tab=CTab&url=
Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 443
Just wrap your -D property with double quotes. It should work under WebLogic.

-Dportal.url="https://abc.com/cp?tab=CTab&url="
ya ji
Ranch Hand

Joined: Jul 14, 2008
Posts: 40
Hi Deepak,

I followed your way, but I can't start weblogic now, got error: "=CTab was unexpected at this time."

Do you know how to resolve it?

Deepak Pant wrote:Just wrap your -D property with double quotes. It should work under WebLogic.

-Dportal.url="https://abc.com/cp?tab=CTab&url="
Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 443
What version of WebLogic and OS ? Can you paste the exact command line option ?
ya ji
Ranch Hand

Joined: Jul 14, 2008
Posts: 40
setting in my setDomainEnv.cmd is:

set WL_HOME=C:\Oracle\Middleware\wlserver_10.3
for %%i in ("%WL_HOME%") do set WL_HOME=%%~fsi

set BEA_JAVA_HOME=

set USER_MEM_ARGS=-Xmx1024m -XX:PermSize=256m -Dlogback.configurationFile=C:\Oracle\Middleware\user_projects\domains\o_domain\user_conf\logback.xml -Dportal.url="https://aaa.bbb.com/csp?tab\=CTab&url\="

set SUN_JAVA_HOME=C:\Program Files\Java\jdk1.6.0_07


I called command and got message as below:
C:\Documents and Settings\Me>C:\Oracle\Middleware\user_projects\domains\o_domain\startWebLogic.cmd
=CTab was unexpected at this time.
Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 443
can you try to use following lines instead of one SET command you have in the batch file ?

ya ji
Ranch Hand

Joined: Jul 14, 2008
Posts: 40
Thanks a lot Deepak, it worked last Friday, but today, when I start weblogic, the system property is not set, I don't know why.

I set it in startWebLogic.cmd, like below(green):

call "%DOMAIN_HOME%\bin\setDomainEnv.cmd" %*

set O_PROP=-Dportal.url="https://aaa.bbb.com/csp?tab=CTab&url="
set USER_MEM_ARGS=%O_PROP%


set SAVE_JAVA_OPTIONS=%JAVA_OPTIONS%

Do you have any idea?
 
wood burning stoves
 
subject: how to add character '&' in system property value
 
Similar Threads
Jboss SSL
Help required on Stored Procedure
Java property files best practices
A good way to send out a bulk of emails ?
Appending Dynamic value to src attribute of the html:img tag