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.
To reproduce: 1) build netbeans according to 'how to get it' section on http://wiki.netbeans.org/wiki/view/HTMLEmbeddedLanguagesHowTo 2) create an RHTML file with some ruby code <% ... %> or open an existing one => you will get following CCE: SEVERE [org.openide.util.RequestProcessor] java.lang.ClassCastException: org.netbeans.api.languages.ParseException at org.netbeans.modules.languages.LanguagesManager.getLanguage(LanguagesManager.java:107) The code on the line 107 is apparently incorrect, it assumes the instance is always instance of Language class, which is not true - a few lines above an instance of ParseException is put into.
Created attachment 40445 [details] The CCE
The CCE shows up when I use scripting/ruby2 to parse the ruby content of the rhtml. I tried to workaround the problem with creating an empty nbs file for text/x-ruby mimetype and registered it instead of the one in ruby2 module, but similar problems appeared again. The CCE appears again, but this time not for text/x-ruby language, but for text/x-css, which indicates that the problem is not related to the particullar language. Moreover a NPE from ASTItem.java:62 started to show up once the schliemann parser runs. Another NPE from javascript's Semantic class shows as well. IMO these problems are related to your latest changes in fix of issue #99134 or issue #99394 since they started to show up after I updated these two fixes from trunk. Please look at it ASAP, since I consider this as blockes for putting S. into build. The last two exceptions (the NPEs) shows up also in JSP.
Created attachment 40474 [details] The NPE from ASTToken
Created attachment 40475 [details] The NPE from Semantic
fixed in trunk: IDE:------------------------------------------------- IDE: [4/5/07 11:28 AM] Committing "Generic Languages Framework" started Checking in src/org/netbeans/modules/languages/LanguagesManager.java; /cvs/languages/engine/src/org/netbeans/modules/languages/LanguagesManager.java,v <-- LanguagesManager.java new revision: 1.17; previous revision: 1.16 done Checking in src/org/netbeans/modules/languages/features/MySecondDrawLayer.java; /cvs/languages/engine/src/org/netbeans/modules/languages/features/MySecondDrawLayer.java,v <-- MySecondDrawLayer.java new revision: 1.6; previous revision: 1.5 done Checking in manifest.mf; /cvs/languages/engine/manifest.mf,v <-- manifest.mf new revision: 1.68; previous revision: 1.67 done IDE: [4/5/07 11:29 AM] Committing "Generic Languages Framework" finished
Hanzi, you just fixed the CCE and replaced in by IllegalArgumentException. The problem is still there. My point was that there is something worng much deeper, the CCE was just so obvious... Have you tried to reproduce? Do you need my help? I am adding the .rb file which I use to reproduce.
Created attachment 40497 [details] The rhtml file to reproduce
Can you attach IAException stack trace,please? Is it blocker for merge2trunk? (rhtml will not be in build) I have no time to build whole ide + your modules today. So I have not tried it, sorry.
Created attachment 40539 [details] The IllegalArgumentException
I realized that the problem is caused by CSS piece embedded into the RHTML or JSP. The same problem appears in standalone CSS. Please try to build languages/css and open a CSS file. It throws the IAE on my machine. Can you please verify? Maybe it is something bad on my side!?!?
I can not reproduce it in CSS. Marek, can you doublecheck your sources, please? You must have some strange version of files. I am not able to map your stack to my sources. Strange line numbers...
I am sorry, I have changed the source of Language class when trying to debug the problem. The CVS doesn't work now so I cannot update the stack. However I forgot to add the the exception which I was talking about - the IAE from LanguagesManager. The LM is also modified so I cannot guarantee the lines, but the IAE is thrown from the same place where the CCE was trown originally.
Created attachment 40657 [details] The IAE from LanguagesManager
Just one more hint to reproduce: Sometimes, the schliemann parser doesn't take into account CSS embedding for the first time (after the file is opened). Try to rerun the parser by changing the document...
I have tried to reproduce this bug in embedding_60 branch, but I was unsuccessful. Embedding does not work for me at all!
ths issue is really reproducible on embedding_60 branch only. Its caused by l.getFeature () == null call. It should be changed to getFeatures () > 0. I have added this check to trunk version too. IDE:------------------------------------------------- IDE: [4/10/07 3:42 PM] Committing "Generic Languages Framework" started Checking in src/org/netbeans/modules/languages/LanguagesManager.java; /cvs/languages/engine/src/org/netbeans/modules/languages/LanguagesManager.java,v <-- LanguagesManager.java new revision: 1.19; previous revision: 1.18 done Checking in src/org/netbeans/modules/languages/ParserManagerImpl.java; /cvs/languages/engine/src/org/netbeans/modules/languages/ParserManagerImpl.java,v <-- ParserManagerImpl.java new revision: 1.27; previous revision: 1.26 done Checking in src/org/netbeans/modules/languages/Language.java; /cvs/languages/engine/src/org/netbeans/modules/languages/Language.java,v <-- Language.java new revision: 1.39; previous revision: 1.38 done Checking in manifest.mf; /cvs/languages/engine/manifest.mf,v <-- manifest.mf new revision: 1.73; previous revision: 1.72 done IDE: [4/10/07 3:42 PM] Committing "Generic Languages Framework" finished IDE:------------------------------------------------- IDE: [4/10/07 3:43 PM] Committing "JavaScript.nbs" started Checking in JavaScript.nbs; /cvs/scripting/javascript/src/org/netbeans/modules/languages/javascript/JavaScript.nbs,v <-- JavaScript.nbs new revision: 1.30; previous revision: 1.29 done IDE: [4/10/07 3:43 PM] Committing "JavaScript.nbs" finished IDE:------------------------------------------------- IDE: [4/10/07 3:43 PM] Committing "manifest.mf" started Checking in manifest.mf; /cvs/scripting/javascript/manifest.mf,v <-- manifest.mf new revision: 1.29; previous revision: 1.28 done IDE: [4/10/07 3:43 PM] Committing "manifest.mf" finished
OK, the IAE is fixed now. The only problem which persisted is the NPE from ASTItem.java:62 (I'll fill a separate issue for it).