类未发现异常?

发布于 2024-08-09 20:42:13 字数 2744 浏览 10 评论 0原文

好吧,我很困惑。昨天它工作得很好。今天突然我开始收到错误。主框架打开得很好,前几个按钮也可以工作。只是最后三个突然不起作用了。当我尝试单击这些按钮(应该打开新窗口)时,出现以下错误

线程“AWT-EventQueue-0”中出现异常 java.lang.NoClassDefFoundError: my/freelancebillingapp/paidStatusUI 在 my.freelancebillingapp.FreelanceBillingUI.paidClicked(FreelanceBillingUI.java:251) 在 my.freelancebillingapp.FreelanceBillingUI.access$200(FreelanceBillingUI.java:18) 在 my.freelancebillingapp.FreelanceBillingUI$3.mouseClicked(FreelanceBillingUI.java:89) 在 java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253) 在 java.awt.Component.processMouseEvent(Component.java:6266) 在 javax.swing.JComponent.processMouseEvent(JComponent.java:3267) 在 java.awt.Component.processEvent(Component.java:6028) 在 java.awt.Container.processEvent(Container.java:2041) 在 java.awt.Component.dispatchEventImpl(Component.java:4630) 在 java.awt.Container.dispatchEventImpl(Container.java:2099) 在 java.awt.Component.dispatchEvent(Component.java:4460) 在java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) 在java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247) 在java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) 在 java.awt.Container.dispatchEventImpl(Container.java:2085) 在 java.awt.Window.dispatchEventImpl(Window.java:2475) 在 java.awt.Component.dispatchEvent(Component.java:4460) 在 java.awt.EventQueue.dispatchEvent(EventQueue.java:599) 在java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) 在 java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) 在java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) 在java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) 在java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) 在 java.awt.EventDispatchThread.run(EventDispatchThread.java:122) 引起:java.lang.ClassNotFoundException:my.freelancebillingapp.paidStatusUI 在 java.net.URLClassLoader$1.run(URLClassLoader.java:200) 在 java.security.AccessController.doPrivileged(本机方法) 在 java.net.URLClassLoader.findClass(URLClassLoader.java:188) 在 java.lang.ClassLoader.loadClass(ClassLoader.java:307) 在 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) 在 java.lang.ClassLoader.loadClass(ClassLoader.java:252) 在 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 24 更多

与昨天工作正常时相比,代码中没有任何变化。我可以打开所有单独的java文件,它们都打开得很好,代码与以前相同..发生了什么?

Ok, I am very confused. Yesterday it worked just fine. Today suddenly I start getting an error. The main frame opens just fine and the first few buttons work. Just the last three suddenly do not work. I get the following error when I try to click those buttons (which should open new windows)

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: my/freelancebillingapp/paidStatusUI
at my.freelancebillingapp.FreelanceBillingUI.paidClicked(FreelanceBillingUI.java:251)
at my.freelancebillingapp.FreelanceBillingUI.access$200(FreelanceBillingUI.java:18)
at my.freelancebillingapp.FreelanceBillingUI$3.mouseClicked(FreelanceBillingUI.java:89)
at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
at java.awt.Component.processMouseEvent(Component.java:6266)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6028)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.ClassNotFoundException: my.freelancebillingapp.paidStatusUI
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 24 more

Nothing has changed in the code from yesterday when it was working fine. I can open all the individual java files and they all open just fine, code is the same as it was.. WTF happened?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

不知在何时 2024-08-16 20:42:13

my.freelancebillingapp.paidStatusUI 是什么?这是一个班级吗?如果是,它应该以大写字母开头,但这实际上是一个旁注。但是,您可能在某个地方遇到了案例问题。可以和文件名一起吗?

What is my.freelancebillingapp.paidStatusUI? Is this a class? If yes, it should start with an uppercase letter but that's actually a side note. However, you likely have a case issue somewhere. Could it be with the file name?

灼痛 2024-08-16 20:42:13

如果您确实没有更改类和/或源文件名的大小写,我怀疑实际问题与您的类路径有关。例如,您的类路径可能显式或隐式包含当前目录,并且在某些时候您更改了当前目录;例如在编译和运行你的类之间。或者您可能只是使用不同的类路径来编译和运行代码。

对于 Java 新手来说,类路径混乱以及类与源文件命名不一致都是常见问题。

If you really didn't change the capitalization of your classes and/or source file names, I suspect that the actual problem is something to do with your classpath. For example, your classpath may explicitly or implicitly include the current directory, and that at some point you changed your current directory; e.g. between compiling and running your class. Or maybe you are simply using different classpaths to compile and run your code.

Classpath confusion and inconsistent class versus source file naming are both common problems for people who are new to Java.

轮廓§ 2024-08-16 20:42:13

我在使用 NetBeans 时就遇到过这种情况。当内存不足时,它会在编译时崩溃,并且项目突然不再识别所有类。解决这个问题的唯一方法就是你所做的——删除该类,然后重新添加它。

抱歉,这里没有答案,只是同情。

I've had that happen using NetBeans. When memory gets low, it barfs on the compile and the project suddenly no longer recognizes all the classes. The only way to fix it is what you did -- remove the class and then re-add it.

Sorry, no answer here, just commiseration.

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