Topic
  • 3 replies
  • Latest Post - ‏2014-08-12T08:01:23Z by DanieleVistalli
DanieleVistalli
DanieleVistalli
11 Posts

Pinned topic Exception when refreshing a builder created with WPF 6.1.5 - Error on WEF 8.5

‏2014-08-11T17:22:07Z |

Hi, I'm porting a quite large application from WPF 6.1.5 (Portal 7.0) to WEF 8.5 (Portal 8.0)

I've an issue with a builder I created in the past using the builder skeleton builder.

In WPF 6.1.5 I was able to use in the builder and coordinator class the Java 1.6 syntax with generics and annotations.

I've opened the model containing the "Skeleton Builder" builder and tried to re-generate / update the builder and coordinator code.

I begun getting parser exception like this:

 

Description Resource Path Location Type
This Builder Call caused the following exception:  Lexical error at line 39, column 5.  Encountered: "@" (64), after : ""
com.bowstreet.parser.TokenMgrError: Lexical error at line 39, column 5.  Encountered: "@" (64), after : ""
at com.bowstreet.parser.JavaParserTokenManager.getNextToken(JavaParserTokenManager.java:2127)
at com.bowstreet.parser.JavaParser.jj_ntk(JavaParser.java:8777)
at com.bowstreet.parser.JavaParser.ClassBody(JavaParser.java:287)
at com.bowstreet.parser.JavaParser.UnmodifiedClassDeclaration(JavaParser.java:268)
at com.bowstreet.parser.JavaParser.ClassDeclaration(JavaParser.java:212)
at com.bowstreet.parser.JavaParser.TypeDeclaration(JavaParser.java:138)
at com.bowstreet.parser.JavaParser.CompilationUnit(JavaParser.java:60)
at com.bowstreet.webapp.util.ClassParser.parseClass(ClassParser.java:806)
at com.bowstreet.builderutilities.BaseBuilderClassGenerator.readClassInfo(BaseBuilderClassGenerator.java:65)
at com.bowstreet.builders.webapp.creation.BuilderSkeletonBuilder.makeCoordinatorClass(BuilderSkeletonBuilder.java:319)
at com.bowstreet.builders.webapp.creation.BuilderSkeletonBuilder.construction(BuilderSkeletonBuilder.java:164)
at com.bowstreet.builders.webapp.creation.BuilderSkeletonBuilder.doBuilderCall(BuilderSkeletonBuilder.java:75)
at com.bowstreet.builders.webapp.foundation.WebAppGenHandler.doBuilderCall(WebAppGenHandler.java:483)
at com.bowstreet.generation.implementation.BaseGenContext.internalInvokeBuilder(BaseGenContext.java:201)
at com.bowstreet.generation.implementation.BaseGenContext.performGenerationPhase(BaseGenContext.java:523)
at com.bowstreet.generation.GenerationManager.generate(GenerationManager.java:183)
at com.bowstreet.generation.GenerationManager.generate(GenerationManager.java:82)
at com.bowstreet.designer.model.ModelAccess.generate(ModelAccess.java:192)
at com.bowstreet.designer.model.ModelContext.generate(ModelContext.java:553)
at com.bowstreet.designer.model.ModelContext.access$100(ModelContext.java:71)
at com.bowstreet.designer.model.ModelContext$1.runInUIThread(ModelContext.java:336)
at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4144)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
htmllabels.model /.................................../builders Builder Skeleton:HTML Lables localization Web Experience Factory Builder Error

After some guessing I understood the skeleton builder was not able to parse the builder and coordinator code to update it. I rewritten the builder and coordinator code without using annotations and generics constructs and got it to work.

Can you please help me understand if there's something new that doesn't allow the usage of annotations and generics constructs in the builder' or coordinator codebase ?

Is this by design or there's some setting I can use to change the way the parser works ?

Thanks in advance.

 
  • kevintap
    kevintap
    749 Posts
    ACCEPTED ANSWER

    Re: Exception when refreshing a builder created with WPF 6.1.5 - Error on WEF 8.5

    ‏2014-08-11T18:17:41Z  

    The Builder Skeleton builder wasn't really designed to be re-run.  The builder was designed to be populated with the desired details for your new builder and then run once in order to generate the skeleton for a builder .bdef file, builder class and coordinator class.  After that, the builder should be disabled or removed from the model and you can go provide the implementation for your builder by editing the files that it creates in your project.

    As you have seen here, the Builder Skeleton's parser does not support the extended Java syntax introduced in Java 1.5, and throws an exception when attempting to parse the annotations or generics included in a .java file.

    In my experience, it has always been easier to just go into the .java files and .bdef and add the necessary changes, for example, to add a new builder input or change a builder input type, etc.  Is there a reason that you need to re-run the Builder Skeleton builder on an existing builder that you have created?

    One possible option here is that you could re-run the Builder Skeleton builder using a different builder/class name and compare what is generated by the builder with your existing class in order to see what changes would be required to support your desired changes to the builder (new builder input, changed builder input, etc).

  • kevintap
    kevintap
    749 Posts

    Re: Exception when refreshing a builder created with WPF 6.1.5 - Error on WEF 8.5

    ‏2014-08-11T18:17:41Z  

    The Builder Skeleton builder wasn't really designed to be re-run.  The builder was designed to be populated with the desired details for your new builder and then run once in order to generate the skeleton for a builder .bdef file, builder class and coordinator class.  After that, the builder should be disabled or removed from the model and you can go provide the implementation for your builder by editing the files that it creates in your project.

    As you have seen here, the Builder Skeleton's parser does not support the extended Java syntax introduced in Java 1.5, and throws an exception when attempting to parse the annotations or generics included in a .java file.

    In my experience, it has always been easier to just go into the .java files and .bdef and add the necessary changes, for example, to add a new builder input or change a builder input type, etc.  Is there a reason that you need to re-run the Builder Skeleton builder on an existing builder that you have created?

    One possible option here is that you could re-run the Builder Skeleton builder using a different builder/class name and compare what is generated by the builder with your existing class in order to see what changes would be required to support your desired changes to the builder (new builder input, changed builder input, etc).

  • DanieleVistalli
    DanieleVistalli
    11 Posts

    Re: Exception when refreshing a builder created with WPF 6.1.5 - Error on WEF 8.5

    ‏2014-08-12T08:01:10Z  
    • kevintap
    • ‏2014-08-11T18:17:41Z

    The Builder Skeleton builder wasn't really designed to be re-run.  The builder was designed to be populated with the desired details for your new builder and then run once in order to generate the skeleton for a builder .bdef file, builder class and coordinator class.  After that, the builder should be disabled or removed from the model and you can go provide the implementation for your builder by editing the files that it creates in your project.

    As you have seen here, the Builder Skeleton's parser does not support the extended Java syntax introduced in Java 1.5, and throws an exception when attempting to parse the annotations or generics included in a .java file.

    In my experience, it has always been easier to just go into the .java files and .bdef and add the necessary changes, for example, to add a new builder input or change a builder input type, etc.  Is there a reason that you need to re-run the Builder Skeleton builder on an existing builder that you have created?

    One possible option here is that you could re-run the Builder Skeleton builder using a different builder/class name and compare what is generated by the builder with your existing class in order to see what changes would be required to support your desired changes to the builder (new builder input, changed builder input, etc).

    Thank you. It makes sense and I can do as suggested.

    I was just guessing that since it "tries" to re-parse the builder class and fails it had a reason for re-parsingthe actual code and not just look for the placeholders that it generates (the "write your code here" comments added by the skeleton builder).

     

    I can live with this and move on :)

    Thanks for the quick answer.

  • DanieleVistalli
    DanieleVistalli
    11 Posts

    Re: Exception when refreshing a builder created with WPF 6.1.5 - Error on WEF 8.5

    ‏2014-08-12T08:01:23Z  
    • kevintap
    • ‏2014-08-11T18:17:41Z

    The Builder Skeleton builder wasn't really designed to be re-run.  The builder was designed to be populated with the desired details for your new builder and then run once in order to generate the skeleton for a builder .bdef file, builder class and coordinator class.  After that, the builder should be disabled or removed from the model and you can go provide the implementation for your builder by editing the files that it creates in your project.

    As you have seen here, the Builder Skeleton's parser does not support the extended Java syntax introduced in Java 1.5, and throws an exception when attempting to parse the annotations or generics included in a .java file.

    In my experience, it has always been easier to just go into the .java files and .bdef and add the necessary changes, for example, to add a new builder input or change a builder input type, etc.  Is there a reason that you need to re-run the Builder Skeleton builder on an existing builder that you have created?

    One possible option here is that you could re-run the Builder Skeleton builder using a different builder/class name and compare what is generated by the builder with your existing class in order to see what changes would be required to support your desired changes to the builder (new builder input, changed builder input, etc).

    Thank you. It makes sense and I can do as suggested.

    I was just guessing that since it "tries" to re-parse the builder class and fails it had a reason for re-parsingthe actual code and not just look for the placeholders that it generates (the "write your code here" comments added by the skeleton builder).

     

    I can live with this and move on :)

    Thanks for the quick answer.