【问题标题】:Need package to import in mule需要在 mule 中导入包
【发布时间】:2022-01-25 04:49:33
【问题描述】:

当我从 git maven (mule) 构建时,我需要导入这些包

所以我的脚本有那些要导入的?

import org.opensaml.ws.soap.client.SOAPClient;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.oxm.jaxb.Jaxb2Marshaller;
import org.springframework.ws.client.core.WebServiceTemplate;
import org.springframework.ws.client.support.interceptor.ClientInterceptor;
import org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor;

所以我认为我需要带有 repo url 的示例 pom.xml 文件,我试图搜索但我坚持

org.opensaml.ws.soap.client 和 org.springframework.ws.soap.security.wss4j

有什么建议吗?

更新:我已经在 pom.xml 文件中添加了您的存储库,但是我在构建时收到了这些错误

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1-jboss-2:compile (default-compile) on project vancho-mvp: Compilation failure: Compilation failure:
79158 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/client/SubscriberClient.java:[4,42] package org.springframework.ws.client.core does not exist
79158 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/client/SubscriberClient.java:[14,17] cannot find symbol
79159 [ERROR] symbol:   class WebServiceTemplate
79159 [ERROR] location: class com.van2.soap.client.SubscriberClient
79159 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/config/SoapConfig.java:[3,35] package org.opensaml.ws.soap.client does not exist
79160 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/config/SoapConfig.java:[8,36] package org.springframework.oxm.jaxb does not exist
79160 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/config/SoapConfig.java:[9,42] package org.springframework.ws.client.core does not exist
79160 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/config/SoapConfig.java:[10,57] package org.springframework.ws.client.support.interceptor does not exist
79161 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/config/SoapConfig.java:[11,50] package org.springframework.ws.soap.security.wss4j does not exist
79161 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/config/SoapConfig.java:[29,16] cannot find symbol
79161 [ERROR] symbol:   class Jaxb2Marshaller
79162 [ERROR] location: class com.van2.soap.config.SoapConfig
79162 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/config/SoapConfig.java:[35,16] cannot find symbol
79162 [ERROR] symbol:   class Wss4jSecurityInterceptor
79162 [ERROR] location: class com.van2.soap.config.SoapConfig
79163 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/config/SoapConfig.java:[45,12] cannot find symbol
79163 [ERROR] symbol:   class WebServiceTemplate
79163 [ERROR] location: class com.van2.soap.config.SoapConfig
79164 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/client/PrepaidPackageClient.java:[4,42] package org.springframework.ws.client.core does not exist
79164 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/client/PrepaidPackageClient.java:[14,17] cannot find symbol
[ERROR] symbol:   class WebServiceTemplate

编辑 pom.xml 后再次更新(更新 2 aled):

82900 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1-jboss-2:compile (default-compile) on project vancho-mvp: Compilation failure: Compilation failure:
82900 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/config/SoapConfig.java:[3,35] package org.opensaml.ws.soap.client does not exist
82900 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/config/SoapConfig.java:[11,50] package org.springframework.ws.soap.security.wss4j does not exist
82901 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/config/SoapConfig.java:[35,16] cannot find symbol
82901 [ERROR] symbol:   class Wss4jSecurityInterceptor

aled 更新 3:

81466 [ERROR] /builds/home/app1/src/main/java/com/van2/soap/config/SoapConfig.java:[11,50] package org.springframework.ws.soap.security.wss4j does not exist
81467 [ERROR] /builds/home/app1/src/main/java/com/van2/config/SoapConfig.java:[35,16] cannot find symbol
  symbol:   class Wss4jSecurityInterceptor
  location: class com.van2.soap.config.SoapConfig

【问题讨论】:

  • 在您的 Mule 应用程序中构建 Java 源代码是否需要这些包?

标签: mule maven-2


【解决方案1】:

您的项目使用的 OpenSAML 版本看起来很旧,在 end of life and abandoned。请注意,评论中的 mvnrepository 链接中提到了活动的安全漏洞。使用这个旧软件风险很大:

<!-- https://mvnrepository.com/artifact/org.opensaml/openws -->
<dependency>
    <groupId>org.opensaml</groupId>
    <artifactId>openws</artifactId>
    <version>1.5.4</version>
</dependency>

Spring WS 最新发布:

<!-- https://mvnrepository.com/artifact/org.springframework.ws/spring-ws-core -->
<dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>spring-ws-core</artifactId>
    <version>2.4.7.RELEASE</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.springframework.ws/spring-ws-security -->
<dependency>
    <groupId>org.springframework.ws</groupId>
    <artifactId>spring-ws-security</artifactId>
    <version>2.4.7.RELEASE</version>
</dependency>

【讨论】:

  • 您好@aled 我已将这些存储库添加到我的 pom.xml 中,并且在我想构建时遇到了这些 maven 错误...仍然无法重新调整 opensaml ..
  • 与您发布的原始错误完全相同,还是消息中有任何更改?
  • 嗨@aled,我已经更新了我的原始帖子,错误如下:更新:我已经在 pom.xml 文件中添加了你的 repos 但是我在构建时收到了这些错误 请检查原始发布
  • 看来opensaml错误消失了。 Spring WS 缺少的包应该很容易通过一些谷歌搜索来解决。等我回到电脑前看看。
  • 在审查时我注意到我复制了一个不同 Spring 产品的依赖项。我现在已经使用 Spring WS 的正确依赖项更新了答案。让我知道是否还有缺课。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-08-14
  • 2021-06-06
  • 1970-01-01
  • 2018-07-10
  • 2018-10-26
相关资源
最近更新 更多