Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » Exceptions when discovering java model from java project with annotations
Exceptions when discovering java model from java project with annotations [message #667413] Thu, 28 April 2011 15:10 Go to next message
Eclipse UserFriend
Originally posted by: vanbeerst.gmail.com

This is a multi-part message in MIME format.
--------------030502070700030402040405
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I am having trouble discovering a java model from a java project.
Everything works fine when there are no annotations used in the project,
but when there are annotations, some exceptions are thrown.

I have tried this with following configurations, which gave all the same
results :
- Modisco 0.7 on eclipse Galileo
- Modisco 0.8 on eclipse Helios
- Modisco 0.9 on eclipse Indigo (M6)

There are 3 different kinds of exceptions thrown :
- classcast exception from AnnotationTypeMemberDeclarationImpl to
AbstractMethodDeclaration
- classcast exception from TypeParameterImpl to UnresolvedItem
- IOWrappedException stating that TypeAccessImpl is not contained by a
resource

For my project I get several of these exceptions. In attachment for each
of those types of exceptions one stack trace is given.

Note that I only get these exception when doing a full java analysis. I
do not get any exceptions when setting following value in the
DiscoveryParametersBean :
this.discoveryParametersBean.setFullJavaLevel(false);


Does anyone know what I can do about this?
If necessary, I will try to create a minimal project which has these
exceptions, for now I only have fairly large projects, which I can not
just post here.

Best regards,
Tony.

--------------030502070700030402040405
Content-Type: text/plain;
name="classcastexception1.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="classcastexception1.txt"

eclipse.buildId=M20110210-1200
java.version=1.6.0_24
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.java.product


Error
Thu Apr 28 16:59:48 CEST 2011
org.eclipse.gmt.modisco.java.emf.impl.AnnotationTypeMemberDe clarationImpl cannot be cast to org.eclipse.gmt.modisco.java.AbstractMethodDeclaration (org.eclipse.gmt.modisco.java.discoverer_0.8.0.v201006150543 )

java.lang.ClassCastException: org.eclipse.gmt.modisco.java.emf.impl.AnnotationTypeMemberDe clarationImpl cannot be cast to org.eclipse.gmt.modisco.java.AbstractMethodDeclaration
at org.eclipse.gmt.modisco.java.io.java.JDTVisitor.endVisit(JDT Visitor.java:1698)
at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvo cation.java:247)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:25 28)
at org.eclipse.jdt.core.dom.ReturnStatement.accept0(ReturnState ment.java:136)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:25 28)
at org.eclipse.jdt.core.dom.IfStatement.accept0(IfStatement.jav a:190)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java :2551)
at org.eclipse.jdt.core.dom.Block.accept0(Block.java:136)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:25 28)
at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDec laration.java:504)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java :2551)
at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclara tion.java:484)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java :2551)
at org.eclipse.jdt.core.dom.CompilationUnit.accept0(Compilation Unit.java:219)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.gmt.modisco.java.io.java.JavaReader.visitCompila tionUnit(JavaReader.java:266)
at org.eclipse.gmt.modisco.java.io.java.JavaReader.parseTypeRoo t(JavaReader.java:225)
at org.eclipse.gmt.modisco.java.io.java.JavaReader.parsePackage (JavaReader.java:246)
at org.eclipse.gmt.modisco.java.io.java.JavaReader.readModel(Ja vaReader.java:175)
at org.eclipse.gmt.modisco.java.actions.DiscoverJavaModelFromJa vaProject$2.run(DiscoverJavaModelFromJavaProject.java:194)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)



--------------030502070700030402040405
Content-Type: text/plain;
name="classcastexception2.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="classcastexception2.txt"

eclipse.buildId=M20110210-1200
java.version=1.6.0_24
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.java.product


Error
Thu Apr 28 16:59:48 CEST 2011
org.eclipse.gmt.modisco.java.emf.impl.TypeParameterImpl cannot be cast to org.eclipse.gmt.modisco.java.UnresolvedItem

java.lang.ClassCastException: org.eclipse.gmt.modisco.java.emf.impl.TypeParameterImpl cannot be cast to org.eclipse.gmt.modisco.java.UnresolvedItem
at org.eclipse.gmt.modisco.java.emf.impl.UnresolvedItemAccessIm pl.eSet(UnresolvedItemAccessImpl.java:212)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjec tImpl.java:1081)
at org.eclipse.gmt.modisco.java.io.java.binding.PendingElement. affectTarget0(PendingElement.java:172)
at org.eclipse.gmt.modisco.java.io.java.binding.PendingElement. affectTarget(PendingElement.java:152)
at org.eclipse.gmt.modisco.java.io.java.binding.BindingManager. resolveBindings(BindingManager.java:312)
at org.eclipse.gmt.modisco.java.io.java.JavaReader.finalResolve Bindings(JavaReader.java:285)
at org.eclipse.gmt.modisco.java.io.java.JavaReader.terminate(Ja vaReader.java:337)
at org.eclipse.gmt.modisco.java.actions.DiscoverJavaModelFromJa vaProject$2.run(DiscoverJavaModelFromJavaProject.java:202)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)



--------------030502070700030402040405
Content-Type: text/plain;
name="typeaccessimpl_not_contained.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="typeaccessimpl_not_contained.txt"

eclipse.buildId=M20110210-1200
java.version=1.6.0_24
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.java.product


Error
Thu Apr 28 16:59:48 CEST 2011
Unkown error.

org.eclipse.emf.ecore.resource.Resource$IOWrappedException: The object 'org.eclipse.gmt.modisco.java.emf.impl.TypeAccessImpl@63f8ce' is not contained in a resource.
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.endSave(XMLSaveIm pl.java:306)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl. java:270)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLRes ourceImpl.java:206)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(Resour ceImpl.java:1406)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(Resour ceImpl.java:993)
at org.eclipse.gmt.modisco.java.actions.DefaultDiscoverer.saveR esource(DefaultDiscoverer.java:125)
at org.eclipse.gmt.modisco.java.actions.DiscoverJavaModelFromJa vaProject$2.run(DiscoverJavaModelFromJavaProject.java:205)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.eclipse.emf.ecore.xmi.DanglingHREFException: The object 'org.eclipse.gmt.modisco.java.emf.impl.TypeAccessImpl@63f8ce' is not contained in a resource.
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.handleDanglingH REF(XMLHelperImpl.java:760)
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.getURIFragment( XMLHelperImpl.java:731)
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.getIDREF(XMLHel perImpl.java:753)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveIDRefMany(XML SaveImpl.java:2003)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLS aveImpl.java:1355)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XML SaveImpl.java:2685)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSa veImpl.java:1174)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSa veImpl.java:1035)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany (XMLSaveImpl.java:2386)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLS aveImpl.java:1533)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XML SaveImpl.java:2685)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSa veImpl.java:1174)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSa veImpl.java:1035)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany (XMLSaveImpl.java:2386)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLS aveImpl.java:1533)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XML SaveImpl.java:2685)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSa veImpl.java:1174)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSa veImpl.java:1035)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany (XMLSaveImpl.java:2386)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLS aveImpl.java:1533)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XML SaveImpl.java:2685)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSa veImpl.java:1174)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSa veImpl.java:1035)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany (XMLSaveImpl.java:2386)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLS aveImpl.java:1533)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XML SaveImpl.java:2685)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSa veImpl.java:1174)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSa veImpl.java:1035)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany (XMLSaveImpl.java:2386)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLS aveImpl.java:1533)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XML SaveImpl.java:2685)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(XM LSaveImpl.java:680)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveI mpl.java:588)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl. java:256)
... 6 more



--------------030502070700030402040405--
Re: Exceptions when discovering java model from java project with annotations [message #667507 is a reply to message #667413] Fri, 29 April 2011 09:05 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
Hi,

Thanks for your practical feedback on the MoDisco Java Discoverer!

Do you have already submitted a bug related to your problem?
I quickly checked in the MoDisco Bugzilla but couldn't find any directly related issue.

It would be good that you submit a dedicated bug with the information you've provided here and attach to it, if possible, a small sample project reproducing the issues you've encountered: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=MDT.MoDi sco&component=Technologies

Best regards,

Hugo


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: Exceptions when discovering java model from java project with annotations [message #667522 is a reply to message #667413] Fri, 29 April 2011 10:50 Go to previous messageGo to next message
Fabien Giquel is currently offline Fabien GiquelFriend
Messages: 147
Registered: July 2009
Senior Member
Hi Tony,

I did not found some similar opened issue in our bugzilla. As you
suggest it, can you try to isolate the case in one minimal projet and
submit one new bugzilla
( https://bugs.eclipse.org/bugs/enter_bug.cgi?product=MDT.MoDi sco) ?


----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
rue Nina Simone
44000 NANTES
----------------------------------------------------
Re: Exceptions when discovering java model from java project with annotations [message #667538 is a reply to message #667522] Fri, 29 April 2011 12:22 Go to previous message
Eclipse UserFriend
Originally posted by: vanbeerst.gmail.com

Hi,

I have added a bug report here :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=344259

There is a minimal project added there, but it only reproduces one of
the exceptions mentioned in my previous post. I hope the other
exceptions are related.

Tony.
Previous Topic:Welcome to eclipse.modisco
Next Topic:Structured Metrics Model (SMM)
Goto Forum:
  


Current Time: Thu Mar 28 12:32:17 GMT 2024

Powered by FUDForum. Page generated in 0.03983 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top