You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by MARollins <ma...@computer.org> on 2007/08/24 11:23:33 UTC
Tomcat & commons.net FTPClient
Hi,
I've written an application to download and process a set of files using
commons.net FTPClient. This runs fine from in a standalone application.
However, when I incorporate it into a web app (Tomcal/Struts/Spring) it
fails on the constructor of FTPClient, ie.
FTPClient ftp=new FTPClient();
Using a debugger I can see that it doesn't even enter the constructor, which
makes me think it is a class loader problem, but the exception I get is as
follows...
java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
org.apache.struts2.interceptor.BackgroundProcess$1.run(BackgroundProcess.java:56)
java.lang.Thread.run(Thread.java:595)
The whole application is running on my local PC (ie webserver, FTPServer).
I'm not starting Tomcat with a security policy (as far as I am aware,
anyway).
Any suggestions gratefully received!
Thanks
--
View this message in context: http://www.nabble.com/Tomcat---commons.net-FTPClient-tf4322563.html#a12309189
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat & commons.net FTPClient
Posted by MARollins <ma...@computer.org>.
DOH!
Yes, it was a classloading problem. I had assumed the IDE had packaged
commons net in the web app but it hadn't.
MARollins wrote:
>
> Hi,
> I've written an application to download and process a set of files using
> commons.net FTPClient. This runs fine from in a standalone application.
>
> However, when I incorporate it into a web app (Tomcal/Struts/Spring) it
> fails on the constructor of FTPClient, ie.
>
> FTPClient ftp=new FTPClient();
>
> Using a debugger I can see that it doesn't even enter the constructor,
> which makes me think it is a class loader problem, but the exception I get
> is as follows...
>
> java.lang.reflect.InvocationTargetException
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:585)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
>
> org.apache.struts2.interceptor.BackgroundProcess$1.run(BackgroundProcess.java:56)
> java.lang.Thread.run(Thread.java:595)
>
> The whole application is running on my local PC (ie webserver, FTPServer).
> I'm not starting Tomcat with a security policy (as far as I am aware,
> anyway).
>
> Any suggestions gratefully received!
>
> Thanks
>
>
--
View this message in context: http://www.nabble.com/Tomcat---commons.net-FTPClient-tf4322563.html#a12309772
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org