You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by jcamus <jc...@parkeon.com> on 2009/06/19 10:06:03 UTC

CXF-BC with SSL : Port 8181 is configured with wrong protocol

Hi!

I am trying to implement a SSL (HTTPS) protocol entry point into a CXF-BC
component. But when deploying I have the following error :

<stack-trace><![CDATA[javax.jbi.management.DeploymentException:
java.lang.IllegalStateException: Port 8181 is configured with wrong protocol
"http" for "https://localhost:8181/hello"
        at
org.apache.servicemix.cxfbc.CxfBcConsumer.validate(CxfBcConsumer.java:441)
        at
org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.java:58)
        at
org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBeanDeployer.java:55)
        at
org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:96)
        at
org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)
        at
org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)
        at
org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:508)
        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:353)
        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256)
        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:667)
        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)
        at
org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:631)
        at java.util.TimerThread.mainLoop(Timer.java:512)

Here are my xml config files :

xbean.xml of CXF-BC :


<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:parkeon="http://esb.transfolio.parkeon.com"
	xsi:schemaLocation="http://servicemix.apache.org/cxfbc/1.0
http://servicemix.apache.org/schema/servicemix-cxfbc-3.2.2.xsd 
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

	
	<!-- 
locationURI="https://localhost:8181/TransfolioEsb/services/SoapCardManagement"
--> 
	<cxfbc:consumer wsdl="classpath:hello.wsdl"
		targetService="tns:HelloService" 
		locationURI="https://localhost:8181/hello"
		targetInterface="tns:Hello" busCfg="ssl.xml">

		<cxfbc:inInterceptors>
			<bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
		</cxfbc:inInterceptors>
		<cxfbc:outInterceptors>
			<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
		</cxfbc:outInterceptors>
		<cxfbc:inFaultInterceptors>
			<bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
		</cxfbc:inFaultInterceptors>
		<cxfbc:outFaultInterceptors>
			<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
		</cxfbc:outFaultInterceptors>
	</cxfbc:consumer>

</beans>

ssl.xml

<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:sec="http://cxf.apache.org/configuration/security"
  xmlns:http="http://cxf.apache.org/transports/http/configuration"
  xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
  xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
  xsi:schemaLocation="
  		   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
           http://www.springframework.org/schema/beans
             
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">


  <http:destination name="{http://hello/}HelloServicePort.http-destination">    
  </http:destination>
  
  <httpj:engine-factory bus="cxf">
         <!-- you just need to specify the TLS Server configuration for the
certain port -->
	 <httpj:engine port="9003">
	     <httpj:tlsServerParameters>
	      <sec:keyManagers keyPassword="password">
	           <sec:keyStore type="JKS" password="password" 
	                resource="keystore.jks"/>
	      </sec:keyManagers>
	      <sec:trustManagers>
	          <sec:keyStore type="JKS" password="password"
	               resource="keystore.jks"/>
	      </sec:trustManagers>
	      <sec:cipherSuitesFilter>
	        <!-- these filters ensure that a ciphersuite with
	          export-suitable or null encryption is used,
	          but exclude anonymous Diffie-Hellman key change as
	          this is vulnerable to man-in-the-middle attacks -->
	        <sec:include>.*_EXPORT_.*</sec:include>
	        <sec:include>.*_EXPORT1024_.*</sec:include>
	        <sec:include>.*_WITH_DES_.*</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>
</bean>


And the hello.wsdl

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://hello/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="hello"
targetNamespace="http://hello/">
  <wsdl:types>
    <xsd:schema targetNamespace="http://hello/">
      <xsd:element name="hello">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="in" type="xsd:string"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="helloResponse">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="out" type="xsd:string"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="helloRequest">
    <wsdl:part element="tns:hello" name="parameters"/>
  </wsdl:message>
  <wsdl:message name="helloResponse">
    <wsdl:part element="tns:helloResponse" name="parameters"/>
  </wsdl:message>
  <wsdl:portType name="hello">
    <wsdl:operation name="hello">
      <wsdl:input message="tns:helloRequest"/>
      <wsdl:output message="tns:helloResponse"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="helloSOAP" type="tns:hello">
    <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="hello">
      <soap:operation soapAction="http://hello/hello"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="hello">
    <wsdl:port binding="tns:helloSOAP" name="helloSOAP">
      <soap:address location="http://localhost:8181/hello"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>


Can you tell me where am I wrong? 

Thanks.


-- 
View this message in context: http://www.nabble.com/CXF-BC-with-SSL-%3A-Port-8181-is-configured-with-wrong-protocol-tp24107182p24107182.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: CXF-BC with SSL : Port 8181 is configured with wrong protocol

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Comment inline
jcamus wrote:
> Hi!
>
> I am trying to implement a SSL (HTTPS) protocol entry point into a CXF-BC
> component. But when deploying I have the following error :
>
> <stack-trace><![CDATA[javax.jbi.management.DeploymentException:
> java.lang.IllegalStateException: Port 8181 is configured with wrong protocol
> "http" for "https://localhost:8181/hello"
>         at
> org.apache.servicemix.cxfbc.CxfBcConsumer.validate(CxfBcConsumer.java:441)
>         at
> org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.java:58)
>         at
> org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBeanDeployer.java:55)
>         at
> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:96)
>         at
> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)
>         at
> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)
>         at
> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:508)
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:353)
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256)
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:667)
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)
>         at
> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:631)
>         at java.util.TimerThread.mainLoop(Timer.java:512)
>
> Here are my xml config files :
>
> xbean.xml of CXF-BC :
>
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns:parkeon="http://esb.transfolio.parkeon.com"
> 	xsi:schemaLocation="http://servicemix.apache.org/cxfbc/1.0
> http://servicemix.apache.org/schema/servicemix-cxfbc-3.2.2.xsd 
>        http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>
> 	
> 	<!-- 
> locationURI="https://localhost:8181/TransfolioEsb/services/SoapCardManagement"
> --> 
> 	<cxfbc:consumer wsdl="classpath:hello.wsdl"
> 		targetService="tns:HelloService" 
> 		locationURI="https://localhost:8181/hello"
> 		targetInterface="tns:Hello" busCfg="ssl.xml">
>
> 		<cxfbc:inInterceptors>
> 			<bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
> 		</cxfbc:inInterceptors>
> 		<cxfbc:outInterceptors>
> 			<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
> 		</cxfbc:outInterceptors>
> 		<cxfbc:inFaultInterceptors>
> 			<bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
> 		</cxfbc:inFaultInterceptors>
> 		<cxfbc:outFaultInterceptors>
> 			<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
> 		</cxfbc:outFaultInterceptors>
> 	</cxfbc:consumer>
>
> </beans>
>
> ssl.xml
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xmlns:sec="http://cxf.apache.org/configuration/security"
>   xmlns:http="http://cxf.apache.org/transports/http/configuration"
>   xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
>   xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
>   xsi:schemaLocation="
>   		   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
>            http://www.springframework.org/schema/beans
>              
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>
>
>   <http:destination name="{http://hello/}HelloServicePort.http-destination">    
>   </http:destination>
>   
should be

<http:destination name="{http://hello/}helloSOAP.http-destination">    
  </http:destination>

intead, it should match the port name from your wsdl
>   
>   <httpj:engine-factory bus="cxf">
>          <!-- you just need to specify the TLS Server configuration for the
> certain port -->
> 	 <httpj:engine port="9003">
>   
and  should be

<httpj:engine port="8181">

instead since you are using 8181 port not the 9003


> 	     <httpj:tlsServerParameters>
> 	      <sec:keyManagers keyPassword="password">
> 	           <sec:keyStore type="JKS" password="password" 
> 	                resource="keystore.jks"/>
> 	      </sec:keyManagers>
> 	      <sec:trustManagers>
> 	          <sec:keyStore type="JKS" password="password"
> 	               resource="keystore.jks"/>
> 	      </sec:trustManagers>
> 	      <sec:cipherSuitesFilter>
> 	        <!-- these filters ensure that a ciphersuite with
> 	          export-suitable or null encryption is used,
> 	          but exclude anonymous Diffie-Hellman key change as
> 	          this is vulnerable to man-in-the-middle attacks -->
> 	        <sec:include>.*_EXPORT_.*</sec:include>
> 	        <sec:include>.*_EXPORT1024_.*</sec:include>
> 	        <sec:include>.*_WITH_DES_.*</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>
> </bean>
>
>
> And the hello.wsdl
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:tns="http://hello/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="hello"
> targetNamespace="http://hello/">
>   <wsdl:types>
>     <xsd:schema targetNamespace="http://hello/">
>       <xsd:element name="hello">
>         <xsd:complexType>
>           <xsd:sequence>
>             <xsd:element name="in" type="xsd:string"/>
>           </xsd:sequence>
>         </xsd:complexType>
>       </xsd:element>
>       <xsd:element name="helloResponse">
>         <xsd:complexType>
>           <xsd:sequence>
>             <xsd:element name="out" type="xsd:string"/>
>           </xsd:sequence>
>         </xsd:complexType>
>       </xsd:element>
>     </xsd:schema>
>   </wsdl:types>
>   <wsdl:message name="helloRequest">
>     <wsdl:part element="tns:hello" name="parameters"/>
>   </wsdl:message>
>   <wsdl:message name="helloResponse">
>     <wsdl:part element="tns:helloResponse" name="parameters"/>
>   </wsdl:message>
>   <wsdl:portType name="hello">
>     <wsdl:operation name="hello">
>       <wsdl:input message="tns:helloRequest"/>
>       <wsdl:output message="tns:helloResponse"/>
>     </wsdl:operation>
>   </wsdl:portType>
>   <wsdl:binding name="helloSOAP" type="tns:hello">
>     <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>     <wsdl:operation name="hello">
>       <soap:operation soapAction="http://hello/hello"/>
>       <wsdl:input>
>         <soap:body use="literal"/>
>       </wsdl:input>
>       <wsdl:output>
>         <soap:body use="literal"/>
>       </wsdl:output>
>     </wsdl:operation>
>   </wsdl:binding>
>   <wsdl:service name="hello">
>     <wsdl:port binding="tns:helloSOAP" name="helloSOAP">
>       <soap:address location="http://localhost:8181/hello"/>
>     </wsdl:port>
>   </wsdl:service>
> </wsdl:definitions>
>
>
> Can you tell me where am I wrong? 
>
> Thanks.
>
>
>   


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com