NullPointerException when filling in stacktrace?

Hi,
In the app I'm trying to understand, an exception is thrown. I know so, as I use log4j to log what happens. Log4j is set to DEBUG.
This is some of my code
public class CreateCustomerAction extends Action {
  //Logger
  static Logger logger = Logger.getLogger(CreateCustomerAction.class);
  public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) {
     // Some initialisation
    try {
      customerDAO.createCustomer(customerTO);   
      actionMessages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("success.add"));
      saveMessages(request, actionMessages);
      return (mapping.findForward("success"));
    catch (Exception ex) {
      if (ex==null)
          logger.info("exception is null! ============================== ");
      logger.info("an exception occurred! ============================== ",ex.fillInStackTrace()); // LINE 54!The appropriate code in CustomerDAO
    try {
      logger.info("MBE: ++++++ getConnection ++++++++");
      connection = getConnection();
      // Some more code
    catch (SQLException ex) {
      logger.info("MBE: ++++++ SQLException ++++++ ");     
      throw new DAOException();
    }This is what I get in my log file:
11:27:19,506 INFO  app15a.action.CreateCustomerAction - ++++++ getConnection ++++++++
11:27:19,522 INFO  app15a.action.CreateCustomerAction - an exception occurred! ==============================
java.lang.NullPointerException
     at app15a.action.CreateCustomerAction.execute(CreateCustomerAction.java:54)
     at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
     at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
     at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
     at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
     at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:852)
     at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:584)
     at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
     at java.lang.Thread.run(Unknown Source)Am I correct in assuming the exception that was thrown in the other class is Null? When not obvious, line 54 is the line containing the following code:
logger.info("an exception occurred! ============================== ",ex.fillInStackTrace());And why did my logfile not show an entry containing ++++++ SQLException ++++++?

Abel wrote:
You lost me. In the line
logger.info("an exception occurred! ============================== ",ex.fillInStackTrace());there are two objects, logger and ex. And IMHO, if I see "an exception occurred! ============================== " and a stack trace, I doubt it is coming from a logger object that is not instantiated. I would not know any other way to check if logger==null.Ok, have it your way. Of course one can never print out 'logger' and 'ex' and one can never use a debugger and one can never look at the code to make sure that 'logger' is initialized to something other than null. What one can do is, without any checks, tell everyone that they are wrong.
Edited by: sabre150 on Jan 2, 2008 1:02 PM

Similar Messages

  • NullPointerException when doing a getObjectById

    In one circumstance I am getting a NullPointerException when performing a
    getObjectById. I double checked to be sure that all fields of the object
    Id are filled properly and that the metadata is mapped properly. This
    error is with 2.5.0 b2
    - Jeff
    Exception and Stack Trace:
    com.solarmetric.kodo.runtime.FatalException: java.lang.NullPointerException
    NestedThrowables:
    java.lang.NullPointerException
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectByIdFilter(PersistenceManagerImpl.java:1150)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1045)
    at
    dtv.pos.tender.TenderHelper.getTenderSettingsForGroup(TenderHelper.java:69)
    at
    dtv.pos.tender.ValidateTenderAmountRule.validateGroup(ValidateTenderAmountRule.java:42)
    at
    dtv.pos.tender.ValidateTenderAmountRule.isValid(ValidateTenderAmountRule.java:28)
    at
    dtv.pos.common.AbstractValidationOp.applyValidationRules(AbstractValidationOp.java:205)
    at
    dtv.pos.common.AbstractValidationOp.runValidationCheck(AbstractValidationOp.java:170)
    at
    dtv.pos.common.AbstractValidationOp.handleOpExec(AbstractValidationOp.java:133)
    at
    dtv.pos.framework.op.DefaultOpChain.internalDoOp(DefaultOpChain.java:353)
    at
    dtv.pos.framework.op.DefaultOpChain.handleOpExec(DefaultOpChain.java:178)
    at
    dtv.pos.framework.op.OpChainProcessor.runChain(OpChainProcessor.java:336)
    at
    dtv.pos.framework.op.OpChainProcessor.internalEventHandle(OpChainProcessor.java:271)
    at dtv.pos.framework.op.OpChainProcessor.run(OpChainProcessor.java:106)
    at java.lang.Thread.run(Thread.java:536)
    NestedThrowablesStackTrace:
    java.lang.NullPointerException
    at
    com.solarmetric.kodo.runtime.StateManagerImpl.initialize(StateManagerImpl.java:216)
    at
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.loadByPK(ClassMapping.java:986)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.initialize(JDBCStoreManager.java:327)
    at
    com.solarmetric.kodo.runtime.StateManagerImpl.loadInitialState(StateManagerImpl.java:177)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectByIdFilter(PersistenceManagerImpl.java:1143)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1045)
    at
    dtv.pos.tender.TenderHelper.getTenderSettingsForGroup(TenderHelper.java:69)
    at
    dtv.pos.tender.ValidateTenderAmountRule.validateGroup(ValidateTenderAmountRule.java:42)
    at
    dtv.pos.tender.ValidateTenderAmountRule.isValid(ValidateTenderAmountRule.java:28)
    at
    dtv.pos.common.AbstractValidationOp.applyValidationRules(AbstractValidationOp.java:205)
    at
    dtv.pos.common.AbstractValidationOp.runValidationCheck(AbstractValidationOp.java:170)
    at
    dtv.pos.common.AbstractValidationOp.handleOpExec(AbstractValidationOp.java:133)
    at
    dtv.pos.framework.op.DefaultOpChain.internalDoOp(DefaultOpChain.java:353)
    at
    dtv.pos.framework.op.DefaultOpChain.handleOpExec(DefaultOpChain.java:178)
    at
    dtv.pos.framework.op.OpChainProcessor.runChain(OpChainProcessor.java:336)
    at
    dtv.pos.framework.op.OpChainProcessor.internalEventHandle(OpChainProcessor.java:271)
    at dtv.pos.framework.op.OpChainProcessor.run(OpChainProcessor.java:106)
    at java.lang.Thread.run(Thread.java:536)

    I have discovered that the cause of this error was that we accidentaly
    made the class abstract. I am confused however as to why this caused a
    null-pointer exception, as opposed to an exception that complained about
    trying to instantiate an abstract class.
    Jeff Sheldon wrote:
    In one circumstance I am getting a NullPointerException when performing a
    getObjectById. I double checked to be sure that all fields of the object
    Id are filled properly and that the metadata is mapped properly. This
    error is with 2.5.0 b2
    - Jeff
    Exception and Stack Trace:
    com.solarmetric.kodo.runtime.FatalException: java.lang.NullPointerException
    NestedThrowables:
    java.lang.NullPointerException
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectByIdFilter(PersistenceManagerImpl.java:1150)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1045)
    at
    dtv.pos.tender.TenderHelper.getTenderSettingsForGroup(TenderHelper.java:69)
    at
    dtv.pos.tender.ValidateTenderAmountRule.validateGroup(ValidateTenderAmountRule.java:42)
    at
    dtv.pos.tender.ValidateTenderAmountRule.isValid(ValidateTenderAmountRule.java:28)
    at
    dtv.pos.common.AbstractValidationOp.applyValidationRules(AbstractValidationOp.java:205)
    at
    dtv.pos.common.AbstractValidationOp.runValidationCheck(AbstractValidationOp.java:170)
    at
    dtv.pos.common.AbstractValidationOp.handleOpExec(AbstractValidationOp.java:133)
    at
    dtv.pos.framework.op.DefaultOpChain.internalDoOp(DefaultOpChain.java:353)
    at
    dtv.pos.framework.op.DefaultOpChain.handleOpExec(DefaultOpChain.java:178)
    at
    dtv.pos.framework.op.OpChainProcessor.runChain(OpChainProcessor.java:336)
    at
    dtv.pos.framework.op.OpChainProcessor.internalEventHandle(OpChainProcessor.java:271)
    at dtv.pos.framework.op.OpChainProcessor.run(OpChainProcessor.java:106)
    at java.lang.Thread.run(Thread.java:536)
    NestedThrowablesStackTrace:
    java.lang.NullPointerException
    at
    com.solarmetric.kodo.runtime.StateManagerImpl.initialize(StateManagerImpl.java:216)
    at
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.loadByPK(ClassMapping.java:986)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.initialize(JDBCStoreManager.java:327)
    at
    com.solarmetric.kodo.runtime.StateManagerImpl.loadInitialState(StateManagerImpl.java:177)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectByIdFilter(PersistenceManagerImpl.java:1143)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1045)
    at
    dtv.pos.tender.TenderHelper.getTenderSettingsForGroup(TenderHelper.java:69)
    at
    dtv.pos.tender.ValidateTenderAmountRule.validateGroup(ValidateTenderAmountRule.java:42)
    at
    dtv.pos.tender.ValidateTenderAmountRule.isValid(ValidateTenderAmountRule.java:28)
    at
    dtv.pos.common.AbstractValidationOp.applyValidationRules(AbstractValidationOp.java:205)
    at
    dtv.pos.common.AbstractValidationOp.runValidationCheck(AbstractValidationOp.java:170)
    at
    dtv.pos.common.AbstractValidationOp.handleOpExec(AbstractValidationOp.java:133)
    at
    dtv.pos.framework.op.DefaultOpChain.internalDoOp(DefaultOpChain.java:353)
    at
    dtv.pos.framework.op.DefaultOpChain.handleOpExec(DefaultOpChain.java:178)
    at
    dtv.pos.framework.op.OpChainProcessor.runChain(OpChainProcessor.java:336)
    at
    dtv.pos.framework.op.OpChainProcessor.internalEventHandle(OpChainProcessor.java:271)
    at dtv.pos.framework.op.OpChainProcessor.run(OpChainProcessor.java:106)
    at java.lang.Thread.run(Thread.java:536)

  • NullPointerException when adding an object into a Vector Class

    So here is the code:
    package Image;
    import java.io.Serializable;
    import java.util.Vector;
    public class Album implements Serializable{
    private String name;
    private String password;
    Vector<ImageClass> allImages;
    public Album( String name, String password, Vector<ImageClass> allImages) {
    this.name = name;
    this.password = password;
    this.allImages = allImages;
    public Album() {
    public Vector<ImageClass> getAllImages() {
    return allImages;
    public void setAllImages(Vector<ImageClass> allImages) {
    this.allImages = allImages;
    public String getName() {
    return name;
    public void setName(String name) {
    this.name = name;
    public String getPassword() {
    return password;
    public void setPassword(String password) {
    this.password = password;
    public void addIC(ImageClass ic){
    allImages.add(ic);
    public ImageClass getIC(int pos){
    ImageClass ic = allImages.get(pos);
    return ic;
    Now I got an NullPointerException when I call the getIC Method from another class of another package
    Here is the part of code of that class.
    private void SaveMenuItemActionPerformed(java.awt.event.ActionEvent evt) {                                            
    ImageClass ic = new ImageClass();
    ic.setTitle(ImageTextField.getText());
    ic.setDescription(DescriptionTextArea.getText());
    try {
    ic.setReferenceNumber(Integer.parseInt(ReferenceTextField.getText()));
    } catch (NumberFormatException nfe) {
    JOptionPane.showMessageDialog(null, "Reference Number is not in a correct format");
    try {
    ic.setDate(new SimpleDateFormat("dd/MM/yyyy").parse(DateTextField.getText(), new ParsePosition(0)));
    } catch (IllegalArgumentException iae) {
    JOptionPane.showMessageDialog(null, "Date is not in correct format");
    ic.setImageData(imageData);
    if(a==null){
    JOptionPane.showMessageDialog(this,"Please, create or open an Album");
    }else{
    a.addIC(ic);
    try{
    ObjectOutputStream oos;
    FileOutputStream fos = new FileOutputStream(album, true);
    oos = new ObjectOutputStream(fos);
    oos.writeObject(a);
    oos.flush();
    oos.close();
    }catch(FileNotFoundException fnfe){
    fnfe.printStackTrace();
    }catch(IOException ioe){
    ioe.printStackTrace();
    }

    h1. The Ubiquitous Newbie Tips
    * DON'T SHOUT!!!
    * Homework dumps will be flamed mercilessly. [Feelin' lucky, punk? Well, do ya'?|http://www.youtube.com/watch?v=1-0BVT4cqGY]
    * Have a quick scan through the [Forum FAQ's|http://wikis.sun.com/display/SunForums/Forums.sun.com+FAQ].
    h5. Ask a good question
    * Don't forget to actually ask a question. No, The subject line doesn't count.
    * Don't even talk to me until you've:
        (a) [googled it|http://www.google.com.au/] and
        (b) had a squizzy at the [Java Cheat Sheet|http://mindprod.com/jgloss/jcheat.html] and
        (c) looked it up in [Sun's Java Tutorials|http://java.sun.com/docs/books/tutorial/] and
        (d) read the relevant section of the [API Docs|http://java.sun.com/javase/6/docs/api/index-files/index-1.html] and maybe even
        (e) referred to the JLS for "advanced" questions.
    * [Good questions|http://www.catb.org/~esr/faqs/smart-questions.html#intro] get better Answers. It's a fact. Trust me on this one.
        - Lots of regulars on these forums simply don't read badly written questions. It's just too frustrating.
          - FFS spare us the SMS and L33t speak! Pull your pants up, and get a hair cut!
        - Often you discover your own mistake whilst forming a "Good question".
        - Often you discover that you where trying to answer "[the wrong question|http://blog.aisleten.com/2008/11/20/youre-asking-the-wrong-question/]".
        - Many of the regulars on these forums will bend over backwards to help with a "Good question",
          especially to a nuggetty problem, because they're interested in the answer.
    * Improve your chances of getting laid tonight by writing an SSCCE
        - For you normal people, That's a: Short Self-Contained Compilable (Correct) Example.
        - Short is sweet: No-one wants to wade through 5000 lines to find your syntax errors!
        - Often you discover your own mistake whilst writing an SSCCE.
        - Often you solve your own problem whilst preparing the SSCCE.
        - Solving your own problem yields a sense of accomplishment, which makes you smarter ;-)
    h5. Formatting Matters
    * Post your code between a pair of &#123;code} tags
        - That is: &#123;code} ... your code goes here ... &#123;code}
        - This makes your code easier to read by preserving whitespace and highlighting java syntax.
        - Copy&paste your source code directly from your editor. The forum editor basically sucks.
        - The forums tabwidth is 8, as per [the java coding conventions|http://java.sun.com/docs/codeconv/].
          - Indents will go jagged if your tabwidth!=8 and you've mixed tabs and spaces.
          - Indentation is essential to following program code.
          - Long lines (say > 132 chars) should be wrapped.
    * Post your error messages between a pair of &#123;code} tags:
        - That is: &#123;code} ... errors here ... &#123;code}
        - OR: &#91;pre]&#123;noformat} ... errors here ... &#123;noformat}&#91;/pre]
        - To make it easier for us to find, Mark the erroneous line(s) in your source-code. For example:
            System.out.println("Your momma!); // <<<< ERROR 1
        - Note that error messages are rendered basically useless if the code has been
          modified AT ALL since the error message was produced.
        - Here's [How to read a stacktrace|http://www.0xcafefeed.com/2004/06/of-thread-dumps-and-stack-traces/].
    * The forum editor has a "Preview" pane. Use it.
        - If you're new around here you'll probably find the "Rich Text" view is easier to use.
        - WARNING: Swapping from "Plain Text" view to "Rich Text" scrambles the markup!
        - To see how a posted "special effect" is done, click reply then click the quote button.
    If you (the newbie) have covered these bases *you deserve, and can therefore expect, GOOD answers!*
    h1. The pledge!
    We the New To Java regulars do hereby pledge to refrain from flaming anybody, no matter how gumbyish the question, if the OP has demonstrably tried to cover these bases. The rest are fair game.

  • Occasionally when filling in forms in Safari 5.1.2 certain keys on the keyboard don"t work.  When I use the coma it opens up another tab.

    Occasionally when filling in forms in Safari 5.1.2 certain keys on the keyboard don"t work.  When I use the coma it opens up another tab. I've used other browsers to fill in the forms and they work fine so my keyboard is OK.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of this exercise is to determine whether the problem is localized to your user account, or is system-wide. Enable guest logins and log in as Guest. For instructions, launch the System Preferences application, select “Help” from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box.
    While logged in as Guest, you won’t have access to any of your personal files or settings. Any application you run will behave as if you were running it for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    As Guest, launch the application(s) and test. Same problem(s)?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.

  • After upgrading from acrobat 9.5 to XI pro my users have complained on slow typing when filling in form that were created in version 9.5?

    After upgrading from acrobat 9.5 to XI pro my users have complained on slow typing when filling in form that were created in version 9.5?
    The issue is they type but there is 2 second delay when it appears in the field.
    Windows 7 64bit

    I see, I misread your reference to Reader 11 to mean you were using Acrobat 11, but it looks like it worked out anyway.
    The base-14 fonts are special in PDF because they are guaranteed to be available even if they are not embedded. If you select a non-base-14 font for use with a form field, the entire font usually gets embedded, since each glyph it contains has to be available for use with the field. This can take up a lot of space if you do this a lot, and the space isn't reduced if you change back to a base-14 font later because the internal reference to it is not removed. This is caused by the bug I mentioned.
    In your case, however, the entire font doesn't get embedded because fonts like it (e.g., large asian fonts with a lot of glyphs, Arial Unicode) would take up too much space if fully embedded. If it did, a 100KB PDF could bloat to 20MB with that one change. Instead, users are expected to have such fonts installed on their system, which is why you were prompted to install the font pack. This despite the fact that the font was not actually used by anything in your document, it was simply the orphaned reference to it that triggered this. This should get fixed in Acrobat eventually so this type of thing doesn't happen again.

  • When filling out a form, some fields copy to others when I tab to the next. How can I make this stop?

    When filling out a form, some fields copy to others when I tab to the next. How can I make this stop?

    You can't using Adobe Reader. It looks like whomever created the form used the same identifiers (names) for various fields. Each field with the same name will populate with the information used in another field of the same name. This is intentional.
    Normally when I see this, it tells me that someone created an initial field then copy/pasted it to make additional fields but forgot to change the names.

  • How can I change the behavior of the Green Enter button when filling out a field in a form? Current it submits the entire form, I would like it to tab to the next field instead

    When using Firefox for Andriod:
    When filling out a field on a form, they keyboard has a Green Enter button that submits the entire form. However, there are multiple fields on the page, and I would like it to tab to the next field. At the very least not submit the form.
    Also, is there a way to configure the keyboard that shows up for each html5 input type?

    They keyboard that shows up has the large "Green Enter" go button, a backspace and some arrow keys, but no tab button.

  • When filling out a form, when I type in information in one field, move to the next and begin typing,

    when filling out a form, when I type information into the first field, move to the next and begin typing, the information in the prior field disappears

    Hey gregery,
    Please let me know what Acrobat version are you using.
    Also, go to File> Properties> Security and check whether form filling is allowed or not as shown below:
    Regards,
    Anubha

  • NullPointerException when trying to load faces application

    Hi,
    I'm new with JSF and I have a NullPointerException when trying to use a JSF tag in my file.
    My web.xml is defined as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
    </context-param>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    </web-app>
    And faces-config.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    The exception that I get is:
    java.lang.NullPointerException
         javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:615)
         javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:217)
         org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:71)
    (HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    I guess that it's a matter of configuration, but couldn't find a solution.
    Can someone help?
    Thanks,
    Efrat

    well i think you will need
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    in you web.xml as well can be server or client state save but quite sure you have to define that

  • 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 use source table as a mapping component

    Hi all,
    I am new to owb and I got NullPointerException when I try to drag a table to my mapping.
    The table is imported and it's from a windows oracle database. The mapping is located on my linux oracle database.
    By the way, I can even deploy the table.
    What have I done wrong and why this happen?
    thanks in advance.
    帖子经 953800编辑过

    Hi Timo,
    Thanks for the reply,
    If I understand correctly I need to apply to the weblogic server 10.3.5 + Sherman patch UPDATE1 patch #12979653 and patch #12917525. After this the ADF Runtime 11.1.1.5 installed in the Production environments will allow me to run my application that is running in ADF Runtime 11.1.2.1. right?
    I'm working on getting this patches installed. Thank you very much for your help.
    I run the test on my local server as a test class and as a web service, it worked perfect, nevertheless in the Production environment I got a interesting answer:
    Production 1 and 2:
    Request:
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://model/">
    <env:Header/>
    <env:Body>
    <ns1:getVersion/>
    </env:Body>
    </env:Envelope>
    Response
    <?xml version='1.0' encoding='UTF-8'?>
    <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
    <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
    <faultcode>S:Server</faultcode>
    <faultstring>oracle/jbo/Version</faultstring>
    </S:Fault>
    </S:Body>
    </S:Envelope>
    Request:
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://model/">
    <env:Header/>
    <env:Body>
    <ns1:getBuildLabel/>
    </env:Body>
    </env:Envelope>
    Response:
    <?xml version='1.0' encoding='UTF-8'?>
    <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
    <ns2:getBuildLabelResponse xmlns:ns2="http://model/">
    <return>oracle.jbo.Version</return>
    </ns2:getBuildLabelResponse>
    </S:Body>
    </S:Envelope>
    Edited by: 917852 on Jul 12, 2012 11:31 AM

  • Java.lang.NullPointerException when instantiating VORowImpl

    Hi , I am trying to extend a controller where I want to get an attribute value from a View object. I initiate the VO and then use vo.first() to get RowImpl. But I get NullPointerException when i use the extended CO in the page pointing to the line where I use VoRowImpl. Below is the code of ProcessFormRequest():
    OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);
    OAApplicationModule oarootam = oapagecontext.getRootApplicationModule();
    oarootam.invokeMethod("initExpenseReportHeadersVO");
    ExpenseReportHeadersVOImpl vo = (ExpenseReportHeadersVOImpl)oaapplicationmodule.findViewObject("ExpenseReportHeadersVO");
    ExpenseReportHeadersVORowImpl row = (ExpenseReportHeadersVORowImpl)vo.first(); //Error stack points to this line
    Number empId = null;
    if(row!=null){
    empId = (Number)row.getAttribute("EmployeeId");
    Please help me out.
    Regards,
    Gowthami.

    Looks like you are using OA Framework. Please ask on their forum {forum:id=210}
    Timo

  • Java.lang.NullPointerException when deploying a PIA

    I am having a problem deploying a PIA on PeopleTools 8.45.18 on Solaris 8 using WebLogic 8.1 sp 3. The error I experience is java.lang.NullPointerException when I run this command:
    ./setup.solaris -console -is:log /var/temp/piainstall.log
    InstallShield Wizard
    Initializing InstallShield Wizard...
    Searching for Java(tm) Virtual Machine...
    Welcome to the InstallShield Wizard for PeopleSoft Internet Architecture.
    Using the InstallShield Wizard you will install PeopleSoft Internet
    Architecture on your computer.
    Version: 8.45.18
    Note: If installing onto a BEA WebLogic Server, make sure to shutdown any
    running web servers to avoid web server corruption.
    Select Next to continue or Cancel to exit.
    Press 1 for Next, 3 to Cancel or 4 to Redisplay [1]
    Choose the setup type that best suits your needs.
    [X] 1 - BEA WebLogic Server
    [ ] 2 - IBM WebSphere Server
    To select an item enter its number, or 0 when you are finished: [0]
    Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]
    Please select the configuration to install.
    [X] 1 - Single Server Domain
    [ ] 2 - Multi Server Domain
    [ ] 3 - Distributed Managed Server
    To select an item enter its number, or 0 when you are finished: [0] 2
    Enter 0 to continue or 1 to make another selection: [0]
    Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]
    java.lang.NullPointerException
    An error occurred during wizard bean change notification:
    java.lang.NullPointerException
    at PSChangeSharedLibPermission.PSSearchAndSet(PSChangeSharedLibPermission.java:67)
    at PSChangeSharedLibPermission.execute(PSChangeSharedLibPermission.java:53)
    at com.installshield.wizard.StandardWizardListener.execute(StandardWizardListener.java:123)
    at com.installshield.wizard.StandardWizardListener.currentBeanChanged(StandardWizardListener.java:106)
    at com.installshield.wizard.Wizard$RunThread.run(Wizard.java:1564)
    any thoughts...

    please let me know if you have configured any RPS for the same.i faced a similar issue while i was trying to create an instance taken from oracle export dump taken from one of our client.our error got resolved when we changed the web profile to PROD. More often than not this is an issue with the webprofile. try changing the web profile one by one from dev to test to prod and kiosk.
    if none of these resolves the issue, try ruuning version app engine program. this will update the ppltools version. in correct version may also some times cause this issue.
    Please let me know if you have configured ldap.

  • Java.lang.NullPointerException when trying to start UM

    I get java.lang.NullPointerException when I try to start Unified Messaging using EM on a new Windows 2000 single-box installation. Has anyone enountered this problem?

    I have also encountered same issue. Please let me know the solution in case you find it.
    In fact after configuiring Oracle files as per the document provided at Oracle OTN site 'Collaboration handbook', I am unable to connect OID. As per log it says
    2003/04/01:20:37:58[Oidmon]: Unable to connect to database, will retry after 20 sec
    2003/04/01:21:20:21Starting Monitor Process, PID=2920
    2003/04/01:21:20:21ORACLE_SID not set, setting to iasdb
    2003/04/01:21:41:22Failed to fetch Process Table. ORA-12571: TNS:packet writer failure
    I checked Listener, which was found ok, then I checked TNSPING, which executed ok.
    I have dowloaded documents troubleshooting OID, but no success. The document itself says that architecture of OID is fairly complex and the log does not suggest much insight.
    Any solution?
    Regards,
    Vipul

  • 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

Maybe you are looking for

  • Itunes will not Import Video???

    Ok my itunes doesnt like me or something. Yesterday it let me import a .avi video file and convert it so my ipod can play it. So that one worked fine. Tried to do a few different ones today, no go. I try to import the file to my itunes library, it do

  • Installing Parallels when Boot Camp already running Windows

    I'm considering installing Parallels on my MacBook Pro, which I already have partitioned with a drive running Windows using Boot Camp. What I need to know is, do I need to eliminate the partition with Boot Camp and if so, will I have to completely re

  • Safari 7.1.2 very slow with web pages containing flash animations

    Hello, Since I haved installed the last flash plugin update, safari 7.1.2 (mac os 10.9.5) is very slow on pages containing flash stuff. Already try to clean "cache.db", "reinitialize safari" from "safari menu", does not work ... While surfing the con

  • Scheduler jobs to refresh table data from SQL server

    Hi ! I am planning to have a scheudler job to refresh data from a SQL server database into Oracle. All I do is run several of the below statements. Each of these tables have less than 100 rows. So, it completes in under 20 seconds. I am wondering if

  • PO modification even if it is finalized ?  :-(

    Hi, I have a big problem in my prod.environment...  We noticed that EBP can modify a PO document always !!! I mean, even if the PO has a confirmation and invoice in R3 (completely finalized). I made a test and I can modify the PO (increase the quanti