Java.lang.NullPointerException still in the beta 2

I opened a class with 322 lines of code, press CTRL+A (select all) and then CTRL+C (copy to clipboard) and gives me the exception:
"Copy" did not complete normally.  Please see the log for more information.
java.lang.NullPointerException
This error was already reported in the beta 1 of the Flash Builder 4.7 so seems that still remains in this new release.

Hi,
Could you please send a sample snippet or class to [email protected] ? It will help us reproduce this issue.
Also, please attach log file (Location: yourworkspace/.metadata/.log)?
Thanks,
Radhakrishna

Similar Messages

  • Java.lang.NullPointerException: When Get the PDF File Name

    Hi,
    i try to follow the blog on <b>Handling FileUpload and FileDownload in NetWeaver Developer Studio(NWDS) 2004S</b> on /people/rekha.malavathu2/blog/2006/12/12/handling-fileupload-and-filedownload-in-netweaver-developer-studionwds-2004s
    as i create a fileupload and i wish to get the file name and the pdf, then i to run and deploy it but i get <b>java.lang.NullPointerException</b>
    the code are as below when i click on send email button
    IPrivateEmail.IFileUploadNodeNode node = wdContext.nodeFileUploadNode();
    IPrivateEmail.IFileUploadNodeElement fileUploadEle = node.createFileUploadNodeElement();
         try{
         IWDResource resource = WDResourceFactory.createResource(wdContext.currentContextElement().getFileUploadUI().read(true), wdContext.currentContextElement().getFileUploadUI().getResourceName(), WDWebResourceType.PDF, true);
         fileUploadEle.setFileUploadAttr(resource);
         fileUploadEle.setFileUploadName(wdContext.currentContextElement().getFileUploadUI().getResourceName());
         node.addElement(fileUploadEle);
         }catch(Exception e){
         wdComponentAPI.getMessageManager().reportSuccess("ERROR"+e.getMessage());
    but i wonder which part of the code i did wrongly.. as i wish to insert into my send email code
    Properties props = new Properties();
              String host = "SMTP HOST";
              props.put("mail.smtp.host", host);
              Session session = Session.getInstance(props, null);
              MimeMessage message = new MimeMessage(session);
              Address toAddress = new InternetAddress();
              Address fromAddress = new InternetAddress();
              Address ccAddress = new InternetAddress();
              Address bccAddress = new InternetAddress();
              try
                   MimeMultipart multipart = new MimeMultipart();
                   BodyPart messageBodyPart = new MimeBodyPart();
                   if (! wdContext.currentEmailElement().getFrom().equals(""))
                        fromAddress = new InternetAddress(wdContext.currentEmailElement().getFrom());               
                        message.setFrom(fromAddress);
                   if (! wdContext.currentEmailElement().getTo().equals(""))
                        toAddress = new InternetAddress(wdContext.currentEmailElement().getTo());
                        message.setRecipient(Message.RecipientType.TO, toAddress);
                   if (! wdContext.currentEmailElement().getCc().equals(""))
                        ccAddress = new InternetAddress(wdContext.currentEmailElement().getCc());
                        message.setRecipient(Message.RecipientType.CC, ccAddress);
                   if (! wdContext.currentEmailElement().getBcc().equals(""))
                        bccAddress = new InternetAddress(wdContext.currentEmailElement().getBcc());
                        message.setRecipient(Message.RecipientType.BCC, bccAddress);
                   if (! wdContext.currentEmailElement().getSubject().equals(""))
                        message.setSubject(wdContext.currentEmailElement().getSubject());
                   if (! wdContext.currentEmailElement().getBody().equals(""))
                        messageBodyPart.setText(wdContext.currentEmailElement().getBody());
                   multipart.addBodyPart(messageBodyPart);
                   messageBodyPart = new MimeBodyPart();
                   String filename = IWDResource.getResourceName();
                   DataSource source = new FileDataSource(filename);
                   messageBodyPart.setDataHandler(new DataHandler(source));
                   messageBodyPart.setFileName(source.getName());                    
                   messageBodyPart.setHeader("Content-Type","application/pdf");
                   multipart.addBodyPart(messageBodyPart);
                   message.setContent(multipart);
                   Transport.send(message);
              catch (AddressException e)
                   wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
                   e.printStackTrace();
              catch (SendFailedException e)
                   wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
                   e.printStackTrace();
              catch (MessagingException e)
                   wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
                   e.printStackTrace();
    so i wonder could anyone help me out.. as i need to get the pdf filename order to put into the variable call <b>filename</b> at the send mail code.
    below is the error message
    java.lang.NullPointerException
         at com.sap.example.uploademail.Email.wdDoInit(Email.java:124)
         at com.sap.example.uploademail.wdp.InternalEmail.wdDoInit(InternalEmail.java:146)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
         at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:200)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:155)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.doOpen(WebDynproWindow.java:295)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.show(ApplicationWindow.java:183)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.open(ApplicationWindow.java:178)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:364)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:748)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:283)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:759)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:712)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

    facing same issue.
    jdev 10.1.3.3.0, on expanding the database connection, I get a null pointer exception.
    On the testing the connection it says 'success' though.
    any inputs ?

  • Java.lang.NullPointerException : Where is the bug ?!

    Hi,
    where is the bug in this method ?
    I just do not see it !
    When I run it I get the following error message
    Exception in thread "main" java.lang.NullPointerException
    at edu.clip.rerank.main.packageRec(main.java:239)
    and line 239 is the one I have indicated with <================
    Any suggestion would be immensely appreciated.
    Many thanks.
    public static RerankInstance packageRec (ArrayList chunk)
    String spanish = new String();
    String gold = new String();
    String line = null;
    boolean readingCandidates = false;
    Double lm = null;
    Double tm = null;
    Double lm_tm = null;
    ArrayList candidates = new ArrayList();
    ArrayList LM_likelihoods = new ArrayList();
    ArrayList TM_likelihoods = new ArrayList();
    ArrayList LM_TM_likelihoods = new ArrayList();
    RerankInstance foo = null;
    for (int i = 0; i < chunk.size(); i++) {
    if (!chunk.get(0).toString().startsWith("<REC>")) {
    System.out.println("PROBLEM DETECTED " + chunk.get(0));
    line = chunk.get(i).toString();
    if (line.startsWith("Spanish=")) {
    spanish = line.substring("Spanish=".length());
    System.out.println("SPANISH== " + spanish);
    else if (line.startsWith("Gold="))
    gold = line.substring("Gold=".length());
    else if (line.startsWith("<CANDIDATES>"))
    readingCandidates = true;
    else if (line.startsWith("</CANDIDATES>"))
    readingCandidates = false;
    if (spanish != null && candidates.size() > 0) {
    System.out.println("Spanish=" + spanish);
    String [] cands = (String[]) candidates.toArray(new String[0]);
    foo = new RerankInstance (spanish, cands);
    ArrayList LM_temp = new ArrayList();
    ArrayList TM_temp = new ArrayList();
    ArrayList LM_TM_temp = new ArrayList();
    if (LM_likelihoods.size() > 0 )
    Double [] LM_likes = (Double[])LM_likelihoods.toArray(new Double[0]);
    foo.setLikelihoods_single(LM_likes);
    if (TM_likelihoods.size() > 0 ){
    Double [] TM_likes = (Double[])TM_likelihoods.toArray(new Double[0]);
    foo.setLikelihoods_single(TM_likes);
    if (LM_TM_likelihoods.size() > 0 ) {
    Double [] LM_TM_likes = (Double[])LM_TM_likelihoods.toArray(new Double[0]);
    foo.setLikelihoods_single(LM_TM_likes);
    }//if
    else if (readingCandidates) {
    System.out.println("Candidate[" + line + "]");
    int ndx = line.indexOf('\t');
    candidates.add(line.substring(0,ndx));
    int ndx_a = line.indexOf('\t', ndx+1);
    int ndx_b = line.indexOf('\t', ndx_a+1);
    if (ndx_a > ndx+1) {
    lm = (line.substring(ndx+1,ndx_a)).startsWith("-Infinity") ? new Double(0) : new Double (line.substring(ndx+1,ndx_a));
    if (ndx_b > ndx_a+1) {
    tm = (line.substring(ndx_a+1,ndx_b)).startsWith("-Infinity") ? new Double(0) : new Double(line.substring(ndx_a+1,ndx_b));
    if ( ndx_b > -1) {
    lm_tm = (line.substring(ndx_b+1)).startsWith("-Infinity") ? new Double (0) : new Double(line.substring(ndx_b+1));
    try
    if (lm != null)
    LM_likelihoods.add(lm);
    if (tm != null)
    TM_likelihoods.add(tm);
    if (lm_tm != null)
    LM_TM_likelihoods.add(lm_tm);
    } catch (Exception e){ };
    }//else
    }//for
    String test = foo.getSourcePhrase().getPhrase(); <==============
    System.out.println("WHERE IS THE SOURCE " + test);
    return foo;
    } //end of method

    Foo is definatelly null because...
    Near the begining of the method foo is initialised to null.
    A load of conditional statements follow in only one of which foo is instantiated.
    If this condition is not satisfied foo will remain null.
    If that happens then you will get the error that you're getting on line 239.
    Essentially all the conditions before the above mentioned condition would have to evaluate to false for foo not to remain null by the time line 239 is executed.
    Line 239 is executed regardles of any of the conditional statements in your method, i.e. regardless of whether null is instantiated or not, in which case it remains null - hence the NullPointerException.

  • Java.lang.NullPointerException : while editing the human task  JDeveloper

    java.lang.NullPointerException
    o.bpel.services.workflow.verification.impl.TaskContentAccess.getAccess(TaskContentAccess.java:127)
    o.tip.tools.ide.workflow.util.AccessRulesUtil.getDefaultActionAccessData(AccessRulesUtil.java:265)
    o.tip.tools.ide.workflow.util.AccessRulesUtil.getChangedActionAccessData(AccessRulesUtil.java:174)
    o.tip.tools.ide.workflow.editor.tab.TaskActionAccessConfigurationPanel.getData(TaskActionAccessConfigurationPanel.java:272)
    o.tip.tools.ide.workflow.editor.tab.TaskActionAccessConfigurationPanel.initMode(TaskActionAccessConfigurationPanel.java:439)
    o.tip.tools.ide.workflow.editor.tab.TaskAccessConfigurationPanel.initMode(TaskAccessConfigurationPanel.java:147)
    o.tip.tools.ide.workflow.editor.tab.AdvancedOptionsPanel.setData(AdvancedOptionsPanel.java:195)
    o.tip.tools.ide.workflow.editor.tab.AdvancedOptionsEditor.setData(AdvancedOptionsEditor.java:116)
    o.tip.tools.ide.workflow.editor.WorkflowManager.loadIntoUIModel(WorkflowManager.java:218)
    o.tip.tools.ide.workflow.addin.WFTabbedEditor.load(WFTabbedEditor.java:265)
    o.tip.tools.ide.workflow.addin.WFTabbedEditor.access$000(WFTabbedEditor.java:105)
    o.tip.tools.ide.workflow.addin.WFTabbedEditor$1.run(WFTabbedEditor.java:253)
    j.lang.Thread.run(Thread.java:619)

    Getting following error when I try to update Human task from JDeveloper
    Uncaught exception
    java.lang.NullPointerException
    o.bpel.services.workflow.verification.impl.TaskContentAccess.getAccess(TaskContentAccess.java:127)
    o.tip.tools.ide.workflow.util.AccessRulesUtil.getDefaultActionAccessData(AccessRulesUtil.java:265)
    o.tip.tools.ide.workflow.util.AccessRulesUtil.getChangedActionAccessData(AccessRulesUtil.java:174)
    o.tip.tools.ide.workflow.editor.tab.TaskActionAccessConfigurationPanel.getData(TaskActionAccessConfigurationPanel.java:272)
    o.tip.tools.ide.workflow.editor.tab.TaskAccessConfigurationPanel.getActionData(TaskAccessConfigurationPanel.java:103)
    o.tip.tools.ide.workflow.editor.tab.AdvancedOptionsPanel.getData(AdvancedOptionsPanel.java:215)
    o.tip.tools.ide.workflow.editor.tab.AdvancedOptionsEditor$LocalPropertyChangeListener.propertyChange(AdvancedOptionsEditor.java:141)
    j.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
    j.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
    j.a.Component.firePropertyChange(Component.java:8128)
    o.tip.tools.ide.workflow.editor.tab.AssigneesEditor.propertyChange(AssigneesEditor.java:186)
    j.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
    j.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
    j.a.Component.firePropertyChange(Component.java:8128)
    o.tip.tools.ide.workflow.editor.v2.StageEditor.firePropertyChange(StageEditor.java:1488)
    o.tip.tools.ide.workflow.editor.v2.StageEditor.propertyChange(StageEditor.java:1081)
    j.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
    j.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
    j.a.Component.firePropertyChange(Component.java:8128)
    o.tip.tools.ide.workflow.editor.v2.ParticipantEditor.editParticipant(ParticipantEditor.java:1304)
    o.tip.tools.ide.workflow.editor.v2.ParticipantEditor$LocalMouseAdapter.mouseClicked(ParticipantEditor.java:1004)
    j.a.Component.processMouseEvent(Component.java:6266)
    jx.s.JComponent.processMouseEvent(JComponent.java:3267)
    j.a.Component.processEvent(Component.java:6028)
    j.a.Container.processEvent(Container.java:2041)
    j.a.Component.dispatchEventImpl(Component.java:4630)
    j.a.Container.dispatchEventImpl(Container.java:2099)
    j.a.Component.dispatchEvent(Component.java:4460)
    j.a.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
    j.a.LightweightDispatcher.processMouseEvent(Container.java:4247)
    j.a.LightweightDispatcher.dispatchEvent(Container.java:4168)
    j.a.Container.dispatchEventImpl(Container.java:2085)
    j.a.Window.dispatchEventImpl(Window.java:2478)
    j.a.Component.dispatchEvent(Component.java:4460)
    j.a.EventQueue.dispatchEvent(EventQueue.java:599)
    j.a.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    j.a.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    j.a.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    j.a.EventDispatchThread.run(EventDispatchThread.java:122)

  • Java.lang.NullPointerException when trying to compile

    Hi everybody!
    I'm trying to compile a file using javax.tools.JavaCompiler but I get a java.lang.NullPointerException when running the program.
    Here is my code:
    public boolean CompExecFile(File filename){
              boolean compRes = false;
              try {
                   System.out.println(filename.getAbsolutePath());
                   JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
                   StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null); //line where I get the error
                   Iterable<? extends JavaFileObject> compilationUnits2 = fileManager.getJavaFileObjects(filename);
                   compRes = compiler.getTask(null, fileManager, null, null, null, compilationUnits2).call();
                   fileManager.close();
                 if (compRes) {
                     System.out.println ("Compilation was successful");
                 } else {
                     System.out.println ("Compilation failed");
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              return compRes;
         }There error on the line "StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);":
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException+
    I've seen several examples using the parameters "null,null,null" but I don't know if it's good :(
    Many thanks for your help.

    I've found something which could maybe be what I need to do but I'm not sure:
    // Build a new ClassLoader using the given URLs, replace current Classloader
    ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
    ClassLoader newCL = new URLClassLoader(myClasspathURLs, oldCL);
    Thread.currentThread().setContextClassLoader(newCL);
    System.out.println("Successfully replaced ClassLoader");
    Class fooClass = newCL.loadClass(appClass); //which replaces the line "Class<?> tempFileClass = Class.forName("TempFile");" ?!Is that what I need to do?
    EDIT: I've tried that but I still have the same problem:
                      File classFile = new File ("TempFile.class");
                      ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
                      ClassLoader newCL = new URLClassLoader(new URL[] {classFile.toURL()}, oldCL);
                      Thread.currentThread().setContextClassLoader(newCL);
                      System.out.println("Successfully replaced ClassLoader");
                      Class tempFileClass = newCL.loadClass("TempFile");
                      Method main = tempFileClass.getMethod("main", String[].class);
                      main.invoke(null,new String[0]); Edited by: Foobrother on Jul 28, 2008 8:18 AM

  • Java.lang.NullPointerException when doing SQL on ms access

    I am trying to perform Insert and delete commands on an access database and I continue to get a java.lang.NullPointerException when performing the action. Everything is fine when i do a Select * FROM..., I am able to read all of the information I ask for, but when performing the Insert/Delete commands I get the error. Any help would be appreciated, I will copy and past a portion of my code below. All of the fields and variable types match with what is in the database.
    public void executeAddSecretary() throws SQLException{
    String a,b;
    a= txtSecLname.getText();
    b= txtSecFname.getText();
    statement.execute("INSERT INTO Contact_Sec (Sec_Lname,Sec_Fname) Values ('" + a + "', '" + b + "')");
    System.out.println("updated Secretary");
    public void executeDeleteContact() throws SQLException{
    String a = "a";
    statement.execute("DELETE FROM Contact WHERE Lname = ('" + a + "')");
    System.out.println("deleted contact");
    Thanks to anyone who can help me out.

    1) Use prepared statement instead of statement.
    2) Do like this ...
    PreparedStatement prepStmt = null;
    try
         String query="INSERT INTO Contact_Sec (Sec_Lname,Sec_Fname) Values (?,?)");
         prepStmt = connection.prepareStatement(query);
         prepStmt.setString(1, value1);
         prepStmt.setString(2, value2);
         prepStmt.executeUpdate();
    catch (SQLException e)
         throw e;
    catch (Exception e)
         throw e;
    finally
         try
              if (prepStmt != null)
                   prepStmt.close();
         } catch (Exception e) {}
         try
              if (connection != null)
                   connection.close();
         } catch (Exception e) {}
    }3) If you still get the null exception then put step wise System.out's
    and debug it.
    -Rohit

  • Uncaught Exception: java.lang.NullPointerException

    Hi,
    My BB 8220 flip has always had battery problems. Lately the battery dies after only 8 hours in standby mode. The last time it died was two days ago, and after four hours of charging it finally turned back on - only to have the error 'Uncaught Exception: java.lang.NullPointerException' showing on the screen.  I have noticed that now the Call Log does not work for Incoming, Outgoing and Missed calls.  The SMS has also mysteriously disappeared so I am unable to send and receive texts.  My address book is still intact.  I don't have a data plan so I do not have any extra applications on the phone, simply what it came with.  I have tried to reboot (removing battery) a few times, but the error has not fixed itself.
    Any simple ways to fix this error, or is my phone beyond repair?
    Solved!
    Go to Solution.

    Hi and Welcome to the Forums!
    Given your description, I advise an OS reload or upgrade. From a PC, you can install any OS package to a BB via this procedure:
    http://supportforums.blackberry.com/t5/BlackBerry-Device-Software/How-To-Reload-Your-Operating-Syste...
    Note that while written for "reload", it can be used to upgrade, downgrade, or reload -- it all depends on the OS package you download and install to your PC. You can even use a different carriers OS package by simply inserting, between steps 1 and 2, the deletion, on your PC, of a file named VENDOR.XML. Be sure that you remove, from your PC, any other BB device OS packages as having more than one installed to the PC can cause conflicts with this procedure.
    If you are on MAC, you are limited to only your carriers sanctioned OS packages...but can still use any levels that they currently sanction. See this procedure:
    KB19915How to perform a clean reload of BlackBerry smartphone application software using BlackBerry Desktop Software
    Good luck and let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Unexpected exception with file: java.lang.NullPointerException

    Hi :)
    Still a Newbee
    Geting the message Unexpected exception with file: java.lang.NullPointerException
    Have traced the error down with the use of System.out.println(a sequential number); but having got it down to bReader.close();, I think, I'm not understanding why. I think it has something to do with the line while (text != null){
    Don't fully understand yet as a newbee, but one can only learn. Like my other error (I once spent six hours on a pair of {}!!!! we all learn) I've spent two evenings now resarching and trying to solve this, so a bit of help would be very much appreciated.
    Error occurs after System.out.println(7);
    Code
    private void initialiseData()
    String text;
    int size;
    try
    File file = new File("needleData.txt");
    FileReader fReader = new FileReader(file);
    BufferedReader bReader = new BufferedReader(fReader);
    text = bReader.readLine(); // Read the first line to get the number of needles stored
    size = Integer.parseInt(text);
    while (text != null){
    String type;
    double length;
    double thickestDiameter;
    int donationYear;
    String construction;
    boolean isStraight;
    boolean hasEye;
    boolean wasMachineMade;
    boolean isExhibited;
    text = bReader.readLine();
    type = text;
    //System.out.println("type " + type);
    text = bReader.readLine();
    length = Double.parseDouble(text);
    //System.out.println("length " + length);
    text = bReader.readLine();
    thickestDiameter = Double.parseDouble(text);
    //System.out.println("thickestDiameter " + thickestDiameter);
    text = bReader.readLine();
    donationYear = Integer.parseInt(text);
    //System.out.println("donationYear " + donationYear);
    text = bReader.readLine();
    construction = text;
    //System.out.println("construction " + construction);
    text = bReader.readLine();
    isStraight = text.equalsIgnoreCase("true")? true: false;
    //System.out.println("isStraight " + isStraight);
    text = bReader.readLine();
    hasEye = text.equalsIgnoreCase("true")? true: false;
    //System.out.println("hasEye " + hasEye);
    text = bReader.readLine();
    wasMachineMade = text.equalsIgnoreCase("true")? true: false;
    //System.out.println("wasMachineMade " + wasMachineMade);
    text = bReader.readLine();
    isExhibited = text.equalsIgnoreCase("true")? true: false;
    //System.out.println("isExhibited " + isExhibited);
    int i=0;
    needles = new Needle [9];
    needles[i] = new Needle("type", length, thickestDiameter, donationYear, "construction",isStraight, hasEye, wasMachineMade, isExhibited);
    size ++;
    i ++;
    System.out.println(7);
    bReader.close();
    System.out.println(8);
    fReader.close();
    System.out.println(9);
    } catch(FileNotFoundException e){
    System.out.println("File not found : " + e);
    } catch(IOException e){
    System.out.println("I/O exception reading file: "+ e);
    } catch(Exception e){
    System.out.println("Unexpected exception with file: " + e);
    Thanks :(

    Re-post (Formated) if i understand the formating correctly.
    private void initialiseData()
    String text;
    int size;
    try
    File file = new File("needleData.txt");
    FileReader fReader = new FileReader(file);
    BufferedReader bReader = new BufferedReader(fReader);
    text = bReader.readLine(); // Read the first line to get the number of needles stored
    size = Integer.parseInt(text);
    [while (text != null){
    String type;
    double length;
    double thickestDiameter;
    int donationYear;
    String construction;
    boolean isStraight;
    boolean hasEye;
    boolean wasMachineMade;
    boolean isExhibited;
    text = bReader.readLine();
    type = text;
    //System.out.println("type " + type);
    text = bReader.readLine();
    length = Double.parseDouble(text);
    //System.out.println("length " + length);
    text = bReader.readLine();
    thickestDiameter = Double.parseDouble(text);
    //System.out.println("thickestDiameter " + thickestDiameter);
    text = bReader.readLine();
    donationYear = Integer.parseInt(text);
    //System.out.println("donationYear " + donationYear);
    text = bReader.readLine();
    construction = text;
    //System.out.println("construction " + construction);
    text = bReader.readLine();
    isStraight = text.equalsIgnoreCase("true")? true: false;
    //System.out.println("isStraight " + isStraight);
    text = bReader.readLine();
    hasEye = text.equalsIgnoreCase("true")? true: false;
    //System.out.println("hasEye " + hasEye);
    text = bReader.readLine();
    wasMachineMade = text.equalsIgnoreCase("true")? true: false;
    //System.out.println("wasMachineMade " + wasMachineMade);
    text = bReader.readLine();
    isExhibited = text.equalsIgnoreCase("true")? true: false;
    //System.out.println("isExhibited " + isExhibited);
    int i=0;
    needles = new Needle [9];
    needles = new Needle("type", length, thickestDiameter, donationYear, "construction",isStraight, hasEye, wasMachineMade, isExhibited);
    size ++;
    i ++;
    System.out.println(7);
    bReader.close();
    System.out.println(8);
    fReader.close();
    System.out.println(9);
    } catch(FileNotFoundException e){
    System.out.println("File not found : " + e);
    } catch(IOException e){
    System.out.println("I/O exception reading file: "+ e);
    } catch(Exception e){
    System.out.println("Unexpected exception with file: " + e);

  • Data Federator Connection to R3 - java.lang.NullPointerException

    Hi.
    We are trying to add a SAP R3 DataSource in Data Federator XI 3.0 SP2.
    Test Connection gives us the following message: "The connection was established but there is no table for the given connection parameters", what it seems to be ok according to the SAP doc.
    However, when we try to get a list of the Functions or Infosets in the SAP system, an error comes because of a "java.lang.NullPointerException". Checking the application log we get the following:
    2010/03/30 12:21:27.059|<=|||0|26537104| |||||||||||||||"[LeSelect.Api.LSStatementImpl] - [Execution Thread 4]Executing query: CALL executeConnectorCommand '/TEST//TEST/user_bla/sources/draft/R3SYS', 'GET_FUNCTION_LIST * * 200'"
    2010/03/30 12:21:27.074|>=|E||0|26537104| |||||||||||||||"[LeSelect.Core.n] - [Execution Thread 4]Bad Wrapper Error:
    java.lang.NullPointerException
         at LeSelect.Wrappers.SAPR3.H.F(y:343)
         at LeSelect.Wrappers.SAPR3.H.executeCommand(y:285)
         at LeSelect.Core.B.D.R(y:151)
         at LeSelect.Core.QueryEngine.H.p.G(y:131)
         at LeSelect.Core.QueryEngine.H.p.A(y:105)
         at LeSelect.Core.QueryEngine.B.J.A(y:72)
         at LeSelect.Core.QueryEngine.Executor.y.A(y:227)
         at LeSelect.Core.QueryEngine.m.A(y:284)
         at LeSelect.Api.LSStatementImpl.lsExecuteQuery(y:314)
         at LeSelect.B.E.D.V(y:935)
         at LeSelect.B.E.K.B(y:105)
         at LeSelect.B.E.G$_A.run(y:691)"
    We registered the callback program and did all of the steps indicated for the installation, also checked the possible sources of the error according to OSS Note 1278491.
    Any idea how to solve this? Thanks.

    Hello, we have the similar problem: while connecting from Data Federator to SAP ERP we get the following error - "Wrapper /ZTEST/sources/ZTEST reported an exception which is not a WrapperException: java.lang.NullPointerException: null"
    It's necessary to install "SAP BusinessObjects Data Federator Infoset, SAP Query and ABAP Functions Connector Prototype"
    SAP BusinessObjects Web Intelligence Reporting for SAP ERP
    for connection to SAP ERP.
    Are there any ideas? Thanks

  • Getting "java.lang.NullPointerException" error message when trying to run an OATS OpenScript file from Eclipse to Create a record in Oracle EBS

    Hello,
    I'm trying to run a simple OpenScript script in Eclipse that creates a record (a Supplier in this case) in Oracle E-Business Suite. So I copied the the script file from OpenScript and created it as a Class in Eclipse.  Then I created a main class to call the methods within the script class but no matter what method I call (initialize, run or finalize) I'm getting the java.lang.NullPointerException message. The error doesn't seem to be related with any specific line in the script but with the way that I'm calling it.
    Should I call the OpenScript class from my main class in a different way? (see my examples below)
    BTW, all external .jar files coming with OATS have been added to my project in Eclipse.
    1) Here's the main class I created to call the OpenScript method (Eclipse auto-corrected my main class adding a Try and Catch around the method call):
    public class Test {
        public static void main(String[] args) {
            nvscript nvs = new nvscript();
            try {
                nvs.initialize();
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
    2) Here's the script from OpenScript (the actual script has more steps but I'm just using the first one for a proof of concept):
    import oracle.oats.scripting.modules.basic.api.*;
    import oracle.oats.scripting.modules.browser.api.*;
    import oracle.oats.scripting.modules.functionalTest.api.*;
    import oracle.oats.scripting.modules.utilities.api.*;
    import oracle.oats.scripting.modules.utilities.api.sql.*;
    import oracle.oats.scripting.modules.utilities.api.xml.*;
    import oracle.oats.scripting.modules.utilities.api.file.*;
    import oracle.oats.scripting.modules.webdom.api.*;
    import oracle.oats.scripting.modules.formsFT.api.*;
    import oracle.oats.scripting.modules.applet.api.*;
    public class nvscript extends IteratingVUserScript {
        @ScriptService oracle.oats.scripting.modules.utilities.api.UtilitiesService utilities;
        @ScriptService oracle.oats.scripting.modules.browser.api.BrowserService browser;
        @ScriptService oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService ft;
        @ScriptService oracle.oats.scripting.modules.webdom.api.WebDomService web;
        @ScriptService oracle.oats.scripting.modules.applet.api.AppletService applet;
        @ScriptService oracle.oats.scripting.modules.formsFT.api.FormsService forms;
        public void initialize() throws Exception {
            this.getSettings().set("formsft.useformsonly",true);
            browser.launch();
        public void run() throws Exception {
            beginStep(
                    "[1] E-Business Suite Home Page Redirect (/ebs12cloud.winshuttle.com:8000/)",
                    0);
                web.window(2, "/web:window[@index='0' or @title='about:blank']")
                        .navigate("http://ebs12.xxxxxxx.com:8000/");
                web.window(4, "/web:window[@index='0' or @title='Login']")
                        .waitForPage(null);
                    think(4.969);
                web.textBox(
                        7,
                        "/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:input_text[@id='usernameField' or @name='usernameField' or @index='0']")
                        .setText("winshuttle_user");
                    think(2.0);
                web.textBox(
                        8,
                        "/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:input_password[@id='passwordField' or @name='passwordField' or @index='0']")
                        .click();
                    think(1.109);
                web.textBox(
                        9,
                        "/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:input_password[@id='passwordField' or @name='passwordField' or @index='0']")
                        .setPassword(deobfuscate("kjhkjhkj=="));
                    think(1.516);
                web.button(
                        10,
                        "/web:window[@index='0' or @title='Login']/web:document[@index='0']/web:form[@id='DefaultFormName' or @name='DefaultFormName' or @index='0']/web:button[@id='SubmitButton' or @value='Login' or @index='0']")
                        .click();
            endStep();
        public void finish() throws Exception {       
    3) Here's the error messages I'm getting based on the method I call from my main class:
    3.a) when calling Initialize():
    java.lang.NullPointerException
        at oracle.oats.scripting.modules.basic.api.IteratingVUserScript.getSettings(IteratingVUserScript.java:723)
        at nvscript.initialize(nvscript.java:22)
        at Test.main(Test.java:9)
    3 b) when calling Run():
    java.lang.NullPointerException
        at oracle.oats.scripting.modules.basic.api.IteratingVUserScript.beginStep(IteratingVUserScript.java:260)
        at nvscript.run(nvscript.java:30)
        at Test.main(Test.java:9)
    Any help and/or constructive comment will be appreciated it.
    Thanks.
    Federico.

    UPDATE
    Compiling from command line I found out that the class definition for oracle.oats.scripting.modules.basic.api.IteratingVUserScript is missing. Do you know what .jar file contains this class?
    Thanks.
    Fede.

  • Java.lang.NullPointerException in RFC Receiver Adapter

    Hi Experts,
    i have configured SQL Sender Adapter and this works fine, i can see the payload. and at the receiver adapter i have configured RFC Receiver Adapter this is throwing NullPointerException as mentioned below.. can someone help me out to fix this issue..
    Error Description:
    Error     Exception caught by adapter framework: null
    Success     MP: Processing local module localejbs/AF_Modules/RequestResponseBean
    Error     MP: Exception caught with cause java.lang.NullPointerException
    Error     Delivery of the message to the application using connection   
                    RFC_http://sap.com/xi/XI/System failed, due to:
                    com.sap.aii.af.ra.ms.api.RecoverableException: java.lang.NullPointerException.
    Success     The message status set to WAIT.
    Thanks,
    Srikanth

    Hi Srikanth,
    This error Occurs because of incomplete configuration in the reciever communication channel.Please check all the required configurations in the reciever communication channel and then activate the channel.
    Regards,
    Naveen

  • SOAP: call failed: java.lang.NullPointerException

    Hi,
    We are geeting the error in RWB -->
    SOAP: call failed: java.lang.NullPointerException
    We checked the communication channel and interface and all are working fine.
    Can anybody suggest?
    Regards,
    Akki..................

    Hi,
    use this link to find the answer..
    SOAP adapter
    Regards,
    Amitanshu

  • Getting Java.Lang.NullPointerException

    Hi,
    I am getting java.lang.NullPointerException when calling the 'validate' method. Appreciate any help.
    Thanks
    import com.sun.net.ssl.internal.ssl.Provider;
    import java.io.*;
    import java.net.URL;
    import java.net.URLEncoder;
    import java.security.Security;
    import java.text.DateFormat;
    public class PSCASClient{
    public static String validate(String fullUrl, String ticket, String altVal) throws IOException {
    String validateURL = null;
    if (altVal.equals("N")) {
    validateURL = "https://login.uconn.edu/cas/validate";
    else
    validateURL = "https://login.uconn.edu/cas/validate";
    try
    Security.addProvider(new Provider());
    System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
    int ticketParamIndex = fullUrl.lastIndexOf("&ticket=");
    String service = null;
    if (ticketParamIndex != -1) {
    // service = URLEncoder.encode(fullUrl.substring(0, ticketParamIndex)); /* This method is deprecated - JA */
    service = URLEncoder.encode(fullUrl.substring(0, ticketParamIndex), service);
    else {
    // service = URLEncoder.encode(fullUrl); /* This method is deprecated - JA */
    service = URLEncoder.encode(fullUrl, service);
    URL u = new URL(validateURL + "?ticket=" + ticket + "&service=" + service);
    BufferedReader in = new BufferedReader(new InputStreamReader(u.openStream()));
    if (in == null) {
    return null;
    String line1 = in.readLine();
    String line2 = in.readLine();
    if (line1 != null && line2 != null && line1.equals("yes"))
    String user = line2;
    user = user.toUpperCase();
    return user;
    else {
    return null;
    catch(Exception e)
    logMessage("ERROR: Exception attempting validate: " + e);
    return null;
    public static void logMessage(String message){
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ");
    Date now = new Date();
    try
    BufferedWriter os = new BufferedWriter(new FileWriter("/tmp/pscas_signon_log.txt", true));
    os.write(formatter.format(now));
    os.write(message);
    os.write("\n");
    os.close();
    catch(IOException _ex) { }

    Hi,
    I am getting java.lang.NullPointerException when
    calling the 'validate' method. Appreciate any help.
    Thanks
    import com.sun.net.ssl.internal.ssl.Provider;
    import java.io.*;
    import java.net.URL;
    import java.net.URLEncoder;
    import java.security.Security;
    import java.text.DateFormat;
    public class PSCASClient{
    public static String validate(String fullUrl, String
    ticket, String altVal) throws IOException {
    String validateURL = null;
    if (altVal.equals("N")) {
    validateURL = "https://login.uconn.edu/cas/validate";
    else
    validateURL = "https://login.uconn.edu/cas/validate";
    try
    Security.addProvider(new Provider());
    System.setProperty("java.protocol.handler.pkgs",
    "com.sun.net.ssl.internal.www.protocol");
    int ticketParamIndex =
    fullUrl.lastIndexOf("&ticket=");
    String service = null;
    if (ticketParamIndex != -1) {
    // service = URLEncoder.encode(fullUrl.substring(0,
    ticketParamIndex)); /* This method is deprecated - JA
    service = URLEncoder.encode(fullUrl.substring(0,
    ticketParamIndex), service);
    else {
    // service = URLEncoder.encode(fullUrl); /* This
    method is deprecated - JA */
    service = URLEncoder.encode(fullUrl, service);
    URL u = new URL(validateURL + "?ticket=" + ticket +
    "&service=" + service);
    BufferedReader in = new BufferedReader(new
    InputStreamReader(u.openStream()));
    if (in == null) {
    return null;
    String line1 = in.readLine();
    String line2 = in.readLine();
    if (line1 != null && line2 != null &&
    line1.equals("yes"))
    String user = line2;
    user = user.toUpperCase();
    return user;
    else {
    return null;
    catch(Exception e)
    logMessage("ERROR: Exception attempting validate: " +
    e);
    return null;
    public static void logMessage(String message){
    SimpleDateFormat formatter = new
    SimpleDateFormat("yyyy-MM-dd HH:mm:ss ");
    Date now = new Date();
    try
    BufferedWriter os = new BufferedWriter(new
    FileWriter("/tmp/pscas_signon_log.txt", true));
    os.write(formatter.format(now));
    os.write(message);
    os.write("\n");
    os.close();
    catch(IOException _ex) { }
    }I am using the package jsse.jar. The following lines may be causing the error.
    try
    Security.addProvider(new Provider());
    System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
    int ticketParamIndex = fullUrl.lastIndexOf("&ticket=");
    String service = null;
    if (ticketParamIndex != -1) {
    // service = URLEncoder.encode(fullUrl.substring(0, ticketParamIndex)); /* This method is deprecated - JA */
    service = URLEncoder.encode(fullUrl.substring(0, ticketParamIndex), service);
    else {
    // service = URLEncoder.encode(fullUrl); /* This method is deprecated - JA */
    service = URLEncoder.encode(fullUrl, service);
    URL u = new URL(validateURL + "?ticket=" + ticket + "&service=" + service);

  • Java.lang.NullPointerException warning beside components on ADF JSP page

    java.lang.NullPointerException warning beside components on ADF JSP page problem
    Hello
    i developed a web application with the help of the Adf technology On jdeveloper 10.1.3.3.0 . Everything is Ok.
    But when i use application sometimes on the page i take a java.lang.NullPointerException warn beside the some components like a inputbox or a radio button ..)
    i looked the logs but nothing.
    How can i solve this problem.
    Have you got any idea?

    Hi,
    it's the validator property on inputText components that causes it. not validation or StateValidation or EnableTokenValidation.
    Paste your inputText source from the page if you are not sure.
    Brenden

  • Java.lang.NullPointerException (OC4J 10.1.3.1 & JDeveloper 10.1.3.1)

    My project that ran perfectly under JDeveloper 9.0.5.2/OC4J 9.0.2 no loner runs under Jdeveloper 10.1.3.1/OC4J 10.1.3.1.
    The failure (java.lang.NullPointerException ) is in the following code snippet:
    =================================================
    Public String getString(String columnName) throws SQLException {
    return getResultSet().getString(columnName);
    =================================================
    columnName is being passed the same value in both environments.
    The JSP snippet that executes the above is:
    =================================================
    com.app.servlet.SQLDataSource detail =
    ((com.app.servlet.SQLDataSource)request.getAttribute("AcctList"));
    <td width="20%" class="tableRow">
    <a class="a4"><%= detail.getString("ACCT")%></a>
    </td>
    ==================================================
    AcctList is a text file that contains the following SQL code:
    ============
    select ACCT
    , VDESC
    from GL
    :WhereClause
    :OrderByClause
    ============
    :WhereClause & :OrderByClause are set in a calling "Filter" JSP filter page.
    All debug statements in my code indicate the the getResultSet is properly executed. Yet when the detail.getString("ACCT") is hit I receive the NullPointerException.
    Any clues?
    Remember, no code has changed between the 9.0.2 and 10.1.3.1 environments. They both hot the same database with the same JDBC drivers.
    TIA,
    Ed.

    Jan,
    The NullPointerException is pointed to:
    at oracle.jdbc.driver.ScrollableResultSet.findColumn(ScrollableResultSet.java:1308)
    at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1572)
    at oracle.jdbc.SQLDataSource.getString(SQLDataSource.java:388)
    at apps.AcctList._jspService(_AcctList.java:66)
    The code ( in "_AcctList.java") at line 66 reads:
    out.print(detail.getString"ACCT") );
    However, digging into my application log file I found that the following error happend at 10:52:46.0 (the above error occured at 10:52.50):
    07/03/02 10:52:46.0 intemrp: Servlet error
    java.lang.IllegalStateException: OutputStream already retrieved
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.EvermindHttpServletResponse.getWriter(EvermindHttpServletResponse.java:921)
         at com.sage.servlet.ServletAdaptor.error(ServletAdaptor.java:148)
         at com.sage.servlet.ServletAdaptor.service(ServletAdaptor.java:74)
         at inetmrp.servlet.ServletAdaptor.service(ServletAdaptor.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    07/03/02 10:52:46.0 intemrp: An existing connection was forcibly closed by the remote host
    07/03/02 10:52:46.0 intemrp: An existing connection was forcibly closed by the remote host
    Any ideas?
    Thanks,
    Ed.

Maybe you are looking for