File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issue with FTP upload using org.apache.commons.net.ftp

 
Poonam Chaudhari
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using jdk1.4. I want to use org.apache.commons.net.ftp for uploading files to my server. I am using jakarta-oro-2.0.8.jar and commons-net-1.4.0.jars
Below is the code snippet:
....
FTPClient ftp = new FTPClient();
ftp.connect(serverName);
ftp.login(userName, password);
ftp.storeFile(serverName,in);
...
after executing the file I get error at line
FTPClient ftp = new FTPClient(); as :

java.lang.UnsupportedClassVersionError: org/apache/commons/net/ftp/FTPClient (Unsupported major.minor version 49.0)
java.lang.ClassLoader.defineClass0(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:502)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1634)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
pto.requestHandler.FileUploadRH.execute(FileUploadRH.java:75)
PtoController.doGet(PtoController.java:181)
PtoController.doPost(PtoController.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Any suggestions to resolve the issue.
Thanks in advance.
[ May 15, 2007: Message edited by: Poonam Chaudhari ]
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

That means that the library has been compiled for a newer version of the JVM than you are using. In this case, it requires Java 5 (which uses class file version 49.0) whereas you may have something older.

It sounds strange, though, as the release notes state that it should work even with JDK 1.3. To resolve it, you could always grab the source code and recompile it using your JDK version.
[ May 15, 2007: Message edited by: Ulf Dittmer ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic