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 188363 - Lack of runtime dep on XDM -> cannot create Maven EAR project
Summary: Lack of runtime dep on XDM -> cannot create Maven EAR project
Status: RESOLVED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: XAM (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Nikita Krjukov
URL:
Keywords:
: 188413 188437 188443 190428 (view as bug list)
Depends on:
Blocks: 188437
  Show dependency tree
 
Reported: 2010-07-04 22:40 UTC by David Konecny
Modified: 2013-05-14 12:51 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 171168


Attachments
stacktrace (1.81 KB, text/plain)
2010-07-04 22:40 UTC, David Konecny
Details
stacktrace (6.04 KB, text/plain)
2010-07-07 10:08 UTC, Alexey Butenko
Details
stacktrace (1.94 KB, text/plain)
2010-07-08 20:00 UTC, David Konecny
Details
stacktrace (1.85 KB, text/plain)
2010-07-09 08:24 UTC, Petr Jiricka
Details
Suggested patch (untested) (1.63 KB, patch)
2010-07-09 13:14 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Konecny 2010-07-04 22:40:53 UTC
Build: NetBeans IDE Dev (Build 100705-53b042abad31)
VM: Java HotSpot(TM) Client VM, 16.3-b01, Java(TM) SE Runtime Environment, 1.6.0_20-b02
OS: Linux

User Comments:
dkonecny: just created new EAR Maven project




Stacktrace: 
java.lang.UnsupportedOperationException: prepareForUndoRedo access not supported.
   at org.netbeans.modules.xml.xam.dom.ReadOnlyAccess.prepareForUndoRedo(ReadOnlyAccess.java:441)
   at org.netbeans.modules.xml.xam.AbstractModel$ModelUndoableEdit.justUndo(AbstractModel.java:682)
   at org.netbeans.modules.xml.xam.AbstractModel$ModelUndoableEditSupport.abortUpdate(AbstractModel.java:177)
   at org.netbeans.modules.xml.xam.AbstractModel.rollbackTransaction(AbstractModel.java:440)
   at org.netbeans.modules.maven.model.Utilities.performPOMModelOperations(Utilities.java:346)
   at org.netbeans.modules.maven.newproject.ArchetypeWizardUtils.addEARDeps(ArchetypeWizardUtils.java:570)
Comment 1 David Konecny 2010-07-04 22:40:56 UTC
Created attachment 100593 [details]
stacktrace
Comment 2 David Konecny 2010-07-05 00:19:33 UTC
On today's build if I try to create new Maven Enterprise Application the project instantiation fails with attached exception. I could not workaround it and looking into the code did not help either. Looks like DocumentModelAccessProvider impl is not in model source lookup and therefore default readonly version of model is used?
Comment 3 Alexey Butenko 2010-07-07 10:08:32 UTC
Created attachment 100640 [details]
stacktrace

Add JSF framework to the Maven Web App
Comment 4 Petr Jiricka 2010-07-07 14:36:53 UTC
Could this be caused by the fix for bug 180614?
Comment 5 Jesse Glick 2010-07-07 14:50:42 UTC
FWIW I am unable to reproduce in a dev build (also on Linux).
Comment 6 Exceptions Reporter 2010-07-08 08:17:38 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=171168
Comment 7 David Konecny 2010-07-08 20:00:08 UTC
Created attachment 100709 [details]
stacktrace

happens always
Comment 8 David Konecny 2010-07-08 20:06:05 UTC
This happens to me always. Tried it again on yesterday's fresh dev build with new userdir - all I did in IDE is created new Maven Enterprise Application project with all default values and it fail wit the same exception during instantiation. If you point me to a place in code where non-readonly model should be created I'm happy to debug it and look why it fails.
Comment 9 David Konecny 2010-07-08 22:16:21 UTC
After reading Bug 184306 I think this is related and so passing to Nikita to have a look. There is also bug 188443 which I'm going to assign to Nikita as well - most likely the same problem although exception is different

QA should double check whether this works on 691.
Comment 10 David Konecny 2010-07-08 22:20:43 UTC
Denis, you are quite experience with xam etc. Any opinion what might be wrong off hand?
Comment 11 David Konecny 2010-07-08 23:32:05 UTC
I think I found the problem. Jesse, in http://hg.netbeans.org/web-main/rev/b3c6794116db you removed dependency on org.netbeans.modules.xml.xdm from several modules. If I add the dep back to web.jsf then both this and bug 188443 go away.
Comment 12 Jesse Glick 2010-07-08 23:43:53 UTC
*** Bug 188443 has been marked as a duplicate of this bug. ***
Comment 13 Jesse Glick 2010-07-08 23:49:49 UTC
Well it's harmless enough to readd the dependency on xml.xdm but the question is why is it there to begin with? web.jsf does not compile against xdm, so having a <build-prerequisite/> <compile-dependency/> is certainly wrong. Having just a <run-dependency/> is possible but odd for an autoload library. Perhaps the global services registered by XDM have to be present, and there are no other modules depending on it? If so, xml.xam could recommend a token which XDM provides, though again this is odd for something that looks like a "pure" library.

Again, I cannot reproduce so as to add better advice; creating an EAR project set works fine for me in dev builds. Is this perhaps only reproducible with ergonomics enabled? Can't the exception in this issue and bug #188443 say something more meaningful?
Comment 14 Jesse Glick 2010-07-09 00:17:59 UTC
Hotfix in core-main #1242c0a83d2e (parented to original for ease of pulling into other repos); now need to determine why this dependency was expressed in a nonstandard way and why error messages were so unhelpful.
Comment 15 Jesse Glick 2010-07-09 00:27:11 UTC
It seems that without the dep, the xdm module is not enabled at all; then in XAM, AbstractModelFactory.getAccessProvider() returns null (and probably same for AbstractDocumentModel.getAccessProvider()). Rather than failing promptly with a helpful error, some limited-functionality variant is used instead.
Comment 16 Jesse Glick 2010-07-09 00:36:11 UTC
If, appears likely, the public Java API of XDM is not being used at all, yet published parts of XAM require that XDM to be enabled in order to function as documented, then that dependency should be made explicit. If all clients of XAM need XDM, then XAM should OpenIDE-Module-Needs it. If only certain ones do (which?), then XAM should document a module token which they should OpenIDE-Module-Requires, and should throw meaningful errors when not present but needed.

BTW when no DocumentModelAccessProvider is present:

java.lang.Exception: Stack trace
        at java.lang.Thread.dumpStack(Thread.java:1206)
        at org.netbeans.modules.xml.xam.dom.AbstractDocumentModel.getAccessProvider(AbstractDocumentModel.java:591)
        at org.netbeans.modules.xml.xam.dom.AbstractDocumentModel.getEffectiveAccessProvider(AbstractDocumentModel.java:584)
        at org.netbeans.modules.xml.xam.dom.AbstractDocumentModel.getAccess(AbstractDocumentModel.java:572)
        at org.netbeans.modules.xml.xam.dom.AbstractDocumentModel.syncStarted(AbstractDocumentModel.java:136)
        at org.netbeans.modules.xml.xam.AbstractModel.sync(AbstractModel.java:279)
        at org.netbeans.modules.xml.xam.AbstractModelFactory.getModel(AbstractModelFactory.java:140)
        at org.netbeans.modules.maven.model.pom.POMModelFactory.getModel(POMModelFactory.java:78)
        at org.netbeans.modules.maven.model.Utilities.performPOMModelOperations(Utilities.java:326)
        at org.netbeans.modules.maven.newproject.ArchetypeWizardUtils.addEARDeps(ArchetypeWizardUtils.java:570)
        at org.netbeans.modules.maven.newproject.ArchetypeWizardUtils.instantiate(ArchetypeWizardUtils.java:360)
        at org.netbeans.modules.maven.newproject.EAWizardIterator.instantiate(EAWizardIterator.java:105)
Comment 17 Petr Jiricka 2010-07-09 08:24:12 UTC
Created attachment 100718 [details]
stacktrace

Canceling properties dialog of a Maven web project.
Comment 18 Jesse Glick 2010-07-09 13:11:34 UTC
Nikita writes:
> The XAM and XDM modules are very connected.
> The XAM is more like interface, but XDM is more implementation.
> I think there isn't another implementation rather then XDM now.
> So it definitely worth to import them both.

In this case the -Needs/-Provides pairing would make the most sense.
Comment 19 Jesse Glick 2010-07-09 13:14:15 UTC
Created attachment 100729 [details]
Suggested patch (untested)
Comment 20 Quality Engineering 2010-07-13 03:30:24 UTC
Integrated into 'main-golden', will be available in build *201007130001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/1242c0a83d2e
User: Jesse Glick <jglick@netbeans.org>
Log: Hotfix of #188363: add runtime-only dep web.jsf -> xml.xdm.
Comment 21 Jesse Glick 2010-07-13 14:00:15 UTC
*** Bug 188437 has been marked as a duplicate of this bug. ***
Comment 22 Jesse Glick 2010-07-13 14:07:25 UTC
Urgent (applies also to Java IDE builds), was not being addressed, so: core-main #7415d2e33594
Comment 23 Quality Engineering 2010-07-14 02:44:48 UTC
Integrated into 'main-golden', will be available in build *201007140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/7415d2e33594
User: Jesse Glick <jglick@netbeans.org>
Log: #188363: make XAM require the presence of XDM.
Comment 24 Jesse Glick 2010-10-07 17:21:57 UTC
*** Bug 188413 has been marked as a duplicate of this bug. ***
Comment 25 Svata Dedic 2013-05-14 12:51:56 UTC
*** Bug 190428 has been marked as a duplicate of this bug. ***