我正在尝试在具有WAS 6.1服务器的本地工作区中设置我的应用程序。它是一个企业应用程序。设置工作区后,除一个 Web 服务调用外,所有功能都按预期工作。
在我们的应用程序中,我们使用服务调用以从存储库中检索文档。
public Document executeSearchRequest(String packageName, String serviceName, Document searchCriteriaDoc) throws CfGCPApplicationException
{
try
{
CiServiceConsumerFactory serviceFactory = (CiServiceConsumerFactory) CfFrameworkMgr.getInstance().getComponent("SERVICE_CONSUMER_FACTORY");
Document responseDoc = null;
CiServiceConsumer consumer = serviceFactory.createConsumer();
CffinServiceCall finRequestServiceCall = new CffinServiceCall();
finRequestServiceCall.setPackageName(CfPropertyLoader.getProperty(packageName));
CfLogWriter.debug("Package name : "+ CfPropertyLoader.getProperty(packageName));
finRequestServiceCall.setServiceName(CfPropertyLoader.getProperty(serviceName));
CfLogWriter.debug("Service name : "+ CfPropertyLoader.getProperty(serviceName));
finRequestServiceCall.setPayload(searchCriteriaDoc);
CfLogWriter.debug("Payload : "+ CfXMLHelper.getStringFromDocument(searchCriteriaDoc) );
finRequestServiceCall.setTimeout(Integer.parseInt(CiGCPConstants.SERVICE_TIMEOUT_PERIOD)); //ToDo
CfLogWriter.debug("Timeout period : "+ CiGCPConstants.SERVICE_TIMEOUT_PERIOD );
System.setProperty("com.ibm.ssl.performURLHostNameVerification", "true");
// **Below statement is where the error is happening**
CffinServiceCall finReplyServiceCall = consumer.callRequestReply(finRequestServiceCall);
if (finReplyServiceCall != null ){
responseDoc = finReplyServiceCall.getPayloadSingleDocument();
CfLogWriter.debug("Response Document : "+CfXMLHelper.getStringFromDocument(responseDoc));
}
return responseDoc;
}catch(Exception ex)
{
throw new CfGCPApplicationException("executeSearchRequest failed" , ex);
}
}
当我尝试检索文档时,它显示以下错误。
[1/3/17 12:31:55:517 CST] 00000033 ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "searchDocument" on bean "BeanId(GCPonline#GCPonlineEJB.jar#CrOnlineDocumentSearchRetrieval, null)". Exception data: java.lang.NoClassDefFoundError: com.fin.services.consumer.FetchServiceConsumerType
at com.fin.framework.services.consumer.CfServiceConsumerMgrImpl.checkConfigCache(CfServiceConsumerMgrImpl.java:665)
at com.fin.framework.services.consumer.CfServiceConsumerMgrImpl.getServiceDefinitionType(CfServiceConsumerMgrImpl.java:622)
at com.fin.framework.services.consumer.CfServiceConsumerMgrImpl.getServiceConsumerConfiguration(CfServiceConsumerMgrImpl.java:652)
at com.fin.framework.services.consumer.CfServiceConsumerImpl.getConsumerConfiguration(CfServiceConsumerImpl.java:687)
at com.fin.framework.services.consumer.CfServiceConsumerImpl.callRequestReply(CfServiceConsumerImpl.java:278)
at com.fin.app.GCP.facade.CfGCPBaseECMInterface.executeSearchRequest(CfGCPBaseECMInterface.java:92)
at com.fin.app.GCP.facade.CfGCPMobiusInterface.searchDocMetaDataDetByService(CfGCPMobiusInterface.java:90)
at com.fin.app.GCP.facade.CfGCPMobiusInterface.searchDocMetaDataDet(CfGCPMobiusInterface.java:66)
at com.fin.app.GCP.facade.CfOnlineDocumentSearchRetrievalUtility.searchMobiusDocuments(CfOnlineDocumentSearchRetrievalUtility.java:169)
at com.fin.app.GCP.facade.CfOnlineDocumentSearchRetrievalUtility.searchDocument(CfOnlineDocumentSearchRetrievalUtility.java:86)
at com.fin.app.GCP.bs.CrOnlineDocumentSearchRetrievalBean.searchDocument(CrOnlineDocumentSearchRetrievalBean.java:26)
at com.fin.app.GCP.bs.EJSRemoteStatelessCrOnlineDocumentSearchRetrieval_6df5d278.searchDocument(EJSRemoteStatelessCrOnlineDocumentSearchRetrieval_6df5d278.java:65)
at com.fin.app.GCP.bs._CrOnlineDocumentSearchRetrieval_Stub.searchDocument(_CrOnlineDocumentSearchRetrieval_Stub.java:75)
at com.fin.app.GCP.bs.delegate.CfGCPBsDelegateServiceImpl.searchDocument(CfGCPBsDelegateServiceImpl.java:1180)
at com.fin.app.GCP.actions.CgBillDetailsDispatchAction.retrieveDocument(CgBillDetailsDispatchAction.java:1070)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
at com.fin.app.GCP.controller.CgAuthorizationFilter.doFilter(CgAuthorizationFilter.java:96)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3252)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:264)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1439)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:112)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1815)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
方法FetchServiceConsumerType存在于名为Servicemf的jar中,我已经检查了类路径,jar存在于类路径中,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="ejbModule"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/WebSphere v6.1 JRE"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/com.ibm.ws.ast.st.runtime.runtimeTarget.v61/was.base.v61"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry exported="true" kind="lib" path="/sharedlib/fetch/6.1.04/fetchservices.jar"/>
<classpathentry exported="true" kind="lib" path="/sharedlib/fetch/6.1.04/servicemf.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/gcponlineWeb"/>
<classpathentry kind="output" path="ejbModule"/>
</classpath>
我完全不知道我需要做什么。请对此进行一些说明..提前致谢!!
如果某个类在编译时可用,则在将此类部署到服务器时,还需要在运行时使该类可用于应用程序。
听起来缺少的类FetchServiceConsumerType
来自您班级路径上的/sharedlib/fetch/6.1.04/servicemf.jar
。 因此,您有两个基本选项可以使该类在运行时可用于您的应用程序:
- 将
servicemf.jar
打包到企业应用程序 (EAR) 中 - 将
servicemf.jar
添加到共享库,并将该共享库提供给企业应用程序
此处详细介绍了这两个选项(以及其他选项):
IBM - 使用通用应用程序文件的最佳实践