Dear all I am writing ftplet to send to rabbitMQ the filename of the uploaded file to the apche ftp server.
I have imported the following class import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; I have also placed the rabbitmq.client.jar on apache ftp server lib. But when I start my server and upload so that the file name can be queued then I get an error that class is not found. Exception in thread "pool-3-thread-1" java.lang.NoClassDefFoundError: com/rabbitmq/client/ConnectionFactory at net.tra.ftpserver.ftpletservice.EFDMSFtplet.SendMessageByKey(EFDMSFtplet.java:156) at net.tra.ftpserver.ftpletservice.EFDMSFtplet.onUploadEnd(EFDMSFtplet.java:129) at org.apache.ftpserver.ftplet.DefaultFtplet.afterCommand(DefaultFtplet.java:89) at net.tra.ftpserver.ftpletservice.EFDMSFtplet.afterCommand(EFDMSFtplet.java:103) at org.apache.ftpserver.ftpletcontainer.impl.DefaultFtpletContainer.afterCommand(DefaultFtpletContainer.java:145) at org.apache.ftpserver.impl.DefaultFtpHandler.messageReceived(DefaultFtpHandler.java:221) at org.apache.ftpserver.listener.nio.FtpHandlerAdapter.messageReceived(FtpHandlerAdapter.java:62) at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:858) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:542) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:48) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:947) at org.apache.ftpserver.listener.nio.FtpLoggingFilter.messageReceived(FtpLoggingFilter.java:85) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:542) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:48) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:947) at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74) at org.apache.mina.filter.logging.MdcInjectionFilter.filter(MdcInjectionFilter.java:135) at org.apache.mina.filter.util.CommonEventFilter.messageReceived(CommonEventFilter.java:70) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:542) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:48) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:947) at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:398) at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:234) at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:542) at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:48) at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:947) at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74) at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63) at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:770) at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:762) at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:704) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: com.rabbitmq.client.ConnectionFactory at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 32 more Please help Charles ________________________________________ From: Charles Titus Palapala <ctpalap...@tra.go.tz> Sent: Monday, January 11, 2021 12:26 PM To: ftpserver-users@mina.apache.org Subject: Re: FTPlet properties not exposed from configuration Miroslav Thanks very much following the standard has worked. ________________________________________ From: Miroslav Pokorny <miroslav.poko...@gmail.com> Sent: Monday, January 11, 2021 11:47 AM To: ftpserver-users@mina.apache.org Subject: Re: FTPlet properties not exposed from configuration Hi Charles, Not quite sure, and havent actually tested but you have named your fields using a non standard capitalisation. > private String QueueUser; > private String QueueKey; > private String QueueExchangeName; The java standard for fields is that they start with a lower case letter, so rename "QueueUser" to "queueUser", "QueueKey" to "queueKey" and "QueueExchangeName" to "queueExchangeName". Your class name is also "wrong", the java standard is that class names start with a capital letter, so "myFtplet" should be "MyFtplet". > public class myFtplet extends DefaultFtplet { This might help with your Spring problem, but i havent actually checked but its always best to follow these standards. Regards mP On Mon, 11 Jan 2021 at 18:01, Charles Titus Palapala <ctpalap...@tra.go.tz> wrote: > ?Dear all > > I writing a simple ftplet for apache ftp server. > > > package net.test.ftpserver.ftpletservice.myFtplet; > > > public class myFtplet extends DefaultFtplet { > private final Logger LOG = LoggerFactory.getLogger(EFDMSFtplet.class); > > private String QueueUser; > > private String QueueKey; > > private String QueueExchangeName; > > public String getQueueHost() { > return QueueHost; > } > > public void setQueueHost(String queueHost) { > QueueHost = queueHost; > } > > public String getQueueUser() { > return QueueUser; > } > > public void setQueueUser(String queueUser) { > this.QueueUser = queueUser; > } > > public String getQueueKey() { > return QueueKey; > } > > public void setQueueKey(String queueKey) { > this.QueueKey = queueKey; > } > > public String getQueueExchangeName() { > return QueueExchangeName; > } > > public void setQueueExchangeName(String queueExchangeName) { > this.QueueExchangeName = queueExchangeName; > } > > } > > > > Then I set my bean property as > > <ftplets> > <ftplet name="Ftplet1"> > <beans:bean class="net.test.ftpserver.ftpletservice.myFtplet"> > <beans:property name="QueueKey" value="admin123" /> > <beans:property name="QueueExchangeName" value="exFILLING" /> > <beans:property name="secureFolder" value="c:/secureFolder" /> > </beans:bean> > </ftplet> > </ftplets> > > > When I start my apache ftp Server I get the following Error > > [ERROR] 2021-01-02 15:31:59,752 [] [] Daemon error > org.springframework.beans.factory.BeanCreationException: Error creating > bean > with name 'org.apache.ftpserver.FtpServerFactory#0': Cannot create inner > bean > 'net.tra.ftpserver.ftpletservice.EFDMSFtplet#12bb9f0' of type > [net.tra.ftpserver.ftpletservice.EFDMSFtplet] while setting bean property > 'ftplets' with key [EFDMSFtplet1]; nested exception is > org.springframework.beans.factory.BeanCreationException: Error creating > bean > with name 'net.tra.ftpserver.ftpletservice.EFDMSFtplet#12bb9f0' defined in > file > [C:\apache-ftpserver\ftp\res\conf\ftpd-typical.xml]: Initialization of bean > failed; nested exception is > org.springframework.beans.InvalidPropertyException: > Invalid property 'QueueKey' of bean class > [net.tra.ftpserver.ftpletservice.EFDMSFtplet]: No property 'QueueKey' found > at > > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230) > at > > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:117) > at > > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:320) > at > > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:134) > at > > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245) > > > > > I can not figure out what is wrong. > > > Charles? > > > ________________________________ > > > > DISCLAIMER: This e-mail and any attachments are proprietary to TANZANIA > REVENUE AUTHORITY.Any unauthorized use or interception is illegal. The > views and opinions expressed are those of the sender, unless clearly stated > as being those of TANZANIA REVENUE AUTHORITY. This e-mail is only addressed > to the addressee and TANZANIA REVENUE AUTHORITY shall not be responsible > for any further publication of the contents of this e-mail. If this e-mail > is not addressed to you, you may not copy, print, distribute or disclose > the contents to anyone nor act on its contents. If you received this in > error, please inform the sender and delete this e-mail from your computer. > > > -- mP ________________________________ DISCLAIMER: This e-mail and any attachments are proprietary to TANZANIA REVENUE AUTHORITY.Any unauthorized use or interception is illegal. The views and opinions expressed are those of the sender, unless clearly stated as being those of TANZANIA REVENUE AUTHORITY. This e-mail is only addressed to the addressee and TANZANIA REVENUE AUTHORITY shall not be responsible for any further publication of the contents of this e-mail. If this e-mail is not addressed to you, you may not copy, print, distribute or disclose the contents to anyone nor act on its contents. If you received this in error, please inform the sender and delete this e-mail from your computer. ________________________________ DISCLAIMER: This e-mail and any attachments are proprietary to TANZANIA REVENUE AUTHORITY.Any unauthorized use or interception is illegal. The views and opinions expressed are those of the sender, unless clearly stated as being those of TANZANIA REVENUE AUTHORITY. This e-mail is only addressed to the addressee and TANZANIA REVENUE AUTHORITY shall not be responsible for any further publication of the contents of this e-mail. If this e-mail is not addressed to you, you may not copy, print, distribute or disclose the contents to anyone nor act on its contents. If you received this in error, please inform the sender and delete this e-mail from your computer.