Hi,
I'm developing a J2EE application with EJB and Hibernate in JBoss.
In an EJB method, it loads a Member object from Hibernate session then call assignGroup(String) method. The assignGroup method may throw InvalidGroupException.
try {
member.assignGroup(group);
} catch(InvalidGroupException ex) {
...
return GROUP_ERROR_CODE;
}
When I test it by assigning an invalid group, I expect the codes inside the catch block is executed and GROUP_ERROR_CODE is returned. However, I get the following exception in EJB client:
java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.lang.ClassNotFoundException: com.caplogic.InvalidGroupException
(no security manager: RMI class loader disabled)
Then I modify the EJB method, the member object is constructed instead of loaded from Hibernate session. This time I get the expected result. Why?
Thanks for your help.
|