How to work around the java runtime bug -The indentation is overridden

Hello all,
I generate xml from a servlet and stream to client as the following code. It works fine in my local machine (The xml is indented nicely) but when the war file deployed on a geronimo server 2.0.2. (It uses java 1.5.0_16). The xml streamed out without indentation
               response.setContentType("application/xml");
               response.setHeader("Content-disposition","attachment; filename="+fileName);
               // set up a transformer
               TransformerFactory transfac = TransformerFactory.newInstance();
               Transformer trans = transfac.newTransformer();
               trans.setOutputProperty(OutputKeys.METHOD, "xml");                
               trans.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
               trans.setOutputProperty(OutputKeys.STANDALONE, "yes");
               trans.setOutputProperty(OutputKeys.VERSION, "1.0");
               trans.setOutputProperty(OutputKeys.INDENT, "yes");
               trans.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
               // create string from xml tree
               DOMSource source = new DOMSource(doc);
               ServletOutputStream os = response.getOutputStream();
               OutputStreamWriter w = new OutputStreamWriter(os, "UTF-8");
               StreamResult result = new StreamResult();          
               result.setWriter(w);
               trans.transform(source, result);This is the bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6337981 (The indentation is overridden)
I tried the work around suggested there by using OutputStreamWriter, it doesn't help.
(I cannot change anything on the server. I have to accept whatever in the server)
Please help
Thank you
Edited by: mycoffee on Jun 10, 2011 8:16 AM

You have to set the indent level on the factory, see bug #6296446. This only affects 1.5; 1.6 allows you to set the indent level on the transformer, as you did (and for cross-version compatibility, setting it on both doesn't hurt).
transfac.setAttribute("indent-number", Integer.valueOf(4));

Similar Messages

  • HT201272 hi all, I am having trouble downloading 2 music videos. I keep getting the download error 8008. Can anyone enlighten me on how to work around the problem.

    Hi guys, I'm havinh trouble downloading 2 music videos. The download starts then stops before it gets going and gives me an error code, 8008. Can anyone help please.

    Try the troubleshooting for that error number on this page : http://support.apple.com/kb/TS3297
    "Error -50," "-5000," "8003," "8008," or "-42023"
    These alerts occur due to timeouts or conflicts trying to write a file during download.
    If you encounter this issue while accessing iTunes Store:
    See iTunes 9: "One Moment Please" or "Error (-50)" message when accessing iTunes Store
    If you encounter this issue while while downloading something from the iTunes Store:
    Delete your iTunes Downloads folder, located in:
    Mac OS X:
  ~/Music/iTunes/iTunes Media/Downloads   Note: "iTunes Media" may appear as "iTunes Music. Also, the tilde (~) refers to your Home directory.
    Windows Vista:
  \Users\username\Music\iTunes\iTunes Media\Downloads\
    Windows 7:
  \Users\username\My Music\iTunes\iTunes Media\Downloads\
    Windows XP:
  \Documents and Settings\username\My Documents\My Music\iTunes\iTunes Media\Downloads\
    After locating your iTunes Downloads folder:
    Quit iTunes.
    Delete the Downloads folder on your computer.
    Open iTunes.
    Choose Store > Check for Available Downloads.
    Enter your account name and password.
    If you encounter this issue while while downloading Digital Copies using Windows:
    Use MSCONFIG (directions for Windows XP and Windows Vista/Windows 7) to disable conflicting software.
    If using MSCONFIG steps resolves the issue, you may want to use the System Configuration Utility to turn on the third-party System Services and Startup Items one at a time (restarting your computer after turning on the item or items) to identify which System Service or Startup Item is causing the conflict.
    You can turn all of them back on by selecting the Normal Startup option under the General tab of the System Configuration Utility window, but please note that this may cause the issue to reoccur.
    If you are able to isolate the issue to a particular third-party software, you may wish to contact them to let them know of the conflict.

  • I no longer have access to my icloud email and don't know the answers to my security questions. Does anyone know how to work around this to reset my icloud ID without losing my info? I haven't backed up in a year because of this.

    I no longer have access to my icloud email and don't know the answers to my security questions. Does anyone know how to work around this to reset my icloud ID without losing my info? I haven't backed up in a year because of this.

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (123381)

  • Dev 6.0: Bug in ReportBuilder (!!!) How to work around ?

    Hi !
    I have a problem with ReportBuilder. After Arrange->Size Objects
    or Arrange->Allign Objects the child object doesn't belong to
    paren frame. There is no such thing in Developer 2000. Can
    anybody help me how to work around it ? It's practically
    impossible to create complicated report.
    Thanks in advance.
    null

    I don't know is it's possible to just search and replace as part of the checkout. We do it the other way around. Each user uses his own directory but for jdev all development is done in /mnt_dev/...
    So you map the users development directory to /mnt_dev. this way the path information stays constant and you don't need change the environment.
    Timo

  • How to work around audio sounding worse in Logic?

    Hi Folks
    We just bought Logic 8 for its MIDI, composing/scoring and loop/instrument resources. Have used Nuendo for 5 years, for audio for video, which has included some music creation.
    I did some quick recording/playback audio tests and here's how I hear the results:
    Voice recorded and played back in Nuendo sounds just like live. Voice recorded in Logic and played back in Logic sounds relatively flat and digital. Voice recorded in Nuendo and played back in Logic sounds relatively flat and digital. Voice recorded in Logic, exported as a file and played back in Nuendo sounds just like live voice and like it was recorded in Nuendo.
    So how do you work around the crummy sounding audio in Logic? Is the problem only the audio playback within Logic? Do you compose in Logic, export as files and then mix in another app? If so, which app? Or do you know the export will sound better outside of Logic? Or what other adaptation have people come to?
    Thanks for reading.

    No audio problems with Logic Pro 8 my side. In fact, it is sounding somehow better than Logic Pro 7 and latency is better. 44/48/96 all sounds great! Bus, FX, output, EXS24, etc. etc. -- wonderful stuff.
    Interface wise everything is at my finger tips and I didn't have to do anything to get my control surfaces to work (Mackie). Everything makes sense -- huge improvement over LP7. Really helps me explore being creative.
    So far Logic Pro 8 is an amazing step forward -- good work Apple.
    Thank you Apple.

  • Working around the frame selection order issue in CS 4

    Hi guys,
    I'm trying to write a javascript in Indesign that will copy the contents of every selected text frame into the clipboard. The main problem is the selection order, since I'm using CS 4. I'm trying to work around the problem by writing the X and Y coordinates of every frame in arrays through a "for" loop, since the relevant order is always from top left to bottom right in my documents. However, I'm not sure what to do after sorting the arrays : how could I tell the program to use first the frame with the coordinates closest to 0, then the next, etc. ? So far I have this :
    var LesX = new Array();
    var LesY = new Array();
    var Blocs = app.selection;
    for (var i = 0; i < Blocs.length; i++) {
    var myBounds = Blocs[i].geometricBounds;
    var X = myBounds[1];
    var Y = myBounds[0];
    LesX.push(X);
    LesY.push(Y);
    LesX.sort(sortnum);
    Thanks a lot for your help!
    Ma

    Ths is not a good approach. your LesX array will be something like [90, 50, 30, 60, 20] before the sort. And after the sort it will be [20, 30, 50, 60, 90]. But that will not tell you how to find the object whose X value is 20.
    I would write it like this:
    function byYX(a,b) {
        var
            aY = a.geometricBounds[0],
            bY = b.geometricBounds[0],
            aX = a.geometricBounds[1],
            bX = b.geometricBounds[1],
            dy = bY-aY,
            dx = bX-aX;
        return dy?dy:dx;
    var blocs = app.selection;
    blocs.sort(byYX);

  • I was looking at the "Find my iPhone" app and I have a doubt regarding how it works for the macbook. In order to detect the location, the macbook should remain signed into iCloud. What if the thief logs out of iCloud. Would we able to locate the macbook?

    I was looking at the "Find my iPhone" app and I have a doubt regarding how it works for the macbook. In order to detect the location, the macbook should remain signed into iCloud. What if the person who has stolen my macbook logs out of iCloud.
    It should work fine for iPhone/iPad because we can enable "Restrictions" to prevent the user from signing out of iCloud. Do we have simialr settings for the macbook?
    Thanks,

    If it's not on the device list, it indicates that someone has gone to Find My iPhone on icloud.com and manually deleted it from the device list (as explained here: http://help.apple.com/icloud/#mmfc0eeddd), and it has not gone back online since (which would cause it to reappear on the device list; Find My iPhone has been turned of in settings on the device; the iClolud account has been deleted from the device; or the entire devices has been erased and restored.
    Unfortunately, there's no other way to track the phone other than through Find My iPhone.  You could call your carrier and see if they would blackliste it so at least the theif couldn't use it.

  • My daughter forgot her password, any suggestions of how to get around the password without deleting everything she has on it?

    She has never synced her ipod touch to iTunes, any suggestions of how to get around the password without deleting everything she has on the device?  Apple support recommended recovery mode, but doesn't that erase everything on the ipod?

    You are out of luck but a Date Recovery company may be able to help if the iPod does not have iOS 8.
    If there is an iCloud backup you can restore from that.
    You can redownload most iTunes purchases by:        
      Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • Hallo My system runs slow. how can i reorganize the date, that the pc runs faster? In the window world i hade to delete some fils. how it work in the apple world?

    Hallo My system runs slow. how can i reorganize the date, that the pc runs faster? In the window world i hade to delete some fils. how it work in the apple world?

    See these:
    Switching from Windows to Mac OS X,
    Basic Tutorials on using a Mac,
    Mac OS X keyboard shortcuts,
    Anatomy of a Mac,
    MacTips,
    Switching to Mac Superguide, and
    Switching to the Mac: The Missing Manual, Mountain Lion Edition.
    Additionally, *Texas Mac Man* recommends:
    Quick Assist,
    Welcome to the Switch To A Mac Guides,
    Take Control E-books, and
    A guide for switching to a Mac.
    Once you get familiar with the Mac, see:
    Mac Maintenance Quick Assist,
    Mac OS X speed FAQ,
    Speeding up Macs,
    How to Speed up Macs, ,
    Macintosh OS X Routine Maintenance,
    Essential Mac Maintenance: Get set up,
    Essential Mac Maintenance: Rev up your routines,
    Maintaining OS X, 
    Five Mac maintenance myths and
    Myths of required versus not required maintenance for Mac OS X for information.

  • Scheduling Gantt: How to work with the "zoom-to-fit" drop-down

    I'm trying to figure out how to work with the "zoom-to-fit" drop-down on the scheduling Gantt dvt control. It has choices in the drop-down that are not appropriate for my project. The documented purpose of this drop-down is to allow the user to zoom to a level that would allow a certain time range to "fit" within the current window. The choices start at "1 Week" and go up through "2 Weeks", "1 Month" etc. The problem is that the projects I'm displaying are generally just a couple of days long, and consist of many small tasks. So even 1 Week is too big. Also, no matter what I pick in this drop down, nothing happens.
    So my questions are these:
    1. Can I change the choices in this drop-down? If so, how do I do that?
    2. If not, then how can I remove this drop-down? (I figure I probably can if I disable "zoom", but I don't want to do that.)
    3. How do I get this to actually do something? I assume maybe I have to code some listener somewhere, but if so, how do I do that.
    Thanks for any hints, tips and advice!

    Currently, we do not allow customization of zoom-to-fit. Please file an ER. We could add a param to featuresOff attribute to disable/remove zoom-to-fit from the toolbar without disabling/removing zoom.

  • How to work on the same project on two machines at the same time and also exchange progress seamlessly using Adobe Premiere Pro CC 2014?

    We are working on a film project on Adobe Premiere Pro CC 2014. Two editors are working on the same film project (same pproj file ) on two machines. As a result the bin structure and the file structure is exactly the same. We even bought two licenses for the respective machines to make matters simple (at least we thought it would).
    Now when we share a sequence between the two machines, every time we have to import and re-link media. Also each sequence import comes with its own set of files, which are actually already present in the project. Basically the new sequences are looking to re-link the media to the original/ source files only and are completely ignoring the file structure present in the project.
    In all editing softwares, timeline/ sequence sharing is a very common practise when working on multiple machines. Why is it so tedious in CC 2014? Every time we share a sequence between the two machines the media gets doubled and tripled in the project. As a result the project file size is increasing perpetually. Already Premiere CC 2014 is extremely laggy and slow, and this stupid bug is making it more difficult for us to finish our work on time.
    Has anybody ever faced this issue? How do we solve it? We are willing to try out any workflow that you can suggest.

    Concurrently working on the same project it requires a specific implementation in all editing programs like Avid's Unity/ ISIS shared storage. That's what you are simply not considering. none of your issues would be any problem if your projects resided on a commonly accessed server or something like that. Check respective hardware solutions.
    Mylenium

  • Work-around The Whine: why does this work? And is it BAD?

    Hello everybody, sorry to bring up The Whine again, but I was wondering if anyone can figure out why the following trick works to eliminate the noise.
    Also, could doing this regularly (all the time, basically) potentially be bad for the system in any way?
    This is the work-around I've been using:
    1. Open Photobooth, then Force Quit that application (you must Force Quit rather than simply quit)
    2. Put the Macbook to sleep, waiting a few seconds until the indicator light starts pulsing.
    3. Wake up the computer.
    Voila. That always does the trick, eliminating the whine until either the next time I boot up or the next time I open and quit Photobooth in the normal way.
    I suppose force quitting may keep the processor slightly busy somehow?
    Don't know...

    John P.,
    You say that all the notebooks that you know of make
    some kind of noise. How many notebooks is that? Not
    trying to be a jerk or anything but it better be like
    dozens and dozens to make this claim. I have heard
    the exact opposite of this claim from users that have
    owned a few notebooks as well.
    Hi Jerome,
    No problem... I'll clarify..
    5 notebooks personally, so when I say "all notebooks that I know of", it's a true claim because that is exactly what I'm saying.
    If this noise is caused by capacitor that is at some
    miniature threshold then why does the noise go away
    when said remedies are employed? Does the capacitor
    get bigger? Doesn't make sense but I appreiate that
    you want to reassure original poster.
    Actually I may have misspoken--it may be called a "voltage regulator" and it sits directly West of the CPU and controller chip. They do make noise and from what I have been told and remember, they can dampen it w/ a capacitor but that's about it. It's just the nature of the beast for that type of component, I'm told.
    What "I" think it may be is the power fluctuations, or lack thereof, in the Intel chip causing it--when you put a load on it, there's a power fluctuation because your CPU usage is going up/down a little bit, but when you're not doing anything it's very little it causes it to make a little noise. No big deal, but just as long as it's not blaring in your ear when you're trying to use your computer. My ZV6000 does the same thing, but it doesn't matter when you've got a load or not--seems to do it more when I have Cool 'n' Quiet enabled.
    This is not right. I am sorry.
    If this noise is normal then I'll take no MacBook.
    You know it is being fixed apparently on the MacBook
    Pros by motherboard replacement.
    I never said anything about pro. I don't own one, nor have I used one. I can't say how profound in comparison to the Macbook (non pro) it is.
    I'm sure if Apple thought it was a big enough problem, they would act either more quickly about it, but it's not stopping me from checking my e-mail or going on the Web.

  • TS1317 I have just purchased my Apple on plugging in my wireless internet usb it says I need a Java runtime, how do I know what Java runtime and where do I download it from?

    Can anyone tell me what 'Java runtime' is required to get my Blink usb internet connection working and where I can download it from?

    Holly cow, I don't see where it supports anything but Windows®!?
    http://www.blinkit.net.au/Support
    Also, pretty dangerous of them to require Java to use this.
    Anyway, open Applications>Utilities>Java Preferences, that'll tell you the Versions you have... might need to check "Enable applet Pug-in and Web Start Applications", not sure.

  • How to Get Around the Memo Size Limitations in CR ?

    I am Using Crystal Reports 2008, SQL Database and ASP .Net Visual Studio 2010 for Team Foundation with Crystal Viewer embedded in a web page.  All current update and patches area installed.
    Database has Memo Fields up to 164000 characters in length. Viewer show fine, but with the reports that have been designed to print this information, only seeing part of the Memo field.
    This happens with both RTF, Text and HTML formatted data from within the database field.
    I have read that there is a limitation on the size of a Memo field that Crystal Reports will print (65,534).
    I actually received an Crystal Reports error box when i try to concatenate multiple substring fields as a formula.
    Does anyone have any suggestions or ideas on a work-around ? 
    Due to legal considerations, this data has to be output as it was input, so it can't be hacked. It can be parsed and again merged  but I really donu2019t want to try and write SQL procedures to parse HTML code into readable multiple pieces based on variable length tags with large memo fields.
    Please offer any and every suggestion,
    Thanks to all  ! !
    Edited by: Ludek Uher on Oct 21, 2010 1:31 PM

    yes sir,
    already did but i didn't receive any answers. . .   Memo Field Size Limitations with Crystal Reports 2008 ?
    Thanks for your help.

  • How To Work Around Set Up Issue With Time Machine?

    When I attempt to set up an external drive for Time Machine I get this: You do not have appropriate access privileges to save file “.001b63b53d7a” in folder “Time Machine Backups”. I have searched for this file and cannot find it. I have deleted any and all Time Machine Backup files.

    I worked through the first four on the work around and this is what the terminal screen looks like:
    Last login: Sun Jan 11 20:59:31 on ttys000
    Macintosh:~ Brokenarrow$ cd /Volumes
    Macintosh:Volumes Brokenarrow$ ls -al
    total 12
    drwxrwxrwt@ 5 root admin 170 Jan 11 20:01 .
    drwxrwxr-t 40 root admin 1428 Dec 28 15:42 ..
    lrwxr-xr-x 1 root admin 1 Jan 10 06:29 Macintosh HD -> /
    drwxrwxr-x 15 Brokenarrow Brokenarrow 1020 Jan 11 19:56 Time Machine Backups
    drwx------ 1 Brokenarrow Brokenarrow 2048 Jan 11 20:10 mikesmail
    Macintosh:Volumes Brokenarrow$
    I tried to determine which was the back up volume name (tried Time Machine, Time Machine Backups) but no luck. Any suggestions? Thanks for your patience.

Maybe you are looking for

  • Duplicated folders in Mail from iCloud account

    Hi, I have a little problem with Mail in Mac OS X Mountain Lion and iCloud. I use the last release, with all upgrades done. When I use Mail, sometimes (and always when I use the Sync function in Mail) I get duplicated folders from iCloud. A little pi

  • Display the foreign keys and primary keys in hirarchy qeury  please ?

    Any sql query to get the following columns: I should display all the master table names,it's primary key field and its foregin key field,the name of the foreignkey'table. This should be displayed in hirarchy i.e. it should start from the top level ta

  • Iphone syncing in PSE 7

    Hi there - this is my first post so forgive me if I have put this in the wrong place ... I have just invested in an iphone 3GS, and have been using PSE for a while, and am now on PSE 7.0.  I would like to sync my PSE albums to my iphone.  I can selec

  • Document level Data and Item level data

    Hi, Can anyone please explain the difference between Document level data and Item level data for sales order. Thanks shalini

  • Agent Error? IOException in sending Request :: Connection refused: connect

    For the past couple of days, I have been running into the "IOException in sending Request :: Connection refused: connect" error. I am running 10.2.01 on Windows 2003R2. Along with this error, the DB Control shows agent unreachable. Is there anything