The table named 'Something' could not be found
AmitGoenka opened this issue · 6 comments
I have been able to generate the metadata successfully.
However when I try to run 'mvn -e -X -Pgen generate-sources', I get the following output:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.jaxio.celerio:celerio-maven-plugin:4.0.18:generate (Generates files using the extracted database schema.) on project celerio-generator-configtool: The table named subscriptions could not be found at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoExecutionException: The table named subscriptions could not be found at com.jaxio.celerio.maven.plugin.celerio.GenerateMojo.execute(GenerateMojo.java:204) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) ... 20 more Caused by: java.lang.IllegalArgumentException: The table named subscriptions could not be found at org.springframework.util.Assert.notNull(Assert.java:115) at com.jaxio.celerio.factory.EntityConfigFactory.assertEntityConfigIsValid(EntityConfigFactory.java:81) at com.jaxio.celerio.factory.EntityConfigFactory.assertEntityConfigListIsConsistent(EntityConfigFactory.java:64) at com.jaxio.celerio.factory.ProjectFactory.init(ProjectFactory.java:165) at com.jaxio.celerio.main.CelerioProducer.produce(CelerioProducer.java:66) at com.jaxio.celerio.main.CelerioProducer.produce(CelerioProducer.java:60) at com.jaxio.celerio.maven.plugin.celerio.GenerateMojo.process(GenerateMojo.java:220) at com.jaxio.celerio.maven.plugin.celerio.GenerateMojo.execute(GenerateMojo.java:201)
It could be a case sensitivity problem... I presume that in your celerio configuration file you use as table name "subscriptions" but may be the real name is "SUBSCRIPTIONS"...
I have tried with different combinations already. I've tried 'subscriptions', 'SUBSCRIPTIONS', 'Subscriptions'.
I am using MS-SQL Server. And the table is in the schema 'dbo'. So I had it like this in the pom.xml:
<jdbc.schema>dbo</jdbc.schema>
Has this table been reversed ?
Have you checked the content of metadata.xml ? Normally the table should appear there...
I had run the database reversal commands. The metadata.xml looks something like this: (I have removed the sensitive information on the db connection)
<metadata xmlns="http://www.jaxio.com/schema/celerio"> <jdbcConnectivity driver="net.sourceforge.jtds.jdbc.Driver" url="XX" user="XX" password="XX" schemaName="dbo" oracleRetrieveRemarks="false" oracleRetrieveSynonyms="true" reverseIndexes="true" reverseOnlyUniqueIndexes="true" catalog=""> <tableNamePatterns/> <tableTypes> <tableType>TABLE</tableType> </tableTypes> </jdbcConnectivity> <databaseInfo databaseMajorVersion="11" databaseMinorVersion="0" databaseProductName="Microsoft SQL Server" databaseProductVersion="11.00.6537" driverMajorVersion="1" driverMinorVersion="3" driverName="jTDS Type 4 JDBC Driver for MS SQL Server and Sybase" driverVersion="1.3.1" extraInfo=""/> <tables/> </metadata>
Also, I get the following output in console:
[INFO] Connected OK [INFO] No table name pattern defined, using '%' [INFO] Working with 1 table name pattern(s) [INFO] Loading with catalog=[] schemaPattern=[dbo] tableNamePattern=[%] types=[TABLE] [INFO] Write metadata.xml file to src\main\config\celerio-maven-plugin\metadata.xml [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------
your metadata.xml is kind of empty... it means the reverse has not really worked. This is certainly due to your jdbc configuration....
Try to find some inspiration in issue 39 (s/o has posted his configuration):
It's working now!!! Referring to issue 39 helped. Turns out I had the celerio-maven-plugin.xml file incorrect.