Results 1 to 3 of 3

Thread: Add Java system property

  1. #1
    Join Date
    Sep 2009
    Posts
    21

    Default Add Java system property

    Hi,
    I need to have an additional Java system property property set as part of the SpringDM server startup. The easy way to do this is to go into startup scripts and add it there. But I guess this is not the most graceful way to do it and also I need to do it programatically, so it gets a little tricky. I tried to look through the config files and through the startup scripts, but it does not look like I can configure this anywhere else.

    Am I missing a better way to accomplish what I need?

    Thanks

  2. #2
    Join Date
    Dec 2005
    Location
    Philadelphia, PA, USA
    Posts
    228

    Default

    What version of dm-server you are using?

    If v2.0 - you can easily do this by creating a setevn.sh/bat script in the bin directory and add your properties there

    Code:
    # *ix type os system
    JAVA_OPTS="$JAVA_OPTS \
    	-Xmx512m \
    	-XX:PermSize=128m \
    	-Dbundles.configuration.location=$KERNEL_HOME/config/propsloader/ \
    	-Dspring.security.strategy=MODE_INHERITABLETHREADLOCAL \
    	-Dsolr.solr.home=$KERNEL_HOME/solr/"
    dmk.sh/bat picks up JAVA_OPTS and passes them to the java process.

    If you need to set something programmatically - your code will need to call
    System.setProperty(key, val); somewhere.
    Thanks
    Dmitry

  3. #3
    Join Date
    Sep 2009
    Posts
    21

    Default

    Thanks. At this point we are still on 1.x. Once we move to 2.0 I will take advantage of the approach you have suggested, it does look exactly like what I need.

    Unfortunately I cannot set the property in the code since I need it at startup time.

    Thanks again for the response.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •