SSL Configuration in Latest version of SCM-Sever

123 views
Skip to first unread message

Sai Raghavendar

unread,
Apr 20, 2020, 4:38:40 PM4/20/20
to scmmanager
I am getting Caused by: java.lang.reflect.InvocationTargetException with below snippet when trying to start the scm-server.

=====
<Call id="sslConnector" name="addConnector">
  <Arg>
    <New class="org.eclipse.jetty.server.ServerConnector">
      <Arg name="server"><Ref refid="Server" /></Arg>
        <Arg name="factories">
          <Array type="org.eclipse.jetty.server.ConnectionFactory">
            <Item>
            <New id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
  <Set name="KeyStorePath"><Property name="jetty.home" default="." />/conf/keystore.jks</Set>
  <Set name="KeyStorePassword">xxxxxxx</Set>
  <Set name="KeyManagerPassword">xxxxxxx</Set>
  <Set name="TrustStorePath"><Property name="jetty.home" default="." />/conf/keystore.jks</Set>
  <Set name="TrustStorePassword">xxxxxxx</Set>
</New>
            </Item>
            <Item>
              <New class="org.eclipse.jetty.server.HttpConnectionFactory">
                <Arg name="config"><Ref refid="tlsHttpConfig"/></Arg>
              </New>
            </Item>
          </Array>
        </Arg>
        <Set name="host"><Property name="jetty.host" /></Set>
        <Set name="port"><Property name="jetty.ssl.port" default="8181" /></Set>
        <Set name="idleTimeout">30000</Set>
      </New>
  </Arg>
</Call>

====
Could you suggests  what is the worng or help to resolve the issue .

Rene Pfeuffer

unread,
Apr 21, 2020, 2:15:32 AM4/21/20
to scmma...@googlegroups.com
Hello Sai,

an InvocationTargetException is just a wrapper around the actual error, so this could be anything. Can you post the complete stack trace? There should be lines saying `caused by` (maybe multiple times), that should give more information.

Regards

René

--
You received this message because you are subscribed to the Google Groups "scmmanager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scmmanager+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scmmanager/9a17e425-c814-4fc8-bf7d-f2ac1476762a%40googlegroups.com.


--

Best Regards 

René Pfeuffer


// Cloudogu GmbH 
// Brabandtstr. 9-10 | 38100 Braunschweig - Germany

// Phone:+49. 531. 2 35 28-63
// Fax:+49. 531. 2 35 28-19
// Web:cloudogu.com

// Managing Director: T. Friedrich, T. Grosser, T. Paliga 
// Register Court: Braunschweig | Commercial Register Braunschweig HRB 204974

---------------------------------------------------------------------- 
This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you must not copy this message or attachment or disclose the contents to any other person. If you have received this transmission in error, please notify the sender immediately and delete the message and any attachment from your system. 
----------------------------------------------------------------------

Sai Raghavendar

unread,
Apr 21, 2020, 5:59:28 AM4/21/20
to scmmanager
Thank you for the reply and pls find the complete log trace while startup

2020-04-21 05:57:56.685:INFO::main: Logging initialized @212ms to org.eclipse.jetty.util.log.StdErrLog
2020-04-21 05:57:56.927:WARN:oejx.XmlConfiguration:main: Deprecated constructor public org.eclipse.jetty.util.ssl.SslContextFactory() in file:///opt/scm-server/conf/server-config.xml
2020-04-21 05:57:56.933:WARN:oejx.XmlConfiguration:main: Config error at <Call id="sslConnector" name="addConnector"><Arg>|    <New class="org.eclipse.jetty.server.ServerConnector"><Arg name="server"><Ref refid="Server"/></Arg><Arg name="factories">|          <Array type="org.eclipse.jetty.server.ConnectionFactory"><Item>|            <New id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory"><Set name="KeyStorePath"><Property name="jetty.home" default="."/>/conf/keystore.jks</Set><Set name="KeyStorePassword">importkey</Set><Set name="KeyManagerPassword">importkey</Set><Set name="TrustStorePath"><Property name="jetty.home" default="."/>/conf/keystore.jks</Set><Set name="TrustStorePassword">importkey</Set></New>|            </Item><Item>|              <New class="org.eclipse.jetty.server.HttpConnectionFactory"><Arg name="config"><Ref refid="tlsHttpConfig"/></Arg></New>|            </Item></Array>|        </Arg><Set name="host"><Property name="jetty.host"/></Set><Set name="port"><Property name="jetty.ssl.port" default="8181"/></Set><Set name="idleTimeout">30000</Set></New>|  </Arg></Call> java.lang.reflect.InvocationTargetException in file:///opt/scm-server/conf/server-config.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: sonia.scm.server.ScmServerException: error during server configuration
        at sonia.scm.server.ScmServer.<init>(ScmServer.java:74)
        at sonia.scm.server.ScmServerDaemon.<clinit>(ScmServerDaemon.java:41)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.invokeConstructor(XmlConfiguration.java:768)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.construct(XmlConfiguration.java:1055)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:1027)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1556)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:1457)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newArray(XmlConfiguration.java:1126)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1560)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:1457)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.access$700(XmlConfiguration.java:414)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration$Args.<init>(XmlConfiguration.java:1715)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration$Args.<init>(XmlConfiguration.java:1702)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:1027)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1556)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:1457)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.access$700(XmlConfiguration.java:414)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration$Args.<init>(XmlConfiguration.java:1715)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration$Args.<init>(XmlConfiguration.java:1702)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.call(XmlConfiguration.java:958)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:531)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:445)
        at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:385)
        at sonia.scm.server.ScmServer.<init>(ScmServer.java:70)
        ... 1 more
Caused by: java.lang.IllegalArgumentException: Null HttpConfiguration
        at org.eclipse.jetty.server.HttpConnectionFactory.<init>(HttpConnectionFactory.java:55)
        at org.eclipse.jetty.server.HttpConnectionFactory.<init>(HttpConnectionFactory.java:46)
        ... 27 more
To unsubscribe from this group and stop receiving emails from it, send an email to scmma...@googlegroups.com.

Rene Pfeuffer

unread,
Apr 21, 2020, 9:37:19 AM4/21/20
to scmma...@googlegroups.com
In your configuration you are referring to a http configuration with the id `tlsHttpConfig`. It looks like this is not defined and therefore `null`. You need to add such an element starting with `<New id="tlsHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration">`.

To unsubscribe from this group and stop receiving emails from it, send an email to scmmanager+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scmmanager/5a87a7fb-ca32-4e0b-a817-7bdde29ac202%40googlegroups.com.

Sai Raghavendar

unread,
Apr 21, 2020, 11:46:59 AM4/21/20
to scmmanager
Thank you Rene.

If you have any sample template for the ssl configuration where i can customize would be helpful .

Sai Raghavendar

unread,
Apr 22, 2020, 8:50:35 AM4/22/20
to scmmanager
Could somebody pls help

Rene Pfeuffer

unread,
Apr 22, 2020, 1:35:45 PM4/22/20
to scmma...@googlegroups.com
Sorry, we are a little bit under pressure at the moment and I have to admit that I do not know the jetty config well. Just as a quick guess: Can you just replace

`<Ref refid="tlsHttpConfig"/>`

with

`<Ref refid="httpConfig"/>`

and therefore use the default http config from the existing configuration (assuming that you have kept the block starting with `<New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">`)?

To unsubscribe from this group and stop receiving emails from it, send an email to scmmanager+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scmmanager/6c99873f-3701-4c97-9002-a7fc74c7ebb4%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages