10 Replies Latest reply on Dec 7, 2011 4:12 AM by slawek t

    Errai 2.0 and compilation error

    slawek t Novice

      I develope a project with Errai 1.3.1-SNAPSHOT and today I've switched to 2.0-SNAPSHOT. This is a maven based project. During the building (maven build), I receive such error:

       

      ...

      [INFO] INFO [RpcProxyLoaderGenerator] generating rpc proxy loader class.

      [INFO]    [ERROR] Errors in 'd:\workspace371\dms\target\.generated\org\jboss\errai\marshalling\client\api\MarshallerFactoryImpl.java'

      [INFO]       [ERROR] Line 1898: Unresolvable native reference to field 'suppressedExceptions' in type 'java.lang.Throwable'

      [INFO]       [ERROR] Line 1902: Unresolvable native reference to field 'suppressedExceptions' in type 'java.lang.Throwable'

      [INFO]    [ERROR] Cannot proceed due to previous errors

      [INFO] ------------------------------------------------------------------------

      [INFO] BUILD FAILURE

      ...

       

      and below mentioned by compiler code snippets

      -> org\jboss\errai\marshalling\client\api\MarshallerFactoryImpl.java:1898):

       

        private native static void java_lang_Throwable_suppressedExceptions(Throwable instance, List value) /*-{

          instance.@java.lang.Throwable::suppressedExceptions = value;

        }-*/;

       

      -> org\jboss\errai\marshalling\client\api\MarshallerFactoryImpl.java:1902):

       

        private native static List java_lang_Throwable_suppressedExceptions(Throwable instance) /*-{

          return instance.@java.lang.Throwable::suppressedExceptions;

        }-*/;

       

      Is there a way to avoid this compilation error?

        • 1. Re: Errai 2.0 and compilation error
          Mike Brock Master

          What version of the JDK are you using?

          • 2. Re: Errai 2.0 and compilation error
            slawek t Novice

            C:\Users\slawek>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)

            • 3. Re: Errai 2.0 and compilation error
              slawek t Novice

              Compilation of project with Errai 1.3.1-SNAPSHOT libs never finished with such error. I haven't change anything in my project except libs (changed to 2.0-SNAPSHOT) and after that the compilation error appeared.

              • 4. Re: Errai 2.0 and compilation error
                slawek t Novice

                Hi Mike,

                 

                Do you have any idea what I did wrong or what I can change to have 2.0-SNAPSHOT working? I really want to switch to newest Errai implementation.

                • 5. Re: Errai 2.0 and compilation error
                  Mike Brock Master

                  We will be publishing new snapshots for 2.0 in about an hour which fix this problem.

                  • 6. Re: Errai 2.0 and compilation error
                    slawek t Novice

                    Hi,

                     

                    I tried it once again and this time I receive the error:

                     

                    ...

                    [INFO]       Computing all possible rebind results for 'org.jboss.errai.marshalling.client.api.MarshallerFactory'

                    [INFO]          Rebinding org.jboss.errai.marshalling.client.api.MarshallerFactory

                    [INFO]             Invoking generator org.jboss.errai.marshalling.rebind.MarshallersGenerator

                    [INFO]                Generating Marshallers Bootstrapper...

                    [INFO] INFO [MarshallerGeneratorFactory] nothing has changed. using cached marshaller factory class.

                    [INFO]          Rebinding org.jboss.errai.marshalling.client.api.MarshallerFactory

                    [INFO]             Invoking generator org.jboss.errai.marshalling.rebind.MarshallersGenerator

                    [INFO]                Generating Marshallers Bootstrapper...

                    [INFO]       Adding '1' new generated units

                    [INFO]          Validating newly compiled units

                    [INFO]             Ignored 1 unit with compilation errors in first pass.

                    [INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.

                    [INFO] INFO [RpcProxyLoaderGenerator] nothing has changed. using cached rpc proxy loader class.

                    [INFO]    [ERROR] Errors in 'd:\workspace371\dms\target\.generated\org\jboss\errai\marshalling\client\api\MarshallerFactoryImpl.java'

                    [INFO]       [ERROR] Line 1244:  The constructor AssertionError(String, Throwable) is undefined

                    [INFO]       [ERROR] Line 1462:  The constructor ConcurrentModificationException(String, Throwable) is undefined

                    [INFO]    [ERROR] Cannot proceed due to previous errors

                    [INFO] ------------------------------------------------------------------------

                    [INFO] BUILD FAILURE

                    [INFO] ------------------------------------------------------------------------

                    ...

                     

                     

                    At first I thought that it was compiled under java jdk1.6 but the I removed old (not used) jdk1.6 and the only remaining java is jdk1.7 (and jre7) - unfortunatelly, the error still appears. What's wrong?

                    • 7. Re: Errai 2.0 and compilation error
                      Christian Sadilek Master

                      Can you try again after deleting the code generation cache (the .errai subdirectory)? Alternatively, you can pass -Derrai.devel.nocache=true as parameter to the build. This is only necessary after upgrading to a new version.

                      • 8. Re: Errai 2.0 and compilation error
                        slawek t Novice

                        After I deleted .errai folder and added -Derrai.devel.nocache=true to the build, I receive the same kind of errors but a bit different locations for them in generated java source file:

                         

                        [INFO] INFO [RpcProxyLoaderGenerator] generating rpc proxy loader class.

                        [INFO]    [ERROR] Errors in 'D:\workspace371\dms\target\.generated\org\jboss\errai\marshalling\client\api\MarshallerFactoryImpl.java'

                        [INFO]       [ERROR] Line 376:  The constructor AssertionError(String, Throwable) is undefined

                        [INFO]       [ERROR] Line 1144:  The constructor ConcurrentModificationException(String, Throwable) is undefined

                        [INFO]    [ERROR] Cannot proceed due to previous errors

                        [INFO] ------------------------------------------------------------------------

                        [INFO] BUILD FAILURE

                        [INFO] ------------------------------------------------------------------------

                        • 9. Re: Errai 2.0 and compilation error
                          Mike Brock Master

                          Yes, we are still working through getting the new marshalling implemented. I believe the SNAPSHOT which will be going out in a few hours will fix this problem.

                          • 10. Re: Errai 2.0 and compilation error
                            slawek t Novice

                            The latest changes you have made solved the problem and now the compilation finishes with no errors.