Help with nullPointer exception

Hi,
I would like some help identifying and error in the code below. Im getting a nullPointer exception at the location specified in the code. Im adding elements to a tableModel. What puzzles me is that the strings I add to the model does contain values. And it does not complain about adding them. Perhaps this is just a simple error, and you more experinced programmars are probably loughing at me ;)
void getTests() {
      String[] idNummer = getDirectory(); //gets filenames from a directory
      for (int i = 0; i < idNummer.length; i++) {
         idNummer[i] = idNummer.substring(idNummer[i].lastIndexOf(dataSeparetor) + 1, idNummer[i].length());
// just sorts out specific parts of the filenames
for (int i = 0; i < idNummer.length; i ++) {
System.out.println(idNummer[i]); //I print the sorted filenames and they not null
testModel.addElement(idNummer[i]); //I add them to the table model
testNr.setModel(testModel); //and gets a nullPoint exception here??

I'm sorry, you mean testNr. Don't pay any attention to the above post. it is also declared directly in the class:
public class GUI extends JFrame implements EventListener  {
  JList testModel;
}and creates an instance here:
public GUI {
testModel = new DefaultListModel();
getTests();
testNr = new JList(testModel);
      testNr.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
      testNr.setLayoutOrientation(JList.VERTICAL);
      testNr.setPreferredSize(new Dimension(80, 80));
      testNr.addListSelectionListener(new ListSelectionListener() {
         public void valueChanged(ListSelectionEvent event) {
      leftPanel.add(testNr, BorderLayout.EAST);
}

Similar Messages

  • JTable crashes with NullPointer exception

    Hi
    I use a JTable with a selfmade TableModel.
    On first display I get an Nullpointer exception
    in the JTable, when it calls prepareRenderer.
    I'm not using the DefaultRenderer ... that is I'm not specifying it explicitly.
    Has anybody seen this behaviour before?
    Thanx a lot
    Spieler

    In your TableModel do you use a custom Renderer as well? You said you're not using the DefaultRenderer, so I assume you're calling the setDefaultRenderer() method?
    Check to make sure you have the proper class given as the class of the renderer. I had this problem once because I had accidentally given a different class than what the renderer really was.
    Example:
    // my custom renderer
    MyRenderer1 renderer = new MyRenderer1();
    // wrong class
    setDefaultRenderer(MyRenderer.class, renderer);
    // right class
    setDefaultRenderer(MyRenderer1.class, renderer);Hope this helps!
    - Brion Swanson

  • Urgent help with an exception !!

    Hi I Use a java class to calculate some data.
    This java class is called from a jsp page and first I create a Object from the class (and the constructor method is been called). In this constructor I recive (from the jsp page) a String[][] and other diferent values, but in this method I "copy" the String[][] I have passed to a Double [][] variable (defined like global) and I obtain an exception when the Sting[][] variable contains null vales. But I think I am treating that subject:
    JAVA CLASS:
    public class Functions_AEMult{
        Double [][] datosA;
        public Functions_AEMult( String [][] TablaFinal, String Frecuencia, String [] ValoresMult, HttpSession session)
            datosA = new Double[TablaFinal.length][2];
            for(int i = 0;i< TablaFinal.length;i++)
                if(null != TablaFinal[0])
    datosA [i][0] = new Double(TablaFinal[i][0]);
    if(null != TablaFinal[i][1])
    datosA [i][1] = new Double(TablaFinal[i][1]);
    The exception It gives me: ( In "[i]Functions_AEMult.java:884" the line is datosA [1] = new Double(TablaFinal[i][(j+1)]); )
    type Informe de Excepci�n
    mensaje
    descripci�n El servidor encontr� un error interno () que hizo que no pudiera rellenar este requerimiento.
    excepci�n
    org.apache.jasper.JasperException
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    causa ra�z
    java.lang.NullPointerException
         java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:980)
         java.lang.Double.valueOf(Double.java:202)
         java.lang.Double.<init>(Double.java:277)
         analisisEsp.Functions_AEMult.<init>(Functions_AEMult.java:884)
         org.apache.jsp.admin.PaleoPlot.show_jsp._jspService(show_jsp.java:928)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    nota La traza completa de la causa de este error se encuentra en los archivos de diario de Apache Tomcat/5.0.28.Some body can help me??
    thanks very much

    If you had some code comparing the entries for the String array to null, I would agree with you. But you don't. So you are calling new Double(null) and throwing that exception.Thanks for ur answer DrClap.
    when I do...
    if(null != TablaFinal[0])
    datosA [i][0] = new Double(TablaFinal[i][0]);
    if(null != TablaFinal[i][1])
    datosA [i][1] = new Double(TablaFinal[i][1]);
    I am comparing the entries for the String array to null, No?
    Thanks

  • Help with these Exceptions!

    Hello All,
    when the code below is run and I select a table name that starts with the number 0 I get a Eception, which is fine but when I click back into the combobox where I have the Table name that sarts with the number 0,
    it Thows that Exception again. How can I get my code to only thow that exception once?
    Someone suggested to use the getId() for the Action event will do this. I have tried to find out how to use this but was unsucessfull. Please could someone help me?
    Thanks
    Dave
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.sql.*;
    public class ComboBoxTable{
    static Connection conn2;
       static DatabaseMetaData DMD;
       static JComboBox group = new JComboBox();
       static JComboBox groupList = new JComboBox();
      public static void main(String[] args) {
    try  {
              // Load the database driver
            Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" ) ;
            conn2 = DriverManager.getConnection( "jdbc:odbc:myProject") ;
            DMD=conn2 .getMetaData();
            ResultSet rs=DMD.getTables(null,null,null,new String[]{"TABLE"});
            while(rs.next()) {
              group.addItem((String)rs.getString(3));
            rs.close() ;
         } catch (SQLException se ) {
            System.out.println( "SQL Exception: " + se ) ;
         } catch (Exception e ) {
            System.out.println( e ) ;
         group.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e)  {
              String tbl = (String)group.getSelectedItem();
              try {
                    Statement st=conn2.createStatement();
                 st.execute("SELECT * FROM "+tbl+" WHERE 1=0");
                 ResultSet rs=st.getResultSet();
                 ResultSetMetaData md=rs.getMetaData();
                 groupList.removeAllItems();
                 for (int i=1;i<=md.getColumnCount();i++) {
                   groupList.addItem(md.getColumnName(i));
                 st.close() ;
              } catch (SQLException se ) {
                 System.out.println( "SQL Exception: " + se ) ;
              } catch (Exception ex ) {
                 System.out.println( ex ) ;
    int j=10;
          String[][] data = new String[j][2];
          for (int k=0; k<j; k++){
             String[] row = {"",""};
             data[k] = row;
        String[] colNames = {"Column A", "Column B"};
        JTextField jtf = new JTextField();
        JTable tbl = new JTable(data, colNames);
    // Create the combo box editor
        DefaultCellEditor editor = new DefaultCellEditor(groupList);
    // ADDED IN MY ATTEMPT TO HAVE TO COLUMNS WITH COMBOBOXES
        DefaultCellEditor editor2 = new DefaultCellEditor(group);
    // Assign the editor to the second column
        TableColumnModel tcm = tbl.getColumnModel();
        tcm.getColumn(0).setCellEditor(editor2);
    // ADDED
        tcm.getColumn(1).setCellEditor(editor);
    // Set column widths
        tcm.getColumn(0).setPreferredWidth(200);
        tcm.getColumn(1).setPreferredWidth(100);
    // Set row heighht
        tbl.setRowHeight(20);
        tbl.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        tbl.setPreferredScrollableViewportSize(tbl.getPreferredSize());
         JFrame f = new JFrame("ComboBoxDemo");
        f.getContentPane().add(new JScrollPane(tbl), "Center");
        f.pack();
        f.addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent evt) {
             System.exit(0);
        f.setVisible(true);
    }

    If you can predict an exception with such certainty, you should put some sanity checking in your code to prevent the the exception from ever occurring.

  • Help with the exception handling

    I have something like
    Node n = getNode();
    if (null == n) {
    throw new ServletException ("Missing or Incorrect Request");
    some extra code here
    catch (Exception e ) {
    logger.error(e);
    throw new ServletException ("Missing or Incorrect Request");
    I though that after throwing ServletException it would be caught in catch block and then will be thrown again so I can handle it in another method. Problem is that it is dies on line
    logger.error(e);
    I understand that it is better to specify exact exception instead of using parent Exception class, yet in theory I thought it should work.
    Can someone tell what is wrong here.
    Message was edited by:
    arushunter

    "Problem is that it is dies on line logger.error(e);"
    What does 'dies' mean? Is logger null? Is there another exception? Can you provide any more detailed info?
    You shouldn't catch any exception that you're not going to handle. Personally, I'm not crazy about logging and rethrowing the same thing. It's really not a servlet exception; it's an application exception that tells users when a request is malformed.
    Seems more like a validation issue to me. If you were using Spring, you'd have a validator that would check the input for correctness, add errors if any, and reroute the user back to the offending page with messages telling them how to correct the problem.
    %

  • What a basis admin can help with GRC except install/upgrade?

    Our basis team installs and upgrades GRC.
    However when coming to the support for GRC, we are not sure where to draw the border line between
    basis team and security team.
    What is the responsibility of basis team in GRC area?
    Thanks  for your help.

    Hi Jennifer,
    There is no real clear cut answer for this! Where do you draw the line for the other ERP systems?
    It really depends on your own support structure and the skills of the individuals. I would ask your Application Support Mgr to confirm / define the remit with those involved.
    Having said that, I would suggest that the technical landscape management and connectors would lend itself to the basis / netweaver analysts role. You may also want them to deal with the assignment of the webservices and the connectivity of the components to each other.
    The functional configuration would tend to lend itself to the security team though as I expect that they would be more business focussed and be able to design the way in which the tools should be used by the business.
    I hope this helps?
    Simon

  • Help with an exception when trying to establish a socket connection

    i am trying to make a chat (using an applet for the client).......
    it uses an simple socket connection between the server and clients.....when i connect the client to address 127.0.0.1 or localhost everything works fine, but when i try to connect the client to my DNS name or ip, i get an exception....the exception reads:
    java.security.AccessControlException: access denied (java.net.SocketPermission nextwave.dyndns.org resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
    at java.security.AccessController.checkPermission(AccessController.java:401)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
    at java.lang.SecurityManager.checkConnect(SecurityManager.java:1042)
    at java.net.InetAddress.getAllByName0(InetAddress.java:937)
    at java.net.InetAddress.getAllByName0(InetAddress.java:918)
    at java.net.InetAddress.getAllByName(InetAddress.java:912)
    at java.net.InetAddress.getByName(InetAddress.java:832)
    at java.net.InetSocketAddress.<init>(InetSocketAddress.java:109)
    at java.net.Socket.<init>(Socket.java:119)
    at Client.<init>(Client.java:42)
    at ClientApplet.init(ClientApplet.java:12)
    at sun.applet.AppletPanel.run(AppletPanel.java:347)
    at java.lang.Thread.run(Thread.java:536)
    what is this all about??????
    i'm not that fluent in java, or networking at that, but i'm sure there is something i can do to fix this......
    any help would be greatley appreciated.

    this is why i am not heart-broken that i will be going the other (executable jar) route.......the major deciding factor is the people who will be using this chat will most likley not be able to edit the policy file due to lack of knowledge, and probably won't want to take the time to try.....they would rather download a program, and double-click execute........
    i thank you for taking the time to help me......i have been reading through the posts in this forum, and am seeing it is a good place to get help, so i will be sticking around.....
    mahalo and happy java

  • Help with this exception calling a WS

    Hello there, i have a stand alone java application that consume a WS deployed in a WLS.
    This call works before... i made some changes in the WS but to the logic not the methods signatures... now i have problems when i want to call... i get this weird Exception... can u help me please to understand it?
    Exception in thread "main" java.lang.ExceptionInInitializerError
         at weblogic.wsee.ws.init.WsDeploymentChain.newClientChain(WsDeploymentChain.java:24)
         at weblogic.wsee.ws.WsFactory.callClientListeners(WsFactory.java:113)
         at weblogic.wsee.ws.WsFactory.createClientService(WsFactory.java:46)
         at weblogic.wsee.jaxrpc.ServiceImpl.init(ServiceImpl.java:149)
         at weblogic.wsee.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:117)
         at com.activacionbb.webservice.cliente.ActivacionWebServices_Impl.<init>(Unknown Source)
         at com.activacionbb.webservice.cliente.ActivacionWebServices_Impl.<init>(Unknown Source)
         at com.activacionbb.mq.Despachador.<init>(Despachador.java:29)
         at com.activacionbb.mq.Despachador.main(Despachador.java:53)
    Caused by: java.lang.ClassCastException: com.bea.xbean.values.XmlTokenImpl
         at weblogic.wsee.tools.wseegen.schemas.impl.ListenerTypeImpl.getListenerClass(ListenerTypeImpl.java:37)
         at weblogic.wsee.ws.init.WsConfigFactory.getDeploymentListenerConfig(WsConfigFactory.java:139)
         at weblogic.wsee.ws.init.WsConfigFactory.load(WsConfigFactory.java:110)
         at weblogic.wsee.ws.init.WsConfigFactory.newInstance(WsConfigFactory.java:59)
         at weblogic.wsee.ws.init.WsConfigFactory.newInstance(WsConfigFactory.java:45)
         at weblogic.wsee.ws.init.WsConfigManager.<clinit>(WsConfigManager.java:8)
         ... 9 more
    Thanx in advance!!

    Hello there, i have a stand alone java application that consume a WS deployed in a WLS.
    This call works before... i made some changes in the WS but to the logic not the methods signatures... now i have problems when i want to call... i get this weird Exception... can u help me please to understand it?
    Exception in thread "main" java.lang.ExceptionInInitializerError
         at weblogic.wsee.ws.init.WsDeploymentChain.newClientChain(WsDeploymentChain.java:24)
         at weblogic.wsee.ws.WsFactory.callClientListeners(WsFactory.java:113)
         at weblogic.wsee.ws.WsFactory.createClientService(WsFactory.java:46)
         at weblogic.wsee.jaxrpc.ServiceImpl.init(ServiceImpl.java:149)
         at weblogic.wsee.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:117)
         at com.activacionbb.webservice.cliente.ActivacionWebServices_Impl.<init>(Unknown Source)
         at com.activacionbb.webservice.cliente.ActivacionWebServices_Impl.<init>(Unknown Source)
         at com.activacionbb.mq.Despachador.<init>(Despachador.java:29)
         at com.activacionbb.mq.Despachador.main(Despachador.java:53)
    Caused by: java.lang.ClassCastException: com.bea.xbean.values.XmlTokenImpl
         at weblogic.wsee.tools.wseegen.schemas.impl.ListenerTypeImpl.getListenerClass(ListenerTypeImpl.java:37)
         at weblogic.wsee.ws.init.WsConfigFactory.getDeploymentListenerConfig(WsConfigFactory.java:139)
         at weblogic.wsee.ws.init.WsConfigFactory.load(WsConfigFactory.java:110)
         at weblogic.wsee.ws.init.WsConfigFactory.newInstance(WsConfigFactory.java:59)
         at weblogic.wsee.ws.init.WsConfigFactory.newInstance(WsConfigFactory.java:45)
         at weblogic.wsee.ws.init.WsConfigManager.<clinit>(WsConfigManager.java:8)
         ... 9 more
    Thanx in advance!!

  • Help with ArrayIndexOutOfBounds Exception

    Hi all,
    I am very new to programming in general and Java in particular. I'm working on a program from a book that is supposed to read 72 hourly readings of voltage and then print the mean voltage over that time period and any hours where the voltage varies from the mean by more than ten percent.
    I have an array set up that should have 72 elements created randomly, between 12000-14000. I'm getting an ArrayIndexOutOfBounds Exception when I try to run the program. So far as I understand, this means that somewhere in the program I'm trying to reference an array index that doesn't exist. I just can't see where that is! I've tried a couple different things to see if they've worked but have had no luck.
    I'm sure this is just a simple thing, but I'm feeling a little under the weather and I think my brain is pickled from looking at this code for too long. Any suggestions or ideas are gladly welcomed! I'll paste the code below to take a look at. Sorry if it's ugly or messy... I'm just figuring this stuff out still!
    Thanks so much-
    Heather
    import java.lang.*;
    import java.util.*;
    class VoltageReport {
    VoltageReport () throws IOException {
    System.out.println("Welcome to the voltage meter program!");
    //int place = 0;
    int MeterReadings[] = new int [71];
    int place = 0;
    for (int i = 0; i <= 71; i++) {
    //if (place == 72) break; thought this would do it, but it doesn't.
    MeterReadings[place] = (int) (Math.random()*2000+12000);
    place++;
    place = 0;
    int VoltageMean;
    VoltageMean = 0;
    for (int i = 0; i <= 71; i++) {
    VoltageMean = VoltageMean + MeterReadings[place];
    place++;
    place = 0;
    VoltageMean = VoltageMean / 72;
    for (int i = 0; i <= 71; i++) {
    if (MeterReadings[place] < (.9 * VoltageMean)) {
    System.out.println("Hour " + place + " is more than 10% lower than the " + "mean of " + VoltageMean + " .");
    else if (MeterReadings[place] > (.9 * VoltageMean)) {
    System.out.println("Hour " + place + " is more than 10% higher than the " + "mean of " + VoltageMean + " .");
    place++;
    System.out.println("That's all the information I have. Goodbye!"); }
    public static void main (String [] args) throws IOException {
    new VoltageReport();
    }

    if (MeterReadings[place] < (.9 * VoltageMean))
        System.out.println("Hour " + place + " is more than 10% lower than the " + "mean of " + VoltageMean + " .");
    else if (MeterReadings[place] > (.9 * VoltageMean))
        System.out.println("Hour " + place + " is more than 10% higher than the " + "mean of " + VoltageMean + " .");The problem lies in the else-if. You are checking if the voltage is over 90% of the mean. I think you want to check if it is over 110% of(10% over) the mean.
    else if(MeterReadings[place] > (1.1 * VoltageMean))
    ....And a few other things.
    Arrays
    int[] temp = new int[5]; // you have indexes (indices?) 0, 1, 2, 3 & 4 is the last one
    // Count them, there is 5 there.  Since we always start at 0, the last one is always 1 less than the length.
    // Never do temp[temp.length], this will ALWAYS end in IndexOutOfBoundsException.
    // temp[temp.length-1] is the way to get the last element.
    Posting code
    Since you were unusually nice, no one has cut sick at you, but in the future when you post code, put it between [ code ] and [ /code ] tags (I added spaces so the forum doesn't recognize them, but you get the idea).
    Cheers,
    Radish21

  • Nullpointer exception... any help would be appreciated

    In advance, I apologize for any ignorance which I may obviously have... I'm in the process of learning Java, and am used to C/C++... In any case, I'm running into a nullpointer exception while 'compiling', which I'm having trouble figuring out... I'll list everything below, but this message will be rather long, as I will try to include everything I can. For this reason, I will ask my questions here, at the top:
    1) A null pointer exception, I believe, is generated when something is being referenced which is currently null, for example "a=null; a.b;" yields a null pointer exception. However, is there any other way that one is generated?
    2) Are there methods to figure out what/why something is null other than simply looking at it? As shown below, it seems that just looking at it runs you in a circle from line to line, file to file, which leads you back to the beginning where nothing is actually null... (I'm probably just not seeing it, but that seems to be what's happening to me)
    So now, on to the actual code:
    The following is a printout of the debugging info:
    ~/bin/jdk*/bin/java -classpath classes jamie.Main
    java.lang.NullPointerException
    at jamie.Main.Sys_Log(Main.java:110)
    at jamie.Main.Setup(Main.java:142)
    at jamie.Main.main(Main.java:54)
    Exception in thread "main" java.lang.NullPointerException
    at jamie.Main.Sys_Log(Main.java:110)
    at jamie.Main.Shutdown(Main.java:182)
    at jamie.Main.main(Main.java:92)And a short excerpt of each. (*) indicates line which error originates:
    20    )   private static Log                sys_log;
    108  )   static void Sys_Log(String msg)
    109  )   {
    110*)        sys_log.Log(msg);
    111  )   }
    142*)   Sys_Log("Server warming up...");
    182*)   Sys_Log("Server shutting down...");
    50  )     public static void main(String[] args)
    51  )     {
    52  )          try
    53  )          {
    54*)                Setup();
    85  )     catch(Exception e)
    86  )     {
    87  )          e.printStackTrace(System.out);
    88  )          err_log.Log(e.toString());
    89  )     }
    90  )     finally
    91  )     {
    92*)            Shutdown();
    93  )      }Now, various things that I have tried, and their result (you can probably skip this section, as these were mostly futile efforts):
    What seems odd to me is that the initial error is on line 110, which is the logging function Sys_Log. Since it's a null pointer exception, I would assume that sys_log is null? and thus in calling Log we're generating that error... I'm not entirely sure that that makes sense, though. Additionally, and what I find odd, is that if I change it to what I will list below, I get a slew of other seemingly unrelated problems:
    20    )   private static Log                sys_log;
    108  )   static void Sys_Log(String msg)
    109  )   {
    110#)        if (sys_log!=null)
    111  )        sys_log.Log(msg);
    112  )   }This results in a problem with function Err_Log, which I change the same way, resulting in the following:
    java.lang.NullPointerException
            at jamie.Area_LUL.Load(Area_LUL.java:23)
            at jamie.Main.Setup(Main.java:161)
            at jamie.Main.main(Main.java:55)
    Exception in thread "main" java.lang.NullPointerException
            at jamie.Main.Shutdown(Main.java:186)
            at jamie.Main.main(Main.java:93)In Main.java the following lines are generating the error:
    160  )   lul = new Area_LUL();
    161*)   lul.Load();And in Area_LUL.java I also have the following:
    14  )class Area_LUL implements LoaderUnloader
    15  ){
    16  )    public void Load()
    17  )    {
    18  )        try
    19  )        {
    20  )            areadir = new File("./areas/");
    21  )            SAXParser p = SAXParserFactory.newInstance().newSAXParser();
    22  )
    23*)            for(File curr : areadir.listFiles(new Area_Filter()))
    24  )            {
    25  )                p.parse(curr, new XMLParser());
    26  )            }
    27  )        }Where in the above, the for statement is generating the null pointer exception... which would tell me that areadir is null, however it is defined as new File("./areas/"); Also, lul (defined as new Area_LUL(); is generating the same error, though it is clearly defined in Area_LUL.java at the top of the last excerpt.
    Also, LoaderUnloader is defined in another file as follows:
    interface LoaderUnloader
        void Load();
        void Unload();
    }which are defined in Area_LUL in Area_LUL.java .
    A major theory which I currently have is that the compiler is beginning with my main.java file, and not seeing the class definition in another file, and thus attributing the class obj I create as null, which is causing the error, but I also am not sure if this is possible...
    My imports for Main.java are as follows:
    package jamie;
    import java.io.*;
    import java.util.*;I'm not entirely sure what the package is including, however I do have a jamie.jar file in another directory (../../dist) (could be referencing that?). Also, to compile the source I am using the following command:
    ~/bin/jdk*/bin/java -classpath classes jamie.MainHowever my classpath (I believe) isn't set to include all my files in the given directory. I wouldn't believe that this would be an issue, however if it could possibly be causing this, I can figure out how to set it properly. Also, this should mean I'm starting with Main.java, and perhaps I am right in concluding that it isn't referencing Area_LUL in another file properly, which is setting it as null?
    In any case... Any help would be greatly appreciated. This has been a bit of a struggle for about a month now, trying various resources, moving things around, etc... Thanks so much for your time in reading,
    -Jess

    I'm not able to follow the program flow from your post. Please create a small standalone program that exhibits the problem and post that back here.
    Your assumption re a NPE is correct, that's the only way they're generated.
    There are no "canned" methods to resolve NPEs. The best solution is to put System.out.println statements for all of the involved objects and variables immediately preceeding the error line (in this case, 110) and something will show null. Usually that's enough info to backtrace to the real cause.

  • Help with: oracle.toplink.essentials.exceptions.ValidationException

    hi guys,
    I really need ur help with this.
    I have a remote session bean that retrieves a list of books from the database using entity class and I call the session bean from a web service. The problem is that when i display the books in a jsp directly from the session bean everything works ok but the problem comes when I call the session bean via the web service than it throws this:
    Exception Description: An attempt was made to traverse a relationship using indirection that had a null Session. This often occurs when an entity with an uninstantiated LAZY relationship is serialized and that lazy relationship is traversed after serialization. To avoid this issue, instantiate the LAZY relationship prior to serialization.
    at oracle.toplink.essentials.exceptions.ValidationException.instantiatingValueholderWithNullSession(ValidationException.java:887)
    at oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:233)
    at oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:105)
    at oracle.toplink.essentials.indirection.IndirectList.buildDelegate(IndirectList.java:208)
    at oracle.toplink.essentials.indirection.IndirectList.getDelegate(IndirectList.java:330)
    at oracle.toplink.essentials.indirection.IndirectList$1.<init>(IndirectList.java:425)
    at oracle.toplink.essentials.indirection.IndirectList.iterator(IndirectList.java:424)
    at com.sun.xml.bind.v2.runtime.reflect.Lister$CollectionLister.iterator(Lister.java:278)
    at com.sun.xml.bind.v2.runtime.reflect.Lister$CollectionLister.iterator(Lister.java:265)
    at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:129)
    at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
    at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
    at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
    at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:65)
    at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:168)
    at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
    at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
    at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
    at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:277)
    at com.sun.xml.bind.v2.runtime.BridgeImpl.marshal(BridgeImpl.java:100)
    at com.sun.xml.bind.api.Bridge.marshal(Bridge.java:141)
    at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:315)
    at com.sun.xml.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:142)
    at com.sun.xml.ws.encoding.StreamSOAPCodec.encode(StreamSOAPCodec.java:108)
    at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:258)
    at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.java:320)
    at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java:93)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:454)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
    at com.sun.enterprise.webservice.JAXWSServlet.doPost(JAXWSServlet.java:176)
    ... 29 more
    This happens when I test the web service using netbeans 6.5.
    here's my code:
    session bean:
    ArrayList bookList = null;
    public ArrayList retrieveBooks()
    try
    List list = em.createNamedQuery("Book.findAll").getResultList();
    bookList = new ArrayList(list);
    catch (Exception e)
    e.getCause();
    return bookList;
    web service:
    @WebMethod(operationName = "retrieveBooks")
    public Book[] retrieveBooks()
    ArrayList list = ejbUB.retrieveBooks();
    int size = list.size();
    Book[] bookList = new Book[size];
    Iterator it = list.iterator();
    int i = 0;
    while (it.hasNext())
    Book book = (Book) it.next();
    bookList[i] = book;
    i++;
    return bookList;
    Please help guys, it's very urgent

    Yes i have a relationship but i didnt want it to be directly. Maybe this is a design problem but in my case I dont expect any criminals to be involved in lawsuit. My tables are like that:
    CREATE TABLE IF NOT EXISTS Criminal(
         criminal_id INTEGER NOT NULL AUTO_INCREMENT,
         gender varchar(1),
         name varchar(25) NOT NULL,
         last_address varchar(100),
         birth_date date,
         hair_color varchar(10),
         eye_color varchar(10),
         weight INTEGER,
         height INTEGER,
         PRIMARY KEY (criminal_id)
    ENGINE=INNODB;
    CREATE TABLE IF NOT EXISTS Lawsuit(
         lawsuit_id INTEGER NOT NULL AUTO_INCREMENT,
         courtName varchar(25),
         PRIMARY KEY (lawsuit_id),
         FOREIGN KEY (courtName) REFERENCES Court_of_Law(courtName) ON DELETE NO ACTION
    ENGINE=INNODB;
    CREATE TABLE IF NOT EXISTS Rstands_trial(
         criminal_id INTEGER,
         lawsuit_id INTEGER,
         PRIMARY KEY (criminal_id, lawsuit_id),
         FOREIGN KEY (criminal_id) REFERENCES Criminal(criminal_id) ON DELETE NO ACTION,
         FOREIGN KEY (lawsuit_id) REFERENCES Lawsuit(lawsuit_id) ON DELETE CASCADE
    ENGINE=INNODB;So I couldnt get it.

  • Need help with error: XML parser failed: Error An exception occurred! Type:......

    <p>Need help with the following error.....what does it mean....</p><p>28943 3086739136 XML-240304 3/7/07 7:13:23 PM |SessionNew_Job1<br /><font color="#ff0000">28943 3086739136 XML-240304 3/7/07 7:13:23 PM XML parser failed: Error <An exception occurred! Type:UnexpectedEOFException, Message:The end of input was not expected> at</font><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM line <7>, char <8> in <<?xml version="1.0" encoding="WINDOWS-1252" ?><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <DSConfigurations><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <DSConfiguration default="true" name="Configuration1"><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <case_sensitive>no</case_sensitive><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <database_type>Oracle</database_type><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <db_alias_name1>ODS_OWNER</db_alias_name1><br />28943 3086739136 XML-240304 3/7/07 7:13:23 PM <db_ali>, file <>.<br />28943 3086739136 XML-240307 3/7/07 7:13:23 PM |SessionNew_Job1<br />28943 3086739136 XML-240307 3/7/07 7:13:23 PM XML parser failed: See previously displayed error message.</p><p>Any help would be greatly appreciated.  It&#39;s something to do with my datasource and possibly the codepage but I&#39;m really not sure.</p><p>-m<br /></p>

    please export your datastore as ATL and send it to support. Somehow the internal language around configurations got corrupted - never seen before.

  • 1 View linked to 2 CompCont: NullPointer Exception

    Hi,
    Here is the architecture of my app :
    MainView --> CompContA --> ModelA (RFC function A)
    ........|
    ........|---> IntCompB --> CompContB --> Model B (RFC function B)
    And here is the content of the MainView :
    AdviceNumber : [
    Z2_I_Rechercher_Avis_Input.AdviceNumber) | RefreshButton1
    UserId : [Z2_I_Rechercher_Bottin_Input.UserId) | RefreshButton2
    Name : [Z2_I_Rechercher_Avis_Input.Output.It_Infos_Bottin.Name) 
    Now, my application works when I populate an AdviceNumber and press the RefreshButton1.  At the return, the name field is refreshed and I use some Java code to move the UserId that my function returned to the UserId of the screen. This works well.
    Then if I change the value of the UserId in the screen and press the RefreshButton2, the second function returns me another name, and I use some Java code to move this name into the Name field of the screen. This works well too.
    The problem is that I can't use the refreshButton2 first!  I get a NullPointer exception.
    And I know why, it's because the « Output » structure of my Z2_I_Rechercher_Avis_Input is not initialized (since the refreshButton1 has not been used yet).
    But I can't find the right way to code it.
    Can you help me, thanks!
    Message was edited by:
            Emanuel Champagne

    I want the user to click on the button he wants.
    I just need to know how to initialize the Output.Struc1 when the user decides to click on the RefreshButton2 First.
    It's the line in bold that give me the error (but that line works well when the RefreshButton1 is used first!)
      public void onActionRafraichirAvis(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionRafraichirAvis(ServerEvent)
         //$$begin ActionButton(-775562010)
         wdThis.wdGetAvisCompController().executeZ2_I_Rechercher_Avis_Input();
         //$$end
         // At the return, we need to refresh the values of the screen with the ones returned by the function.
         // Access to the structure showed on the screen
    IIt_Infos_BottinElement AvisInfosBottinEl = wdContext
                                                                  .nodeIt_Infos_Bottin()
                                                                  .currentIt_Infos_BottinElement();
        // Access to the structure received by the RFC function
        IIt_Z2I053TElement BottinEl = wdContext
                                                             .nodeIt_Z2I053T()
                                                             .currentIt_Z2I053TElement();
         <b>AvisInfosBottinEl.setName(BottinEl.getName());</b>
    Message was edited by:
            Emanuel Champagne

  • Please help with setData of Datagram class

    hi
    im new to J2ME stuff. while working with BOOK "wireless java programming with java 2 micro edition" i encountered a problem in networking chapter.
    Im gating NULLPointer Exception while using setData() method of Datagram Class
                   byte[] message = new byte[length];
                   System.arraycopy(msg.getBytes(),0,message,0,length);
    // null poninter exception// sendDatagram.setData(message,0,length);
                   sendDatagram.setLength(length);
    the whole code of client program is as...
    import javax.microedition.midlet.*;
    import javax.microedition.io.*;
    import javax.microedition.lcdui.*;
    import java.io.*;
    public class DatagramClient extends MIDlet implements CommandListener{
         private Form mainScreen;
         private TextField sendingField;
         private Display myDisplay = null;
         private DatagramClientHandler client;
         //define the GUI components for displaying the returned message
         private Form resultScreen;
         private StringItem resultField;
         private String resultString;
         Command sendCommand = new Command("SEND",Command.OK,1);
         public DatagramClient() {
              //intialize the GUI components
              myDisplay = Display.getDisplay(this);
              mainScreen = new Form("Datagram Client");
              sendingField = new TextField("Enter your message",null,30,TextField.ANY);
              mainScreen.append(sendingField);
              mainScreen.addCommand(sendCommand);
              mainScreen.setCommandListener(this);
         public void startApp(){
              myDisplay.setCurrent(mainScreen);
              client = new DatagramClientHandler();
         public void pauseApp(){
         public void destroyApp(boolean unconditional){
         public void commandAction (Command c, Displayable s) {
              if(c==sendCommand){
                   //get the message text from user input
                   String sendMessage = sendingField.getString();
                   try{
                        resultString = client.send_receive(sendMessage);
                   }catch(IOException e){
                        System.out.println("Failed in Send_receive(); "+e);
                   resultScreen = new Form ("Message confirmed:");
                   resultField = new StringItem(null,resultString);
                   resultScreen.append(resultField);
                   resultScreen.setCommandListener(this);
                   myDisplay.setCurrent(resultScreen);
         public class DatagramClientHandler extends Object {
              private DatagramConnection dc;
              private Datagram sendDatagram;
              private Datagram receiveDatagram;
              public DatagramClientHandler() {
                   try{
                        dc = (DatagramConnection)Connector.open("datagram://"+":9000");
                        receiveDatagram = dc.newDatagram(dc.getMaximumLength());
                   } catch(IOException e){
                        System.out.println(e.toString());
              public String send_receive(String msg) throws IOException {
                   int length = msg.length();
                   System.out.println("length of string "+length+"message "+msg);
                   byte[] message = new byte[length];
                   System.arraycopy(msg.getBytes(),0,message,0,length);
                   System.out.println("message is : "+message+" length is "+length);
                   sendDatagram.setData(message,0,length);
                   sendDatagram.setLength(length);
                   String retval = "";
                   try{
                        dc.send(sendDatagram);
                        dc.receive(receiveDatagram);
                        byte[] data = receiveDatagram.getData();
                        retval = new String(data,0,receiveDatagram.getLength());
                   }catch (Exception e ){System.out.println("sirfra excep: "+e);}
                   finally{
                        if(dc!=null) dc.close();
                   return retval;
    sir i hav to submit an assignment on networking and RMS on thursday. so please help me as early as possible . ill be really very thankful to you.

    please change "sendDatagram" to "receiveDatagram"
    public String send_receive(String msg) throws IOException {
    int length = msg.length();
    System.out.println("length of string "+length+"message "+msg);
    byte[] message = new byte[length];
    System.arraycopy(msg.getBytes(),0,message,0,length);
    System.out.println("message is : "+message+" length is "+length);
    sendDatagram.setData(message,0,length);
    sendDatagram.setLength(length);

  • Nullpointer exception when calling Task.getPayloadAsElement()

    Hi all,
    I have deployed an simple bpel in my 10.1.3.1 bpel engine. The proces contains a simpel human tasks, which I want to complete using the human workflow 10.1.3 api. This is the task message which includes my payload:
    initiateTask_ApproveLoanRequestTask
    [2006/12/04 20:59:48]
    Invoked 2-way operation "initiateTask" on partner "TaskService".
    - <messages>
    - <initiateTaskInput>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
    - <initiateTask xmlns="http://xmlns.oracle.com/bpel/workflow/taskService">
    - <task xmlns="http://xmlns.oracle.com/bpel/workflow/task">
    <title>
    Aprove Loan Request task
    </title>
    - <payload>
    - <approveLoanRequestPayload xmlns="http://xmlns.oracle.com/approveLoanRequest">
    <nameRequester>
    Tom
    </nameRequester>
    <loanRequest>
    1000
    </loanRequest>
    <currency/>
    <isApproved/>
    </approveLoanRequestPayload>
    </payload>
    <taskDefinitionURI>
    http://xesoa1.iteye.local:8894/orabpel/default/approveLoanRequest/1.0/ApproveLoanRequestTask/ApproveLoanRequestTask.task
    </taskDefinitionURI>
    <creator>
    Tom
    </creator>
    <ownerUser>
    bpeladmin
    </ownerUser>
    <ownerGroup/>
    <priority>
    3
    </priority>
    <identityContext/>
    <userComment/>
    <attachment/>
    - <processInfo>
    <domainId>
    default
    </domainId>
    <instanceId>
    100008
    </instanceId>
    <processId>
    approveLoanRequest
    </processId>
    <processName>
    approveLoanRequest
    </processName>
    <processType>
    BPEL
    </processType>
    <processVersion>
    1.0
    </processVersion>
    </processInfo>
    <systemAttributes/>
    <systemMessageAttributes/>
    <titleResourceKey/>
    <callback/>
    <identificationKey/>
    </task>
    </initiateTask>
    </part>
    </initiateTaskInput>
    - <initiateTaskResponseMessage>
    - <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
    - <initiateTaskResponse xmlns="http://xmlns.oracle.com/bpel/workflow/taskService">
    - <workflowContext xmlns="http://xmlns.oracle.com/bpel/workflow/common">
    - <credential>
    <login>
    bpeladmin
    </login>
    <identityContext>
    jazn.com
    </identityContext>
    </credential>
    <token>
    13PdID5l3hQSt5QrDDwIyW0GK01koYzxtTLKFTV8e75uWJsSEkJuTRpE7+PJfcK3VL1koQYczeHlUE3fl4yvA9GAsezTFonLuQtb84khaEJpaOUFsBflwg1c5n7J/JE37eJW6HeqoT2utGTwWCfWP3Pm9InF5TUTQkqsguXpd29z+qEllTtnbJAbSRtyeUu5TtQGzcQcBWedYko8rql7XGSFba/O5DJriVW/nrgH7oC5c4diUencB0aVZzWTW2jrOogcTxbQfk8=
    </token>
    </workflowContext>
    - <task xmlns="http://xmlns.oracle.com/bpel/workflow/task">
    <title>
    Aprove Loan Request task
    </title>
    - <payload>
    - <approveLoanRequestPayload xmlns="http://xmlns.oracle.com/approveLoanRequest">
    <nameRequester>
    Tom
    </nameRequester>
    <loanRequest>
    1000
    </loanRequest>
    <currency/>
    <isApproved/>
    </approveLoanRequestPayload>
    - <approveLoanRequestPayload xmlns="http://xmlns.oracle.com/approveLoanRequest">
    <nameRequester>
    Tom
    </nameRequester>
    <loanRequest>
    1000
    </loanRequest>
    <currency/>
    <isApproved/>
    </approveLoanRequestPayload>
    </payload>
    <taskDefinitionURI>
    http://xesoa1.iteye.local:8894/orabpel/default/approveLoanRequest/1.0/ApproveLoanRequestTask/ApproveLoanRequestTask.task
    </taskDefinitionURI>
    <creator>
    Tom
    </creator>
    <ownerUser>
    bpeladmin
    </ownerUser>
    <ownerGroup/>
    <priority>
    3
    </priority>
    <identityContext>
    jazn.com
    </identityContext>
    <userComment/>
    <attachment/>
    - <processInfo>
    <domainId>
    default
    </domainId>
    <instanceId>
    100008
    </instanceId>
    <processId>
    approveLoanRequest
    </processId>
    <processName>
    approveLoanRequest
    </processName>
    <processType>
    BPEL
    </processType>
    <processVersion>
    1.0
    </processVersion>
    </processInfo>
    - <systemAttributes>
    <approvalDuration>
    0
    </approvalDuration>
    <assignedDate>
    2006-12-04T20:59:47.547+01:00
    </assignedDate>
    - <assigneeGroups>
    <id>
    Supervisor
    </id>
    </assigneeGroups>
    <createdDate>
    2006-12-04T20:59:47.555+01:00
    </createdDate>
    <digitalSignatureRequired>
    false
    </digitalSignatureRequired>
    <expirationDate/>
    <inShortHistory>
    true
    </inShortHistory>
    <isGroup>
    true
    </isGroup>
    <numberOfTimesModified>
    1
    </numberOfTimesModified>
    <passwordRequiredOnUpdate>
    false
    </passwordRequiredOnUpdate>
    <pushbackSequence>
    -1
    </pushbackSequence>
    <secureNotifications>
    false
    </secureNotifications>
    <state>
    ASSIGNED
    </state>
    <taskId>
    2043f79925decda1:559dec6a:10f4e2a1a3b:-7ac9
    </taskId>
    <taskNumber>
    10063
    </taskNumber>
    - <updatedBy>
    <id>
    Tom
    </id>
    </updatedBy>
    <updatedDate>
    2006-12-04T20:59:47.555+01:00
    </updatedDate>
    <version>
    1
    </version>
    <versionReason>
    TASK_VERSION_REASON_INITIATED
    </versionReason>
    <taskDefinitionId>
    default_approveLoanRequest_1.0_ApproveLoanRequestTask
    </taskDefinitionId>
    <taskDefinitionName>
    ApproveLoanRequestTask
    </taskDefinitionName>
    </systemAttributes>
    <systemMessageAttributes/>
    <titleResourceKey/>
    <callback/>
    <identificationKey/>
    </task>
    </initiateTaskResponse>
    </part>
    </initiateTaskResponseMessage>
    </messages>
    When I want to parse the payload to binding objects the method task.getPayloadAsElement returns a nullpointer exception. I'm using the Remote client variant of the API.
    I hope some one can help me on this issue.
    Thanks in advance!
    -Tom

    The task payload is not populated when fetching a list of tasks using the queryTasks() method. You need to explicitly call getTaskDetailsById() or getTaskDetailsByNumber() to retrieve the complete task with the payload. Then the method task.getPayloadAsElement() should return you the payload as expected.

Maybe you are looking for

  • Xcompmgr draws trailing shadow outlines without the -f flag

    I have been fiddling around with xcompmgr, and so far its been pretty cool, i like being able to see through my terminals and fading effects were cool for a while, but i noticed that after long periods of use it would start bashing X and i would get

  • Entire cycle of tds

    i want to make a manual  for tds cycle can anyone help me

  • Organising large numbers of events

    Organising Events.... Like a lot of things when it comes to Apple things are easy when they're easy but become a nightmare when there not. One example a friend uses I photo which was fine when she had 10/15 'events' but things quickly became unmanage

  • Cannot import contacts in CSV format

    hi all, When i updated my firmware on nokia e 71 i saved my messages to my pc using nokia messaging center as csv format.After upgradation when i tried to take it back the import option was disabled. I can do only export or what ?. Can anyone help me

  • Old Express on TC Network - Airtunes on Ethernet?

    Hi, I want to buy an old Airport Express for my Time Capsule based network. I want to use the AE's Airtunes capabilities, but through Ethernet, as it will sit next to my Capsule. Is this possible? Can I turn off the wireless of the AE and just use th