URL call works in windows and not in linux

HI,
I am using the below code to call a URL from my java code. It works fine when I access the application from local tomcat service, but it doesn't work under linux where my production server is setup.
URL url = new URL(urlData);
                         URLConnection conn = url.openConnection();
                         conn.setDoOutput(true);
                         OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
               wr.write(rawData);
               wr.flush();
               BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
               String line;
               while ((line = rd.readLine()) != null) {
                    if (mode.equalsIgnoreCase("O"))
                         retValCaseId = Integer.parseInt(line.toString());
                    else if(mode.equalsIgnoreCase("C"))
                         retValCloseStatus = line.toString();
                         //System.out.println("retValCloseStatus "+ retValCloseStatus);
               wr.close();
               rd.close();

Do anyone know what is the problem?
Regds,
noneda

Similar Messages

  • URL.openStream() works in Windows but not in Linux

    I am having a problem with this line:
    BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
    in the code sample further below.
    A simple program using this line works when compiled in my Windows XP:
    java version "1.6.0_03"
    Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
    Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)
    but not when compiled on my RedHat FC 4 server:
    java version "1.4.2"
    gij (GNU libgcj) version 4.0.2 20051125 (Red Hat 4.0.2-8)
    The program (making using of a previous froum example and pared down to minimize tangent topics):
    The code works for all 3 URLs in Windows. In Linux it only works for the 1st one (bbc.co site)
    Error is listed below the code:
    import java.net.*;
    import java.io.*;
    public class BBC {
    public static void main(String[] args) throws Exception
    //    URL url = new URL("http://news.bbc.co.uk/sport1/hi/football/eng_prem/6205747.stm");
    //    URL url = new URL("http://www.weatherunderground.com/global/stations/71265.html");
        URL url = new URL("http://www.weatherunderground.com");
        BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
        int nLineCnt = 0;
        String inputLine;
        while ((inputLine = in.readLine()) != null)
            nLineCnt++;
        System.out.println("nLineCnt=" + nLineCnt);
    //--------------------------------------------------------------------------------------------------------------------------------------------Exception in thread "main" java.lang.StringIndexOutOfBoundsException
    at java.lang.String.substring(int, int) (/usr/lib/libgcj.so.6.0.0)
    at gnu.java.net.protocol.http.Request.readResponse(gnu.java.net.LineInputStream) (/usr/lib/libgcj.so.6.0.0)
    at gnu.java.net.protocol.http.Request.dispatch() (/usr/lib/libgcj.so.6.0.0)
    at gnu.java.net.protocol.http.HTTPURLConnection.connect() (/usr/lib/libgcj.so.6.0.0)
    at gnu.java.net.protocol.http.HTTPURLConnection.getInputStream() (/usr/lib/libgcj.so.6.0.0)
    at java.net.URL.openStream() (/usr/lib/libgcj.so.6.0.0)
    at BBC.main(java.lang.String[]) (Unknown Source)
    at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
    at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
    Can anyone please suggest what I can do to be able to process the weatherunderground URL?
    Claude

    To me it would suggest a bug in the VM that you are using.
    Solutions
    1. Use a different VM
    2. Write your own code to process the http code. Depending on licensing for the VM in use and the VM itself. you might be
    able to find the bug in that code, fix it yourself, and then use your fix (start up command line options for VM.) Otherwise
    you have to duplicate the functionality. You might look to jakarta commons, there might be code there that does that.

  • MB Black : Network working under Windows and NOT under OSX

    Hello,
    Since Monday, MacOSX can't detect my airport and ethernet connection, but, surprise surprise, It works fine under windows XP ! The bluetooth one works on OSX.
    I've reinstalled, the whole thing several times (OSX, Windows XP, OSX without bootcamp and XP), reset the PRAM, the PMU each time, but the problem's still here.
    Do you think it's a hardware problem ? Has anyone already experienced that ?
    It's the 3 logic board I use for the same MacBook, and I'm getting really disappointed...
    Nicolas

    Was there anything which may have triggered the problem? If the NICs work under Windoze it's not going to be a hardware issue with the Mac. Try a direct connection to the modem, if this works you can narrow it down to the hardware in-between. It's not the hub (unless that's between router and modem) as it effects the wireless side as well, so it sounds like the router. I assume you've cold booted it, so you could try restoring factory defaults under admin. If both have worked before there must be something which triggered the change, and this is first place I'd start looking.
    Danny

  • Macbook pro running windows 7 parallel vpn works in windows and not mac

    I recently purchased a macbook pro. My medical management software runs in windows. I installed the software on the mac using parallels. If I'm at my home network/office I can access the server/program. When I try to access the vpn outside the network it won't work.

    Parallels is supossed to be loaded on Mac OS platform and then you load Windows 7 on Parallels. The VPN is also supposed to be loaded on the Parallels platform. The VPN is not supposed to be on the Mac platform.
    If you need to run the VPN on the Mac platform then you have to edit the set up of it because it is not the same as running in Windows. You'll have to ask your IT person about using the VPN on the OS X.

  • CS6 Plugin works on windows but not mac

    Hi,
    We have been developing a plugin for InDesign since CS3 and have recently ported it to CS6 (it was ported to all previous versions too, as they came out).
    I followed the porting guide etc. and on windows it compiles and runs just ok - the plugin works correctly.
    But when i compiled the same files on our mac machine and put the .indesignPlugin file in th plugins directory i can't see our plugin's context menu.
    I can see that it is in fact loaded on startup (when i remove it ID loads 325 extensions, when i put it back - 326), but still it dosen't seem to work...
    I initially thought that the versioning was off but our PluginVersion resource relies solemnly on SDKDef.h , i also tried putiing the file in CS5's plugin directory and got an error message that CS6 is required - so the version info is fine i guess.
    We are using xCode 3.2.5 (because we have to support Mac OS 10.5 and 10.4) to build on mac and i've never had problems before - it worked on CS4, CS5 and CS5.5.
    The changes i made when porting were minor and only in the code - so what has changed? and how come it works on windows but not on mac?
    Any input is greatly appreciated, i've already spent days trying to understand this.
    Thanks,
    Dan.

    Hi and thank you for replying.
    The resources do get compiled correctly (i assume this because we do get a .indesign file at the end - which means the ODFRC ran ok). they are linked correctly in the mac project (i saw a file that determines the version - it's linked the same way against my win and mac projects and the win version works fine so i guess that's ok too).
    the context menu is just another menu on the "menu bar" (don't know how to call it?) - i.e where the "file" and "edit" etc. menus are.
    I can't seem to understand how come this works fine under windows but not under mac - they are essentially the same projects linked against the same resources (the difference being iCode vs VC10 projects).
    can this be related to the fact we're using xCode 3.2.5?
    Thank you.

  • Why is my airportxpr only working with Itunes and not with another music program

    why is my airportxpr only working with Itunes and not with another music program??
    I can not select/see other outputs in my sound selector.

    You have not indicated which OS or which music program you have so I have listed a program called Airfoil to try for both Windows and Mac - it may work for you
    for Windows - http://rogueamoeba.com/airfoil/windows/
    for Mac - http://rogueamoeba.com/airfoil/mac/

  • After the most recent firefox update I can no longer copy and paste. the fuinction only works in Windows and I HATE usign it. Any suggestions on how to restore the copy and paste function while using Mozilla?

    I have been unable to use the copy and past command while using mozilla. the fucntion does work in windows IE, but I don't want to use windows. How do I restore or fix this function? I varies, works some days and not others.

    See http://kb.mozillazine.org/Clipboard_not_working
    Try to use the keyboard if the buttons on the web page aren't working.
    * Copy: Ctrl+C or Ctrl+Insert
    * Paste: Ctrl+V or Shift+Insert
    * Cut: Ctrl+X or Shift+Delete

  • From Mac to PC. 3rd gen.iPod shows in Windows and not in iTunes

    3rd Generation iPod version 2.3
    Installing on a PC using Windows XP Home Edition
    My son gave me his old iPod having just bought the newest version. I already own an iPod shuffle and have not had any difficulties. I would mention however that my son used the iPod with his Mac computer.
    My difficulty is that the iPod shows up in Windows and not in iTunes. I just cannot get iTunes to recognize this iPod.
    On the settings on the iPod it states my name, the format is Windows and funnily enough all my playlists have been downloaded but not the tunes.
    I have uninstalled the iPod shuffle and uninstalled, reinstalled the software registering the new iPod to me and have gone through all the points mentioned on the Apple site on http://docs.info.apple.com/article.html?artnum=93716 many times.
    Because I kept getting the balloon “One of the USB Devices attached to this computer has malfunctioned and windows does not recognize it” (Even though it appeared in Disk Drives in Device Manager) I have bought and installed a USB 2.0 port PCI card. I really thought this would be the answer. However the usual balloons came up the first time (after having uninstalled and reinstalled the software yet again). The balloons stated that the hardware device has been installed and ready to use. However nothing appears in iTunes. Upon reconnecting the iPod again in whatever port I am still getting the balloon message “USB device attached to this computer has malfunctioned……………………..” All the USB port function properly with other devices (including the iPod shuffle when the software is uninstalled and installed again giving the shuffles details) and on the Device Manager windows they show as working properly. Still on the iPod “do not disconnect” and nothing on the window in iTunes and everytime I plug it in the same old notice comes up.
    Any ideas of a solution would be greatly appreciated.
    Dell Dimension 3000 Windows XP

    No reply from this discussion group but if this helps anyone else it would be good.
    I reformated iPod by right clicking on disk in My Computer and clicking format.
    After many different notices when trying to open I went to http://docs.info.apple.com/article.html?artnum=304996 and followed the instructions.
    The problem was solved and my iPod now appears in iTunes and I am able to sync.
    Millbrookman

  • Quicktime plugin works in IE and not in safari

    Hello,
    I'm using Safari 2.0.1 for browsing the web. I'm on Tiger 10.4.2 and have QT7 pro.
    Firewall is set to let Quicktime streaming pass through.
    the following URL is extract from the allocine web site witch is the french movie portal.
    http://www.allocine.fr/video/generation.mov?u=rtsp://a1622.v09806.c980.e.vq.akamaistream.net/7/1622/980 /41891159/quicktime.allocine.fr/nmedia/18/35/52/34/18397590_fa1_vosth.mov
    under safari I've got the big blue Q and that's it. On IE it works fine.
    Moreover on safari the end of the URL (beginning at RTSP) open quicktime player.
    Sound to me like a bug but can't be sure.
    You can check at www.allocine.com click on a movie and try to watch a trailer ("bande annonce" in french).
    Moreover High definition trailer works fine on this site with quicktime....
    really strange
    maxime
    just an add on : Trailers on apple web site works fine

    Sorry but already done that. Quicktime is set to RTSP and SDP in the mime settings...
    A person in the french forum got the salme problem than I and install IE. With IE he can got at allocine web site..
    I'm convinced it's something to do with the HTML interpreter but can't point out.
    On Safari the plugin seems not starting so I assume it's not the connexion and can't see why it would works under IE and not safari in this case...
    Please, I don't want to why IE, get my Safari back to work on allocine web site with quicktime
    maxime

  • Where is CS5 preference to use new window and not tabs?

    Hi,
    I prefer a new window rather than lose screen space to tabs.
    Is there a preference somewhere to open new document in new window and not as a tab?
    Thanks,
    Garrett

    You can use the "Float in window" command (available in Window | Arrange menu) - but this will work once you have created a new doc.

  • TS1363 I'm trying to set up my new ipod nano, it appears in windows and not in itunes- if I reinstall itunes, will the files of other ipod users on the computer be lost?

    I'm trying to up my new Ipod Nano, it appears in Windows and not in Itunes, if I reinstall Itunes, will files previously set up by other Ipod users sharing the computer be lost?

    You said " I sign in but her music list shows up mixed with about 1/3 of mine."
    Sign in where?
    What music list?
    It also sounds like that computer is not authorized for the account. You can only have 5 computers authorized for one account. If yo go to iTunes>Store>View account and then sign in it will tell you how many (but no what computers) are authorized. There is no way to find out what computers are authorized.
    You can deauthorize all computer once a year.
    See:
    iTunes Store: About authorization and deauthorization

  • Hello, I have a Mac computer with NVIDIA 750M dedicated graphics card and monitor EIZO but the problem was there when I was working with Windows and Acer monitor. When I open a file from Camera Raw in PS this is smaller than the screen so I double-click w

    Hello, I have a Mac computer with NVIDIA 750M dedicated graphics card and monitor EIZO but the problem was there when I was working with Windows and Acer monitor. When I open a file from Camera Raw in PS this is smaller than the screen so I double-click with the tool "hand" to fit on the screen, but the picture loses sharpness and becomes blurry. If you magnify the image even only slightly with the tool "zoom" the picture comes back clear. In Camera Raw instead is always sharp. I solve the problem by turning off the graphics card in PS but often use plugin that need the graphics card otherwise the processing time is much longer. I ask for help.
    Thanks.

    Hello, I have a Mac computer with NVIDIA 750M dedicated graphics card and monitor EIZO but the problem was there when I was working with Windows and Acer monitor. When I open a file from Camera Raw in PS this is smaller than the screen so I double-click with the tool "hand" to fit on the screen, but the picture loses sharpness and becomes blurry. If you magnify the image even only slightly with the tool "zoom" the picture comes back clear. In Camera Raw instead is always sharp. I solve the problem by turning off the graphics card in PS but often use plugin that need the graphics card otherwise the processing time is much longer. I ask for help.
    Thanks.

  • How do I get a longer list of items in the history window - and not have to click "Show All History"? The default list is too short.

    How do I get a longer list of items in the history window - and not have to click "Show All History"? The default list is too short.

    Well I figured it out… all you do say show commands :-/

  • Why does my php export feature work in IE and not firefox?

    Why does my php export feature work in IE and not Firefox? I've written a web application which contains a SigmaGrid. The grid controls reload, add update delete, print and export to csv all work in IE8. The export feature does not work in Firefox.

    I'm not sure what's going on for you. I've had 4 other developers - two on Comcast and two on Fios review my work and they get the control and export action in the IE8 version but not the FF10 version.
    Thanks for looking into this for me, though. I appreciate the effort. '' The operation was a success doctor, but the patient died.''

  • I have CS6 and CC installed on my mac when I'm using CS6 and use bridge CC activates how can I set this to only work on one and not the other

    I have CS6 and CC installed on my mac when I'm using CS6 and use bridge CC activates how can I set this to only work on one and not the other

    If you want Bridge CS6 to open when using Photoshop CS6, you must quit Bridge CC.
    Then File menu > Browse in Bridge will bring up Bridge CS6.
    If Bridge CC is already open, The File > Browse in Bridge for Photoshop CS6 will use Bridge CC and Bridge CS6 will not open.
    I hope that's the answer you were looking for.
    Gene

Maybe you are looking for

  • Acrobat 9 Pro installation problem

    I have some problem while installing the acrobat 9 pro where download from adobe.com While I start to install to acrobat 9 pro, then there will be a window that will count from 00.00% to 100%, right. After counting to 100%, the window will close and

  • Trying to print DVD-Cover, but Text is missing

    Hi, I'm trying to print a Cover I designed in Pages. It is printing everything fine except for the text that sits vertically (at 270°) on the spine of the cover. When I turn it to 0° it is being printed. Again at any other degree rate it is not showi

  • Possiblity to expand / narrow / reset all drillstroughable parts of the report with one button

    Hi, has anyone done that bevore? Is this possible .. I have parts of a big Report, that are expanded (where i can see all detaildata) and parts where the detaildata is there, but arent showed by Standard (are narrowed). I wish i could have a button,

  • Query regarding report

    Hi, I need to create a new report to list all the managers and the users under the managers. pease help me to achieve this functionality. the report should looks like... manager_nameA user_uder_manager_nameA1 , user_uder_manager_nameA2,user_uder_mana

  • 9i and 10g on same server (Win 2000) - only use one a time.

    I am working on setting up an oracle server for testing purposes and wonder if it is possible to install 9i and 10g on the same server (Win 2000) without any conflicts? Only one would be used at a time. Thanks, Luke