诊断从Karaf 3.0.1移植到4.2.5的问题

时间:2019-05-23 17:18:58

标签: maven apache-karaf

我曾经使用Karaf 3.0.1处理旧版服务。从那以后,我搬到了同一组织中的另一个项目,但是原始团队现在需要升级到Karaf 4.2.5,并且他们在启动Karaf时遇到了麻烦。我认为这是其中一个功能文件中的缺陷,但我不了解所有细节。

在启动时,他们看到以下内容:

2019-05-15T21:45:36,871 | INFO  | activator-1-thread-2 | Activator                        | 12 - org.apache.karaf.deployer.features - 4.2.5 | Deployment finished. Registering FeatureDeploymentListener
2019-05-15T21:45:36,885 | ERROR | activator-1-thread-2 | FeatureDeploymentListener        | 12 - org.apache.karaf.deployer.features - 4.2.5 | Unable to update deployed features for bundle: org.apache.felix.framework - 5.6.12
java.lang.NullPointerException: null
    at org.apache.karaf.deployer.features.FeatureDeploymentListener.bundleChanged(FeatureDeploymentListener.java:247) [12:org.apache.karaf.deployer.features:4.2.5]
    at org.apache.karaf.deployer.features.FeatureDeploymentListener.init(FeatureDeploymentListener.java:95) [12:org.apache.karaf.deployer.features:4.2.5]

我检查了该版本的源代码,从堆栈跟踪中可以看出,该代码将NPE放在此块的“ removeAll”行上:

        Map<String, Set<String>> requirements = featuresService.listRequirements();
        requirements.get(ROOT_REGION).removeAll(reqsToRemove);
        requirements.get(ROOT_REGION).addAll(reqsToAdd);

我可以在此处提供功能部件文件,但是我不确定哪些功能适用,因此我将提供所有可能相关的所有三个功能:

<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="https://urldefense.proofpoint.com/v2/url?u=http-3A__karaf.apache.org_xmlns_features_v1.0.0&d=DwIGaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=9OLBxruHRfaDacPPRgY0lo_uRQinK70ZT8iH3tYE3Ws&s=-WOdVjtBcTlU5U3nK04qXKhBM5YtFQVGqH6-T4ygUV4&e=" name="onemap-service-${pom.version}">
    <repository>mvn:com.att.ecom.apis/event-dashboard-impl/1.1.0-SNAPSHOT/xml/features</repository>
    <repository>mvn:org.apache.cxf.karaf/apache-cxf/2.7.11/xml/features</repository>
    <repository>mvn:com.att.ecom.apis/apis-base/1.1.0-SNAPSHOT/xml/features</repository>

    <feature name='onemap-impl' version='${pom.version}' resolver='(obr)'>
        <feature version="${pom.version}">onemap-api</feature>
        <feature version="1.1.0-SNAPSHOT">common-spring-jdbc</feature>
        <bundle>mvn:org.hibernate/hibernate-validator/4.2.0.Final</bundle>
        <bundle>mvn:com.att.ecom.apis/onemap-impl/${pom.version}</bundle>
        <configfile override="true" finalname="/etc/OneMapImpl.ApplicationProperties.cfg">mvn:com.att.ecom.apis/onemap-impl/${pom.version}/cfg/OneMapImpl.ApplicationProperties</configfile>
        <configfile override="true" finalname="/etc/OneMapImpl.BingMaps.cfg">mvn:com.att.ecom.apis/onemap-impl/${pom.version}/cfg/OneMapImpl.BingMaps</configfile>
        <configfile override="true" finalname="/etc/OneMapImpl.WaiCoverageProperties.cfg">mvn:com.att.ecom.apis/onemap-impl/${pom.version}/cfg/OneMapImpl.WaiCoverageProperties</configfile>
        <configfile override="true" finalname="/etc/OneMapImpl.CoverageCacheProperties.cfg">mvn:com.att.ecom.apis/onemap-impl/${pom.version}/cfg/OneMapImpl.CoverageCacheProperties</configfile>
    </feature>

    <feature name='onemap-api' version='${pom.version}' resolver='(obr)'>
         <feature version="1.1.0-SNAPSHOT">apis-base</feature>
         <bundle>mvn:javax.validation/com.springsource.javax.validation/1.0.0.GA</bundle>
         <bundle>mvn:com.att.ecom.apis/onemap-api/${pom.version}</bundle>
    </feature>

    <feature name='onemap-rest' version='${pom.version}' resolver='(obr)'>
        <feature version="1.1.0-SNAPSHOT">rest</feature>
        <feature version="1.1.0-SNAPSHOT">event-dashboard-impl</feature>
        <bundle>mvn:com.att.ecom.apis/onemap-rest/${pom.version}</bundle>
        <bundle>mvn:com.att.ecom.apis/rest-base/1.1.0-SNAPSHOT</bundle>
        <configfile override="true" finalname="/etc/OneMapRest.ApplicationProperties.cfg">mvn:com.att.ecom.apis/onemap-rest/${pom.version}/cfg/OneMapRest.ApplicationProperties</configfile>
    </feature>

    <feature name='onemap-service' version='${pom.version}' resolver='(obr)'>
        <feature version="${pom.version}">onemap-api</feature>
        <feature version="${pom.version}">onemap-impl</feature>
        <feature version="${pom.version}">onemap-rest</feature>
    </feature>
</features>

<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="https://urldefense.proofpoint.com/v2/url?u=http-3A__karaf.apache.org_xmlns_features_v1.0.0&d=DwIGaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=9OLBxruHRfaDacPPRgY0lo_uRQinK70ZT8iH3tYE3Ws&s=-WOdVjtBcTlU5U3nK04qXKhBM5YtFQVGqH6-T4ygUV4&e=" name="common-features-${pom.version}">
    <feature name='jackson' version='2.9.8' resolver='(obr)'>
        <bundle>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jsr339-api-m10/2.9.0</bundle>
        <bundle>mvn:com.fasterxml.jackson.core/jackson-core/2.9.8</bundle>
        <bundle>mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.8</bundle>
        <bundle>mvn:com.fasterxml.jackson.core/jackson-databind/2.9.8</bundle>
        <bundle>mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/2.9.8</bundle>
        <bundle>mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.9.8</bundle>
        <bundle>mvn:com.fasterxml.jackson.module/jackson-module-jaxb-annotations/2.9.8</bundle>
    </feature>

    <feature name='httpclient' version='3.1.7' resolver='(obr)'>
        <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient/3.1_7</bundle>
        <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-codec/1.3_5</bundle>
        <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-io/1.4_3</bundle>
    </feature>

    <feature name='common' version='1.1.0-SNAPSHOT' resolver='(obr)'>
        <bundle>mvn:commons-lang/commons-lang/2.6</bundle>
        <bundle>mvn:commons-collections/commons-collections/3.2.1</bundle>
    </feature>

    <feature name='common-spring-jdbc' version='1.1.0-SNAPSHOT' resolver='(obr)'>
        <bundle>mvn:org.springframework/org.springframework.web/3.2.4.RELEASE</bundle>
        <bundle>mvn:org.springframework/org.springframework.jdbc/3.2.4.RELEASE</bundle>
        <bundle>mvn:org.springframework.ws/spring-xml/2.1.4.RELEASE</bundle>
    </feature>

    <feature name='quartz' version='2.3.1' resolver='(obr)'>
        <bundle>wrap:mvn:org.quartz-scheduler/quartz/2.3.1$Bundle-Name=quartz&amp;Bundle-SymbolicName=quartz&amp;Bundle-Version=2.3.1</bundle>
    </feature>

    <feature name='rest' version='1.1.0-SNAPSHOT' resolver='(obr)'>
        <feature version="1.1.0-SNAPSHOT">common</feature>
        <feature version="3.2.7">cxf</feature>
        <feature version="2.9.8">jackson</feature>
<!--         <feature version="3.1.7">httpclient</feature> -->
        <!-- By default cxf deploys with a "/cxf" context -->
        <config name="org.apache.cxf.osgi">
            org.apache.cxf.servlet.context=/*
        </config>
    </feature>
</features>

<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="https://urldefense.proofpoint.com/v2/url?u=http-3A__karaf.apache.org_xmlns_features_v1.0.0&d=DwIGaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn-xy2uk0vYF_EA&m=9OLBxruHRfaDacPPRgY0lo_uRQinK70ZT8iH3tYE3Ws&s=-WOdVjtBcTlU5U3nK04qXKhBM5YtFQVGqH6-T4ygUV4&e=" name="features-aggregate-1.1.55-SNAPSHOT">
    <repository>mvn:com.att.ecom.apis/onemap-impl/1.4.3-SNAPSHOT/xml/features</repository>
    <repository>mvn:com.att.ecom.apis/external-services-impl/1.1.0-SNAPSHOT/xml/features</repository>
    <repository>mvn:com.att.ecom.apis/cassandra-dao-impl/1.1.7-SNAPSHOT/xml/features</repository>
    <repository>mvn:com.att.ecom.apis/unlock-features/1.1.0-SNAPSHOT/xml/features</repository>
    <repository>mvn:com.att.ecom.apis/service-monitoring/1.1.1-SNAPSHOT/xml/features</repository>
    <repository>mvn:com.att.ecom.apis/eai-service-impl/1.1.0-SNAPSHOT/xml/features</repository>
    <repository>mvn:com.att.ecom.apis/gddn-service-impl/1.1.0-SNAPSHOT/xml/features</repository>
    <repository>mvn:com.att.ecom.apis/sli-service-impl/1.1.0-SNAPSHOT/xml/features</repository>
    <repository>mvn:com.att.ecom.apis/fraud-alert-impl/1.1.2-SNAPSHOT/xml/features</repository>
    <repository>mvn:com.att.ecom.personalization/personalization/1.1.11-SNAPSHOT/xml/features</repository>
    <repository>mvn:com.att.ecom.apis/fan-profile-automation/1.1.5-SNAPSHOT/xml/features</repository>
    <repository>mvn:com.att.ecom.apis/email-service/1.1.0-SNAPSHOT/xml/features</repository>

    <feature name='full-deploy' version='1.1.55-SNAPSHOT' resolver='(obr)'>
        <bundle>mvn:org.jolokia/jolokia-osgi/1.6.1</bundle>
        <feature version="1.4.3-SNAPSHOT">onemap-service</feature>
        <feature version="1.1.0-SNAPSHOT">external-services</feature>
        <feature version="1.1.7-SNAPSHOT">cassandra-dao</feature>
        <feature version="1.0.0">unlock-features</feature>
        <feature version="1.1.1-SNAPSHOT">service-monitoring</feature>
        <feature version="1.1.0-SNAPSHOT">eai-service-impl</feature>
        <feature version="1.1.0-SNAPSHOT">gddn-service-impl</feature>
        <feature version="1.1.0-SNAPSHOT">sli-service-impl</feature>
        <feature version="1.1.2-SNAPSHOT">fraud-alert-impl</feature>
        <feature version="1.1.2-SNAPSHOT">fraud-alert-rest</feature>
        <feature version="1.1.11-SNAPSHOT">personalization-incub</feature>
        <feature version="1.1.5-SNAPSHOT">fan-profile-automation</feature>
        <feature version="1.1.0-SNAPSHOT">email-service</feature>
    </feature>
</features>

0 个答案:

没有答案