Posts Tagged ‘GenIC’
(long tweet) JOnAS / GenIC / Method … of interface … should NOT throw RemoteException
Case
On generating Local
s and Remote
s of EJBs (let’s say JonathanBean
) to be deployed on JOnAS, the GenIC raises:
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
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:
* @ejb.interface-method view-type="remote"
but can with neither:
* @ejb.interface-method view-type="both"
nor:
* @ejb.interface-method view-type="local"
As a quickfix, I suggest to surround with a try/catch
block a throw a RuntimeException
if needed.
Problems when invoking main method from GenIC … error in fastrmic
Case
Trying to deploy an EAR on JOnAS, I got the following error:
Problems when invoking main method from GenIC: java.lang.RuntimeException: error in fastrmic (null)
More detail:
JOnASEJBService.__checkGenIC : Cannot apply GenIC on the file 'C:\jonathan\jonathan_2012.05.11-13.47.29.ear\jonathan-server.jar' with the args '[-classpath, C:\jonathan\jonathan_2012.05.11-13.47.29.ear\jonathan-server.jar, -protocols, jrmp, -invokecmd]'. org.ow2.jonas.service.ServiceException : Problems when invoking main method from GenIC: java.lang.RuntimeException: error in fastrmic (null) at org.ow2.jonas.generators.genic.wrapper.GenicServiceWrapper.callGenic(GenicServiceWrapper.java:79) at org.ow2.jonas.ejb2.internal.JOnASEJBService.__callGenic(JOnASEJBService.java:2017)
Quickfix
Edit $JONAS_BASE/conf/jonas.properties
.
The properties jonas.services
and jonas.service.ejb2.auto-genic
must be consistent.
Especially, if GenIC is enabled (jonas.service.ejb2.auto-genic true
), then check ejb2 is among the services pointed at by jonas.services
, eg:
jonas.services jtm,db,security,resource,
ejb2
,web,ear
.