Announcement Announcement Module
Collapse
No announcement yet.
Problem creating a single Roo project that uses both Mongo and JPA/MySQL Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem creating a single Roo project that uses both Mongo and JPA/MySQL

    Hi,

    I am attempting to create a Roo project that uses both MongoDB and JPA/MySQL. I have successfully created projects that use either MongoDB or JPA/MySQL. But I have not used them both together. I need to know if it is possible to create a single Roo project that uses both Mongo and JPA/MySQL.

    When I attempt to use the following commands, I get an error:

    Command 'mongo setup --databaseName pizza --host localhost --port 27017' was found but is not currently available

    -----

    roo> script note-setup.txt
    project --topLevelPackage org.demo
    Created ROOT/pom.xml
    Created SRC_MAIN_RESOURCES
    Created SRC_MAIN_RESOURCES/log4j.properties
    Created SPRING_CONFIG_ROOT
    Created SPRING_CONFIG_ROOT/applicationContext.xml

    jpa setup --provider HIBERNATE --database MYSQL --jndiDataSource java:jboss/datasources/PizzaDS
    Created SPRING_CONFIG_ROOT/jndi.properties
    Please update your JNDI details in src/main/resources/META-INF/spring/jndi.properties.
    Updated SPRING_CONFIG_ROOT/applicationContext.xml
    Created SRC_MAIN_RESOURCES/META-INF/persistence.xml
    Updated ROOT/pom.xml [added dependencies mysql:mysql-connector-java:5.1.18, org.hibernate:hibernate-core:4.1.8.Final, org.hibernate:hibernate-entitymanager:4.1.8.Final, org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final, commons-collections:commons-collections:3.2.1, org.hibernate:hibernate-validator:4.3.1.Final, javax.validation:validation-api:1.0.0.GA, cglib:cglib-nodep:2.2.2, javax.transaction:jta:1.1, org.springframework:spring-jdbc:${spring.version}, org.springframework:spring-orm:${spring.version}, commons-pool:commons-pool:1.5.6, commons-dbcp:commons-dbcp:1.3]

    entity jpa --class ~.domain.Pizza
    Created SRC_MAIN_JAVA/org/demo/domain
    Created SRC_MAIN_JAVA/org/demo/domain/Pizza.java
    Created SRC_MAIN_JAVA/org/demo/domain/Pizza_Roo_Configurable.aj
    Created SRC_MAIN_JAVA/org/demo/domain/Pizza_Roo_ToString.aj
    Created SRC_MAIN_JAVA/org/demo/domain/Pizza_Roo_Jpa_ActiveRecord.aj
    Created SRC_MAIN_JAVA/org/demo/domain/Pizza_Roo_Jpa_Entity.aj

    field string --fieldName name --notNull --sizeMin 2
    Updated SRC_MAIN_JAVA/org/demo/domain/Pizza.java
    Created SRC_MAIN_JAVA/org/demo/domain/Pizza_Roo_JavaBean.aj
    field date --fieldName dateCreated --type java.util.Date
    Updated SRC_MAIN_JAVA/org/demo/domain/Pizza.java
    Updated SRC_MAIN_JAVA/org/demo/domain/Pizza_Roo_JavaBean.aj

    mongo setup --databaseName notes --host localhost --port 27017

    Command 'mongo setup --databaseName notes --host localhost --port 27017' was found but is not currently available (type 'help' then ENTER to learn about this command)

    Script required 7.051 seconds to execute
    Script execution aborted

    -----

    My full script file looks like this:

    project --topLevelPackage org.demo

    jpa setup --provider HIBERNATE --database MYSQL --jndiDataSource java:jboss/datasources/PizzaDS

    entity jpa --class ~.domain.Pizza

    field string --fieldName name --notNull --sizeMin 2
    field date --fieldName dateCreated --type java.util.Date

    mongo setup --databaseName notes --host localhost --port 27017

    entity mongo --class ~.domain.Note

    field string --fieldName name --notNull --sizeMin 2
    field string --fieldName category

    repository mongo --interface ~.repository.NoteRepository --entity ~.domain.Note

    service --interface ~.service.NoteService --entity ~.domain.Note

    web mvc setup

    web mvc all --package ~.web
Working...
X