Announcement Announcement Module
Collapse
No announcement yet.
Add Java system property Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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.

      Comment

      Working...
      X