Hi,

I keep getting errors when I try to launch ftpd.bat with my own ftplet (w/o it, 
it works fine).

I have a MyFtplet.jar file (containing MyFtplet.class) which implements 
onUploadStart for a simple test.

Error message begins like this:

Using XML configuration file c:\ftpserver-1.0.0-RC1\res\conf\myftpd.xml...
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with 
name 'org.apache.ftpserver.FtpServerFactory#0': Cannot create inner bean 
'MyFtplet#5329c5' 
of type [MyFtplet] while setting bean property 'ftplets' with key [MyFtplet]; 
nested exception is 
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading 
class [MyFtplet] 
for bean with name 'MyFtplet#5329c5' defined in file 
[c:\ftpserver-1.0.0-RC1\res\conf\myftpd.xml]: 
problem with class file or dependent class; nested exception is 
java.lang.NoClassDefFoundError:
 MyFtplet (wrong name: MyFtplet/MyFtplet)
...

Any idea ? (see below my code and conf extracts)

Thx

____________________________________________

Java code is :

package MyFtplet;

import java.io.*;

import org.apache.ftpserver.ftplet.FtpException;
import org.apache.ftpserver.ftplet.FtpReply;
import org.apache.ftpserver.ftplet.FtpRequest;
import org.apache.ftpserver.ftplet.FtpSession;
import org.apache.ftpserver.ftplet.FtpletResult;
import org.apache.ftpserver.ftplet.Ftplet;


public class MyFtplet extends org.apache.ftpserver.ftplet.DefaultFtplet {

 public FtpletResult onUploadStart(FtpSession session, FtpRequest request) 
  throws FtpException, IOException {

  System.out.println("==> Upload");

  return FtpletResult.DEFAULT;
 }
}

My XML conf file contains:

 <ftplets>
  <ftplet name="MyFtplet">
   <beans:bean class="MyFtplet">
    <beans:property name="foo" value="123" />
   </beans:bean>
  </ftplet>
 </ftplets>

Reply via email to