TeaBee
TeaBee

Reputation: 99

Running Spring Roo PIzzashop sample

I did work with Spring but am new to Spring Roo, so I have downloaded 1.3.2 and wanted to run the pizzashop sample. I have maven 3.2.1, JDK8 installed. I started Roo from the command line and wanted to execute "script pizzashop.roo" in a newly created directory, however I got several errors:

  1. tailor activate web-simple failed, as I do not have a web-simple config. I solved this by removing the line, after not finding a tailor.xml in the release bundle or via Google.
  2. perform tests failed, because "failed to load ApplicationContext". How can I solve the issue?
  3. I ran perform package, which was successful, after which I tried mvn tomcat:run from the command line, which failed with:

    2015-11-27 09:10:03,645 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to read candidate component class: file [c:\development\components\roo_pizza\target\classes\com\springsource\pizzashop\domain\PizzaOrderPk.class]; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: class path resource [java/io/Serializable.class]

To me it looks like Java 8 is not supported, although I read Roo 1.3 added Java8 support. (I have no ideai for the ApplicationContext issue.) I wanted to do a demonstration of Roo next week, any help is appreciated.

Thanks

TeaBee

Upvotes: 0

Views: 370

Answers (4)

TeaBee
TeaBee

Reputation: 99

So, here are the modifications I did, to enable Java8. java set to 1.8 aspectj set to 1.8.3 sprint set to 4.2.3.RELEASE

complains about:

The method installFormatters(FormatterRegistry) of type ApplicationConversionServiceFactoryBean must override or implement a supertype method in ApplicationConversionServiceFactoryBean.java

since installFormatters has been deprecated in Spring 4. Commented-out the installFormatters Override part.

upgraded aspectj-maven-plugin to 1.8.3 added 1.8 to pom.xml to aspectj-maven-plugin

[WARNING] advice defined in org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl has not been applied [Xlint:adviceDidNotMatch]
c:\development\components\roo_pizza\org\springframework\mock\staticmock\AnnotationDrivenStaticEntityMockingControl.aj:117

[INFO] 
[INFO] --- aspectj-maven-plugin:1.8:test-compile (default) @ pizzashop ---
[INFO] Showing AJC message detail for messages of types: [error, warning, fail]
[WARNING] this affected type is not exposed to the weaver: com.springsource.pizzashop.domain.PizzaOrderPk [Xlint:typeNotExposedToWeaver]
c:\development\components\roo_pizza\org\springframework\beans\factory\aspectj\AnnotationBeanConfigurerAspect.aj:82

[WARNING] this affected type is not exposed to the weaver: com.springsource.pizzashop.domain.PizzaOrderPk [Xlint:typeNotExposedToWeaver]
c:\development\components\roo_pizza\org\springframework\beans\factory\aspectj\AnnotationBeanConfigurerAspect.aj:88

[WARNING] this affected type is not exposed to the weaver: com.springsource.pizzashop.domain.PizzaOrderPk [Xlint:typeNotExposedToWeaver]
c:\development\components\roo_pizza\org\springframework\beans\factory\aspectj\AbstractInterfaceDrivenDependencyInjectionAspect.aj:100

I am still uncomfortable with the warnings, but tests pass and seemingly PizzaShop runs.

Upvotes: 0

TeaBee
TeaBee

Reputation: 99

So, after upgrading to Java8, roo console complains about not being able to load ApplicationContext. Tried adding:

<resources>
    <resource>
        <filtering>true</filtering>
        <directory>src/test/resources</directory>
        <includes>
            <include>**/*.properties</include>
        </includes>
        <excludes>
            <exclude>**/*local.properties</exclude>
        </excludes>
    </resource>
    <resource>
        <directory>src/main/resources</directory>
        <includes>
            <include>**/*.properties</include>
            <include>**/*.xml</include>
        </includes>
    </resource>
</resources>

to pom.xml, but did not help.

Upvotes: 0

TeaBee
TeaBee

Reputation: 99

So, I started fixing things: First, I downgraded to Java7, then upgraded to maven 3.3.9. At first the roo command "perform tests" failed to run. This needed fixing by copying the mvnXXX.cmd files (in maven\bin) to mvnXXX.bat. Looks like roo is looking for "bat" files. Now, everything ran fine. I also noticed, that by running mvn tomcat:run, Catalina 6.0.29 is started. So I changed to mvn tomcat7:run. I will revert to Java8, and post the results.

Upvotes: 0

Kuloman
Kuloman

Reputation: 1

Spring Roo is a very flexible tool, but this means it is also complicated and cumbersome. More than 50% when I use it, I have to solve issues manually to make it run. But on the other side you have a powerful tool. If you are not comitted to work with spring, I would suggest to desire if you can use a more lightweight and more stable tool like JBoss Forge or generjee. Or check springfuse if you really need spring.

Upvotes: 0

Related Questions