Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic