<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
EJB3 over SSL doesn't work for remote client
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/chengwen">Wen Cheng</a> in <i>EJB3</i> - <a href="http://community.jboss.org/message/622861#622861">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p><span>I read the post: </span><a class="jive-link-external-small" href="http://community.jboss.org/thread/148760" target="_blank">http://community.jboss.org/thread/148760</a></p><p>And my situation is similar. But the solution dosen't works.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>JBOSS Version: JBoss 6.0.0.0 Final </p><p>OS: Windows XP</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I created a stateless bean in my application and configure it to use SSLSocket.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>@Stateless</p><p>@Remote(ReflectEJB.class)</p><p><span style="color: #ff0000;">@RemoteBinding(clientBindUrl="sslsocket://${jboss.bind.address}:3843")</span></p><p>public class ReflectEJBBean implements ReflectEJB{</p><p>   public String sayHello(){</p><p>          return "hello" ;</p><p>     }</p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>And I also configured <span style="color: #ff0000;">ejb3-connectors-jboss-beans.xml</span> file where I added a MBean:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code"><bean name="EJB3SSLRemotingConnector" class="org.jboss.remoting.transport.Connector">
    <property name="invokerLocator">sslsocket://${jboss.bind.address}:3843</property>
    <property name="serverConfiguration">
      <inject bean="ServerConfiguration" />
    </property>
    <property name="serverSocketFactory">
      <inject bean="sslServerSocketFactory" />
    </property>
  </bean>
  <bean name="sslServerSocketFactory" class="org.jboss.security.ssl.DomainServerSocketFactory">
     <constructor>
        <parameter><inject bean="EJB3SSLDomain"/></parameter>
     </constructor>
  </bean>
  <bean name="EJB3SSLDomain" class="org.jboss.security.plugins.JaasSecurityDomain">
     <constructor>
        <parameter>EJB3SSLDomain</parameter>
     </constructor>
     <property name="keyStoreURL">../conf/server.keystore</property>
     <property name="keyStorePass">mypassword</property>   
  </bean></code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I start jboss with " <span style="color: #ff0000;">-b 0.0.0.0</span> " on windows,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="color: #333333;">The bean works pretty well when I running the test code on the machine where jboss running.</span></p><p><span style="color: #333333;">However ,when I running the test code on a different machine , an exception is throw,</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code">javax.naming.NamingException: Could not dereference object [Root exception is org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [sslsocket://0.0.0.0:3843/]]
    at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1508)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:824)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at com.css.waterbox.server.api.consoleapi.SessionDriver.main(SessionDriver.java:445)
Caused by: org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [sslsocket://0.0.0.0:3843/]
    at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:831)
    at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:167)
    at org.jboss.remoting.Client.invoke(Client.java:1961)
    at org.jboss.remoting.Client.invoke(Client.java:804)
    at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    at org.jboss.ejb3.proxy.impl.remoting.IsLocalProxyFactoryInterceptor.invoke(IsLocalProxyFactoryInterceptor.java:104)
    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
    at $Proxy0.createProxyBusiness(Unknown Source)
    at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:129)
    at org.jboss.ejb3.proxy.impl.objectfactory.session.stateless.StatelessSessionProxyObjectFactory.getProxy(StatelessSessionProxyObjectFactory.java:79)
    at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:161)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
    at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1483)
    at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1500)
    ... 4 more
Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:193)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:519)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
    at org.jboss.remoting.transport.sslsocket.SSLSocketClientInvoker.connect(SSLSocketClientInvoker.java:243)
    at org.jboss.remoting.transport.sslsocket.SSLSocketClientInvoker.createSocket(SSLSocketClientInvoker.java:186)
    at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:1165)
    at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:816)
    at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:167)
    at org.jboss.remoting.Client.invoke(Client.java:1961)
    at org.jboss.remoting.Client.invoke(Client.java:804)
    at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    at org.jboss.ejb3.proxy.impl.remoting.IsLocalProxyFactoryInterceptor.invoke(IsLocalProxyFactoryInterceptor.java:104)
    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
    at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
    at $Proxy0.createProxyBusiness(Unknown Source)
    at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:129)
    at org.jboss.ejb3.proxy.impl.objectfactory.session.stateless.StatelessSessionProxyObjectFactory.getProxy(StatelessSessionProxyObjectFactory.java:79)
    at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:161)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
    at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1483)
    at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1500)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:824)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at com.css.waterbox.server.api.consoleapi.SessionDriver.main(SessionDriver.java:445)
    at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
    ... 15 more
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I tried the way mentioned in <a class="jive-link-external-small" href="https://jira.jboss.org/jira/browse/EJBTHREE-1650" target="_blank">https://jira.jboss.org/jira/browse/EJBTHREE-1650</a> , In another word, I add jboss.xml in META-INF folder in myejb.jar:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code"><?xml version="1.0" encoding="utf-8"?>
<jboss xmlns="http://www.jboss.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee
                            http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
             version="5.0">
            
  <enterprise-beans>
     <session>
       <ejb-name>ReflectEJBBean</ejb-name>
       <remote-binding>
           <jndi-name>ReflectEJBBean/remote</jndi-name>
           <client-bind-url>sslsocket://${jboss.bind.address}:3843</client-bind-url>
       </remote-binding>
     </session>
  </enterprise-beans>
</jboss></code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>But it got no improvement.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I know when I start jboss with "-b the_real_IP_of_the_machine" instead of "-b 0.0.0.0" , I can access ReflectEJBBean in a remote machine.</p><p>But I want to keep the "-b 0.0.0.0" for some reason.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Any idea?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks very much in advance.</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/622861#622861">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in EJB3 at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>