[ http://jira.andromda.org/browse/UMLMETA-64?page=comments#action_12476 ]
     
Thomas Letsch commented on UMLMETA-64:
--------------------------------------

Hi Wouter,

thanks for the reply. For now I found a work-around:
Removing all Entity Stereotypes in my model. 

I found in the source that it only tries to cast it when there is an Entity 
stereotype attached. I am just starting to understandabout how androMDA builds 
its internal datastructures. Therefore I have only a few ideas. A fast bugfix 
could be to check for being an instance of ModelElementFacade instead only 
MetafacadeBase. 

I remember another ClassCastException in EntityMetaFacade where the following 
code fails:
            if (superClass.hasStereotype(UMLProfile.STEREOTYPE_ENTITY))
            {
                Entity facade = (Entity)superClass;
                identifiers.addAll(facade.getIdentifiers(follow));
            }
Here could fix the replacement of the 
"superClass.hasStereotype(UMLProfile.STEREOTYPE_ENTITY)" through "superClass 
instanceof Entity" the problem...


But for now the workaround is ok, because our main focus the next days/weeks is 
on generating code for interfaces/value objects and XML. I will start to add 
entity stereotypes on requirement again and then try to rebuild our application 
several times. The hope is, that I will find the problem in the model that way.

BTW: AndroMDA works fine with Maven 1.1, at least for the small things we do 
actually.


Regards,
Thomas


> AndroMDA fails with ClassCastException (LinkFacadeLogicImpl)
> ------------------------------------------------------------
>
>          Key: UMLMETA-64
>          URL: http://jira.andromda.org/browse/UMLMETA-64
>      Project: UML Metafacades
>         Type: Bug
>     Versions: 3.1 Final, 3.2-RC1
>  Environment: Maven 1.1-b2
> MagicDraw 9.5
> AndroMDA 3.1, but 3.2-RC1-SNAPSHOP does fail with the same error
>     Reporter: Thomas Letsch
>     Assignee: Wouter Zoons
>      Fix For: 3.2-RC1

>
> AndroMDA reports a "java.lang.ClassCastException: 
> org.andromda.metafacades.uml14.LinkFacadeLogicImpl" when it tries to generate 
> code for our project.
> Before the error it shows the following lines (in DEBUG mode):
> --------
> [The first 2 lines where reported like 1000 times before for all cartridges]
> 2006-01-09 10:58:53,088 DEBUG [root] performing 
> 'MetafacadeMappings.getMetafacadeMapping' with mappingObject 
> 'Interaction$Impl ID: .:0000000000001042 MID: .:00000000000003B7 OPCKG: 
> .:0000000000000694', stereotypes '[]', namespace 'hibernate' and context 
> 'null'
> 2006-01-09 10:58:53,088 DEBUG [root] namespace mapping not found --> finding 
> default
> 2006-01-09 10:58:53,104 DEBUG [root] found mapping --> 'null'
> 2006-01-09 10:58:53,260 ERROR [org.andromda.core.engine.ModelProcessor] Error 
> performing ModelProcessor.process with model(s) --> 
> 'file:C:\LP\hector\mda\src\main\uml\hector.xml.zip!\hector.xml'
> 2006-01-09 10:58:53,291 ERROR [AndroMDA] Exception recorded in --> 
> 'C:\LP\hector\mda\andromda060109105853.exc' 
> --------
> The Exception reported is the following:
> ------- AndroMDA Exception Recording -------
> Version ........: 3.1
> Error ..........: Error performing ModelProcessor.process with model(s) --> 
> 'file:C:\LP\hector\mda\src\main\uml\hector.xml.zip!\hector.xml'
> Build ..........: 2005-11-09 21:53:49
> Build System ...: Windows XP-5.1
> Build JDK ......: Sun Microsystems Inc.-1.5.0_04-b05
> Build Builder ..: wzo
> Run System .....: Windows 20005.0
> Run JDK ........: Sun Microsystems Inc.1.5.0_04-b05
> Main Exception .: org.andromda.metafacades.uml14.LinkFacadeLogicImpl
> Root Exception .: java.lang.ClassCastException: 
> org.andromda.metafacades.uml14.LinkFacadeLogicImpl
> java.lang.ClassCastException: 
> org.andromda.metafacades.uml14.LinkFacadeLogicImpl
> at 
> org.andromda.metafacades.uml14.UMLModelAccessFacade$1.evaluate(UMLModelAccessFacade.java:209)
> at 
> org.apache.commons.collections.CollectionUtils.filter(CollectionUtils.java:433)
> at 
> org.andromda.metafacades.uml14.UMLModelAccessFacade.filterMetafacades(UMLModelAccessFacade.java:200)
> at 
> org.andromda.metafacades.uml14.UMLModelAccessFacade.getModelElements(UMLModelAccessFacade.java:172)
> at 
> org.andromda.core.metafacade.MetafacadeFactory.getAllMetafacades(MetafacadeFactory.java:627)
> at 
> org.andromda.core.metafacade.MetafacadeFactory.validateAllMetafacades(MetafacadeFactory.java:230)
> at 
> org.andromda.core.engine.ModelProcessor.validateModel(ModelProcessor.java:411)
> at 
> org.andromda.core.engine.ModelProcessor.loadModelIfNecessary(ModelProcessor.java:370)
> at 
> org.andromda.core.engine.ModelProcessor.loadIfNecessary(ModelProcessor.java:553)
> at 
> org.andromda.core.engine.ModelProcessor.processModels(ModelProcessor.java:222)
> at org.andromda.core.engine.ModelProcessor.process(ModelProcessor.java:148)
> at org.andromda.core.engine.ModelProcessor.process(ModelProcessor.java:84)
> at org.andromda.core.engine.Engine.run(Engine.java:82)
> at org.andromda.core.AndroMDA.run(AndroMDA.java:131)
> at org.andromda.maven.AndroMDARunner.run(AndroMDARunner.java:74)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at 
> org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:268)
> at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:61)
> at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:6Cool
> at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:50)
> at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:86)
> at 
> org.apache.commons.jelly.expression.jexl.JexlExpression.evaluate(JexlExpression.java:69)
> at org.apache.commons.jelly.tags.core.SetTag.doTag(SetTag.java:84)
> at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247)
> at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
> at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186)
> at org.apache.commons.jelly.tags.core.WhenTag.doTag(WhenTag.java:46)
> at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247)
> at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
> at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186)
> at org.apache.commons.jelly.tags.core.ChooseTag.doTag(ChooseTag.java:3Cool
> at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247)
> at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
> at 
> org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:7Cool
> at 
> org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:109)
> at org.apache.maven.werkz.Goal.fire(Goal.java:656)
> at org.apache.maven.werkz.Goal.attain(Goal.java:592)
> at org.apache.maven.werkz.WerkzProject.attainGoal(WerkzProject.java:210)
> at 
> org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:114)
> at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247)
> at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
> at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186)
> at org.apache.maven.werkz.jelly.PreGoalTag$1.firePreGoal(PreGoalTag.java:103)
> at org.apache.maven.werkz.Goal.firePreGoalCallbacks(Goal.java:708)
> at org.apache.maven.werkz.Goal.fire(Goal.java:633)
> at org.apache.maven.werkz.Goal.attain(Goal.java:592)
> at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:693)
> at org.apache.maven.MavenSession.attainGoals(MavenSession.java:263)
> at org.apache.maven.cli.App.doMain(App.java:511)
> at org.apache.maven.cli.App.main(App.java:1258)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at com.werken.forehead.Forehead.run(Forehead.java:551)
> at com.werken.forehead.Forehead.main(Forehead.java:581)
> Thanks,
> Thomas
> BTW: I reported that error already in an User Forum, bt there was no response 
> still. Perhaps its better to report it here. I hope that does not violate any 
> policies.




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642

Reply via email to