如何在 Websphere 商务错误中查找批处理元素

Posted

技术标签:

【中文标题】如何在 Websphere 商务错误中查找批处理元素【英文标题】:How to find batch element in Websphere commerce error 【发布时间】:2021-05-11 12:08:57 【问题描述】:

当我在 Websphere 应用程序中运行 buildindex 时,buildindex 日志中出现以下错误:

[2021/05/10 15:41:57:590 GMT] I Data import pre-processing completed in 0.389 seconds for table TI_CAT_EXTENDED_41060.
[2021/05/10 15:41:57:591 GMT] I /opt/IBM/WebSphere/CommerceServer80/instances/auth/search/pre-processConfig/MC_41060/DB2/wc-dataimport-preprocess-catentry-metainf.xml
[2021/05/10 15:41:57:591 GMT] I 
Table name:     TI_X_CATENT_META_INF_410600
Fetch size:     500
Batch size:     500
[2021/05/10 15:41:58:048 GMT] I Error for batch element #415: DB2 SQL Error: SQLCODE=-302, SQLSTATE=22001, SQLERRMC=null, DRIVER=4.19.77
[2021/05/10 15:41:58:048 GMT] I SQL: SELECT CATENTRY_ID, TITLE, TITLE_KEYWORDS, SHORT_DESC, SHORT_DESC_KEYWORDS, LONG_DESC, LONG_DESC_KEYWORDS, LOCALE FROM X_CATENT_META_INF WHERE STORE_ID = 41006
[2021/05/10 15:41:58:087 GMT] I 
The program exiting with exit code: 1. 
Data import pre-processing was unsuccessful. An unrecoverable error has occurred.

[2021/05/10 15:41:58:091 GMT] E com.ibm.commerce.foundation.dataimport.preprocess.DataImportPreProcessorMain:handleExecutionException Exception message: CWFDIH0002: An SQL exception was caught. The following error occurred: [jcc][t4][102][10040][4.19.77] Batch failure.  The batch was submitted, but at least one exception occurred on an individual member of the batch.
Use getNextException() to retrieve the exceptions for specific batched elements. ERRORCODE=-4229, SQLSTATE=null., stack trace: com.ibm.commerce.foundation.dataimport.exception.DataImportSystemException: CWFDIH0002: An SQL exception was caught. The following error occurred: [jcc][t4][102][10040][4.19.77] Batch failure.  The batch was submitted, but at least one exception occurred on an individual member of the batch.
Use getNextException() to retrieve the exceptions for specific batched elements. ERRORCODE=-4229, SQLSTATE=null.
    at com.ibm.commerce.foundation.dataimport.preprocess.DataImportPreProcessorMain.processDataConfig(DataImportPreProcessorMain.java:1515)
    at com.ibm.commerce.foundation.dataimport.preprocess.DataImportPreProcessorMain.execute(DataImportPreProcessorMain.java:1331)
    at com.ibm.commerce.foundation.dataimport.preprocess.DataImportPreProcessorMain.main(DataImportPreProcessorMain.java:534)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
    at java.lang.reflect.Method.invoke(Method.java:620)
    at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:280)
Caused by: com.ibm.db2.jcc.am.BatchUpdateException: [jcc][t4][102][10040][4.19.77] Batch failure.  The batch was submitted, but at least one exception occurred on an individual member of the batch.
Use getNextException() to retrieve the exceptions for specific batched elements. ERRORCODE=-4229, SQLSTATE=null
    at com.ibm.db2.jcc.am.b4.a(b4.java:475)
    at com.ibm.db2.jcc.am.Agent.endBatchedReadChain(Agent.java:414)
    at com.ibm.db2.jcc.am.ki.a(ki.java:5342)
    at com.ibm.db2.jcc.am.ki.c(ki.java:4929)
    at com.ibm.db2.jcc.am.ki.executeBatch(ki.java:3045)
    at com.ibm.commerce.foundation.dataimport.preprocess.AbstractDataPreProcessor.populateTable(AbstractDataPreProcessor.java:373)
    at com.ibm.commerce.foundation.dataimport.preprocess.StaticAttributeDataPreProcessor.process(StaticAttributeDataPreProcessor.java:461)
    at com.ibm.commerce.foundation.dataimport.preprocess.DataImportPreProcessorMain.processDataConfig(DataImportPreProcessorMain.java:1482)
    ... 7 more

异常似乎很清楚,但我无法批量识别#415 元素是什么。即使是日志也无济于事,因为它没有指向另一个更详细的日志。您对找到它有什么建议吗?

【问题讨论】:

见ibm.com/support/pages/… 我不是商务专家,但错误 - SQLCODE=-302, SQLSTATE=22001 - \means INPUT VARIABLE OR PARAMETER IS INVALID OR TOO LARGE 然后查询失败 WHERE STORE_ID = 41006 。所以我猜STORE_ID 是不正确的。通过 sql 工具试试这个查询,看看它是否产生任何结果。 【参考方案1】:

感谢用户@mao的评论,我有followed this link

首先必须确定失败的表。为 di-preprocess 启用更详细的跟踪:

导航到:

WC_installdir/instances/instance_name/xml/config/dataimport

并打开 logging.properties 文件。查找 INFO 的所有实例和 将其更改为最佳。可以选择增加日志文件的大小和 编辑此文件时的历史日志文件数。

由于这个建议,我重新运行了buildindex过程,发现solr错误地对原始表中的字段进行分组,从而为目的地生成了一个太长的字段,并产生了错误。

【讨论】:

以上是关于如何在 Websphere 商务错误中查找批处理元素的主要内容,如果未能解决你的问题,请参考以下文章

学习日记0827异常处理 元类 自定义元类 自定义元类来实例化类 属性查找顺序

如何从托管在 Websphere 6.1 上的 DB2 数据库获取 XADatasource

Struts/Spring WebSphere jndi 错误

WebSphere 7 中的消息驱动 bean (EJB3)、XA 事务、错误处理

使用不在模型中的字段扩展 django 表单,导致错误,只能连接列表,而不是元组

如何浏览 Websphere MQ 消息而不删除它?