Ah ha.  I finally got the debugger to work again.  The NullPointerException
is in DependencyConstraints in this method:

    private static void addDependency(Module fromModule, Module toModule,
Set<Module> dependencies) {
        if (!toModule.equals(fromModule)) {
            if (dependencies.add(toModule)) {
                // recursive call, when m not used before
                collectDependencies(toModule, dependencies);
            }
        }
    }

In that first "if" statement, "toModule" is null because I only imported
"a-model", but "a-model" has a reference to something in "b-model".  Since I
did not import "b-model", the system could not resolve that reference
correctly.  So my "app" project's design file, I need to import both
"a-model" and "b-model".  Is there a way to print out the Java stacktrace
when an Xtend template encounters an error?  oAW's default Xtend stacktrace
was a bit vague.

Having both imports gets me past this blocking error, but what I really want
is for the user to be able to just import the common "main-model.design"
file and have that Application's objects loaded automatically.  I'll keep
investigating.  This thread looks useful for creating a hook for loading
everything in the common project's "main-model.design":

http://www.openarchitectureware.org/forum/viewtopic.php?showtopic=9521

Thanks,
Polly



amphoras wrote:
> 
> Hi,
> 
> I have some questions about the "import" statement.  In my workspace, I
> have two projects.  I have a "common" project and my "app" project.  My
> app project has a design file that imports a design file from the "common"
> project.  I use an import statement like this:
> 
> import
> "platform:/resource/com.foo.common.model/src/main/resources/main-model.design"
> 
> I noticed that it isn't enough that the project "com.foo.common.model" is
> in my workspace.  It has to physically be in the same directory as my
> "app" project.  When I used Eclipse's "import project" function to import
> this project from another directory into my workspace, I got all kinds of
> errors complaining about not being able to find the design file that I
> want to import.  Is this to be expected?  It was confusing since I could
> see the project and oAW/Sculptor could not.
> 
> Then there was another weird problem.  In my "common" project, I have
> several design files like this:
> main-model.design: 
> 
> import
> "platform:/resource/com.foo.common.model/src/main/resources/a-model.design"
> import
> "platform:/resource/com.foo.common.model/src/main/resources/b-model.design"
> import
> "platform:/resource/com.foo.common.model/src/main/resources/c-model.design"
> 
> Application CommonModel {
>       basePackage=com.foo.common.model
> }
> 
> a-model, b-model, and c-model files each contain one ApplicationPart with
> one Module like this:
> 
> ApplicationPart A {
> 
>       Module a {
>        ...
>        }
> }
> 
> The Modules define enums, ValueObjects, BasicTypes, etc.
> 
> In my "app" project, I thought that I could just import my "common"
> main-model.design file, but it turns out to not be true.  The DSL editor
> shows validation errors unless I import the exact model.design file where
> the Domain Object is defined.  This is a bit unwieldy because now I need
> an import statement for each module design files.
> 
> So when I do import the correct module design file, then the validation
> error goes away, but I get a NullPointerException when I run the
> generator:
> 
> 0    INFO  WorkflowRunner     -
> --------------------------------------------------------------------------------------
> 453  INFO  WorkflowRunner     - openArchitectureWare 4.3.0, Build
> 20080508-1430PRD
> 453  INFO  WorkflowRunner     - (c) 2005-2008 openarchitectureware.org and
> contributors
> 453  INFO  WorkflowRunner     -
> --------------------------------------------------------------------------------------
> 453  INFO  WorkflowRunner     - running workflow: workflow.oaw
> 453  INFO  WorkflowRunner     - 
> 18473 INFO  StandaloneSetup    - Registering platform uri
> 'C:\projects\InforBUS\runtime-mdd3'
> 18707 INFO  CompositeComponent - Workflow: executing workflow
> sculptorworkflow.oaw in workflow.oaw:3
> 18707 INFO  CompositeComponent - Workflow: executing workflow
> org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw in
> sculptorworkflow.oaw:29
> 18707 INFO  CompositeComponent - ParserComponent(sculptordsl-parser)
> 20504 INFO  CompositeComponent - IfComponent: executing if
> org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw in
> org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw:9
> 20504 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 
> 20692 INFO  CompositeComponent - XtendComponent(dslTransformation):
> executing 'transformation::DslTransformation'
> 21583 INFO  CompositeComponent - CheckComponent: slot model check file(s):
> constraints/constraints 
> 239909 ERROR AbstractExpressionsUsingWorkflowComponent - Error in
> Component  of type org.openarchitectureware.check.CheckComponent: 
>       EvaluationException : java.lang.NullPointerException
>       constraints::constraints.chk[1378,30] on line 33
> 'this.checkCyclicDependencies()'
> 
> 244081 ERROR WorkflowRunner     - Workflow interrupted. Reason:
> EvaluationException : java.lang.NullPointerException
>       constraints::constraints.chk[1378,30] on line 33
> 'this.checkCyclicDependencies()'
> 
> 244081 ERROR WorkflowRunner     - ERROR in Component of type
> org.openarchitectureware.check.CheckComponent
>       java.lang.NullPointerException [boolean checkCyclicDependencies(Module
> module)]  in workflow: CheckComponent: slot model check file(s):
> constraints/constraints 
> 244081 ERROR WorkflowRunner     - ERROR in Component of type
> org.openarchitectureware.check.CheckComponent
>       java.lang.NullPointerException [this.checkCyclicDependencies()]  in
> workflow: CheckComponent: slot model check file(s):
> constraints/constraints 
> 
> My "app" project has an Entity that is referencing a ValueObject inside
> the "common" project, which seems like it should work.  I haven't changed
> any code in the DependencyConstraints.java file either.  Any idea why I am
> getting this error? 
> 
> Thanks,
> Polly
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-Sculptor--problems-importing-design-files-tp20236014s17564p20249808.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fornax-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to