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 131894 - AssertionError at org.netbeans.modules.visualweb.insync.Util.isBraveheartPage
Summary: AssertionError at org.netbeans.modules.visualweb.insync.Util.isBraveheartPage
Status: RESOLVED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: _ sandipchitale
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-03 08:47 UTC by John Baker
Modified: 2008-09-13 05:17 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 43110


Attachments
project file plus driver jars (1.10 MB, application/x-compressed)
2008-04-03 08:48 UTC, John Baker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Baker 2008-04-03 08:47:31 UTC
Build: NetBeans IDE Dev (Build 080330)
VM: Java HotSpot(TM) Client VM, 20070825020013.pb131437.hotspot, Java(TM) 2 Runtime Environment, Standard Edition,
1.5.0_12-b04
OS: Windows XP, 5.1, x86
User comments: 
Using a Customer project, switch CONSTANTSView.jsp from Design view to JSP view and back to Design view
STACKTRACE: (first 10 lines)
java.lang.AssertionError
        at org.netbeans.modules.visualweb.insync.Util.isBraveheartPage(Util.java:1063)
        at org.netbeans.modules.visualweb.insync.InSyncServiceProvider.isBraveheartPage(InSyncServiceProvider.java:362)
        at
org.netbeans.modules.visualweb.insync.live.DesignBeanNodeHelper$LanguageProperty.getValue(DesignBeanNodeHelper.java:1039)
        at org.openide.explorer.propertysheet.PropUtils.updateEdFromProp(PropUtils.java:874)
        at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.java:847)
        at org.openide.explorer.propertysheet.ReusablePropertyModel.getPropertyEditor(ReusablePropertyModel.java:101)
        at org.openide.explorer.propertysheet.RendererFactory.preparePropertyEditor(RendererFactory.java:260)
        at org.openide.explorer.propertysheet.RendererFactory.getRenderer(RendererFactory.java:168)
        at org.openide.explorer.propertysheet.SheetCellRenderer.getTableCellRendererComponent(SheetCellRenderer.java:153)
        at org.openide.explorer.propertysheet.BaseTable.prepareRenderer(BaseTable.java:608)
Comment 1 John Baker 2008-04-03 08:48:36 UTC
Created attachment 59591 [details]
project file plus driver jars
Comment 2 John Baker 2008-04-03 08:53:46 UTC
The attached project may be invalid, but still I wouldn't expect an Assertion error to occur when opening CONSTANTSview.jsp

To setup the project:
1) Unzip the attachment (includes both a project and driver jar files).
2) In NetBeans, switch to the Services tab, expand Databases, right-click on Drivers and add new Driver.
Provide the both jar files that are included in the root of the folder extracted by the zip file

3) Open the project, a warning dialog opens, click OK
4) Right-click on project and choose Resolve Database problem menuitem
5) In the Resolve Data Sources dialog, select the data source then click Add Database Connection then accept the default
values and click OK

6) Open CONSTANTSview.jsp
If you don't get the Assertion error then click on the JSP tab for the page then back to Design view
Comment 3 John Baker 2008-04-03 09:11:25 UTC
If I open the same project in 6.0 and CONSTANTSview.jsp then the page opens fine.

This seems to be a regression in 6.1
Comment 4 _ sandipchitale 2008-04-03 14:50:21 UTC
The assertion is from this check:

        Element element = dom.getDocumentElement();
        
        if (element.hasAttribute("xmlns:ui")) { // NOI18N
            assert element.getAttribute("xmlns:ui").equals("http://www.sun.com/web/ui"); // NOI18N
            
            return true;
        }

So need to look inside the .jsp source to see if the value of the xmlns:ui is in fact 'http://www.sun.com/web/ui'. If
not, how it got changed?
Comment 5 _ sandipchitale 2008-04-03 15:00:23 UTC
Sure enough...in the .jsp source I see:

xmlns:ui="http://www.sun.com/webui/webuijsf"

which looks like the one from Woodstock.

The project seems to be a JSF 1.2 project...in which case the namespace should be:

xmlns:webuijsf="http://www.sun.com/webui/webuijsf"

(which is the case in Page1.jsp in the same project)

and you cannot use Bravehart components in JSF 1.2 based projects.
Comment 6 Winston Prakash 2008-04-03 15:42:23 UTC
Theoretically 

xmlns:ui="http://www.sun.com/webui/webuijsf"

is correct. As long as all the prefix to the woodstock components in the page also has ui: prefix.

Actually, I see in nbdev users arguing about "stupid" naming convention (webuijsf). In fact one user has changed the
template to xmlns:w="http://www.sun.com/webui/webuijsf" and all the component prefix to w: and claims now on all the
pages she creates correctly generating with w: (impressive flexibility she says :) )
Comment 7 John Baker 2008-04-03 17:59:07 UTC
yes, I see the incompatibility, but the page opens fine in 6.0

Also, if there is stricter checking for component versions then at least the Assertion error could be more descriptive.
Comment 8 John Baker 2008-04-03 18:07:45 UTC
Since the page is invalid may not be P2 but still need to understand why the page opens in 6.0 
Comment 9 _ sandipchitale 2008-04-03 18:11:25 UTC
May be the page opens but does it work?

Do you have the 6.0 FCS. In the FCS product assertions are off.
Comment 10 _ sandipchitale 2008-04-03 18:15:22 UTC
Well Insync always had this code to detect the Bravehart vs. Woodstoick and the mechanism was recommended by component
team. I think Designer also uses it.
Comment 11 John Baker 2008-04-03 20:07:57 UTC
User is cc'd to describe what he did

In 6.1 the page opens blank, but in 6.0 the page the components render fine.

I guess you didn't try opening the project?
Comment 12 praveen_r 2008-04-04 11:50:38 UTC
hi
I am unable to understand what is cc'd.

Actully i am also unable to open page of V6.0 in V6.1

but on my side my page only does not display in netbeans 6.1.
when i deploy my project through V6.1 . my page displays properly on browser.

now i am asking to u why ur 2 versions (V6.0 and V6.1)are not compatible with each other???
V6.1 is the updated version of V6.0, so it should support V6.0 code also.

if u r able to solve my problem(Edit,Update,Delete) on V6.0 , then i need not to sift from V6.0 to V6.1.

I have not done anything different in this project. I have created my project according to ur sample code.

Thanks
waiting for reply

Comment 13 John Baker 2008-04-04 18:46:49 UTC
cc'd means that your netbeans user id is on the cc list which means that you are included in discussions of this issue
see above.

The problem with your application does not appear to be any incompatibility with 6.0 and 6.1.
I've provided you an example of the correct way to do Inserts Updates Deletes.  Also, I provided information on how
to get more help with your application. http://developers.sun.com/services/expertassistance/index.jsp?intcmp=1365

Comment 14 Peter Zavadsky 2008-09-12 22:54:12 UTC
Fixed.
The assertion was removed, and also the check for the relevant xmlns: attribute improved.

changeset:   101838:e5455167b93c
tag:         tip
user:        Peter Zavadsky <pzavadsky@netbeans.org>
date:        Fri Sep 12 14:51:29 2008 -0700
summary:     #131894 Fixing assertion, improving checking for braveheart and woodstock type of components.
Comment 15 Quality Engineering 2008-09-13 05:17:39 UTC
Integrated into 'main-golden', will be available in build *200809130201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/e5455167b93c
User: Peter Zavadsky <pzavadsky@netbeans.org>
Log: #131894 Fixing assertion, improving checking for braveheart and woodstock type of components.