Importa BD HSQLDB to MYSQL

Help
Pamela
2012-12-31
2013-05-01
  • Pamela
    Pamela
    2012-12-31

    Hi,

    Please can you help me, i try import BD HSQLDB to MYSQL, but I have the follow error.

    2012-12-31 12:22:14.978::WARN:  Nested in org.springframework.beans.factory.Bean
    CreationException: Error creating bean with name 'jtrac' defined in ServletConte
    xt resource : Cannot create inner bean 'info.jt
    rac.JtracImpl#2b3cdb' of type  while setting bean property
    'target'; nested exception is org.springframework.beans.factory.BeanCreationExc
    eption: Error creating bean with name 'info.jtrac.JtracImpl#2b3cdb' defined in S
    ervletContext resource : Cannot resolve referen
    ce to bean 'dao' while setting bean property 'dao'; nested exception is org.spri
    ngframework.beans.factory.BeanCreationException: Error creating bean with name '
    dao' defined in ServletContext resource : Invoc
    ation of init method failed; nested exception is org.springframework.dao.DataInt
    egrityViolationException: could not insert: ; nested exc
    eption is org.hibernate.exception.ConstraintViolationException: could not insert
    : :
    com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Dupl
    icate entry 'admin' for key 2

     
  • Pamela
    Pamela
    2012-12-31

    Steps for import BD

    1.-  Create BD in MYSQL name "jtrac".
    2.- Execute file "start.bat" and this operation, generated all tables in my BD Mysql
    3.- Empty all tables in Mysql.
    3.- Open file sql "jtrac\data\db\jtrac.script" and copy all querys INSERT
    4.- Execute querys INSERT in PhpMyadmin, all tables are completed with data.
    5.- I have 2 erros ….

    5.1 - Refresh system jtrac and I can see the project, but I can't make any move. The system give me the next error… "Internal error … Return to home page "

    OR

    5.2 - Restart service "start.bat" and system is down. and the error is
    "HTTP ERROR: 503
    SERVICE_UNAVAILABLE
    RequestURI=/jtrac/app/
    Powered by jetty://"
    And in cmd window i see this error. "Duplicate entry 'admin' for key 2"

    But in table "users" only exist one register "admin". I don't understand why try to insert again user "admin" …

    Attach complete log.

            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.createBean(AbstractAutowireCapableBeanFactory.java:353)
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver
    .resolveInnerBean(BeanDefinitionValueResolver.java:219)
            … 39 more
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creati
    ng bean with name 'dao' defined in ServletContext resource [/WEB-INF/application
    Context.xml]: Invocation of init method failed; nested exception is org.springfr
    amework.dao.DataIntegrityViolationException: could not insert: [info.jtrac.domai
    n.User]; nested exception is org.hibernate.exception.ConstraintViolationExceptio
    n: could not insert:
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1260)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:438)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory$1.run(AbstractAutowireCapableBeanFactory.java:383)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.createBean(AbstractAutowireCapableBeanFactory.java:353)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
    ject(AbstractBeanFactory.java:245)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
    y.getSingleton(DefaultSingletonBeanRegistry.java:169)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
    (AbstractBeanFactory.java:242)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
    (AbstractBeanFactory.java:164)
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver
    .resolveReference(BeanDefinitionValueResolver.java:269)
            … 47 more
    Caused by: org.springframework.dao.DataIntegrityViolationException: could not in
    sert: ; nested exception is org.hibernate.exception.Cons
    traintViolationException: could not insert:
            at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHiberna
    teAccessException(SessionFactoryUtils.java:622)
            at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernate
    AccessException(HibernateAccessor.java:412)
            at org.springframework.orm.hibernate3.HibernateTemplate.execute(Hibernat
    eTemplate.java:378)
            at org.springframework.orm.hibernate3.HibernateTemplate.merge(HibernateT
    emplate.java:769)
            at info.jtrac.hibernate.HibernateJtracDao.storeUser(HibernateJtracDao.ja
    va:176)
            at info.jtrac.hibernate.HibernateJtracDao.createSchema(HibernateJtracDao
    .java:427)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1325)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1294)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1257)
            … 56 more
    Caused by: org.hibernate.exception.ConstraintViolationException: could not inser
    t:
            at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.j
    ava:71)
            at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelp
    er.java:43)
            at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(Abstr
    actReturningDelegate.java:40)
            at org.hibernate.persister.entity.AbstractEntityPersister.insert(Abstrac
    tEntityPersister.java:2158)
            at org.hibernate.persister.entity.AbstractEntityPersister.insert(Abstrac
    tEntityPersister.java:2638)
            at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentit
    yInsertAction.java:48)
            at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
            at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)

            at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)

            at org.hibernate.event.def.AbstractFlushingEventListener.performExecutio
    ns(AbstractFlushingEventListener.java:298)
            at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlus
    hEventListener.java:27)
            at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
            at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary
    (HibernateAccessor.java:390)
            at org.springframework.orm.hibernate3.HibernateTemplate.execute(Hibernat
    eTemplate.java:374)
            … 66 more
    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationExce
    ption: Duplicate entry 'admin' for key 2
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
            at com.mysql.jdbc.Util.getInstance(Util.java:386)
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1040)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
            at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2734)
            at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
    va:2155)
            at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
    :2458)
            at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
    :2375)
            at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
    :2359)
            at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Del
    egatingPreparedStatement.java:102)
            at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAn
    dExtract(IdentityGenerator.java:73)
            at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(Abstr
    actReturningDelegate.java:33)
            … 77 more
    2012-12-31 12:36:56.009::WARN:  Nested in org.springframework.beans.factory.Bean
    CreationException: Error creating bean with name 'jtrac' defined in ServletConte
    xt resource : Cannot create inner bean 'info.jt
    rac.JtracImpl#2b3cdb' of type  while setting bean property
    'target'; nested exception is org.springframework.beans.factory.BeanCreationExc
    eption: Error creating bean with name 'info.jtrac.JtracImpl#2b3cdb' defined in S
    ervletContext resource : Cannot resolve referen
    ce to bean 'dao' while setting bean property 'dao'; nested exception is org.spri
    ngframework.beans.factory.BeanCreationException: Error creating bean with name '
    dao' defined in ServletContext resource : Invoc
    ation of init method failed; nested exception is org.springframework.dao.DataInt
    egrityViolationException: could not insert: ; nested exc
    eption is org.hibernate.exception.ConstraintViolationException: could not insert
    : :
    com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Dupl
    icate entry 'admin' for key 2
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
            at com.mysql.jdbc.Util.getInstance(Util.java:386)
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1040)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
            at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2734)
            at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.ja
    va:2155)
            at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
    :2458)
            at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
    :2375)
            at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java
    :2359)
            at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Del
    egatingPreparedStatement.java:102)
            at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAn
    dExtract(IdentityGenerator.java:73)
            at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(Abstr
    actReturningDelegate.java:33)
            at org.hibernate.persister.entity.AbstractEntityPersister.insert(Abstrac
    tEntityPersister.java:2158)
            at org.hibernate.persister.entity.AbstractEntityPersister.insert(Abstrac
    tEntityPersister.java:2638)
            at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentit
    yInsertAction.java:48)
            at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
            at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)

            at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)

            at org.hibernate.event.def.AbstractFlushingEventListener.performExecutio
    ns(AbstractFlushingEventListener.java:298)
            at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlus
    hEventListener.java:27)
            at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
            at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary
    (HibernateAccessor.java:390)
            at org.springframework.orm.hibernate3.HibernateTemplate.execute(Hibernat
    eTemplate.java:374)
            at org.springframework.orm.hibernate3.HibernateTemplate.merge(HibernateT
    emplate.java:769)
            at info.jtrac.hibernate.HibernateJtracDao.storeUser(HibernateJtracDao.ja
    va:176)
            at info.jtrac.hibernate.HibernateJtracDao.createSchema(HibernateJtracDao
    .java:427)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1325)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1294)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1257)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:438)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory$1.run(AbstractAutowireCapableBeanFactory.java:383)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.createBean(AbstractAutowireCapableBeanFactory.java:353)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
    ject(AbstractBeanFactory.java:245)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
    y.getSingleton(DefaultSingletonBeanRegistry.java:169)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
    (AbstractBeanFactory.java:242)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
    (AbstractBeanFactory.java:164)
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver
    .resolveReference(BeanDefinitionValueResolver.java:269)
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver
    .resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1172)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.populateBean(AbstractAutowireCapableBeanFactory.java:940)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:437)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory$1.run(AbstractAutowireCapableBeanFactory.java:383)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.createBean(AbstractAutowireCapableBeanFactory.java:353)
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver
    .resolveInnerBean(BeanDefinitionValueResolver.java:219)
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver
    .resolveValueIfNecessary(BeanDefinitionValueResolver.java:117)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1172)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.populateBean(AbstractAutowireCapableBeanFactory.java:940)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:437)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory$1.run(AbstractAutowireCapableBeanFactory.java:383)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBean
    Factory.createBean(AbstractAutowireCapableBeanFactory.java:353)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
    ject(AbstractBeanFactory.java:245)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
    y.getSingleton(DefaultSingletonBeanRegistry.java:169)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
    (AbstractBeanFactory.java:242)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
    (AbstractBeanFactory.java:164)
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.
    preInstantiateSingletons(DefaultListableBeanFactory.java:394)
            at org.springframework.context.support.AbstractApplicationContext.finish
    BeanFactoryInitialization(AbstractApplicationContext.java:736)
            at org.springframework.context.support.AbstractApplicationContext.refres
    h(AbstractApplicationContext.java:369)
            at org.springframework.web.context.ContextLoader.createWebApplicationCon
    text(ContextLoader.java:261)
            at org.springframework.web.context.ContextLoader.initWebApplicationConte
    xt(ContextLoader.java:199)
            at org.springframework.web.context.ContextLoaderListener.contextInitiali
    zed(ContextLoaderListener.java:45)
            at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.
    java:511)
            at org.mortbay.jetty.servlet.Context.startContext(Context.java:135)
            at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.jav
    a:1191)
            at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:
    481)
            at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:434
    )
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
    40)
            at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection
    .java:147)
            at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHan
    dlerCollection.java:120)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
    40)
            at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection
    .java:147)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
    40)
            at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:
    117)
            at org.mortbay.jetty.Server.doStart(Server.java:210)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
    40)
            at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:929)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at org.mortbay.start.Main.invokeMain(Main.java:183)
            at org.mortbay.start.Main.start(Main.java:497)
            at org.mortbay.start.Main.main(Main.java:115)
    2012-12-31 12:36:56.041::INFO:  Started SelectChannelConnector @ 0.0.0.0:900