无法在tomcat服务器中运行FTPServer java文件

发布于 2024-11-28 11:34:42 字数 1132 浏览 1 评论 0原文

我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

深居我梦 2024-12-05 11:34:42

正如您所提到的,您的 .java 文件名是 ftpserver.java 这意味着您的类名必须是

public class ftpserver{

}

所以请尝试调用一个对象,祝

ftpserver ftps = new ftpserver();

您好运

As you have mentioned your .java file name is ftpserver.java that means your class name must be

public class ftpserver{

}

So try invoking an object as

ftpserver ftps = new ftpserver();

good luck

扶醉桌前 2024-12-05 11:34:42

我找到了解决方案,由于包它造成了冲突,现在它工作正常

I found the solution, due to the package it was creating an conflict now its working fine

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文