【发布时间】:2012-12-22 00:50:02
【问题描述】:
我成功地编写了部署扩展和存储扩展。
以下是我从核心日志中获取的日志,显示所有内容都已完美加载!!
2013-01-08 11:30:19,759 INFO BundleConfigurationLoader - Added 'PublishAction' for storage 'persistence' with 'com.tridion.storage.dao.JPAPublishActionDAO'.
2013-01-08 11:30:38,259 DEBUG JPAPublishActionDAO - Constructor of JPAPublishActionDAO- storageId:searchdb
2013-01-08 11:30:38,259 DEBUG JPAPublishActionDAO - Constructor of JPAPublishActionDAO- entityManagerFactory:true
2013-01-08 11:30:38,259 DEBUG JPAPublishActionDAO - Constructor of JPAPublishActionDAO- storageName:PublishAction
2013-01-08 11:19:38,400 INFO Module - No TransformProcessor configured, will not transform files before deployment for module com.tridion.custom.extensions.SearchPageDeployer
2013-01-08 11:30:38,400 DEBUG SearchPageDeployer - Constructor of SearchPageDeployer //This is my PageDeployer Constructor
2013-01-08 11:30:38,744 DEBUG SearchPageDeployer - Called processPage from SearchPageDeployer //This is my process Page of pagedeployer class
2013-01-08 11:30:38,572 DEBUG SearchPageDeployer - SearchPageDeployer Called processItem
2013-01-08 11:30:38,572 DEBUG StorageManagerFactory - Default storage provider has caching set to: false
2013-01-08 11:30:38,572 DEBUG StorageManagerFactory - Loaded following dao Properties[publication=0, typeMapping=PublishAction, storageId=searchdb, cached=false] for publication/typeMapping/itemExtension: 0 / PublishAction / null
2013-01-08 11:30:38,572 DEBUG StorageManagerFactory - Loading a non cached DAO for publicationId/typeMapping/itemExtension: 0 / PublishAction / null
2013-01-08 11:30:38,572 DEBUG StorageManagerFactory - Wrapping DAO's, currently 0 wrappers installed
2013-01-08 11:30:38,572 INFO JPAPublishActionDAO - Entering Method: JPAPublishActionDAO.PublishAction.store
2013-01-08 11:40:33,228 ERROR SearchPageDeployer - SearchPageDeployer - Exception occurred com.tridion.broker.StorageException: Unable to persist data entity, Error while commiting the transaction, Error while commiting the transaction
现在,当我尝试将数据存储在我的表中时,我得到 “发生异常 com.tridion.broker.StorageException:无法持久保存数据实体,提交事务时出错,提交事务时出错”
这是我的实体类的任何问题还是我缺少的东西。
编辑:在 logback xml 中启用记录器级别“ON”之后。
我在核心文件中遇到以下异常:
2013-01-08 14:42:10,713 DEBUG SQL - insert into AUTN_ITEMS (ACTION, FLAG, ITEM_TYPE, LAST_PUBLISHED_DATE, PUBLICATION_ID, SCHEMA_ID, TCMURI, URL, ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?)
2013-01-08 14:42:10,728 DEBUG AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2013-01-08 14:42:10,744 DEBUG JDBCExceptionReporter - could not insert: [com.tridion.storage.dao.PublishAction] [insert into AUTN_ITEMS (ACTION, FLAG, ITEM_TYPE, LAST_PUBLISHED_DATE, PUBLICATION_ID, SCHEMA_ID, TCMURI, URL, ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?)]
com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert explicit value for identity column in table 'AUTN_ITEMS' when IDENTITY_INSERT is set to OFF.
谢谢
【问题讨论】:
-
您好。这是您看到的唯一错误吗?您可以检查日志文件中的堆栈跟踪吗?如果您没有看到更多错误信息,那么也许您可以打开 root 日志记录(logback.xml 中的 root level="DEBUG")。
-
@Sea,是的,这是我得到的唯一异常,我已经启用了级别="DEBUG",在反编译 JPABaseDAO 后,我看到在其公共
中生成了异常T create(T itemToCreate) 抛出 StorageException 方法,不知道是什么原因,因为实体是根据我的 SQL 表,如果你愿意我也可以发布我的实体代码 -
这可能是您的实体和表之间不同步的小东西。为了能够更好地看到这一点,只需确保你的 logback.xml 中有这个:
-
不知道在存储 bean 之前我能看到什么数据,请在我保存数据之前查看日志。 [PublishAction:id=0,action=PUBLISH,url=/english/test/test.aspx,tcmuri=tcm:233-192242-64,last_published_date=Tue Jan 08 14:42:10 GST 2013,item_type=64,schema_id =null,flag=null]
-
您能否确保已将列 ID 定义为身份,您的 schema_id 和标志允许包含空值,并且您的数据库中没有其他列被标记为非空?
标签: tridion tridion-2011 tridion-content-delivery tridion-storage-extension tridion-deploy-extension