Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java Newb, null pointer question...

Status
Not open for further replies.

hugstable

Programmer
Feb 20, 2006
65
US
trying to compile some code in creator 2 (on a Mac)

got the following blowup:
Code:
java.lang.NullPointerException
	at com.sun.rave.jsf.project.ext.RaveWebActionProvider.updateWebXml(RaveWebActionProvider.java:967)
	at com.sun.rave.jsf.project.ext.RaveWebActionProvider.invokeAction(RaveWebActionProvider.java:203)
	at org.netbeans.modules.project.ui.actions.MainProjectAction.actionPerformed(MainProjectAction.java:90)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:334)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
	at java.awt.Component.processMouseEvent(Component.java:5554)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
	at java.awt.Component.processEvent(Component.java:5319)
	at java.awt.Container.processEvent(Container.java:2010)
	at java.awt.Component.dispatchEventImpl(Component.java:4021)
	at java.awt.Container.dispatchEventImpl(Container.java:2068)
	at java.awt.Component.dispatchEvent(Component.java:3869)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3936)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
	at java.awt.Container.dispatchEventImpl(Container.java:2054)
	at java.awt.Window.dispatchEventImpl(Window.java:1774)
	at java.awt.Component.dispatchEvent(Component.java:3869)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Pls point me in the right direction as to what could be wrong.... i am very new to this and need some help...

the source that caused the bomb to go off was

Code:
package com.brainysoftware;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;

public class MyCustomTag extends TagSupport {

  public int doEndTag() throws JspException {
    JspWriter out = pageContext.getOut();
    try {
      out.println("Hello from the custom tag.");
    } 
    catch (Exception e) {
    }
    return super.doEndTag();
  }
}

all help is greatly appreciated... thanks!
 
You are hiding the exception trace ... never to this.

Do
Code:
    try {
      out.println("Hello from the custom tag.");
    } 
    catch (Exception e) {
        e.printStackTrace();
        throw new JspException("Caught exception writing content from tag, orig exception : " +e);
    }

And then post the original exception trace

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
it wont compile... i added that code and when i compile i get almoste the same error...
THANKS FOR TRYING TO HELP...


Code:
java.lang.NullPointerException
	at com.sun.rave.jsf.project.ext.RaveWebActionProvider.updateWebXml(RaveWebActionProvider.java:967)
	at com.sun.rave.jsf.project.ext.RaveWebActionProvider.invokeAction(RaveWebActionProvider.java:203)
	at org.netbeans.modules.project.ui.actions.FileCommandAction.actionPerformed(FileCommandAction.java:73)
	at org.netbeans.modules.project.ui.actions.LookupSensitiveAction.actionPerformed(LookupSensitiveAction.java:88)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:334)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
	at java.awt.Component.processMouseEvent(Component.java:5554)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
	at java.awt.Component.processEvent(Component.java:5319)
	at java.awt.Container.processEvent(Container.java:2010)
	at java.awt.Component.dispatchEventImpl(Component.java:4021)
	at java.awt.Container.dispatchEventImpl(Container.java:2068)
	at java.awt.Component.dispatchEvent(Component.java:3869)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3936)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
	at java.awt.Container.dispatchEventImpl(Container.java:2054)
	at java.awt.Window.dispatchEventImpl(Window.java:1774)
	at java.awt.Component.dispatchEvent(Component.java:3869)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)



 
Check that both pageContext and the PrintStream you get are not null.

Cheers,
Dian
 
Thats not a compiler error - thats a runtime error.

Anyway, no-where in that stack trace can I see any method being executed that matches with the code that you have posted ...

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
i compiled it in creator - i am working on installing tomcat on my mac... i want to try and compile from javac... i will post those errors in a few...
 
you are 100% right... compiled fine on my tux box.... Looks like a creator 2 issue... GO SUN!

IF THERE ARE ANY CREATOR 2 USERS WHO CAN HELP ME OUT.... please let me know what the f*ck i am doing wrong... spent all day on this like a tool.... very disapointing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top