If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision 3886:
L2JDP Revision 6988:
java.lang.NullPointerException
at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.doAutoLoot(L2PcInstance.java:4747)
at com.l2jserver.gameserver.model.actor.L2Attackable.doItemDrop(L2Attackable.java:1481)
at com.l2jserver.gameserver.model.actor.L2Attackable.doItemDrop(L2Attackable.java:1392)
at com.l2jserver.gameserver.model.actor.L2Attackable.calculateRewards(L2Attackable.java:538)
at com.l2jserver.gameserver.model.actor.L2Character.doDie(L2Character.java:2086)
at com.l2jserver.gameserver.model.actor.L2Npc.doDie(L2Npc.java:2667)
at com.l2jserver.gameserver.model.actor.L2Attackable.doDie(L2Attackable.java:466)
at com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance.doDie(L2MonsterInstance.java:204)
at com.l2jserver.gameserver.model.actor.status.CharStatus.reduceHp(CharStatus.java:196)
at com.l2jserver.gameserver.model.actor.status.NpcStatus.reduceHp(NpcStatus.java:51)
at com.l2jserver.gameserver.model.actor.status.AttackableStatus.reduceHp(AttackableStatus.java:49)
at com.l2jserver.gameserver.model.actor.L2Character.reduceCurrentHp(L2Character.java:6792)
at com.l2jserver.gameserver.model.actor.L2Attackable.reduceCurrentHp(L2Attackable.java:437)
at com.l2jserver.gameserver.model.actor.L2Attackable.reduceCurrentHp(L2Attackable.java:373)
at handlers.skillhandlers.Mdam.useSkill(Mdam.java:175)
at com.l2jserver.gameserver.model.actor.L2Character.callSkill(L2Character.java:6433)
at com.l2jserver.gameserver.model.actor.L2Character.onMagicHitTimer(L2Character.java:6138)
at com.l2jserver.gameserver.model.actor.L2Character$MagicUseTask.run(L2Character.java:2534)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Can you give me some idea to why?
I get this error sometime...
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
- Stake
- Posts: 383
- Joined: Sun Mar 23, 2008 9:33 pm
- Location: Hungary
- Contact:
Re: I get this error sometime...
"java.lang.NullPointerException
at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.doAutoLoot(L2PcInstance.java:4747)"
You should take a look at this doAutoLoot function. It may have got an attackable instance as value that is null.
at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.doAutoLoot(L2PcInstance.java:4747)"
You should take a look at this doAutoLoot function. It may have got an attackable instance as value that is null.


-
- Posts: 71
- Joined: Mon Sep 28, 2009 4:51 am
Re: I get this error sometime...
If it is possible cause this error some server lag? Maybe the server doesn't reach the database for a sec?
Another.... is it possible to catch the error? i need some debug information.... and some advice how i can?
Another.... is it possible to catch the error? i need some debug information.... and some advice how i can?
- Stake
- Posts: 383
- Joined: Sun Mar 23, 2008 9:33 pm
- Location: Hungary
- Contact:
Re: I get this error sometime...
Server loads everything into the memory on start. It uses database only for writing. Put a try-catch in doAutoLoot and under catch execute some variable value to be written in the console.adamss wrote:If it is possible cause this error some server lag? Maybe the server doesn't reach the database for a sec?
Another.... is it possible to catch the error? i need some debug information.... and some advice how i can?


-
- Posts: 71
- Joined: Mon Sep 28, 2009 4:51 am
Re: I get this error sometime...
Code: Select all
public void doAutoLoot(L2Attackable target, L2Attackable.RewardItem item) { try { if (isInParty()&&ItemTable.getInstance().getTemplate(item.getItemId()).getItemType() != L2EtcItemType.HERB) getParty().distributeItem(this, item, false, target); else if (item.getItemId() == 57) addAdena("Loot", item.getCount(), target, true); else addItem("Loot", item.getItemId(), item.getCount(), target, true); } catch (Exception e) { _log.warning("Target: "+target); _log.warning("Reward item: "+item); _log.warning("isInParty: "+isInParty()); _log.warning("ItemCheck: "+ItemTable.getInstance().getTemplate(item.getItemId()).getItemType()); } finally { try { con.close(); } catch (Exception e) {} } }
You mean something like this?
-
- L2j Veteran
- Posts: 3437
- Joined: Wed Apr 30, 2008 8:53 am
- Location: Russia
Re: I get this error sometime...
And where is the line 4747 ?
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
public static final int PI = 3.1415926535897932384626433832795;
- Stake
- Posts: 383
- Joined: Sun Mar 23, 2008 9:33 pm
- Location: Hungary
- Contact:
Re: I get this error sometime...
That's what he hasn't told us yet._DS_ wrote:And where is the line 4747 ?

it shows under doAutoLoot to me, so adamss may have some patches in L2PcInstance.


-
- Posts: 71
- Joined: Mon Sep 28, 2009 4:51 am
Re: I get this error sometime...
yeah, i have some modification.. 
line 4747: "if (isInParty()&&ItemTable.getInstance().getTemplate(item.getItemId()).getItemType() != L2EtcItemType.HERB)
"

line 4747: "if (isInParty()&&ItemTable.getInstance().getTemplate(item.getItemId()).getItemType() != L2EtcItemType.HERB)
"
- Stake
- Posts: 383
- Joined: Sun Mar 23, 2008 9:33 pm
- Location: Hungary
- Contact:
Re: I get this error sometime...
Java is very sensitive for exceptions, so I think it may be ItemTable.getInstance().getTemplate(item.getItemId()) that returns null at this line, but you don't need to worry. Just put an empty or a one line warning for the catch and there will be no more multi-line errors for you.adamss wrote:yeah, i have some modification..
line 4747: "if (isInParty()&&ItemTable.getInstance().getTemplate(item.getItemId()).getItemType() != L2EtcItemType.HERB)
"

So it'd better solution than making checks for each function. If Java finds an exception it will stop at that line and not query lines under that exception is found at.

