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 82899 - ClassCastException from JavaEditor with JBoss server
Summary: ClassCastException from JavaEditor with JBoss server
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords: RANDOM
: 83180 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-08-17 12:55 UTC by Jiri Skrivanek
Modified: 2007-10-30 09:44 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Entire stack trace (1.04 KB, text/plain)
2006-08-17 12:56 UTC, Jiri Skrivanek
Details
happend with 070307 build of 551 with glassfish (12.71 KB, text/plain)
2007-03-13 17:29 UTC, Lukas Hasik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2006-08-17 12:55:51 UTC
CCE appears randomly but I have steps when it appears very often:

1) go to Runtime view and add JBoss server
2) create a web application with JBoss target server
3) in editor call Run File context action
4) when the page is open in browser call View Servlet action in editor
5) close all documents in editor
6) create a new JSP file
7) repeat steps 3 to 6 several times and the following exception appears sooner
or later:

java.lang.ClassCastException:
org.netbeans.modules.web.core.jsploader.JspServletDataObject$ServletEditorCookie
cannot be cast to org.openide.windows.CloneableOpenSupport
	at
org.netbeans.modules.java.JavaEditor$JavaEditorEnv.findCloneableOpenSupport(JavaEditor.java:1221)

Build 20060817-0525, JDK1.6.0-b93, WindowsXP, JBoss4.0.4.GA.
Comment 1 Jiri Skrivanek 2006-08-17 12:56:30 UTC
Created attachment 33018 [details]
Entire stack trace
Comment 2 Libor Kotouc 2006-08-21 09:22:26 UTC
Can you reproduce also on another target server? It does not look as the server
plugin problem (I guess that this is the reason why this issue is not filed
against JBoss plugin...).
Aren't there some other exceptions accompanying the attached one in the messages
log?
Comment 3 Jiri Skrivanek 2006-08-21 09:33:40 UTC
I was only able reproduce it with JBoss target server. And no other exceptions
were in messages log.
Comment 4 Petr Pisl 2006-08-21 13:48:26 UTC
I can reproduce this on linux as well. The exception appears after Run action on
my configuration. 
Comment 5 Petr Pisl 2006-08-21 16:25:28 UTC
I'm able to reproduce this issue only with JBoss. I tied with Tomcat and
Glassfish as well, but only when the targer server is JBoss I can see the
exception very often. The behavior is strange even for Run File action.
Sometimes the browser displays that the page is not accessible. Sometimes the
page is displayed in the browser, but the View Servlet action displays message
that the page has to be run before view servlet, but the page is displayed in
the browser.

The main reason why the exceptin is raised is that the classes are not loaded by
the same classloader.
Cannot cast an instance of "class
org.netbeans.modules.web.core.jsploader.JspServletDataObject$ServletEditorCookie
(loaded by instance of
org.netbeans.StandardModule$OneModuleClassLoader(id=11967))" to an instance of
"class org.openide.windows.CloneableOpenSupport (loaded by instance of
org.netbeans.StandardModule$OneModuleClassLoader(id=12001))"

The strange things is as well that when Tomcat/Glassfish are target server, then
the problematic code is not called. The code is not executed sometimes with
JBoss. Then the run action and view servlet are finished correctly. But if the
code is executed, then the exception appears.

So what is the difference between JBoss plugin and the others one? 
Comment 6 Lukas Hasik 2007-03-13 17:29:28 UTC
Created attachment 39450 [details]
happend with 070307 build of 551 with glassfish
Comment 7 Andrei Badea 2007-10-18 14:43:42 UTC
Reassigning per desc6.
Comment 8 Andrei Badea 2007-10-18 14:47:20 UTC
*** Issue 83180 has been marked as a duplicate of this issue. ***
Comment 9 Andrei Badea 2007-10-18 14:50:52 UTC
But issue 83810 happens on GlassFish, so perhaps not a JBoss plugin problem after all.
Comment 10 Marek Fukala 2007-10-29 16:34:14 UTC
related to issue #115104 IMO.
Comment 11 Jan Lahoda 2007-10-29 16:37:11 UTC
Well, the org.netbeans.modules.java.JavaEditor was completely rewritten, so I do not think this can happen again. If it
does, please reopen and attach an up-to-date stack trace.
Comment 12 Jiri Skrivanek 2007-10-30 09:44:00 UTC
Verified.