Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to add character '&' in system property value

 
ya ji
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 446
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 446
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of WebLogic and OS ? Can you paste the exact command line option ?
 
ya ji
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 446
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you try to use following lines instead of one SET command you have in the batch file ?

 
ya ji
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic