Hi Wen,
I am trying exactly the same.
JBoss 5.1.0-GA
Eclipse Java EE IDE 1.2.0
Java - jdk1.6.0_21
OS: Windows XP
I have added below snippet to ejb3-connectors-jboss-beans.xml from \jboss-5.1.0.GA\server\default\deploy folder
<bean name="org.jboss.ejb3.RemotingConnector" 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">resource:archserver.keystore</property>
<property name="keyStorePass">testing</property>
</bean>
My jboss.xml from EJB jar META-INF fodler
<?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>FooBean</ejb-name>
<remote-binding>
<jndi-name>FooBean/remote</jndi-name>
<client-bind-url>sslsocket://147.141.95.125:3843</client-bind-url>
</remote-binding>
</session>
</enterprise-beans>
</jboss>
My EJB is:
@Stateless
@Remote(FooRemote.class)
@RemoteBinding(clientBindUrl="sslsocket://147.141.95.125:3843")
public class FooBean implements FooRemote {
public String echo(String s)
{
System.out.println("############Calling echo().................");
return s;
}
}
And My server startup arguments are
-c default -Djavax.net.ssl.keyStore=C:/jboss-5.1.0.GA/server/default/conf/archserver.keystore -Djavax.net.ssl.keyStorePassword=testing
When I try to access the EJB from client I get the error message
Exception in thread "main" 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://147.141.95.125:3843/]]
at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1504)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:822)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.ssga.ejb3.test.Client.main(Client.java:38)
I tried changing the binding address to
${jboss.bind.address} - Still same error
0.0.0.0 - Still Same Error
P-BOSLOCALPC(my PC name) - Still Same error
Do you think anything wrong in my configuration or server startup arguments to eliminate this error?
Thanks in advance,
Siddu