Note that there are some explanatory texts on larger screens.

plurals
  1. POJBoss 7: No EJB receiver available
    primarykey
    data
    text
    <p>I'm pretty newbie with JBoss 7. I'm facing strange behaviour. Sometimes, when I try to invoke a session bean, I run into the following exception:</p> <pre><code>com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.util.List myServlet.getData() throws myException' threw an unexpected exception: java.lang.IllegalStateException: No EJB receiver available for handling [appName:myAppNameEE,modulename:myModuleEJB,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@3e23bd28 </code></pre> <p>It usually happens when run my GWT application from Eclipse. The exception does not occur always. Sometimes it occurs fewer than others. Sometimes it occurs pretty every time I call a session bean and it's a pain. I read tutorial (https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI?_sscc=t) and I am pretty sure to have the jboss-ejb-client.properties in the right place.</p> <p>my jboss-ejb-client looks like:</p> <p><code>endpoint.name=myAppEE/myAppEJB remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false remote.connections=default remote.connection.default.host=localhost remote.connection.default.port = 4447 remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false</code></p> <p>it is located in:</p> <p><code>myAppEJB\ejbModule\com\myApp\ejb\conf</code></p> <p>The businness delegate:</p> <pre><code>public class myAppServerDelegate extends ServerDelegate{ private Logger logger = Logger.getLogger(myAppServerDelegate.class.getName()); private myAppRemote theSession = null; public myAppServerDelegate() throws Exception { try { theSession = (myAppRemote) getJndiContext().lookup(getJindiLookupName(myAppServerDelegate.class, myAppRemote.class)); } catch (NamingException e) { throw (e); } } public List&lt;myDataDTO&gt; getAllmyDataBy(String a, String b, String c, String d,Integer e, Integer f) throws ServerDelegateException { return theSession.getAllmyDataBy(a, b, c, d,e,f); } public Integer getCountmyDataBy(String a, String b, String c, String d) throws ServerDelegateException { return theSession.getCountmyDataBy(a, b, c, d); } ... public String getServiceMessage() { return theSession.getServiceMessage(); } ... } </code></pre> <p>The session bean:</p> <pre><code>@Stateless public class myAppSession implements myAppRemote { private Logger logger = Logger.getLogger(myAppSession.class.getName()); @PersistenceContext protected EntityManager entityManager; @EJB private myAppHomeLocal beanmyApp; ... public String getServiceMessage() { return "MESSAGGIODISERVIZIO"; } public List&lt;myDataDTO&gt; getAllmyDataBy(String a,String b, String c, String d,Integer e, Integer f) throws ServerDelegateException { logger.info("myAppSession.getAllmyDataBy."); List&lt;myData&gt; entityList = findByParms(a, b, c, d,e,f); return myDataAssemblyDTO.getmyDataDTOList(entityList); } public Integer getCountmyDataBy(String a,String b, String c, String d) throws ServerDelegateException { return findByParmsCount(a, b, c, d); } ... } </code></pre> <p>The servlet:</p> <pre><code>... </code></pre> <p>@SuppressWarnings("serial")</p> <p>public class MyGenericServiceImpl extends RemoteServiceServlet implements MyGenericService {</p> <pre><code>private MyAppServerDelegate myAppServerDelegate = null; public MyGenericServiceImpl() throws Exception{ super(); myAppServerDelegate = new MyAppServerDelegate(); } private MyAppServerDelegate getDelegate() { return myAppServerDelegate; } private myGWTException buildLocalExceptionFromServerException(ServerDelegateException sde) { myGWTException x = new myGWTException(); x.setParms(sde.guiMessage,sde.timestamp,sde.tipoEvento); return x; } @Override public PagingLoadResult&lt;myDataBean&gt; getAllmyDataBy(String a, String b, String c, PagingLoadConfig plc) throws MyGWTException { try { String cs = ((UserSessionBean)this.getThreadLocalRequest().getSession().getAttribute("user")).getCodiceStudio(); List&lt;myDataBean&gt; tsb = MyDataClientAssembly.getMyDataBeanList(myAppServerDelegate.getAllmyDataBy(cs, a, b, c, plc.getOffset(), plc.getLimit())); return new BasePagingLoadResult&lt;MyDataBean&gt;(tsb, plc.getOffset(), myDataServerDelegate.getCountmyDataBy(cs, a, b, c)); } catch (ServerDelegateException sde) { throw buildLocalExceptionFromServerException(sde); } } @Override public String getServiceMessage() { return getDelegate().getServiceMessage(); } @Override public Integer getCountmyDataBy(String a, String b, String c) throws AmbrogioGWTException { try { String cs = ((UserSessionBean)this.getThreadLocalRequest().getSession().getAttribute("user")).getCs(); return myAppServerDelegate.getCountmtDataBy(cs, a, b, c); } catch (ServerDelegateException sde) { throw buildLocalExceptionFromServerException(sde); } } } </code></pre> <p>The serverdelegate:</p> <pre><code>public class ServerDelegate { static public String getJindiLookupName( Class&lt;?&gt; theBeanClass, Class&lt;?&gt; theSessionClass) throws NamingException { String jbossServerName = System.getProperty("jboss.server.name"); if (jbossServerName== null || "".equals(jbossServerName)){ return "myAppEE/myAppEJB/"+ theBeanClass.getSimpleName() + "!" + theSessionClass.getName(); }else{ return "java:global/myAppEE/myAppEJB/" + theBeanClass.getSimpleName() + "!" + theSessionClass.getName(); } } static public Context getJndiContext() throws NamingException { System.out.println("ServerDelegate.getJndiContext"); final Properties jndiProperties = new Properties(); String jbossServerName = System.getProperty("jboss.server.name"); if (jbossServerName== null || "".equals(jbossServerName)){ jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, org.jboss.naming.remote.client.InitialContextFactory.class.getName()); jndiProperties.put(Context.PROVIDER_URL, "remote://localhost:4447"); jndiProperties.put("jboss.naming.client.ejb.context", true); jndiProperties.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false"); } return new InitialContext(jndiProperties); } } </code></pre> <p>I can't figure out what's going on. TIA.</p> <p>Francesco</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload