FileNotFound Vs NullPointer

Hi,
Why FileNotFound is checked exception while NullPointer is unchecked exception? Whether file is present or not is going to be known at run time so is the case with NullPointer as run time you will come to know ur object is null.
What is that FileNotFound or for that matter all checked exceptions make them checked and other as unchecked exception.
Jounty

FNF is a checked exception because u know what you have to do when the File is not located ny the program. Where as NPE can be avoided by checking whether object is null or not before performing some operation on that but if at runtime the object on which the operation is performed is null then you do not have any control on that. Hence the NPE is unchecked exception.

Similar Messages

  • NullPointer exception in request.getParameter().indexof(.....) only in 6.1

    Hi
    I have one full working application (containing WAR + JAR) files.
    Right now this application is working absolutely fine in weblogic 6.0 sp1 on
    WINNT & Solaris.
    In this application, we accept events to save data from external
    applications like excel files.
    Now code in JSP is -->
    Line 1: String Data = request.getParameter("data");
    Line 2: Data.indexof(........);
    Now in case of weblogic 6.1, i am getting NullPointer Exception in line 2,
    but I am NOT getting any exception in case of weblogic 6.0sp1.
    To my surprise, I am also printing request obj parameters values, whenever
    jsp get called from external source, there it is printing value of "data".
    I am totally clueless!!
    Any idea plz?
    Ashish Jain

    Looking very closely at request object contents..
    Wht i am sending (posting) from excel file-->
    xmlData=<?xml version="1.0" encoding="UTF-8"?><reportSheet bu="SHKXXX"
    report="PBrandContr" sheet=
    "PBrandContr" year="2002" coType="A" status="0" brId="PIC" act_brId="PIC"
    opt="P" ></reportSheet>
    But 6.1 interprets like this ---->
    key is --------> xmlData=<?xml version="1.0" encoding="UTF-8"?><reportSheet
    bu="SHKXXX" report="PBrandContr" sheet=
    "PBrandContr" year="2002" coType="A" status="0" brId="PIC" act_brId
    And Value is -------> "PIC" opt="P" ></reportSheet>
    This thing is causing all problems.
    I am not observing this kinda behaviour in 6.0sp1.
    Thanks
    Ashish Jain
    "Ashish Jain" <[email protected]> wrote in message
    news:[email protected]..
    Hi
    I have one full working application (containing WAR + JAR) files.
    Right now this application is working absolutely fine in weblogic 6.0 sp1on
    WINNT & Solaris.
    In this application, we accept events to save data from external
    applications like excel files.
    Now code in JSP is -->
    Line 1: String Data = request.getParameter("data");
    Line 2: Data.indexof(........);
    Now in case of weblogic 6.1, i am getting NullPointer Exception in line 2,
    but I am NOT getting any exception in case of weblogic 6.0sp1.
    To my surprise, I am also printing request obj parameters values,whenever
    jsp get called from external source, there it is printing value of "data".
    I am totally clueless!!
    Any idea plz?
    Ashish Jain

  • 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.

  • [Endeca 3.1.1 + ATG 10.1.2] @FileNotFound error while requesting a page

    When I am requesting for a Endeca page (say "dil"), I am getting the following error:
    18:40:58,306 INFO [AssemblerPipelineServlet] DEBUG Allowed mime type null for assembly of URI /crs/dil
    18:40:58,306 INFO [AssemblerTools] DEBUG Assembling content for {contentUri=/pages/dil, @type=ContentInclude}
    18:40:58,321 ERROR [AssemblerTools] A problem occured assembling requested content. Response from the assembler was {contentUri=/pages/dil, @type=ContentInclude, @error=FileNotFound}
    Also every 1 minute, I keep getting the following error in console (My machine IP is 172.21.21.64):
    19:14:40,658 SEVERE [LiveContentClient] Shutting down and reconnecting client [172.21.21.64:3899]. Encountered exception: java.io.IOException: An established connection was aborted by the software in your host machine
    19:15:25,141 SEVERE [LiveContentClient] Shutting down and reconnecting client [172.21.21.64:3899]. Encountered exception: java.nio.channels.ClosedChannelException
    19:15:28,047 SEVERE [LiveContentClient] Shutting down and reconnecting client [172.21.21.64:3899]. Encountered exception: java.nio.channels.ClosedChannelException
    19:15:29,672 SEVERE [LiveContentClient] Shutting down and reconnecting client [172.21.21.64:3899]. Encountered exception: java.nio.channels.ClosedChannelException
    Thanks in advance
    Dilroz

    So the various Endeca modules were moved between 10.0.3 (where they were shipped with CRS with module names that began with "Endeca", like "Endeca.Index", "Endeca) and 10.1.1 and later (where they were moved to their more permanent homes, like DAF.Endeca.Index, DCS.Endeca.Index, etc).
    For a complete list of the locations of Endeca modules in 10.1.2, see the "ATG Modules" section of http://docs.oracle.com/cd/E36434_01/Platform.10-1-2/ATGEndecaIntegrationGuide/ATGEndecaIntegrationGuide.pdf .
    CRS in 10.1.2 and later depends upon the Endeca and the ATG Endeca integration modules, and CIM should pull in the needed ATG modules automatically for CRS.

  • Nullpointer on com.sap.tc.webdynpro.progmodel.controller.MessageManager

    Dear all,
    i have two web dynpro components, say A and B.
    A is using component B.
    When i push a close button in B, i do the following things:
    1. wdComponentAPI.getMessageManager().reportWarning("Some warning!!!");
    2. wdThis.wdGetICLRequestDetailsController().leaveRequestDetails();
    This leaveRequestDetails() fires a plug (standard) to leave back to my component A and component A deletets the componentUsage when needed... ( if(hasActiveComponent()) )
    Component B has a view with an inputfield for an amount (bigdecimal). When this has valid input and i push the button and execute 1. and 2. everything works fine and i see the warning on the view of my comp. A.
    When i put invalid input in the amount field ( for example some characters) and i push the button, i see an error message on my view in comp. B. (automatic validation)
    When i correct the input and push the submit button again while the previous error message is still visible on the screen (so there's no event trigerred since the automatic validation), i get the following nullpointer exception on calling the deleteComponent method in component A:
    java.lang.NullPointerException
    +     at com.sap.tc.webdynpro.progmodel.controller.MessageManager.setAttributeValidbyContext(MessageManager.java:656)+
    +     at com.sap.tc.webdynpro.progmodel.context.NodeElement.clearPendingInput(NodeElement.java:297)+
    +     at com.sap.tc.webdynpro.progmodel.context.NodeElement.exit(NodeElement.java:132)+
    +     at com.sap.tc.webdynpro.progmodel.context.Node$ElementList.exit(Node.java:1859)+
    +     at com.sap.tc.webdynpro.progmodel.context.Node.clearElements(Node.java:1560)+
    +     at com.sap.tc.webdynpro.progmodel.context.Node.forgetDataNode(Node.java:1733)+
    +     at com.sap.tc.webdynpro.progmodel.context.Node.exit(Node.java:295)+
    +     at com.sap.tc.webdynpro.progmodel.context.Node.exit(Node.java:306)+
    +     at com.sap.tc.webdynpro.progmodel.context.Context.exit(Context.java:53)+
    +     at com.sap.tc.webdynpro.progmodel.controller.Controller.exit(Controller.java:161)+
    +     at com.sap.tc.webdynpro.progmodel.view.View.exitController(View.java:403)+
    +     at com.sap.tc.webdynpro.progmodel.view.View.exitController(View.java:435)+
    +     at com.sap.tc.webdynpro.progmodel.controller.Controller.exit(Controller.java:154)+
    +     at com.sap.tc.webdynpro.progmodel.view.ViewManager.exit(ViewManager.java:125)+
    +     at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.exit(ClientComponent.java:211)+
    +     at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.deleteComponent(ClientComponent.java:195)+
    +     at com.sap.tc.webdynpro.progmodel.components.ComponentUsage.deleteComponent(ComponentUsage.java:199)+
    When i do the same again, but without reporting the warning before leaving comp B, i don't get the nullpointer exception and can continue interacting on my view in component A.
    Can anyone tell me what's the cause for this nullpointer? is it a bug?
    Kind regards.
    J.

    The following is a working solution for me:
    MessageManager mManager = (MessageManager)wdComponentAPI.getMessageManager();
    mManager.reset();
    I have put these lines right before i call the deleteComponent() method in my web dynpro component A.

  • Java.lang.NullPointer Exception in File-RFC-File wtihout BPM scenario

    Hi All,
    I have implemented scenario File - RFC - File without BPM in PI7.1 according to below link by bhavesh
    [File - RFC - File without a BPM - Possible from SP 19.;
    but I am getting error java.lang.NullPointer Exception  in Audit log of sender communication channel when it enters in ResponseOnewayBean.
    I had implemented the same in PI 7.0 but there it was working fine.
    Is there any limitations on the use of the above beans in PI7.1 as I could see two more threads on the same unanswered yet.
    Please help me in resolving as it is priority task for me
    Thanks,
    Amit

    Sometime back I saved this SAP Note 1261159 for this error. Not sure if it is still valid. Try to get it implemented.
    Regards,
    Prateek

  • File LookUp in the MM : FileNotFound Exception

    Hello Friends,
    I am trying to fetch a file during the message mapping. The code I have written in the UDF is as follows :
    <u>
    String company = "";
    HashMap fileMap = new HashMap();
    BufferedReader reader = new BufferedReader(new FileReader("C:
    testfolder
    Mydata.txt"));
    String line = "";
    while((line = reader.readLine())!=null)
    String[] lineArray = line.split(",");
    fileMap.put(lineArray[1], lineArray[0]);
    company = (String) fileMap.get(a);
    return company; </u>
    <b>
    But I am getting the FileNotFound Exception when I tried to run the interface mapping.
    I have confirmed that file is there in the respective folder.
    1. Can we use the above code to fetch the file ?
    2. Do we need to put the file in the XI server ?
    </b>
    Thanks for your time.
    ~PRANAV

    and what exactly you are trying to do with this code ?
    to access files,you need to use Java io api's,and you can access file from any server,not just XI server
    but there are few drawbacks with this,first of all the file name and path will be hardcoded so u need to change it every time you move your file from Dev to QA to Prd.
    secondly this approach is good to read the file,but not a very good idea to write something in the file
    Thanx
    Aamir

  • Nullpointer in 'weblogic.transaction.internal.CoordinatorImpl

              I am using Weblogic 6.1 SP4 on JDK 1.3.1 on AIX.
              My server has a transacted EJB which accesses Oracle and DB2 databases. I have
              been running my application for several months.
              Suddenly, yesterday it starting spitting out these exceptions a few times a minute.
              I cannot find the configuration change I made that would have caused this to
              suddenly start appearing. My code has not changed in 2 weeks.
              Has anyone seen this error before? Does anyone know what causes this, so that
              I can narrow my search?
              Thanks for your help,
              Tania
              ####<Mar 4, 2003 12:35:48 PM CST> <Warning> <Dispatcher> <ksp12025> <cuAS01> <ExecuteThread:
              '5' for queue: 'default'> <system> <> <000000> <RuntimeException thrown by rmi
              server: 'weblogic.rmi.internal.BasicServerRef@105 - jvmid: '-4285102758410085945S:10.1.21.21:[18120,18120,18121,18121,18120,18121,-1]:qdomain4:cuAS01',
              oid: '261', implementation: 'weblogic.transaction.internal.CoordinatorImpl@311671da''>
              java.lang.NullPointerException
              at weblogic.transaction.internal.ServerResourceInfo.isAccessibleAtAndAssignableTo(ServerResourceInfo.java(Compiled
              Code))
              at weblogic.transaction.internal.ServerTransactionImpl.assignResourcesToSelf(ServerTransactionImpl.java(Compiled
              Code))
              at weblogic.transaction.internal.ServerTransactionImpl.assignResourcesToSelf(ServerTransactionImpl.java(Compiled
              Code))
              at weblogic.transaction.internal.ServerTransactionImpl.localCommit(ServerTransactionImpl.java(Compiled
              Code))
              at weblogic.transaction.internal.SubCoordinatorImpl.startCommit(SubCoordinatorImpl.java(Compiled
              Code))
              at weblogic.transaction.internal.CoordinatorImpl_WLSkel.invoke(Unknown
              Source)
              at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java(Compiled
              Code))
              at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java(Compiled
              Code))
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java(Compiled
              Code))
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java(Compiled Code))
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              

              Thanks,
              The problem did clear up when the Unix server had to get bounced. I believe it
              was bounced for an unrelated issue.
              The one thing I noticed was that there were a couple of copies of my EJBs in the
              wlnotdelete directory that the server had been previously compliaining about.
              They went away after the Unix server was restarted and the NullPointer problem
              went away.
              We plan to upgrade to 7.1 soon, but will try to move to SP5 if we need to sooner.
              Thanks for your help.
              Tania Rhinehart
              Rajesh Mirchandani <[email protected]> wrote:
              >This is fixed in SP5. Open a case with [email protected] and reference
              >CR092301.
              >
              >Slava Imeshev wrote:
              >
              >> Hi Tania,
              >>
              >> I think you need to contact BEA support at [email protected]
              >>
              >> Regards,
              >>
              >> Slava Imeshev
              >>
              >> "Tania Rhinehart" <[email protected]> wrote in message
              >> news:[email protected]...
              >> >
              >> > I am using Weblogic 6.1 SP4 on JDK 1.3.1 on AIX.
              >> > My server has a transacted EJB which accesses Oracle and DB2 databases.
              > I
              >> have
              >> > been running my application for several months.
              >> > Suddenly, yesterday it starting spitting out these exceptions a few
              >times
              >> a minute.
              >> > I cannot find the configuration change I made that would have caused
              >this
              >> to
              >> > suddenly start appearing. My code has not changed in 2 weeks.
              >> >
              >> > Has anyone seen this error before? Does anyone know what causes
              >this, so
              >> that
              >> > I can narrow my search?
              >> >
              >> > Thanks for your help,
              >> > Tania
              >> >
              >> > ####<Mar 4, 2003 12:35:48 PM CST> <Warning> <Dispatcher> <ksp12025>
              >> <cuAS01> <ExecuteThread:
              >> > '5' for queue: 'default'> <system> <> <000000> <RuntimeException
              >thrown by
              >> rmi
              >> > server: 'weblogic.rmi.internal.BasicServerRef@105 - jvmid:
              >> '-4285102758410085945S:10.1.21.21:[18120,18120,18121,18121,18120,18121,-1]:q
              >> domain4:cuAS01',
              >> > oid: '261', implementation:
              >> 'weblogic.transaction.internal.CoordinatorImpl@311671da''>
              >> >
              >> > java.lang.NullPointerException
              >> > at
              >> weblogic.transaction.internal.ServerResourceInfo.isAccessibleAtAndAssignable
              >> To(ServerResourceInfo.java(Compiled
              >> > Code))
              >> > at
              >> weblogic.transaction.internal.ServerTransactionImpl.assignResourcesToSelf(Se
              >> rverTransactionImpl.java(Compiled
              >> > Code))
              >> > at
              >> weblogic.transaction.internal.ServerTransactionImpl.assignResourcesToSelf(Se
              >> rverTransactionImpl.java(Compiled
              >> > Code))
              >> > at
              >> weblogic.transaction.internal.ServerTransactionImpl.localCommit(ServerTransa
              >> ctionImpl.java(Compiled
              >> > Code))
              >> > at
              >> weblogic.transaction.internal.SubCoordinatorImpl.startCommit(SubCoordinatorI
              >> mpl.java(Compiled
              >> > Code))
              >> > at
              >> weblogic.transaction.internal.CoordinatorImpl_WLSkel.invoke(Unknown
              >> > Source)
              >> > at
              >> weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java(Compiled
              >> > Code))
              >> > at
              >> weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java(Compi
              >> led
              >> > Code))
              >> > at
              >> weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java(C
              >> ompiled
              >> > Code))
              >> > at
              >> weblogic.kernel.ExecuteThread.execute(ExecuteThread.java(Compiled Code))
              >> > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >> >
              >
              >--
              >Rajesh Mirchandani
              >Developer Relations Engineer
              >BEA Support
              >
              >
              

  • NullPointer when GUI calls method in Client

    Hi, I'm relatively new to Java programming and this conference.
    I hope the following is not too long winded.
    I'm trying to programme a FTP Client which is controlled by a GUI.
    My JBuilder project has three classes:
    ClientGUI.java and ClientFrame.java (produced with JBUilder's New Application option)
    plus AClient.java (this is the 'engine' of the project).
    ClientGUI constructs an instance 'frame' of ClientFrame which in turn constructs an instance 'client' of AClient.
    The call to the AClient constructor has to be in a try/catch statement,
    and takes a JTextArea as a parameter from ClientFrame to allow 'client' to display messges in my GUI.
    The AClient constructor opens the Socket connection to a simple server on the same computer.
    This part works.
    However, when I attempt to use events generated by buttons in my GUI ('frame')to call methods in 'client', I get the following null-pointer exception:-
    java.lang.NullPointerException
    at ClientFrame.jButton1_actionPerformed(ClientFrame.java:219)
    at ClientFrame_jButton1_actionAdapter.actionPerformed(ClientFrame.java:274)
    etc...
    etc...
    These refer to code blocks:-
        if ( client.isAlive() ) {  /*line 219*/
          System.out.println("client alive");
        }where isAlive() is a simple test method that returns true,
    and
      public void actionPerformed(ActionEvent e) {
        adaptee.jButton1_actionPerformed(e);  /*line 274*/
      }'client' is listed as a public field in ClientFrame and is instanciated, so why do I have this problem?
    Enclosing the call in a try/catch statement doesn't help.
    Thanks in advance. Laurence

    The NullPointer means that the client was not instantiated, though you may think it has been.
    Make sure that you are instantiating the correct variable, for instance, if you have a class-level field called client you would do something like this:
    public class WhateverClass {
      private AClient client;
      //other stuff
      public WhateverClass(...) {
        client = //assignment either
                 //with new AClient(...)
                 //or something else
      }You would NOT do:
    public class WhateverClass {
      private AClient client;
      //other stuff
      public WhateverClass(...) {
        AClient client = //assignment either
                         //with new AClient(...)
                         //or something else
      }Since this would create a second variable of name client that only has scope within the constructor.
    Also, if the client is being assigned through a parameter in the constructor, check to make sure that that you are not passing a null value along... Do a System.out.println(client) after the assignement and see what you get. Then you know if the problem occurs in this class or in the class that creates the AClient reference to begin with...

  • Nullpointer when starting application.

    Sometimes when i start my application with java web start, a nullpointer exception accurs, but it doesn't affect the application. And seems to happen randomly.
    Exception in thread "Thread-3" java.lang.NullPointerException
    at com.sun.javaws.Launcher$2.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    The application still starts, and apparently runs without problems.
    Can anyone explain this?
    /Kenneth

    hi Sid,
    Thanks problem was the way I was accessing the values. But still its not clear how error was coming in wdMOdify method when at start it should not run at the load time.
    And (!firsttime) can be used in case something is modify and screen rendering has happened more than once.
    Regards

  • Query using SDO in JDeveloper - NullPointer

    I have this java lines for query:
    DocsOddcModuleServiceImpl docs = new DocsOddcModuleServiceImpl();
    FindCriteria findCriteria = new FindCriteriaImpl();
    FindControl findControl = new FindControlImpl();
    DocsOddcVOSDOResult result = docs.findDocsOddcVO1buscarDocsOddcPorIdInstancia(findCriteria, 1L, findControl);
    List resultList = result.getValue();
    int total = resultList.size();
    System.out.println("total eh " + total);
    Problem: at this line "DocsOddcVOSDOResult result = docs.findDocsOddcVO1buscarDocsOddcPorIdInstancia(findCriteria, 1L, findControl);" i get a nullpointer exception.
    <Apr 28, 2011 5:06:54 PM BRT> <Error> <solicitarcadastamentodeveiculosui.dataservices.server.serviceinterface.DocsOddcModuleServiceImpl> <BEA-000000> <
    java.lang.NullPointerException
         at oracle.jbo.server.svc.ServiceImpl.acquireResources(ServiceImpl.java:377)
         at oracle.jbo.server.svc.ServiceImpl.find(ServiceImpl.java:2288)
         at solicitarcadastamentodeveiculosui.dataservices.server.serviceinterface.DocsOddcModuleServiceImpl.findDocsOddcVO1buscarDocsOddcPorIdInstancia(DocsOddcModuleServiceImpl.java:117)
         at solicitarcadastamentodeveiculosui.bean.OddcBean.popularTabela(OddcBean.java:47)
         at solicitarcadastamentodeveiculosui.bean.OddcBean.init(OddcBean.java:39)
    I have a simple table at oracle database, i use the jdeveloper to generate a View Object / View Criteria and Service Interface (SDO), and i want to make a simple query:
    Select * from table where idInstancia = "idInstancia" (Bind Variable - Type - Long)
    I am feeling that my problem is at findCriteria and findControl. I instantiate these variables, but i'm not populating.
    Should i use the setter method ? What ?
    Thanks
    Victor Jabur

    Yeah, you are right on, if you haven't guessed it in the last couple of months ;-)
    fecthStart, fetchSize, and excludeAttribute are all required property for FindCriteria.
    retrieveAllTranslations is a required property for FindControl.

  • 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);
    }

  • ArrayList nullpointer exception

    I'm creating a game called bubblebreaker in Java, with the principle off model, view and controller classes.
    In my model class I create a list of bubble objects. In the view I make these bubbles visible and in the controller class I react on external events (mouseclicks, ...)
    My design is almost finished but I'm having some troubles removing my selected bubbles.
    When I have selected my bubbles I want to remove them with another click on that bubble.
    In the method deleteBub(Bubble delete) I will use the "set" method from the arraylist and make the bubble object "null":
    protected void deleteBub(Bubble delete) {
            bubbleList.set(delete.getNumber(), null);
    }This is the error:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    +     at Model.deleteBub(Model.java:69)+
    It also points to this method:
    In the view class I check if the object is null:
    protected void drawBub(Bubble bubb, Graphics g) {
                if(bubb!=null) {
                    g.setColor(bubb.getColor());
                    g.fillOval(20*bubb.getX(), 20*bubb.getY(), 20*model.getRadius(), 20*model.getRadius());
                else System.out.println(bubb.getNumber() + " is null");
    }There are no compilation errors. I just get a nullpointer exception when I click the second time on a bubble, so when it should be made null.
    Edited by: Lektroluv on May 5, 2009 2:22 AM

    I think I'm not on the same level as you.
    The set command replaces the original bubble object with null, wright?
    So for example the list changes from this:
    new Bubble(.....)
    new Bubble(.....)
    new Bubble(.....)
    new Bubble(.....)
    ...to this:
    new Bubble(.....)
    null
    new Bubble(.....)
    null
    new Bubble(.....)
    new Bubble(.....)
    ...The second list isn't good, because it has "nulls" in it?!?!? --> nullpointer exception?
    What I've done next is in stead off replacing it with null, replacing it with new Bubble(BLACK ...)
    new Bubble(.....)
    new Bubble(BLACK ...)
    new Bubble(.....)
    new Bubble(BLACK ...)
    new Bubble(.....)
    new Bubble(.....)
    ...Edited by: Lektroluv on May 5, 2009 8:37 AM
    Edited by: Lektroluv on May 5, 2009 8:37 AM

  • 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

  • JUTreeNodeBinding question (nullpointer exception in getAttribute)

    Hi,
    I've got a question about a piece of code. I've used a JTree which displays a recursive tree, which is working fine. I want to do something when a node is selected. I have the following piece of code:
    jTree1.addTreeSelectionListener(
       new TreeSelectionListener()
         public void valueChanged(TreeSelectionEvent e)
           DefaultMutableTreeNode node = (DefaultMutableTreeNode)jTree1.getLastSelectedPathComponent();
           if (node != null)
             JUTreeNodeBinding tnb = (JUTreeNodeBinding)(node.getUserObject());
             if (tnb!=null)
       });this code is taken from some example I've read on this forum and slightly modified (I can't find the original posting).
    Now, according to the sourcecompletion feature, tnb has methods like getAttribute, getAttributeDef. But when I call one of these methods on tnb (where the '...' is in the example above), I always get a nullpointer exception , somewhere inside the getAttribute call. (the variable 'tnb' itself is not null)
    Why wouldn't this work? Shouldn't the getAttribute calls give me access to the attributes of the row from the view that corresponds the selected element?
    The logwindow shows this for the nullpointer exception:
    Exception occurred during event dispatching:
    java.lang.NullPointerException
         oracle.jbo.AttributeDef[] oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDefs()
              JUCtrlValueBinding.java:173
         oracle.jbo.AttributeDef oracle.jbo.uicli.binding.JUCtrlValueBinding.getAttributeDef(int)
              JUCtrlValueBinding.java:239
         void mypackage.PMyData$1.valueChanged(javax.swing.event.TreeSelectionEvent)
              PMyData.java:332
         void javax.swing.JTree.fireValueChanged(javax.swing.event.TreeSelectionEvent)
              JTree.java:2269
         void javax.swing.JTree$TreeSelectionRedirector.valueChanged(javax.swing.event.TreeSelectionEvent)
              JTree.java:2575
         void javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(javax.swing.event.TreeSelectionEvent)
              DefaultTreeSelectionModel.java:612
         void javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(java.util.Vector, javax.swing.tree.TreePath)
              DefaultTreeSelectionModel.java:1006
         void javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(javax.swing.tree.TreePath[])
              DefaultTreeSelectionModel.java:288
         void javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(javax.swing.tree.TreePath)
              DefaultTreeSelectionModel.java:171
         void javax.swing.JTree.setSelectionPath(javax.swing.tree.TreePath)
              JTree.java:1088
         void javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(javax.swing.tree.TreePath, java.awt.event.MouseEvent)
              BasicTreeUI.java:2117
         void javax.swing.plaf.basic.BasicTreeUI$MouseHandler.mousePressed(java.awt.event.MouseEvent)
              BasicTreeUI.java:2683
         void java.awt.Component.processMouseEvent(java.awt.event.MouseEvent)
              Component.java:3712
         void java.awt.Component.processEvent(java.awt.AWTEvent)
              Component.java:3544
         void java.awt.Container.processEvent(java.awt.AWTEvent)
              Container.java:1164
         void java.awt.Component.dispatchEventImpl(java.awt.AWTEvent)
              Component.java:2593
         void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
              Container.java:1213
         void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
              Component.java:2497
         void java.awt.LightweightDispatcher.retargetMouseEvent(java.awt.Component, int, java.awt.event.MouseEvent)
              Container.java:2451
         boolean java.awt.LightweightDispatcher.processMouseEvent(java.awt.event.MouseEvent)
              Container.java:2210
         boolean java.awt.LightweightDispatcher.dispatchEvent(java.awt.AWTEvent)
              Container.java:2125
         void java.awt.Container.dispatchEventImpl(java.awt.AWTEvent)
              Container.java:1200
         void java.awt.Window.dispatchEventImpl(java.awt.AWTEvent)
              Window.java:926
         void java.awt.Component.dispatchEvent(java.awt.AWTEvent)
              Component.java:2497
         void java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent)
              EventQueue.java:339
         boolean java.awt.EventDispatchThread.pumpOneEventForHierarchy(java.awt.Component)
              EventDispatchThread.java:131
         void java.awt.EventDispatchThread.pumpEventsForHierarchy(java.awt.Conditional, java.awt.Component)
              EventDispatchThread.java:98
         void java.awt.EventDispatchThread.pumpEvents(java.awt.Conditional)
              EventDispatchThread.java:93
         void java.awt.EventDispatchThread.run()
              EventDispatchThread.java:85

    Bit of a coincidence.. I was just running into the same problem. But if you check getAttributeDefs(), you'll see that there only is one attribute available, namely the one that is being displayed in the tree. (the 'description'-attribute)
    Or at least, that's the case with my sitation.
    I would love to be able to address all available attributes, eg. foreign key fields, but that doesn't seem possible.
    At the moment, I'm using the following work-around, which of course is far from ideal:
    Key key = tnb.getRowKey();
    ViewObject vo = panelBinding.getApplicationModule().findViewObject("SomeVO");
    Row[] rows = vo.findByKey(key);
    if (rows == null || rows.length != 1)
      System.out.println("Notice: not 1 rows");
      return;
    Row row = rows[0];
    // now you can fetch all the attributes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • What's happening to MOG?

    1. MOG are no longer taking registrations.2. Apple Music has launched.3. After free trial Apple Music is the same price per month as MOG.3. The Apple Music start screen asks "Joined through Telstra?"  But offers no other information. What's going on?

  • Real Player plugin in use - how to get rid of it?

    I tried to play something someone sent me, it required realaudio, I downloaded for free Real player for mac, it didn't do the job, so I tried to trash it, but I keep getting the message above. Anyone knows what to do? Max

  • Print Dialog does NOT reset to defaults

    ON my iMac in OSX 10.9.4, when you go to print the previous settings for number of copies to print are retained instead of resetting to 1. Therefore, if people are not watching this, extra copies get printed until you realize what is going on. Is the

  • TableView scrolling even when scroll bar is in the middle

    All If we have a table that has events being inserted into it constantly when I move the scrollbar half way down the table keeps scrolling so I can't fix it on a certain row that I want to look at.

  • Why is my Macbook so slow to open?

    Why is my MacBook so slow to start up? I've recently cleared more space on the start-up disk (currently has 49GB of the 74GB capacity), but it still takes about 2 minutes to start up from cold. Any suggestions?