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.
Reproduced in build 060726. Applying Venetian Blind pattern to OTA schema results in: java.lang.IllegalStateException: Referencing component is not part of model. at org.netbeans.modules.xml.xam.dom.AbstractNamedComponentReference.checkParentPartOfModel(AbstractNamedComponentReference.java:173) at org.netbeans.modules.xml.xam.dom.AbstractNamedComponentReference.getReferenced(AbstractNamedComponentReference.java:124) at org.netbeans.modules.xml.schema.model.impl.GlobalReferenceImpl.get(GlobalReferenceImpl.java:65) at org.netbeans.modules.xml.schema.model.impl.GlobalReferenceImpl.get(GlobalReferenceImpl.java:39) at org.netbeans.modules.xml.axi.impl.Util.getGlobalComplexType(Util.java:1449) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.createPeerGlobalComplexType(DefaultSchemaGenerator.java:415) at org.netbeans.modules.xml.axi.impl.GardenOfEden.createPeerParent(GardenOfEden.java:163) at org.netbeans.modules.xml.axi.impl.VenetianBlind.createPeerParent(VenetianBlind.java:81) at org.netbeans.modules.xml.axi.impl.GardenOfEden.visit(GardenOfEden.java:102) at org.netbeans.modules.xml.axi.Attribute.accept(Attribute.java:70) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformChildren(DefaultSchemaGenerator.java:189) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformChildren(DefaultSchemaGenerator.java:194) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformChildren(DefaultSchemaGenerator.java:194) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformChildren(DefaultSchemaGenerator.java:194) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformChildren(DefaultSchemaGenerator.java:194) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformChildren(DefaultSchemaGenerator.java:194) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformChildren(DefaultSchemaGenerator.java:194) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformChildren(DefaultSchemaGenerator.java:194) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformChildren(DefaultSchemaGenerator.java:194) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformChildren(DefaultSchemaGenerator.java:194) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformChildren(DefaultSchemaGenerator.java:194) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformChildren(DefaultSchemaGenerator.java:194) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformChildren(DefaultSchemaGenerator.java:194) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformChildren(DefaultSchemaGenerator.java:194) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformSchema(DefaultSchemaGenerator.java:130) at org.netbeans.modules.xml.axi.impl.SchemaGeneratorFactoryImpl.transformSchema(SchemaGeneratorFactoryImpl.java:101) at org.netbeans.modules.xml.schema.abe.wizard.SchemaTransformWizard$1.run(SchemaTransformWizard.java:115) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)
Is this the flattend OTA schema, ie all the OTA files combined into one single schema. If not can you specify which OTA schema file.
Created attachment 32291 [details] OTA Schema
Yes, it's a singe file schema. Please find it in attachment.
I do not see this exception. However after 30 minutes (even with 1GB of max setting for JVM memory). I am getting StackOverFlow. It looks like we are firing a lot of events for the XAM to handle, since we are mutating the schema model incrementally (for descendents) of new global element's that are added. I am going to try a different approach of creating global elements outside of the schema model and then adding them. This reduces the events drastically. If approach also does not work, we may want to fix this for FCS. java.lang.reflect.UndeclaredThrowableException at $Proxy15.childrenAdded(Unknown Source) at org.netbeans.modules.xml.xam.ComponentEvent$EventType$2.fireEvent(Com ponentEvent.java:59) at org.netbeans.modules.xml.xam.AbstractModel$Transaction.fireCompleteEv entSet(AbstractModel.java:388) at org.netbeans.modules.xml.xam.AbstractModel$Transaction.fireEvents(Abs tractModel.java:350) at org.netbeans.modules.xml.xam.AbstractModel.endTransaction(AbstractMod el.java:257) at org.netbeans.modules.xml.axi.impl.DefaultSchemaGenerator.transformSch ema(DefaultSchemaGenerator.java:136) at org.netbeans.modules.xml.axi.impl.SchemaGeneratorFactoryImpl.transfor mSchema(SchemaGeneratorFactoryImpl.java:101) at org.netbeans.modules.xml.schema.abe.wizard.SchemaTransformWizard$1.ru n(SchemaTransformWizard.java:115) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java :932) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerIm pl.java:416) ... 10 more Caused by: java.lang.StackOverflowError at java.util.Collections$UnmodifiableCollection$1.<init>(Collections.jav a:1007) at java.util.Collections$UnmodifiableCollection.iterator(Collections.jav a:1006) at java.util.Collections$UnmodifiableCollection$1.<init>(Collections.jav a:1007) at java.util.Collections$UnmodifiableCollection.iterator(Collections.jav a:1006) at java.util.Collections$UnmodifiableCollection$1.<init>(Collections.jav a:1007) at java.util.Collections$UnmodifiableCollection.iterator(Collections.jav a:1006) at java.util.Collections$UnmodifiableCollection$1.<init>(Collections.jav a:1007) at java.util.Collections$UnmodifiableCollection.iterator(Collections.jav a:1006) at java.util.Collections$UnmodifiableCollection$1.<init>(Collections.jav a:1007) at java.util.Collections$UnmodifiableCollection.iterator(Collections.jav a:1006) at java.util.Collections$UnmodifiableCollection$1.<init>(Collections.jav a:1007) at java.util.Collections$UnmodifiableCollection.iterator(Collections.jav a:1006) at java.util.Collections$UnmodifiableCollection$1.<init>(Collections.jav a:1007) at java.util.Collections$UnmodifiableCollection.iterator(Collections.jav a:1006) at java.util.Collections$UnmodifiableCollection$1.<init>(Collections.jav a:1007)
I tried a different approach of creating global elements outside of the schema model and then adding them. This reduces the events drastically. Also I don't see the stackoverflow. There are some minor issues 1. Takes 2-3 min for the transformation of flattened OTA. May not be fixable for beta. 2. I saw some blank lines between some components. I will investigate. Should be fixable for beta. I am proceeding in this approach. If there are not regressions, then I will check in before Sunday 07/30 or waive this bug.
Requesting waiver for NB55 beta * the bug id and a short description o 81266 - StackOverflowError on applying Russian Doll to OTA schema * the justification for the waiver o Fix requires XDM prettyprint code change, and XDM code is already frozen * a statement about user impact (e.g. how often the bug is likely to occur, behavior after the problem occurs, impact on other features, etc.) o Applying design pattern on large schema (like OTA) * a workaround description (if available) o None * an estimation when and how the bug will be fixed o Root cause for this bug : In AXI transform code, we keep on mutating schema model, by visiting AXI model. As a result of the mutation, there the event size that the XAM can handles grow out of propotion. I had tried with 1GB memory, even then this issue is reproduced. o Fix: Instead of a creating global element, and add it to the schema, then start mutation, we can create model-less global elements, and then add later to schema node. This code works, but it causes issues in XDM pretty print. Current XDM pretty print works on nodes that are added to a parent that is already in tree. So we need XDM pretty print also to work correctly on model-less nodes too.
*** Issue 80711 has been marked as a duplicate of this issue. ***
Waived for beta
The issue is that during transform we create a lot of events (as we keep on populate descendents of a global element or complextype) that the XAM cannot handle. TO reduce this size of events, we took the approach of adding the global element or complex type to schema node after we are done populating with their descendants. This will lead to few events one each for a global component that we create. The change need spans XDM pretty print and AXI model schema generation code. XDM Changes =========== Files Affected: =============== Checking in src/org/netbeans/modules/xml/xdm/xam/XDMAccess.java; new revision: 1.1.2.20; previous revision: 1.1.2.19 Checking in src/org/netbeans/modules/xml/xdm/nodes/NodeImpl.java; new revision: 1.2.2.16; previous revision: 1.2.2.15 Checking in src/org/netbeans/modules/xml/xdm/XDMModel.java; new revision: 1.2.2.43; previous revision: 1.2.2.42 Tests added ============ Checking in test/unit/src/org/netbeans/modules/xml/xdm/diff/prettyprint2.xml; new revision: 1.1.2.1; previous revision: 1.1 Checking in test/unit/src/org/netbeans/modules/xml/xdm/diff/prettyprint1.xml; new revision: 1.1.2.1; previous revision: 1.1 Checking in test/unit/src/org/netbeans/modules/xml/xdm/diff/MergeDiffTest.java; new revision: 1.1.2.12; previous revision: 1.1.2.11 AXI model changes ================= Files affected: ================ Checking in src/org/netbeans/modules/xml/axi/SchemaGenerator.java; new revision: 1.1.2.10; previous revision: 1.1.2.9 Checking in src/org/netbeans/modules/xml/axi/impl/SchemaGeneratorUtil.java; new revision: 1.1.2.1; previous revision: 1.1 Checking in src/org/netbeans/modules/xml/axi/impl/SchemaGeneratorFactoryImpl.java; new revision: 1.1.2.10; previous revision: 1.1.2.9 Checking in src/org/netbeans/modules/xml/axi/impl/RussianDoll.java; new revision: 1.1.2.6; previous revision: 1.1.2.5 Checking in src/org/netbeans/modules/xml/axi/impl/Util.java; new revision: 1.1.2.54; previous revision: 1.1.2.53 Checking in src/org/netbeans/modules/xml/axi/impl/GardenOfEden.java; new revision: 1.1.2.18; previous revision: 1.1.2.17 Checking in src/org/netbeans/modules/xml/axi/impl/VenetianBlind.java; new revision: 1.1.2.14; previous revision: 1.1.2.13 Checking in src/org/netbeans/modules/xml/axi/impl/MixedPattern.java; new revision: 1.1.2.4; previous revision: 1.1.2.3 Checking in src/org/netbeans/modules/xml/axi/impl/SalamiSlice.java; new revision: 1.1.2.12; previous revision: 1.1.2.11 Checking in src/org/netbeans/modules/xml/axi/impl/DefaultSchemaGenerator.java; new revision: 1.1.2.27; previous revision: 1.1.2.26 Checking in src/org/netbeans/modules/xml/axi/datatype/Datatype.java; new revision: 1.1.2.7; previous revision: 1.1.2.6 Test changes: ============ Checking in test/unit/src/org/netbeans/modules/xml/axi/SchemaGeneratorTest.java; new revision: 1.1.2.9; previous revision: 1.1.2.8 Checking in test/unit/src/org/netbeans/modules/xml/axi/SchemaGeneratorPerfTest.java; new revision: 1.1.2.9; previous revision: 1.1.2.8 Checking in test/unit/src/org/netbeans/modules/xml/axi/DesignPatternTest.java; new revision: 1.1.2.20; previous revision: 1.1.2.19 Checking in test/unit/src/org/netbeans/modules/xml/axi/SchemaTransformTest.java; new revision: 1.1.2.26; previous revision: 1.1.2.25 Checking in test/unit/src/org/netbeans/modules/xml/axi/TestCatalogModel.java; new revision: 1.1.2.5; previous revision: 1.1.2.4 Checking in test/unit/src/org/netbeans/modules/xml/axi/SchemaGeneratorDatatypesTest.java; new revision: 1.1.2.6; previous revision: 1.1.2.5
Verified in build 060824.