This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Issue with FTP upload using org.apache.commons.net.ftp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Issue with FTP upload using org.apache.commons.net.ftp" Watch "Issue with FTP upload using org.apache.commons.net.ftp" New topic
Author

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

Poonam Chaudhari
Greenhorn

Joined: May 04, 2007
Posts: 1
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
Marshal

Joined: Mar 22, 2005
Posts: 41182
    
  45
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 ]

Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issue with FTP upload using org.apache.commons.net.ftp
 
Similar Threads
problem retrieving a zip file from FTP server using org.apache.commons.net.ftp.
FTP issue (using org.apache.commons.net.ftp)
Secure FTP using org.apache.commons.net.ftp.*
Error 500 when compiling servlet
Class not found exception in struts with hibernate