너무 크고 획일적 인 원격 Bean이있는 레거시 시스템에서 작업 중이며 추가해야 할 새로운 기능을 별도로 유지하려고합니다.서로 다른 원격 객체 간의 원격 EJB 기능 분할
나의 초기 아이디어는 새로운 인터페이스를 기존 인터페이스에 추가하는 대신 모든 물건을 사용하여 새 인터페이스를 만들고 내 인터페이스를 구현하는 원격 객체를 반환하는 단일 메서드를 추가하는 것이 었습니다.
지금 당면한 문제는 객체를 반환하는 메서드를 호출 할 때 런타임이 스텁을 보내는 대신 직렬화하려고한다는 것입니다.
코드 레이아웃이 더 많거나 적은 같은 것입니다 :
@Stateless
public class OldBean implements OldRemoteInterface {
//lots of the old unrelated methods here
public MyNewStuff getMyNewStuff() {
return new MyNewStuff();
}
}
@Remote
public interface OldRemoteInterface {
//lots of the old unrelated methods declared here
MyNewStuff getMyNewStuff();
}
public class MyNewStuff implements NewRemoteInterface {
//methods implemented here
}
@Remote
public interface NewRemoteInterface {
//new methods declared here
}
내가 점점 오전 예외입니다 :
"IOP00810267: (MARSHAL) An instance of class MyNewStuff could not be marshalled:
the class is not an instance of java.io.Serializable"
내가 확장, "옛날 방식을"그것을 위해 노력했다 내가 할 java.rmi.Remote
대신 EJB @Remote
주석을 사용하는 인터페이스 및 예외입니다 :
"IOP00511403: (INV_OBJREF) Class MyNewStuff not exported, or else is actually
a JRMP stub"
나는 분명해야 할 뭔가를 놓쳐 버렸음을 안다. :/
"검은 마법"이 수행 될 것으로 예상했습니다. @Remote 주석이 추가 된 후드에서 – fortran
나는 그것이 그랬 더라면 좋겠다고 생각한다! :) – Renan