Either both the local-home and the local elements or both the home and the remote elements must be specified.
EJB CatalogService has defined EJB2.x remote component interface of be.work.apps.bookstore.ejb.service.ICatalogService but has no home; ; Incomplete EJB2.x View [JBMETA-130]
Logan Lee wrote:
but, now I receive a nullpointer in my servlet: catalogService is null. It seems the bean isn't injected...
Logan Lee wrote:
so I decided to write a small client to test the bean via JNDI lookup. the lookup fails with a ClassCastException.
Exception in thread "main" java.lang.ClassCastException: javax.naming.Reference
When a servlet is packaged standalone (outside ear) and an EJB is packaged standalone, the EJB can't be injected into the servlet without specifying a JNDI name somewhere.
Jaikiran Pai wrote:
Logan Lee wrote:
so I decided to write a small client to test the bean via JNDI lookup. the lookup fails with a ClassCastException.
Exception in thread "main" java.lang.ClassCastException: javax.naming.Reference
For this you will require the jbossall-client.jar and all the jar files listed in the META-INF/MANIFEST.MF of that jar, to be present in the client's classpath. Those jars are available in the JBOSS_HOME/client folder.
Csaba Toth wrote:
Jaikiran Pai wrote:
I faced this exception during test runs. I added the JBOSS_HOME/client folder to the classpath of the xyzTest.java file, but I still get the exception. What am I doing wrong?
Additional comments:
1. Only my test runs didn't work, when I deployed the application it could communicate. So there must be some problem with the difference between the execution environment, version numbers of jars, classpath in case of the test. I even installed the 5.1.0.GA jbossall-client from the JBOSS_HOME/client directory into my Maven repository, to use exactly the same versions. I use the jdk6 version of 5.1.0.GA JBoss, 1.6.0_21 SUN JDK.
2. if I remove the ejb-jar.xml from my EJB module, my app deploys OK, but it can't find the EJB any more, so not just the tests doesn't work, but the real life app any more.
Don't get me started about those stupid light bulbs. |