-
15. Re: Unable to access no-interface EJB that extends an Abstract Impl
jaikiran Jul 17, 2011 11:36 PM (in response to nikida78)Adams Tan wrote:
Sorry, a noob question here, can I test against the latest nightly build to try you fix?
Yes, you can. The binaries are available for download. Follow this thread http://community.jboss.org/thread/167590
-
16. Re: Unable to access no-interface EJB that extends an Abstract Impl
nikida78 Aug 5, 2011 4:29 AM (in response to jaikiran)I tried a nightly build (16 Jul 2011), and the problem seems solved, until I hit a variant of the same problem...
Basically, I had several business interfaces that had some common methods (such as count), hence I had a super interface called FacadeLocal. See following codes:
public interface FacadeLocal<T> { int count(); } public interface VehicleFacadeLocal extends FacadeLocal<T> { //inherits all parent interface methods } public abstract class AbstractFacade<T> { private Class<T> entityClass; public AbstractFacade(Class<T> entityClass) { this.entityClass = entityClass; } protected abstract EntityManager getEntityManager(); } @Stateless public class VehicleFacade extends AbstractFacade<Vehicle> implements VehicleFacadeLocal { @PersistenceContext(unitName = "testfacadePU") private EntityManager em; protected EntityManager getEntityManager() { return em; } public VehicleFacade() { super(Vehicle.class); } } @Named @SessionScoped public class WebBean implements Serializable { @Inject private VehicleFacadeLocal vf; //calls the business interface instead of implementation public int getVehicleCount() { return vf.count(); } }
Now when I run, I get an exception that says View of type interface x.y.FacadeLocal not found on bean.
I believe it is the same problem, but any use case. Since I have a lot of business interfaces, which quite a number of common ones, this implementation would be important to me.
Hoping for help, thanks!
-
17. Re: Unable to access no-interface EJB that extends an Abstract Impl
jaikiran Aug 5, 2011 4:37 AM (in response to nikida78)Adams Tan wrote:
I tried a nightly build (16 Jul 2011),
Please try the latest one.
Adams Tan wrote:
Now when I run, I get an exception that says View of type interface x.y.FacadeLocal not found on bean.
I believe it is the same problem, but any use case. Since I have a lot of business interfaces, which quite a number of common ones, this implementation would be important to me.
Hoping for help, thanks!
If the latest build has the same issue, please post the entire exception stacktrace.
-
18. Re: Unable to access no-interface EJB that extends an Abstract Impl
nikida78 Aug 8, 2011 1:27 AM (in response to jaikiran)I haven't been able to download the nightly build, seems like the site is down or has exceed maximum number of connections.
Anyway, I did some digging, and realised Glassfish 3.1.1 had the same issues. However, after changing the @Inject to @EJB instead, both Glassfish and JBoss 7 (nightly - 17 Jul) worked.
I'll try out the latest nightly before posting a full stacktrace.