• 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:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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: 43028
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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic