facebook

Spring Scaffold not working

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

    t23745
    Member

    I’m scaffolding via a schema using jDTS connection. The connection( with instance=name parameter, if it make a difference) is okay in that the database explorer is okay. By the scaffold generates error as follows. What am I doing wrong?

    !ENTRY org.skyway.core.generate 4 0 2014-02-25 15:11:13.977
    !MESSAGE Generation job failed
    !STACK 0
    java.lang.RuntimeException: Error invoking function: initializeCrud[public void com.skyway.scaffolding.crud.util.ContextAwareCrudFunctions.initializeCrud() throws org.eclipse.core.runtime.CoreException] with parameters: []
        at org.skyway.core.generate.snippet.function.FunctionInvoker.invoke(FunctionInvoker.java:103)
        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:2345)
        at org.skyway.core.generate.execute.GenerationJob.run(GenerationJob.java:55)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
    Caused by: java.lang.RuntimeException: Unable to load data type from table(s): [org.skyway.integration.data.persistence.provider.datatype.TableDataTypeInput@19dad0c]
        at org.skyway.integration.data.persistence.provider.datatype.TableDataTypeInputProvider.generateDataTypes(TableDataTypeInputProvider.java:227)
        at org.skyway.integration.data.persistence.provider.datatype.TableDataTypeInputProvider.getDataTypes(TableDataTypeInputProvider.java:74)
        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:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.skyway.core.generate.snippet.function.FunctionInvoker.invoke(FunctionInvoker.java:95)
        ... 13 more
    Caused by: org.hibernate.exception.SQLGrammarException: Could not get list of tables from database. Probably a JDBC driver problem. 
    Configured schema:null
    Configured catalog:null
    Available schemas:
     ... schema list removed
    Available catalogs:
     ... catalogue list removed
    
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
        at org.hibernate.cfg.reveng.dialect.OracleMetaDataDialect.getTables(OracleMetaDataDialect.java:257)
        at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:476)
        at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:74)
        at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:860)
        at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:121)
        at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:94)
        at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:42)
        at org.skyway.integration.data.persistence.importer.hibernate.HibernateModelGenerator.createJDBCConfiguration(HibernateModelGenerator.java:227)
        at org.skyway.integration.data.persistence.importer.hibernate.HibernateModelGenerator.generateModel(HibernateModelGenerator.java:96)
        at org.skyway.integration.data.persistence.provider.datatype.TableDataTypeInputProvider.generateDataTypes(TableDataTypeInputProvider.java:213)
        ... 22 more
    Caused by: java.sql.SQLException: Invalid object name 'all_tables'.
        at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
        at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
        at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
        at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671)
        at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505)
        at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1029)
        at org.hibernate.cfg.reveng.dialect.OracleMetaDataDialect.getTableResultSet(OracleMetaDataDialect.java:667)
        at org.hibernate.cfg.reveng.dialect.OracleMetaDataDialect.getTables(OracleMetaDataDialect.java:221)
        ... 31 more
    #347553 Reply

    t23745
    Member

    Version: 2014 Blue Build id: 12.0.0-Blue-20131202 (x32 bit)
    It’s actually the Bling (License & also says so on the splash screen), but the ‘about’ says it’s Blue version.
    Target database SqlServer 2008 R2.

    #347555 Reply

    t23745
    Member

    Note: ‘all_tables’ was not an input from me. All Scaffold inputs referenced simple tables & columns that do exist, i.e. scaffold builder read the schema correctly to present me tables I recognize. Also tried this with a 2013 Blue version, also failed, same error. Also tried with MS SqlServer drivers, got different error which has already been well reported hence switch to jDTS.

    #347558 Reply

    t23745,

    Sorry that you are seeing this issue. To help us replicate the issue at our end, can you please copy paste the schema of the tables you are trying to scaffold ?

    #347566 Reply

    t23745
    Member
    USE [B2B]
    GO
    
    /****** Object:  Table [dbo].[ClientOut]    Script Date: 02/24/2014 16:25:38 ******/
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    
    SET ANSI_PADDING ON
    GO
    
    CREATE TABLE [dbo].[ClientMessage](
        [MessageProcId] [int] IDENTITY(1,1) NOT NULL,
          [MessageFrom] [varchar](255) NOT NULL,
          [MessageType] [varchar](255) NOT NULL,
          [MessageDatetime] [datetime] NOT NULL,
          [AttrName] [varchar](255) NOT NULL,                
        [AttrValue] [varchar](255) NOT NULL 
    ) ON [PRIMARY]
    
    GO
    
    SET ANSI_PADDING OFF
    GO
    #347575 Reply

    t23745,

    Thanks for providing the table schema.

    > Can you please mention which version of jDTS driver you are using ?

    > Can you please clarify whether you have followed the same steps mentioned in this tutorial ? If not, please mention the changes you have made in the scaffolding wizard.

    #347578 Reply

    t23745
    Member

    jtds-1.3.1.jar
    net.sourceforge.jtds.jdbc.driver
    as Tutorial – yes,
    ‘select Database tables’ also offers catalog dropdown. I also get Select Primary Keys(s) page for which I select messageProcId
    I didn’t select scaffold web, but tried that again it didnt make any difference
    I don’t get dialogues as in 8 & 9, but i have seen them on previous runs.

    I would have thought the the term “all_tables” was very significant that must be deriving from the scaffold code base.

    #347582 Reply

    t23745,

    We couldn’t replicate the issue at our end with your table schema and jTDS 1.3.1 driver.

    > Can you please mention the exact steps you followed for creating the SQL server connection in MyEclipse database explorer ?

    > Please attach the screenshot of the SQL server connection by right clicking on SQL connection and select Edit. (Find my SQL server connection details in the attached screenshot for your visual reference)

    > Can you please clarify which schema name you have selected under ‘Select database tables’ section in Scaffolding wizard ? Also please clarify whether there is any schema named ‘all_tables’ in your SQL server database ?

    #347592 Reply

    t23745
    Member

    database explore, new connection then typed input, only auto drop down field was the driver. test worked as expected, using default port.

    all_tables is not a literal the exists as a table within any catalog / schema within the database. I assume it derives fro the jTDS or the scaffold code base.

    scaffold:
    – select DB connection ‘ …-jTDS Drivers’
    – catalog, offered 2, select my instance name
    – schema, select dbo
    causes 7 tables to be displayed of which clientmessage is one, use add to transfer to rhs
    – Dialect select org.hibernate.dialect.SQLServerDialect
    – MetaData Dialect, select default, only other is for Oracle

    on Finish get Generating domain objects from conn… – jTDSDrivers]… & then Generation Error dialogue.

    Attachments:
    You must be logged in to view attached files.
    #347593 Reply

    t23745
    Member

    deleted connection, re added it, Test works as does explorer.

    Then attempted scaffold, same screens offered select same (one) table. on finish now get new error

    
    !ENTRY org.skyway.core.generate 4 0 2014-02-27 15:47:46.394
    !MESSAGE Generation job failed
    !STACK 0
    java.lang.RuntimeException: Error invoking function: initializeCrud[public void com.skyway.scaffolding.crud.util.ContextAwareCrudFunctions.initializeCrud() throws org.eclipse.core.runtime.CoreException] with parameters: []
        at org.skyway.core.generate.snippet.function.FunctionInvoker.invoke(FunctionInvoker.java:103)
        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:2345)
        at org.skyway.core.generate.execute.GenerationJob.run(GenerationJob.java:55)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
    Caused by: org.eclipse.core.runtime.OperationCanceledException: Unable to scaffold because no data type inputs were provided.  See the error log for more details.
        at com.skyway.scaffolding.crud.util.ContextAwareCrudFunctions.getDataTypes(ContextAwareCrudFunctions.java:184)
        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:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.skyway.core.generate.snippet.function.FunctionInvoker.invoke(FunctionInvoker.java:95)
        ... 13 more
    #347611 Reply

    t23745,

    Thanks again for the details provided.

    Can you please clarify whether you have specified the SQLServerDialect rather than the default option ‘Auto-Detect’ in the scaffolding wizard ?

    #347674 Reply

    t23745
    Member

    I selected sqlserverdialect

    #347710 Reply

    t23745,

    we couldn’t replicate the issue at our end even after trying different settings.

    > Can you please attach the full error stack trace ?

    > Can you please share the details of the OS name and version in which the SQL server is installed ?

    > Can you please clarify whether you are scaffolding the table which contains some data in it ? Is yes, can you please send the table schema and the data in it ?

    #348037 Reply

    t23745
    Member

    I assume that you are indicating that the reference to “all_tables” does not derive from your code base.
    Disappointingly I’ve resorted to hand crafting the scaffold code.

    #348112 Reply

    t23745,

    We could replicate the issue only when we select ‘OracleMetadatadialect’ as the Metadata Dialect and ‘SQLserver’ as the dialect in the ‘Select database tables’ section of Spring scaffolding wizard. The MetaDataDialect should be left as the default setting ‘Default’.

    Regarding “all_tables”, it is used only with the ‘OracleMetaDataDialect’ set as the Metadata dialect.

    If you are still seeing the issue, can you please attach the full error stack trace to help us investigate further ?

    Let us know how it works for you.

Viewing 15 posts - 1 through 15 (of 16 total)
Reply To: Spring Scaffold not working

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