0

我们有一个项目,我们已经使用 WSO2 Enterprise Integrator 一年左右。随着时间的推移,实现变得相对复杂,它涉及代理、API、模板、自定义中介和消息代理的组合。这通过单个 CAR 部署工件进行部署。公共代码已共享为 WSO2>Extensions>JavaLibraryProject (WSO2 DevStudio)。这个库被归档到 CAR 中:

<artifact name="M2E-Commons" version="1.0.1" type="lib/library/bundle" serverRole="ApplicationServer">
  <file>M2E-Commons-1.0.1.jar</file>
</artifact>

这对我们过去的所有版本都很好,但是在 WSO2 EI 6.2.0 中被打破了

这是在 WSO2 EI 6.1.1 上部署时日志的开头:

TID: [-1234] [] [2018-04-09 14:33:52,337]  INFO {org.wso2.carbon.application.deployer.internal.ApplicationManager} -  Deploying Carbon Application : M2E-CAP_1.0.16.car... {org.wso2.carbon.application.deployer.internal.ApplicationManager}
TID: [-1234] [] [2018-04-09 14:33:52,350]  INFO {org.wso2.carbon.application.deployer.handler.DefaultAppDeployer} -  OSGi bundle in file:///opt/wso2ei/wso2/tmp/carbonapps/-1234/1523284432337M2E-CAP_1.0.16.car/M2E-Commons_1.0.1/M2E-Commons-1.0.1.jar location is about to be installed to Carbon Server. {org.wso2.carbon.application.deployer.handler.DefaultAppDeployer}
TID: [-1234] [] [2018-04-09 14:33:52,351]  INFO {org.wso2.carbon.application.deployer.handler.DefaultAppDeployer} -  OSGi bundle M2E-Commons installed to Carbon Server. {org.wso2.carbon.application.deployer.handler.DefaultAppDeployer}
TID: [-1234] [] [2018-04-09 14:33:52,369]  INFO {org.wso2.carbon.application.deployer.handler.DefaultAppDeployer} -  OSGi bundle M2E-Commons successfully started on Carbon Server. {org.wso2.carbon.application.deployer.handler.DefaultAppDeployer}
TID: [-1234] [] [2018-04-09 14:33:52,369]  INFO {org.apache.synapse.deployers.ClassMediatorDeployer} -  Deploying Class mediators from file : /opt/wso2ei/wso2/tmp/carbonapps/-1234/1523284432337M2E-CAP_1.0.16.car/M2E-Device_1.0.0/M2E-Device-1.0.0.jar {org.apache.synapse.deployers.ClassMediatorDeployer}
TID: [-1234] [] [2018-04-09 14:33:52,370]  INFO {org.apache.synapse.deployers.ClassMediatorDeployer} -  Deploying Class mediators from file : /opt/wso2ei/wso2/tmp/carbonapps/-1234/1523284432337M2E-CAP_1.0.16.car/M2E-Flic_1.0.0/M2E-Flic-1.0.0.jar {org.apache.synapse.deployers.ClassMediatorDeployer}

这是部署在 WSO2 EI 6.2.0 上的同一个 CAR:

TID: [-1234] [] [2018-04-06 22:29:46,703]  INFO {org.wso2.carbon.application.deployer.internal.ApplicationManager} -  Deploying Carbon Application : M2E-CAP_1.0.16.car... {org.wso2.carbon.application.deployer.internal.ApplicationManager}
TID: [-1234] [] [2018-04-06 22:29:46,810]  INFO {org.apache.synapse.deployers.ClassMediatorDeployer} -  Deploying Class mediators from file : /opt/wso2ei/wso2/tmp/carbonapps/-1234/1523053786703M2E-CAP_1.0.16.car/M2E-Device_1.0.0/M2E-Device-1.0.0.jar {org.apache.synapse.deployers.ClassMediatorDeployer}
TID: [-1234] [] [2018-04-06 22:29:46,810]  INFO {org.apache.synapse.deployers.ClassMediatorDeployer} -  Deploying Class mediators from file : /opt/wso2ei/wso2/tmp/carbonapps/-1234/1523053786703M2E-CAP_1.0.16.car/M2E-Flic_1.0.0/M2E-Flic-1.0.0.jar {org.apache.synapse.deployers.ClassMediatorDeployer}
TID: [-1234] [] [2018-04-06 22:29:46,810]  INFO {org.apache.synapse.deployers.ClassMediatorDeployer} -  Deploying Class mediators from file : /opt/wso2ei/wso2/tmp/carbonapps/-1234/1523053786703M2E-CAP_1.0.16.car/M2E-M2L_ISS_1.0.0/M2E-M2L_ISS-1.0.0.jar {org.apache.synapse.deployers.ClassMediatorDeployer}
TID: [-1234] [] [2018-04-06 22:29:46,810]  INFO {org.apache.synapse.deployers.ClassMediatorDeployer} -  Deploying Class mediators from file : /opt/wso2ei/wso2/tmp/carbonapps/-1234/1523053786703M2E-CAP_1.0.16.car/M2E-M2T_1.0.1/M2E-M2T-1.0.1.jar {org.apache.synapse.deployers.ClassMediatorDeployer}
TID: [-1234] [] [2018-04-06 22:29:46,881] ERROR {org.apache.synapse.deployers.AbstractSynapseArtifactDeployer} -  Deployment of the Synapse Artifact from file : /opt/wso2ei-6.2.0/wso2/tmp/carbonapps/-1234/1523053786703M2E-CAP_1.0.16.car/M2E-ISS.LightOff_1.0.0/M2E-ISS.LightOff-1.0.0.xml : Failed! {org.apache.synapse.deployers.AbstractSynapseArtifactDeployer}
  java.lang.NoClassDefFoundError: sk/m2ms/wso2/m2e/M2Mediator

显然,OSGi 捆绑包 M2E-Commons 部署没有正确优先于其他工件部署之前启动 - 导致 NoClassDefFoundError。

你有什么想法?这可以通过一些符合 OSGi 的机制/概念来解决吗?或者这是针对 WSO2 提交的有效错误?

提前谢谢你,彼得

4

1 回答 1

0

NoClassDefFoundError由于开始订购,永远不会发生这样的错误。这意味着捆绑包使用该包sk.m2ms.wso2.m2e,但既不导入也不包含该包。这是捆绑包构建中的错误,所以如果这不是您自己构建的捆绑包,那么我建议这确实是一个应该报告给供应商的错误。

于 2018-04-10T07:12:49.087 回答