无法在tomcat服务器中运行FTPServer java文件
我的 FTPserver 在新部署的 /folder/ftpserver.java 中运行,但在此之前意味着在之前部署的服务中,它被放置在 /folder/folder1/folder2/ftpserver 中。
即使更改路径并在新路径中运行 ftpserver 后,tomcat6 服务器仍采用旧的并抛出错误,提示
Exception in thread "main" java.lang.NoClassDefFoundError: FTPServer (wrong name: Contact/share/sockclass/FTPServer)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: FTPServer. Program will exit.
我如何解决此问题,请帮助我,我是 tomcat 的新手。
My FTPserver is running in /folder/ftpserver.java in the newly deployed but before that means in the previous services deployed it was placed in /folder/folder1/folder2/ftpserver.
Even after changing the path and running the ftpserver in the new path, the tomcat6 server is taken the old and throwing the error which says
Exception in thread "main" java.lang.NoClassDefFoundError: FTPServer (wrong name: Contact/share/sockclass/FTPServer)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: FTPServer. Program will exit.
how do i resolve this problem kindly help me I am novice for tomcat.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如您所提到的,您的 .java 文件名是 ftpserver.java 这意味着您的类名必须是
所以请尝试调用一个对象,祝
您好运
As you have mentioned your .java file name is ftpserver.java that means your class name must be
So try invoking an object as
good luck
我找到了解决方案,由于包它造成了冲突,现在它工作正常
I found the solution, due to the package it was creating an conflict now its working fine