Fornax-Platform
Forum

[sculptor] weird errors after editing DSL

View: New views
5 Messages — Rating Filter:   Alert me  

[sculptor] weird errors after editing DSL

by amphoras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am making some modifications to the Sculptor DSL according to the instructions in the Developer's Guide.  I added some attributes to DomainObject and Attribute and introduced a new concept called Constant and added this as a collection to DomainObject.  

I am able to generate the editor plugin and type my new keywords into "model.design" file.  All my new keywords are highlighted and there are no syntax errors.  I was quite pleased and thought that I was doing everything correctly.

However, I know now that I should have run the model.design's generator with each change to make sure it really worked before adding the next thing!  After making all these changes, I fired up Maven's install goal for the first time, and I get:

1551 INFO  CompositeComponent - Workflow: executing workflow sculptorworkflow.oaw in workflow.oaw:3
1551 INFO  CompositeComponent - Workflow: executing workflow org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw in sculptorworkflow.oaw:29
1551 INFO  CompositeComponent - ParserComponent(sculptordsl-parser)
1739 INFO  CompositeComponent - IfComponent: executing if org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw in org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw:9
1739 INFO  ConditionalComponent - CheckComponent(sculptordsl-checker): expression dslModel.eAllContents.union({dslModel}) check file(s): org::fornax::cartridges::sculptor::dsl::GenChecks org::fornax::cartridges::sculptor::dsl::Checks
1864 ERROR AbstractExpressionsUsingWorkflowComponent - Error in Component sculptordsl-checker of type org.openarchitectureware.check.CheckComponent:
        EvaluationException : Couldn't find type or property 'dslModel'
        nofile[0,8] on line 1 'dslModel'

1864 ERROR WorkflowRunner     - mismatched input 'foo' expecting '}' on line 95 in model.design
...[snip a bunch more mismatched input errors]...

1864 ERROR WorkflowRunner     - no viable alternative at input '<EOF>' on line 0 in model.design
1864 ERROR WorkflowRunner     - ERROR in Component sculptordsl-checker of type org.openarchitectureware.check.CheckComponent
        Couldn't find type or property 'dslModel' [dslModel]  in workflow: CheckComponent(sculptordsl-checker): expression dslModel.eAllContents.union({dslModel}) check file(s): org::fornax::cartridges::sculptor::dsl::GenChecks org::fornax::cartridges::sculptor::dsl::Checks
1864 ERROR WorkflowRunner     - ERROR in Component sculptordsl-checker of type org.openarchitectureware.check.CheckComponent
        Couldn't find type or property 'dslModel' [dslModel.eAllContents]  in workflow: CheckComponent(sculptordsl-checker): expression dslModel.eAllContents.union({dslModel}) check file(s): org::fornax::cartridges::sculptor::dsl::GenChecks org::fornax::cartridges::sculptor::dsl::Checks
1880 ERROR WorkflowRunner     - ERROR in Component sculptordsl-checker of type org.openarchitectureware.check.CheckComponent
        Couldn't find type or property 'dslModel' [dslModel.eAllContents.union({dslModel})]  in workflow: CheckComponent(sculptordsl-checker): expression dslModel.eAllContents.union({dslModel}) check file(s): org::fornax::cartridges::sculptor::dsl::GenChecks org::fornax::cartridges::sculptor::dsl::Checks
[FATAL ERROR] org.fornax.toolsupport.maven2.OawWorkflowMojo#execute() caused a linkage error (java.lang.NoSuchMethodError) and may be out-of-date. Check the realms:
[FATAL ERROR] Plugin realm = app0.child-container[org.fornax.toolsupport:fornax-oaw-m2-plugin]
...

I have no idea what these errors mean.  I didn't change the GenChecks.chk and Checks.chk files.  What file did I mess up?  The only thing that I can think of doing is to retrace my steps and take out my changes one by one to see if I can get back to something that generates.  That is going to be time consuming though, so I appreciate any hints or clues that you can give me.

Thanks,
Polly

Re: [sculptor] weird errors after editing DSL

by amphoras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

OK, I have gotten a little bit further.  The first "mismatched input" error gave me a clue about the problem.  I had added two attributes to DslReference.  When I comment out the two new attributes from the sculptordsl.xtxt file and remove them from my model.design file, the generator works.  I don't see the problem though because I copied and pasted them from another concept and those work fine.  Also, I can see these two attributes in the generated metamodel Java files.  The definition is as follows:

DslReference :
  (doc=STRING)?
  REF (visibility=DslVisibility)? (collectionType=DslCollectionType"<")? (("@")?domainObjectType=[DslSimpleDomainObject]) (">")? name=ID
    ((key?="key") |
     ((notChangeable?=NOT "changeable") | ("changeable")) |
     ((required?="required") | (NOT "required")) |
     ((nullable?="nullable") | (NOT "nullable")) |
     ("cascade" "=" cascade=STRING) |
     ("fetch" "=" fetch=STRING) |
     ((cache?="cache") | (NOT "cache")) |
     ((inverse?="inverse") | (NOT "inverse")) |
     ("databaseColumn" "=" databaseColumn=STRING) |
     ("orderBy" "=" orderBy=ID) |
     ("foo" "=" foo=STRING) |
     ("foo2" "=" foo2=STRING))*
    (OPPOSITE oppositeName=ID)? (";")?;  

--Polly


amphoras wrote:
Hi,

I am making some modifications to the Sculptor DSL according to the instructions in the Developer's Guide.  I added some attributes to DomainObject and Attribute and introduced a new concept called Constant and added this as a collection to DomainObject.  

I am able to generate the editor plugin and type my new keywords into "model.design" file.  All my new keywords are highlighted and there are no syntax errors.  I was quite pleased and thought that I was doing everything correctly.

However, I know now that I should have run the model.design's generator with each change to make sure it really worked before adding the next thing!  After making all these changes, I fired up Maven's install goal for the first time, and I get:

1551 INFO  CompositeComponent - Workflow: executing workflow sculptorworkflow.oaw in workflow.oaw:3
1551 INFO  CompositeComponent - Workflow: executing workflow org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw in sculptorworkflow.oaw:29
1551 INFO  CompositeComponent - ParserComponent(sculptordsl-parser)
1739 INFO  CompositeComponent - IfComponent: executing if org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw in org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw:9
1739 INFO  ConditionalComponent - CheckComponent(sculptordsl-checker): expression dslModel.eAllContents.union({dslModel}) check file(s): org::fornax::cartridges::sculptor::dsl::GenChecks org::fornax::cartridges::sculptor::dsl::Checks
1864 ERROR AbstractExpressionsUsingWorkflowComponent - Error in Component sculptordsl-checker of type org.openarchitectureware.check.CheckComponent:
        EvaluationException : Couldn't find type or property 'dslModel'
        nofile[0,8] on line 1 'dslModel'

1864 ERROR WorkflowRunner     - mismatched input 'foo' expecting '}' on line 95 in model.design
...[snip a bunch more mismatched input errors]...

1864 ERROR WorkflowRunner     - no viable alternative at input '<EOF>' on line 0 in model.design
1864 ERROR WorkflowRunner     - ERROR in Component sculptordsl-checker of type org.openarchitectureware.check.CheckComponent
        Couldn't find type or property 'dslModel' [dslModel]  in workflow: CheckComponent(sculptordsl-checker): expression dslModel.eAllContents.union({dslModel}) check file(s): org::fornax::cartridges::sculptor::dsl::GenChecks org::fornax::cartridges::sculptor::dsl::Checks
1864 ERROR WorkflowRunner     - ERROR in Component sculptordsl-checker of type org.openarchitectureware.check.CheckComponent
        Couldn't find type or property 'dslModel' [dslModel.eAllContents]  in workflow: CheckComponent(sculptordsl-checker): expression dslModel.eAllContents.union({dslModel}) check file(s): org::fornax::cartridges::sculptor::dsl::GenChecks org::fornax::cartridges::sculptor::dsl::Checks
1880 ERROR WorkflowRunner     - ERROR in Component sculptordsl-checker of type org.openarchitectureware.check.CheckComponent
        Couldn't find type or property 'dslModel' [dslModel.eAllContents.union({dslModel})]  in workflow: CheckComponent(sculptordsl-checker): expression dslModel.eAllContents.union({dslModel}) check file(s): org::fornax::cartridges::sculptor::dsl::GenChecks org::fornax::cartridges::sculptor::dsl::Checks
[FATAL ERROR] org.fornax.toolsupport.maven2.OawWorkflowMojo#execute() caused a linkage error (java.lang.NoSuchMethodError) and may be out-of-date. Check the realms:
[FATAL ERROR] Plugin realm = app0.child-container[org.fornax.toolsupport:fornax-oaw-m2-plugin]
...

I have no idea what these errors mean.  I didn't change the GenChecks.chk and Checks.chk files.  What file did I mess up?  The only thing that I can think of doing is to retrace my steps and take out my changes one by one to see if I can get back to something that generates.  That is going to be time consuming though, so I appreciate any hints or clues that you can give me.

Thanks,
Polly

Re: [sculptor] weird errors after editing DSL

by amphoras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Any ideas for how to debug this issue?  I downloaded ANTLRWorks and tested my model.design file, and it parses correctly.  I know this because I tested with a broken model.design so I would know what the output looks like for something that is broken, and my model.design is not broken.

I cannot figure out why adding those two keywords to DslAttribute works but adding the same ones to DslReference does not work.  I'm copying and pasting the same snippets in the XText file.  The OAW errors are so cryptic too.  Googling the OAW newsgroups has not been helpful.  

I'm just banging my head against the wall now, so any help would be greatly appreciated!  ;)

Thanks,
Polly


amphoras wrote:
OK, I have gotten a little bit further.  The first "mismatched input" error gave me a clue about the problem.  I had added two attributes to DslReference.  When I comment out the two new attributes from the sculptordsl.xtxt file and remove them from my model.design file, the generator works.  I don't see the problem though because I copied and pasted them from another concept and those work fine.  Also, I can see these two attributes in the generated metamodel Java files.  The definition is as follows:

DslReference :
  (doc=STRING)?
  REF (visibility=DslVisibility)? (collectionType=DslCollectionType"<")? (("@")?domainObjectType=[DslSimpleDomainObject]) (">")? name=ID
    ((key?="key") |
     ((notChangeable?=NOT "changeable") | ("changeable")) |
     ((required?="required") | (NOT "required")) |
     ((nullable?="nullable") | (NOT "nullable")) |
     ("cascade" "=" cascade=STRING) |
     ("fetch" "=" fetch=STRING) |
     ((cache?="cache") | (NOT "cache")) |
     ((inverse?="inverse") | (NOT "inverse")) |
     ("databaseColumn" "=" databaseColumn=STRING) |
     ("orderBy" "=" orderBy=ID) |
     ("foo" "=" foo=STRING) |
     ("foo2" "=" foo2=STRING))*
    (OPPOSITE oppositeName=ID)? (";")?;  

--Polly


Re: [sculptor] weird errors after editing DSL

by Patrik Nordwall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, have you rebuilt sculptor-parent (mvn install)? Are you using the correct version number in your target project? Trunkow 1.5.0-SNAPSHOT

Re: [sculptor] weird errors after editing DSL

by amphoras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

$%#@!  

After much pain and agony debugging ten levels deep into oAW, I finally figured out the problem.  It was like you said (I saw your response right after I figured it out).  After running into the problems with the Fornax repo a few days ago, I stopped running the mvn install target on sculptor-parent and was testing by running the workflow.  Somehow it ended up that my test Eclipse environment had the latest changes in the editor plugin, but the target project is looking in MAVEN_REPO\org\fornax\cartridges\org.fornax.cartridges.sculptor.dsl\1.4.0\org.fornax.cartridges.sculptor.dsl-1.4.0.jar's sculptordsl.xmi file.  

So even though my editor contained my latest changes and looked like everything was working, the parser was looking in the local Maven repo at the DSL Ecore model from three days ago!  

I ran maven install and things are finally working.  There was nothing wrong with my DSL changes after all.  Arg!

btw, why is it so hard to debug into oAW?  Most of the source from the Eclipse plugins directory don't match up with the jars in the Maven repo.  I checked out all the oaw4 code from their CVS repo and still had to debug blind a lot of the time.  Luckily I happened to see the source path of the xmi file and finally figured out the problem.

Thanks,
Polly


Patrik Nordwall wrote:
Hi, have you rebuilt sculptor-parent (mvn install)? Are you using the correct version number in your target project? Trunkow 1.5.0-SNAPSHOT
LightInTheBox - Buy quality products at wholesale price