I have a problem ,  my cxf-ssl.xml setting for httpj-engine is working when
it runs as l springboot camel application.

but it failed at JUnitTest with below error , It seem SpringContext could
corretly import resource for ssl cxf setting during
JUnitTest. (CamelSpringBootRunner)

Caused by:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
17 in XML document from class path resource [ cxf-ssl.xml  ] is invalid;
nested exception is org.xml.sax.SAXParseException; lineNumber: 17;
columnNumber: 24; cvc-complex-type.2.4.c: wildcard ist strict,, but no
declaration found for  Element 'httpj:engine-factory'

Here is my cxf-ssl.xml setting for httpj-engine

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
xmlns:beans="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
">
<httpj:engine-factory>
<httpj:engine port="9999">
<httpj:tlsServerParameters>
<sec:keyManagers
keyPassword="password">
<sec:keyStore file="../keystore.jks"
password="password type="jks" />
</sec:keyManagers>
<sec:trustManagers>
<sec:keyStore file=" ../keystore.jks  "
password="password" type="jks" />
</sec:trustManagers>
<!-- sec:clientAuthentication want="true" required="true"/ -->
</httpj:tlsServerParameters>
</httpj:engine>
</httpj:engine-factory>
</beans>


Here is my springboot application which import resource of

@SpringBootApplication
@ImportResource(value = { "classpath: cxf-ssl.xml   ",
"classpath:META-INF/cxf/cxf.xml" })
public class MySpringBootCamelApplication {


Here is my Junit SpringBootCamelTest

@RunWith(CamelSpringBootRunner.class)
@SpringBootTest(classes =  MySpringBootCamelApplication.class)
@TestPropertySource(locations = { "classpath:application-test.properties" })
@UseAdviceWith
public class  MySpringBootCamelApplicationTest {

Reply via email to