Jump to content
  • 0

Game server console error


DocuWin

Question

Hi to all developers i have this console error when i target any npc in my server (acis pack) can any one help me?

 

 

Failed reading: [C] Action ; java.lang.NullPointerException
        at com.l2jmega.gameserver.instancemanager.RaidBossInfoManager.getRaidBossRespawnTime(RaidBossInfoManager.java:78)
        at com.l2jmega.gameserver.model.actor.Npc.horus(Npc.java:1983)
        at com.l2jmega.gameserver.model.actor.Npc.showChatWindow(Npc.java:1498)
        at com.l2jmega.gameserver.model.actor.Npc.showChatWindow(Npc.java:1437)
        at com.l2jmega.gameserver.model.actor.Npc.onAction(Npc.java:524)
        at com.l2jmega.gameserver.network.clientpackets.Action.runImpl(Action.java:117)
        at com.l2jmega.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:52)
        at com.l2jmega.gameserver.network.L2GameClient.run(L2GameClient.java:843)
        at com.l2jmega.commons.concurrent.ThreadPool$TaskWrapper.run(ThreadPool.java:224)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

Edited by Vision
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
6 hours ago, DocuWin said:

Hi to all developers i have this console error when i target any npc in my server (acis pack) can any one help me?

 

 

Failed reading: [C] Action ; java.lang.NullPointerException
        at com.l2jmega.gameserver.instancemanager.RaidBossInfoManager.getRaidBossRespawnTime(RaidBossInfoManager.java:78)
        at com.l2jmega.gameserver.model.actor.Npc.horus(Npc.java:1983)
        at com.l2jmega.gameserver.model.actor.Npc.showChatWindow(Npc.java:1498)
        at com.l2jmega.gameserver.model.actor.Npc.showChatWindow(Npc.java:1437)
        at com.l2jmega.gameserver.model.actor.Npc.onAction(Npc.java:524)
        at com.l2jmega.gameserver.network.clientpackets.Action.runImpl(Action.java:117)
        at com.l2jmega.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:52)
        at com.l2jmega.gameserver.network.L2GameClient.run(L2GameClient.java:843)
        at com.l2jmega.commons.concurrent.ThreadPool$TaskWrapper.run(ThreadPool.java:224)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

Few things about the pack:

the pack you using has alot of problems and backdoors, i recommend you to find a developer to help you remove them

 

Few things about the error:

its a common NPE in Brasil people have got use to it and ignore them you did some action on this Horus boss and the developer did not predict that in some place the code would be "null" so here you have it, adding a null check will solve this

 

Few things on how to find that error:

look closely the error says that was generated on

com.l2jmega.gameserver.instancemanager.RaidBossInfoManager.getRaidBossRespawnTime(RaidBossInfoManager.java:78)

this gives you the place and the line to look what happent

respectively RaidBossInfoManager.java:78

so looking at this file on that line is what you have to do, then if you dont know what to do come back here and ask what to do on those lines.

OR

pay a developer to do this for you

 

:summon:@Kara br pack your expertise

Link to comment
Share on other sites

  • 0
18 hours ago, DocuWin said:

Hi to all developers i have this console error when i target any npc in my server (acis pack) can any one help me?

 

 

Failed reading: [C] Action ; java.lang.NullPointerException
        at com.l2jmega.gameserver.instancemanager.RaidBossInfoManager.getRaidBossRespawnTime(RaidBossInfoManager.java:78)
        at com.l2jmega.gameserver.model.actor.Npc.horus(Npc.java:1983)
        at com.l2jmega.gameserver.model.actor.Npc.showChatWindow(Npc.java:1498)
        at com.l2jmega.gameserver.model.actor.Npc.showChatWindow(Npc.java:1437)
        at com.l2jmega.gameserver.model.actor.Npc.onAction(Npc.java:524)
        at com.l2jmega.gameserver.network.clientpackets.Action.runImpl(Action.java:117)
        at com.l2jmega.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:52)
        at com.l2jmega.gameserver.network.L2GameClient.run(L2GameClient.java:843)
        at com.l2jmega.commons.concurrent.ThreadPool$TaskWrapper.run(ThreadPool.java:224)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

 

Post the getRaidBossRespawnTime.java here. 

Link to comment
Share on other sites

  • 0

@Kara

 

 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package com.l2jmega.gameserver.instancemanager;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;

import com.l2jmega.L2DatabaseFactory;

/**
 * @author rapfersan92
 */
public class RaidBossInfoManager
{
    private static final Logger _log = Logger.getLogger(RaidBossInfoManager.class.getName());
    
    private final Map<Integer, Long> _raidBosses;
    
    public static RaidBossInfoManager getInstance()
    {
        return SingletonHolder._instance;
    }
    
    protected RaidBossInfoManager()
    {
        _raidBosses = new ConcurrentHashMap<>();
        load();
    }
    
    public void load()
    {
        try (Connection con = L2DatabaseFactory.getInstance().getConnection())
        {
            PreparedStatement statement;
            ResultSet rs;
            
            statement = con.prepareStatement("SELECT boss_id, respawn_time FROM grandboss_data UNION SELECT boss_id, respawn_time FROM raidboss_spawnlist ORDER BY boss_id");
            rs = statement.executeQuery();
            while (rs.next())
            {
                int bossId = rs.getInt("boss_id");
                    _raidBosses.put(bossId, rs.getLong("respawn_time"));
            }
            rs.close();
            statement.close();
        }
        catch (Exception e)
        {
            _log.warning("Exception: RaidBossInfoManager load: " + e);
        }
        
        _log.info("RaidBossInfoManager: Loaded " + _raidBosses.size() + " instances.");
    }
    
    public void updateRaidBossInfo(int bossId, long respawnTime)
    {
        _raidBosses.put(bossId, respawnTime);
    }
    
    public long getRaidBossRespawnTime(int bossId)
    {
        return _raidBosses.get(bossId);
    }
    
    private static class SingletonHolder
    {
        protected static final RaidBossInfoManager _instance = new RaidBossInfoManager();
    }
}
 

Link to comment
Share on other sites

  • 0

getRaidBossRespawnTime return null because there is no such boss info. So basically it load data from SQL but for that specific ID (idk which) there is no info so it return null, either replace with a null check and return 0 or do your check at that method.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...