Page 1 of 2

SEVERE: Failed executing HitTask.

Posted: Wed May 27, 2009 6:01 am
by Bruteforce
Do not forget to add your Server and Datapack Revision numbers!
» Find Revision
L2J Revision Number: Last Gracia 2.2
L2JDP Revision Number: Last Gracia 2.2

I once again got this error when a player got killed when having karma:

Code: Select all

2009-maj-27 00:07:13 net.sf.l2j.gameserver.model.actor.L2Character$HitTask runSEVERE: Failed executing HitTask.java.lang.ArrayIndexOutOfBoundsException: 14    at javolution.util.FastCollection.toArray(FastCollection.java:359)    at net.sf.l2j.gameserver.model.itemcontainer.ItemContainer.getItems(ItemContainer.java:79)    at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.onDieDropItem(L2PcInstance.java:5187)    at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.doDie(L2PcInstance.java:5041)    at net.sf.l2j.gameserver.model.actor.status.CharStatus.reduceHp(CharStatus.java:241)    at net.sf.l2j.gameserver.model.actor.status.PlayableStatus.reduceHp(PlayableStatus.java:41)    at net.sf.l2j.gameserver.model.actor.status.PcStatus.reduceHp(PcStatus.java:113)    at net.sf.l2j.gameserver.model.actor.status.PcStatus.reduceHp(PcStatus.java:43)    at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.reduceCurrentHp(L2PcInstance.java:10607)    at net.sf.l2j.gameserver.model.actor.L2Character.onHitTimer(L2Character.java:5162)    at net.sf.l2j.gameserver.model.actor.L2Character$HitTask.run(L2Character.java:2388)    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)    at java.util.concurrent.FutureTask.run(FutureTask.java:138)    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)    at java.lang.Thread.run(Thread.java:619) 
And as always when I get this error, the CPU usage goes to 100% and stays there until I reboot server.
I still don't know why I get this, or how to fix it, and now I'm asking if this is something that will be fixed in Gracia 2.3.
I would much appreciate if someone could help me out.
Thanks so much in advance!

Re: SEVERE: Failed executing HitTask.

Posted: Wed May 27, 2009 9:35 am
by _DS_
2.2 not supported now, moving.

Re: SEVERE: Failed executing HitTask.

Posted: Wed May 27, 2009 10:44 am
by Bruteforce
_DS_ wrote:2.2 not supported now, moving.
So, should I take this as a 'Yes, it's been fixed in 2.3'?
If not, it's still valid for the bug-section, I think.

Re: SEVERE: Failed executing HitTask.

Posted: Wed May 27, 2009 12:14 pm
by DrHouse
He means that support is limited and only in this forum.

Lets see if we can avoid synchronization to fix this problem. Please try this patch:

Code: Select all

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java===================================================================--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 3078)+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (working copy)@@ -5318,6 +5318,8 @@            }              int dropCount = 0;+            final L2ItemInstance[] items = getInventory().getItems();+                        while (dropPercent > 0 && Rnd.get(100) < dropPercent && dropCount < dropLimit)            {                 int itemDropPercent = 0;@@ -5327,8 +5329,11 @@                nonDroppableList = Config.KARMA_LIST_NONDROPPABLE_ITEMS;                nonDroppableListPet = Config.KARMA_LIST_NONDROPPABLE_ITEMS; -               for (L2ItemInstance itemDrop : getInventory().getItems())+               for (L2ItemInstance itemDrop : items)                {+                   if (itemDrop == null)+                       continue;+                                       // Don't drop                    if (                            itemDrop.isShadowItem() || // Dont drop Shadow Items 

Re: SEVERE: Failed executing HitTask.

Posted: Wed May 27, 2009 8:05 pm
by Bruteforce
Thanks a lot! I will try it asap!

Re: SEVERE: Failed executing HitTask.

Posted: Wed May 27, 2009 10:24 pm
by DrHouse
Thanks for testing. I have just realized that code above could make drop an item multiple times. If possible, try this one:

Code: Select all

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java===================================================================--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 3078)+++java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java    (working copy)@@ -106,6 +106,7 @@ import net.sf.l2j.gameserver.model.MacroList; import net.sf.l2j.gameserver.model.ShortCuts; import net.sf.l2j.gameserver.model.TradeList;+import net.sf.l2j.gameserver.model.L2ItemInstance.ItemLocation; import net.sf.l2j.gameserver.model.L2Skill.SkillTargetType; import net.sf.l2j.gameserver.model.actor.L2Attackable; import net.sf.l2j.gameserver.model.actor.L2Character;@@ -5318,17 +5319,22 @@            }              int dropCount = 0;+            final L2ItemInstance[] items = getInventory().getItems();+                        while (dropPercent > 0 && Rnd.get(100) < dropPercent && dropCount < dropLimit)            {                 int itemDropPercent = 0;-               List<Integer> nonDroppableList = new FastList<Integer>();-               List<Integer> nonDroppableListPet = new FastList<Integer>();+               List<Integer> nonDroppableList = Config.KARMA_LIST_NONDROPPABLE_ITEMS;;+               List<Integer> nonDroppableListPet = Config.KARMA_LIST_NONDROPPABLE_ITEMS; -               nonDroppableList = Config.KARMA_LIST_NONDROPPABLE_ITEMS;-               nonDroppableListPet = Config.KARMA_LIST_NONDROPPABLE_ITEMS;--               for (L2ItemInstance itemDrop : getInventory().getItems())+               for (L2ItemInstance itemDrop : items)                {+                   // Using a single array for every while loop iteration could provoke to drop an item twice+                   if (itemDrop == null +                           || itemDrop.getLastChange() == L2ItemInstance.REMOVED +                           || itemDrop.getLocation() == ItemLocation.VOID)+                       continue;+                                       // Don't drop                    if (                            itemDrop.isShadowItem() || // Dont drop Shadow Items 
Some parts of it will be commited to trunk either it fixes the problem or it doesnt

Re: SEVERE: Failed executing HitTask.

Posted: Thu May 28, 2009 9:13 am
by Bruteforce
Sorry, can't apply this patch.
Eclipse doesn't recognize it as a patch.
I then tried to apply it manually, but I get an error saying "itemDrop cannot be resolved".

Also, should there be two ; at the end of this line?

Code: Select all

List<Integer> nonDroppableList = Config.KARMA_LIST_NONDROPPABLE_ITEMS;;
Thanks for trying to help!

Edit: I just wanted to add, that I try to apply this on the latest 2.3 svn, since that's the version I'm working on to go live with tomorrow! :)

Re: SEVERE: Failed executing HitTask.

Posted: Thu May 28, 2009 9:52 pm
by Bruteforce
I don't know what I did wrong the first time, but now the second try I could apply the patch manually! :)

Thanks, will let you know my findings!

Re: SEVERE: Failed executing HitTask.

Posted: Fri May 29, 2009 9:00 am
by DrHouse
:D

Re: SEVERE: Failed executing HitTask.

Posted: Mon Jun 01, 2009 9:24 am
by Bruteforce
Sorry, but didn't work. Still got 100% CPU after someone cleansed himself of karma by getting killed.

BTW, sometimes the karma isn't reduced upon death, it stays the same. Maybe this is what is causing the server to raise in CPU?

And, I'm running this on Gracia Final now, so this thread may be moved to bugg-section again! :)

Server Version= 3116
Datapack Version= 6189

Re: SEVERE: Failed executing HitTask.

Posted: Mon Jun 01, 2009 6:30 pm
by Bruteforce
I'm now starting to think it has something to do with when they are killed by guards.
Got a player who died time after time, dropping stuff all over, but no lag.
Then he started killing himself on a guard, and voila!

Edit: BTW, this time I never got an error in the console!

Re: SEVERE: Failed executing HitTask.

Posted: Mon Jun 01, 2009 8:57 pm
by DrHouse
So the second patch fixed the console output but lag stays, right?

Re: SEVERE: Failed executing HitTask.

Posted: Tue Jun 02, 2009 7:03 am
by Notorious
Yes, you could say that! :)

Re: SEVERE: Failed executing HitTask.

Posted: Wed Jun 03, 2009 6:10 am
by Bruteforce
I found the problem now!!! :)
It occurs when the player has no items at all left to drop, and is killed.
On first kill with no items to drop, CPU went to about 50%.
Second time it went to 100%.

So maybe there needs to be some check to see if there are any more to drop before trying to drop items when killed having karma.

I had one augmented weapon on me that I still had left.
I will remove this, and try again, just to make sure! :)

Oh, and btw... Sometimes when I try to click to pick up the items from the ground, it sais I failed to pick it up, but if I use the pick-up action-button, it picks it up normally.

Edit: Tested with no augmented weapon, and only 2 items to drop. I have it set to drop 5 items. And I got the CPU high again. So when the player can't drop the number of items set in rates.properties, ie he has less items in inventory/paperdoll, you have the problem.

Thanks you oh so so much, for fixing this!

And I use Gracia Final,
L2J Revision Number: 3124
L2JDP Revision Number: 6201

Re: SEVERE: Failed executing HitTask.

Posted: Wed Jun 03, 2009 6:37 am
by janiii
Bruteforce wrote:I found the problem now!!! :)
Thanks you oh so so much, for fixing this!
very nice catch and that you found the problem! thx to you! :)

(i already looked at the problem, yes, it just loops without the end, because he cannot drop the max amount that should be dropped)