Announcement Announcement Module
Collapse
No announcement yet.
[ERROR] declare @type is only supported at Java 5 compliance level or above Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • [ERROR] declare @type is only supported at Java 5 compliance level or above

    hi,every one.
    I just run the demo given by spring roo, and when I type perform tests, then I got following error, who can tell me how I can do? thanks!
    my java home is :

    C:\Users\Administrator>java -version
    java version "1.7.0"
    Java(TM) SE Runtime Environment (build 1.7.0-b147)
    Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)

    C:\Users\Administrator>echo %java_home%
    C:\Program Files\Java\jdk1.7.0

    ---------------------
    and my maven home is:
    C:\Users\Administrator>mvn -version
    Apache Maven 3.0.3 (r1075438; 2011-03-01 01:31:09+0800)
    Maven home: C:\maven\apache-maven-3.0.3\bin\..
    Java version: 1.7.0, vendor: Oracle Corporation
    Java home: C:\Program Files\Java\jdk1.7.0\jre
    Default locale: zh_CN, platform encoding: GBK
    OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"



    ~.domain.PizzaOrder roo> perform tests
    [INFO] Scanning for projects...
    [INFO]
    [INFO] ------------------------------------------------------------------------
    [INFO] Building pizzashop 0.1.0.BUILD-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO] n.PizzaOrder roo>
    [INFO] --- aspectj-maven-plugin:1.2:compile (default) @ pizzashop ---
    [ERROR] declare @type is only supported at Java 5 compliance level or above
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILUREroo>
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 5.229s
    [INFO] Finished at: Tue Nov 01 23:10:03 CST 2011
    [INFO] Final Memory: 6M/18M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.2:compile (default) on proje
    ct pizzashop: Compiler errors :
    [ERROR] error at declare @type: Topping: @Configurable;
    [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [ERROR] D:\workspace\pizza\src\main\java\com\demo\pizzasho p\domain\Topping_Roo_Configurable.aj:10:0:
    :0 declare @type is only supported at Java 5 compliance level or above
    [ERROR] error at declare @type: Topping: @Entity;
    [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [ERROR] D:\workspace\pizza\src\main\java\com\demo\pizzasho p\domain\Topping_Roo_Jpa_Entity.aj:17:0::0
    declare @type is only supported at Java 5 compliance level or above
    [ERROR] error at declare @type: PizzaOrder: @Configurable;
    [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [ERROR] D:\workspace\pizza\src\main\java\com\demo\pizzasho p\domain\PizzaOrder_Roo_Configurable.aj:10
    :0::0 declare @type is only supported at Java 5 compliance level or above
    [ERROR] error at declare @type: Base: @Entity;
    [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^
    [ERROR] D:\workspace\pizza\src\main\java\com\demo\pizzasho p\domain\Base_Roo_Jpa_Entity.aj:17:0::0 de
    clare @type is only supported at Java 5 compliance level or above
    [ERROR] error at declare @type: Pizza: @Entity;
    [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^
    [ERROR] D:\workspace\pizza\src\main\java\com\demo\pizzasho p\domain\Pizza_Roo_Jpa_Entity.aj:17:0::0 d
    eclare @type is only supported at Java 5 compliance level or above
    [ERROR] error at declare @type: Pizza: @Configurable;
    [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [ERROR] D:\workspace\pizza\src\main\java\com\demo\pizzasho p\domain\Pizza_Roo_Configurable.aj:10:0::0
    declare @type is only supported at Java 5 compliance level or above
    [ERROR] error at declare @type: Base: @Configurable;
    [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [ERROR] D:\workspace\pizza\src\main\java\com\demo\pizzasho p\domain\Base_Roo_Configurable.aj:10:0::0
    declare @type is only supported at Java 5 compliance level or above
    [ERROR] error at declare @type: PizzaOrder: @Entity;
    [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [ERROR] D:\workspace\pizza\src\main\java\com\demo\pizzasho p\domain\PizzaOrder_Roo_Jpa_Entity.aj:17:0
    ::0 declare @type is only supported at Java 5 compliance level or above
    [ERROR] -> [Help 1] roo>
    [ERROR] .PizzaOrder roo>
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] .PizzaOrder roo>
    [ERROR] For more information about the errors and possible solutions, please read the following arti
    cles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/d...utionException

  • #2
    Hi,

    I get exactly the same error, using JDK6, and trying to carry out the 'ten_minutes' demo.

    declare @type is only supported at Java 5 compliance level or above

    (I tried to change my JAVA_HOME with JDK5, and JDK7, and it still doesn't work). Is it something wrong with this version of Roo?
    Or could it be my Maven setup somehow?

    Comment


    • #3
      it's ok, but I do not know why!

      C:\Documents and Settings\administrator>mvn -version
      Apache Maven 3.0.3 (r1075438; 2011-03-01 01:31:09+0800)
      Maven home: C:\apache-maven-3.0.3-bin\apache-maven-3.0.3\bin\..
      Java version: 1.6.0_26, vendor: Sun Microsystems Inc.
      Java home: C:\Program Files\Java\jdk1.6.0_26\jre
      Default locale: zh_CN, platform encoding: GBK
      OS name: "windows xp", version: "5.1", arch: "x86", family: "windows"
      C:\Documents and Settings\administrator>mvn -version
      Apache Maven 3.0.3 (r1075438; 2011-03-01 01:31:09+0800)
      Maven home: C:\apache-maven-3.0.3-bin\apache-maven-3.0.3\bin\..
      Java version: 1.6.0_26, vendor: Sun Microsystems Inc.
      Java home: C:\Program Files\Java\jdk1.6.0_26\jre
      Default locale: zh_CN, platform encoding: GBK
      OS name: "windows xp", version: "5.1", arch: "x86", family: "windows"
      C:\Documents and Settings\administrator>roo
      ____ ____ ____
      / __ \/ __ \/ __ \
      / /_/ / / / / / / /
      / _, _/ /_/ / /_/ /
      /_/ |_|\____/\____/ 1.2.0.M1 [rev 1fa252f]


      Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.

      Comment


      • #4
        Still getting the problem running the 'ten_minutes' demo.

        Hi,

        I have just tried with JDK1.6update29, and Maven 3.0.3. (I deleted my repository, and effectively started fresh).
        (I am running on Windows xp version 5.1)
        I can ofcourse get roo 1.2.0 M1 up and running, and I go through the 'ten_minutes' demo mentioned in the reference documentation. All steps seem to complete OK, except when I come to run
        'perform tests', then at the end of much downloading of artifacts etc, I get the following error......
        (Please can someone help)...Can the last poster try and run the ten_minutes demo (it will only take up 10 minutes of your time ), and see if he gets further than me, or gets the same thing. Any other ideas? Thanks In Advance

        [ERROR] declare @type is only supported at Java 5 compliance level or above
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD FAILURE
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 9:25.547s
        [INFO] Finished at: Wed Nov 02 11:11:51 GMT 2011
        [INFO] Final Memory: 5M/21M
        [INFO] ------------------------------------------------------------------------
        [ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.2:compil
        e (default) on project tenminutes: Compiler errors :
        [ERROR] error at declare @type: Timer: @Entity;
        [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^
        [ERROR] C:\temp\ten_mins2\src\main\java\com\tenminutes\Tim er_Roo_Jpa_Entity.aj:1
        7:0::0 declare @type is only supported at Java 5 compliance level or above
        [ERROR] error at declare @type: Timer: @Configurable;
        [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        [ERROR] C:\temp\ten_mins2\src\main\java\com\tenminutes\Tim er_Roo_Configurable.aj
        :10:0::0 declare @type is only supported at Java 5 compliance level or above
        [ERROR] error at declare @type: ApplicationConversionServiceFactoryBean: @Config
        urable;
        [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
        [ERROR] C:\temp\ten_mins2\src\main\java\com\tenminutes\web \ApplicationConversion
        ServiceFactoryBean_Roo_ConversionService.aj:15:0:: 0 declare @type is only suppor
        ted at Java 5 compliance level or above
        [ERROR] -> [Help 1]
        [ERROR] o>
        [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
        ch.
        [ERROR] Re-run Maven using the -X switch to enable full debug logging.
        [ERROR] o>
        [ERROR] For more information about the errors and possible solutions, please rea
        d the following articles:

        Comment


        • #5
          yes

          I successed in company's machine, my last post is the version environment, but I really do not know why.

          ---

          Originally posted by rk1000 View Post
          Hi,

          I have just tried with JDK1.6update29, and Maven 3.0.3. (I deleted my repository, and effectively started fresh).
          (I am running on Windows xp version 5.1)
          I can ofcourse get roo 1.2.0 M1 up and running, and I go through the 'ten_minutes' demo mentioned in the reference documentation. All steps seem to complete OK, except when I come to run
          'perform tests', then at the end of much downloading of artifacts etc, I get the following error......
          (Please can someone help)...Can the last poster try and run the ten_minutes demo (it will only take up 10 minutes of your time ), and see if he gets further than me, or gets the same thing. Any other ideas? Thanks In Advance

          [ERROR] declare @type is only supported at Java 5 compliance level or above
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD FAILURE
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 9:25.547s
          [INFO] Finished at: Wed Nov 02 11:11:51 GMT 2011
          [INFO] Final Memory: 5M/21M
          [INFO] ------------------------------------------------------------------------
          [ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.2:compil
          e (default) on project tenminutes: Compiler errors :
          [ERROR] error at declare @type: Timer: @Entity;
          [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^
          [ERROR] C:\temp\ten_mins2\src\main\java\com\tenminutes\Tim er_Roo_Jpa_Entity.aj:1
          7:0::0 declare @type is only supported at Java 5 compliance level or above
          [ERROR] error at declare @type: Timer: @Configurable;
          [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          [ERROR] C:\temp\ten_mins2\src\main\java\com\tenminutes\Tim er_Roo_Configurable.aj
          :10:0::0 declare @type is only supported at Java 5 compliance level or above
          [ERROR] error at declare @type: ApplicationConversionServiceFactoryBean: @Config
          urable;
          [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
          [ERROR] C:\temp\ten_mins2\src\main\java\com\tenminutes\web \ApplicationConversion
          ServiceFactoryBean_Roo_ConversionService.aj:15:0:: 0 declare @type is only suppor
          ted at Java 5 compliance level or above
          [ERROR] -> [Help 1]
          [ERROR] o>
          [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
          ch.
          [ERROR] Re-run Maven using the -X switch to enable full debug logging.
          [ERROR] o>
          [ERROR] For more information about the errors and possible solutions, please rea
          d the following articles:

          Comment


          • #6
            I got another problem on ubuntu:


            roo> download accept terms of use
            Exception in thread "Spring Roo JLine Shell" java.lang.ExceptionInInitializerError
            at org.springframework.roo.uaa.UaaRegistrationService Impl.registerBundleSymbolicNameUse(UaaRegistration ServiceImpl.java:104)
            at org.springframework.roo.uaa.UaaRegistrationService Impl.flushIfPossible(UaaRegistrationServiceImpl.ja va:172)
            at org.springframework.roo.uaa.UaaCommands.acceptTou( UaaCommands.java:60)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:616)
            at org.springframework.roo.support.util.ReflectionUti ls.invokeMethod(ReflectionUtils.java:191)
            at org.springframework.roo.process.manager.ProcessMan agerHostedExecutionStrategy$1.callback(ProcessMana gerHostedExecutionStrategy.java:49)
            at org.springframework.roo.process.manager.internal.D efaultProcessManager.doTransactionally(DefaultProc essManager.java:184)
            at org.springframework.roo.process.manager.internal.D efaultProcessManager.execute(DefaultProcessManager .java:147)
            at org.springframework.roo.process.manager.ProcessMan agerHostedExecutionStrategy.execute(ProcessManager HostedExecutionStrategy.java:47)
            at org.springframework.roo.shell.AbstractShell.execut eCommand(AbstractShell.java:201)
            at org.springframework.roo.shell.jline.JLineShell.pro mptLoop(JLineShell.java:392)
            at org.springframework.roo.shell.jline.JLineShell.run (JLineShell.java:158)
            at java.lang.Thread.run(Thread.java:636)
            Caused by: java.lang.IllegalStateException: java.util.zip.ZipException: error in opening zip file
            at org.springframework.uaa.client.VersionHelper.getPr oductFromManifest(VersionHelper.java:189)
            at org.springframework.roo.uaa.UaaRegistrationService .<clinit>(UaaRegistrationService.java:38)
            ... 16 more
            Caused by: java.util.zip.ZipException: error in opening zip file
            at java.util.zip.ZipFile.open(Native Method)
            at java.util.zip.ZipFile.<init>(ZipFile.java:131)
            at java.util.jar.JarFile.<init>(JarFile.java:150)
            at java.util.jar.JarFile.<init>(JarFile.java:87)
            at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarF ile.java:90)
            at sun.net.http://www.protocol.jar.URLJarFile.g...rFile.java:66)
            at sun.net.http://www.protocol.jar.JarFileFacto...ctory.java:71)
            at sun.net.http://www.protocol.jar.JarURLConnec...tion.java:122)
            at sun.net.http://www.protocol.jar.JarURLConnec...tion.java:150)
            at java.net.URL.openStream(URL.java:1029)
            at org.springframework.uaa.client.VersionHelper.getPr oductFromManifest(VersionHelper.java:185)
            ... 17 more

            Comment


            • #7
              I'm having the same problems as the first poster had when I'm in STS-2.9.2-RELEASE. However, there's one additional twist. I have all of the error messages noted above with STS but works fine from the command line if I run the roo script "pizzashop.roo":


              Description Resource Path Location Type
              declare @type is only supported at Java 5 compliance level or above ApplicationConversionServiceFactoryBean_Roo_Conver sionService.aj /pizzashop/src/main/java/com/springsource/pizzashop/web line 24 Java Problem
              declare @type is only supported at Java 5 compliance level or above BaseDataOnDemand_Roo_Configurable.aj /pizzashop/src/test/java/com/springsource/pizzashop/domain line 11 Java Problem
              declare @type is only supported at Java 5 compliance level or above BaseDataOnDemand_Roo_DataOnDemand.aj /pizzashop/src/test/java/com/springsource/pizzashop/domain line 22 Java Problem
              declare @type is only supported at Java 5 compliance level or above BaseIntegrationTest_Roo_Configurable.aj /pizzashop/src/test/java/com/springsource/pizzashop/domain line 11 Java Problem
              declare @type is only supported at Java 5 compliance level or above BaseIntegrationTest_Roo_IntegrationTest.aj /pizzashop/src/test/java/com/springsource/pizzashop/domain line 21 Java Problem
              declare @type is only supported at Java 5 compliance level or above BaseIntegrationTest_Roo_IntegrationTest.aj /pizzashop/src/test/java/com/springsource/pizzashop/domain line 23 Java Problem
              declare @type is only supported at Java 5 compliance level or above BaseIntegrationTest_Roo_IntegrationTest.aj /pizzashop/src/test/java/com/springsource/pizzashop/domain line 25 Java Problem
              declare @type is only supported at Java 5 compliance level or above BaseRepository_Roo_Jpa_Repository.aj /pizzashop/src/main/java/com/springsource/pizzashop/repository line 18 Java Problem
              declare @type is only supported at Java 5 compliance level or above BaseServiceImpl_Roo_Service.aj /pizzashop/src/main/java/com/springsource/pizzashop/service line 16 Java Problem
              declare @type is only supported at Java 5 compliance level or above BaseServiceImpl_Roo_Service.aj /pizzashop/src/main/java/com/springsource/pizzashop/service line 18 Java Problem
              ... etc ...

              but it works fine from the command line if I run the mvn package tomcat:run. No errors and just works. What's wrong with STS settings?

              Comment


              • #8
                I found my problem in case anyone else runs into the same thing. This is a bug. What happened was that I created a new roo project from the dashboard and then ran the script pizzashop.roo. From the command line everything worked but inside eclipse I ended up needing to go to the dashboard and select "configure extensions" at the bottom of the dashboard and have eclipse find my maven directory. It listed the value but was not bound to the directory. As soon as I clicked it it found /Applications/springsource/apache-maven-3.0.4/ and it pulled down the dependencies correctly and the application worked. That cost me a few hours.

                Comment

                Working...
                X