[jboss-user] java.lang.reflect.UndeclaredThrowableException

Pasquale Imbemba p.imbemba at gmail.com
Fri Nov 6 08:22:11 EST 2009


Hi all,

I'm beginning ejb3.0.

I have the following stuff inside a server package, I deploy on my JBoss
4.0.4-GA:
FooBarBean.java - a stateless session bean
FooBarException.java - an extension of Exception
FooBarRemote.java - the remote interface

A method in FooBarRemote throws FooBarException.
FooBarBean implements FooBarRemote (and thus throws the FooBarException).

On another package, on the same project folder, I have a FooBarClient.java
that connects to JBoss via jnp and looks sup JNDI to get the right bean and
uses its method.

I start the JBoss server, create a Remote debug config inside eclipse where
I enter the project folder, connection type is standard (socket attach),
host is localhost and port is 8000 (I have configured eclipse to bypass
proxy for localhost). I launch the remote debug and it is fine.
When I run the client, I am able to debug up to the point where I pass
FooBarBean an invalid parameter, for which I except to see the
FooBarException printed on the console.
Some thing like
input is i=1
if ( i<0){
throw new FooBarException("1 is greater than 0").

But I get the above java.lang.reflect.UndeclaredThrowableException on a
proxy0 back caused by  java.lang.ClassNotFoundException.

I've double checked: the client invokes the correct bean and the method call
is made between try catch, catching FooBarException (the client would
syserrprint the FooBarException to the console). If the input is valid,
everything is fine.
I'm not sure how I should interpret this error: Does it mean that JBoss is
unaware of the FooBarException class? (It's in the jar however).

Any hints?
Thanks in advance,
~pasquale
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20091106/6a3b04bf/attachment.html 


More information about the jboss-user mailing list