2017-09-18 1 views
0

최근에 기존 청사진 컨테이너에 "http-conf"네임 스페이스를 추가했습니다. 하지만 유닛 테스트 케이스를 실행하고 있다면 예외를 던져 청사진 컨테이너를 종료합니다. 그러나 카라프에 설치하면 동일한 코드가 제대로 작동합니다. 내 청사진 코드가Camel CXF - "http-conf"네임 스페이스가 InvalidSyntaxException을 throw합니다.

,

<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:] 

답변

0

POM에서 아래의 종속성을 추가하고 위에서 언급 한 다른 종속성을 모두 제거한 후에 문제가 해결되었습니다. 이러한 종속성이 프레임 워크 프로젝트에서 다운로드되므로

<dependency> 
<groupId>org.osgi</groupId> 
<artifactId>org.osgi.compendium</artifactId> 
<version>5.0.0</version> 
<scope>test</scope> 
</dependency> 
관련 문제