Very strange Illegal Argument Exception

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
Pere
Posts: 400
Joined: Sat Jan 05, 2008 11:09 am
Location: Catalunya, Berguedà

Very strange Illegal Argument Exception

Post by Pere »

This is happening in my server since like 6 months ago, when ThreadPoolManager was updated (I get lots of them):

Code: Select all

08-jul-2010 12:49:01 l2tns.gameserver.model.actor.instance.L2PcInstance restoreEffectsADVERTENCIA: Could not restore L2PcInstance:Rizoku[269261888] active effect data: nulljava.lang.IllegalArgumentException	at java.util.concurrent.ScheduledThreadPoolExecutor.scheduleAtFixedRate(Unknown Source)	at l2tns.gameserver.ThreadPoolManager.scheduleEffectAtFixedRate(ThreadPoolManager.java:125)	at l2tns.gameserver.model.L2Effect.setFirstTime(L2Effect.java:278)	at l2tns.gameserver.model.actor.instance.L2PcInstance.restoreEffects(L2PcInstance.java:8500)	at l2tns.gameserver.model.actor.instance.L2PcInstance.restore(L2PcInstance.java:7634)	at l2tns.gameserver.model.actor.instance.L2PcInstance.load(L2PcInstance.java:1325)	at l2tns.gameserver.network.L2GameClient.loadCharFromDisk(L2GameClient.java:500)	at l2tns.gameserver.network.clientpackets.CharacterSelect.runImpl(CharacterSelect.java:92)	at l2tns.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:92)	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)
I know that this must be only in my fork, otherwise it would be fixed. But I can't get how the hell can I get an illegal argument exception having this on ThreadPoolManager.scheduleEffectAtFixedRate:

Code: Select all

			delay = ThreadPoolManager.validateDelay(delay);			initial = ThreadPoolManager.validateDelay(initial);			return _effectsScheduledThreadPool.scheduleAtFixedRate(r, initial, delay, TimeUnit.MILLISECONDS); 
where validateDelay() makes sure that these variables will NEVER cause IAE...

Any idea?
Bones tardes amics meus tots!
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Very strange Illegal Argument Exception

Post by janiii »

not only you:

http://l2jserver.com/trac/ticket/4750
http://l2jserver.com/trac/ticket/4630


if ( delay < 0 || period < = 0) { throw new IllegalArgumentException(); }
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: Very strange Illegal Argument Exception

Post by JIV »

I know that this must be only in my fork
happens all the time xD, its just ignored :)

problem is:

Code: Select all

        if (period <= 0)            throw new IllegalArgumentException();
period = delay


there were some discussion (i think in dev section) and posted some patches about it but wasnt tested on live.
User avatar
Pere
Posts: 400
Joined: Sat Jan 05, 2008 11:09 am
Location: Catalunya, Berguedà

Re: Very strange Illegal Argument Exception

Post by Pere »

Can you put here the possible patch? I will test it on live :P

Anyways, we have these validateDelay functions which avoid the arguments to be <= 0...

EDIT: Ah no, it moves it to 0! Then, instead "if (delay < 0) delay = 0;", we should put "if (delay <=0) delay = 1;".. or won't that work?
Bones tardes amics meus tots!
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: Very strange Illegal Argument Exception

Post by JIV »

cant find it :x
User avatar
Pere
Posts: 400
Joined: Sat Jan 05, 2008 11:09 am
Location: Catalunya, Berguedà

Re: Very strange Illegal Argument Exception

Post by Pere »

threadpoolmanager line ~100

Code: Select all

	public static long validateDelay(long delay)	{		if (delay < 0)			delay = 0;		else if (delay > MAX_DELAY)			delay = MAX_DELAY;		return delay;	}
Bones tardes amics meus tots!
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: Very strange Illegal Argument Exception

Post by JIV »

that patch , not method :)
User avatar
Pere
Posts: 400
Joined: Sat Jan 05, 2008 11:09 am
Location: Catalunya, Berguedà

Re: Very strange Illegal Argument Exception

Post by Pere »

Lol, then even being a patch, it is an unsuccessful one xD
Bones tardes amics meus tots!
Post Reply