2014-07-22 2 views
1

EJB 3.0을 작성하는 방법을 배우기 위해이 가이드 http://jonas.ow2.org/doc/JONAS_5_1_7/doc/doc-en/html/ejb3_programmer_guide.html을 따라 가겠지만, 2.3. Writing the Client Code 장 이후에 붙어 있습니다.org.omg.stub.java.rmi._Remote_Stub 비 호환성

RAD 8.5와 WAS 7.0을 사용하고 있습니다. 나는 몇 가지 솔루션을 시도했습니다

22-lug-2014 12.33.15 null null 
WARNING: WSVR0072W 
22-lug-2014 12.33.15 null null 
WARNING: WSVR0072W 
22-lug-2014 12.33.15 null null 
WARNING: WSVR0072W 
22-lug-2014 12.33.15 null null 
WARNING: WSVR0072W 
22-lug-2014 12.33.15 null null 
INFO: Client code attempting to load security configuration 
Exception in thread "P=194786:O=0:CT" java.lang.ClassCastException: org.omg.stub.java.rmi._Remote_Stub incompatible with HelloWorldInterface 
    at Client.main(Client.java:26) 

: 난 항상이 오류가 나는 EJB 프로젝트와 세션 빈을 만들었지 만 클라이언트를 실행할 때 (즉, 빈의 같은 프로젝트 및 EAR에) 하지만 결과는 없습니다. 오류를 해결하는 방법에 대한 아이디어가 있으십니까?

+0

'PortableObject.narrow()'로 시도하십시오. 나는 당신이 그것을 필요로하지 않는다고 확신하지 않는다. – EJP

+0

그럼 나를 도와 주셔서. 이미 시도했지만 문제를 해결하지 못했습니다. – DarkCoffee

답변

0

java 주 또는 JUnit 컨텍스트에서는 createEJBStubs.bat를 사용하여 EJB 3 스텁을 생성해야합니다. 당신이 스텁을 생성 한 후

<target name="export_ear"> 
    <earExport earProjectName="MyProject" earExportFile="${locationName}/MyProject.ear" exportSource="false" overwrite="true"/> 
</target> 

<target name="createStubs" depends="export_ear"> 
    <exec executable="${was.home}/bin/createEJBStubs.bat"> 
     <arg line="${locationName}/MyProject.ear" /> 
    </exec> 
</target> 

EAR 파일의 위치 -의 루트 디렉토리

locationName 설치

WAS - 나는

was.home은 ... 나를 위해 그것을 생성하는 ANT 작업을 사용하고 있습니다 MyProject.jar 및 MyProjectClient.jar을 MyProject.ear에서 추출하여 빌드 경로에 포함시켜야합니다.