2011-08-09 32 views
0

我正在使用EJB 2.x。我有兩臺機器,兩臺都在WebSphere 7.0。 他們每個人都部署了不同的應用程序。當我從一個應用程序(machine1上)嘗試調用其他應用程序的EJB(machine2上),我收到以下錯誤:在嘗試調用另一臺服務器上的EJB方法時出現Websphere錯誤

java.rmi.MarshalException: CORBA MARSHAL 0x4942f999 No; nested exception is: org.omg.CORBA.MARSHAL: Profile data of length 0x3f400000 while reading IOR Profile vmcid: IBM minor code: 999 completed: No

有沒有人有知道如何解決這個問題,因爲我」米很困擾這個問題。 Thanx!

編輯

對於EJB調用我用常用的方法:

Properties props = new Properties(); 
props.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory"); 
props.put(Context.PROVIDER_URL, "iiop://remote.host.com:2809"); 
props.put(Context.SECURITY_PRINCIPAL, "remote_user"); 
props.put(Context.SECURITY_CREDENTIALS, "remote_pwd"); 
Context ctx = new InitialContext(props); 
Object objRef = ctx.lookup("servicemanagerJndiName"); 
ServiceManagerHome home = (ServiceManagerHome) PortableRemoteObject.narrow(
     objRef, ServiceManagerHome.class); 
manager = home.create(); 
manager.getMethod();... 

的事情是,這個服務調用正確inoked遠程服務器上,並且響應被髮送,只需在客戶端上我收到以下錯誤:

And this is the error I receive[SoapConnectorThreadPool : 5] [] ERROR java.rmi.MarshalException: CORBA MARSHAL 0x4942f999 No; nested exception is: org.omg.CORBA.MARSHAL: Profile data of length 0x3f400000 while reading IOR Profile vmcid: IBM minor code: 999 completed: No at com.ibm.CORBA.iiop.UtilDelegateImpl.mapSystemException(UtilDelegateImpl.java:277) at javax.rmi.CORBA.Util.mapSystemException(Util.java:84) at com.host.local.manager._ServiceManager_Stub.getMethod(_ServiceManager_Stub.java):

+0

你是如何在其他服務器上調用EJB的?你使用的是外國的細胞綁定等? 詳細說明設置並提供詳細日誌,以便我們可以嘗試並幫助您。 Manglu – Manglu

回答

0

我已成功解決了該問題。 外部的jar所在的地方ServiceManager(遠程接口)& ServiceManagerHome(home接口)被佔用,已經被jar文件替換,裏面還包含了Stubs。存根使用的是com.ibm.websphere.ant.tasks.WsEjbDeployant任務。你的螞蟻看起來應該服用點是這樣的:

<taskdef name="wsejbdeploy" classname="com.ibm.websphere.ant.tasks.WsEjbDeploy> 
     <classpath refid="your.websphere.classpath"/> 
    </taskdef> 
    <target name="packEjbJar"> 
     <jar destfile="pre-deploy-ejb.jar"> 
      <metainf dir="src" includes="ejb-jar.xml" /> 
      <metainf dir="src" includes="ibm-ejb-jar-bnd.xmi" /> 

      <fileset dir="your.build.classes.location"> 
       <include name="com/yourapp/ejb/**/*.*" /> 
      </fileset> 
     </jar> 
     <wsejbdeploy inputJar="pre-deploy-ejb.jar" 
          wasHome="your.websphere.home" 
          workingDirectory="dist" 
          outputJar="ejb.jar" 
          codegen="false" 
          keepGenerated="false" 
          quiet="false" 
          noValidate="true" 
          noWarnings="false" 
          noInform="false" 
          failonerror="true" 
          trace="true" 
          classpathref="your.classpath" /> 
    </target> 

在此之後,存根將被打包在ejb.jar。用這個新的jar重新部署後,我的應用程序工作得很好。 注意您需要填寫ibm-ejb-jar-bnd.xmi才能創建存根。以下是此文件的示例內容:

<ejbbnd:EJBJarBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ejbbnd="ejbbnd.xmi" xmlns:ejb="ejb.xmi" xmi:id="ejb-jar_ID_Bnd"> 
    <ejbJar href="META-INF/ejb-jar.xml#ejb-jar_ID"/> 
    <ejbBindings xmi:id="Session_ServiceManager_Bnd" jndiName="com.host.local.manager.ServiceManager"> 
    <enterpriseBean xmi:type="ejb:Session" href="META-INF/ejb-jar.xml#Session_ServiceManager"/> 
    </ejbBindings> 
</ejbbnd:EJBJarBinding> 

P.S.此外,從MACHINE1訪問(上機2)遠程豆我需要設置 C:\ WINDOWS \ SYSTEM32 \ DRIVERS \等\主機文件,並添加列表中的IP和遠程 機2名

希望此信息對某人有用。

相關問題