Skip to content

[Help] Error While Restoring Clans!

Featured Replies

Hello everybody !

 

After every server restart clans can't be restored.

The error is :

 

Error while restoring clan : java.lang.NullPointerException

(This error is repeated for every clan)

the next line is :

Restored 8 clans from database

clan exists in clan_data but is like there is not!

 

It comes from net.sf.l2j.gameserver.model.L2Clan.java and the file is 100% unmodified!

I am sure I was using this pack in the past without problems. Now I just re-compiled the source!

 

I was thinking if it's the problem comes from jdk version but I tried to run the server and compile the source with jdk6 , jdk7 and jdk8

 

Any idea? thank you in advance

Edited by Spidey*

Check log folder for detailed info about the npe. Then check that file and provide the line. And whats the pack.

  • Author

the error is not saved in the error log.

just another one coming from clans

 

 

java.lang.NullPointerException
    at net.sf.l2j.gameserver.model.L2Clan.setLevel(L2Clan.java:805)
    at net.sf.l2j.gameserver.model.L2Clan.changeLevel(L2Clan.java:2385)
    at net.sf.l2j.gameserver.model.L2Clan.levelUpClan(L2Clan.java:2359)
    at net.sf.l2j.gameserver.model.actor.instance.L2VillageMasterInstance.onBypassFeedback(L2VillageMasterInstance.java:155)
    at net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:350)
    at net.sf.l2j.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:82)
    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)
7 Ìáú 2015 2:52:25 ìì net.sf.l2j.gameserver.network.clientpackets.RequestBypassToServer runImpl

pack is old based in L2jteon as far I remember

  • Author

 

  
public void setLevel(int level)
    {
        _level = level;
        if(_forum == null)
        {
            if(_level >= 2)
            {
                _forum = ForumsBBSManager.getInstance().getForumByName("ClanRoot").getChildByName(_name);
                if(_forum == null) // Line 806
                {
                    _forum = ForumsBBSManager.getInstance().createNewForum(_name,ForumsBBSManager.getInstance().getForumByName("ClanRoot"),Forum.CLAN,Forum.CLANMEMBERONLY,getClanId());
                }
            }
        }
    }
I see it's ok ( I never modified this file , and it was working fine)
  • Author

sorry for double post .

I tried //pledge setlevel 1 and it works fine

//pledge setlevel 2-5 is not!

 

java.lang.NullPointerException
        at net.sf.l2j.gameserver.model.L2Clan.setLevel(L2Clan.java:805)
        at net.sf.l2j.gameserver.model.L2Clan.changeLevel(L2Clan.java:2385)
        at net.sf.l2j.gameserver.handler.admincommandhandlers.AdminPledge.useAd
minCommand(AdminPledge.java:120)
        at net.sf.l2j.gameserver.network.clientpackets.SendBypassBuildCmd.runIm
pl(SendBypassBuildCmd.java:68)
        at net.sf.l2j.gameserver.network.clientpackets.L2GameClientPacket.run(L
2GameClientPacket.java:82)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

Put this

                if(_forum == null) // Line 806
                {
                    _forum = ForumsBBSManager.getInstance().createNewForum(_name,ForumsBBSManager.getInstance().getForumByName("ClanRoot"),Forum.CLAN,Forum.CLANMEMBERONLY,getClanId());
                }

Under if (_forum != null)

            if (_forum != null)
            {
                if(_forum == null) // Line 806
                {
                    _forum = ForumsBBSManager.getInstance().createNewForum(_name,ForumsBBSManager.getInstance().getForumByName("ClanRoot"),Forum.CLAN,Forum.CLANMEMBERONLY,getClanId());
                }
            }

Or simply use (fix errors if any) this one

    public void setLevel(int level)
    {
        _level = level;
        
        if (_level >= 2 && _forum == null)
        {
            final Forum forum = ForumsBBSManager.getInstance().getForumByName("ClanRoot");
            if (forum != null)
            {
                _forum = forum.getChildByName(_name);
                if (_forum == null)
                    _forum = ForumsBBSManager.getInstance().createNewForum(_name, ForumsBBSManager.getInstance().getForumByName("ClanRoot"), Forum.CLAN, Forum.CLANMEMBERONLY, _clanId);
            }
        }
    }

Edited by SweeTs

  • Author

I just removed the whole if , I think it's useless and it's ok! thank you for your help

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.