Sending "Cookie" header  with JRE 1.5.0_07 doesn't work with JWS

Hi
I have a JWS application that runs from JRE 1.4.0_XX to JRE 1.5.0_06
The app sends a "Cookie" header to our webserver
HttpURLConnection tc = (HttpURLConnection)repository.openConnection();
tc.setRequestProperty("Cookie", "GLINK=TOKENID");
Now this has worked thru 20 different runtime versions since 1.4.0_xx until JRE 1.5.0_07 was released. My code has remained unchanged for 3 years. And with JRE 1.5.0_07 the "Cookie" header is simply gone in the webserver or never sent at all. The changelog for 1.5.0_07 only has a rough description of what has changed. I can see that SUN has made som changes to class HttpUrlConnection in 1.5.0_07 by comparing class files against 1.5.0_06 and apparently disturbed som funtionality that worked before. Other headers are received but not the "Cookie" header. If the application is executed without JWS, for example with Eclipse or Jbuilder, the "Cookie" header is received by the web server and all other headers as well.
Any ideas what SUN has done in 1.5.0_07 and JWS ?? and more specifically in class URLConnection or HttpURLConnection.
Here is some code example to test the issue:
Run this code with and without Java Web Start
With JWS, the "Cookie" header is never received by the server.
without JWS, the header value is reveived.
import java.net.*;
import java.io.*;
public class HTTPTest
public static byte[] crLfArr = {13,10};
public static String contenttype_ = "text/plain";
public static BufferedReader retval = null;
public static void main(String[] args) throws IOException
int tecken = (int)'X';
String boundary = "12345xyzzy";
URL repository = new URL("http://myserver");
URLConnection tc = (URLConnection)repository.openConnection();
tc.setDoOutput(true);
tc.setDoInput(true);
tc.setAllowUserInteraction(false);
tc.setRequestProperty("Content-Type"," multipart/form-data; boundary=" + boundary);
tc.setRequestProperty("Cookie", "GLINK=TOKENID");
OutputStream out = tc.getOutputStream();
printPartHeader(out, boundary, "filtag" , "filnamn");
out.write(tecken);
printEndBoundary(out,boundary);
out.close();
retval = new BufferedReader(new InputStreamReader(tc.getInputStream()));
public static void printEndBoundary(OutputStream out, String boundary) throws IOException
String str;
str = "--" + boundary + "--";
out.write(str.getBytes());
out.write(crLfArr);
out.write(crLfArr);
public static void printPartHeader(OutputStream out,
String boundary,
String field,
String filename) throws IOException
String str;
printBoundary(out,boundary);
str = "Content-Disposition: form-data; name=\"" + field + "\"";
out.write(str.getBytes());
if (filename.length() > 0) {
str = "; filename=\"" + filename + "\"";
out.write(str.getBytes());
out.write(crLfArr);
str = "Content-Type: " + contenttype_;
out.write(str.getBytes());
out.write(crLfArr);
out.write(crLfArr);
public static void printBoundary(OutputStream out, String boundary) throws IOException
String str;
str = "--" + boundary;
out.write(str.getBytes());
out.write(crLfArr);
Regards
Jojje

Hi,
I decompiled the HttpURLConnection implementation in question from the rt.jar file. I do not think that you can find the source code for these SUN-specific implementations anywhere (except maybe through the new Java 6.0 collaboration process).
JAD did the trick.
For the standard classes (packages java.*, javax.*), I think that the most current source code is included in the corresponding JDK download.
As to the JWS vs. standalone effect, I do not know what happens there.
Maybe Java uses a different HttpURLConnection implementation when running as a standalone application?
For our applet, the problem is definitely there. The cookie header was set but already removed when the CookieHandler method was called.
The trouble is, that our applet can operate multiple independent sessions (with different session-ids), so a global CookieHandler is not an option. The only reason why I previously had to implement my own CookieHandler implementation in 1.5 was in order to remove unwanted Cookies which were otherwise inherited from the browser session by the CookieHandler�s applet default implementation.
I also entered a bug report (on Wednesday already)...
regards,
Gunnar

Similar Messages

  • Proxy client (over USB connection) with DHCP assigned IP address doesn't work with FRDM-K64F

    Hello,
    after reading about the issues on this forum with a static IP address on the Freescale FRDM-K64F board I went for an DHCP address but I can't get the proxy client to work over a USB connection with DHCP either.
    My console tells me the following:
    RTC Time: Wed 2014-01-01 00:07:27
    Network initialized
    IP Address:      10.143.xxx.yyy (xxx and yyy is real numbers, just changing them for the forum to letters)
    Subnet mask:     255.255.252.0
    Gateway:         10.143.xxx.yyy
    MAC-address:     00:0c:00:06:70:00
    And when I try o to connect with the following command :
    java -jar proxy.jar -socket 10.143.xxx.yyy
    I get the following output and no CLI interface:
    Trying to open socket connection with device: 10.143.xxx.yyy:2201
    Connected to the socket: Socket[addr=/10.143.xxx.yyy,port=2201,localport=49605]
    Open channel 8 with hash 0x130399b3
    Channel 8 CLOSED -> OPENED
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 OPENED -> AVAILABLE
    Open channel 9 with hash 0x0
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    Channel 8 AVAILABLE -> REQUEST_SENT
    notifyResponse ACK_RESPONSE on channel 8
    Channel 8 REQUEST_SENT -> ACKNOWLEDGED
    Channel 8 ACKNOWLEDGED -> DATA_SENT
    notifyResponse AVAILABLE_RESPONSE on channel 8
    Channel 8 DATA_SENT -> AVAILABLE
    I don't know if this matter but my java version is:
    java version "1.8.0_31"
    Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
    Any ideas or am I missing something completely?
    Thanks
    Andy

    Hi, Andy. Please excuse my ignorance, I am very new at this ME embedded stuff. I had my challenges, but was finally able to get my board up with a static address. I went through a lot of headaches, but finally got the board flashed with the latest bin. I then updated the jwc_properties.ini file on the SD card to include:
    # Whether static configuration or DHCP server is used do get IP address. Possible values: dhcp,static
    ip.method = static
    # IP address,used with static IP configuration only
    ip.addr = 192.168.0.30
    # Network mask,used with static IP configuration only
    ip.netmask = 255.255.255.0
    # Network gateway,used with static IP configuration only
    ip.gateway = 192.168.0.1
    # DNS server,used with static IP configuration only
    ip.dns = 208.67.222.222
    # MAC address
    mac.addr = 01:02:03:04:05:06
    I was then put the card into the board, disconnected both USB cables, and then powered it up. From that point I was able to ping the board. I can now use Device Manager in NetBeans to connect to the device.
    I am struggling quite a bit with many issues. It seems that when I try to stop the app from NetBeans, the "please wait" dialog hangs forever. I have to use Windows Task Manager to kill the "JavaW" process tree and reconnect the board.
    I have also had trouble understanding the GPIO pin assignments. Another gotcha was trying to use the AutoStart feature. Since the sample app never cleanly exited, I thought that I bricked the board. The secret is to power it down, remove the SD card, and then delete all files EXCEPT the jwc_properties.ini file, put the SD card back in, then power up. It seems that the board forgets that the MIDlet was installed.
    Hope this helps others out there.
    Please everybody, post your experiences here. There seem to be very few of us, and finding pearls in the dust is rare right now.
    Regards,
    Pete

  • How can I get Firefox version 5? I use an application for banking that doesn't work with version 6 yet.

    I am using an application for banking with Bank of America that doesn't work with Firefox 6 so I need to install Firefox 5 until Bank of America can update their app to work with Firefox 6. Can you tell me how to find the download for Firefox 5?
    Thank you

    I have an old iPhoto version and it still works with Mavericks, the version before yours, that is puzzling.

  • MSI K7N2-L usb 2.0 doesn't work with scanjet 4570c

    I have a MSI K7N2-L motherboard with WINXP and SP1 that doesn't work with Scanjet 4570C if I set USB in BIOS to 1.1+2.2.  Sometimes it locked up the PC or it showed streaks on the image.  It worked just fine if I set to USB 1.1.  Does anyone knows this is the problem with the MSI motherboard?  I'm sure it was not the Scanjet since it is USB 2.0 supported, and I'd tried another Scanjet and the problem was still the same.

    Quote from: Wonkanoby on 21-March-05, 21:14:07
    If you are having problems with USB ports, read this topic.
    besure you have only 8 wires connected no usboc
    Nice topic! 
    But usb 2.0 DOES work with 1.3, 1.4 and 1.52 BIOSes. Only after updating to 1.5 official one of the front panel ports (not all 2) start works as 1.1   

  • I used migration to send photos form my Mac Book to my I Mac now i get an error message "iPhoto can not be opened because of a problem"  Check with the developer to make sure iPhoto works with this version of Max OSX.  You may need to install any availabl

    I used migration to send photos form my Mac Book to my I Mac now i get an error message "iPhoto can not be opened because of a problem"  Check with the developer to make sure iPhoto works with this version of Max OSX.  You may need to install any available updates or reinstall IPhoto.
    I tried installing Iphoto it said it was downloaded successfully. I still get the error messafe, and can not open any photos of program,  any suggestions?

    What version of iPhoto do you have on the Macbook and on the iMac? What systems are you running on the Macbook and on the iMac?
    Does the message only refer to "a problem" or does it specify what it is?
    Happy Holidays

  • I have tried VERY unsuccessfully to install iphoto 9.2.3 update...it says it has successfully updated - then on opening says: iPhoto cannot be opened because of a problem. Check with the developer to make sure iPhoto works with this version of Mac OS X.

    I have tried VERY unsuccessfully to install the new iphoto 9.2.3 update.
    I have installed it several times both from the appstore and from Apple Support downloads...it says it has 'successfully updated' - then on opening iphoto, a dialogue box pops up and says:
    iPhoto cannot be opened because of a problem.
    Check with the developer to make sure iPhoto works with this version of Mac OS X. You may need to reinstall the application. Be sure to install any available updates for the application and Mac OS X.
    Click Report to see more detailed information and send a report to Apple.
    Insane...I have all my updates including Lion 10.7.3 why does APPLE KEEP SENDING BETAS AS A REAL PRODUCT?
    Does anyone know how to copy over a backup from a twinned drive Backup? What files etc.
    Thanks tons...

    Thanks Terence,
    I did get it working finally...and your last advice was what I needed.
    I am embarassed that I was an early adopter...SHOULD HAVE KNOWN BETTER and read the problems before creating some for myself.
    This was an excercise in frustration, because of the obtuse division between the appstore and Apple Support downloads... it was a bit of a circuitous route...strange that with all the security reciepts and tracking that Apple goes to to prevent piracy... which Steve by his own admission used to build Apple...
    Why aren't the server scripts smart enough to say…”HEY DUMMY you can't use this download because you purchased the last iPhoto upgrade from the appstore...and… DON'T WASTE YOUR TIME and precious data BUDGET downloading this gargantuan file which will eat 20% of your expensive 5Gb monthly data allotment!!!…and NOT WORK…only pretend to…and then foul your system….kill your productivity and turn your hair whiter…even worse than LION did.
    I am just so antagonized by the inept scripts in recent installations that don't do a diagnostic before allowing installation that is going to corrupt things...I had less effort and frustration when I ran my ATARI with a MAC emulator...rarely lost any productivity to nonsense.
    I AM TIRED OF BETAs dressed as products...designed and rushed out for Apple toys that once were tools of the creative trade...COREL...may still have a chance at a comeback if Apple keeps pumping out toys instead of the venerable tools we once adored as income enhancers.

  • IMessage works fine for me and my friend when talking with other Apple guys but doesn't work when we want to chat with each other

    Hello. Both me and my friend has got an iPhone. We both have the newest version of iOS7. We both have iMessage turned on and it works for both of us while we want to chat with other iPhone/iPad/iPod friends. But... when we want to send each other an iMessage... it doesn't work. Let's say my friend's contact name is "D" so i go to Messages -> New Message and in the recipient field i write D. I can choose her number and if it was iMessage "D" would obviously turn in blue like it does. But no, it turnes green and forces me to send normal SMS as if she didn't have an Apple device. Please help, klejbroda.

    Make sure the send address you are using for the friend (and vice versa) are actually one of those you have set for iMessage.

  • I have ipad with IOS 7,  Some apps doesn' t work, safari not open some web site. What can I do?

    I have ipad with IOS 7,  Some apps doesn' t work, safari not open some web site. What can I do?

    Try this and see if it helps.
    Settings>Safari>Clear cookies and data.
    Now close Safari completely. Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the app that you want to close and then "swipe up" or "drag up" on the app preview thumbnail to close it.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Comcast email doesn't work with firefox 26. I can't get a full inbox, get to my preferences to change, drop downs need to use arrows to get to

    firefox 26 doesn't work with comcast email. won't keep me signed in; won't show whole inbox in either full or lite; won't allow me to get to preferences; drop downs only work with arrows. I could just keep going.
    Earlier this week they worked fine.

    Be sure to delete the login.comcast.net cookie, it is not near the other comcast and xfinity cookies.

  • Keyconfig doesn't work with FF 24.0. Is there a way?

    I have just completed rebuilding my PC from a hard disk format. In doing so, I loaded the latest FF 24.0.
    Part of my essential application was a script that used keyconfig to cause Easy Copy to send page source to the clipboard, where the script parses it. Unfortunately, keyconfig does not work with FF 24.0.
    The write-up for Easy Copy starts to explain how to make it act on a key combination, rather than on mouse action without using keycopy - but then says how it doesn't need to, because it's too much effort, and besides - keyconfig exists and does the job - which, I agree, it used to, very well - but it doesn't any more.
    What to do? If there is no other way, can I get a downgrade of FF that works with keyconfig?
    There is a new add-on, key config (note the space), but it doesn't do what keyconfig did.

    Hmmm...
    The first time I loaded it was through the FireFox Add-ons tool, so that was the natural mechanism to use to do it again. Even now, it is listed on the tool - but a notice comes up saying that it doesn't work with FF 24.0. Before getting help from you, I was on the point of downgrading FireFox to be able to use the add-on with an older version.
    Another solution to my problem (possibly a better one) would be if the writer of Easy Copy would give instructions for making a key combination to cause his add-on to respond to the keyboard without the intervention of keyconfig - hence only one add-on would be needed instead of two. He has made hotkeys for two of his functions - to copy the URL to scratchpad, for example, but there is no hotkey to copy the page source. I was going to suggest it on his web site, but it doesn't accept input.

  • I had a Tascam US 122 usb interface, but it didn't work with OSX Mavericks. What model would work with this? Would the US-144 mkii work with my system?

    I had a Tascam US 122 usb interface, but it didn't work with OSX Mavericks. What model would work with this? Would the US-144 mkii work with my system?
    Thanks!

    You didn't mention the kind of track in GB you are trying to create, but if you are connecting the keyboard with a guitar chord to the Tascam, you will need to set up a Real Instrument Track in GB to hear anything. If your keyboard has a midi out, use a midi cable to the midi input of the Tascam, create Software Instrument Track, and you will hear something. But with a guitar chord, it won't send the right signal to a Software Instrument Track. The headphone jack in the Tascam monitors the signal coming back to it out of GB (if you choose the US-122 as your monitor in GB's preferences), so you wouldn't hear your keyboard if the track is not set up correctly. It could be the drivers, but since you didn't mention the type of keyboard or the type of GB track, I thought that might be a possible answer as well.
    eMac   Mac OS X (10.3.8)  

  • LG 42-inch LCD TV - 42LS5700 Doesn't work with Apple TV?

    I saw a posting on Amazon that states this LG doesn't work with the third gengeration Apple TV. Is the 3rd generation the latest? If so is this true?

    I was hoping someone out there with both the TV and the Apple TV would confirm it doesn't work. As the OP of this thread I did know about the Amazon.com posting, but wondered if the reviewer there just didn't set it up right.
    LG's support has been a disappointment so far in that I attempted to post a question on their forums and it was rejected. Oddly they said it didn't meet their posting requirements.
    I've kept the LG boxed and may send it back.

  • Slide advancer (Kensington) doesn't work with powerpoint

    slide advancer (Kensington) doesn't work with powerpoint

    Hi, Todd.
    I don't use an AirClick, but a quick check over at Griffin Technologies indicates one must be using PowerPoint 2004 to control presentations with the AirClick and AirClick USB products.
    If you're using PowerPoint 2004, then I suggest you take up the matter with Griffin Technology's Support. They also appear to have published some updated software for AirClick.
    Another place you may want to search or post is the the PowerPoint group you can find on the Microsoft Mac Support - Newsgroups page. These are Google Groups with active participation from MS PowerPoint users, including a variety of expert users.
    I don't mean to send you somewhere else, but I've found numerous answers there for folks with questions related to MS products. Accordingly, it has often proved to be the first, best place to look for answers to questions such as you are asking.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • Trying to load illustrator 6cs onto new mac and the old activation code for my ill cs doesn't work with it

    Trying to load a downloaded version of illustrator 6cs onto new mac and the old activation code for my illustrator cs doesn't work with it.  Do I need a new code or am I missing something?  Same goes for my Photoshop cs.

    you need your serial number.
    if you purchased from or registered with adobe check your account, https://www.adobe.com/account.html

  • Why my new Mac mini  DVI dual link mini display port adapter doesn't work  with my 30"display (LG W3000H)?

    Hello There
    Can any of you advise on the below? Tried to connect Mac mini with a 30" display through a DVI dual link mini display port adapter. For the first try Mac mini go connected to the display, then i've chosen the highest resolution (2560x1600, native) and right at that moment they got disconected. Since then the display stays black. What can be the issue, is it possible DVI dual link mini display port adapter is not compatible with 30"display (LG W3000H)? It works with DVI male-male cable plus DVI HDMI adapter as long as the resolution stays under 1280x800. Any idea is much appreciated.
    Thank you, Vera

    Hi,
    I can report that my Mac Mini Intel Duo connected instantly and without even having to set it up (on the first try) with my 1366x768 native resolution DELL 50" Plasma Display. It's so beautiful that I just want to stand there and fondle my HDTV as I drool haplessly like Homer Simpson with a doughnut in his mouth. Seriously, no problems.... guess I bought the right cable (ebay).
    Before you buy a Duo, make sure you're aware of the airport and bluetooth issues that so many (maybe everyone who tries to use them together) are having. It seems that bluetooth interferes with airport, or maybe the other way around. Anyway, it's messed up. Also, Airport reception is generally VERY poor with the new Intel Mac Mini.
    Despite these things, I still love mine (I now have 2 base stations and an airport express for my powerhouse wireless needs, and an external DLink bluetooth-2-USB dongle solved the bluetooth/airport issues... in my case).
    FWIW,
    awk
    667-MHz Ti PowerBook G4.   Mac OS X (10.3.9)  

Maybe you are looking for

  • Register and integrate SIP number in Skype for Business

    Hello, We are setting up a skype for business server and would like to know if it is possible to register a sip number straight into the server configuration?We have a voip number with the details and would like to use this one.. KRBas

  • Using 35mm Lense adapter (flipped images)

    Guys, i use cameras with mini35 mm apadters that flips my image... So, i see a few of ways to edit this material. 1.Create an apple script, that would flip every mov that i captured P.S.: but this is not good idea, because, FCP doesnt understand any

  • Cannot query composites in EM

    Hi, I installed SOA Suite 11.1.1.4 on windows and database XE. The installation is successful, but when I go to EM --> SOA --> soa-infra --> default, I get only message "Fetching Data..." in all the tabs. I even deployed a composite but I can't query

  • Contact sheet pdf in lightroom

    I was recently shown how to create contact sheet pdf's in Lightroom 4 which could be emailed to clients onto which they could comment and return. All this without the need for more software or so i thought. I cannot seem to make it work. What softwar

  • Apple Care extension?

    Is it possible to extend Apple Care Warranty after the 3-year period? If not, are there other companies that offer such warranties? Thanks!