- This topic has 1 reply, 2 voices, and was last updated 13 years, 2 months ago by jkennedy.
-
AuthorPosts
-
Glen IhrigMemberI recently experienced what appears to be a rare but disastrous issue with the Spring DSL.
What seems to have happened is that making changes in the generated java code triggered a bug in the DSL which deleted all annotation related code and method bodies, leaving mostly comments and method signatures.
The condition first occurred in UserRestController. I did not catch what happened, so I played around in UserController and saw the error first hand. When saving a change to a method signature in the DSL, The DSL editor seemed to go into a loop generating all of the methods in the controller three or four times, but ended by deleting all ‘extra’ methods, leaving the editor looking completely normal.
I think this may be the error described here https://www.genuitec.com/forums/topic/unbelievably-frustrating-autogeneration/&start=0&postdays=0&postorder=asc&highlight=method
I have not been able to reproduce the behavior, but have uncovered an issue with the synchronization between the DSL editor and the code base. I have seen a similar issue with the DSL editor since the Skyway Builder 6.0 days, but never with these consequences.
Due to the complex (and random?) nature of this problem I am posting a _lot_ of detail, including two sample projects, in the hopes that it will be helpful.
In the short term, I have deleted my project, restored a backup and things are working all right.
Best regards,
-Glen
================
Project creation steps:
================Scaffold a test program using a simple single table MySQL db 1. Create a db connection to remote MyQSL server 2. Create a new MyEclipse Web Project (Test) - Java EE 6.0, otherwise default 3. Enable Spring DSL - Add Spring Nature - Generate all application layers - Spring 3.0 runtime dependencies - keep other defaults 4. Scaffold Spring Crud Application - Specify MySQL connection, accept defaults - Table details id BigInt 20 firstName Varchar 32 lastName Varchar 32 - Default Application Layers and Packages (com.arkadias.testdsl) - Spring MVC UI - Generate REST and JSON support - Keep defaults at Customize User Interface 5. Test scaffolded app - Confirm all CRUD operations via web page - dashboard: http://dev-mac-ws.local:8080/Test/ - Confirm all CRUD operations via REST - New User POST accept: application/json content-type: application/json url: http://dev-mac-ws.local:8080/Test/User request body: {"id":4,"firstName":"Teal","lastName":"Anderson"} response body: {"id":4,"firstName":"Teal","lastName":"Anderson"} - List Users GET accept: application/json content-type: application/json url: http://dev-mac-ws.local:8080/Test/User request body: response body: [{"id":1,"firstName":"John","lastName":"Smith"},{"id":2,"firstName":"Jane","lastName":"Adams"},{"id":3,"firstName":"Jeff","lastName":"Mayer"},{"id":4,"firstName":"Teal","lastName":"Anderson"}] - Load User GET accept: application/json content-type: application/json url: http://dev-mac-ws.local:8080/Test/User/2 request body: response body: {"id":4,"firstName":"Teal","lastName":"Anderson"} - Save User PUT accept: application/json content-type: application/json url: http://dev-mac-ws.local:8080/Test/User request body: {"id":4,"firstName":"Thomas","lastName":"Allen"} response body: {"id":4,"firstName":"Thomas","lastName":"Allen"} - Delete user DELETE accept: application/json content-type: application/json url: http://dev-mac-ws.local:8080/Test/User/4 request body: response body: Confirm user deleted with List Users or Web UI. Up to this point everything works as expected.
=================================
Attempt to reproduce destructive DSL generation error.
Ultimately unsuccessful, but DSL-code editor sync errors may shed some light?
=================================- Change the loadUser method to expect the user id in the request body as opposed to the URL. a) Make changes in the Spring DSL - UserRestController. a.1 Change URL from /User/{user_id} to /loadUser a.2 Change Method to POST a.3 Change Mapped As from 'Path Variable' to 'Request Param'. a.4 Save UserRestController and clean project a.5 Changes to code are generated as expected. a.6 Exit ME4S and restore project from backup. b) Make changes in code and sync DSL with code. b.1 Change code as follows: As Scaffolded ------------------------------------- @RequestMapping(value = "/User/{user_id}", method = RequestMethod.GET) @ResponseBody public User loadUser(@PathVariable Integer user_id) { return userDAO.findUserByPrimaryKey(user_id); } As Modified ------------------------------------- @RequestMapping(value = "/loadUser", method = RequestMethod.POST) @ResponseBody public User loadUser(@RequestParam Integer user_id) { return userDAO.findUserByPrimaryKey(user_id); } b.2 Observe Spring DSL - UserRestController - Note that changes from code are in evidence, and DSL editor is marked as 'dirty'. b.3 Save DSL editor. b.4 Changes in DSL are generated as expected. b.5 Exit ME4S and restore project from backup. c) Make changes in code and sync using Update Spring DSL From Source. c.1 Change code as follows (same as above): As Scaffolded ------------------------------------- @RequestMapping(value = "/User/{user_id}", method = RequestMethod.GET) @ResponseBody public User loadUser(@PathVariable Integer user_id) { return userDAO.findUserByPrimaryKey(user_id); } As Modified ------------------------------------- @RequestMapping(value = "/loadUser", method = RequestMethod.POST) @ResponseBody public User loadUser(@RequestParam Integer user_id) { return userDAO.findUserByPrimaryKey(user_id); } c.2 Observe Spring DSL - UserRestController - Note that changes from code are NOT in evidence, and DSL editor is marked as 'dirty'. c.3 Save DSL editor. c.4 Changes in DSL are NOT generated as expected - The DSL, although saved, is out of sync with the code. This appears to be a random error, but repeating the process as described above, causes it to appear after only a few attempts. c.5 Execute MyEclipse > Spring DSL > Update Spring DSL From Source. - Process ends with message 'Your Java source files have been processed successfully'. - The DSL editor still does not reflect the state of the code. - The DSL editor is marked as 'dirty'. c.6 Code and DSL editor are still out of sync. c.7 Close and open both editors. c.8 Both editors are now in sync.
==============
Installation Details:
==============*** Date: Tuesday, September 6, 2011 9:03:40 PM PDT ** System properties: OS=MacOSX OS version=10.5.8 Java version=1.6.0_26 *** MyEclipse details: MyEclipse Enterprise Workbench Version: 9.1 Build id: 9.1-20110701 *** Eclipse details: MyEclipse for Spring Version: 9.1.0 Build ID: 9.1.0 Build 10 (110630_1845) Eclipse startup command=-os macosx -ws cocoa -arch x86_64 -showsplash -launcher /Applications/Development/DevelopmentFolders/Genuitec/MyEclipse for Spring 9.app/Contents/Profile/myeclipseforspring.app/Contents/MacOS/myeclipseforspring -name Myeclipseforspring --launcher.library /Applications/Development/DevelopmentFolders/Genuitec/MyEclipse for Spring 9.app/Contents/Profile/myeclipseforspring.app/Contents/MacOS//../../../../../../Common/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.1.R36x_v20100810/eclipse_1309.so -startup /Applications/Development/DevelopmentFolders/Genuitec/MyEclipse for Spring 9.app/Contents/Profile/myeclipseforspring.app/Contents/MacOS/../../../../../../Common/plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar -install /Applications/Development/DevelopmentFolders/Genuitec/MyEclipse for Spring 9.app/Contents/Profile -configuration /Applications/Development/DevelopmentFolders/Genuitec/MyEclipse for Spring 9.app/Contents/Profile/configuration -keyring /Users/glen/.eclipse_keyring -showlocation -vm /System/Library/Frameworks/JavaVM.framework
============
Sample projects
============The DSL generation errors are in the web controllers web/UserController and web/rest/UserResrController. The corresponding controller test classes also show the result of the generation error.
Attachments:
You must be logged in to view attached files.
jkennedyMemberGlen,
Sorry you ran into this issue, and thanks for the details it will make it easier to dig in a bit.
We are looking into this now.
Thanks,
Jack -
AuthorPosts