This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 30713

Summary: NPE while creating a JSP file under the classes directory of a Web Module
Product: javaee Reporter: Jason Rush <jrush>
Component: CodeAssignee: Petr Jiricka <pjiricka>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P3    
Version: -FFJ-   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 34090    
Bug Blocks:    

Description Jason Rush 2003-02-06 02:11:46 UTC
***  [S1S CUSTBUG] This issue is based on an S1S customer's bug report ***

Description: 
Create a jsp file under the classes directory:
You always have this NPE:
Thu Jul 25 19:18:00 PDT 2002: java.lang.NullPointerException: <no message>
java.lang.NullPointerException
        at
org.netbeans.modules.web.webdata.WebResourceImpl.getFileObject(WebResourceImpl.java:78)
        at
org.netbeans.modules.web.core.jsploader.JspCompileUtil.getFOForWebResource(JspCompileUtil.java:112)
        at
org.netbeans.modules.tomcat.tomcat40.compile.TomcatOptionsImpl.findDO(TomcatOptionsImpl.java:114)
        at
org.netbeans.modules.tomcat.tomcat40.compile.TomcatOptionsImpl.<init>(TomcatOptionsImpl.java:67)
        at
org.netbeans.modules.tomcat.tomcat40.compile.TomcatCompileContext$TomcatDevelopmentCompilation.initialize(TomcatCompileContext.java:209)
        at
org.netbeans.modules.tomcat.tomcat40.compile.TomcatCompileContext$TomcatDevelopmentCompilation.<init>(TomcatCompileContext.java:193)
        at
org.netbeans.modules.tomcat.tomcat40.compile.TomcatCompileContext.getDevelopmentCompilation(TomcatCompileContext.java:122)
        at
org.netbeans.modules.web.core.jsploader.JspDataObject.getCookie(JspDataObject.java:189)
        at org.openide.loaders.DataNode.getCookie(DataNode.java:295)
        at
org.openidex.nodes.looks.NodeProxyLook.getCookie(NodeProxyLook.java:96)
        at
org.openidex.nodes.looks.CompositeLook.getCookie(CompositeLook.java:237)
        at
org.netbeans.modules.web.core.jsploader.WebLookNode.getCookie(WebLookNode.java:234)
        at
org.openide.actions.AbstractCompileAction.enable(AbstractCompileAction.java:60)
        at org.openide.util.actions.NodeAction.isEnabled(NodeAction.java:119)
        at org.openide.awt.Actions$ButtonBridge.updateState(Actions.java:372)
[catch] at org.openide.awt.Actions$1.run(Actions.java:331)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:443)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:191)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)


Also when you try to complie this JSP you have:
bbb.jsp [-1:-1] java.io.FileNotFoundException: /bbb.jsp
        at
org.apache.jasper.compiler.ParserController.getReader(ParserController.java:435)
        at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:193)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
        at
org.netbeans.modules.tomcat.tomcat40.compile.TomcatCompileContext$TomcatDevelopmentCompilation.compileJspToServlet(TomcatCompileContext.java:493)
        at
org.netbeans.modules.web.core.jsploader.JspCompiler$Group.start(JspCompiler.java:221)
        at
org.netbeans.core.compiler.CompilationEngineImpl$CompilerThread$GroupCompiler.run(CompilationEngineImpl.java:257)
Errors compiling bbb.


Thu Jul 25 20:32:37 MDT 2002	ludo

Work Around: 
Never create JSPs under the "classe" directory.
In fact, the IDE should not allow this at all...
Also, if when mounting web modules in the IDE, the check should be done and a
nice error should be emitted.

Thu Jul 25 20:32:37 MDT 2002	ludo

Evaluation: 
the nicer dialog will be shown

in Doublin it will not be a problem; the webResourceImpl will not be used


A comment.
Comment 1 Jason Rush 2003-02-06 02:12:52 UTC
Transferred from BugTraq 4721126.
Comment 2 _ rkubacki 2003-02-06 08:15:41 UTC
Webdata was Damian's responsibility so maybe Martin can look into
this. Hopefully we will not use it for new version.
Comment 3 Petr Jiricka 2003-02-12 15:09:58 UTC
The first exception does not happen any more - I can not 
reproduce it. The second one still occurs, but I can not 
think of a way to avoid it. Using Projects is crucial for 
this fix.
Comment 4 psuk 2003-02-28 18:11:57 UTC
Setting Target Milestone to 4.0 (Projects Infrastrucure)
Comment 5 Petr Jiricka 2004-01-28 20:46:39 UTC
Now it's not possible to create a JSP under the classes directory ->
fixed.