JBoss AS 7.1 ERROR: JBREM000200: Remote connection failed:

I have two projects, one is running on the server (JBoss AS 7.1) and the other is on a client that can communicate with the server.

Both are on the same machine.

Eclipse workspace image

Here is my code from the Main.java class which is in the client project.

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class Main {
    public static void main(String[] args) {
        CalculetteService calculette = null;
        try {
            Context    context = new InitialContext();
            calculette = (CalculetteService) context.lookup("ejb:/Analyzator-Server//CalculetteServiceImpl!CalculetteService");
            System.out.println("Vysledok je: " + calculette.add(10, 10));
        } catch (NamingException e) {
            e.printStackTrace();
        }
    }
    public Main() {
        super();
    }

}

      

After trying to run it, I get this error:

apr 29, 2015 4:26:12 PM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.3.GA
apr 29, 2015 4:26:12 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.3.GA
apr 29, 2015 4:26:12 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.2.GA
apr 29, 2015 4:26:13 PM org.jboss.remoting3.remote.RemoteConnection handleException
ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed]
    at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:36)
    at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:117)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at Main.main(Main.java:9)
Caused by: java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
    at org.jboss.naming.remote.protocol.IoFutureHelper.get(IoFutureHelper.java:87)
    at org.jboss.naming.remote.client.cache.ConnectionCache.get(ConnectionCache.java:42)
    at org.jboss.naming.remote.client.InitialContextFactory.createConnection(InitialContextFactory.java:153)
    at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateConnection(InitialContextFactory.java:126)
    at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:106)
    ... 5 more
Caused by: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
    at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:365)
    at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:214)
    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
    at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
    at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
    at org.xnio.nio.NioHandle.run(NioHandle.java:90)
    at org.xnio.nio.WorkerThread.run(WorkerThread.java:184)
    at ...asynchronous invocation...(Unknown Source)
    at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:270)
    at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:251)
    at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:349)
    at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:333)
    at org.jboss.naming.remote.client.cache.EndpointCache$EndpointWrapper.connect(EndpointCache.java:110)
    at org.jboss.naming.remote.client.cache.ConnectionCache.get(ConnectionCache.java:41)
    ... 8 more

      

I tried everything I could find on the internet but nothing seems to help.

Here is part of my standalone.xml otherwise set to default

<interfaces>
    <interface name="management">
        <inet-address value="${jboss.bind.address:127.0.0.1}"/>
    </interface>
    <interface name="public">
        <inet-address value="${jboss.bind.address:127.0.0.1}"/>
    </interface>
</interfaces>

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    <socket-binding name="http" port="8080"/>
    <socket-binding name="https" port="8443"/>
    <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
    <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9980}"/>
    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
    <socket-binding name="osgi-http" interface="management" port="8090"/>
    <socket-binding name="remoting" port="4447"/>
    <socket-binding name="txn-recovery-environment" port="4712"/>
    <socket-binding name="txn-status-manager" port="4713"/>
    <outbound-socket-binding name="mail-smtp">
        <remote-destination host="localhost" port="25"/>
    </outbound-socket-binding>
</socket-binding-group>

      

And my jndi.properties which are also in the client project

java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
java.naming.provider.url = remote\://localhost\:4447
jboss.naming.client.ejb.context=true
java.naming.factory.url.pkgs=org.jboss.ejb.client.naming

      

The server is working fine with no errors.

I would be very grateful for your help because I don't know what else to try. Thank you for your time.

+3


source to share





All Articles