Thread: Hyperion NPC loading error via xstream

Results 1 to 8 of 8
  1. #1 Hyperion NPC loading error via xstream 
    Registered Member

    Join Date
    Jan 2009
    Posts
    4,023
    Thanks given
    494
    Thanks received
    446
    Rep Power
    4269
    Yes xstream's are up to date.


    So why? Does this happen, i have wondered an hour about can't seem to find fix, must be easy fix?


    Code:
    Caused by: com.thoughtworks.xstream.converters.ConversionException: Element npcSpawn of type org.hyperion.rs2.model.npcs.NPCSpawn is not defined as field in type org.hyperion.rs2.model.npcs.NPCSpawn---- Debugging information ----
    class               : org.hyperion.rs2.model.npcs.NPCSpawn
    required-type       : org.hyperion.rs2.model.npcs.NPCSpawn
    converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
    path                : /list/npcSpawn[2163]/npcSpawn
    line number         : 49178
    class[1]            : java.util.ArrayList
    converter-type[1]   : com.thoughtworks.xstream.converters.collections.CollectionConverter
    version             : null
    -------------------------------

    Code:
    at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.writeValueToImplicitCollection(AbstractReflectionConverter.java:403)	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:334)
    	at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:234)
    	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
    	at com.thoughtworks.xstream.converters.collections.CollectionConverter.addCurrentElementToCollection(CollectionConverter.java:79)
    	at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:72)
    	at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:66)
    	at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:61)
    	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
    	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
    	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1052)
    	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1036)
    	at com.thoughtworks.xstream.XStream.fromXML(XStream.java:921)
    	at org.hyperion.rs2.model.npcs.NPCSpawn.init(NPCSpawn.java:64)
    	at org.hyperion.rs2.model.world.World$9.call(World.java:234)
    	at java.util.concurrent.FutureTask.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Attached image
    Reply With Quote  
     

  2. #2  
    Registered Member
    thim slug's Avatar
    Join Date
    Nov 2010
    Age
    28
    Posts
    4,132
    Thanks given
    1,077
    Thanks received
    1,137
    Rep Power
    5000
    Caused by: com.thoughtworks.xstream.converters.ConversionExce ption: Element npcSpawn of type org.hyperion.rs2.model.npcs.NPCSpawn is not defined as field in type org.hyperion.rs2.model.npcs.NPCSpawn---- Debugging information ----

    More specifically: Element npcSpawn of type org.hyperion.rs2.model.npcs.NPCSpawn is not defined as field in type org.hyperion.rs2.model.npcs.NPCSpawn
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Jan 2009
    Posts
    4,023
    Thanks given
    494
    Thanks received
    446
    Rep Power
    4269
    I've checked it over and over. So can you explain why?
    Attached image
    Reply With Quote  
     

  4. #4  
    Registered Member
    thim slug's Avatar
    Join Date
    Nov 2010
    Age
    28
    Posts
    4,132
    Thanks given
    1,077
    Thanks received
    1,137
    Rep Power
    5000
    npcSpawn is not defined in org.hyperion.rs2.model.npcs.NPCSpawn class
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Jan 2009
    Posts
    4,023
    Thanks given
    494
    Thanks received
    446
    Rep Power
    4269
    Quote Originally Posted by Samuel View Post
    npcSpawn is not defined in org.hyperion.rs2.model.npcs.NPCSpawn class
    it is?

    Code:
    package org.hyperion.rs2.model.npcs;
    
    
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.util.List;
    import java.util.logging.Logger;
    
    
    import org.hyperion.rs2.content.skills.fishing.Fishing;
    import org.hyperion.rs2.model.world.Location;
    import org.hyperion.rs2.model.world.World;
    import org.hyperion.util.XStreamUtil;
    
    
    /**
     * Represents an NPC spawn. The loading and spawning is handled in here as well.
     * 
     * @author Brown.
     */
    
    
    public class NPCSpawn
    {
    
    
    	/**
    	 * The logger instance.
    	 */
    	private static final Logger logger = Logger.getLogger( NPCSpawn.class.getName() );
    
    
    	/**
    	 * The ID of the NPC this spawn represents.
    	 */
    	private int npcId;
    
    
    	/**
    	 * The walking type.
    	 */
    	private int walkingType;
    
    
    	/**
    	 * The spawn location.
    	 */
    	private Location spawnLocation;
    
    
    	/**
    	 * The minimum location of this NPCSpawn.
    	 */
    	private Location minLocation;
    
    
    	/**
    	 * The maximum location of this NPCSpawn.
    	 */
    	private Location maxLocation;
    
    
    
    
    	/**
    	 * Loads the NPC spawn list from xml, and spawns all the NPC's.
    	 * 
    	 * @throws FileNotFoundException
    	 *             If it couldn't find npcSpawns.xml.
    	 */
    	@SuppressWarnings( "unchecked" )
    	public static void init() throws FileNotFoundException
    	{
    		logger.info( "Loading NPC spawns..." );
    		List<NPCSpawn> spawns = ( List<NPCSpawn> )XStreamUtil.getXStream().fromXML( new FileInputStream( "data/npcSpawns.xml" ) );
    		for( NPCSpawn spawn: spawns ) {
    			NPC npc = NPC.create( NPCDefinition.forId( spawn.getId() ), spawn.getLocation(), spawn.getMinimumLocation(), spawn.getMaximumLocation() );
    			npc.setWalkingType( spawn.getWalkingType() );
    			World.getWorld().getNPCs().add( npc );
    		}
    		logger.info( "Loaded " + spawns.size() + " NPC spawns." );
    		Fishing.spawnFishingSpots();
    	}
    
    
    
    
    	/**
    	 * Gets the location associated with this NPCSpawn.
    	 * 
    	 * @return The spawn location.
    	 */
    	private Location getLocation()
    	{
    		return spawnLocation;
    	}
    
    
    
    
    	/**
    	 * Gets the id of this NPCSpawn.
    	 * 
    	 * @return The NPC id.
    	 */
    	private int getId()
    	{
    		return npcId;
    	}
    
    
    
    
    	/**
    	 * Gets the lowest location the NPC can walk into.
    	 * 
    	 * @return The minLocation.
    	 */
    	public Location getMinimumLocation()
    	{
    		return minLocation;
    	}
    
    
    
    
    	/**
    	 * Gets the highest location the NPC can walk into.
    	 * 
    	 * @return The maxLocation.
    	 */
    	public Location getMaximumLocation()
    	{
    		return maxLocation;
    	}
    
    
    
    
    	/**
    	 * Gets the walking type for this npc.
    	 * 
    	 * @return The walking type.
    	 */
    	public int getWalkingType()
    	{
    		return walkingType;
    	}
    
    
    }
    Attached image
    Reply With Quote  
     

  6. #6  
    Registered Member
    thim slug's Avatar
    Join Date
    Nov 2010
    Age
    28
    Posts
    4,132
    Thanks given
    1,077
    Thanks received
    1,137
    Rep Power
    5000
    Quote Originally Posted by Ahridok View Post
    it is?

    Code:
    package org.hyperion.rs2.model.npcs;
    
    
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.util.List;
    import java.util.logging.Logger;
    
    
    import org.hyperion.rs2.content.skills.fishing.Fishing;
    import org.hyperion.rs2.model.world.Location;
    import org.hyperion.rs2.model.world.World;
    import org.hyperion.util.XStreamUtil;
    
    
    /**
     * Represents an NPC spawn. The loading and spawning is handled in here as well.
     * 
     * @author Brown.
     */
    
    
    public class NPCSpawn
    {
    
    
        /**
         * The logger instance.
         */
        private static final Logger logger = Logger.getLogger( NPCSpawn.class.getName() );
    
    
        /**
         * The ID of the NPC this spawn represents.
         */
        private int npcId;
    
    
        /**
         * The walking type.
         */
        private int walkingType;
    
    
        /**
         * The spawn location.
         */
        private Location spawnLocation;
    
    
        /**
         * The minimum location of this NPCSpawn.
         */
        private Location minLocation;
    
    
        /**
         * The maximum location of this NPCSpawn.
         */
        private Location maxLocation;
    
    
    
    
        /**
         * Loads the NPC spawn list from xml, and spawns all the NPC's.
         * 
         * @throws FileNotFoundException
         *             If it couldn't find npcSpawns.xml.
         */
        @SuppressWarnings( "unchecked" )
        public static void init() throws FileNotFoundException
        {
            logger.info( "Loading NPC spawns..." );
            List<NPCSpawn> spawns = ( List<NPCSpawn> )XStreamUtil.getXStream().fromXML( new FileInputStream( "data/npcSpawns.xml" ) );
            for( NPCSpawn spawn: spawns ) {
                NPC npc = NPC.create( NPCDefinition.forId( spawn.getId() ), spawn.getLocation(), spawn.getMinimumLocation(), spawn.getMaximumLocation() );
                npc.setWalkingType( spawn.getWalkingType() );
                World.getWorld().getNPCs().add( npc );
            }
            logger.info( "Loaded " + spawns.size() + " NPC spawns." );
            Fishing.spawnFishingSpots();
        }
    
    
    
    
        /**
         * Gets the location associated with this NPCSpawn.
         * 
         * @return The spawn location.
         */
        private Location getLocation()
        {
            return spawnLocation;
        }
    
    
    
    
        /**
         * Gets the id of this NPCSpawn.
         * 
         * @return The NPC id.
         */
        private int getId()
        {
            return npcId;
        }
    
    
    
    
        /**
         * Gets the lowest location the NPC can walk into.
         * 
         * @return The minLocation.
         */
        public Location getMinimumLocation()
        {
            return minLocation;
        }
    
    
    
    
        /**
         * Gets the highest location the NPC can walk into.
         * 
         * @return The maxLocation.
         */
        public Location getMaximumLocation()
        {
            return maxLocation;
        }
    
    
    
    
        /**
         * Gets the walking type for this npc.
         * 
         * @return The walking type.
         */
        public int getWalkingType()
        {
            return walkingType;
        }
    
    
    }
    Show me where it's defined, I can't see it lol...
    Reply With Quote  
     

  7. #7  
    q.q


    Join Date
    Dec 2010
    Posts
    6,519
    Thanks given
    1,072
    Thanks received
    3,535
    Rep Power
    4752
    Quote Originally Posted by Ahridok View Post
    it is?

    Code:
    package org.hyperion.rs2.model.npcs;
    
    
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.util.List;
    import java.util.logging.Logger;
    
    
    import org.hyperion.rs2.content.skills.fishing.Fishing;
    import org.hyperion.rs2.model.world.Location;
    import org.hyperion.rs2.model.world.World;
    import org.hyperion.util.XStreamUtil;
    
    
    /**
     * Represents an NPC spawn. The loading and spawning is handled in here as well.
     * 
     * @author Brown.
     */
    
    
    public class NPCSpawn
    {
    
    
    	/**
    	 * The logger instance.
    	 */
    	private static final Logger logger = Logger.getLogger( NPCSpawn.class.getName() );
    
    
    	/**
    	 * The ID of the NPC this spawn represents.
    	 */
    	private int npcId;
    
    
    	/**
    	 * The walking type.
    	 */
    	private int walkingType;
    
    
    	/**
    	 * The spawn location.
    	 */
    	private Location spawnLocation;
    
    
    	/**
    	 * The minimum location of this NPCSpawn.
    	 */
    	private Location minLocation;
    
    
    	/**
    	 * The maximum location of this NPCSpawn.
    	 */
    	private Location maxLocation;
    
    
    
    
    	/**
    	 * Loads the NPC spawn list from xml, and spawns all the NPC's.
    	 * 
    	 * @throws FileNotFoundException
    	 *             If it couldn't find npcSpawns.xml.
    	 */
    	@SuppressWarnings( "unchecked" )
    	public static void init() throws FileNotFoundException
    	{
    		logger.info( "Loading NPC spawns..." );
    		List<NPCSpawn> spawns = ( List<NPCSpawn> )XStreamUtil.getXStream().fromXML( new FileInputStream( "data/npcSpawns.xml" ) );
    		for( NPCSpawn spawn: spawns ) {
    			NPC npc = NPC.create( NPCDefinition.forId( spawn.getId() ), spawn.getLocation(), spawn.getMinimumLocation(), spawn.getMaximumLocation() );
    			npc.setWalkingType( spawn.getWalkingType() );
    			World.getWorld().getNPCs().add( npc );
    		}
    		logger.info( "Loaded " + spawns.size() + " NPC spawns." );
    		Fishing.spawnFishingSpots();
    	}
    
    
    
    
    	/**
    	 * Gets the location associated with this NPCSpawn.
    	 * 
    	 * @return The spawn location.
    	 */
    	private Location getLocation()
    	{
    		return spawnLocation;
    	}
    
    
    
    
    	/**
    	 * Gets the id of this NPCSpawn.
    	 * 
    	 * @return The NPC id.
    	 */
    	private int getId()
    	{
    		return npcId;
    	}
    
    
    
    
    	/**
    	 * Gets the lowest location the NPC can walk into.
    	 * 
    	 * @return The minLocation.
    	 */
    	public Location getMinimumLocation()
    	{
    		return minLocation;
    	}
    
    
    
    
    	/**
    	 * Gets the highest location the NPC can walk into.
    	 * 
    	 * @return The maxLocation.
    	 */
    	public Location getMaximumLocation()
    	{
    		return maxLocation;
    	}
    
    
    
    
    	/**
    	 * Gets the walking type for this npc.
    	 * 
    	 * @return The walking type.
    	 */
    	public int getWalkingType()
    	{
    		return walkingType;
    	}
    
    
    }
    it wants the field npcSpawn inside the class NPCSpawn of type NPCSpawn
    Reply With Quote  
     

  8. Thankful user:


  9. #8  
    Registered Member

    Join Date
    Jan 2009
    Posts
    4,023
    Thanks given
    494
    Thanks received
    446
    Rep Power
    4269
    Got it fixed, npcSpawn file was ****ed up.
    Attached image
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 1
    Last Post: 10-13-2013, 12:38 PM
  2. [HYPERION] Efficient NPC loading
    By tommo in forum Tutorials
    Replies: 12
    Last Post: 12-13-2012, 02:21 AM
  3. [PI] Npc Load Error Please Help!!
    By Sn0wD0g in forum Help
    Replies: 1
    Last Post: 03-06-2012, 06:16 AM
  4. Error with NPC loading
    By shoopdawhoop in forum Help
    Replies: 3
    Last Post: 06-20-2010, 03:57 PM
  5. Replies: 3
    Last Post: 03-14-2010, 08:33 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •