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 115479 - java.lang.StackOverflowError typemanagement.TypeManager.
Summary: java.lang.StackOverflowError typemanagement.TypeManager.
Status: NEW
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@uml
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-13 16:31 UTC by pzajac
Modified: 2013-11-29 00:08 UTC (History)
21 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 3762


Attachments
simle java project with reproducible case (10.67 KB, application/octet-stream)
2008-12-24 20:37 UTC, Sergey Petrov
Details
stacktrace (183.15 KB, text/plain)
2009-02-10 23:38 UTC, dimitarmisev
Details
stacktrace (125.00 KB, text/plain)
2009-09-23 13:52 UTC, michbarsinai
Details
stacktrace (174.21 KB, text/plain)
2010-07-31 13:10 UTC, javydreamercsw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pzajac 2007-09-13 16:31:30 UTC
Build: NetBeans IDE Dev (Build 200709130000)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b05
OS: Windows XP, 5.1, x86
STACKTRACE: (first 10 lines)
java.lang.StackOverflowError
        at java.lang.Character.digit(Character.java:4494)
        at java.lang.Integer.parseInt(Integer.java:445)
        at java.lang.Integer.parseInt(Integer.java:497)
        at com.werken.saxpath.XPathReader.numberInteger(XPathReader.java:140)
        at com.werken.saxpath.XPathReader.filterExpr(XPathReader.java:205)
        at com.werken.saxpath.XPathReader.pathExpr(XPathReader.java:75)
        at com.werken.saxpath.XPathReader.unionExpr(XPathReader.java:940)
        at com.werken.saxpath.XPathReader.unaryExpr(XPathReader.java:928)
        at com.werken.saxpath.XPathReader.multiplicativeExpr(XPathReader.java:879)
        at com.werken.saxpath.XPathReader.additiveExpr(XPathReader.java:850)
...
        at com.werken.saxpath.XPathReader.expr(XPathReader.java:727)
        at com.werken.saxpath.XPathReader.parse(XPathReader.java:44)
        at org.jaxen.BaseXPath.(BaseXPath.java:130)
        at org.jaxen.BaseXPath.(BaseXPath.java:157)
        at org.jaxen.dom4j.Dom4jXPath.(Dom4jXPath.java:103)
        at org.dom4j.xpath.DefaultXPath.parse(DefaultXPath.java:302)
        at org.dom4j.xpath.DefaultXPath.(DefaultXPath.java:52)
        at org.dom4j.DocumentFactory.createXPath(DocumentFactory.java:182)
        at org.dom4j.tree.AbstractNode.createXPath(AbstractNode.java:207)
        at org.dom4j.tree.AbstractNode.selectSingleNode(AbstractNode.java:187)
        at 
....
org.netbeans.modules.uml.core.metamodel.core.foundation.ExternalFileManager.isImportedElement(ExternalFileManager.java:779)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.verifyParentsLoaded(TypeManager.java:1048)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.resolveExternalNode(TypeManager.java:388)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.findByID(TypeManager.java:2007)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.getRawElementByID(TypeManager.java:1944)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.getParentNode(TypeManager.java:1124)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.getParentAndVerify(TypeManager.java:1068)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.verifyParentsLoaded(TypeManager.java:1055)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.resolveExternalNode(TypeManager.java:388)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.findByID(TypeManager.java:2007)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.getRawElementByID(TypeManager.java:1944)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.getParentNode(TypeManager.java:1124)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.getParentAndVerify(TypeManager.java:1068)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.verifyParentsLoaded(TypeManager.java:1055)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.resolveExternalNode(TypeManager.java:388)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.findByID(TypeManager.java:2007)
        at org.netbeans.modules.uml.core.typemanagement.TypeManager.getRawElementByID(
Comment 1 Exceptions Reporter 2008-01-29 16:24:46 UTC
THIS ISSUE HAS ALREADY 10 DUPLICATES
Comment 2 Viktor Lapitski 2008-01-30 21:33:49 UTC
code analysis shows that it may happen when model contains 
circular specializations, ie. A->B->A. This can be created 
 as a result of the following scenario:

0.lets have A->B
1.RE both interfaces
2.source code edit to make B->A
3.partial RE, ie. only B.java

The partial RE, while being usefull and effective, have a set 
of potential drawbacks when only one side of an updated relation 
is REed. The above mentioned case is just one example.

To avoid the infinite recursion problem the defensive code 
will be added to block creation of such circular situation. 
Comment 3 Viktor Lapitski 2008-02-01 01:49:23 UTC
Fixed. Added defensive check to RE to block circular generalization 
relationship creation.


author	lvv@netbeans.org
	Thu Jan 31 17:34:59 2008 -0800 (12 minutes ago)
changeset 65441	ea358d996d1f
parent 65440	b5a249ba0ebe
child 65443	e72d3aee0433
child 65444	8791fd6a63ab
Fix for 115479 java.lang.StackOverflowError typemanagement.TypeManager. 

and 

Checking in uml/core/src/org/netbeans/modules/uml/core/reverseengineering/reinte
gration/UMLParsingIntegrator.java;
/cvs/uml/core/src/org/netbeans/modules/uml/core/reverseengineering/reintegration
/Attic/UMLParsingIntegrator.java,v  <--  UMLParsingIntegrator.java
new revision: 1.7.2.4; previous revision: 1.7.2.3
done
Checking in uml/core/src/org/netbeans/modules/uml/core/metamodel/core/foundation
/RelationValidator.java;
/cvs/uml/core/src/org/netbeans/modules/uml/core/metamodel/core/foundation/Attic/
RelationValidator.java,v  <--  RelationValidator.java
new revision: 1.2.6.3; previous revision: 1.2.6.2
done
Comment 4 Peter Lam 2008-03-27 02:01:01 UTC
verified in NB 6.1 build 200803251204.
The resulting model no longer has the circular result.
Comment 5 Exceptions Reporter 2008-10-08 15:08:23 UTC
Reopening - reproduced in NetBeans IDE 6.1 (Build 200804211638)
http://statistics.netbeans.org/exceptions/detail.do?id=124906
Comment 6 Sergey Petrov 2008-11-05 18:24:46 UTC
it seems not all cases was fixed in 6.1
Comment 7 Sergey Petrov 2008-11-05 18:29:12 UTC
able to reproduce with re of properties from hg (Resource Bundle)
Comment 8 Sergey Petrov 2008-11-06 08:09:24 UTC
it's enough to re org.netbeans.modules.properties.PropertiesEditorSupport class ino new project to get the issue.
Comment 9 Sergey Petrov 2008-12-24 20:31:37 UTC
root cause is incorrect elements resolving causing circular generalization creation. see simle attached project below
with reproducible case.
Comment 10 Sergey Petrov 2008-12-24 20:37:34 UTC
Created attachment 75302 [details]
simle java project with reproducible case
Comment 11 Sergey Petrov 2009-01-11 11:28:37 UTC
stackoverflow is replaced with warning in log, for me it's better. initial reasons for the issue are not resolved yet.
Comment 12 Quality Engineering 2009-01-12 17:33:03 UTC
Integrated into 'main-golden', will be available in build *200901121401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/54332ee77058
User: sergeyp@netbeans.org
Log: fix #115479 made verification to avoid stackoverflow - infinite recursion. still need to resolve corrupted model which cause this problem.
Comment 13 Quality Engineering 2009-02-01 07:47:07 UTC
Integrated into 'main-golden', will be available in build *200902010201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/7ae17487a878
User: sergeyp@netbeans.org
Log: fix #115479 - part fix, check in proper places
Comment 14 dimitarmisev 2009-02-10 23:38:16 UTC
Build: NetBeans IDE 6.5 (Build 200811100001)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33
OS: Linux, 2.6.27-11-generic, i386

User Comments: 
creating an UML project from an existing Java project

Stacktrace: 
java.lang.StackOverflowError
        at org.jaxen.BaseXPath.<init>(BaseXPath.java:157)
        at org.jaxen.dom4j.Dom4jXPath.<init>(Dom4jXPath.java:103)
        at org.dom4j.xpath.DefaultXPath.parse(DefaultXPath.java:302)
        at org.dom4j.xpath.DefaultXPath.<init>(DefaultXPath.java:52)
        at org.dom4j.DocumentFactory.createXPath(DocumentFactory.java:182)
        at org.dom4j.tree.AbstractNode.createXPath(AbstractNode.java:207)
Comment 15 dimitarmisev 2009-02-10 23:38:23 UTC
Created attachment 76823 [details]
stacktrace
Comment 16 Sergey Petrov 2009-03-12 14:04:56 UTC
in 6.7 only a better log can be added, so there will be no exceptions and also user will know smth isn't good.
"    There was some problems with source parsing, see report: 
Possible generalization-implementation resolve problem."
text is added to report for this case, in general it's related to some resolve problem if there are classes with the
same name (may be for nested classes only).

keep the issue opened to find root cause later.
Comment 17 Quality Engineering 2009-03-18 22:38:46 UTC
Integrated into 'main-golden', will be available in build *200903181604* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/cfd9f0791b2a
User: sergeyp@netbeans.org
Log: fix #115479 - now user will see smth is wrong
Comment 18 michbarsinai 2009-09-23 13:52:04 UTC
Build: NetBeans IDE Dev (Build 200909220201)
VM: Java HotSpot(TM) Client VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03
OS: Windows XP, 5.1, x86

User Comments: 
Deploying a JEE project and reverse engineering (UML) another one. The switching to another application.

Stacktrace: 
java.lang.StackOverflowError
        at java.lang.Character.digit(Character.java:4494)
        at java.lang.Integer.parseInt(Integer.java:445)
        at java.lang.Integer.parseInt(Integer.java:497)
        at com.werken.saxpath.XPathReader.numberInteger(XPathReader.java:140)
        at com.werken.saxpath.XPathReader.filterExpr(XPathReader.java:205)
        at com.werken.saxpath.XPathReader.pathExpr(XPathReader.java:75)
Comment 19 michbarsinai 2009-09-23 13:52:18 UTC
Created attachment 88188 [details]
stacktrace
Comment 20 javydreamercsw 2010-07-31 13:10:35 UTC
Created attachment 101133 [details]
stacktrace

Running reverse engineering.