Announcement Announcement Module
Collapse
No announcement yet.
How to set a system property? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to set a system property?

    I am trying to set a system property on TC server 2.2.1

    I tried to update the setenv.bat file in the bin directory of my instance but it didn't worked. The documentation is not very clear on that subject. I mainly use the "run" goal (i.e. run tc server as a foreground process).

    I am using the developer edition (without STS)

    Thanks
    S.

  • #2
    If you start tc Server on Windows with run (or start), it'll run using the Java Service Wrapper. This means that VM configuration, including system properties, is defined in the wrapper.conf file rather than setenv.bat. System properties are set using wrapper.java.additional.n.

    Comment


    • #3
      Okay thanks for the response. This is eventually what I was about to try. Is there any other way to start TC server so that I can pass arguments more easily (I don't need to windows service stuff yet)

      If the setEnv.bat is not used, can you tell me why it's there?

      Thanks!

      Comment


      • #4
        You can start tc Server using batch, i.e. tcruntime-ctl.bat instance-name batch. This'll start it as a foreground process without using the Java Service Wrapper. You can then use setenv.bat for its JVM configuration.

        Comment


        • #5
          for the record:

          If you want to use the run goal: tcruntime-ctl.bat run just edit your $TC_SERVER$/conf/wrapper.conf and add extra system property to the wrapper.java.additional.XX (please make sure to follow the numbers. At the time of writing the latest value is 13 so you should add something like this

          wrapper.java.additional.14="-DmySystemKey=myValue"

          You can also patch your setenv.bat but in that case you must run the following command

          tcruntime-ctl.bat batch

          Thanks for the help !

          Comment


          • #6
            Not as advertised

            This doesn't seem to work as advertised.

            --- wrapper.conf ---
            wrapper.java.additional.10="-Djavax.net.ssl.keyStore=xxxxxx"
            wrapper.java.additional.11="-Djavax.net.ssl.keyStorePassword=xxxxx"


            --- in my app ---
            System.out.println("keyStore=" + System.getProperty("javax.net.ssl.keyStore"));
            System.out.println("keyStorePassword=" + System.getProperty("javax.net.ssl.keyStorePassword "));


            --- console output ---

            keyStore=null
            keyStorePassword=null

            Comment


            • #7
              Sorry, probably worthwhile to mention that this is using STS 2.3.2 and tcServer 6.0.20. I'd like to try upgrading, but a mix of plugins that we use makes that prohibitive.

              Comment


              • #8
                It all depends how STS starts tc server. Try to run it on the command line (with the "run" option)

                Comment


                • #9
                  Originally posted by ShagVT View Post
                  Sorry, probably worthwhile to mention that this is using STS 2.3.2 and tcServer 6.0.20. I'd like to try upgrading, but a mix of plugins that we use makes that prohibitive.
                  STS doesn't use the service wrapper to launch the instance. Instead, you should add the system property to the launch configuration for the server within STS.

                  Comment

                  Working...
                  X