I have a situation like this:
class myEx extends Exception {}
class MyEx1 extends MyEx {}
class A
{
public void method1() throws MyEx1
{
}
}
class B extends GenericPortlet
{
public void processAction(ActionRequest request, ActionResponse response) throws PortletException, PortletSecurityException, IOException
{
try {
A a = new A();
a.method1();
}
catch (MyEx1) {
}
catch (myEx) {
}
catch (Exception) {
}
}
}
why is it possible that when i throw an MyEx1 in A.method1 i can't catch it in my instance of B as MyEx1 or MyEx. I can only catch it as an Exception. I also try to cast it to MyEx1 but it didn't work.
I'm using JBoss and JBoss Portal