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 151691

Summary: IllegalArgumentException: Model source is read-only.
Product: javaee Reporter: pz0513 <pz0513>
Component: JSFAssignee: _ potingwu <potingwu>
Status: RESOLVED FIXED    
Severity: blocker CC: pz0513, samaresh
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
URL: http://statistics.netbeans.org/exceptions/detail.do?id=16485
Issue Type: DEFECT Exception Reporter: 16485
Attachments: stacktrace

Description pz0513 2008-10-29 11:21:44 UTC
Build: NetBeans IDE 6.1 (Build 200805300101)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b06, Java(TM) SE Runtime Environment, 1.6.0_02-b06
OS: Windows XP, 5.1, x86

User Comments:
GUEST: Trying to add managed bean to faces-config.xml



Stacktrace: 
java.lang.IllegalArgumentException: Model source is read-only.
        at org.netbeans.modules.xml.xam.AbstractModel.startTransaction(AbstractModel.java:351)
        at org.netbeans.modules.xml.xam.AbstractModel.startTransaction(AbstractModel.java:341)
        at org.netbeans.modules.web.jsf.editor.JSFPopupAction$AddManagedBeanAction.actionPerformed(JSFPopupAction.java:149)
        at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:290)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
Comment 1 pz0513 2008-10-29 11:21:54 UTC
Created attachment 72821 [details]
stacktrace
Comment 2 Samaresh Panda 2008-11-18 21:10:18 UTC
Should be handled by web/jsf module.
Comment 3 _ potingwu 2008-11-19 18:23:13 UTC
Hi, samaresh,

I'm confused here for using xml.xam.Model API! All of our calls use startTransaction() and endTransaction() to modify
the model so that the model will block and sync the updates. What else the callers should also handle? Thanks!

BTW, pz0513,

Under what condition did you get this exception? I cannot reproduce it here.
Comment 4 Samaresh Panda 2008-11-20 23:46:30 UTC
I'm not sure how you're creating MS, but I guess there is a flag "editable" in MS constructor, that makes the MS RO if
you pass editable as false. Pass true instead.
Comment 5 _ potingwu 2008-11-20 23:51:41 UTC
web.jsf always creates the model source as editable, hence lots of developers not getting any error. But looks like the
reporter sometimes (or just rarely) gets this exception! Is it some kind of race condition that the model does not handle?
Comment 6 Exceptions Reporter 2008-12-04 15:02:06 UTC
This issue has already 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=144089
Comment 7 Quality Engineering 2008-12-11 16:56:50 UTC
Integrated into 'main-golden', will be available in build *200812111401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/d6e2acfd1662
User: potingwu@netbeans.org
Log: Fix Issue#151691, IllegalArgumentException: Model source is read-only.
Comment 8 _ potingwu 2008-12-11 17:00:29 UTC
Fixed in the 7.0 trunk,
    changeset d6e2acfd1662 in main
    details: http://hg.netbeans.org/main?cmd=changeset;node=d6e2acfd1662