本文整理汇总了Java中org.apache.commons.lang.exception.ExceptionUtils.printRootCauseStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java ExceptionUtils.printRootCauseStackTrace方法的具体用法?Java ExceptionUtils.printRootCauseStackTrace怎么用?Java ExceptionUtils.printRootCauseStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang.exception.ExceptionUtils
的用法示例。
在下文中一共展示了ExceptionUtils.printRootCauseStackTrace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: map
import org.apache.commons.lang.exception.ExceptionUtils; //导入方法依赖的package包/类
@Override
public void map(Object key, Object value, Context context)
throws IOException, InterruptedException {
LindenIndexRequest indexRequest;
try {
indexRequest = LindenIndexRequestParser.parse(lindenConfig.getSchema(), value.toString());
} catch (Exception e) {
ExceptionUtils.printRootCauseStackTrace(e);
throw new IllegalStateException("LindenIndexRequestParser parsing error", e);
}
if (indexRequest.getType() != IndexRequestType.INDEX) {
throw new IllegalStateException("Index request type error");
}
Document doc = LindenDocParser.parse(indexRequest.getDoc(), lindenConfig);
// now we have uid and lucene Doc;
IntermediateForm form = new IntermediateForm();
form.process(new Term(lindenConfig.getSchema().getId(), indexRequest.getDoc().getId()), doc,
lindenConfig.getIndexAnalyzerInstance(), facetsConfig);
form.closeWriter();
int chosenShard = DefaultShardingStrategy.calculateShard(shards.length, indexRequest);
if (chosenShard >= 0) {
// insert into one shard
context.write(shards[chosenShard], form);
} else {
logger.error("calculateShard failed for " + value.toString());
return;
}
}