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 30473 - ClassClastException when opening servlet created from JSP
Summary: ClassClastException when opening servlet created from JSP
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: Svata Dedic
URL:
Keywords:
: 30873 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-01-29 12:59 UTC by Petr Jiricka
Modified: 2007-09-26 09:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The exception stack trace (1.30 KB, text/plain)
2003-01-29 13:00 UTC, Petr Jiricka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2003-01-29 12:59:07 UTC
1. Create a web module
2. Create a JSP in this web module
3. Compile the JSP
4. Choose 'View Servlet' on this JSP
5. The servlet will be opened, but the exception in the 
attachment is thrown

Worse, this exception keeps popping up when working with 
the IDE, which makes the IDE virtually unusable.
Comment 1 Petr Jiricka 2003-01-29 13:00:21 UTC
Created attachment 8718 [details]
The exception stack trace
Comment 2 Tomas Hurka 2003-01-29 17:46:48 UTC
This was caused by Svata's fix of issue #30010. I am not sure how to solve it. Why does not JspServletCompilerSupport extend CompilerSupport? 
Comment 3 Petr Jiricka 2003-01-30 07:57:53 UTC
Because it is implemented by delegating the compilation to 
another object. In such a case, it is more convenient to 
directly implement CompilerCookie, rather than subclassing 
CompilerSupport, which is unsuitable for this.

Anyway, I believe JavaDataObject.getCookie(..) should 
behave as specified in the OpenAPIs documentation - the 
current implementation is against the OpenAPI javadoc.

I am not familiar with issue #30010, but why does it has 
to be solved this hacky way ?
Comment 4 Svata Dedic 2003-01-30 09:01:28 UTC
Apologies; I will try to find out a better test for    
this. e.g. iff someone asks for CompilerCookie and   
the CompilerSupport subclass will not be instanceof   
it, null will be returned. This particular CCE is 
caused by the fact that JavaNode asks for 
CompilerSupport, rather than for java module's own 
CS subclass -- that will be changed, too. 
Could that work ?   
 
Comment 5 Petr Jiricka 2003-01-30 09:34:08 UTC
Sure. As long as the method does not return an instance 
that does not extend/implement the parameter class, I am 
fine.
Comment 6 Svata Dedic 2003-01-31 12:35:48 UTC
/cvs/java/src/org/netbeans/modules/java/JavaDataObject.java,v  <-- 
JavaDataObject.java
new revision: 1.167; previous revision: 1.166
/cvs/java/src/org/netbeans/modules/java/JavaNode.java,v  <-- 
JavaNode.java
new revision: 1.94; previous revision: 1.93
Comment 7 Martin Grebac 2003-02-08 22:31:37 UTC
*** Issue 30873 has been marked as a duplicate of this issue. ***
Comment 8 Jan Becicka 2003-02-28 13:21:26 UTC
Verified in trunk