错误ejb:“没有EJB接收器可用于处理”

时间:2016-12-05 13:35:46

标签: java java-ee jboss ejb wildfly

线程“AWT-EventQueue-0”中的异常java.lang.IllegalStateException:EJBCLIENT000025:没有EJB接收器可用于处理调用上下文org.jboss.ejb.client的[appName:,moduleName:,distinctName:Biblioo]组合。 EJBClientInvocationContext @ 42aee012     在org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:749)     at 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.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198)     在org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)     在org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)     at com.sun.proxy。$ Proxy0.addLivre(Unknown Source)     在clientlourd.fenetre $ 2.actionPerformed(fenetre.java:128)     在javax.swing.AbstractButton.fireActionPerformed(未知来源)     at javax.swing.AbstractButton $ Handler.actionPerformed(Unknown Source)     在javax.swing.DefaultButtonModel.fireActionPerformed(未知来源)     在javax.swing.DefaultButtonModel.setPressed(未知来源)     在javax.swing.plaf.basic.BasicButtonListener.mouseReleased(未知来源)     at java.awt.Component.processMouseEvent(Unknown Source)     在javax.swing.JComponent.processMouseEvent(未知来源)     at java.awt.Component.processEvent(Unknown Source)     at java.awt.Container.processEvent(Unknown Source)     at java.awt.Component.dispatchEventImpl(Unknown Source)     at java.awt.Container.dispatchEventImpl(Unknown Source)     at java.awt.Component.dispatchEvent(Unknown Source)     at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)     at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)     at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)     at java.awt.Container.dispatchEventImpl(Unknown Source)     at java.awt.Window.dispatchEventImpl(Unknown Source)     at java.awt.Component.dispatchEvent(Unknown Source)     at java.awt.EventQueue.dispatchEventImpl(Unknown Source)     在java.awt.EventQueue.access $ 500(未知来源)     在java.awt.EventQueue $ 3.run(未知来源)     在java.awt.EventQueue $ 3.run(未知来源)     at java.security.AccessController.doPrivileged(Native Method)     at java.security.ProtectionDomain $ JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)     at java.security.ProtectionDomain $ JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)     在java.awt.EventQueue $ 4.run(未知来源)     在java.awt.EventQueue $ 4.run(未知来源)     at java.security.AccessController.doPrivileged(Native Method)     at java.security.ProtectionDomain $ JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)     at java.awt.EventQueue.dispatchEvent(Unknown Source)     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)     在java.awt.EventDispatchThread.run(未知来源)

无法找到解决方案:\任何帮助?!

1 个答案:

答案 0 :(得分:-1)

非常感谢你!这是我的代码:

上下文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(new ActionListener(){

public void actionPerformed(ActionEvent arg0) {

                stub.addLivre(new Livre());

            }           
    });

catch(例外e)

    {

        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 =假

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

public interface 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(name =&#34; biblio&#34;)

public class biblio_Impl实现interface_remote,interface_local {

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

@覆盖

    public void addLivre(Livre L)

    {

        em.persist(L);

    }

}