I tried to configure compressed remote calls as described in Configuration Guide section
14.2.1.
See:
http://www.redhat.com/docs/manuals/jboss/jboss-eap-4.2/doc/Server_Configu....
I changed jboss-service.xml to use a CompressionClient/ServerSocketFactory:
| <mbean code="org.jboss.invocation.jrmp.server.JRMPInvoker"
name="jboss:service=invoker,type=jrmp,socketType=CompressionSocketFactory">
| <attribute name="RMIObjectPort">4445</attribute>
| <attribute
name="ServerAddress">${jboss.bind.address}</attribute>
| <attribute
name="RMIClientSocketFactory">org.jboss.test.jrmp.ejb.CompressionClientSocketFactory</attribute>
| <attribute
name="RMIServerSocketFactory">org.jboss.test.jrmp.ejb.CompressionServerSocketFactory</attribute>
| <depends>jboss:service=TransactionManager</depends>
| </mbean>
|
The CompressionClient/ServerSocketFactory uses a CompressionSocket to wrap the
Input/OutputStream of the client-server-socket with a
java.util.zip.GZIPInput/OutputStream:
| class CompressionSocket extends Socket
| {
| ..
| /*
| * Returns a stream of type CompressionInputStream
| */
| public InputStream getInputStream() throws IOException
| {
| if (in == null)
| {
| in = new GZIPInputStream( super.getInputStream() );
| }
| return in;
| }
|
| /*
| * Returns a stream of type CompressionOutputStream
| */
| public OutputStream getOutputStream() throws IOException
| {
| if (out == null)
| {
| out = new GZIPOutputStream( super.getOutputStream());
| }
| return out;
| }
| ..
|
The configuration is working. The CompressionClient/ServerSocketFactory are used. But i
get an exception on the client side when i do remote calls:
| java.rmi.ConnectIOException: error during JRMP connection establishment; nested
exception is:
| java.net.SocketTimeoutException: Read timed out
| at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:286)
| at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
| at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
| at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
| at
org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:133)
| at
org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
| at
org.jboss.invocation.MarshallingInvokerInterceptor.invoke(MarshallingInvokerInterceptor.java:63)
| at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
| at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
| at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:184)
| at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
| at $Proxy0.create(Unknown Source)
| at
com.carano.cbf.partner.client._AbstractGPAktionZuordnungEJBClienthandlerBase.createRemotehandler(_AbstractGPAktionZuordnungEJBClienthandlerBase.java:68)
| at
com.carano.framework.abo.EJBClienthandler$EJBObjectFactory.createRemote(EJBClienthandler.java:1293)
| at
com.carano.framework.util.ejb.AbstractEJBObjectFactory.getRemote(AbstractEJBObjectFactory.java:704)
| at
com.carano.framework.abo.EJBClienthandler.getEJBhandler(EJBClienthandler.java:245)
| at com.carano.framework.abo.EJBClienthandler.doSearch(EJBClienthandler.java:897)
| at com.carano.framework.abo.EJBClienthandler.doSearch(EJBClienthandler.java:850)
| at
com.carano.framework.abo.client.AbstractClienthandler._doSearch(AbstractClienthandler.java:1063)
| at
com.carano.framework.abo.client.AbstractClienthandler.searchMainBOs(AbstractClienthandler.java:1018)
| at
com.carano.cbf.partner.client.AbstractGPAktionZuordnungClienthandlerSupport.getLastAktionsForCurrentUser(AbstractGPAktionZuordnungClienthandlerSupport.java:109)
| at
com.carano.cbf.partner.client.AbstractGPAktionZuordnungEJBClienthandler.getLastAktionsForCurrentUser(AbstractGPAktionZuordnungEJBClienthandler.java:80)
| at
fleet.client.gui.FleetAktionenStatusBar.checkForNewAktionen(FleetAktionenStatusBar.java:201)
| at fleet.client.gui.FleetAktionenStatusBar.init(FleetAktionenStatusBar.java:116)
| at
fleet.client.gui.FleetAktionenStatusBar.<init>(FleetAktionenStatusBar.java:108)
| at
fleet.client.gui.CaramotoDesktopRootPane.createStatusBar(CaramotoDesktopRootPane.java:790)
| at
com.carano.framework.gui.client.masterdetail.AbstractDesktopRootPane.jbInit(AbstractDesktopRootPane.java:368)
| at
com.carano.framework.gui.client.masterdetail.AbstractDesktopRootPane.<init>(AbstractDesktopRootPane.java:338)
| at
fleet.client.gui.CaramotoDesktopRootPane.<init>(CaramotoDesktopRootPane.java:274)
| at fleet.client.gui.CaramotoMDIFrame$1.<init>(CaramotoMDIFrame.java:134)
| at
fleet.client.gui.CaramotoMDIFrame.createDesktopRootPane(CaramotoMDIFrame.java:134)
| at
com.carano.framework.gui.client.masterdetail.AbstractDesktopFrame.createRootPane(AbstractDesktopFrame.java:158)
| at javax.swing.JFrame.frameInit(JFrame.java:241)
| at javax.swing.JFrame.<init>(JFrame.java:164)
| at
com.carano.framework.gui.client.masterdetail.AbstractDesktopFrame.<init>(AbstractDesktopFrame.java:134)
| at fleet.client.gui.CaramotoMDIFrame.<init>(CaramotoMDIFrame.java:41)
| at fleet.client.gui.Main.<init>(Main.java:243)
| at fleet.client.gui.Main.main(Main.java:394)
| Caused by: java.net.SocketTimeoutException: Read timed out
| at java.net.SocketInputStream.socketRead0(Native Method)
| at java.net.SocketInputStream.read(SocketInputStream.java:129)
| at java.net.SocketInputStream.read(SocketInputStream.java:182)
| at java.util.zip.CheckedInputStream.read(CheckedInputStream.java:42)
| at java.util.zip.GZIPInputStream.readUByte(GZIPInputStream.java:205)
| at java.util.zip.GZIPInputStream.readUShort(GZIPInputStream.java:197)
| at java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:136)
| at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:58)
| at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:68)
| at
org.jboss.test.jrmp.ejb.CompressionSocket.getInputStream(CompressionSocket.java:72)
| at sun.rmi.transport.tcp.TCPConnection.getInputStream(TCPConnection.java:85)
| at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:226)
| ... 37 more
|
Thanks for help!
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154670#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...