Recent Posts
Archives

Posts Tagged ‘xdoclet’

PostHeaderIcon (long tweet) JOnAS / GenIC / Method … of interface … should NOT throw RemoteException

Case

On generating Locals and Remotes of EJBs (let’s say JonathanBean) to be deployed on JOnAS, the GenIC raises:
[java]GenIC.fatalError : GenIC fatal error: Cannot read the Deployment Descriptors from /foo/goo/jonathan-server.jar: Method foo of interface lalou.jonathan.JonathanLocal should NOT throw RemoteException[/java]

Within the EJB2, the method foo is declared to be Local and to throw RemoteException

Quickfix

The error is explicit.

A Local EJB cannot throw RemoteException.
Especially, the considered method can be declared with the right XDocLet tag, ie:

[java]* @ejb.interface-method view-type="remote"[/java]

but can with neither:
[java]* @ejb.interface-method view-type="both"[/java]

nor:
[java]* @ejb.interface-method view-type="local"[/java]

As a quickfix, I suggest to surround with a try/catch block a throw a RuntimeException if needed.