Run main project error

I'm using netbeans but i do not get any compiling errors just a error when i build my project.
java.lang.NullPointerException
at Flights.<init>(Flights.java:25)
at Flights.main(Flights.java:29)
Exception in thread "main"
Java Result: 1

That is an error that occurs when you run the program. To find what the error is, find the exception class named NullPointerException in the java.lang API documentation. It says:
"NullPointerException extends RuntimeException
Thrown when an application attempts to use null in a case where an object is required. These include:
Calling the instance method of a null object.
Accessing or modifying the field of a null object.
Taking the length of null as if it were an array.
Accessing or modifying the slots of null as if it were an array.
Throwing null as if it were a Throwable value"
The rest of the error message tells you where the problems is happening - at line 25 of the main method in the program Flights.
Often caused by using an array index that is too large (trying to index beyond the end of the array). Bottom line, an object was expected, but a null was found.

Similar Messages

  • Error when running a project

    Hello,
    I'm using Eclipse IDE, and wireless toolkit for J2ME is properly configured. However, when i run a project i got in the console:
    Running with storage root C:\Documents and Settings\Sorin\j2mewtk\2.5.2\appdb\DefaultGrayPhone
    Running with locale: Romanian_Romania.1250
    Running in the identified_third_party security domain
    java.lang.ClassNotFoundException: ComenziJ2ME
         at com.sun.midp.midlet.MIDletState.createMIDlet(+29)
         at com.sun.midp.midlet.Scheduler.schedule(+52)
         at com.sun.midp.main.Main.runLocalClass(+28)
         at com.sun.midp.main.Main.main(+80)
    Execution completed.
    3349320 bytecodes executed
    58 thread switches
    1667 classes in the system (including system classes)
    17251 dynamic objects allocated (514492 bytes)
    1 garbage collections (0 bytes collected)Why i got this? ?I should mention that i create a J2ME project, then i create a simple Midlet, and those methods are automatically generated... i did not write any lines of code, just run the project. And i got that error.. Please help.
    Thanks!

    When you get that error, you can find the details in the problems panel, on the bottom of the screen in code view. The problem with your project is that the libs folder doesn't exist, and while I'm not sure how that could happen, the fix is easy:
    In code view, look at the project navigator (on the right side of your window). Right click on "Untilted_1" and select New -> Folder. Enter "libs" (without quotes) as the name of the new folder and press Finish. You should now be able to run successfully.

  • Java Creater LE run project error

    Today i tried to run this project example using that java open source program i changed the project setting directory to where i placed the project example so that i can have a look but instead it displayed me these sort of errors: -
    --------------------Configuration: choir - JDK version 1.5.0_11 <Default> - <Default>--------------------
    Driver loaded: sun.jdbc.odbc.JdbcOdbcDriver
    Connecting to url: jdbc:odbc:choirdsn;database=choir.mdb
    Exception in thread "main" java.lang.NullPointerException
    at view.MyComboBox.addItems(MyComboBox.java:16)
    at view.ChoirFrame.updateDisplay(ChoirFrame.java:47)
    at view.ChoirFrame.<init>(ChoirFrame.java:38)
    at main.ChoirMain.main(ChoirMain.java:13)
    Process completed.
    So if you got a solution to this can you post it in this thread please, would be appreciated thank you :)

    So obviously, some reference in view.MyComboBox.addItems, Line16, is null. Make sure that whichever reference it is, it's properly referenced to an object, before you start working with it.

  • Run project error message

    -When i try to run my project i get this message :
    *the correct version of Flash Player does not appear to be installed. try to run anyways.*
    -then i click *yes* and get an error message
    *Launching Main has encountered a problem. An internal error occured during: Launching Main.
    java.lang.NullPointerException*
    But when i go on http://www.adobe.com/software/flash/about/ it tells me that i have version 10,1,102,64 installed.

    Have you tried uninstalling Flash Player and reinstalling it? Have you tried publishing the project, then openning the html document?
    Chris

  • Error while running a project in em console

    It was running fine all these days.server was restarted and i am facing problems shown below.
    I am not able run any project(ex.Project1) in em console.I am getting 2 errors like.
    1)DBLocker caught exception while retrieving locked messages.Will retry retrieval after 2 seconds
    2)Error while invoking endpoint "http://<server name>:7001/soa-infra/services/default/Project1/StdService" from client; Security Subject: Administrators
    Even if i unlock the account,its getting locked automatically.
    Notifications:1)The DocumentChange is not configured to be allowed for the component: RichTable[org.apache.myfaces.trinidad.component.UIXTable$RowKeyFacesBeanWrapper@7ae15fc6, id=messagesResult]
    2)Invalid Remote Targets: [Target Name: /Farm_soa_domain/soa_domain/AdminServer/OracleBamServer, Target Type: oracle_bam_server, Display Name: OracleBamServer (AdminServer) => com.bea:Name=oracle-bam#11.1.1,Location=AdminServer,Type=AppDeployment], [Target Name: /Farm_soa_domain/soa_domain/AdminServer/OracleBamWeb, Target Type: oracle_bam_web, Display Name: OracleBamWeb (AdminServer) => com.bea:Name=oracle-bam#11.1.1,Location=AdminServer,Type=AppDeployment]
    3)Calling ClearCacheCanonical Path=oracle.dms:JDBC_DataSource=SOADataSource,Location=AdminServer,name=/JDBC/SOADataSource/CONNECTION_4106,type=JDBC_Connection :::: matched=false
    Thanks in advance

    ALV Grid control is based on the custom controls on the screen. When the program is scheduled in background, it tries to create GUI related front-end objects and hence the error u201CFatal Error u2013 GUI cannot be reachedu201D. This type of problem is common with all the programs that use the ALV grid control to display the output.
    Solution:
    Whenever we execute this type of programs in background, we should be passing a blank docking container instead of the custom container as parent to our grid control. 
    The docking container doesnu2019t need any of the custom controls on the screen; instead it attaches an area to any or all of the four edges of the screen (top, left, right or bottom). The behavior of the areas in the container is determined by the sequence in which they are initialized. Docking Containers are attached to the screen from the inside out. This means that when you create a second container, it is attached to the edge of the screen, and the container that was already there is pushed outwards. 
    Let us modify the standard program (by taking a copy of it) to enable it to execute it in background.
    Following modifications have to be made:
    ·        Define a docking container in the program
    data: or_doc  type ref to cl_gui_docking_container .
    ·        At the time of creating a custom container, check if the program is being executed in background or foreground. If the program is scheduled in background, then create a docking container instead of custom container.
    if cl_gui_alv_grid=>offline( ) is initial.
        create object or_custom_container
               exporting container_name = c_container.
      create object or_grid
             exporting i_parent = or_custom_container.
    else .
    create object or_grid
             exporting i_parent = or_doc .
    endif . 
    Now test executing the program in background. The report would be generated.

  • Error in Jdeveloper while running a project on weblogic server.

    Hi ,
    I am receiving below error while running a project in Weblogic. I am using Jeveloper 11.1.1.2.0
    *** Using port 7101 ***
    "C:\Documents and Settings\nlatif\Application Data\JDeveloper\system11.1.1.2.36.55.36\DefaultDomain\bin\startWebLogic.cmd"
    [waiting for the server to complete its initialization...]
    The system cannot find the path specified.
    The JRE was not found in directory D:\OracleJeveloper\Middleware\jdk160_14_R27.6.5-32. (JAVA_HOME)
    Please edit your environment and set the JAVA_HOME
    variable to point to the root directory of your Java installation.
    Press any key to continue . . .
    where as I can run the same project in other machine on Jdeveloper with out this error.
    Thanks & regards,
    Noman

    Noman,
    have you checked that the folder D:\OracleJeveloper\Middleware\jdk160_14_R27.6.5-32 contains the jre?
    Timo

  • Getting an error when I want to run my project on another pc! URGENT!!

    Hey everyone,
    This is my first post. I have a big problem. I created an enterprise application for a college project but now I want to test it on my laptop. Unfortunately when I want to run the project it gives me this error:
    deployment started : 0%
    Deploying application in domain failed;
    Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : com.mysql.jdbc.jdbc2.optional.MysqlDataSource
    Error Code: 0
    C:\Wesley Chin J2EE Project\EdHardyClothingStore\nbproject\build-impl.xml:264: The module has not been deployed.
    When I try and deploy the project it wont deploy.
    Any ideas on what i can do to fix it?
    Urgent help please as I have to hand in the project today!
    Thanks soo much in advance,
    Wesley

    Hello Wesley,
    you will need the jdbc driver for your database.
    You will find it on http://dev.mysql.com/downloads/connector/j/3.1.html
    Download it and put it in your glassfish classpath, e. g. [glassfish-root]/domains/domain1/lib/ext and restart the server.
    Greetings,
    Andreas

  • Error when I run a Project

    When I first installed Java Studio Creator on Solaris, it worked totally fine, but after using it a couple times, when I run a project, an error message comes out :
    The Sun Java System Application Server 8 could not start.
    More information about the cause is in the Server log file.
    Possible reasons include:
    -Port conflicts. (use netstat -a to detect possible port numbers already used by the operation system.)
    -Incorrect server configuration (domain.xml to be corrected manually)
    - Corrupted Deployed Applications preventing the server to start.(This can be seen in the server.log file. In this case, domain.xml needs to be modified).
    I'm just rookie to this program, I don't know what i did wrong and
    if anybody wants to see my server.log file, I would be glad to post it up.
    thank you

    Hi Jack,
    Please do post the server log file here so that we can try and find a solution for the problem you are facing.
    I had a problem a while ago with the app server too. While trying to run an application, after a few times, it would give me an error message saying the Application Server cannot be started. I rebooted my machine and thankfully it worked again. Just try this too and see if it works.
    If it doesnt we can go through the server log and try to identify the cause of the problem.
    Cheers :-)

  • Unable to run ADF Project Using with Jdev 10 and Weblogic server 9.2

    Dear All,
    I am unable to run ADF Project on Weblogic Server 9.2. I am created Sample Project with ADF Control. This was when we create jsp at that time i am selected libraries ADF. After created war file. This war i am deploying into Server. At that time i am getting error java.lang.noclassfound error.
    so please tell me how we can run these application.
    Regards,
    Suresh.V

    Hard to help you here. JDev 10 used to work with OAS 10g as application server. This does not mean that you can't use Weblogic9.2, but because it is not the default configuration you may have some problems doing this.
    One problem is that you need to install the ADF runtime libraries in the WLS 9.2 server, but there is no installer I know of. You can try to deploy the needed libraries together with your app, but you have to figure out which libraries you need.
    Next thing is that you should deploy an EAR instead of a WAR.
    Timo

  • Project Server 2010 - Unable to open project, no valid Project Detail Page could be found for the project error

    I have a workflow being deployed for the first time on a farm. When I create a project with an EPT connected to the workflow it runs and can enter the required field in a PDP.  Then I Submit the workflow to go to the next stage and I get the "Unable
    to open project, no valid Project Detail Page could be found for the project" error.  After that the project is stuck on the same error.  All of the 18 stages have PDP and Schedules assigned to them.
    Any ideas on why the workflow cannot see the PDPs?  Is there a farm permissions that I am missing?  Thanks!

    Hi David,
    It starts to be a bit technical for me, but here is what I found on the web (seems to be an authentication issue with Sharepoint 2010):
    http://social.technet.microsoft.com/Forums/en-US/120ab535-63d2-4205-a51f-1987e9c0cf79/sharepoint-fba-the-content-type-texthtml-charsetutf8-of-the-response-message-does-not-match-the
    http://social.msdn.microsoft.com/Forums/silverlight/en-US/5cc70ff6-50d9-4cd3-b092-12007f4e495b/response-message-contenttypebindingtype-mismatch
    http://stackoverflow.com/questions/5263150/the-content-type-text-html-charset-utf-8-of-the-response-message-does-not-match
    Hope it will help you going forward in resolving your issue.
    Guillaume Rouyre - MBA, MCP, MCTS

  • XMl parser version problem for running struts project in jdeveloper 10.1.3

    Dear All.
    I am trying to run a struts (v 1.2.9) based project in Jdeveloper 10.1.3.1.0.The struts version in Jdeveloper is 1.1.
    when i am trying to run the index.jsp i get an error:
    org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic
    I think the XML parser version is a problem.Jdeveloper has OracleXMLParser v2 and i think the XML Parser apis used in building the project is different.I have placedcustiom xml parser apis and the xerces.jar in the jdevbin/jdev/lib folder and included these jar in the bootclasspath as follows:
    AddVMOption -Xbootclasspath/p:../lib/xml-apis.jar
    AddVMOption -Xbootclasspath/p:../lib/xerces-2.6.2.jar
    But even then the Exception persists.Is the syntax for Xbootclasspath wrong or i need to place these custom api's in some other location of jdev.
    I am not being able to figure out the XMl parser problem.
    Any help wud be great.
    Is it that i cant run the project in jdeveloper.Just to mention the application is deployed in OC4J on the server and runs fine..But its only that i kant run it locally through jdeveloper

    I am also facing the same issue on my laptop. I searched for forum but no luck.
    appreciate if anybody can throw some light on this.

  • Help - Editor does not contain a main type error (Eclipse)

    Hello,
    I'm trying to run a Text input program out of the Eclipse program and I keep getting this Editor does not contain a main type error - can someone help me
    here's the code
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.text.DecimalFormat;
    import java.util.Scanner;
    import uwcse.io.Input;
    public class FileInputExample {
         public static void main(String[] args) {
              // Create a Scanner to read the input file
              String fileName = new Input().readString("Input file name? ");
              System.out.println();
              Scanner scan;
              try {
                   scan = new Scanner(new File(fileName));
              } catch (FileNotFoundException e) {
                   System.out.println(fileName + " doesn't exist!");
                   return;
              // Read the file and count the number of occurences of A, B, ...
              int[] count = new int[26];
              while (scan.hasNextLine()) {
                   String line = scan.nextLine();
                   line = line.toLowerCase();
                   for (int i = 0; i < line.length(); i++) {
                        char c = line.charAt(i);
                        if (c >= 'a' && c <= 'z') {
                             count[c - 'a']++;
              scan.close();
              int length = 0;
              for (int i = 0; i < count.length; i++) {
                   length += count;
              // Display the statistics (as an histogram)
              DecimalFormat df = new DecimalFormat("0.00");
              for (int i = 0; i < count.length && length > 0; i++) {
                   double percent = count[i] * 100.0 / length;
                   String display = "" + (char) ('a' + i);
                   display += "(" + df.format(percent) + "%):\t";
                   for (int j = 1; j <= Math.round(percent); j++) {
                        display += "X";
                   System.out.println(display);
    }Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    First, note that your program uses a non-standard class, "uwcse.io.Input" which is not available to us. Normally that is a show stopper - in this case, it's not, as I was able to eliminate its use.
    Your program runs fine, so the error is an Eclipse error unrelated to Java.
    You need to ask for help at an Eclipse support site, not here, as these forums are Java language forums.

  • How can i have two main projects?

    Hi,
    i would like to have two main projects in order to run those at the same time , how can i do that?
    thanks
    alvaro

    they can run independently,
    I prefer not to use the command line, so i would like to run those projects with netbeans, is it posible?Probably. Other IDEs can run multiple programs at once, so Netbeans probably can, too. But, as cotton.m suggested, you should concentrate on learning Java before you learn how to use an IDE.

  • I can't finalizing my movie project: error 49, what is this?

    i can't finalizing my movie project: error 49, what is this?

    Hi
    Error -49 opWrErr  File already open with write permission
    Trash the preference files while application is NOT Running.
    from Karsten Schlüter
    Some users notice on exporting larger projects from within iMovie that this operation is aborted with an 'error -49'
    This issue occours only on MacOs machines using 10.7x
    try switching-off the Local Mobile Backup
    in Terminal copy/paste
    sudo tmutil disablelocal
    Re-launch Mac
    Yours Bengt W

  • Premiere PRO save project error if CC is runing.

    I have a problem with my Premiere Pro which wont save or auto-save if Creative Cloud application is running.
    I do save directly in a folder which CC is syncin to cloud. I have same setup at home and at office, sicne I can work from either locations (I have cloned files and using same letters for video drive = V: on both computers). This worked ok until recently, when Creative Cloud started preventing Premiere to save file. If I quit CC, Premiere saves ok. Than after I run CC again, it will sync new files normaly. What it wont do is saving into cloud-synced folder if CC is running.
    The error I get in Premiere is
    An unknown error accured while saving the project.
    Select "save as" from the File menu to save the project to a new lovation.
    If I use Save As it works directly to CC. Just "overwrite" save does not work.
    More funny is the fact, that after I Save As the project under another name in same folder, saving not only works with newly saved project, but also with original "broken" project (for few times, than refuse again and again demand using "save as").
    Quite sometimes few autosaved files in "Auto-Save" folder does not sync either (error dialog, "can't sync"). Solution is that those not-synced files are moved out from folder to (let say) desktop, let CC to be synced, than I copy files back. At this time CC syncs theese files too (and do not even upload them, they just get green arrow after a few seconds).
    MY system consisting of 6-core Intel SB-E, 16GB ram, all SSD drives, English Windows 7.
    Any ideas?
    Many thanks.
    MIHAEL
    EDIT: I have F-secure antivirus on both system. I suspect maybe there is some write permission problem.

    And if you are working on two macs, when working from the other mac save that file to your local hard drive, then creative cloud will automatically save that file to creative cloud... when you switch mac you will have the updated file in creative cloud! Open the file and when you have finished, save as to your local hard drive, and creative cloud will then again automatically save it to creative cloud! I think the easiest way to look at the cloud is seeing it as a back up so every file you save to your hard drive will be automatically backed up to creative cloud.

Maybe you are looking for