use*_*705 5 java security tomcat exception maven
我的应用程序依赖于外部 jar
<dependency>
<groupId>org.objectweb.joram</groupId>
<artifactId>jftp</artifactId>
<version>1.52</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我主要对使用以下包import net.sf.jftp.net.*感兴趣
但看起来这个jar还暴露了org.apache.log4j包中的某些类,导致在将应用程序war文件部署到tomcat时出现以下异常
java.lang.SecurityException:类“org.apache.log4j.PropertyConfigurator”的签名者信息与同一包中其他类的签名者信息不匹配
有什么办法可以避免错误吗?
首先你可以使用
mvn dependency:tree
Run Code Online (Sandbox Code Playgroud)
准确查看 jftp 加载了哪些依赖项。然后,像这样排除那些你不想要的:
<dependency>
<groupId>org.objectweb.joram</groupId>
<artifactId>jftp</artifactId>
<version>1.52</version>
<exclusions>
<exclusion> <!-- declare the exclusion here -->
<groupId>sample.ProjectB</groupId>
<artifactId>Project-B</artifactId>
</exclusion>
</exclusions>
</dependency>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3498 次 |
| 最近记录: |