2016-12-16 44 views
0

一個簡短的問題,我正在將舊的jboss 4.2.x GA grails應用程序(2.3.10)移動到wildfly 10,我正在調用我的ejb's。grails + EJB3 =沒有EJB接收器可用於處理

例如一個簡單的配置在resources.groovy文件:

jndiBinBaseTemplate(JndiTemplate) { 

    environment = [ 
      "java.naming.factory.initial": "org.jboss.naming.remote.client.InitialContextFactory", 
      "java.naming.provider.url": "http-remoting://127.0.0.1:8080".toString(), 
      "java.naming.security.principal":"test", 
      "java.naming.security.credentials":"test", 
      "jboss.naming.client.ejb.context":true, 
      "java.naming.factory.url.pkgs":"org.jboss.ejb.client.naming" 
    ] 
} 

binbaseStatus(SimpleRemoteStatelessSessionProxyFactoryBean) { 
    businessInterface = "edu.ucdavis.genomics.metabolomics.binbase.bci.server.jmx.StatusJMXFacade" 
    jndiName = "bci/bci-core/StatusJMXFacadeBean!edu.ucdavis.genomics.metabolomics.binbase.bci.server.jmx.StatusJMXFacade" 
    jndiTemplate = ref(jndiBinBaseTemplate) 
} 

始終會導致以下異常:

EJBCLIENT000025: No EJB receiver available for handling [appName:bci, moduleName:bci-core, distinctName:] combination for invocation context [email protected] Stacktrace follows: 
java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:bci, moduleName:bci-core, distinctName:] combination for invocation context [email protected] 
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:798) 
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:128) 
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186) 
at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:255) 
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:200) 
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:183) 
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:146) 
at minix.BinBaseClusterController$_closure4.doCall(BinBaseClusterController.groovy:29) 
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565) 
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1360) 
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331) 
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331) 
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331) 
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:477) 
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) 
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:539) 
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227) 
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031) 
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406) 
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186) 
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965) 
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) 
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:288) 

沒有任何人有任何想法,缺什麼?這似乎是grails特有的,因爲我的arquillian測試遠程ejb的工作很好,否則。

回答

0

由於某種原因,我無法解釋。這是通過使用兩個jndi配置選項來解決的。

ressrouces.groovy:

binbaseProperties(org.springframework.beans.factory.config.MapFactoryBean){ sourceMap = [

  "java.naming.factory.initial": "org.jboss.naming.remote.client.InitialContextFactory", 
      "java.naming.provider.url": "http-remoting://${BinBaseConfigReader.getServer()}:8080", 
      "${Context.SECURITY_PRINCIPAL}":"binbase", 
      "${Context.SECURITY_CREDENTIALS}":"binbase", 
      "jboss.naming.client.ejb.context":true, 
      "java.naming.factory.url.pkgs":"org.jboss.ejb.client.naming", 
      "org.jboss.ejb.client.scoped.context": true, 
      "endpoint.name":"client-endpoint", 


      "remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED":false, 
      "remote.connections":"default", 
      "remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS":false, 
      "remote.connection.default.host":"${BinBaseConfigReader.getServer()}", 
      "remote.connection.default.port":"8080", 
      "remote.connection.default.protocol":"http-remoting", 
      "remote.connection.default.username":"binbase", 
      "remote.connection.default.password":"binbase" 


    ] 

}

resources.xml中

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
         http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd"> 

<jee:remote-slsb environment-ref="binbaseProperties" id="binbaseStatus" 
       jndi-name="ejb:bci/bci-core//StatusJMXFacadeBean!edu.ucdavis.genomics.metabolomics.binbase.bci.server.jmx.StatusJMXFacade" 
       business-interface="edu.ucdavis.genomics.metabolomics.binbase.bci.server.jmx.StatusJMXFacade" 
       lazy-init="true" /> 

如果沒有提供remote.connection.default屬性,它只會失敗,並在服務器端發現類未找到錯誤,並顯示該無用的錯誤消息。

相關問題