Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

how to add character '&' in system property value

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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=
 
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
reply
    Bookmark Topic Watch Topic
  • New Topic