2017-01-03 7 views
0

WAS 6.1 Serverを使用しているローカル・ワークスペースでアプリケーションをセットアップしようとしています。そのエンタープライズアプリケーションです。ワークスペースを設定した後、1つのWebサービス呼び出しを除いて、すべての機能が期待通りに機能しています。java.lang.NoClassDefFoundError:EJBモジュール内

私たちのアプリケーションでは、リポジトリからドキュメントを取得するためのサービス呼び出しを行います。

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ファイルをクラスパスに存在する方法:私は私が必要なものに完全に無知だ

<?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> 

する。これにいくつかの光を投げてください..事前に感謝!

+0

こんにちは!いくつかの外部ライブラリを使用しますか?ライブラリが複数回インポートされるときにこのエラーが発生することがあります。 –

+0

こんにちはMelli、応答に感謝します。私は元の記事で述べたように、いくつかの機能については共有ライブラリからjarを使います。これはその瓶の一つです。私はこれを一度だけ追加しました。なぜこのエラーが発生しているのか分かりません。 エラーが発生している場所でコードスニペットを追加するために投稿を変更しました。 – Jackson2489

+0

このクラスパスは、ビルド/コンパイル中に使用され、実行されません。そのため、瓶を耳の中に入れたり、WASで設定された共有ライブラリを使用して入れなければなりません。 – Gas

答えて

0

クラスがコンパイル時に使用可能な場合、実行時にクラスをサーバーにデプロイするときに、そのクラスをアプリケーションで使用できるようにする必要もあります。

クラスパスにはがあります(/sharedlib/fetch/6.1.04/servicemf.jar)。だから、実行時にアプリケーションのクラスが利用できるようにするには、2つの基本的なオプションがあります。

  1. パッケージエンタープライズ・アプリケーション(EAR)
  2. servicemf.jarは、共有ライブラリにservicemf.jarを追加し、あなたにその共有ライブラリを提供しますエンタープライズアプリケーション

(とりわけ)両方のオプションは、ここでは詳細に説明されています
IBM - Best Practice for using common application files

関連する問題