任何人帮助我,
我将包net.java.sip.communicator.impl.gui.main.account
的一个方法 NewAccountDialog 调用到另一个包SimpleAccountRegistrationActivator
的{{1}}类中,但它会抛出以下异常......
java.lang.NoClassDefFoundError: net / java / sip / communicator / impl / gui / main / account / NewAccountDialog at net.java.sip.communicator.plugin.simpleaccreg.SimpleAccountRegistrationActivator $ LoginFrame $ 1.actionPerformed(SimpleAccountRegistrationActivator.java:302) 在javax.swing.AbstractButton.fireActionPerformed(未知来源)at javax.swing.AbstractButton $ Handler.actionPerformed(Unknown Source)at javax.swing.DefaultButtonModel.fireActionPerformed(未知来源)at javax.swing.DefaultButtonModel.setPressed(未知来源)at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(未知 来自)java.awt.Component.processMouseEvent(未知来源)at javax.swing.JComponent.processMouseEvent(未知来源)at java.awt.Component.processEvent(未知来源)at java.awt.Container.processEvent(未知来源)at java.awt.Component.dispatchEventImpl(未知来源)at java.awt.Container.dispatchEventImpl(未知来源)at java.awt.Component.dispatchEvent(未知来源)at java.awt.LightweightDispatcher.retargetMouseEvent(未知来源)at java.awt.LightweightDispatcher.processMouseEvent(未知来源)at java.awt.LightweightDispatcher.dispatchEvent(未知来源)at java.awt.Container.dispatchEventImpl(未知来源)at java.awt.Window.dispatchEventImpl(未知来源)at java.awt.Component.dispatchEvent(未知来源)at java.awt.EventQueue.dispatchEventImpl(未知来源)at java.awt.EventQueue.access $ 300(未知来源)at java.awt.EventQueue $ 3.run(未知来源)at java.awt.EventQueue $ 3.run(未知来源)at java.security.AccessController.doPrivileged(Native Method)at java.security.ProtectionDomain $ 1.doIntersectionPrivilege(未知 来源)at java.security.ProtectionDomain $ 1.doIntersectionPrivilege(未知 来自)java.awt.EventQueue $ 4.run(未知来源)at java.awt.EventQueue $ 4.run(未知来源)at java.security.AccessController.doPrivileged(Native Method)at java.security.ProtectionDomain $ 1.doIntersectionPrivilege(未知 来自)java.awt.EventQueue.dispatchEvent(未知来源)at java.awt.EventDispatchThread.pumpOneEventForFilters(未知来源) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) 在java.awt.EventDispatchThread.pumpEventsForHierarchy(未知 来自java.awt.EventDispatchThread.pumpEvents(未知来源) at java.awt.EventDispatchThread.pumpEvents(Unknown Source)at java.awt.EventDispatchThread.run(未知来源)引起: 抛出java.lang.ClassNotFoundException: net.java.sip.communicator.impl.gui.main.account.NewAccountDialog not not 发现者:net.java.sip.communicator.plugin.simpleaccreg [155] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1550) 在 org.apache.felix.framework.BundleWiringImpl.access $ 400(BundleWiringImpl.java:77) 在 org.apache.felix.framework.BundleWiringImpl $ BundleClassLoader.loadClass(BundleWiringImpl.java:1988) 在java.lang.ClassLoader.loadClass(未知来源)... 37更多
答案 0 :(得分:0)
Jiti使用OSGI框架和Apache Felix Client。所以基本上当你在build.xml上应用run命令时,它会创建一堆jar。
现在,当类在编译时可用但在运行时不可用时,NoClassDefFoundError会上升。因此,由于罐子的包装,他们两个班级将进入不同的罐子。所以,这个错误上升。
解决方案:现在猜测A类通过导入B类外部引发错误。
find Class A's parent package and search for its manifest file if you are not able to find its manifest file than go to parent of that package. Continue this steps until you find its manifest file.
In manifest file import package of Class B.
find Class B's parent package and search for its manifest file if you are not able to find its manifest file than go to parent of that package. Continue this steps until you find its manifest file.
In manifest file export package of Class B.
there are some rules for editing manifest file. So,before editing please read it .