通过使用EclipseLink JPA2.0,我构建了一个工作正常的应用程序。然后我在表中添加一些属性并重新生成该表实体。
但是当我通过facade(会话bean)在该特定实体上调用create方法时抛出异常,即第一个新列不存在。当我从实体中删除该列时,错误就是第二个新列。
但是列中存在具有相同名称的列。实际上我通过netbeans重新生成了所有实体
代码在一台机器上工作正常但在其他机器上连续抛出异常。即使使用相同的代码相同的环境。
[#| 2013-06-06T18:07:36.220 + 0500 |警告| glassfish3.1.1 | javax.enterprise.system.core.transaction.com.sun.jts.jta | _ThreadID = 47; _ThreadName = Thread- 2; | JTS5054:完成后发生意外错误 本地异常堆栈: 异常[EclipseLink-4002](Eclipse Persistence Services - 2.3.0.v20110604-r9504):org.eclipse.persistence.exceptions.DatabaseException 内部异常:com.mysql.jdbc.exceptions.MySQLSyntaxErrorException:未知列' ixsCenterFrequency'在'字段列表' 错误代码:1054 呼叫:INSERT INTO greenacs_rev.cpe(campingTime,cpeTimestamp,CUSTID,ddvVersion,idFirstUseDate,idHardwareVersion,idModemFirmwareVersion,idSerialNumber,idSoftwareVersion,idUpTime,使用ifconfig,illMacAddress,illlInterfaceIPAddress,illlInterfaceSubnetMask,ilwAutoChannelEnable,ilwBSSID,ilwChannel,ilwStandard,ilwTotalByteReceived,ilwTotalByteSent,ilwTransmitPower, imConnectionRequestPassword,imConnectionRequestURL,imConnectionRequestUsername,imParameterKey,imPassword,imPeriodicInformInterval,imPeriodicTime,imURL,imUsername,ioAccountName,iosRealm,iosType,iowccProviderIdentifier,iowhProviderIdentifier,isvlStatus,isvlcCallForwardOnNoAnswerNumber,isvlsAuthPassword,isvlsAuthUserName,isvlsX_UserAccount,isvsOutboundProxy,isvsOutboundProxyPort,isvvDigitMap,isvxRxGain,isvxTxGain,iuISPHomePage, iwwWANAccessType,iwwrFirmwareVersion,iwwrSotwareVersion,iwwwDNSServers,iwwwDefaultGateway,iwwwExternalIPaddress,iwwwMacAddress,iwwwMaxMTUSize,iwwwSubnetMask,iwwwn oOfRetires,ixDownlinkMeanCINR,ixDownlinkMeanRSSI,ixPHYDLmcs,ixPHYULmcs,ixServingBSID,ixfFullbandScanClass,ixlHoldOnLastGoodBSEnable,ixlLastGoodBSsScanEnable,ixlNeighborBSsScanEnable,ixsCenterFrequency,ixsDisconnectReason,ixsDownlinkDataRate,ixsNumberBytesReceived,ixsNumberBytesTransmitted,ixsNumberPktsReceived,ixsNumberPktsReceivedWithError,ixsNumberPktsTransmitted,ixsSecurity,ixsTxMeanPower,ixsUplinkDataRate,ixwcCAPLScanEnable,ixwcNAPFilterEnable,ixwcRECONNECT_ACTIVE,ixwcSupplicantAnonymousIDEnable, lastSyncTime,hmId)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ?,?,?,?,?,?,?,?,?,?) bind => [82参数绑定] 查询:InsertObjectQuery(kics.green.acs.ejb.entity.CPE [cpeId = 1]) at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:324) 在org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:840) 在org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeNoSelect(DatabaseAccessor.java:906) 在org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:592) 在org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:535) at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1702) 在org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:253) 在org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:207) 在org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.insertObject(DatasourceCallQueryMechanism.java:342) at org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:162) 在org.eclipse.persistence.internal.queries.StatementQueryMechanism.insertObject(StatementQueryMechanism.java:177) at org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObjectForWrite(DatabaseQueryMechanism.java:472) at org.eclipse.persistence.queries.InsertObjectQuery.executeCommit(InsertObjectQuery.java:80) 在org.eclipse.persistence.queries.InsertObjectQuery.executeCommitWithChangeSet(InsertObjectQuery.java:90) 在org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeWriteWithChangeSet(DatabaseQueryMechanism.java:287) at org.eclipse.persistence.queries.WriteObjectQuery.executeDatabaseQuery(WriteObjectQuery.java:58) 在org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:829) 在org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:728) at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWorkObjectLevelModifyQuery(ObjectLevelModifyQuery.java:108) at org.eclipse.persistence.queries.ObjectLevelModifyQuery.executeInUnitOfWork(ObjectLevelModifyQuery.java:85) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2863) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1501) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1483) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1443) at org.eclipse.persistence.internal.sessions.CommitManager.commitNewObjectsForClassWithChangeSet(CommitManager.java:224) at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsForClassWithChangeSet(CommitManager.java:191) at org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:136) at org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:3784) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1407) at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:634) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1497) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.issueSQLbeforeCompletion(UnitOfWorkImpl.java:3135) at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.issueSQLbeforeCompletion(RepeatableWriteUnitOfWork.java:344) at org.eclipse.persistence.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:157) at org.eclipse.persistence.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:68) at com.sun.jts.jta.SynchronizationImpl.before_completion(SynchronizationImpl.java:99) at com.sun.jts.CosTransactions.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:158) 在com.sun.jts.CosTransactions.TopCoordinator.beforeCompletion(TopCoordinator.java:2547) 在com.sun.jts.CosTransactions.CoordinatorTerm.commit(CoordinatorTerm.java:279) 在com.sun.jts.CosTransactions.TerminatorImpl.commit(TerminatorImpl.java:250) 在com.sun.jts.CosTransactions.CurrentImpl.commit(CurrentImpl.java:623) at com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:323) at com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate.commitDistributedTransaction(JavaEETransactionManagerJTSDelegate.java:175) at com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.commit(JavaEETransactionManagerSimplified.java:858) at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:5114) at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4879) at com.sun.ejb.containers.MessageBeanContainer.afterMessageDeliveryInternal(MessageBeanContainer.java:1207) at com.sun.ejb.containers.MessageBeanContainer.afterMessageDelivery(MessageBeanContainer.java:1180) at com.sun.ejb.containers.MessageBeanListenerImpl.afterMessageDelivery(MessageBeanListenerImpl.java:86) at com.sun.enterprise.connectors.inbound.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:143) at $ Proxy308.afterDelivery(Unknown Source) at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:328) 在com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:114) at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl $ WorkerThread.performWork(ThreadPoolImpl.java:497) at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl $ WorkerThread.run(ThreadPoolImpl.java:540) 引起:com.mysql.jdbc.exceptions.MySQLSyntaxErrorException:未知列' ixsCenterFrequency'在'字段列表' 在com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936) 在com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) 在com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573) 在com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1160) 在com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:685) 在com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1400) 在com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1314) 在com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1299) 在org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:831) ......还有54个 |#]