You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Stefan Alex <ab...@gmail.com> on 2017/03/03 09:06:48 UTC

cxf:rsServer running on https issues

Hello , 
 I need to secure a JAX-RS endpoints from my integration project but I have
a lot of issues with it .
I'm running on apacheServiceMix 5.0.4 , which contains the following
components :
2.4.1 of Apache Karaf ,5.10.0 of ActiveMQ, 2.14.1 of Camel ,3.0.2 of CXF

i have the endpoint declared like this 

<cxf:rsServer id="rsServer" address="http://localhost:8888/rest/"
    serviceClass="com.xxxx.inbound.service.InboundService" 
    loggingFeatureEnabled="true" loggingSizeLimit="99999" depends-on="">
    <cxf:providers>
       <ref bean="jsonProvider"/>
    </cxf:providers>
  </cxf:rsServer> 

Which is the proper way to have it running on https://localhost:8888/rest/ ?

I tried the following :
http://cxf.apache.org/docs/secure-jax-rs-services.html#SecureJAX-RSServices-Configuringendpoints
but when I integrate the example it complains that the cxf bean is missing .

I tried also this configuration :

<httpj:engine-factory bus="cxf">
  <httpj:engine port="444">
    <httpj:tlsServerParameters>
      <sec:keyManagers keyPassword="password">
        <sec:keyStore type="JKS"
                      password="password"
                      file="src/main/config/servicemix.jks"/>
        </sec:keyManagers>
        <sec:trustManagers>
          <sec:keyStore type="JKS"
                        password="password"
                        file="src/main/config/servicemix.jks"/>
      </sec:trustManagers>
    </httpj:tlsServerParameters>

    <httpj:threadingParameters minThreads="5"
                               maxThreads="15" />

    <httpj:sessionSupport>true</httpj:sessionSupport>
  </httpj:engine>
</httpj:engine-factory>

But this one generate other error ;

aused by: java.lang.RuntimeException:
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of
IllegalAnnotationExceptions
Two classes have the same XML type name
"{http://cxf.apache.org/transports/http-jetty/configuration}TLSServerParametersIdentifiedType".
Use @XmlType.name and @XmlType.namespace to assign different names to them.
	this problem is related to the following location:
		at
org.apache.cxf.transports.http_jetty.configuration.TLSServerParametersIdentifiedType
		at protected java.util.List
org.apache.cxf.transports.http_jetty.configuration.JettyHTTPServerEngineFactoryConfigType.identifiedTLSServerParameters
		at
org.apache.cxf.transports.http_jetty.configuration.JettyHTTPServerEngineFactoryConfigType
		at public javax.xml.bind.JAXBElement
org.apache.cxf.transports.http_jetty.configuration.ObjectFactory.createEngineFactory(org.apache.cxf.transports.http_jetty.configuration.JettyHTTPServerEngineFactoryConfigType)
		at org.apache.cxf.transports.http_jetty.configuration.ObjectFactory
	this problem is related to the following location:
		at
org.apache.cxf.transports.http_jetty.configuration.TLSServerParametersIdentifiedType

Please can you help me with some hints about how this problem can be solved
?
thank you very much in advance .
best regards,
Stefan 




--
View this message in context: http://cxf.547215.n5.nabble.com/cxf-rsServer-running-on-https-issues-tp5777737.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: cxf:rsServer running on https issues

Posted by Colm O hEigeartaigh <co...@apache.org>.
Try adding at the top of the file:

<import resource="classpath:META-INF/cxf/cxf.xml"/>

Colm.

On Fri, Mar 3, 2017 at 4:43 PM, Stefan Alex <ab...@gmail.com> wrote:

> Hello ,
>    I put the two configurations into one file and I get the cxf error again
> :
>
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean
> with name
> 'org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory': Cannot
> resolve reference to bean 'cxf' while setting constructor argument; nested
> exception is
> org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean
> named 'cxf' is defined
>
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xmlns:ctx="http://www.springframework.org/schema/context"
>         xmlns:cxf="http://camel.apache.org/schema/cxf"
>         xmlns:camel="http://camel.apache.org/schema/spring"
>         xmlns:ns="http://www.stefanini.com/ca/"
>         xmlns:jaxrs="http://cxf.apache.org/jaxrs"
>         xmlns:jaxws="http://cxf.apache.org/jaxws"
>         xmlns:osgi="http://www.springframework.org/schema/osgi"
>         xmlns:osgix="http://www.springframework.org/schema/osgi-compendium
> "
>         xmlns:context="http://www.springframework.org/schema/context"
>         xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-
> cm/v1.1.0"
>         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"
>         xsi:schemaLocation="
>        http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>        http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context.xsd
>        http://www.springframework.org/schema/osgi
> http://www.springframework.org/schema/osgi/spring-osgi.xsd
>        http://www.springframework.org/schema/osgi-compendium
> http://www.springframework.org/schema/osgi-compendium/
> spring-osgi-compendium.xsd
>        http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd
>        http://camel.apache.org/schema/cxf
> http://camel.apache.org/schema/cxf/camel-cxf.xsd
>        http://cxf.apache.org/transports/http/configuration
>        http://cxf.apache.org/schemas/configuration/http-conf.xsd
>        http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
>        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
>        http://cxf.apache.org/jaxrs-client
>        http://cxf.apache.org/schemas/jaxrs-client.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
>         http://cxf.apache.org/configuration/security
> http://cxf.apache.org/schemas/configuration/security.xsd
>        ">
>
>
>     <httpj:engine-factory bus="cxf">
>
>   <httpj:engine port="444">
>     <httpj:tlsServerParameters>
>       <sec:keyManagers keyPassword="password">
>         <sec:keyStore type="JKS"
>                       password="password"
>                       file="src/main/config/servicemix.jks"/>
>         </sec:keyManagers>
>         <sec:trustManagers>
>           <sec:keyStore type="JKS"
>                         password="password"
>                         file="src/main/config/servicemix.jks"/>
>       </sec:trustManagers>
>     </httpj:tlsServerParameters>
>
>     <httpj:threadingParameters minThreads="5"
>                                maxThreads="15" />
>
>     <httpj:sessionSupport>true</httpj:sessionSupport>
>   </httpj:engine>
> </httpj:engine-factory>
>
>
>
> <bean id="jsonProvider"
> class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
>
> <cxf:rsServer id="rsServer" address="https://localhost:8888/rest2/"
>
> serviceClass="com.stefanini.ca.epsilon.inbound.service.
> VistaraInboundService"
>     loggingFeatureEnabled="true" loggingSizeLimit="99999" depends-on="">
>     <cxf:providers>
>        <ref bean="jsonProvider"/>
>     </cxf:providers>
>   </cxf:rsServer>
>
>
>  <camelContext xmlns="http://camel.apache.org/schema/spring">
>
>      <route>
>        <from uri="cxfrs://bean://rsServer"/>
>         <to uri="log:body?level=INFO"/>
>     </route>
>     </camelContext>
>
> </beans>
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.
> com/cxf-rsServer-running-on-https-issues-tp5777737p5777765.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Re: cxf:rsServer running on https issues

Posted by Stefan Alex <ab...@gmail.com>.
Hello ,
   I put the two configurations into one file and I get the cxf error again
:

org.springframework.beans.factory.BeanCreationException: Error creating bean
with name
'org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory': Cannot
resolve reference to bean 'cxf' while setting constructor argument; nested
exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean
named 'cxf' is defined


<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:ctx="http://www.springframework.org/schema/context" 
	xmlns:cxf="http://camel.apache.org/schema/cxf" 
	xmlns:camel="http://camel.apache.org/schema/spring" 
	xmlns:ns="http://www.stefanini.com/ca/"
	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
	xmlns:jaxws="http://cxf.apache.org/jaxws" 
	xmlns:osgi="http://www.springframework.org/schema/osgi" 
	xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
	xmlns:context="http://www.springframework.org/schema/context" 
	xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
	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"
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
       http://www.springframework.org/schema/osgi-compendium
http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd   
       http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
       http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf.xsd
       http://cxf.apache.org/transports/http/configuration 
       http://cxf.apache.org/schemas/configuration/http-conf.xsd
       http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
       http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd           
       http://cxf.apache.org/jaxrs-client
       http://cxf.apache.org/schemas/jaxrs-client.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
        http://cxf.apache.org/configuration/security               
http://cxf.apache.org/schemas/configuration/security.xsd
       ">
      
       
    <httpj:engine-factory bus="cxf">
  
  <httpj:engine port="444">
    <httpj:tlsServerParameters>
      <sec:keyManagers keyPassword="password">
        <sec:keyStore type="JKS"
                      password="password"
                      file="src/main/config/servicemix.jks"/>
        </sec:keyManagers>
        <sec:trustManagers>
          <sec:keyStore type="JKS"
                        password="password"
                        file="src/main/config/servicemix.jks"/>
      </sec:trustManagers>
    </httpj:tlsServerParameters>

    <httpj:threadingParameters minThreads="5"
                               maxThreads="15" />

    <httpj:sessionSupport>true</httpj:sessionSupport>
  </httpj:engine>
</httpj:engine-factory>


       
<bean id="jsonProvider"
class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>

<cxf:rsServer id="rsServer" address="https://localhost:8888/rest2/"
   
serviceClass="com.stefanini.ca.epsilon.inbound.service.VistaraInboundService" 
    loggingFeatureEnabled="true" loggingSizeLimit="99999" depends-on="">
    <cxf:providers>
       <ref bean="jsonProvider"/>
    </cxf:providers>
  </cxf:rsServer> 
       
 
 <camelContext xmlns="http://camel.apache.org/schema/spring">
 
     <route>
       <from uri="cxfrs://bean://rsServer"/>
        <to uri="log:body?level=INFO"/> 
    </route>  
    </camelContext>	
       
</beans>





--
View this message in context: http://cxf.547215.n5.nabble.com/cxf-rsServer-running-on-https-issues-tp5777737p5777765.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: cxf:rsServer running on https issues

Posted by Colm O hEigeartaigh <co...@apache.org>.
If you combine the two files + change the address to be "https" what is the
error that you see?

Colm.

On Fri, Mar 3, 2017 at 1:33 PM, Stefan Alex <ab...@gmail.com> wrote:

> Hello ,
>    I have it in a separate file , here it is , should I put in one file ?
> Best regards,
> Stefan
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xmlns:ctx="http://www.springframework.org/schema/context"
>         xmlns:cxf="http://camel.apache.org/schema/cxf"
>         xmlns:camel="http://camel.apache.org/schema/spring"
>         xmlns:ns="http://www.stefanini.com/ca/"
>         xmlns:jaxrs="http://cxf.apache.org/jaxrs"
>         xmlns:jaxws="http://cxf.apache.org/jaxws"
>         xmlns:osgi="http://www.springframework.org/schema/osgi"
>         xmlns:osgix="http://www.springframework.org/schema/osgi-compendium
> "
>         xmlns:context="http://www.springframework.org/schema/context"
>         xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-
> cm/v1.1.0"
>         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"
>         xsi:schemaLocation="
>        http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>        http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context.xsd
>        http://www.springframework.org/schema/osgi
> http://www.springframework.org/schema/osgi/spring-osgi.xsd
>        http://www.springframework.org/schema/osgi-compendium
> http://www.springframework.org/schema/osgi-compendium/
> spring-osgi-compendium.xsd
>        http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd
>        http://camel.apache.org/schema/cxf
> http://camel.apache.org/schema/cxf/camel-cxf.xsd
>        http://cxf.apache.org/transports/http/configuration
>        http://cxf.apache.org/schemas/configuration/http-conf.xsd
>        http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
>        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
>        http://cxf.apache.org/jaxrs-client
>        http://cxf.apache.org/schemas/jaxrs-client.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
>         http://cxf.apache.org/configuration/security
> http://cxf.apache.org/schemas/configuration/security.xsd
>        ">
>
>
>
>
>
> <bean id="jsonProvider"
> class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>
>
>
>
> <cxf:rsServer id="rsServer" address="http://localhost:8888/rest2/"
>     serviceClass="com.xxx.InboundService"
>     loggingFeatureEnabled="true" loggingSizeLimit="99999" depends-on="">
>     <cxf:providers>
>        <ref bean="jsonProvider"/>
>     </cxf:providers>
>   </cxf:rsServer>
>
>
>  <camelContext xmlns="http://camel.apache.org/schema/spring">
>
>      <route>
>        <from uri="cxfrs://bean://rsServer"/>
>         <to uri="log:body?level=INFO"/>
>     </route>
>     </camelContext>
>
> </beans>
>
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.
> com/cxf-rsServer-running-on-https-issues-tp5777737p5777752.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Re: cxf:rsServer running on https issues

Posted by Stefan Alex <ab...@gmail.com>.
Hello ,
   I have it in a separate file , here it is , should I put in one file ?
Best regards,
Stefan

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:ctx="http://www.springframework.org/schema/context" 
	xmlns:cxf="http://camel.apache.org/schema/cxf" 
	xmlns:camel="http://camel.apache.org/schema/spring" 
	xmlns:ns="http://www.stefanini.com/ca/"
	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
	xmlns:jaxws="http://cxf.apache.org/jaxws" 
	xmlns:osgi="http://www.springframework.org/schema/osgi" 
	xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
	xmlns:context="http://www.springframework.org/schema/context" 
	xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
	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"
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
       http://www.springframework.org/schema/osgi-compendium
http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd   
       http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
       http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf.xsd
       http://cxf.apache.org/transports/http/configuration 
       http://cxf.apache.org/schemas/configuration/http-conf.xsd
       http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
       http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd           
       http://cxf.apache.org/jaxrs-client
       http://cxf.apache.org/schemas/jaxrs-client.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
        http://cxf.apache.org/configuration/security               
http://cxf.apache.org/schemas/configuration/security.xsd
       ">
      
       


       
<bean id="jsonProvider"
class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"/>



<cxf:rsServer id="rsServer" address="http://localhost:8888/rest2/"
    serviceClass="com.xxx.InboundService" 
    loggingFeatureEnabled="true" loggingSizeLimit="99999" depends-on="">
    <cxf:providers>
       <ref bean="jsonProvider"/>
    </cxf:providers>
  </cxf:rsServer> 
       
 
 <camelContext xmlns="http://camel.apache.org/schema/spring">
 
     <route>
       <from uri="cxfrs://bean://rsServer"/>
        <to uri="log:body?level=INFO"/> 
    </route>  
    </camelContext>
       
</beans>






--
View this message in context: http://cxf.547215.n5.nabble.com/cxf-rsServer-running-on-https-issues-tp5777737p5777752.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: cxf:rsServer running on https issues

Posted by Colm O hEigeartaigh <co...@apache.org>.
Where is your CXF endpoint definition? It should be in the same file.

Colm.

On Fri, Mar 3, 2017 at 12:36 PM, Stefan Alex <ab...@gmail.com> wrote:

> Hello ,
>    this is the file with configuration .
>    The keystore is ok , because I can run for example -
> https://localhost:8443/system/console/bundles
>
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        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"
>        xsi:schemaLocation="
>         http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.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
>         http://cxf.apache.org/configuration/security
> http://cxf.apache.org/schemas/configuration/security.xsd">
>
>
>
>     <httpj:engine-factory bus="cxf">
>
>   <httpj:engine port="444">
>     <httpj:tlsServerParameters>
>       <sec:keyManagers keyPassword="password">
>         <sec:keyStore type="JKS"
>                       password="password"
>                       file="src/main/config/servicemix.jks"/>
>         </sec:keyManagers>
>         <sec:trustManagers>
>           <sec:keyStore type="JKS"
>                         password="password"
>                         file="src/main/config/servicemix.jks"/>
>       </sec:trustManagers>
>     </httpj:tlsServerParameters>
>
>     <httpj:threadingParameters minThreads="5"
>                                maxThreads="15" />
>
>     <httpj:sessionSupport>true</httpj:sessionSupport>
>   </httpj:engine>
> </httpj:engine-factory>
> </beans>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.
> com/cxf-rsServer-running-on-https-issues-tp5777737p5777749.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

Re: cxf:rsServer running on https issues

Posted by Stefan Alex <ab...@gmail.com>.
Hello ,
   this is the file with configuration .
   The keystore is ok , because I can run for example -
https://localhost:8443/system/console/bundles


<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       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"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans                
http://www.springframework.org/schema/beans/spring-beans.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
        http://cxf.apache.org/configuration/security               
http://cxf.apache.org/schemas/configuration/security.xsd">
     
    
    
    <httpj:engine-factory bus="cxf">
  
  <httpj:engine port="444">
    <httpj:tlsServerParameters>
      <sec:keyManagers keyPassword="password">
        <sec:keyStore type="JKS"
                      password="password"
                      file="src/main/config/servicemix.jks"/>
        </sec:keyManagers>
        <sec:trustManagers>
          <sec:keyStore type="JKS"
                        password="password"
                        file="src/main/config/servicemix.jks"/>
      </sec:trustManagers>
    </httpj:tlsServerParameters>

    <httpj:threadingParameters minThreads="5"
                               maxThreads="15" />

    <httpj:sessionSupport>true</httpj:sessionSupport>
  </httpj:engine>
</httpj:engine-factory>
</beans>




--
View this message in context: http://cxf.547215.n5.nabble.com/cxf-rsServer-running-on-https-issues-tp5777737p5777749.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: cxf:rsServer running on https issues

Posted by Colm O hEigeartaigh <co...@apache.org>.
Could you show the complete spring configuration that is causing the error?

Colm.

On Fri, Mar 3, 2017 at 9:06 AM, Stefan Alex <ab...@gmail.com> wrote:

> Hello ,
>  I need to secure a JAX-RS endpoints from my integration project but I have
> a lot of issues with it .
> I'm running on apacheServiceMix 5.0.4 , which contains the following
> components :
> 2.4.1 of Apache Karaf ,5.10.0 of ActiveMQ, 2.14.1 of Camel ,3.0.2 of CXF
>
> i have the endpoint declared like this
>
> <cxf:rsServer id="rsServer" address="http://localhost:8888/rest/"
>     serviceClass="com.xxxx.inbound.service.InboundService"
>     loggingFeatureEnabled="true" loggingSizeLimit="99999" depends-on="">
>     <cxf:providers>
>        <ref bean="jsonProvider"/>
>     </cxf:providers>
>   </cxf:rsServer>
>
> Which is the proper way to have it running on https://localhost:8888/rest/
> ?
>
> I tried the following :
> http://cxf.apache.org/docs/secure-jax-rs-services.html#
> SecureJAX-RSServices-Configuringendpoints
> but when I integrate the example it complains that the cxf bean is missing
> .
>
> I tried also this configuration :
>
> <httpj:engine-factory bus="cxf">
>   <httpj:engine port="444">
>     <httpj:tlsServerParameters>
>       <sec:keyManagers keyPassword="password">
>         <sec:keyStore type="JKS"
>                       password="password"
>                       file="src/main/config/servicemix.jks"/>
>         </sec:keyManagers>
>         <sec:trustManagers>
>           <sec:keyStore type="JKS"
>                         password="password"
>                         file="src/main/config/servicemix.jks"/>
>       </sec:trustManagers>
>     </httpj:tlsServerParameters>
>
>     <httpj:threadingParameters minThreads="5"
>                                maxThreads="15" />
>
>     <httpj:sessionSupport>true</httpj:sessionSupport>
>   </httpj:engine>
> </httpj:engine-factory>
>
> But this one generate other error ;
>
> aused by: java.lang.RuntimeException:
> com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of
> IllegalAnnotationExceptions
> Two classes have the same XML type name
> "{http://cxf.apache.org/transports/http-jetty/configuration}
> TLSServerParametersIdentifiedType".
> Use @XmlType.name and @XmlType.namespace to assign different names to them.
>         this problem is related to the following location:
>                 at
> org.apache.cxf.transports.http_jetty.configuration.
> TLSServerParametersIdentifiedType
>                 at protected java.util.List
> org.apache.cxf.transports.http_jetty.configuration.
> JettyHTTPServerEngineFactoryConfigType.identifiedTLSServerParameters
>                 at
> org.apache.cxf.transports.http_jetty.configuration.
> JettyHTTPServerEngineFactoryConfigType
>                 at public javax.xml.bind.JAXBElement
> org.apache.cxf.transports.http_jetty.configuration.ObjectFactory.
> createEngineFactory(org.apache.cxf.transports.http_jetty.configuration.
> JettyHTTPServerEngineFactoryConfigType)
>                 at org.apache.cxf.transports.http_jetty.configuration.
> ObjectFactory
>         this problem is related to the following location:
>                 at
> org.apache.cxf.transports.http_jetty.configuration.
> TLSServerParametersIdentifiedType
>
> Please can you help me with some hints about how this problem can be solved
> ?
> thank you very much in advance .
> best regards,
> Stefan
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.
> com/cxf-rsServer-running-on-https-issues-tp5777737.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>



-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com