[jboss-user] [EJB 3.0] - Re: EJB3 & SSL not working in JBoss 5 Beta3?
javidjamae
do-not-reply at jboss.com
Fri Feb 15 15:58:44 EST 2008
It seems like I'm doing everything the same, but I get the following error on the server:
| 14:36:15,468 ERROR [ServerThread] Worker thread initialization failure
| java.lang.reflect.InvocationTargetException
| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
| at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
| at org.jboss.remoting.transport.socket.ServerThread.createServerSocketWrapper(ServerThread.java:720)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:368)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
| Caused by: java.net.SocketException: Socket Closed
| at java.net.PlainSocketImpl.setOption(PlainSocketImpl.java:201)
| at java.net.Socket.setSoTimeout(Socket.java:988)
| at com.sun.net.ssl.internal.ssl.SSLSocketImpl.setSoTimeout(SSLSocketImpl.java:1971)
| at org.jboss.remoting.transport.socket.SocketWrapper.setTimeout(SocketWrapper.java:85)
| at org.jboss.remoting.transport.socket.ClientSocketWrapper.createStreams(ClientSocketWrapper.java:168)
| at org.jboss.remoting.transport.socket.ClientSocketWrapper.<init>(ClientSocketWrapper.java:66)
| at org.jboss.remoting.transport.socket.ServerSocketWrapper.<init>(ServerSocketWrapper.java:46)
| ... 7 more
I also see this error on the client:
| [echo] java -Djavax.net.ssl.keyStrore=c:\jbia-src\ch07\target/keystore/client.truststore -Djavax.net.ssl.keyStorePassword=clientpass com.manning.jbia.Client
| [java] Exception in thread "main" org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [sslso
| cket://127.0.0.1:3843/]
| [java] at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:559)
| [java] at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
| [java] at org.jboss.remoting.Client.invoke(Client.java:1634)
| [java] at org.jboss.remoting.Client.invoke(Client.java:548)
| [java] at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:108)
| [java] at $Proxy1.greet(Unknown Source)
| [java] at com.manning.jbia.Client.main(Client.java:27)
| [java] Caused by: java.lang.reflect.InvocationTargetException
| [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| [java] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
| ...
| (rest is same as on server)
|
This is how I started my server:
| $ ./run.sh -Djavax.net.ssl.keyStore=../server/enterprise/conf/server.keystore -Djavax.net.ssl.keyStorePassword=serverpass -c enterprise
|
Here is my mbean:
| <mbean code="org.jboss.remoting.transport.Connector"
| name="jboss.remoting:type=Connector,transport=sslsocket3843,handler=ejb3">
| <attribute name="InvokerLocator">sslsocket://${jboss.bind.address}:3843</attribute>
| <attribute name="Configuration">
| <config>
| <handlers>
| <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
| </handlers>
| </config>
| </attribute>
| </mbean>
|
Here is my bean:
| @RemoteBindings({@RemoteBinding(clientBindUrl = "sslsocket://0.0.0.0:3843", jndiBinding="StatelessSSL")})
| @Stateless
| public class GreeterBean implements Greeter {
| @PersistenceContext
| private EntityManager em;
|
| public void greet(String message) {
| Greeting greeting = new Greeting(message);
| em.persist(greeting);
| }
|
| @SuppressWarnings("unchecked")
| public List<Greeting> getAllGreetings() {
| return em.createQuery("from Greeting").getResultList();
| }
| }
|
And here is my client:
| public class Client {
| public static void main(String[] args) throws Exception {
| InitialContext ctx = new InitialContext();
|
| Greeter greeter = (Greeter) ctx.lookup("StatelessSSL");
| greeter.greet("Hello, world!");
| greeter.greet("Hola, mundo!");
| greeter.greet("Salam, donya!");
| greeter.greet("Bonjour, monde!");
| greeter.greet("Ciao, mondo!");
|
| List<Greeting> greets = greeter.getAllGreetings();
| for (Greeting greeting : greets) {
| System.out.println(greeting.getGreeting());
| }
| }
| }
|
I'm running in cygwin under windows XP. Just for good measure, I made sure to disable the Windows Firewall, but that didn't make a difference. Any clues?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129778#4129778
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129778
More information about the jboss-user
mailing list