Fornax-Platform View a printable version of the current page. Export Page as PDF
  2. Hello World Tutorial (CSC)
 
 Browse Space
General


Projects


Latest News
Latest News
(The 15 most recent blogposts in space Fornax-Platform.)


Global Reports
Find all pages that arent linked from anywhere.
Find all undefined pages.
Feed for new pages.
Added by Patrik Nordwall, last edited by Patrik Nordwall on Feb 16, 2010  (view change) show comment

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

Sculptor Hello World Tutorial

This hands-on tutorial will walk you through the steps of how to create a small application and explore it with some JUnit tests. This example is also used and extended in 3 other tutorials:

This is an introduction to Sculptor. A more extensive example is available in the Advanced Tutorial. If you would like to see something more exciting than running JUnit tests we can recommend the CRUD GUI Tutorial.

Before you start you must follow the instructions in the Installation Guide.

Table of Contents:

Part 1 - Setup Project

In this first part we will setup the project structure for maven and eclipse.

1. Use the following command (one line) to create a maven pom and file structure. You can change the groupId and artifactId if you like.

mvn archetype:generate -DarchetypeGroupId=org.fornax.cartridges -DarchetypeArtifactId=fornax-cartridges-sculptor-archetype-standalone \
-DarchetypeVersion=1.8.0 -DarchetypeRepository=http://www.fornax-platform.org/archiva/repository/releases/ 

Fill in groupId and artifactId:

Define value for groupId: : org.helloworld
Define value for artifactId: : helloworld
Define value for version:  1.0-SNAPSHOT: : 
Define value for package:  org.helloworld: : 

There will be warnings like this:

[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : 
template = archetype-resources/pom.xml [line 40,column 42] : ${fornax-oaw-m2.ver 
sion} is not a valid reference. 

Ignore these warnings and continue with next step if you see no errors.

2. In the new directory, run mvn eclipse:eclipse to create an Eclipse project with the same dependencies as in the pom.

3. Open Eclipse and import the project.

Part 2 - Generate Code

In this part we will write a Sculptor DSL file and generate code from it.

1. Modify the file named model.btdesign in the folder
src/main/resources/

2. Open the model.btdesign file with Sculptor DSL editor, double-click on it.
Add something like this to the design file.

model.btdesign
Application Universe {
    basePackage=org.helloworld

    Module milkyway {
        Service PlanetService {
            String sayHello(String planetName);
            protected findByExample => PlanetRepository.findByExample;
        }

        Entity Planet {
            String name key;
            String message;

            Repository PlanetRepository {
                findByExample;

            }
        }

    }
}

Try the code completion, error highlight and outline view.
It is a Module containing one Entity, with a Repository. The concepts are taken from Domain-Driven Design.

3. Run mvn clean install to generate code and build. The JUnit test will fail.

If you run maven from the command prompt you have to do a refresh in Eclipse. If you run maven as an external task in Eclipse it can refresh automatically.

4. Look at the generated code. In src and test folders the code is only generated once, and you can do manual changes. In generated and test/generated it is generated each time, i.e. don't touch.

Figure 1. File structure

Figure 2. Most important participating classes

Figure 3. Normal flow for sayHello

Part 3 - Fix Failing Test

In this step we will fix the failing JUnit test and add some hand written code.

1. Run PlanetServiceTest as JUnit Test. Red bar.
Adjust the test method testSayHello to something like this:

public void testSayHello() throws Exception {
    String greeting = planetService.sayHello(getServiceContext(), "Earth");
    assertEquals("Hello from Earth", greeting);
}

2. HSQLDB is used as in memory database when running JUnit. Add test data in src/test/resources/dbunit/PlanetServiceTest.xml

<?xml version="1.0" encoding="UTF-8"?>

<dataset>
  <PLANET id="1" name="Earth" message="Hello from Earth"
    LASTUPDATED="2006-12-08" LASTUPDATEDBY="dbunit" version="1" />
  <PLANET id="2" name="Mars" message="Hello from Mars"
    LASTUPDATED="2006-12-08" LASTUPDATEDBY="dbunit" version="1" />
</dataset>

3. Run, still red, but another failure.

4. Implement method sayHello in PlanetServiceImpl.

public String sayHello(ServiceContext ctx, String planetName) {
    Planet planetExample = new Planet(planetName);
    List<Planet> foundPlanets = findByExample(ctx, planetExample);
    Planet planet = foundPlanets.get(0);
    return planet.getMessage();
}

5. Run. Green bar!

6. Add one more test method to test a failure scenario.

public void testSayHelloError() throws Exception {
    try {
        planetService.sayHello(getServiceContext(), "pluto");
        fail("Excpected PlanetNotFoundException");
    } catch (PlanetNotFoundException e) {
        // as expected
    }
}

7. Add PlanetNotFoundException in model.btdesign.

String sayHello(String planetName) throws PlanetNotFoundException;

8. Regenerate with

mvn -Dfornax.generator.force.execution=true generate-sources

9. Add throws PlanetNotFoundException in PlanetServiceImpl.sayHello.

10. Fix the import of PlanetNotFoundException in the test class and run it, red bar.

11. Fix the test. You need to adjust sayHello method.

public String sayHello(ServiceContext ctx, String planetName)
        throws PlanetNotFoundException {
    Planet planetExample = new Planet(planetName);
    List<Planet> foundPlanets = findByExample(ctx, planetExample);
    if (foundPlanets.isEmpty()) {
        throw new PlanetNotFoundException("Didn't find any planet named " + planetName);
    }
    Planet planet = foundPlanets.get(0);
    return planet.getMessage();
}

12. Run. Green bar!

13. Run mvn clean install. Build success.

You can use mvn -o -npu install to speed up the builds, -o == offline, -npu == no plugin upate.
To regenerate you use mvn -Dfornax.generator.force.execution=true -o -npu generate-sources

Source

The complete source code for this tutorial is available in Subversion.

Web Access (read only):
http://fisheye3.cenqua.com/browse/fornax/trunk/cartridges/sculptor/sculptor-helloworld

Anonymous Access (read only):
https://fornax.svn.sourceforge.net/svnroot/fornax/trunk/cartridges/sculptor/sculptor-helloworld

Article Rating: 9.0 (4 voters)
2 3 4 5 6 7 8 9

Great Stuff. Nice job! Congratulations

very nice!  great example, you have my interest.  i am going to try this out

Posted by Anonymous at Jun 07, 2007 01:05 | Reply To This

mvn eclipse:eclipse is throwing error :

 C:\Third-Party\sculptor\helloworld>mvn eclipse:eclipse
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'eclipse'.
[INFO] ----------------------------------------------------------------------------
[INFO] Building EJB project for helloworld
[INFO]    task-segment: [eclipse:eclipse]
[INFO] ----------------------------------------------------------------------------
[INFO] Preparing eclipse:eclipse
Downloading: http://repo1.maven.org/maven2/org/fornax/toolsupport/fornax-oaw-m2-plugin/1.0.3/fornax-oaw-m2-plugin-1.0.3.pom
Downloading: http://repo1.maven.org/maven2/org/fornax/toolsupport/fornax-oaw-m2-plugin/1.0.3/fornax-oaw-m2-plugin-1.0.3.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: org.fornax.toolsupport
ArtifactId: fornax-oaw-m2-plugin
Version: 1.0.3

Reason: Unable to download the artifact from any repository

  org.fornax.toolsupport:fornax-oaw-m2-plugin:pom:1.0.3

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Thu Jun 07 14:42:47 EDT 2007
[INFO] Final Memory: 2M/4M
[INFO] ------------------------------------------------------------------------{{}}

Posted by Anonymous at Jun 07, 2007 20:46 | Reply To This

Please read the [Installation Guide]. There is described how to setup the Maven Profile to get the Fornax artifacts.

Thorsten 

Posted by Anonymous at Jun 08, 2007 00:14 | Reply To This

Thanks Thorsten, I missed that step.

Patrick, I think helloworld should be a from start to run. I think the above only shows till the build.

Also, the number of  steps  to get the helloworld work were too many.

 Hope this helps.

Posted by Anonymous at Jun 09, 2007 01:27 | Reply To This

This really rocks. Fantastic!

Posted by Anonymous at Nov 27, 2007 15:26 | Reply To This

mvn eclipse:eclipse is throwing :

Couldn't find a version in [1.0.0-v20070606, 1.0.0-v20070423] to match range [1.0.0,2.0.0)
  org.eclipse.equinox:app:jar:null

from the specified remote repositories:
  java.net (http://download.java.net/maven/1),
  fornax.repository (http://www.fornax-platform.org/m2/repository),
  central (http://repo1.maven.org/maven2/)

Posted by Anonymous at Dec 08, 2007 15:21 | Reply To This

fornax.repository must be placed before central repository in settings.xml.
See http://www.nabble.com/-fornax-repository--missing-equinox-dependency-to14252094s17564.html#a14259136
I have adjusted this in installation guide.

Hello - I ran into the same "Couldn't find a version in [1.0.0-v20070606, 1.0.0-v20070423] to match range [1.0.0,2.0.0) org.eclipse.equinox:app:jar:null" problem. A colleague pointed out this may be due to http://jira.codehaus.org/browse/MECLIPSE-208? Because a) I can't figure out how to your repository before the central repository in settings.xml in Maven 2.0.9 (the central doesn't seem to be explicitly listed anymore), b) this may not work trough our in-hose repository mirror proxy, c) depending on repository order is really bad practice, we had a to find a work-around for this. The best we could come up with is this procedure:

Download app-1.0.0-v20070606.pom and app-1.0.0-v20070606.jar from http://repo1.maven.org/eclipse/org/eclipse/equinox/app/1.0.0-v20070606/ into an empty local directory, remove the 'v' from the <version> in the POM and the filenames, and then "mvn install:install-file -Dfile=app-1.0.0-20070606.jar -DpomFile=app-1.0.0-20070606.pom". With that, on Maven 2.0.9, I was able to successfully depend on org.openarchitectureware / oaw-classic-workflow (not even using Fornax).

Regards,
Michael Vorburger, Odyssey Financial Technologies

PS: Why don't you allow Public Sign-Up to your Confluence?

Posted by Anonymous at Apr 17, 2008 20:31 | Reply To This

Hi guys

great work really

there's just a little Maven issue :

your released components inherit from a snapshot version of fornax-parent

first, this is in violation with maven practises

second, for those (like myself) that use entreprise repositories and proxies for central and fornax, this is a real pain to configure the system : typically my proxies for central and fornax do not handle snapshots and the user settings for maven do not specify repositories for snapshots

[INFO] Failed to resolve artifact.

GroupId: org.fornax
ArtifactId: fornax-parent
Version: 2-SNAPSHOT

Reason: Unable to download the artifact from any repository

  org.fornax:fornax-parent:pom:2-SNAPSHOT

sure i *could* change the settings

but in my opinion, i definitely shouldn't have to

is this a choice on your part or just a mistake nobody saw until now ?

thanks

David 

Posted by Anonymous at Dec 18, 2007 11:45 | Reply To This

All template files are encoded in ISO-8859-1 and workflow are configured accordingly
so far so good ...

the thing is when running an archetype on a unicode-enable OS (such as most recent linux distros), the XPand files are badly generated :
the archetype contains a file which content is iso-8859-1, creates an empty file which is utf-8 and write the content (in iso) without converting the char to unicode

=> the generations afterwards fail with unclear messages

here are some traces

drault@squat ~/work/workspace.sqli/fornax/helloworld2 $ file src/main/resources/templates/SpecialCases.xpt
src/main/resources/templates/SpecialCases.xpt: UTF-8 Unicode text, with CRLF line terminators
drault@squat ~/work/workspace.sqli/fornax/helloworld2 $ cat src/main/resources/templates/SpecialCases.xpt
?REM?
[...]
drault@squat ~/work/workspace.sqli/fornax/helloworld2 $ mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Business tier project for helloworld2
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [fornax-oaw-m2:run-workflow

Unknown macro: {execution}

]
[INFO] oAW Maven2 Plugin V2.0.0
0    INFO  WorkflowRunner     - --------------------------------------------------------------------------------------
169  INFO  WorkflowRunner     - openArchitectureWare 4.2.0, Build 200709162219NGT
170  INFO  WorkflowRunner     - (c) 2005-2007 openarchitectureware.org and contributors
171  INFO  WorkflowRunner     - --------------------------------------------------------------------------------------
172  INFO  WorkflowRunner     - running workflow: workflow.oaw
173  INFO  WorkflowRunner     -
1914 INFO  CompositeComponent - Workflow: executing workflow sculptorworkflow.oaw in workflow.oaw:3
1915 INFO  CompositeComponent - Workflow: executing workflow org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw in sculptorworkflow.oaw:28
1916 INFO  CompositeComponent - ParserComponent(sculptordsl-parser)
2320 INFO  CompositeComponent - IfComponent: executing if org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw in org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw:9
2321 INFO  ConditionalComponent - CheckComponent(sculptordsl-checker): expression dslModel.eAllContents.union(

Unknown macro: {dslModel}

) check file(s): org::fornax::cartridges::sculptor::dsl::GenChecks org::fornax::cartridges::sculptor::dsl::Checks
2385 INFO  CompositeComponent - XtendComponent(dslTransformation): executing 'transformation::DslTransformation'
2566 INFO  CompositeComponent - CheckComponent: slot model check file(s): constraints/constraints
2684 INFO  CompositeComponent - XtendComponent(modelTransformation): executing 'transformation::Transformation'
2761 INFO  CompositeComponent - CheckComponent: slot transformedModel check file(s): constraints/constraints
2795 INFO  CompositeComponent - Generator(generator): generating 'templates::Root::Root FOR transformedModel' => directory 'null'
2936 ERROR WorkflowRunner     - no viable alternative at character '¿' on line 2
org.openarchitectureware.xtend.parser.ParseException: no viable alternative at character '¿' on line 2
        at org.openarchitectureware.xpand2.parser.XpandParseFacade$3.handleError(XpandParseFacade.java:68)
        at org.openarchitectureware.xpand2.parser.XpandParseFacade$1.reportError(XpandParseFacade.java:45)
        at org.antlr.runtime.Lexer.nextToken(Lexer.java:119)
        at org.antlr.runtime.CommonTokenStream.fillBuffer(CommonTokenStream.java:119)
        at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:238)
        at org.openarchitectureware.xpand2.parser.XpandLocationAddingParser.start(XpandLocationAddingParser.java:46)
the only way i can fix this issue is to manually fix the characters by hand

anybody has a fix/workaround ? 

Posted by Anonymous at Dec 20, 2007 15:16 | Reply To This

This has been fixed in 1.3.0-SNAPSHOT (refer to http://www.fornax-platform.org/tracker/browse/CSC-174).

Axel

Posted by Anonymous at Jan 13, 2008 14:05 | Reply To This

Comment on "Part 2 - Generate Code": You suggest to test "code completion, error highlight and outline view".

When I tested code completion shortening "PlanetRepository.findByExample" to "Planet" I was able to get completion to "PlanetRepository". When I added a "." I was expecting to be able to choose "findbyExample" but the only entry to select was "DslServiceOperationDelegateMethodName". Am I missing something?

Axel 

Posted by Anonymous at Jan 13, 2008 13:37 | Reply To This

It is true, the code completion is not perfect. We are using the cross reference feature of oAW Xtext, which works fine, but this case is more complicated than what is supported by default. It might be possible to implement it, but we have considered it of minor importance.

Hi all,

when running mvn eclipse:eclipse i get a build error. See below

It seem the file sculptorworkflow.oaw is not generated. 

Would this file generated or have i to create it manually ?

Sven 

[INFO] [fornax-oaw-m2:run-workflow

Unknown macro: {execution}

]
[INFO] oAW Maven2 Plugin V2.0.0
0    INFO  WorkflowRunner     - --------------------------------------------------------------------------------------
16   INFO  WorkflowRunner     - openArchitectureWare 4.2.0, Build 200709162219NGT
16   INFO  WorkflowRunner     - (c) 2005-2007 openarchitectureware.org and contributors
16   INFO  WorkflowRunner     - --------------------------------------------------------------------------------------
31   INFO  WorkflowRunner     - running workflow: workflow.oaw
31   INFO  WorkflowRunner     -
1341 WARN  WorkflowCustomization - Cannot resolve keyword class org.openarchitectureware.xpand2.Generator
1341 WARN  WorkflowCustomization - Cannot resolve keyword class org.openarchitectureware.xpand2.Generator
1341 WARN  WorkflowCustomization - Cannot resolve keyword class org.eclipse.mwe.emf.Reader
1341 WARN  WorkflowCustomization - Cannot resolve keyword class org.eclipse.mwe.emf.Writer
1356 WARN  WorkflowCustomization - Cannot resolve keyword class org.openarchitectureware.xtend.XtendComponent
1356 WARN  WorkflowCustomization - Cannot resolve keyword class org.openarchitectureware.xtend.XtendComponent
1356 WARN  WorkflowCustomization - Cannot resolve keyword class org.openarchitectureware.xpand2.GeneratorAdvice
1356 WARN  WorkflowCustomization - Cannot resolve keyword class org.openarchitectureware.xtend.XtendAdvice
1388 WARN  WorkflowCustomization - Cannot resolve keyword class org.openarchitectureware.check.CheckComponent
1762 ERROR WorkflowRunner     - Couldn't load workflow fragment from sculptorworkflow.oaw [cartridgefile='sculptorworkflow.oaw' in workflow.oaw:3]
1762 ERROR WorkflowRunner     - Workflow interrupted because of configuration errors.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Generation failed
[INFO] ------------------------------------------------------------------------

Posted by Anonymous at Feb 21, 2008 15:39 | Reply To This

I have tried from scratch and I can't reproduce this problem, but the Fornax maven repository has been unstable the last few days. Maybe the archetype project creation failed. We can discuss your issue further at the forum: http://www.nabble.com/Fornax-Platform-f17564.html

Hello Patrick,

i think you are right. The Maven repository was the point of failure.

I had also get failure of  downloading various package from the repository.

But the failure above i could not direct to the repository. 

A next run of the maven command had fix the problem, sometimes.

After clean my local repository today everthing work fine. 

Thanks for your effort !

 (I had try make a new post at the forum, but there are some Problems. Sorry)

Sven 

Posted by Anonymous at Feb 25, 2008 21:17 | Reply To This

Hello Patrick,

I've tried hard today to get the archetype example run, but it didn't succeed. Tomcat tells me:

INFO: Deploying web application archive helloworld-web.war
25.02.2008 23:15:01 org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.springframework.web.context.ContextLoaderListener" is already configured for this context. The duplicate definition has been ignored.
25.02.2008 23:15:01 org.apache.catalina.core.StandardContext start
FATAL: Error listenerStart
25.02.2008 23:15:01 org.apache.catalina.core.StandardContext start
FATAL: Context [/helloworld-web] startup failed due to previous errors
25.02.2008 23:15:02 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
25.02.2008 23:15:02 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
25.02.2008 23:15:02 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/71  config=null
25.02.2008 23:15:02 org.apache.catalina.startup.Catalina start
INFO: Server startup in 14375 ms

Do you have any idea what's wrong? 

Olaf 

Posted by Anonymous at Feb 25, 2008 23:49 | Reply To This

Hi Olaf,
You are deploying in Tomcat according to the instructions in Developer's Guide. Hard to say what can be wrong. "duplicate definition" looks suspicions. I can try to reproduce it but will probably not be able to help you until next week. Maybe we can continue the thread at the forum, and someone else might be able to help: http://www.nabble.com/Fornax-Platform-f17564.html
/Patrik

Hello Patrik,

yes, I deployed according to the developer's guide, except:

  • To be able to call maven to install the project but skip the tests I needed to change the helloworld\pom.xml and the helloworld-web\pom.xml. In both cases the maven-surefire-plugin configuration has to be set to <skip>true</skip>.
  • The helloworld-web project doesn't contain a sculptor-generator.properties file like described in the tutorial, so I took the sculptor-gui-generator.properties.
  • When I created the database the tutorial didn't tell me how to call it, so in the later I had to adjust the name and password in helloworld-web\src\main\webapp\META-INF\context.xml and package again.

Do I need the ear module to build a Tomcat war project? It should be safe to remove the <module>../helloworld-ear</module> from helloworld-parent\pom.xml, isn't it?

I will concentrate on using the business tier now but your assistance in getting the web tier run would  be of great help for me, as I want to use sculptor for a quick start for a mission critical project.

Thanks,

Olaf 

Posted by Anonymous at Feb 26, 2008 09:49 | Reply To This

I have found a solution and explained it in the forum.

Hi, thanks! very nice. but, i have a little bug after last point (13):

......
[INFO] Compiling 2 source files to c:\tutorial\helloworld\target\test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: c:\tutorial\helloworld\target\surefire-reports

org.apache.maven.surefire.booter.SurefireExecutionException: Unable to instantia
te and execute Surefire; nested exception is java.lang.ClassNotFoundException: o
rg.apache.maven.surefire.Surefire
java.lang.ClassNotFoundException: org.apache.maven.surefire.Surefire
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(Isolat
edClassLoader.java:103)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Su
refireBooter.java:281)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.j
ava:818)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: There are test failures.
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:560)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:480)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:459)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)

 please, where is the problem ?

 thanks!

Ivan 

Posted by Anonymous at Apr 09, 2008 10:52 | Reply To This

Hard to say what it can be. I have a maven-surefire-plugin version 2.4.2 in my local maven repository. Try mvn -U clean install or remove your local maven repository, at least maven-surefire-plugin.

HI,

i have problem with List. in my model.design i have:

 abstract Entity Ent1

Unknown macro: {        databaseTable="xxxx"        cache..... - List<@UploadData> uploadDataList.....} abstract Entity UploadData{         databaseTable="upload_xml"         cache .... }

but in Hibernate HBM file i don`t have List but Set (and many-to-many ?):

<set cascade="all" name="uploadDataList" table="UPLOADDATASET_Ent1">
       

        <key column="Ent1"/>
        <many-to-many class="......UploadData" column="UPLOADDATASET"/>
    </set>
 

Why? i need only OneToMary relation (with LIST) between Ent1 and UploadData (1:N).

thank in advice.

Ivan

Posted by Anonymous at May 29, 2008 19:21 | Reply To This

If you define a bidirectional association List will work as you expect.

  Entity Planet {
    - List<@Moon> moons opposite planet;

If you don't define opposite it will be treated as a many-to-many association because that is the more general case and it feels wrong to add a foreign key in Moon table to Planet, even though it doesn't have a dependency in that direction.

For many-to-many associations List collection type is not supported. We didn't think List would be a good design choice for many-to-many.

You can add a feature request in the Tracker if you think there is a need for change of this.

It is now possible to define foreign key usage in Moon, instead of many-to-many relation table.
Use the inverse keyword.

Entity Planet {
    - List<@Moon> moons inverse;

Well done tutorial (features demonstrated in a few steps)! great!

I was a bit disturbed by the fact that the Project did not compile in Eclipse. Luckily I found rapidly how to fix it and added the subfolders of the 'generated' as src-folders. A small sentence about that would have made the whole experience perfect!

 Cheers

André

Posted by Anonymous at Jun 09, 2008 22:47 | Reply To This

Thanks for you positive feedback.
It should not be necessary to add src folders manually.
I have verifed by running the following 3 commands and thereafter importing into eclipse.

mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create -DarchetypeGroupId=org.fornax.cartridges -DarchetypeArtifactId=fornax-cartridges-sculptor-archetype-standalone -DarchetypeVersion=1.3.1 -DremoteRepositories=http://www.fornax-platform.org/m2/repository -DgroupId=org.helloworld -DartifactId=helloworld

cd helloworld

mvn install

mvn eclipse:eclipse

In Part 3, Step 9, you need to also add throws PlanetNotFoundException to PlanetServiceTest.testSayHello() for the test to compile.

-Leif Arne Storset

Posted by Anonymous at Jun 26, 2008 02:23 | Reply To This

Hi,

i've have a similar problem as some threads above. When running mvn eclipse:eclipse i get an error message saying:

Project ID: org.fornax.toolsupport:fornax-oaw-m2-plugin:maven-plugin:2.0.0
Reason: Cannot find parent: org.fornax:fornax-parent for project: org.fornax.too
lsupport:fornax-oaw-m2-plugin:maven-plugin:2.0.0

 I've searched google and found an entry on the mailing list (http://www.mail-archive.com/fornax-developer@lists.sourceforge.net/msg00230.html but i didn't helped me much)

 My environment is eclipse europa (oaw 4.3, Sculptor DSL 1.4.0 ), maven 2.0.5

 Do you have any idea? I don't have any expierence with maven so i don't know what the message means

Posted by Anonymous at Jul 13, 2008 12:41 | Reply To This

I have forgotten to add the error message that oocurs previously.It seems that maven is not able to download something:

[INFO] Preparing eclipse:eclipse
Downloading: http://www.fornax-platform.org/m2/repository/org/fornax//org/fornax
/fornax-parent/2-SNAPSHOT/fornax-parent-2-SNAPSHOT.pom
[WARNING] Unable to get resource 'org.fornax:fornax-parent:pom:2-SNAPSHOT' from
repository fornax.plugin.repository (http://www.fornax-platform.org/m2/repositor
y/org/fornax/)

Posted by Anonymous at Jul 13, 2008 12:57 | Reply To This

I think this problem is due to that the fornax maven repository has moved. In the pom.xml in your project (generated by the archetype) there is a definition of the maven repositories. Change that and replace with the repositories described in this forum thread.

Hello,

I have a similar problem with mvn eclipse:exlipse :

[INFO] Preparing eclipse:eclipse
Downloading: http://fornax-platform.org/archiva/repository/org/fornax/fornax-par
ent/2-SNAPSHOT/fornax-parent-2-SNAPSHOT.pom
Downloading: http://fornax-platform.org/archiva/repository/org/fornax/fornax-par
ent/2-SNAPSHOT/fornax-parent-2-SNAPSHOT.pom
Downloading: http://download.java.net/maven/1/org.fornax/poms/fornax-parent-2-SN
APSHOT.pom
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).

It seems to try downloading from http://download.java.net/maven/1, but there is no org.fornax on that site?

KF 

Posted by Anonymous at Jul 15, 2008 14:11 | Reply To This

Thanks, your change to
-DarchetypeVersion=1.4.1-SNAPSHOT
solved it.

KF

Posted by Anonymous at Jul 20, 2008 20:38 | Reply To This

 when i connect source code from eclipse subversion,show failed!!!!!!!!!!!!!!!!!!!

RA layer request failed
svn: OPTIONS of 'https://fornax.svn.sourceforge.net/svnroot/fornax/trunk/cartridges/sculptor/sculptor-helloworld': Could not read status line: ................... (https://fornax.svn.sourceforge.net)

Posted by Anonymous at Jul 31, 2008 08:15 | Reply To This

Is there any way to generate Sculptor DSL from XMI? I would like to use Sculptor Cartidge using a UML CASE tool (magicdraw, enterprise architect, rose ...). Is that possible??

Thanks

Pau

Posted by Anonymous at Nov 04, 2008 14:30 | Reply To This

That would be possible. The DSL is pure text. A better approach would be create a transformation from your xmi (uml) to sculptor meta model. Read here: http://fornax-platform.org/cp/display/fornax/7.+Developer%27s+Guide+%28CSC%29#7.Developer%27sGuide%28CSC%29-Transformations

After following the installation guide I tried to execute the first step (mvn org.apache.maven...). Is it important in which directory the command is executed (using the commandline prompt)? After I have no experiences using Maven, therefore I'm not sure whether I'm using it the wrong way.

Anyway I get the following error message:

...

[INFO] snapshot org.fornax.cartridges:fornax-cartridges-sculptor-archetype-stand
alone:1.6.0-SNAPSHOT: checking for updates from id0
Downloading: http://www.fornax-platform.org/archive/repository/snapshots//org/fo
rnax/cartridges/fornax-cartridges-sculptor-archetype-standalone/1.6.0-SNAPSHOT/f
ornax-cartridges-sculptor-archetype-standalone-1.6.0-SNAPSHOT.jar
[INFO] Unable to find resource 'org.fornax.cartridges:fornax-cartridges-sculptor
-archetype-standalone:jar:1.6.0-SNAPSHOT' in repository id0 (http://www.fornax-p
latform.org/archive/repository/snapshots/)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error creating from archetype

Embedded error: Archetype does not exist.
Unable to download the artifact from any repository

Can you please tell me what I did wrong? Thanks!

Btw. I checked out maven-launcher as written in the installation guide. But I don't know how to use it to install the sculptor stuff.

Posted by Anonymous at Apr 24, 2009 17:56 | Reply To This

The generated pom depends on aspectweaver however the mvn eclipse:eclipse won't insert the aspectweaver.jar dependency into the .classpath.

This can be solved by setting ajdtVersion to none in the eclipse plugin. see: http://www.nabble.com/mvn-eclipse:eclipse---aspecjrt-not-added-to-.classpath-td21456212.html

Tib

Posted by Anonymous at May 14, 2009 16:52 | Reply To This

I do not get any concrete test class. I do get a PlanetServiceTestBase interface though. Do I miss something?

Thanks for your advices!

Posted by Anonymous at Sep 23, 2009 00:11 | Reply To This

Look in src/main/java

hi,
please help to connect my projet to oracle database ande deploye it itno Tomcat.
thanks.

Posted by Anonymous at Oct 14, 2009 19:56 | Reply To This

Please describe your problem more, and do that in the forum.

Define the following in your sculptor-generator.properties:

deployment.applicationServer=Tomcat
db.product=oracle