0 Replies Latest reply on Jan 5, 2015 10:56 AM by duracel

    SaslException on init InitialContext()

    duracel

      Hello, i can't get rid of an exception SaslException on init InitialContext()

       

      Exception in thread "main" 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:121)
        at javax
      .naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
        at javax
      .naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
        at javax
      .naming.InitialContext.init(InitialContext.java:242)
        at javax
      .naming.InitialContext.<init>(InitialContext.java:192)
        at client
      .test.MainTest.main(MainTest.java:12)
      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.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:56)
        at org
      .jboss.naming.remote.client.InitialContextFactory.getOrCreateCachedNamingStore(InitialContextFactory.java:166)
        at org
      .jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:139)
        at org
      .jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:104)
        
      ... 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.EndpointCache$EndpointWrapper.connect(EndpointCache.java:105)
        at org
      .jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:55)
        
      ... 8 more


      I'm using Jboss 7.1.1. here is my jboss-ejb-client.properties located src/main/resources


      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
      remote
      .connection.default.username=luka2
      remote
      .connection.default.password=luk1


      jndi.properties located also in src/main/resoruces


      java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
      java
      .naming.factory.url.pkgs=org.jboss.ejb.client.naming
      jboss
      .naming.client.ejb.context=true
      java
      .naming.provider.url=remote://localhost:4447
      java
      .naming.security.principal=luka2
      java
      .naming.security.credential=luk1


      the luka2 user was added by add-user script and belongs to ApplicationRealm

      the most importat part of pom.xml is

      <dependency>
        
      <groupId>org.jboss.as</groupId>
        
      <artifactId>jboss-as-ejb-client-bom</artifactId>
        
      <version>7.1.1.Final</version>
        
      <type>pom</type>
      </dependency>
      <dependency>
        
      <groupId>org.jboss.as</groupId>
        
      <artifactId>jboss-as-jms-client-bom</artifactId>
        
      <version>7.1.1.Final</version>
        
      <type>pom</type>
      </dependency>