[EJB 3.0] - Re: EJB with SSL does not work with JBoss AS 4.2.2
by dbmac45
jaikiran,
I am pretty much experiencing the same results that TJ is seeing and with an almost identical setup. I followed the steps in "Chapter 9 - Transports" in the JBoss EJB 3.0 Reference Documentation.
I am running JBoss AS 4.2.2, Java 1.5.0_11 and Windows XP.
I added the following code to the "jboss-service.xml" file in the "server/default/deploy/ejb3.deployer/META-INF" file as specified in the JBoss EJB 3.0 Reference doc.
| <mbean code="org.jboss.remoting.transport.Connector"
| name="jboss.remoting:type=Connector,transport=socket3843,handler=ejb3">
| <depends>jboss.aop:service=AspectDeployer</depends>
| <attribute name="InvokerLocator">sslsocket://${jboss.bind.address}:3843</attribute>
| <attribute name="Configuration">
| <handlers>
| <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
| </handlers>
| </attribute>
| </mbean>
|
My EJB code looks like the following:
| @RemoteBindings({
| @RemoteBinding(clientBindUrl="sslsocket://0.0.0.0:3843", jndiBinding="TitanServicesSSL"),
| @RemoteBinding(jndiBinding="TitanServices")
| })
| @Stateless
| public class TravelAgentBean implements TravelAgentRemote {
| ...
| }
|
My test client looks like the following:
| public static void main(String[] args) {
| try {
| // Get initial context.
| Context jndiContext = getInitialContext();
|
| // Get a reference to a travel agent session bean.
| TravelAgentRemote travelAgentRemote = (TravelAgentRemote) jndiContext.lookup("TitanServicesSSL");
| // TravelAgentRemote travelAgentRemote = (TravelAgentRemote) jndiContext.lookup("TitanServices");
|
| // Create a new cabin.
| CabinDTO cabin1 = new CabinDTO(1, "Master Suite", 1, 1, 3);
|
| travelAgentRemote.createCabin(cabin1);
|
| // Retrieve the newly created cabin. If it was found then
| // display it on the console and then delete it.
| CabinDTO cabin2 = travelAgentRemote.findCabin(cabin1.getId());
|
| if (cabin2 != null) {
| System.out.println(cabin2.toString());
|
| travelAgentRemote.deleteCabin(cabin1.getId());
| }
|
| } catch (NamingException ne) {
| ne.printStackTrace();
| }
|
| }
|
| private static Context getInitialContext() throws NamingException {
| return new InitialContext();
| }
|
|
If I do a "lookup" on "TitanServices" then everything works fine. If I do a "lookup" on "TitanServicesSSL" then it fails (the lookup actually succeeds but the createCabin() method fails). I have created the appropriate keystore, self-signed certificate, etc., according to the JBoss EJB 3.0 Reference doc and have added the appropriate JVM args for the client and JBoss that point to the keystore, etc. JBoss starts successfully and without any errors.
The following is the server-side exception that is thrown when I attempt to run my program using the "TitanServicesSSL" lookup.
| 15:44:44,505 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:991)
| 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
|
|
The following is the client-side exception that is thrown:
| Exception in thread "main" org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [sslsocket://127.0.0.1:3843/]
| at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:532)
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
| at org.jboss.remoting.Client.invoke(Client.java:1634)
| at org.jboss.remoting.Client.invoke(Client.java:548)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
| at $Proxy0.createCabin(Unknown Source)
| at com.titan.client.TitanClient.main(TitanClient.java:27)
| Caused by: 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.SocketClientInvoker.createClientSocket(SocketClientInvoker.java:152)
| at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:856)
| at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:525)
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
| at org.jboss.remoting.Client.invoke(Client.java:1634)
| at org.jboss.remoting.Client.invoke(Client.java:548)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:67)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
| at $Proxy0.createCabin(Unknown Source)
| at com.titan.client.TitanClient.main(TitanClient.java:27)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:74)
| ... 10 more
| Caused by: java.net.SocketException: Socket Closed
| at java.net.PlainSocketImpl.setOption(PlainSocketImpl.java:201)
| at java.net.Socket.setSoTimeout(Socket.java:991)
| 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 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.SocketClientInvoker.createClientSocket(SocketClientInvoker.java:152)
| at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.getConnection(MicroSocketClientInvoker.java:856)
| at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:525)
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122)
| at org.jboss.remoting.Client.invoke(Client.java:1634)
| at org.jboss.remoting.Client.invoke(Client.java:548)
| at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
| ... 10 more
|
|
Like TJ, the following are true:
Yes, I can telnet into the SSL port (3843).
Yes, the key store and passoword have been generated.
Yes, the JVM arguments have been modified to point to the keystore.
Yes, the client gets a references to the EJB but fails when trying to call the createCabin() method.
Yes, all firewalls have been disabled.
Yes, I am using the jbossall-client.jar from version 4.2.2 when running the client.
The JRE version is 1.5.
Thanks in advance for any help,
Dave M.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4146930#4146930
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4146930
17 years, 12 months
[JBossWS] - Nullpointer at JBossXSEntityResolver.getXMLInputSource
by QPool.Char
Hi, there already is a similar thread here: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124794#4124794 , but i think my situation is slightly different.
Using JBoss 4.2.2 with integrated jbossws, i have a locally published WSDL file that i cannot manipulate.
I have generated my client artifacts using Metro (wsimport tool), because i had to do some external binding customizations, which i dont know how to do with jbossws. I try to set up the service like this:
RepositoryService repositoryService =
| new RepositoryService(new URL("http://localhost:8080/alfresco/wsdl/repository-service.wsdl"),
| new QName("repositoryService"));
but i get this error:
| 19:03:51,328 WARN [JBossWSEntityResolver] Trying to resolve id as a non-file URL: http://www.alfresco.org/ws/model/content/1.0
| 19:03:52,703 ERROR [STDERR] java.lang.NullPointerException
| 19:03:52,703 ERROR [STDERR] at org.jboss.ws.metadata.wsdl.xmlschema.JBossXSEntityResolver.getXMLInputSource(JBossXSEntityResolver.java:167)
| 19:03:52,703 ERROR [STDERR] at org.jboss.ws.metadata.wsdl.xmlschema.JBossXSEntityResolver.resolveEntity(JBossXSEntityResolver.java:135)
| 19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown Source)
| 19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.xs.XMLSchemaLoader.resolveDocument(Unknown Source)
| 19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.xs.traversers.XSDHandler.resolveSchema(Unknown Source)
| 19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
| 19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
| 19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
| 19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
| 19:03:52,703 ERROR [STDERR] at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
| 19:03:52,703 ERROR [STDERR] at org.jboss.ws.tools.JavaToXSD.parseSchema(JavaToXSD.java:182)
|
my wsd (excerptsl:
| <wsdl:definitions name="repository-service" targetNamespace="http://www.alfresco.org/ws/service/repository/1.0">
| <!-- ************************************** -->
| <!-- Copyright Alfresco Software, Inc. 2005 -->
| <!-- ************************************** -->
| â
| <wsdl:types>
| âÃÂÃÂ
| <schema elementFormDefault="qualified" targetNamespace="http://www.alfresco.org/ws/service/repository/1.0">
| <xsd:import namespace="http://www.alfresco.org/ws/headers/1.0" schemaLocation="../wsdl/headers.xsd"/>
| <xsd:import namespace="http://www.alfresco.org/ws/cml/1.0" schemaLocation="../wsdl/cml.xsd"/>
| âÃÂÃÂ
| <element name="createStore">
| âÃÂÃÂ
| <complexType>
| âÃÂÃÂ
| <sequence>
| <element name="scheme" type="xsd:string"/>
| <element name="address" type="xsd:string"/>
| </sequence>
| </complexType>
| </element>
| âÃÂÃÂ
| <element name="createStoreResponse">
| âÃÂÃÂ
| <complexType>
| âÃÂÃÂ
| <sequence>
| <element name="createStoreReturn" type="cms:Store"/>
| </sequence>
| </complexType>
| </element>
| âÃÂÃÂ
| <element name="getStores">
| âÃÂÃÂ
| <complexType>
| <sequence/>
| </complexType>
| </element>
| âÃÂÃÂ
| <element name="getStoresResponse">
| âÃÂÃÂ
| <complexType>
| âÃÂÃÂ
| <sequence>
| <element name="getStoresReturn" type="cms:Store" minOccurs="1" maxOccurs="unbounded"/>
| </sequence>
| </complexType>
| </element>
| âÃÂÃÂ
| <element name="query">
| âÃÂÃÂ
| <complexType>
| âÃÂÃÂ
| <sequence>
| <element name="store" type="cms:Store"/>
| <element name="query" type="cms:Query"/>
| <element name="includeMetaData" type="xsd:boolean"/>
| </sequence>
| </complexType>
| </element>
| âÃÂÃÂ....................
| </schema>
| </wsdl:types>
| âÃÂÃÂ
| <wsdl:message name="Headers">
| <wsdl:documentation>Defines the SOAP headers used by this service.</wsdl:documentation>
| <wsdl:part element="rep:QueryConfiguration" name="QueryConfiguration"/>
| </wsdl:message>
| âÃÂÃÂ
| <wsdl:message name="createStoreRequest">
| <wsdl:part element="rep:createStore" name="parameters"/>
| </wsdl:message>
| âÃÂÃÂ
| <wsdl:message name="createStoreResponse">
| <wsdl:part element="rep:createStoreResponse" name="parameters"/>
| </wsdl:message>
| âÃÂÃÂ
| ............âÃÂÃÂ
| <wsdl:service name="RepositoryService">
| âÃÂÃÂ
| <wsdl:documentation>
| Provides read and write operations against a repository.
| </wsdl:documentation>
| âÃÂÃÂ
| <wsdl:port binding="rep:RepositoryServiceSoapBinding" name="RepositoryService">
| <wsdlsoap:address location="http://localhost:8080/alfresco/api/RepositoryService"/>
| </wsdl:port>
| </wsdl:service>
| </wsdl:definitions>
|
Injection also doesnt work, as expected. And using an empty constructor also doesnt work. Any hints on this? Do i have to upgrade jbossws? Or any workaround to show the method where to search for my xsd?
thx in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4146891#4146891
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4146891
17 years, 12 months