Discussions

News: Announcing Open-source EJB/Struts Code Generator ModelJ

  1. ModelJ is an open-source RAD (Rapid Application Development) tool that uses code generation to create complete J2EE apps using the Struts and EJB, deployable on jBoss. It outputs EJB 2.x deployment descriptors and session and entity beans, with business delegates accessible via Struts.

    Check out http://modelj.sourceforge.net.

    Press Release
    --------------------------
    ModelJ is an open-source RAD (Rapid Application Development) tool that uses code generation to create complete J2EE applications using the Struts and EJB frameworks. With ModelJ, one is only a few steps away from a database-driven web site readily deployable to JBoss, the leading open-source J2EE Application Server. ModelJ uses proven design patterns to ensure a robust, easy-to-maintain design.

    ModelJ can also be used as a learning tool for J2EE and JBoss. It outputs EJB 2.x deployment descriptors and session and entity beans, creating business delegates that are accessible via Struts (a Swing-based administration interface is planned). JBoss-QL is used for all database queries.

    The ModelJ generator uses Castor for XML marshalling and Velocity/Texen to perform the actual code generation. The open-source license is GNU/GPL.

    For more information, visit http://modelj.sourceforge.net

    Threaded Messages (21)

  2. Missing something...[ Go to top ]

    The screen that was generated on the source forge main page didn't reflect the true structure of the graph of objects represented in the UML diagram. Are there other screens that incorporate the nested graph components?
  3. Missing something...[ Go to top ]

    Actually, the nested components are accessible from within their parent components.. in the screenshot, for instance, the user is viewing a Role, and the associated User entities are shown below it (and you can add a new User to the Role from that same screen). This represents a one-to-many relationship.

    Many-to-many relationships are treated differently, in that both participants in the relationship are shown in the left menu bar.
  4. Castor jdo[ Go to top ]

    Hi all
    Is there any opensource UML modeller/source generator for castor jdo?
    thanks
    Faisal
  5. This seems to be a nice tool.

    While I think all the J2EE tools that are developed are great, as a beginner I am extremely confused as which framework/tool to actually use, especially since most of the open source projects move at such an extreme pace and updates to "official" technology from Sun also comes every 6 months.

    What should I use for my business objects, and in which combinations?
    EJB, ADO, JDO, hibernate, CMP, MiddleGen...

    While there are books dealing with these questions, I think they are often outdated and the new technology couldn't have been tested thoroughly anyway.
  6. Hi,

    in the second step of your development proces on the sf homepage, you write:
    > II. Implement the design in ModelJ xml
    I don't see adding attributes to your classes as "implementing the design". I don't have the time to look into detail to your tool for the moment, so could you please clarify the design abilities of your tool? The reason for asking is that I'm working on improving the design of existing code (refactoring) with code generation technology. I'm already looking to ArcStyler, OptimalJ and ObjectAssembler and am curious for other tools.

    Another question: what about reverse engineering? On this topic, can somebody tell about his experiences with (or just the status of) reverse xdoclet?

    Kind regards and succes with your tool,
    Pieter Van Gorp.
  7. Another code generation tool[ Go to top ]

    Hi Pieter Van Gorp.

    You asked for other code generation tools. You should have a look at innoQ's iQgen (http://iqgen.innoq.org). It's a commercial template based code generator and might be interesting to you.

    Ludger Springmann
  8. Another code generation tool[ Go to top ]

    Hi robert kraus,
    U don't have to use all of these to be a good j2ee developer. Middlegen generates CMP easily from an SQL provided. Still u have to finish your entity beans manually. Castor jdo and Hibernate do the same thing. So u should use one of them. If u check the last blueprints from Sun - which i think is fast and practical- u will notice that there is no need for a transactionl component such as EJB or JDO. Concerning frameworks I advice u to check only the popular and most used , then u choose which one suits your need: struts and WAF are good frameworks
    Faisal
  9. Error when deploy[ Go to top ]

    Hi,

    I have try today to deploy the sample application
    but it's didn't work.

    After doing a run sample.xml I go to the generated_code
    directory then I run ant to build ejb.jar file.

    But I got some nasy errors like : javax.ejb.* didn't find.

    I will apologize if anyone can tell me what's wrong.

    Chears.

    --
    Alexandre Jaquet
  10. Hi Alexandre Jaquet,

    I had the same trouble. The fix (that worked for me) was to manually copy these two files from my JBoss install:

    my_jboss_home/server/all/lib/javax.servlet.jar
    my_jboss_home/server/all/lib/jboss-j2ee.jar

    into the directory:

    my_modelj-0.65_home/generated-code/lib

    Then the compilation (via ant) successfully completed.

    Can anyone shed any light on whether there is a better way to get it working e.g. can the ant build files be tweaked somehow?

    thanks.
  11. Thanks Adrian it's working fine :)

    Chears.

    --
    Alexandre Jaquet
  12. Great tool, but has one disadvantage: doesn't using XDoclet to generate sources of connected classes.
    This make difficult to maintenance an application and adjust it to later needs.
  13. java:/MySqlDS[ Go to top ]

    Hi,

    after deploying the generated file into JBoss, JBoss complains that it is missing the datasource. I am not that familiar with JBoss (having used BEA all the times) and so I don't know, where I have to configure the datasource, and how. Can someone help me here? I am using JBoss 3.0.4 (tried 3.0.0 as well). Thanx.

    André
  14. java:/MySqlDS[ Go to top ]

    In jboss 3.0.0, scan the {JBOSS.HOME}/docs/examples/jca folder and adjust mysql-service.xml to its config of DB. When this config file are correct, copy the xml file to {JBOSS.HOME}/server/default/deploy folder. That's all.
  15. Hi I can't find the good way to map correctly my database
    I've a table student a table exercice and a relation table
    have_done. I have transform my relation table into a table
    because I have the cardinality 0..n and 0..n.

    What I have to do in my xml config file :

     <bean>
      <name>have_done</name>
      <attribute>
        <primary-key>no</primary-key>
        <name>date_validation</name>
        <type>date</type>
      </attribute>
     <attribute>
       <name>ref_exercice</name>
       <type>Exercice</type>
     </attribute>
     <attribute>
      <name>ref_student</name>
      <type>Student</type>
      </attribute>
      </bean>

    Or add integer reference like I have done in my database ?
    ...
      <name> ref_exercice</name>
      <type> integer</type>
    ...
      <name> ref_student</name>
      <type> integer</type>

    Thanks for your advice.

    --
    Alexandre Jaquet
  16. configuration for postgresql ???[ Go to top ]

    Hi I didn't understand what mean the

    <type-mapping></type-mapping> property.

    Is that represent the
      <attribute name="JndiName">PostgresDS</attribute>
    set in the postgres-service.xml ?

    Maybe somebody can explain me clearly.

    Thanks in advance.

    --
    Alexandre Jaquet
  17. I just report a bug to Tom Tessier about
    the use of ModelJ running on PostgreSQL 7.3
    on cygwin.

    I just deploy exactly the same ejb.jar package on
    JBoss 3.0.4 with mySQL and it's working fine.

    I use the JDBC 7.1-1.3 for postgreSQL.

    Chears.

    --
    Alexandre Jaquet
  18. Error when deploy2[ Go to top ]

    I have an error, when i deploy the war file. the message is
    "java.lang.ClassNotFoundException: No ClassLoaders found for: org.apache.struts.action.ActionFormBean
    at org.jboss.mx.loading.LoadMgr.beginLoadTask(LoadMgr.java:138)
    at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:140)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:252)
    at org.apache.commons.digester.Digester.startElement(Digester.java:1237)
    at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1488)
    at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
    at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
    at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
    at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
    at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
    at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
    at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
    at org.apache.commons.digester.Digester.parse(Digester.java:1514)
    at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1354)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:471)
    at org.apache.struts.tiles.ActionComponentServlet.init(ActionComponentServlet.java:52)
    at javax.servlet.GenericServlet.init(GenericServlet.java:256)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:924)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3341)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3534)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
    at org.jboss.web.catalina.EmbeddedCatalinaService41.createWebContext(EmbeddedCatalinaService41.java:432)
    at org.jboss.web.catalina.EmbeddedCatalinaService41.performDeploy(EmbeddedCatalinaService41.java:306)
    at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:300)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:807)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585)
    at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
    at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
    at $Proxy4.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:435)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:656)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:212)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:225)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:202)
    2003-01-10 10:45:13,506 ERROR [org.jboss.web.localhost.Engine] StandardContext[/web]: Servlet /web threw load() exception
    javax.servlet.ServletException: Parsing error processing resource path /WEB-INF/struts-config.xml
    at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1359)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:471)
    at org.apache.struts.tiles.ActionComponentServlet.init(ActionComponentServlet.java:52)
    at javax.servlet.GenericServlet.init(GenericServlet.java:256)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:924)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3341)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3534)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
    at org.jboss.web.catalina.EmbeddedCatalinaService41.createWebContext(EmbeddedCatalinaService41.java:432)
    at org.jboss.web.catalina.EmbeddedCatalinaService41.performDeploy(EmbeddedCatalinaService41.java:306)
    at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:300)
    at org.jboss.deployment.MainDeployer.start(MainDeployer.java:807)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585)
    at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
    at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
    at $Proxy4.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:435)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:656)
    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:212)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:225)
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:202)"


    Sorry about my english!!!

    Thanks
    Marcelo Hack
  19. Error when deploy2[ Go to top ]

    When I've try to deploy to JBoss I have copy the ear file.
    I copy the struts.jar file to JAVA_HOME/jre/lib/ext.
    But I'm still having a ClassLoader exception.

    I have read so many posts on JBoss forum about Struts errora and try some solutions but I didn't find any one that work.

    --
    Alexandre Jaquet
  20. Error when deploy2[ Go to top ]

    Jasquet, thanks for your help!!!

    Marcelo Hack
  21. Error when deploy2[ Go to top ]

    JBoss 3.0.4 run correctly with the jdk_1_3_1.

    Chears.

    --
    Alexandre Jaquet
  22. Error when executing run of ModelJ[ Go to top ]

    I am getting the following errors when I execute run from the command prompt can anyone help me out?

    ----Command Prompt------------------------------------------------------
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\modelj-0.65-bin>run

    C:\modelj-0.65-bin>ant -Dmodelj-xml-filename=
    Buildfile: build.xml

    copyLayout:
         [copy] Copying 43 files to C:\modelj-0.65-bin\generated-code

    genEJB:
         [echo] +------------------------------------------+
         [echo] | |
         [echo] | Generating EJB + Web files! |
         [echo] | |
         [echo] +------------------------------------------+

    BUILD FAILED
    java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedPropertie
    s
            at java.lang.Class.getMethods0(Native Method)
            at java.lang.Class.getMethods(Class.java:742)
            at org.apache.tools.ant.IntrospectionHelper.<init>(IntrospectionHelper.j
    ava:207)
            at org.apache.tools.ant.IntrospectionHelper.getHelper(IntrospectionHelpe
    r.java:384)
            at org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:296)
            at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
    urable.java:233)
            at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
    urable.java:202)
            at org.apache.tools.ant.Task.maybeConfigure(Task.java:257)
            at org.apache.tools.ant.Task.perform(Task.java:316)
            at org.apache.tools.ant.Target.execute(Target.java:309)
            at org.apache.tools.ant.Target.performTasks(Target.java:334)
            at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
            at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
            at org.apache.tools.ant.Main.runBuild(Main.java:610)
            at org.apache.tools.ant.Main.start(Main.java:196)
            at org.apache.tools.ant.Main.main(Main.java:235)

    Total time: 3 seconds
    java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedPropertie
    s
            at java.lang.Class.getMethods0(Native Method)
            at java.lang.Class.getMethods(Class.java:742)
            at org.apache.tools.ant.IntrospectionHelper.<init>(IntrospectionHelper.j
    ava:207)
            at org.apache.tools.ant.IntrospectionHelper.getHelper(IntrospectionHelpe
    r.java:384)
            at org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:296)
            at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
    urable.java:233)
            at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
    urable.java:202)
            at org.apache.tools.ant.Task.maybeConfigure(Task.java:257)
            at org.apache.tools.ant.Task.perform(Task.java:316)
            at org.apache.tools.ant.Target.execute(Target.java:309)
            at org.apache.tools.ant.Target.performTasks(Target.java:334)
            at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
            at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
            at org.apache.tools.ant.Main.runBuild(Main.java:610)
            at org.apache.tools.ant.Main.start(Main.java:196)
            at org.apache.tools.ant.Main.main(Main.java:235)
    org/apache/commons/collections/ExtendedProperties
    C:\modelj-0.65-bin>