Domanda

I'm building multiple DAO's that consists of two other DAO's. I have made a generic class to handle invocations on the sub-dao's, since this is always the same.

My problem is that for this to work, i had to put an interface containing only methods (not marked local or remote!) on the sub-dao's. All dao's are stateless beans.

When i try to @EJB the dao's however, i get:

com.dao.EJSLocal0SLSomeDao_85a3a0b7 cannot be cast to com.dao.SomeDao

Is there any way to tweak this so i can use an interface not related to Local or Remote?

Kind Regards Tom

È stato utile?

Soluzione

If you need to cast the bean implementation class, then you need to use no-interview view (that is, annotate the EJB with @LocalBean). If you look up an unrelated interface, you can the proxy that is returned can only be cast to that specific interface.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top