-
1. Re: remote JNDI using IP
cacao May 10, 2013 11:35 AM (in response to cacao)I started the server with -b <my-ip> and i am able to get the same code working now.
-
2. Re: remote JNDI using IP
sfcoy May 12, 2013 4:30 AM (in response to cacao)1 of 1 people found this helpfulHi there,
JBossAS/WildFly is configured this way by default for security reasons. It forces administrators to deliberately expose their server to the world, instead of doing it inadvertently.
Instead of using the "-b" command line option, you can indeed configure this in your "standalone*.xml" file.
Define an interface:
{code:xml} <interface name="external">
<inet-address value="your.ip.address"/>
</interface>{code}
Define a socket-binding:
{code:xml}<socket-binding name="ext-remoting" port="4447" interface="external" />{code}
Change the remoting subsystem connector declaration:
{code:xml}<connector name="remoting-connector" socket-binding="ext-remoting" security-realm="ApplicationRealm"/>{code}
-
3. Re: remote JNDI using IP
cacao May 13, 2013 8:40 AM (in response to sfcoy)Hey Stephen, thanks for the pointers. However, after these changes, i am still facing an issue. The standalone java program that i am using to send/retrieve JMS messages is working when run locally on my machine (using my IP in the URL). However, when i run the same program from another machine, i get this exception. (I have used all the jar files as were needed on my local machine when running the program):
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:51)
at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:151)
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 org.local.jms.Jmsdemo.getInitialContext(Jmsdemo.java:157)
at org.local.jms.Jmsdemo.sendMessage(Jmsdemo.java:50)
at org.local.jms.Jmsdemo.main(Jmsdemo.java:38)
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:68)
at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateCachedNamingStore(InitialContextFactory.java:196)
at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:169)
at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:134)
... 7 more
Caused by: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:315)
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:67)
... 10 more
-
4. Re: remote JNDI using IP
wdfink May 14, 2013 2:47 AM (in response to cacao)If you run the client local the security 'ApplicationRealm' is bypassed.
In case you run the client on a different machine you need to add a application user to the ApplicationRealm by using bin/add-user.sh (follow the instructions and select application user).
In your InitialContext you need to set the user and the password.