Byte-Range Serving - PLEASE HELP

Hey Everyone,
I am trying to display very large documents from a servlet and need to stream only the requested bytes to the end-user so they don't have to wait for the entire file to download. I have found an example in perl, but I really want a Java version. Currently my code is set to accept byte ranges and will print out the first range of bytes. The problem is on the second request, when I look for Range in the request header, it is null. I have tried this with both PDF and Word documents and I get the same results for both. Any help anyone could give me would be greatly appreciated. I am under a huge deadline and really need the help.
Thanks

Sean,
Here is the method I am calling within my Servlet...Thanks again for your help.
private void sendPDF(HttpServletRequest req, HttpServletResponse resp, String fullDoc) throws IOException
          long fByte;
          long lByte;
          StringTokenizer stok;
          String tok;
          String curRange;
          File ckFile = new File(fullDoc);
          String shortFile = fullDoc.substring(fullDoc.lastIndexOf(File.separator) + 1);
          resp.setHeader("Content-Disposition", "inline;filename=\"" + shortFile + "\"");
          String rangeStr = req.getHeader("Range");
          long contentLength = 0;
          // check to see if there was a range specified, First time in from the request.
          if (rangeStr == null)
               resp.setContentLength((int) (new File(fullDoc)).length());
               resp.setHeader("Accept-ranges", "bytes");
               FileInputStream fis = new FileInputStream(fullDoc);
               BufferedOutputStream out = new BufferedOutputStream(resp.getOutputStream());
               byte[] inputLine = new byte[1024];
               int numRead = 0;
               int byteCounter = 0;
               resp.setContentType("application/pdf");
               shortFile = fullDoc.substring(fullDoc.lastIndexOf(File.separator) + 1);
               try
                    while ((numRead = fis.read(inputLine)) != -1)
                         byteCounter += numRead;
                         out.write(inputLine, 0, numRead);
                         for (int y = 0; y < 10000; y++);
                    fis.close();
                    out.close();
               catch (SocketException se)
                    fis.close();
          else
               // remove the "bytes=" off the front of the range string
               rangeStr = rangeStr.substring(rangeStr.indexOf("=") + 1);
               // now divide up the ranges into their groups
               StringTokenizer ranges = new StringTokenizer(rangeStr, ",");
               long fileSize = (new File(fullDoc)).length();
               // go through and verify the ranges are valid
               while (ranges.hasMoreTokens())
                    // get the next range set
                    curRange = ranges.nextToken();
                    // breakup the range set
                    stok = new StringTokenizer(curRange, " ,-");
                    tok = stok.nextToken();
                    // convert the first range to a long value
                    fByte = (new Integer(tok)).longValue();
                    lByte = fileSize;
                    // if there is a second value, convert it too
                    if (stok.hasMoreTokens())
                         lByte = (new Integer(stok.nextToken())).longValue();
                    // test to make sure the ranges are valid
                    if (fByte < 0 || fByte > lByte || lByte > fileSize)
                         // error in range
                         return;
                    contentLength += lByte - fByte + 1;
               // the ranges are valid, since we pulled out all of the tokens
               // to check the ranges we need to tokenize again
               // now divide up the ranges into their groups
               ranges = new StringTokenizer(rangeStr, ",");
               // set some header stuff
               String boundary = "multipart";
               resp.setStatus(HttpServletResponse.SC_PARTIAL_CONTENT);
               resp.setHeader("Accept-ranges", "bytes");
               resp.setHeader("Content-Length", String.valueOf(contentLength));
               resp.setHeader("Content-Range", rangeStr);
               resp.setContentType("multipart/x-byteranges; boundary=" + boundary);
               // open the output stream
               ServletOutputStream out = resp.getOutputStream();
               out.flush();
               while (ranges.hasMoreTokens())
                    curRange = (String) ranges.nextElement();
                    stok = new StringTokenizer(curRange, " ,-");
                    long fTok = (new Integer(stok.nextToken())).longValue();
                    if (stok.hasMoreTokens())
                         fByte = fTok;
                         lByte = (new Integer(stok.nextToken())).longValue();
                    else
                         if (curRange.startsWith("-"))
                              fByte = fileSize - fTok;
                              lByte = fileSize;
                         else
                              fByte = 0;
                              lByte = fTok;
                    long bytesToRead = lByte - fByte + 1;
                    out.println();
                    out.println("--" + boundary);
                    out.println("Content-type: application/pdf");
                    out.println("Content-Range: bytes " + fByte + "-" + lByte + "/" + fileSize);
                    out.println();
                    // open the file and send it!
                    FileInputStream fis = new FileInputStream(fullDoc);
                    fis.skip(fByte);
                    byte[] inputLine = new byte[1024];
                    int bytesRead = 0;
                    try
                         while (bytesToRead > 0)
                              if (bytesToRead < inputLine.length)
                                   bytesRead = fis.read(inputLine, 0, (int) bytesToRead);
                              else
                                   bytesRead = fis.read(inputLine);
                              if (bytesRead < 0)
                                   break;
                              bytesToRead -= bytesRead;
                              // write the bytes out to the browser
                              out.write(inputLine, 0, bytesRead);
                              out.flush();
                         if (bytesToRead != 0) System.out.println("bytesToRead is not zero: " + bytesToRead);
                         fis.close();
                         out.flush();
                    catch (SocketException se)
                         fis.close();
               // close the current boundary
               out.println();
               out.println("--" + boundary + "--");
               // close the output stream
               out.close();

Similar Messages

  • I have a big problem :( why is it i cant update my ipod touch 2g into ios 4! im using the latest version of itunes and everytime i click "update" it stucks on the "contacting server" please help :( i want to update it now

    i have a big problem why is it i cant update my ipod touch 2g into ios 4! im using the latest version of itunes and everytime i click "update" it stucks on the "contacting server" please help i want to update it now

    Maybe here:
    iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server

  • Wlserver.exe error occur while start the web logic server-please help

    hi
    Iam getting wlserver.exe error when I start the web logic server-please help. and I cant able to start the web logic server.
    Thannks in Advance,
    Cheers,
    bala...

    Could you please mail the errors and the WLS Version and service pack as well.
    - Ramkumar

  • I'm trying to set up my new iPhone 5s from a backup of my previous iPhone, when trying to enter my Facebook login info in settings I keep getting the following error message : error signing in could not communicate with server, please help !

    I'm trying to set up my new iPhone 5s from a backup of my previous iPhone, when trying to enter my Facebook login info in settings I keep getting the following error message : error signing in could not communicate with server, please help !

    Can you access other apps? Can you acess the internet? Can you access applications that use internet besides facebook?
    If answer is yes to all of these; contact Facebook.

  • Report Server (Please help ! )

    Hello!
    I have installed infrastructure and AS onsame machine. In startthe default report server (rep_myserver) performe very well but after about 60 reports it went to down. Now when i try to start it from AS Home page it start and immidiatly stoped.
    Log files are showing only start and stop time without any other details. Trace files are also empty.
    Please help me to solve this problem. Is it a configration problem or i need a patch to solveit.
    Thanks
    UsmanRana

    Hi UsmanRana,
    Make sure your rep_myserver.conf file has the following line in it and that it isn't commented out:
    <trace traceOpts="trace_all">
    Then restart your report server and look in the "logs" subdirectory for the rep_myserver.trc file. It should show you what happened that caused the report server to shut down.
    regards,
    Stewart

  • Connecting to a wireless print server, please help!!!

    i have a canon mp500 connected to a network through a wireless printserver and wireless router. the printer works when directly connected to my macbook, but not when connected to the print server. i contacted linksys and they sent a docment on how to set the printer up using it's ip address. still didn't work (the instructions were for 10.1 and 10.2). i have downloaded and installed the current mac os x drivers from the canon website with no luck. please help

    I'm no expert, but I was able setup HP printer connected wirelessly to AEBS by using Apple's Printer Setup Utility and Bonjour. I was, however, able to install the HP drivers using the software that came with the printer, but it sounds like you could not do so with Canon?
    Anyway, here are Apple's help files for adding an IP printer:
    "Connecting to an IP printer
    An IP printer is a network printer that uses TCP/IP protocols (such as LPD/LPR, IPP, or Socket or Jet Direct) to communicate with your computer. If the IP printer you want to use is not listed when you print, you can add it to your list of available printers.
    To add an IP printer, you need to know its IP address or DNS name. See your network administrator for assistance.
    Open the document to print, and choose File > Print.
    Choose Add Printer from the Printer pop-up menu, and click IP Printer in the dialog that appears.
    Choose the appropriate printing protocol from the Protocol pop-up menu.
    Type the IP address or DNS name for the printer in the Address field.
    If your printer requires it, type the queue name for your printer in the Queue Name field. If you don't know the queue name, see your network administrator for assistance.
    Enter a name and location for the printer, so you can identify it in the Printer pop-up menu.
    If the Print Using pop-up menu does not display the name of your printer's model, choose the item appropriate for your printer from the Print Using pop-up menu, and then select your printer in the Model Name list.
    Click Add.
    Usually, your computer can detect whether a printer has special accessories installed, such as additional paper trays, extra memory, or a duplex unit. If it can't, a dialog appears that lets you specify them. Make sure the settings in that dialog accurately reflect your printer's installed accessories so you can take full advantage of them."

  • Cant get into same game server please help

    just got a wrt54g v6 and  updated firmware i have 1 pc wired 2 pc wireless and a lap top wireless.when playing call of duty 2 i cant join the same server that another pc on my network is in.i can join a different 1 but not the same.when i try to join the same server the game is interrupted on the other pc and mine says server disconnected.i have ports 28960,20500,20510 open. also ive enabled the dmz and the same thing happens.before i got the router i had all pcs but the lap top networked thru my pc and we never had this problem.im i missing a port? are my settings wrong?please help

    I have also had this problem.
    However I managed to "Fix" mine a slightly different way.
    I had set up my router and correctly configured port forwarding to my gaming PC, but when a friend came round and played on my laptop the same thing would happen.
    We got around this by REMOVING the port forwarding completely. The NAT can then redirect the correct packets to the correct PC. However this will only work if the COD 2 server has not had its default setting changed (as an admin can change whether or not to allow multiple simultaneous connections from the same IP) So if this still doesn't work try speaking to the admin of the server you want to play on and let him know your problem

  • How to deploy oracle forms on weblogic server - please help

    Hi,
    I have installed weblogic server(10.3.1) and fussion middleware 11g forms & reports on windows 2003 server.
    I want to deploy and test oracle forms in weblogic server.
    Please help me.
    Thanks & Regards,

    Hi,
    thanks for your information.
    where can i found the document for testing the report server?
    Thanks & Regards,

  • HT204053 I have come across following error when accessing my icloud account " icloud encountered an error while trying to connect to the server" please help...

    Please help with below error...
    I have been trying to access my icloud account in laptop with windows 7 operating, but I couldn't able to log in to icloud which show following error " icloud encountered an error while trying to connect to the server".
    I have icloud icloud control panel.
    But I can access my same icloud account in another laptop with windows xp operating.

    My recommendation is to download Apple’s Safari version 5.1.7 for Windows to access iCloud.com. It consistently works for me!!!! To make things easier with Safari, I made iCloud.com its Homepage. I’m using it to access iCloud.com from all of my PCs.
    On my Windows 7 systems it appears that some add-ons are causing problems when you try to access iCloud.com with the 32-bit version of IE9, but the 64-bit version seems to work fine, more than likely because there are few add-ons that are 64-bit and the 64-bit version of IE9 can't be the default browser in Windows 7.

  • Setting up iCal on the Mac OS X Server - please help if you can!

    Trying to set up an iCal on our Mac OSX Server for just four of us at my small business. I spent all of yesterday trying to figure this out (i'm fairly novice), and I've had no luck. This is what I have done so far:
    I created an open directory on our server, went into server admin -> services and checked iCal, open directory, and DNS (is this right?)
    Then I created a group in workgroup manager and added the clients to the group.
    I opened iCal and went to add an account. If i didn't put anything in the server details section it would just say that I don't have any configured principals - what does this mean??
    Typed in the user information and copied a million different combinations of this in the account url spot:
    http://my.server.com:8008/principals/groups/groupshortname/. typing things like
    http://(my ip address here):8008/principals/groups/groupshortname/.
    http://(what i think is my server address here):8008/principals/groups/groupshortname/ical.
    and then it says server refused, or address could not be found, etc.
    i do not know what to do. please help.
    thanks,
    ryan

    Hello ryankarolak, and Welcome to the AppleBoards,
    Setting up iCal Server is a little complicated in that you need to do several things in the right order. If you don't have DNS from another source you'll need good DNS set-up for many of the OS X Server services to function correctly. But I'm a little unsure of what your next move is since you didn't give any details about your server set-up or your office network lay-out.
    You should be aware that there is an entire group dedicated to iCal Server here: http://discussions.apple.com/forum.jspa?forumID=1234
    This other board is really the best place to search and find previous threads and post questions with the best chance of getting knowledgeable eyes on them. This forum is really for Xserve specific questions and isn't the best place to get OS X Server services questions answered - people will help out if they can but dedicated groups exist for some of the more complicated issues.
    Good luck,
    =Tod

  • Dispatcher running but not connected to message server :(  please help .

    trc file: "dev_disp", trc level: 1, release: "700"
    sysno      00
    sid        DEV
    systemid   562 (PC with Windows NT)
    relno      7000
    patchlevel 0
    patchno    144
    intno      20050900
    make:      multithreaded, Unicode, 64 bit, optimized
    pid        3744
    Mon Oct 26 12:37:38 2009
    kernel runs with dp version 232000(ext=109000) (@(#) DPLIB-INT-VERSION-232000-UC)
    length of sys_adm_ext is 576 bytes
    SWITCH TRC-HIDE on ***
    ***LOG Q00=> DpSapEnvInit, DPStart (00 3744) [dpxxdisp.c   1243]
         shared lib "dw_xml.dll" version 144 successfully loaded
         shared lib "dw_xtc.dll" version 144 successfully loaded
         shared lib "dw_stl.dll" version 144 successfully loaded
         shared lib "dw_gui.dll" version 144 successfully loaded
         shared lib "dw_mdm.dll" version 144 successfully loaded
    rdisp/softcancel_sequence :  -> 0,5,-1
    use internal message server connection to port 3900
    Mon Oct 26 12:37:50 2009
    WARNING => DpNetCheck: NiHostToAddr(www.doesnotexist0211.qqq.nxst) took 12 seconds
    Mon Oct 26 12:38:06 2009
    WARNING => DpNetCheck: NiAddrToHost(1.0.0.0) took 16 seconds
    ***LOG GZZ=> 2 possible network problems detected - check tracefile and adjust the DNS settings [dpxxtool2.c  5371]
    MtxInit: 30000 0 0
    DpSysAdmExtInit: ABAP is active
    DpSysAdmExtInit: VMC (JAVA VM in WP) is not active
    DpIPCInit2: start server >noptqas_DEV_00                          <
    DpShMCreate: sizeof(wp_adm)          25168     (1480)
    DpShMCreate: sizeof(tm_adm)          5652128     (28120)
    DpShMCreate: sizeof(wp_ca_adm)          24000     (80)
    DpShMCreate: sizeof(appc_ca_adm)     8000     (80)
    DpCommTableSize: max/headSize/ftSize/tableSize=500/16/552064/552080
    DpShMCreate: sizeof(comm_adm)          552080     (1088)
    DpSlockTableSize: max/headSize/ftSize/fiSize/tableSize=0/0/0/0/0
    DpShMCreate: sizeof(slock_adm)          0     (104)
    DpFileTableSize: max/headSize/ftSize/tableSize=0/0/0/0
    DpShMCreate: sizeof(file_adm)          0     (72)
    DpShMCreate: sizeof(vmc_adm)          0     (1864)
    DpShMCreate: sizeof(wall_adm)          (41664/36752/64/192)
    DpShMCreate: sizeof(gw_adm)     48
    DpShMCreate: SHM_DP_ADM_KEY          (addr: 000000000EE70050, size: 6348592)
    DpShMCreate: allocated sys_adm at 000000000EE70050
    DpShMCreate: allocated wp_adm at 000000000EE72150
    DpShMCreate: allocated tm_adm_list at 000000000EE783A0
    DpShMCreate: allocated tm_adm at 000000000EE78400
    DpShMCreate: allocated wp_ca_adm at 000000000F3DC2A0
    DpShMCreate: allocated appc_ca_adm at 000000000F3E2060
    DpShMCreate: allocated comm_adm at 000000000F3E3FA0
    DpShMCreate: system runs without slock table
    DpShMCreate: system runs without file table
    DpShMCreate: allocated vmc_adm_list at 000000000F46AC30
    DpShMCreate: allocated gw_adm at 000000000F46ACB0
    DpShMCreate: system runs without vmc_adm
    DpShMCreate: allocated ca_info at 000000000F46ACE0
    DpShMCreate: allocated wall_adm at 000000000F46ACF0
    MBUF state OFF
    DpCommInitTable: init table for 500 entries
    ThTaskStatus: rdisp/reset_online_during_debug 0
    EmInit: MmSetImplementation( 2 ).
    MM global diagnostic options set: 0
    <ES> client 0 initializing ....
    <ES> InitFreeList
    <ES> block size is 4096 kByte.
    <ES> Info: em/initial_size_MB( 16383MB) not multiple of em/blocksize_KB( 4096KB)
    <ES> Info: em/initial_size_MB rounded up to 16384MB
    Using implementation view
    <EsNT> Using memory model view.
    <EsNT> Memory Reset disabled as NT default
    <ES> 4095 blocks reserved for free list.
    ES initialized.
    rdisp/http_min_wait_dia_wp : 1 -> 1
    ***LOG CPS=> DpLoopInit, ICU ( 3.0 3.0 4.0.1) [dpxxdisp.c   1633]
    Mon Oct 26 12:38:07 2009
    ***LOG Q0K=> DpMsAttach, mscon ( noptqas) [dpxxdisp.c   11822]
    DpStartStopMsg: send start message (myname is >noptqas_DEV_00                          <)
    DpStartStopMsg: start msg sent
    CCMS: AlInitGlobals : alert/use_sema_lock = TRUE.
    CCMS: start to initalize 3.X shared alert area (first segment).
    DpMsgAdmin: Set release to 7000, patchlevel 0
    MBUF state PREPARED
    MBUF component UP
    DpMBufHwIdSet: set Hardware-ID
    ***LOG Q1C=> DpMBufHwIdSet [dpxxmbuf.c   1050]
    DpMsgAdmin: Set patchno for this platform to 144
    Release check o.K.
    Mon Oct 26 12:38:47 2009
    ERROR => DpHdlDeadWp: W0 (pid 276) died [dpxxdisp.c   14532]
    ERROR => DpHdlDeadWp: W1 (pid 5532) died [dpxxdisp.c   14532]
    ERROR => DpHdlDeadWp: W2 (pid 3696) died [dpxxdisp.c   14532]
    ERROR => DpHdlDeadWp: W3 (pid 4928) died [dpxxdisp.c   14532]
    ERROR => DpHdlDeadWp: W4 (pid 6040) died [dpxxdisp.c   14532]
    ERROR => DpHdlDeadWp: W5 (pid 3892) died [dpxxdisp.c   14532]
    ERROR => DpHdlDeadWp: W6 (pid 3860) died [dpxxdisp.c   14532]
    ERROR => DpHdlDeadWp: W7 (pid 4564) died [dpxxdisp.c   14532]
    ERROR => DpHdlDeadWp: W8 (pid 3940) died [dpxxdisp.c   14532]
    ERROR => DpHdlDeadWp: W9 (pid 3288) died [dpxxdisp.c   14532]
    my types changed after wp death/restart 0xbf --> 0xbe
    ERROR => DpHdlDeadWp: W10 (pid 5136) died [dpxxdisp.c   14532]
    my types changed after wp death/restart 0xbe --> 0xbc
    ERROR => DpHdlDeadWp: W11 (pid 5128) died [dpxxdisp.c   14532]
    my types changed after wp death/restart 0xbc --> 0xb8
    ERROR => DpHdlDeadWp: W12 (pid 4452) died [dpxxdisp.c   14532]
    ERROR => DpHdlDeadWp: W13 (pid 4680) died [dpxxdisp.c   14532]
    ERROR => DpHdlDeadWp: W14 (pid 5664) died [dpxxdisp.c   14532]
    my types changed after wp death/restart 0xb8 --> 0xb0
    ERROR => DpHdlDeadWp: W15 (pid 5540) died [dpxxdisp.c   14532]
    my types changed after wp death/restart 0xb0 --> 0xa0
    ERROR => DpHdlDeadWp: W16 (pid 4312) died [dpxxdisp.c   14532]
    my types changed after wp death/restart 0xa0 --> 0x80
    DP_FATAL_ERROR => DpWPCheck: no more work processes
    DISPATCHER EMERGENCY SHUTDOWN ***
    increase tracelevel of WPs
    NiWait: sleep (10000ms) ...
    NiISelect: timeout 10000ms
    NiISelect: maximum fd=309
    NiISelect: read-mask is NULL
    NiISelect: write-mask is NULL
    Mon Oct 26 12:38:57 2009
    NiISelect: TIMEOUT occured (10000ms)
    dump system status
    Workprocess Table (long)               Mon Oct 26 07:08:57 2009
    ========================
    No Ty. Pid      Status  Cause Start Err Sem CPU    Time  Program          Cl  User         Action                    Table
    0 DIA      276 Ended         no      1   0        0                                                                         
    1 DIA     5532 Ended         no      1   0        0                                                                         
    2 DIA     3696 Ended         no      1   0        0                                                                         
    3 DIA     4928 Ended         no      1   0        0                                                                         
    4 DIA     6040 Ended         no      1   0        0                                                                         
    5 DIA     3892 Ended         no      1   0        0                                                                         
    6 DIA     3860 Ended         no      1   0        0                                                                         
    7 DIA     4564 Ended         no      1   0        0                                                                         
    8 DIA     3940 Ended         no      1   0        0                                                                         
    9 DIA     3288 Ended         no      1   0        0                                                                         
    10 UPD     5136 Ended         no      1   0        0                                                                         
    11 ENQ     5128 Ended         no      1   0        0                                                                         
    12 BTC     4452 Ended         no      1   0        0                                                                         
    13 BTC     4680 Ended         no      1   0        0                                                                         
    14 BTC     5664 Ended         no      1   0        0                                                                         
    15 SPO     5540 Ended         no      1   0        0                                                                         
    16 UP2     4312 Ended         no      1   0        0                                                                         
    Dispatcher Queue Statistics               Mon Oct 26 07:08:57 2009
    ===========================
    SiSelNRemove: removed sock 196 (pos=2)
    SiSelNRemove: removed sock 196
    NiSelIRemove: removed hdl 2
    MBUF state OFF
    AdGetSelfIdentRecord: >                                                                           <
    AdCvtRecToExt: opcode 60 (AD_SELFIDENT), ser 0, ex 0, errno 0
    AdCvtRecToExt: opcode 40 (AD_MSBUF), ser 0, ex 0, errno 0
    AdCvtRecToExt: opcode 40 (AD_MSBUF), ser 0, ex 0, errno 0
    blks_in_queue/wp_ca_blk_no/wp_max_no = 1/300/17
    LOCK WP ca_blk 1
    make DISP owner of wp_ca_blk 1
    DpRqPutIntoQueue: put request into queue (reqtype 1, prio LOW, rq_id 15)
    MBUF component DOWN
    NiICloseHandle: shutdown and close hdl 2 / sock 196
    NiBufIClose: clear extension for hdl 2
    MsIDetach: detach MS-system
    cleanup EM
    EsCleanup ....
    EmCleanup() -> 0
    Es2Cleanup: Cleanup ES2
    ***LOG Q05=> DpHalt, DPStop ( 3744) [dpxxdisp.c   10421]
    Good Bye .....
    Thanks in advance
    Shakeel.

    Please check this forums subject.  It is SAP Business One System Administration - dedicate to SAP Business One System only.
    Close your thread and post to a proper forum.  To make other members read your message easily, at least some line breaks are needed in your message.
    Thanks,
    Gordon

  • Problem in starting RMI server, please help!

    Hi , all:
    I am learning RMI from SUN's tutorial. I set all of program packages as same as the tutorial, compiled all of programs . and built all of the jar files, the server classes and the client classes.When I run the server, ComputeEngine, it did not work ,and the following messages were showed at command lines:
    C:\RMI\doc>java -Djava.rmi.server.codebase=file:/c:\rmi\ann\public_html\classes/
    -Djava.rmi.server.hostname=localhost -Djava.security.policy=java.policy eng
    ine.ComputeEngine
    ComputeEngine exception: access denied (java.net.SocketPermission 127.0.0.1:1099
    connect,resolve)
    java.security.AccessControlException: access denied (java.net.SocketPermission 1
    27.0.0.1:1099 connect,resolve)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:272)
    at java.security.AccessController.checkPermission(AccessController.java:
    399)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
    at java.lang.SecurityManager.checkConnect(SecurityManager.java:1044)
    at java.net.Socket.<init>(Socket.java:262)
    at java.net.Socket.<init>(Socket.java:100)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
    SocketFactory.java:25)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
    SocketFactory.java:120)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:499)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:190
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:318)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    at engine.ComputeEngine.main(ComputeEngine.java:25)
    Please give helps .
    Thanks!

    Thank.
    Thank.
    I have put them at the same directory, but is deos not work.
    Something I am not sure.
    On the SUN's tutorial , the follows is given:
    Win32:
    java -Djava.rmi.server.codebase=file:/c:\home\ann\public_html\classes/
    -Djava.rmi.server.hostname=zaphod.east.sun.com
    -Djava.security.policy=java.policy
    engine.ComputeEngine
    I changed hostname = localhost
    I also changed the code of the server class given by tutorial :
    String name = "//host/Compute" ;
    to:
    String name = "//localhost/Compute";
    Should I make such changes?
    Here is the server class given by the tutorial:
    package engine;
    import java.rmi.*;
    import java.rmi.server.*;
    import compute.*;
    public class ComputeEngine extends UnicastRemoteObject
    implements Compute
    public ComputeEngine() throws RemoteException {
    super();
    public Object executeTask(Task t) {
    return t.execute();
    public static void main(String[] args) {
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
    String name = "//host/Compute";
    try {
    Compute engine = new ComputeEngine();
    Naming.rebind(name, engine);
    System.out.println("ComputeEngine bound");
    } catch (Exception e) {
    System.err.println("ComputeEngine exception: " +
    e.getMessage());
    e.printStackTrace();

  • Jinitiator & IE8 On Windows 2008 R2 x64 Server - Please Help!

    Hello All -
    I am wrapping up configuration of a Citrix Xenapp server for a presentation to my manager. The ONLY thing that I cannot get working is jinitiator for our Oracle apps. It is running on IE8 on WIndows 2008 R2 x64.
    I have done a lot of research and replace jvm.dll from Java, but haven't been able to get that to work. My guess is that it's either because I'm downloading the incorrect version of Java (which I extract the .jvm file from) or that i'm running x64.
    Please give any suggestions to help. I've spent hours on this project and if I cannot figure this out and have to go back to a different version of OS, then it's all lost -
    Thanks!

    801574 wrote:
    Great - Thanks.
    Will this need to be something that it installed/configured on my machine with IE8 installed or will changes need to be made to the actual Oracle server? We don't manage the server so hopefully it will be the client end.
    Thank YouAs long as you have the necessary version of JRE installed, you should be good. Necessary application changes/configuration must be made in order for it to use JRE.
    Srini

  • Critical problem with directory server--please help!

    We are having issues with some applications and the root cause seems to be the directory server. We see the following errors in the directory server log.
    [03/Oct/2008:11:58:25 -0600] - DEBUG - conn=-1 op=-1 msgId=-1 - PR_SetSocketOption(PR_SockOpt_NoDelay) failed, error -5962 (The value requested is too large to be stored in the data buffer provided.)
    some other stuff in the log file:
    [03/Oct/2008:11:48:25 -0600] - DEBUG - conn=-1 op=-1 msgId=-1 - PR_SetSocketOption(PR_SockOpt_NoDelay) failed, error -5962 (The value requested is too large to be stored in the data buffer provided.)
    [03/Oct/2008:11:50:26 -0600] - WARNING<20805> - Backend Database - conn=2361383 op=1 msgId=2 - search is not indexed
    [03/Oct/2008:11:50:27 -0600] - WARNING<20805> - Backend Database - conn=2361384 op=1 msgId=2 - search is not indexed
    [03/Oct/2008:11:50:28 -0600] - WARNING<20805> - Backend Database - conn=2361385 op=1 msgId=2 - search is not indexed
    [03/Oct/2008:11:53:25 -0600] - DEBUG - conn=-1 op=-1 msgId=-1 - PR_SetSocketOption(PR_SockOpt_NoDelay) failed, error -5962 (The value requested is too large to be stored in the data buffer provided.)
    [03/Oct/2008:11:57:27 -0600] - WARNING<20805> - Backend Database - conn=2197806 op=82101 msgId=686205 - search is not indexed
    [03/Oct/2008:11:57:57 -0600] - ERROR<5897> - Schema - conn=-1 op=-1 msgId=-1 - User error: Entry "uid=s0224025,ou=People,dc=lethbridgecollege,dc=ab,dc=ca", attribute "pabURI" is not allowed
    [03/Oct/2008:11:58:25 -0600] - DEBUG - conn=-1 op=-1 msgId=-1 - PR_SetSocketOption(PR_SockOpt_NoDelay) failed, error -5962 (The value requested is too large to be stored in the data buffer provided.)
    [03/Oct/2008:12:03:25 -0600] - DEBUG - conn=-1 op=-1 msgId=-1 - PR_SetSocketOption(PR_SockOpt_NoDelay) failed, error -5962 (The value requested is too large to be stored in the data buffer provided.)
    top shows the following: but cpu many times maxes out and runs 100%. Do i need to perform some indexing somewhere or is there other issues?
    load averages: 3.04, 3.15, 3.55 12:11:26
    224 processes: 222 sleeping, 1 running, 1 on cpu
    CPU states: 37.7% idle, 40.2% user, 22.1% kernel, 0.0% iowait, 0.0% swap
    Memory: 2048M real, 36M free, 2429M swap in use, 2979M swap free
    PID USERNAME LWP PRI NICE SIZE RES STATE TIME CPU COMMAND
    10828 mwadmin 129 59 0 0K 0K run 148.1H 24.83% ns-slapd
    9466 mwadmin 70 59 0 151M 65M sleep 743:06 1.98% ns-httpd
    10738 root 1 59 0 4240K 1032K sleep 34.3H 1.73% top
    26298 root 1 0 0 4096K 1696K cpu 0:00 1.51% top
    5759 root 9 59 0 14M 96K sleep 851:54 0.77% cctransport
    13378 ward 1 59 0 0K 0K sleep 1:23 0.57% prstat
    25284 root 1 59 0 68M 27M sleep 561:22 0.50% mixer_applet2
    10005 mwadmin 1 59 0 68M 27M sleep 604:43 0.49% mixer_applet2
    10003 mwadmin 1 59 0 69M 2600K sleep 306:12 0.25% gnome-netstatus
    25282 root 1 59 0 69M 2664K sleep 274:36 0.23% gnome-netstatus
    9881 mwadmin 1 59 0 17M 11M sleep 241:04 0.21% Xvnc
    9896 root 1 59 0 17M 6856K sleep 245:53 0.19% Xvnc
    9911 root 1 59 0 15M 5512K sleep 159:38 0.13% gconfd-2
    9901 mwadmin 1 59 0 15M 5576K sleep 157:18 0.13% gconfd-2
    7962 mwadmin 45 59 0 0K 0K sleep 749:45 0.10% ns-slapd
    any advice would be great.
    Darren

    Darren,
    For this error:
    [03/Oct/2008:11:58:25 -0600] - DEBUG - conn=-1 op=-1 msgId=-1 - PR_SetSocketOption(PR_SockOpt_NoDelay) failed, error -5962 (The value requested is too large to be stored in the data buffer provided.)
    some other stuff in the log file:
    [03/Oct/2008:11:48:25 -0600] - DEBUG - conn=-1 op=-1 msgId=-1 - PR_SetSocketOption(PR_SockOpt_NoDelay) failed, error -5962 (The value requested is too large to be stored in the data buffer provided.)
    Solution/Notes:_
    The below errors are "informational" in nature.
    This is not an issue with the directory server, but with a connection to the directory server and whatever(device,script, or application) is attempting this connection.
    These informational errors you are seeing in the logs are typically related to incoming connections from a load balancer or switch.
    It is usually some device,script or application doing monitoring of the LDAP server,port or connection.
    It is found that one of the biggest culprits to be the Cisco Content Switch or load balancer.
    Generally the cause of this error is a "sticky bit" setting within the Cisco Content Services Switch that is causing these errors.
    These load balancers periodically ping the servers (every five seconds) to verify that they are alive.
    After turning off the "sticky bit" setting, which disables the ping to the server every 5 seconds, the errors will no longer show up.
    The best course of action is to find the client doing this kind of monitoring and change it's behavior.You can look at the directory server's access log for B1 errors (the same client causing the PR accept errors in the errors log will cause B1 errors in the access log) at the same time you see these errors in the errors log. Then back track the connection in the access log to find the connectiing IP address of the clienton the first BIND.
    If you can not determine the client causing these errors and are concerned about your errors logs filling up then you can either turn off this error logging.
    This can be done dynamically on the server with a ldapmodify command:
    cd /install-root/shared/bin or cd /var/opt/mps/serverroot/shared/bin
    ./ldapmodify -p port -h hostname -D "cn=Directory Manager" -w password
    dn: cn=config
    changetype: modify
    replace: nsslapd-infolog-area
    nsslapd-infolog-area: 0
    If you don't want to do that then you can try and modify this attribute.
    "nsslapd-nagle
    When the value of this attribute is off, the TCP_NODELAY option is set so that LDAP responses
    (such as entries or result messages) are sent back to a client immediately.
    When the attribute is turned on, default TCP behavior applies.
    That is, the sending of data is delayed, in the hope that this will enable additional data to be grouped into
    one packet of the underlying network MTU size (typically 1500 bytes for Ethernet)."
    This will require you to stop and restart the server.
    NOTE: Below is the suggested fix, however, please apply this at your own discretion as this may or may not fix the issue. It depends on the client making these connections.
    1. Stop the directory server
    2. Edit the dse.ldif configuration file
    3. In the "cn=config
    " entry, add the attribute "nsslapd-nagle" with a value of "on".
    4. Start the directory server.

  • Safari cant find Server  please help

    i have connected to my wireless interent and when i try to go to any web site a message pops up saying "Safari can't open the page because it can't find the server" why is this happening???the connecton is strong and is there any thing i can do to fix this please and help would be great!
    Message was edited by: JR1000

    this happens all the time ... don't start posting anything on eBay quite yet ...
    most networks will allow connectivity, but may not allow for data transfer. don't trust the amount of bars up in the corner, or the checkmark next to the network name either.
    the town i live in has a wireless provider who, although their network is unencrypted and full strength, requires a monthly subscription to access. i'm not 100% sure why it's that way, but it happens.
    you'll have to find a better access point or reconfigure your local wifi network, if it's yours.
    good luck.

Maybe you are looking for

  • Change of Payment Terms: Vendor

    Hi All, Can somebody tell me how can we collectively change the payment terms in Vendor Master for a purchase organization. That is I dont want to change the Master Records individually...I want to change the records collectively.... Please advice...

  • Digitech RP350 USB Guitar Pedal, Not picking up sound input

    I just was trying to hook up my guitar pedal to garageband to record some tracks. I have the MIDI set up right I am pretty sure, garageband even recognizes the input device as "Digitech RP350". But when i try to record, it is picking up no sound inpu

  • IS THERE ANY WAY TO FORCE KEY COMMIT

    Hi: Is there any way in forcing when inserting/updating a record in a block to call KEYCOMMIT. For Example, if the user inserted/updated a record and before saving the user may quit the form. I would like to enforce the keycommit trigger to be called

  • 3D Texturing Help

    Hello I'm currently using CS6 Ext. and I'm making a gun finish for Counter-Strike:Global Offensive. There are some guides on making these but I think asking on the Adobe Forums would bring a better answer. I'd like to put a graphic I made over a 3D o

  • How do I get my music to quit scrolling and stop and play a song?

    How do I get my music to quit scrolling and stop and play a song?