users@glassfish.java.net

Injection problems

From: <glassfish_at_javadesktop.org>
Date: Fri, 01 Jun 2007 02:52:20 PDT

I've deployed an application as an EAR and are experiencing problems using a stateless session bean. <br>
<br>
At first I got a ClassNotFoundException on the bean interface, but after including the ejb jar in the manifest class-path (for the EAR file), this exception disappeared. So seemingly the container is able to find the bean interface class. <br>
<br>
What I'm experiencing now is a NullPointerException when accessing the bean. <br>
<br>
The bean is declared like this (in a non-bean class):<br>
<tt>@EJB EntityService bean;</tt><br>
<br>
Then, in a method, I try to use the bean:<br>
<tt>return bean.findRecord( entityClass, query );</tt><br>
<br>
[#|2007-06-01T10:55:47.609+0200|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=14;_ThreadName=httpSSLWorkerThread-8081-0;_RequestID=4961034f-f517-4a64-a8ea-dffaa04cce18;|java.lang.NullPointerException
        at com.bluebricks.net.sql.DbConnSQL.getRecord(DbConnSQL.java:60)<br>
<br>
I've tried printing the entityClass and query parameters, and these are not null. It is the bean object that is null, so it can't have been injected as it should.<br>
<br>
I'm using Glassfish V2.<br>
<br>
Any thoughts would be greatly appreciated.<br>
<br>
Regards<br>
Marius<br>
[Message sent by forum member 'mariusw' (mariusw)]

http://forums.java.net/jive/thread.jspa?messageID=219929