[jboss-user] [EJB 3.0] - Re: @EJB injection in JBoss 5 application clients?

Wolfgang Knauf do-not-reply at jboss.com
Sun Oct 12 15:10:13 EDT 2008


I placed a sample at http://www.informatik.fh-wiesbaden.de/~knauf/private/Stateless_BrokenAppClient.ear (created with Eclipse/WTP and includes sources). Hopefully, someone can take a look at it and tell me whats wrong.

The app client is this:
public class GeometricModelApplicationClient
  | {
  |   @EJB()
  |   public static GeometricModelRemote geometricModel;
  |   
  |   public static void main(String[] args)
  |   {
  |     ...
  |     double dblVolume = geometricModel.computeCuboidVolume(10, 5, 7);
  |     ...
  |   }
  | }

I have no deploy descriptors in the app client project (actually, "application-client.xml" and "jboss-client.xml" exist, but are renamed so that they don't work).

Deploying this sample results in:
 21:03:16,921 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/temp/jboss-5.0.0.CR2/server/default/tmp/jsr88/Stateless.ear state=PreReal mode=Manual requiredState=Real
  | org.jboss.deployers.spi.DeploymentException: Error deploying StatelessClient.jar: failed to initialize bean container 
  | 	at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:209)
  | 	at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:108)
  | 	at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
  | 	...
  | Caused by: java.lang.IllegalStateException: Null beannMetaData
  | 	at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.setupMetaDataLists(BeanInterceptorMetaDataBridge.java:266)
  | 	at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.initialise(BeanInterceptorMetaDataBridge.java:186)
  | 	at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.<init>(BeanInterceptorMetaDataBridge.java:112)
  | 	at org.jboss.ejb3.interceptors.metadata.AdditiveBeanInterceptorMetaDataBridge.<init>(AdditiveBeanInterceptorMetaDataBridge.java:48)
  | 	at org.jboss.ejb3.aop.BeanContainer.initialize(BeanContainer.java:193)
  | 	at org.jboss.ejb3.EJBContainer.<init>(EJBContainer.java:240)
  | 	... 83 more
  | Caused by: java.lang.NullPointerException
  | 	at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.setupMetaDataLists(BeanInterceptorMetaDataBridge.java:219)
  | 	... 88 more

If I add "jboss-client.xml", the error is gone, but my EJB variable is always null.
I tried to add a "jndi.properties" file, but this did not make any change.

By declaring an environment reference and performing a JNDI lookup, I can access the bean.

Thanks

Wolfgang

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4181710#4181710

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4181710



More information about the jboss-user mailing list