How to customize RMI socket factory

Hello all,
I'm trying to follow the instructions of an article published in JavaWorld, regarding data compression: http://www.javaworld.com/javaworld/javaqa/2001-12/01-qa-1207-ziprmi.html
I'm getting a "no current ZIP entry" exception when running my client application.
java.rmi.RemoteException: ; nested exception is:
java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.util.zip.ZipException: no current ZIP entry
at com.foo.rmi.RMICSSClient.info(RMICSSClient.java:111)
at com.foo.ServiceTest.test(ServiceTest.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:228)
at junit.framework.TestSuite.run(TestSuite.java:223)
at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.util.zip.ZipException: no current ZIP entry
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unknown Source)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source)
at $Proxy0.info(Unknown Source)
at com.foo.rmi.RMICSSClient.info(RMICSSClient.java:89)
... 20 more
Caused by: java.util.zip.ZipException: no current ZIP entry
at java.util.zip.ZipOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at java.io.DataOutputStream.flush(Unknown Source)
... 27 more
Can someone please assist me solving this problem?
Thanks,
Barak.

I don't believe the code given in that article can possibly work. You have to call ZipOutputStream.finish() at some point for anything to be received at all, and when driven by RMI there is no well-defined point from the ZipSocket's point of view for that to be done.
I would avoid compression altogether. It places an extra load on the client CPU, which is OK, but also on the server CPU, which is not OK. It adds latency to the calls. It saves 50% of the data space if you're lucky. You'd have to have remarkably large object parameters and results for it to be a genuine win.

Similar Messages

  • Inability to control initial timeout in Socket Factory

    Hello,
    We have built our own RMI socket factory where we want to control the timeout of the sockets created there. This is our code
        public Socket createSocket(String host, int port) throws IOException {
                Socket socket = new Socket(host, port);
                socket.setSoTimeout(requestTimeout);
                return socket;
        }Due to spurious heavy loads on our server, we need to operate with timeout values up to 100 seconds.
    However, we find that it is impossible to control the initial socket creation timeout. We observe this thought the lack of giving the the desired timeout parameter. Thus, the socket times out in the default 10 seconds in this initial call, not waiting the desired 100s before making the exception.
    Creating the socket through first creating a default socket and afterwards binding it like this
    Socket socket = new Socket();
    socket.setSoTimeout(socketTimout);
    socket.bind(new InetAddress(host,port));did not seem to do the trick in this setting either (neither did replacing bind with connect).
    What is the reason for this shortcoming in the API? Any workarounds?
    Best regards,
    Helge Fredriksen

    You want:
    Socket socket = new Socket();
    socket.connect(host,port,connectTimeout);
    socket.setSoTimeout(readTimeout);
    return socket;Socket.setSoTimeout only sets the read timeout. Also be aware that with the timed connect shown above you can usually only reduce the timeout, not increase it, from its default.

  • Tutorial for socket factory

    hi.. anybody knows where I can get a good tutorial about socket factories and server socket factories??.. thanks for the help..

    can anybody tell me how to use a socket factory to create sockets which work with firewalls/proxy servers ??

  • Determing the socket factory currently used

    Hi all,
    On the server side, there are 2 different socket factories being used:
    SSL server/client socket factory on port 3000
    server/client socket factory on port 1099
    When a request comes in, can we determine the type of socket factory being used?
    Thanks in advance.

    Not really. Here you go:
    import java.rmi.AccessException;
    import java.rmi.NotBoundException;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    import java.rmi.registry.LocateRegistry;
    import java.rmi.registry.Registry;
    import javax.rmi.ssl.SslRMIClientSocketFactory;
    import javax.rmi.ssl.SslRMIServerSocketFactory;
    public class ReadOnlyRegistry
         extends sun.rmi.registry.RegistryImpl
         // NB DO NOT SPECIFY THIS, otherwise the default Registry stub is incompatible with this
         // remote object.
         // implements Registry
         private Registry     delegate;
          * Creates a new instance of ReadOnlyRegistry.
          * @param plaintextPort Plaintext port number: Only list() and lookup() are permitted via this port.
          * @param sslPort SSL port number: all operations are permitted via this port. This
          * registry is constructed with default SslRMIClientSocketFactory and SslRMIServerSocketFactory.
          * All the conditions for using a default SSLContext and these factories are therefore
          * required, specifically the system properties:
          * <ul>
          *<li>javax.net.keyStore
          *<li>javax.net.keyStoreType
          *<li>javax.net.keyStorePassword
          *<li>javax.net.trustStore
          *<li>javax.net.trustStoreType
          * </ul>to be set correctly.
          * @exception RemoteException Exception constructing either Registry.
         public ReadOnlyRegistry(int plaintextPort, int sslPort) throws RemoteException
              super(plaintextPort);
              // Construct the SSL delegate.
              // Note that as LocateRegistry.createRegistry() reutnrs the remote object, not a stub,
              // we will talk to the delegate directly via local method invocation, not via RMI/SSL.
              this.delegate = LocateRegistry.createRegistry(sslPort, new SslRMIClientSocketFactory(), new SslRMIServerSocketFactory());
         public void     bind(String name, Remote object) throws RemoteException
              throw new AccessException("bind not allowed via plaintext port");
         public String[] list() throws RemoteException
              return delegate.list();
         public Remote lookup(String name) throws RemoteException, NotBoundException
              return delegate.lookup(name);
         public void rebind(String str, Remote remote) throws RemoteException
              throw new AccessException("rebind not allowed via plaintext port");
         public void unbind(String name) throws RemoteException, NotBoundException
              throw new AccessException("unbind not allowed via plaintext port");
    }Message was edited by:
    ejp

  • How to Customize the Message "No Row Returned" from a Report

    Hi,
    I've been trying to customize the Message "No Row Returned" from a Report.
    First i followed the instructions in Note:183131.1 -
    How to Customize the Message "No Row Returned" from a Report
    But of course the OWA_UTIL.REDIRECT_URL in this solution did not work (in a portlet) and i found the metalink document 228620.1 which described how to fix it.
    So i followed the "fix" in the document above and now my output is,..
    "Portlet 38,70711 responded with content-type text/plain when the client was requesting content-type text/html"
    So i search in Metalink for the above and come up with,...
    Bug 3548276 PORTLET X,Y RESPONDED WITH CONTENT-TYPE TEXT/PLAIN INSTEAD OF TEXT/HTML
    And i've read it and read it and read it and read it and can't make heads or tails of what it's saying.
    Every "solution" seems to cause another problem that i have to fix. And all i want to do is customize the Message "No Row Returned" from a Report. Please,...does anyone know how to do this?

    My guess is that it only shows the number of rows it has retrieved. I believe the defailt is for it to only retrieve 50 rows and as you page through your report it retrieves more. So this would just tell you how many rows was retireved, but probably not how many rows the report would contain if you pages to the end. Oracle doesn't really have a notion of total number of rows until the whole result set has been materialized.

  • How to customize top navigation css in SharePoint 2013?

    Hi All,
    How to customize top navigation css in SharePoint 2013?(Want to add colors for each link in the navigation)
    My current page is like-
    Expected-

    Hi Sam,
    Please check the following article about how to style the top navigation with custom css.
    How to: Brand snippets by using CSS in SharePoint 2013
    Thanks
    Daniel Yang
    TechNet Community Support

  • R12 - How to customize the seeded Purchase Order PDF report

    Hi,
    We need to customize the layout AND the data of the seeded Purchase Order pdf report that is generated in PO Summary form when user picks drop-down menu Inquire->View Document. I know how to set up the Document Type with a customized layout but I do not know how to update the XML data that feeds the layout.
    Thanks, Mike

    Mike,
    Please review the following documents.
    Note: 374165.1 - How To Customize The PDF Output For Printed Purchase Order Report (Portrait) ?
    Note: 406094.1 - How To Diagnose Issues Within Oracle Purchasing PDF File Creation for Printing
    Regards,
    Hussein

  • How to customize the error messages in web analysis reports

    Does anyone know how to customize the error messages that web analysis shows ,
    I want to customize the below error message with a custom error message
    "Document does not exist or no authorization to open document.Error occurred while loading document"
    Does anyone know how to do this ?

    Rajesh,
    you may want to check these links
    How to the Change the Application Stopped Message
    How to Change the Dispatcher Running, No Server Connected Message
    http://help.sap.com/saphelp_nw70/helpdata/en/65/18fc3f9ec4e669e10000000a155106/frameset.htm
    Thanks
    Bala Duvvuri

  • How to Customize Preview and Print / Sales Order Acknowledgement

    Hi,
    Our client needs some additional attributes on a sales order acknowledgement print ( Preview and Print ) output.
    The current layout is based on ONTORDDFFN.xml and ONTORDDFN.xsd
    How to customize the same to include additional attributes like Territory and Shipping instructions etc.These new fields are not there in xsd or the xml.
    Appreciate your great help.
    Regards,
    Raju

    Per Oracle you need to implement the method "getPrintExtensionXMLFragment" of  PrintExtensionObject.java. Oracle has given the flexibility that getPrintExtensionXMLFragment can either return a XMLFragement or a sql query.. If the code in getPrintExtensionXMLFragment returns a string which starts with "select" Applications code will execute that query and the corresponding XML will be appended to the main XML. This needs to be written in a CustomClass and then set to the Profile " OM: Printed Document Extension Class Name".
    I would like to know if somebody has extensively added columns at the different levels (header, lines, Addresses, Line Discounts, Charges) and the same additional cols. were implemented in the CustomClass. Let me know.
    Regards,
    Rajesh.

  • How do I delete the factory app settings on my iPod Touch?

    How do I delete the factory app settings on my iPod Touch? For instance: I don't want the app "Stocks" to appear on my screen any more. Is there a way to delete/hide it?

    The built in Apps can't be deleted, but they can be moved to an unused screen. You could create a folder of all unused Apps and move it.
    Stedman

  • Sap afs - how to customize matrix grid in sales order creation

    Hello,
    can anyone help to understand how to customize the matrix grid shown at sales order creation/change (VA01 - AFS Item overview tab - Matrix entry pushbutton). Here system, starting from inserted material nr, shows all possible combination from material's sales grid. The requirement asks to manage the matrix grid before it is shown to the user.
    Thanks in advance for your help
    maurizio

    Hi
    It depends on master data of your material
    Max

  • How to customize the Java Concurrent Program(PO Output for Communication)

    Hi,
    How to customize the Java Concurrent Program(PO Output for Communication)
    I need to add the Line level Ship To Address ,Line Notes and Extended Price fields on Java Concurrent Program.
    Please any body help/guide me in this regard.

    Hi,
    Changing Java Conc. program for "PO Output for Communication" is difficult.
    Actually, if you observe closely, "PO Output for Communication" program uses PO<HEADER/LINES..>_XML views.
    So if you could change these views and add your requireed columns to it, you can automatically see your changes in XML data file.
    See if the following link will you to get there.. http://chandramatta.blogspot.com/
    thanks,
    Matt

  • How to customize search in WS 7 and for multiple virtual servers?

    I'm not clear on how to customize search results pages in Sun Web Server 7. The documentation (the Adminstrator's Guide, page 215) says:
    You can take a look at the default search application located at /bin/https/webapps/search as a sample application
    but I'm not seeing any such thing. I did a find . -name search -type d from the server root and instance root but the only search directories I'm seeing are subdirectories within the generated directory and they look like system generated jsps that I shouldn't touch (So I didn't :-)
    So one question is, where is the default app? A second question is, how do we set up different branding for different virtual servers?
    We're currently using WS 6.1 and it has a field in the GUI for the directory containing the web app to use for search. That seems to have disappeared in WS 7.
    Any help would be appreciated. Thanks.
    Dave

    I don't use the search engine, so I'm afriad I don't have direct experience here.
    What I'd probably do is modify the app so that it looks at the Host data to determine which directory it should point to for graphics, formatting, etc. You could also use the obj.conf with variables to pull graphics from directories appropriately branded. Something like:
    1) Create "additional doc directory" for images
    2) Find the entry in the obj.conf that points to the new directory
    3) Modify the path to something like /path/to/$host/images
    4) Make sure you create directories like:
    /path/to/foobar.com/images/
    /path/to/www.foobar.com/images/
    /path/to/baz.com/images/
    /path/to/www.baz.com/images/

  • How do I get a factory unlocked iPhone 3GS out of (connect to iTunes) mode?

    How do I get a factory unlocked iPhone 3GS out of recovery (connect to itunes) mode? 
    Once the iPhone 3GS is in DFU mode and plugged into iTunes, the restore and update process begins. The restores process are as followed:
    Extracting software > Preparing iPhone for restore (blank screen) > Preparing iPhone software for restore > Restoring iPhone software > Verifying iPhone restore > Restoring iPhone firmware > The iPhone cannot be restored. An unknown error occurred (1).
    I clicked on the more information tab and was taken to a website with some troubleshooting. I did what they suggested (based on the error #) and still no luck. I’ve tried to restore and update about 10 times now but the same message keeps coming up at the end. What should I do now?
    P.S: I have the latest version of iTunes (11), my windows is up to date etc ...

    CDiiva wrote:
    The iPhone cannot be restored. An unknown error occurred (1).
    This Error message is indicative of a Hardware issue. The device may need Service.

  • How to customize the standard t.code of QDV1 with accepting fixed sample 0

    Hello...
    Could you please advice me, From the Functional point of view , I have to develop a function module for sample determination which calculates sample size=0 by using the Standard Function module of QDRS_FIXEX_SAMPLE and t.code of QDV1
    so..can anybody suggest me , how we customize it?. Currently when we use QDV1 t.code it wont accept Zero input for which i'm looking for. Thank you.
    Regards
    Mallikarjun

    Roy,
        Try applying search filters e.g search for a* ,b* ....
    try {
    IUserFactory userFactory = UMFactory.getUserFactory();
    IUserSearchFilter searchFilter = userFactory.getUserSearchFilter();
    searchFilter.setFirstName("a*",1,true);
    ISearchResult searchResult = userFactory.searchUsers(searchFilter);
    while (searchResult.hasNext()) {
           //do something
    Tegala

Maybe you are looking for

  • How to save WEBI report in CSV format on file system

    Hi I am trying to save a WEBI report from BO server in CSV format through java / BO SDK. Iam able to save report in html , pdf and xls format. Please provide a code snippet if available. I know for pdf and xls we directly use doc, binary view and for

  • BlackBerry Desktop Software not syncing anymore after OS 10.7.2 update

    And once again, My two favorite IT toys are not communicating anymore, wasting my time... My upgraded Mac (10.7.2) doesn't seem to be talking the same language as my BB anymore, since it does not sync... Help is, of course, welcome

  • Jiggle mode in Lion

    In Jiggle Mode (within Launchpad) should I have an "x" on the app icons to remove them if I want to?  Currently there's one app that always has an x, it's Caffeine, but no others ever do. 

  • Apple Student Program for Colombia?

    Hi there, I've being searching the whole site, trying to find a number or an email to send this inquiry to but I couldn't so Had no other choise but to post this on the Discussions hoping for someone in the high roll to see this post. I've being a wa

  • EXCEPTION FOREIGN_LOCK, nothing done!- CLEAN_REQREQ_UP job

    Dear Experts When I create a shc, the same is approved & a follow on document couldn't be created. The reason being job CLEAN_REQREQ_UP is not running correctly & upon execution gives a message 'EXCEPTION FOREIGN_LOCK, nothing done!'. Pls advise. Rav