Exceptioninthread"AWT-EventQueue-0"java.lang错误 - 爱问答

(爱问答)

Exceptioninthread"AWT-EventQueue-0"java.lang错误

Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError

at cn.edu.njpi.gjp.dao.SortDao.<init>(SortDao.java:13)

at cn.edu.njpi.gjp.services.SortService.<init>(SortService.java:9)

at cn.edu.njpi.gjp.controller.SortMngController.<init>(SortMngController.java:13)

at cn.edu.njpi.gjp.controller.MainFrameContrller.sortMng(MainFrameContrller.java:14)

at cn.edu.njpi.gjp.view.AbstractMainFrame$2.actionPerformed(AbstractMainFrame.java:82)

at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)

at java.awt.Component.processMouseEvent(Unknown Source)

at javax.swing.JComponent.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Window.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEventImpl(Unknown Source)

at java.awt.EventQueue.access$500(Unknown Source)

at java.awt.EventQueue$3.run(Unknown Source)

at java.awt.EventQueue$3.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$javaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)

at java.security.ProtectionDomain$javaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)

at java.awt.EventQueue$4.run(Unknown Source)

at java.awt.EventQueue$4.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$javaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

Caused by: java.lang.NullPointerException

at java.util.Properties$LineReader.readLine(Unknown Source)

at java.util.Properties.load0(Unknown Source)

at java.util.Properties.load(Unknown Source)

at cn.edu.njpi.gjp.tools.JDBCUtils.<clinit>(JDBCUtils.java:26)

... 41 more


 

你这个错误太明显了,不知道你是不是想使用递归,使用递归的话,必须要能够收缩。

但是,你这个地方,每次进入hitTanks方法时,传入的参数都是badTanks,而且,badTanks中的内容数量没有任何的改变。

从你的代码上看,你不应该是要递归调用hitTanks方法,而应该是调用hitTan方法,下面为修改后的代码

public boolean hitTanks(List<Tank> badTanks) {

for (Iterator iterator = badTanks.iterator(); iterator.hasNext();) {

Tank badTanks1 = (Tank) iterator.next();

boolean b=hitTan(badTanks1); // 这一行进行了修改,修改为调用hitTan方法

if(b){

return true;

}

}return false;

}


相关标签:java

下一篇:tp3.2的报错net::ERR_NAME_NOT_RESOLVED

上一篇:二进制代码的码元速率为2000baud,则HDB3码的速率为多少?

热门标签:
excel 网盘 破解 word dll
最新更新:
微软重新评估新的Outlook的使用时机 联想推出搭载联发科Helio G80芯片组的Tab M9平板 英特尔创新大赛时间确定! 微软Edge浏览器在稳定渠道中推出Workspaces功能 英伟达RTX4060TiGPU推出MaxSun动漫主题! 谷歌地图为用户提供了街景服务! GameSir 在T4 Kaleid中推出了一款出色的控制器! 微软开始在Windows 11 中测试其画图应用程序的新深色模式! LG电子推出全球首款无线OLED电视 英伟达人工智能芯片崭露头角! Steam Deck可以玩什么游戏-Steam Deck价格限时优惠 雷蛇推出CobraPro鼠标 Kindle电子阅读器可以访问谷歌商店吗 Windows10如何加入组策略 window10图片查看器怎么没有了?