2016-12-05 84 views
-2

線程「AWT-EventQueue-0」中的異常java.lang.IllegalStateException:EJBCLIENT000025:沒有可用於處理[appName :, moduleName :, distinctName:Biblioo]的EJB接收器組合用於調用上下文在org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:749) [email protected] 在org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor。的java:116)在org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183) 在org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253) 在org.jboss。 ejb.client.EJBInvocationHand ler.doInvoke(EJBInvocationHandler.java:198) 在org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181) 在org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144) 在com.sun.proxy。$ Proxy0.addLivre(來源不明) 在clientlourd.fenetre $ 2.actionPerformed(fenetre.java:128) 在javax.swing.AbstractButton.fireActionPerformed(來源不明) 在javax.swing中。 AbstractButton的$ Handler.actionPerformed(來源不明) 在javax.swing.DefaultButtonModel.fireActionPerformed(來源不明) 在javax.swing.DefaultButtonModel.setPressed(來源不明) 在javax.swing.plaf.basic.BasicButtonListener.mouseReleased(未知來源) 在jav a.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) 在java.awt.Component.dispatchEventImpl(未知來源) 在java.awt.Container.dispatchEventImpl(未知來源) 在java.awt.Component.dispatchEvent(未知來源) 在java.awt.LightweightDispatcher.retargetMouseEvent(未知來源) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at j ava.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access $ 500(Unknown Source ) at java.awt.EventQueue $ 3.run(Unknown Source) at java.awt.EventQueue $ 3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain $ JavaSecurityAccessImpl.doIntersectionPrivilege(來源不明) 在java.security.ProtectionDomain $ JavaSecurityAccessImpl.doIntersectionPrivilege(來源不明) 在java.awt.EventQueue中的$ 4.run(來源不明) 在java.awt.EventQueue中的$ 4.run(來源不明) 在java.security.AccessController.doPrivileged(本機方法) 在java.security.ProtectionDomain $ JavaSecurityAccessImpl.doIntersectionPrivilege(來源不明) 在java.awt.EventQueue.dispatchEvent(來源不明) 在java.awt.EventDispatchThread.pumpOneEventForFilters (未知來源) 在java.awt.EventDispatchThread.pumpEventsForFilter(未知來源) 在java.awt.EventDispatchThread.pumpEventsForHierarchy(未知來源) 在java.awt.EventDispatchThread.pumpEvents(未知來源) 在java.awt.EventDispatchThread .pumpEvents(未知源) at java.awt.EventDispatchThread。運行(Unknown Source)錯誤ejb:「沒有可用於處理的EJB接收器」

找不到解決方案:\ any help?!

+0

我們展示你的代碼。 –

+1

[JNDI沒有可用於處理的EJB接收器]可能的副本(http://stackoverflow.com/questions/36293301/jndi-no-ejb-receiver-available-for-handling) –

+0

這個問題有十多個答案已經在SO上。你看過他們中的任何一個嗎? –

回答

0

非常感謝你!這裏是我的代碼:

上下文ctx = null;

try{ 
     Properties p = new Properties(); 
     p.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming"); 
     ctx = new InitialContext(p); 
     final interface_remote stub =(interface_remote) ctx.lookup("ejb://Biblioo//biblio!bib.interface_remote"); 

JButton button = new JButton(「Ajouter」);
button.addActionListener(新的ActionListener(){

public void actionPerformed(ActionEvent arg0) { 

       stub.addLivre(new Livre()); 

      }   
    }); 

趕上(例外五)

{ 

     e.toString(); 

    } 
    finally 
    { 
     try { 
      ctx.close(); 
     } catch (NamingException e) { 
      // TODO Auto-generated catch block 
      e.printStackTrace(); 
     } 
    } 

endpoint.name =客戶端點

remote.connectionprovider.create。 options.org.xnio.Options.SSL_ENABLED = false

個remote.connections =默認

remote.connection.default.host = 127.0.0.1

remote.connection.default.port = 8080

remote.connection.default.connect.options.org。 xnio.Options.SASL_POLICY_NOANONYMOUS =假

remote.connection.default.username =管理員

remote.connection.default.password =


@Remote

公共接口interface_remote {

public void addLivre(Livre L); 
public List<Livre> consulterLivres(); 
public Livre consulterlivres(Long ID_livre); 
public void updateLivre(Livre L); 
public void supprimerLivre(Long ID_livre); 

}


@Stateless(名稱= 「文獻記錄」)

公共類biblio_Impl實現interface_remote,interface_local {

@PersistenceContext(unitName="Biblio") 
private EntityManager em; 

@覆蓋

public void addLivre(Livre L) 

    { 

     em.persist(L); 

    } 

}