Results 1 to 5 of 5
  1. #1
    Kethas is offline Member
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default NetBeans losing package information when crashing

    I'm currently writing a program in NetBeans with a Main class and a half-dozen helper classes. At one point, my computer crashed and I had to restart. Since then, NetBeans has been reporting "symbol not found" errors whenever I refer to one class in the project package from another, including places where I'd used those references prior to the crash. I can still build and run the project as normal, and it runs without a hitch, but these erroneous error labels interfere with debugging of actual errors in the code.

    I'm not sure how NetBeans handles storing which classes I've created inside the project package, but loosely speaking, how can I force NetBeans to refresh its understanding of my package?

    Example code to follow.

  2. #2
    Kethas is offline Member
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default

    Main.java:

    Java Code:
    package trade_route_generator_project;
    
    import java.io.*;
    import java.util.Vector;
    
    
    /**
     *
     * @author ---
     */
    public class Main {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
    
           // code removed
    
            GalaxyGeographyModel ggm = new GalaxyGeographyModel(constellationJumpsXMLFile,
                                                                constellationsXMLFile,
                                                                jumpsXMLFile,
                                                                regionJumpsXMLFile,
                                                                regionsXMLFile,
                                                                solarSystemJumpsXMLFile,
                                                                solarSystemsXMLFile,
                                                                pathsFilename);
    
            ggm.computeAndSaveDistanceAndPathsFromSource(0);
    
            // code removed
    
            
        }
    
    }

  3. #3
    Kethas is offline Member
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default

    GalaxyGeographyModel.java:

    Java Code:
    package trade_route_generator_project;
    
    import java.io.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import java.util.Vector;
    import java.util.HashMap;
    import java.util.LinkedList;
    
    /**
     *
     * @author ---
     */
    public class GalaxyGeographyModel {
    
        private Vector<Region> regionVector;
        private Vector<Constellation> constellationVector;
        private Vector<SolarSystem> solarSystemVector;
    
        private Vector<RegionJump> regionJumpVector;
        private Vector<ConstellationJump> constellationJumpVector;
        private Vector<SolarSystemJump> solarSystemJumpVector;
    
        private HashMap<Integer, SolarSystem> solarSystemIDToSolarSystemMap;
        private HashMap<String, SolarSystem> solarSystemNameToSolarSystemMap;
        private HashMap<Integer, Constellation> constellationIDToConstellationMap;
        private HashMap<Integer, Region> regionIDToRegionMap;
    
        private HashMap<SolarSystem, Integer> solarSystemMatrixIndexMap;
        private HashMap<Integer, SolarSystem> matrixIndexSolarSystemMap;
        private short[][] pairwiseDistances; 
        private long[][] pathsFileOffsets;
        private short pathedSourceSolarSystemsCount;
        private boolean pathsFullyInitialized;
        private String pathsFilename;
    
        public GalaxyGeographyModel(File constellationJumpsXMLFile,
                                    File constellationsXMLFile,
                                    File jumpsXMLFile,
                                    File regionJumpsXMLFile,
                                    File regionsXMLFile,
                                    File solarSystemJumpsXMLFile,
                                    File solarSystemsXMLFile,
                                    String _pathsFilename) {
    
            // code removed
    
        }
    
        // non-constructor methods removed
    
    }

  4. #4
    Kethas is offline Member
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default

    Within Main.java, the line
    Java Code:
    GalaxyGeographyModel ggm = new GalaxyGeographyModel(...)
    evokes the following error label from NetBeans:
    Java Code:
    cannot find symbol
        symbol: class GalaxyGeographyModel
        location: class trade_route_generator_project.Main
    ... though that error wasn't there prior to the computer crash, with unchanged code, and both GalaxyGeographyModel.java and Main.java include the line "package trade_route_generator_project".

    Within GalaxyGeographyModel.java, all of the references to other data classes within the trade_route_generator_project package evoke similar errors. For example, for the first line
    Java Code:
        private Vector<Region> regionVector;
    I get the error
    Java Code:
    cannot find symbol
        symbol: class Region
        location: class trade_route_generator_project.GalaxyGeographyModel
    Thanks in advance for your assistance. It will be a tremendous relief to be able to return to coding instead of worrying about fictitious errors caused by the NetBeans implementation.

  5. #5
    Kethas is offline Member
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default

    Disregard. Copy/pasting the code into new class files in a new project didn't fix the problem, and neither did reinstalling NetBeans, but uninstalling NetBeans, rebooting, and reinstalling did. Go figure.

Similar Threads

  1. Replies: 7
    Last Post: 11-09-2009, 08:51 AM
  2. Losing Packets/Bytes using DataInputStream and socket
    By ajordanneve in forum Networking
    Replies: 0
    Last Post: 03-24-2009, 06:22 AM
  3. While loop crashing?
    By ToplessGrunt in forum New To Java
    Replies: 6
    Last Post: 10-20-2008, 12:07 PM
  4. Replies: 0
    Last Post: 07-29-2008, 02:19 PM
  5. Problems with JFrame losing the Design view
    By chris@gaiag.net in forum NetBeans
    Replies: 7
    Last Post: 07-23-2008, 08:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •