Page 1 of 1

SQLException: The name 'true' is not permitted in this conte

Posted: Mon Apr 22, 2013 4:49 pm
by pam
Hi All,

I am working on getting the demosite to run on MS SQL server and Jetty Server.
There are exceptions. Any suggestions/advice on how to fix is appreciated.

Code: Select all

[artifact:mvn] [ERROR] 14:39:09 SchemaExport - schema export unsuccessful
[artifact:mvn] org.hibernate.JDBCException: Error during import script execution at line 16
[artifact:mvn]    at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:370)
[artifact:mvn]    at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:276)
[artifact:mvn]    at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:219)
[artifact:mvn]    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:372)
[artifact:mvn]    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)
[artifact:mvn]    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906)
[artifact:mvn]    at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)
[artifact:mvn]    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:287)
[artifact:mvn]    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
[artifact:mvn]    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
[artifact:mvn]    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
[artifact:mvn]    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
[artifact:mvn]    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
[artifact:mvn]    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
[artifact:mvn]    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
[artifact:mvn]    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
[artifact:mvn]    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
[artifact:mvn]    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105)
[artifact:mvn]    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:915)
[artifact:mvn]    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)
[artifact:mvn]    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
[artifact:mvn]    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
[artifact:mvn]    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
[artifact:mvn]    at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:766)
[artifact:mvn]    at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:406)
[artifact:mvn]    at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:758)
[artifact:mvn]    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:242)
[artifact:mvn]    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1233)
[artifact:mvn]    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:701)
[artifact:mvn]    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:475)
[artifact:mvn]    at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:256)
[artifact:mvn]    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
[artifact:mvn]    at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
[artifact:mvn]    at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:167)
[artifact:mvn]    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
[artifact:mvn]    at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
[artifact:mvn]    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
[artifact:mvn]    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90)
[artifact:mvn]    at org.eclipse.jetty.server.Server.doStart(Server.java:272)
[artifact:mvn]    at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:65)
[artifact:mvn]    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
[artifact:mvn]    at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:511)
[artifact:mvn]    at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:364)
[artifact:mvn]    at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:516)
[artifact:mvn]    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
[artifact:mvn]    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
[artifact:mvn]    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[artifact:mvn]    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[artifact:mvn]    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
[artifact:mvn]    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
[artifact:mvn]    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
[artifact:mvn]    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
[artifact:mvn]    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
[artifact:mvn]    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
[artifact:mvn]    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
[artifact:mvn]    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
[artifact:mvn]    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
[artifact:mvn]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[artifact:mvn]    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[artifact:mvn]    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[artifact:mvn]    at java.lang.reflect.Method.invoke(Method.java:597)
[artifact:mvn]    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
[artifact:mvn]    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
[artifact:mvn]    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
[artifact:mvn]    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[artifact:mvn]    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
[artifact:mvn] Caused by: java.sql.SQLException: The name 'true' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
[artifact:mvn]    at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
[artifact:mvn]    at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
[artifact:mvn]    at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
[artifact:mvn]    at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632)
[artifact:mvn]    at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
[artifact:mvn]    at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
[artifact:mvn]    at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723)
[artifact:mvn]    at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1160)
[artifact:mvn]    at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
[artifact:mvn]    at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:366)
[artifact:mvn]    ... 65 more


~ Thanks

Re: SQLException: The name 'true' is not permitted in this conte

Posted: Mon Apr 22, 2013 10:37 pm
by phillipuniverse
I would investigate the various .sql files in core/src/main/resources/sql and check on line 16 of them. It's possible that there is a statement that happens to be invalid MS-SQL.

Re: SQLException: The name 'true' is not permitted in this conte

Posted: Tue Apr 23, 2013 11:06 am
by pam
Thank for the reply phillipuniverse! Look forward for your response!

Re: SQLException: The name 'true' is not permitted in this conte

Posted: Tue Apr 23, 2013 1:02 pm
by phillipuniverse
Perhaps try converting all of the 'true' values in the SQL imports to '1' and all of the 'false' values to '0'.

Re: SQLException: The name 'true' is not permitted in this conte

Posted: Tue Apr 23, 2013 1:22 pm
by pam
Verified all the sql scripts under core/src/main/resources/sql . All the true values are set to 1 and false to 0.

Re: SQLException: The name 'true' is not permitted in this conte

Posted: Tue Apr 23, 2013 2:13 pm
by phillipuniverse
So did that resolve your exception?

Re: SQLException: The name 'true' is not permitted in this conte

Posted: Tue Apr 23, 2013 2:22 pm
by pam
No. The exception isn't resolved.

Re: SQLException: The name 'true' is not permitted in this conte

Posted: Wed Apr 24, 2013 12:45 pm
by pam
SQLException: The name 'true' is not permitted in this context - FIXED

Though I had updated the sql files under core/src/main/resources/sql replacing true with 1 and false with 0,
the core1.0.jar was not taking the latest entries. Running "maven install" on Demosite, site, core projects, the
core.jar was updated. This fixed the issue.

Thanks,
pam