Recently use Apache Commons-net.jar do ftp upload download function, click "Upload" when the error, as follows:
1 Java.lang.ClassNotFoundException:org.apache.oro.text.regex.Malformed
Online search, there are two ways, 1: Maybe the local Windows XP jdk is 1.6.15 Yi, packaged, Use the 1.6.15 JDK to run an error, and replace it with a JDK higher than jdk1.6.15 to run; 2. Missing Jakarta-oro-2.0.8.jar file.
At first, I tried to get my colleagues to run with a different version of the JDK, and my colleague reminded me that it might be a jar conflict and then go check it and discover that there are two versions of Commons-net.jar under the project. One is the Commons-net-1.4.1.jar already existing in the previous project, and one is the current Commons-net-3.1.jar. First try to delete the Commons-net-1.4.1.jar from the project, and then run the project, click "Upload" Success no more error, run normally.
After consideration, the jar package can be backwards compatible, so Commons-net-3.1.jar can replace the Commons-net-1.4.1.jar, so that deleting a jar package will not affect the other parts of the project.
Use Commons-net to do FTP function exception java.lang.ClassNotFoundException:org.apache.oro.text.regex.Malformed