Camel CXF - "http-conf" 命名空间抛出 InvalidSyntaxException
Camel CXF - "http-conf" namespace throws InvalidSyntaxException
我最近将 "http-conf" 命名空间添加到我现有的蓝图容器中。但是如果我是 运行 我的单元测试用例,这会通过抛出以下异常来关闭我的蓝图容器。但是如果我将它安装在我的 karaf 中,相同的代码可以正常工作。
我的蓝图代码是,
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:camel="http://camel.apache.org/schema/blueprint"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel-cxf="http://camel.apache.org/schema/blueprint/cxf"
xmlns:cxfcore="http://cxf.apache.org/blueprint/core" xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
http://camel.apache.org/schema/blueprint/cxf http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd">
<http-conf:conduit name="*.http-conduit">
<http-conf:client ReceiveTimeout="60000" ConnectionTimeout="60000"/>
</http-conf:conduit>
我得到的例外是,
2017-09-18T13:15:24.983+0530 INFO [] com.jda.flex.sf.container.blueprint.ImportNamespaceHandler Waiting for namespace handler
http://cxf.apache.org/transports/http/configuration [{main} waitForNamespaceHandlers:179 {}]
2017-09-18T13:15:24.984+0530 ERROR [] org.apache.aries.blueprint.container.BlueprintContainerImpl Unable to start blueprint container for bundle Mock_LoadDepartTest/1.0.0 [{main} doRun:438 {}]
com.jda.flex.sf.container.blueprint.ImportException: com.jda.flex.sf.container.blueprint.ImportException: com.jda.flex.sf.container.blueprint.ImportException:
org.osgi.framework.InvalidSyntaxException: Filter ended abruptly: (&objectClass=org.apache.aries.blueprint.NamespaceHandler) (osgi.service.blueprint.namespace=http://cxf.apache.org/transports/http/configuration)
.
.
.
2017-09-18T13:15:24.987+0530 INFO [] com.jda.tma.integration.mock.tests.Mock_LoadDepartTest Waiting 10000ms for Blueprint Container to initialize [{main} waitForTestBundleBlueprintContainer:385 {}]
编辑
为了解决这个问题,我添加了一些依赖项。现在我摆脱了 InvalidSyntaxException" 异常。但是得到了不同的异常。
我在 pom.xml
中添加了以下依赖项
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-soap</artifactId>
<version>3.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-frontend-jaxws -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.felix/org.osgi.compendium -->
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>1.4.0</version>
<scope>test</scope>
</dependency>
下面是我的异常堆栈跟踪。
2017-09-20T18:10:00.524+0530 ERROR [] org.apache.aries.blueprint.container.BlueprintContainerImpl Unable to start blueprint container for bundle Mock_LoadDepartTest/1.0.0 [{main} doRun:438 {}]
com.jda.flex.sf.container.blueprint.ImportException: com.jda.flex.sf.container.blueprint.ImportException: org.osgi.service.blueprint.container.ComponentDefinitionException: Unknown element import in namespace http://www.osgi.org/xmlns/blueprint/v1.0.0
at com.jda.flex.sf.container.blueprint.ImportNamespaceHandler.parseImport(ImportNamespaceHandler.java:358)[services-core-2017.2.0-drop-13.jar:]
at com.jda.flex.sf.container.blueprint.ImportNamespaceHandler.parse(ImportNamespaceHandler.java:269)[services-core-2017.2.0-drop-13.jar:]
在 POM 中添加以下依赖项并删除我上面提到的所有其他依赖项后,问题已解决。因为这些依赖是从我的框架工程下载的
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>5.0.0</version>
<scope>test</scope>
</dependency>
我最近将 "http-conf" 命名空间添加到我现有的蓝图容器中。但是如果我是 运行 我的单元测试用例,这会通过抛出以下异常来关闭我的蓝图容器。但是如果我将它安装在我的 karaf 中,相同的代码可以正常工作。
我的蓝图代码是,
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:camel="http://camel.apache.org/schema/blueprint"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel-cxf="http://camel.apache.org/schema/blueprint/cxf"
xmlns:cxfcore="http://cxf.apache.org/blueprint/core" xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
http://camel.apache.org/schema/blueprint/cxf http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd">
<http-conf:conduit name="*.http-conduit">
<http-conf:client ReceiveTimeout="60000" ConnectionTimeout="60000"/>
</http-conf:conduit>
我得到的例外是,
2017-09-18T13:15:24.983+0530 INFO [] com.jda.flex.sf.container.blueprint.ImportNamespaceHandler Waiting for namespace handler
http://cxf.apache.org/transports/http/configuration [{main} waitForNamespaceHandlers:179 {}]
2017-09-18T13:15:24.984+0530 ERROR [] org.apache.aries.blueprint.container.BlueprintContainerImpl Unable to start blueprint container for bundle Mock_LoadDepartTest/1.0.0 [{main} doRun:438 {}]
com.jda.flex.sf.container.blueprint.ImportException: com.jda.flex.sf.container.blueprint.ImportException: com.jda.flex.sf.container.blueprint.ImportException:
org.osgi.framework.InvalidSyntaxException: Filter ended abruptly: (&objectClass=org.apache.aries.blueprint.NamespaceHandler) (osgi.service.blueprint.namespace=http://cxf.apache.org/transports/http/configuration)
.
.
.
2017-09-18T13:15:24.987+0530 INFO [] com.jda.tma.integration.mock.tests.Mock_LoadDepartTest Waiting 10000ms for Blueprint Container to initialize [{main} waitForTestBundleBlueprintContainer:385 {}]
编辑
为了解决这个问题,我添加了一些依赖项。现在我摆脱了 InvalidSyntaxException" 异常。但是得到了不同的异常。
我在 pom.xml
中添加了以下依赖项<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-soap</artifactId>
<version>3.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-frontend-jaxws -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.felix/org.osgi.compendium -->
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>1.4.0</version>
<scope>test</scope>
</dependency>
下面是我的异常堆栈跟踪。
2017-09-20T18:10:00.524+0530 ERROR [] org.apache.aries.blueprint.container.BlueprintContainerImpl Unable to start blueprint container for bundle Mock_LoadDepartTest/1.0.0 [{main} doRun:438 {}]
com.jda.flex.sf.container.blueprint.ImportException: com.jda.flex.sf.container.blueprint.ImportException: org.osgi.service.blueprint.container.ComponentDefinitionException: Unknown element import in namespace http://www.osgi.org/xmlns/blueprint/v1.0.0
at com.jda.flex.sf.container.blueprint.ImportNamespaceHandler.parseImport(ImportNamespaceHandler.java:358)[services-core-2017.2.0-drop-13.jar:]
at com.jda.flex.sf.container.blueprint.ImportNamespaceHandler.parse(ImportNamespaceHandler.java:269)[services-core-2017.2.0-drop-13.jar:]
在 POM 中添加以下依赖项并删除我上面提到的所有其他依赖项后,问题已解决。因为这些依赖是从我的框架工程下载的
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>5.0.0</version>
<scope>test</scope>
</dependency>