0 Replies Latest reply on Oct 19, 2014 6:22 AM by vrlgohel

    java.lang.RuntimeException: Could not configure TLS for engine on  null:9090

    vrlgohel

      Hi all,

       

      I have been successful in the past configuring a bundle with CXF SSL using Spring. However, when i use blueprint and configuration as below, in my bundle,

       

      <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
        xmlns:camel="http://camel.apache.org/schema/blueprint" xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
        xmlns:cxf="http://cxf.apache.org/blueprint/core" xmlns:http="http://cxf.apache.org/transports/http/configuration"
        xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
        xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
             http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
             http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd
             http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd
              http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd">
      
        <jaxws:server id="serviceEndpoint" address="/SslService"
        serviceClass="com.redhat.service.SslService" serviceBean="com.redhat.service.SslServiceImpl">
        <jaxws:features>
        <cxf:logging/>
        </jaxws:features>
        </jaxws:server>
      
        <http:destination name="{http://service.redhat.com}SslServicePort.http-destination">
        </http:destination>
        <httpj:engine-factory>
        <httpj:engine port="9090">
        <httpj:tlsServerParameters>
        <sec:keyManagers keyPassword="service">
        <sec:keyStore file="service.keystore"/>
        </sec:keyManagers>
        <sec:trustManagers>
        <sec:keyStore file="service.keystore"/>
        </sec:trustManagers>
        <sec:cipherSuitesFilter>
        <sec:include>.*_EXPORT_.*</sec:include>
                          <sec:include>.*_EXPORT1024_.*</sec:include>
                          <sec:include>.*_WITH_DES_.*</sec:include>
                          <sec:include>.*_WITH_AES_.*</sec:include>
                          <sec:include>.*_WITH_NULL_.*</sec:include>
                          <sec:exclude>.*_DH_anon_.*</sec:exclude>
        </sec:cipherSuitesFilter>
        <sec:clientAuthentication want="true" required="true"/>
        </httpj:tlsServerParameters>
        </httpj:engine>
        </httpj:engine-factory>
      </blueprint>
      

       

      I get the following exception from the logs when deploying in JBoss Fuse 6.1.0,

       

      Caused by: java.lang.RuntimeException: Could not process configuration.
              at org.apache.cxf.transport.http_jetty.blueprint.JettyHTTPServerEngineFactoryHolder.init(JettyHTTPServerEngineFactoryHolder.java:165)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_65]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_65]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_65]
              at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_65]
              at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
              at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
              at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:712)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379]
              ... 27 more
      Caused by: java.lang.RuntimeException: Could not configure TLS for engine on  null:9090
              at org.apache.cxf.transport.http_jetty.blueprint.JettyHTTPServerEngineFactoryHolder.init(JettyHTTPServerEngineFactoryHolder.java:152)
              ... 34 more
      Caused by: java.io.FileNotFoundException: service.keystore (No such file or directory)
              at java.io.FileInputStream.open(Native Method)[:1.7.0_65]
              at java.io.FileInputStream.<init>(FileInputStream.java:146)[:1.7.0_65]
              at java.io.FileInputStream.<init>(FileInputStream.java:101)[:1.7.0_65]
              at org.apache.cxf.configuration.jsse.TLSParameterJaxBUtils.getKeyStore(TLSParameterJaxBUtils.java:127)
              at org.apache.cxf.configuration.jsse.TLSParameterJaxBUtils.getKeyManagers(TLSParameterJaxBUtils.java:264)
              at org.apache.cxf.configuration.jsse.TLSServerParametersConfig.<init>(TLSServerParametersConfig.java:69)
              at org.apache.cxf.transport.http_jetty.blueprint.JettyHTTPServerEngineFactoryHolder.init(JettyHTTPServerEngineFactoryHolder.java:149)
              ... 34 more
      

       

       

      All the associated 'jetty' features are already installed in my bundle,

       

      JBossFuse:admin@root> features:list|grep jetty
      [installed  ] [2.7.0.redhat-610379    ] cxf-http-jetty                          cxf-2.7.0.redhat-610379              
      [installed  ] [2.12.0.redhat-610379   ] camel-jetty                             camel-2.12.0.redhat-610379           
      [installed  ] [8.1.14.v20131031       ] jetty                                   karaf-2.3.0.redhat-610379            Provide Jetty engine support
      [installed  ] [8.1.14.v20131031       ] pax-jetty                               org.ops4j.pax.web-3.0.6              Provide Jetty engine support
      

       

      Am i missing anything ? What am i doing wrong ? Or is there any further feature or setup required ?

       

      I am attaching the bundle CxfSSL.zip for reference.