geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: inject EJB in Webapplication
Date Wed, 21 Jan 2009 20:25:27 GMT
Is the ear that contains the ejb running when you get this error?

When an ejb app starts, openejb prints the global jndi names it binds  
the ejbs under in ${geronimo.home}/var/log/geronimo.log.  Can you look  
and see what name your ejb is actually bound under?

thanks
david jencks

On Jan 21, 2009, at 11:23 AM, Oddward wrote:

>
> Hello,
>
> i have a Webservice that needs access an EJB inside an EAR. Im using
> geronimo 2.1 with tomcat. I followed these instructions
> http://cwiki.apache.org/GMOxDOC21/referring-to-an-ejb-from-outside-its-ear.html
> with no result. I think its for EJBs not Servlets.
>
> here some code snipits:
>
>
> Webserviceclass:
> 	@EJB(name="dispatcher")
> 	protected MpeMessageDispatcherInterface mpe;
> Web.xml:
>   <dep:environment>
>        <dep:moduleId>
>            <dep:groupId>com.webservice.app</dep:groupId>
>            <dep:artifactId>appwebservice</dep:artifactId>
>            <dep:version>1.0</dep:version>
>            <dep:type>car</dep:type>
>        </dep:moduleId>
>         <sys:dependencies>
>            <sys:dependency>
>                <sys:groupId>myadear</sys:groupId>
>                <sys:artifactId>myad-ear</sys:artifactId>
>                <sys:version>1.0</sys:version>
>            	<sys:type>car</sys:type>
>            </sys:dependency>
>    </sys:dependencies>
>    </dep:environment>
>    <web:context-root>/IPhoneAppWS</web:context-root>
>    <name:ejb-ref>
>    	<name:ref-name>dispatcher</name:ref-name>
>    	<name:pattern>
>    		<name:groupId>my-ear</name:groupId>
> 	    	<name:artifactId>myear</name:artifactId>
> 	    	<name:version>1.0</name:version>
> 	    	<name:name>MpeMessageDispatcher</name:name>
>    	</name:pattern>
>    </name:ejb-ref>
> </web:web-app>
>
> EJBinterface:
> @Remote
> public interface MpeMessageDispatcherInterface {
>
> EJB:
> @Stateless(name="MpeMessageDispatcher")
> public class MpeMessageDispatcher implements  
> MpeMessageDispatcherInterface {
>
> javax.xml.ws.WebServiceException: Service resource injection failed
> ....
> Caused by: java.lang.InstantiationException: Some objects to be  
> injected
> were not found in jndi: [javax.naming.NameNotFoundException: Name
> "java:openejb/Deployment/myear/MpeMessageDispatcher/ 
> myear.mpe.MpeMessageDispatcherInterface"
> not found.]
> 	at  
> org.apache.geronimo.j2ee.annotation.Holder.newInstance(Holder.java: 
> 171)
> 	at
> org 
> .apache 
> .geronimo 
> .jaxws 
> .annotations.AnnotationHolder.newInstance(AnnotationHolder.java:39)
> 	at  
> org.apache.geronimo.cxf.pojo.POJOEndpoint.<init>(POJOEndpoint.java:76)
> 	... 65 more
> inject
>
> thx
>
>
>
> -- 
> View this message in context: http://www.nabble.com/inject-EJB-in-Webapplication-tp21590354s134p21590354.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>


Mime
View raw message