Uploaded image for project: 'James Imap'
  1. James Imap
  2. IMAP-103

Creating of tables for JPA fails with derby

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.1
    • Component/s: JPA Mailbox
    • Labels:
      None

      Description

      When using derby + JPA it fails on creating the tables:

      11205 James TRACE default Worker #5 openjpa.jdbc.SQL - <t 1423506714, conn 1909514618> [18 ms] spent
      ERROR 22:50:05,762 | james.imapserver | [IMAPHandler-0] Syntax error: Encountered "user" at line 1, column 79.

      {stmnt 1293073531 CREATE TABLE Subscription (id BIGINT NOT NULL, mailbox VARCHAR(255) NOT NULL, user VARCHAR(255) NOT NULL, PRIMARY KEY (id), CONSTRAINT UNQ_USERMAILBOX UNIQUE (user, mailbox))} [code=30000, state=42X01]
      <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Syntax error: Encountered "user" at line 1, column 79. {stmnt 1293073531 CREATE TABLE Subscription (id BIGINT NOT NULL, mailbox VARCHAR(255) NOT NULL, user VARCHAR(255) NOT NULL, PRIMARY KEY (id), CONSTRAINT UNQ_USERMAILBOX UNIQUE (user, mailbox))}

      [code=30000, state=42X01]
      at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:553)
      at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:453)
      at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:159)
      at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:119)
      at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:189)
      at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
      at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
      at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean$ManagedEntityManagerFactoryInvocationHandler.invoke(AbstractEntityManagerFactoryBean.java:434)
      at $Proxy6.createEntityManager(Unknown Source)
      at org.apache.james.imap.jpa.JPAMailboxManager.createMailboxMapper(JPAMailboxManager.java:45)
      at org.apache.james.imap.store.StoreMailboxManager.mailboxExists(StoreMailboxManager.java:283)
      at org.apache.james.imap.processor.LoginProcessor.doProcess(LoginProcessor.java:73)
      at org.apache.james.imap.processor.AbstractMailboxProcessor.doProcess(AbstractMailboxProcessor.java:123)
      at org.apache.james.imap.processor.AbstractMailboxProcessor.process(AbstractMailboxProcessor.java:80)
      at org.apache.james.imap.processor.AbstractMailboxProcessor.doProcess(AbstractMailboxProcessor.java:73)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:44)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.main.ImapRequestHandler.doProcessRequest(ImapRequestHandler.java:171)
      at org.apache.james.imap.main.ImapRequestHandler.handleRequest(ImapRequestHandler.java:102)
      at org.apache.james.imapserver.ImapHandler.handleRequest(ImapHandler.java:104)
      at org.apache.james.imapserver.ImapHandler.handleProtocol(ImapHandler.java:80)
      at org.apache.james.socket.JamesConnectionBridge.handleConnection(JamesConnectionBridge.java:311)
      at org.apache.james.socket.ServerConnection$ClientConnectionRunner.run(ServerConnection.java:469)
      at org.apache.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnable.java:57)
      at org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:118)
      Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Syntax error: Encountered "user" at line 1, column 79.

      {stmnt 1293073531 CREATE TABLE Subscription (id BIGINT NOT NULL, mailbox VARCHAR(255) NOT NULL, user VARCHAR(255) NOT NULL, PRIMARY KEY (id), CONSTRAINT UNQ_USERMAILBOX UNIQUE (user, mailbox))} [code=30000, state=42X01]
      at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:192)
      at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:57)
      at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingStatement.executeUpdate(LoggingConnectionDecorator.java:762)
      at org.apache.openjpa.lib.jdbc.DelegatingStatement.executeUpdate(DelegatingStatement.java:114)
      at org.apache.openjpa.jdbc.schema.SchemaTool.executeSQL(SchemaTool.java:1191)
      at org.apache.openjpa.jdbc.schema.SchemaTool.createTable(SchemaTool.java:949)
      at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:526)
      at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:344)
      at org.apache.openjpa.jdbc.schema.SchemaTool.run(SchemaTool.java:321)
      at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:501)
      ... 49 more
      INFO 22:50:05,766 | james.imapserver | [IMAPHandler-0] Fatal exception during connection from localhost. (0:0:0:0:0:0:0:1%0): Syntax error: Encountered "user" at line 1, column 79. {stmnt 1293073531 CREATE TABLE Subscription (id BIGINT NOT NULL, mailbox VARCHAR(255) NOT NULL, user VARCHAR(255) NOT NULL, PRIMARY KEY (id), CONSTRAINT UNQ_USERMAILBOX UNIQUE (user, mailbox))}

      [code=30000, state=42X01]
      <openjpa-1.2.0-r422266:683325 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Syntax error: Encountered "user" at line 1, column 79.

      {stmnt 1293073531 CREATE TABLE Subscription (id BIGINT NOT NULL, mailbox VARCHAR(255) NOT NULL, user VARCHAR(255) NOT NULL, PRIMARY KEY (id), CONSTRAINT UNQ_USERMAILBOX UNIQUE (user, mailbox))} [code=30000, state=42X01]
      at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:553)
      at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:453)
      at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:159)
      at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:119)
      at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:189)
      at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
      at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
      at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean$ManagedEntityManagerFactoryInvocationHandler.invoke(AbstractEntityManagerFactoryBean.java:434)
      at $Proxy6.createEntityManager(Unknown Source)
      at org.apache.james.imap.jpa.JPAMailboxManager.createMailboxMapper(JPAMailboxManager.java:45)
      at org.apache.james.imap.store.StoreMailboxManager.mailboxExists(StoreMailboxManager.java:283)
      at org.apache.james.imap.processor.LoginProcessor.doProcess(LoginProcessor.java:73)
      at org.apache.james.imap.processor.AbstractMailboxProcessor.doProcess(AbstractMailboxProcessor.java:123)
      at org.apache.james.imap.processor.AbstractMailboxProcessor.process(AbstractMailboxProcessor.java:80)
      at org.apache.james.imap.processor.AbstractMailboxProcessor.doProcess(AbstractMailboxProcessor.java:73)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:44)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:46)
      at org.apache.james.imap.main.ImapRequestHandler.doProcessRequest(ImapRequestHandler.java:171)
      at org.apache.james.imap.main.ImapRequestHandler.handleRequest(ImapRequestHandler.java:102)
      at org.apache.james.imapserver.ImapHandler.handleRequest(ImapHandler.java:104)
      at org.apache.james.imapserver.ImapHandler.handleProtocol(ImapHandler.java:80)
      at org.apache.james.socket.JamesConnectionBridge.handleConnection(JamesConnectionBridge.java:311)
      at org.apache.james.socket.ServerConnection$ClientConnectionRunner.run(ServerConnection.java:469)
      at org.apache.excalibur.thread.impl.ExecutableRunnable.execute(ExecutableRunnable.java:57)
      at org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:118)
      Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Syntax error: Encountered "user" at line 1, column 79. {stmnt 1293073531 CREATE TABLE Subscription (id BIGINT NOT NULL, mailbox VARCHAR(255) NOT NULL, user VARCHAR(255) NOT NULL, PRIMARY KEY (id), CONSTRAINT UNQ_USERMAILBOX UNIQUE (user, mailbox))}

      [code=30000, state=42X01]
      at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:192)
      at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:57)
      at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingStatement.executeUpdate(LoggingConnectionDecorator.java:762)
      at org.apache.openjpa.lib.jdbc.DelegatingStatement.executeUpdate(DelegatingStatement.java:114)
      at org.apache.openjpa.jdbc.schema.SchemaTool.executeSQL(SchemaTool.java:1191)
      at org.apache.openjpa.jdbc.schema.SchemaTool.createTable(SchemaTool.java:949)
      at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:526)
      at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:344)
      at org.apache.openjpa.jdbc.schema.SchemaTool.run(SchemaTool.java:321)
      at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:501)
      ... 49 more

        Attachments

          Activity

            People

            • Assignee:
              norman Norman Maurer
              Reporter:
              norman Norman Maurer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: