facebook

Scaffolding for CRUD fails – added new table

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #322826 Reply

    ctatem
    Member

    I’m attempting to evaluate MyEclipse 10 for Spring.

    I installed and scaffolded a simple set of classes based on an existing table in MySQL (v5). I generated JSF, REST… I deployed the app on the internal server and played with it – it worked.

    I updated some of the classes adding my own code, just to be sure I could do that. All is fine.

    I then used the DB Explorer to add a new table to the schema. After many fits and starts to create foreign keys, I have added a ‘child’ table (it has a foreign key to the table that was already there – which I did not change).

    I attempted to scaffold again, selecting both tables, selecting the original table to be the parent, and all the same options (mostly defaults) as before.

    It immediately fails telling me to read the log, the log (took 10 minutes to figure out where that was) root cause seems to be unable to read a table?

    Shouldn’t I be able to follow this workflow and incrementally generate artifacts as I created them? Any ideas what the root cause here really is?

    Log:
    !ENTRY org.skyway.core.generate 4 0 2012-01-31 10:52:19.215
    !MESSAGE Generation job failed
    !STACK 0
    java.lang.RuntimeException: Error invoking function: initializeCrud with parameters: [Ljava.lang.Object;@d3c7c2
    at org.skyway.core.generate.snippet.function.FunctionInvoker.invoke(FunctionInvoker.java:102)
    at org.skyway.core.generate.snippet.function.FunctionSnippetExpression.evaluate(FunctionSnippetExpression.java:26)
    at org.skyway.core.generate.snippet.SnippetRegistry.evaluate(SnippetRegistry.java:88)
    at org.skyway.core.generate.snippet.SnippetRegistry.getObjectAttribute(SnippetRegistry.java:99)
    at org.skyway.core.generate.generator.invoke.InvokeSnippetGenerator.generate(InvokeSnippetGenerator.java:24)
    at org.skyway.core.generate.generator.DescendantGenerator.generateChild(DescendantGenerator.java:28)
    at org.skyway.core.generate.generator.DescendantGenerator.generateChildren(DescendantGenerator.java:21)
    at org.skyway.core.generate.generator.DescendantGenerator.generate(DescendantGenerator.java:14)
    at org.skyway.core.generate.generator.control.ResourceGenerator.generate(ResourceGenerator.java:19)
    at org.skyway.core.generate.execute.GenerationJob.generate(GenerationJob.java:115)
    at org.skyway.core.generate.execute.GenerationJob$1.run(GenerationJob.java:59)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.skyway.core.generate.execute.GenerationJob.run(GenerationJob.java:55)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
    Caused by: java.lang.RuntimeException: Unable to load data type from table(s): [org.skyway.integration.data.persistence.provider.datatype.TableDataTypeInput@69a918]
    at org.skyway.integration.data.persistence.provider.datatype.TableDataTypeInputProvider.generateDataTypes(TableDataTypeInputProvider.java:222)
    at org.skyway.integration.data.persistence.provider.datatype.TableDataTypeInputProvider.getDataTypes(TableDataTypeInputProvider.java:73)
    at com.skyway.scaffolding.crud.datatype.FilteredDataTypeInputProvider.getDataTypes(FilteredDataTypeInputProvider.java:33)
    at com.skyway.scaffolding.crud.util.ContextAwareCrudFunctions.getDataTypes(ContextAwareCrudFunctions.java:181)
    at com.skyway.scaffolding.crud.util.ContextAwareCrudFunctions.initializeCrud(ContextAwareCrudFunctions.java:55)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.skyway.core.generate.snippet.function.FunctionInvoker.invoke(FunctionInvoker.java:94)
    … 13 more
    Caused by: java.lang.RuntimeException: Unable to load resource: L/property/.springDSL/com/strllc/domain/Notes.datatype
    at org.skyway.integration.data.persistence.importer.hibernate.StringCoreTemplateGenerator.getCore(StringCoreTemplateGenerator.java:133)
    at org.skyway.integration.data.persistence.importer.hibernate.CoreExporter.getCores(CoreExporter.java:154)
    at org.skyway.integration.data.persistence.importer.hibernate.DataTypeExporter.getDataTypes(DataTypeExporter.java:52)
    at org.skyway.integration.data.persistence.importer.hibernate.HibernateModelGenerator.generateDataTypes(HibernateModelGenerator.java:174)
    at org.skyway.integration.data.persistence.importer.hibernate.HibernateModelGenerator.generateModel(HibernateModelGenerator.java:97)
    at org.skyway.integration.data.persistence.provider.datatype.TableDataTypeInputProvider.generateDataTypes(TableDataTypeInputProvider.java:208)
    … 22 more

    (Notes is the new table I added, not the original one)

    #322856

    cconway
    Member

    Hi ctatem,

    I’m sorry you’re having this issue.

    My first question is, did you enable the Spring DSL on this project? The DSL may be less reliable when re-scaffolding. I believe that if you don’t enable the Spring DSL, you should be able to re-scaffold this type of database change. As far as I know the only DB change that would require you to delete the existing classes is if you were to change a primary key.

    Secondly, I know it sounds redundant, but just to make sure you don’t have any cached connection information, please re-connect and refresh the connection. To do that, in the DB Browser view, right click on the node named “Connected to XXXXXX” where XXXXXX is the database name. The select “Reconnect and Refresh”.

    Please let me know if this helps.

    #322894

    ctatem
    Member

    Well, I didn’t have DSL enabled, and had thought to flush the database as you suggested. I had even dropped and recreated the database (tables).

    I did get the scaffolding to work on the ‘child’ table if I dropped the index and foreign key, but adding them back continued to crash.

    Eventually I had to delete (and remove contents from disk) the project; and recreate it from scratch. I now have this scaffolded, but am not convinced that as I iteratively add tables and relationships to my project, that I will be able to scaffold in that manner.

    Are there other “best practices,’ or known limitations on MySQL (as it seems to crash on MySQL) that I should be aware of? Or should I scaffold from a Bean or Entity for better results – even though I would still require access to a MySQL database?

    thanks – cwt

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Scaffolding for CRUD fails – added new table

You must be logged in to post in the forum log in