glassfish - Failed to create EJB in REST service -


i have problem injecting ejb inside of rest service (using jersey on glassfish 3.2 server) , i'm puzzled.

i have ejb interface declared as:

import javax.ejb.local;  @local public interface testservicelocal {      public string gettext(); } 

and class bean implements it:

import javax.ejb.local; import javax.ejb.stateless;  /**  * session bean implementation class testservice  */ @stateless @local(testservicelocal.class) public class testservice implements serializable, testservicelocal {      private static final long serialversionuid = 1l;      /**      * default constructor.      */     public testservice() {         // todo auto-generated constructor stub     }      @override     public string gettext() {         return this.getclass().getname();     }  } 

the rest service looks like:

@path("/service") @stateless public class testrestservice {      @ejb(beanname="testservice")     private testservicelocal testservice;      public testrestservice () {     }      @get     @produces(mediatype.text_plain)     @path("/events")     public string gettext() {         return testservice.gettext();     } } 

the problem when rest service called bean cannot created:

severe: ejb5070: exception creating stateless session bean : [testrestservice] warning: ejb5184:a system exception occurred during invocation on ejb testrestservice, method: public java.lang.string testrestservice.gettext() warning: javax.ejb.ejbexception: javax.ejb.ejbexception: javax.ejb.createexception: not create stateless ejb     @ com.sun.ejb.containers.statelesssessioncontainer._getcontext(statelesssessioncontainer.java:454)     @ com.sun.ejb.containers.basecontainer.getcontext(basecontainer.java:2547)     @ com.sun.ejb.containers.basecontainer.preinvoke(basecontainer.java:1899)     @ com.sun.ejb.containers.ejblocalobjectinvocationhandler.invoke(ejblocalobjectinvocationhandler.java:212)     @ com.sun.ejb.containers.ejblocalobjectinvocationhandlerdelegate.invoke(ejblocalobjectinvocationhandlerdelegate.java:88)     @ com.sun.proxy.$proxy839.gettext(unknown source) 

i had took @ answers posted here none of them seemed work me. appreciated. thank you!

ps: forgot mentioned (don't know if it's relevant). project created under eclipse juno dynamic web project.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -