1. Diagnostic packet Conflict
Java.lang.nosuchmethoderror:org.apache.commons.io.output.deferredfileoutputstream.<init> (ILjava/lang/ String; ljava/lang/string; Ljava/io/file;) V
2. Solve
2.1 Visible Dependency Conflicts
Open the project in Eclipse, and in the dependency hierarchy of the Pom file, search the conflicting package Commons-io to see dependency information for each dependent package. If the package has a dependency conflict, there will be a conflict between the version of XXX and version xxx. Select the correct version and exclusion the remaining version under the corresponding reference package.
or use MVN dependency:tree > Tree.log to import the dependency information into the file Tree.log to see the dependency information for the package Commons-io.
2.2 Non-visible dependency conflicts
1) See if the server uses a different version of the JBoss path that contains the conflicting packages.
The path is: Jboss-x.x.x.ga/lib, and Jboss-x.x.x.ga/server/default/lib, if there is a conflicting version, then delete.
2) Check which package the JVM is loading when the exception occurs.
Add the JVM startup parameter-verbose:class to the program-initiated script, and then restart the app. In the startup log, you can see which package the loaded class came from.
[Loaded org.apache.velocity.runtime.parser.node.ASTTrue from File:/home/admin/app/.default/deploy/app.war/web-inf /lib/velocity-1.6.4.jar]
Trigger the action that caused the exception to view the package that contains the loaded class, compared to the correct package.
Add:
In this case, it is possible that the version of the package raised the error, the method being called is different from the implementation of the higher and lower versions, or there is a missing method in a version.
It is also possible that two different jar packages, containing classes of the same path, are then confused during the call. In this case, you can use shift+ctrl+t in eclipse to see how many of these classes are in the project and see the classpath information.
Java Package Conflict resolution method