Announcement Announcement Module
Collapse
No announcement yet.
derby reverse engineered web app not working Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • derby reverse engineered web app not working

    hi,
    I get following error on deploying war that spring generated on reverse engineering default latest apache derby toursdb demo database.

    At end it says: "Caused by: org.hibernate.HibernateException: Wrong column type in .APP.AIRLINES for column AIRLINE. Found: char, expected: varchar(2)"

    thanks,
    Hari
    ---------------------------------------------------

    Feb 20, 2012 2:35:09 AM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'transactionManager' defined in file [/home/hari/apps/apache-tomcat-7.0.25/webapps/test-0.1.0.BUILD-SNAPSHOT/WEB-INF/classes/META-INF/spring/applicationContext.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'entityManagerFactory' defined in file [/home/hari/apps/apache-tomcat-7.0.25/webapps/test-0.1.0.BUILD-SNAPSHOT/WEB-INF/classes/META-INF/spring/applicationContext.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:328)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:106)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1360)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:1118)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 94)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:225)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:291 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:585)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:913)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:464)
    at org.springframework.web.context.ContextLoader.conf igureAndRefreshWebApplicationContext(ContextLoader .java:384)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:283)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 111)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:4779)
    at org.apache.catalina.core.StandardContext.startInte rnal(StandardContext.java:5273)
    at org.apache.catalina.util.LifecycleBase.start(Lifec ycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:897)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:873)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:615)
    at org.apache.catalina.startup.HostConfig.deployWAR(H ostConfig.java:958)
    at org.apache.catalina.startup.HostConfig$DeployWar.r un(HostConfig.java:1599)
    at java.util.concurrent.Executors$RunnableAdapter.cal l(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.jav a:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'entityManagerFactory' defined in file [/home/hari/apps/apache-tomcat-7.0.25/webapps/test-0.1.0.BUILD-SNAPSHOT/WEB-INF/classes/META-INF/spring/applicationContext.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1455)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 94)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:225)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:291 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:322)
    ... 29 more
    Caused by: javax.persistence.PersistenceException: [PersistenceUnit: persistenceUnit] Unable to build EntityManagerFactory
    at org.hibernate.ejb.Ejb3Configuration.buildEntityMan agerFactory(Ejb3Configuration.java:915)
    at org.hibernate.ejb.HibernatePersistence.createConta inerEntityManagerFactory(HibernatePersistence.java :74)
    at org.springframework.orm.jpa.LocalContainerEntityMa nagerFactoryBean.createNativeEntityManagerFactory( LocalContainerEntityManagerFactoryBean.java:257)
    at org.springframework.orm.jpa.AbstractEntityManagerF actoryBean.afterPropertiesSet(AbstractEntityManage rFactoryBean.java:310)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1514)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1452)
    ... 36 more
    Caused by: org.hibernate.HibernateException: Wrong column type in .APP.AIRLINES for column AIRLINE. Found: char, expected: varchar(2)
    at org.hibernate.mapping.Table.validateColumns(Table. java:283)
    at org.hibernate.cfg.Configuration.validateSchema(Con figuration.java:1343)
    at org.hibernate.tool.hbm2ddl.SchemaValidator.validat e(SchemaValidator.java:139)
    at org.hibernate.impl.SessionFactoryImpl.<init>(Sessi onFactoryImpl.java:378)
    at org.hibernate.cfg.Configuration.buildSessionFactor y(Configuration.java:1872)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityMan agerFactory(Ejb3Configuration.java:906)
    ... 41 more
    Feb 20, 2012 2:35:12 AM org.apache.catalina.core.ApplicationContext log
    INFO: Closing Spring root WebApplicationContext
    Feb 20, 2012 2:35:12 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Feb 20, 2012 2:35:12 AM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    Feb 20, 2012 2:35:12 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLoca tionsCache', 'org.apache.jasper.compiler.TldLocationsCache@ca9a 2d')
Working...
X