SimpleDateFormat: weird behaviors of format() and parse()

Hi,
I wanted to convert a given date to another date with a different timezone. I wrote the code below:
SimpleDateFormat fmt = new SimpleDateFormat("MM/dd/yyyy");
fmt.setTimeZone(TimeZone.getTimeZone(tz));
givenDate.toString() // output is: 2008-05-18 09:38:06.349
Format:
fmt.format(givenDate); // output is: 05/17/2008
Parse:
fmt.parse("05/18/2008 09:38:06.349"); // output is: Sun May 18 13:00:00 GMT+06:00 2008I dont understand why would the logically reverse operation would change the output and show wrong result.
All I want to do is just change the date to a different timezone. How can I get out of this jdk date/time mess?

java.util.Date store the number of milliseconds since 1/1/1970 UTC. It is always UTC and cannot be changed. SimpleDateFormat just allows one to parse and format dates using a particular timezone.

Similar Messages

  • HELP! Sudden weird behavior in Aperture and MobileMe!

    So, I am running the latest version of Aperture and have been successfully publishing many albums to mobileme.
    I have several external hard drives connected to my computer, and almost all of my image files in aperture are referenced. Lately I have been importing the images from SD cards directly into the aperture library, editing, then relocating the masters so that i would only store the keepers (i went this route because it was unclear to me whether or not originals were also deleted if i deleted referenced files--the pop up wording seems vague to me). I usually back up the new image files on the harddrives manually, and then back up the aperture library to a vault after every major import. I also wait until I have done this to reformat my sd cards.
    Of course, this morning, something happened. We had a power outage, and although i have my entire system on UPS units, i had to shut everything down because the batteries only last so long. I did not have time to perform my usual Vault back up. I had a handful of projects with masters in the aperture library (not yet edited and masters relocated). There is one project I do not still have on sd card so that one (and inconvenience for the others) hangs in the balance.
    The situation is this: When I rebooted after our power outage (i reiterate that all hard drives as well as the main mac were shut down safely and properly on battery power), all referenced file projects appear normal, but I cannot see any images in the projects with masters stored in the aperture library. The weird part is that if i put the pointer over those projects, i do get the little balloon that tells me how many versions are in each project. It's like aperture knows they are there, but I don't see them. And another weird thing--the REJECTED images from these projects DO appear when I click on the Rejected Smart Album. And the starred images from those projects DO appear when I click on the one-star-or-better smart album. I don't get it.
    I also cannot see some of the mobileme galleries within aperture when i select them. When i went on-line to see my gallery, there is some weird behavior...some albums are acting strange, confusing images from other albums, or not accepting my username and password settings (I know they are right), or giving me a different album when I select one to look at.
    PLEASE HELP if you can. If I need to, I can always restart from my vault version of the library and reimport last week's stuff from the sd cards, but i'd rather not do that, not to mention there is that one project i will lose.
    I'm here waiting for anyone who thinks they can help!
    Thanks,
    Heather
    Message was edited by: heatherperryphoto
    Message was edited by: heatherperryphoto

    Hi Heather
    I was wondering if I was the only one with this problem. Unfortunately I don't have an answer. I'm running Aperture 2 on a MacBook, with my library on an external drive. The problem is increasing; it seems that most (but not all) recent projects are affected, but none that I created before the problem first started.

  • Decimal Format and Scientific Notation

    I am trying to print numbers in scientific notation using the Decimal Format class. What follows is a simple test program I wrote to find the bug. So far, I have not found a solution.
    import java.text.*;
    public class formatted {
    public static void main (String Arguments[]) {
    DecimalFormat form = new DecimalFormat("0.###E0");
         double numb = 123456.789;
         System.out.println("Nuber is: " +
    form.format(numb));
    The output of this program is... Nuber is: 123456E
    The output is the same if numb is an int, float, or double. If I format the number as "#####.0" or "#####.00" the output is correct. I think that I am following the rules for formatting a number in scientific notation as the process is outlined in the documentation (provided below).
    ***** From Decimal Format under Scientific Notation ***
    Numbers in scientific notation are expressed as the product of a mantissa and a power of ten, for
    example, 1234 can be expressed as 1.234 x 10^3. The mantissa is often in the range 1.0 <= x < 10.0,
    but it need not be. DecimalFormat can be instructed to format and parse scientific notation only via a
    pattern; there is currently no factory method that creates a scientific notation format. In a pattern,
    the exponent character immediately followed by one or more digit characters indicates scientific
    notation. Example: "0.###E0" formats the number 1234 as "1.234E3".
    Anyone understand how the short program is incorrectly written?
    Marc

    The problem is
    format = "0.###E0"
    input number = 123456.789
    output = 123456E (not scientific notation!)
    This is not scientific notation at all. There is no decimal point given and no value in the exponent.
    I understand entirely that by adding more #'es will provide more precision. The bug I have is the output is not printed in the scientific format; other formats work.
    MArc

  • Weird behavior x86 and 64x builds

    this is a x86 for build which is fine, all values are 0:
    in my 64x build, few zeros got an extremly weird value. This only happens in debug mode
    anybody any idea why?
    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    its when i fetch an object from mobile service client (and using offline sync)
    using the debugger shows that this weird value is also in the object
    in the database, client and server side are ALL values 0. not all values show this weird behavior
    there is almost no code from me.. small wrapper around the mobileserviceclient.
    i will try to isolate the problem in small app. any other thought how to debug this?
    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

  • Visibility weird behavior after -Syu

    Hello
    I have been using visibility with openbox on my Arch 64 system for a long time and have been very pleased with both. I just did a full system update yesterday and have been experiencing a weird behavior on visibility ever since.
    Usually when I clicked on an application on a different desktop than mine I was transported to that desktop and the application was focused.
    Since the system update , whenever I click on an application on a different desktop, that application is moved to my current desktop. Meaning that if I actually clicked on every app running on every other desktop, they would all be moved to my current desktop. Weird and impractical if you ask me.
    I am suspecting it has something to do with an upgrade on openbox ? I checked whether some new option/setting was installed on the config file but didn't notice anything.
    Anyone else experiencing the same effect ?

    Maybe one can easily change the visibility code to do it right ?
    Problem is, i have NO knowlege about how this stuff works. Plus, i dont now c++
    But i browsed through the code and found a file called 'window.cc' with this code:
    bool Window::activate(void) {
    255 Server * server = Server::instance();
    256 XEvent event;
    257 long mask = SubstructureRedirectMask | SubstructureNotifyMask;
    258
    259 event.xclient.type = ClientMessage;
    260 event.xclient.serial = 0;
    261 event.xclient.send_event = True;
    262 event.xclient.display = server->display;
    263 event.xclient.window = drawable;
    264 event.xclient.message_type = server->net_active_window_atom;
    265
    266 event.xclient.format = 32;
    267 event.xclient.data.l[0] = 2;
    268 event.xclient.data.l[1] = 0;
    269 event.xclient.data.l[2] = 0;
    270 event.xclient.data.l[3] = 0;
    271 event.xclient.data.l[4] = 0;
    272
    273 if (XSendEvent(server->display, server->root_window, False, mask, &event)) {
    274 return true;
    275 }
    276 return false;
    277 }
    and in 'server.cc' i found this:
    28 // set up atoms
    29 net_active_window_atom = XInternAtom(display, "_NET_ACTIVE_WINDOW", False);
    So what i think is, one need to change the 'Window::activate(void) ' function to first switch desktop and then activate the window.
    Maybe this is total nonsense ... i dont know
    Haench

  • Unable to open .eps file "unknown format and cannot be opened" ?

    A client sent me an .eps file (logo). I tried opening it in Illustrator AND photoshop (just to see if it was saved in one vs the other program) - however to no avail.
    Illustrator gives me a message "unknown format and cannot be opened"
    Photoshop gives me a message "photoshop was unable to parse the postscript".
    I'm using Adobe CS4, and I've never seen this message before—would love to know what this means and how to resolve?
    File attached if anyone is able to open / fix it?
    Thanks kindly,
    Chemol

    Thanks for the advice Scott - does compression improve the .eps?  Is it
    silly for me to ask them to compress it since the file is only 766 KB
    (that's how big the attachment is in my email - though I am unable to open
    it)?
    My friend is able to open it on his end - however the 3rd person (client) is
    the one who sent it, and I have already requested a different version - no
    response from them yet.  Unfortunately what the company "has" is what he
    will likely give to me again (ie: same file / unable to open).  So ... I am
    curious about how I can resolve this issue on my end - if possible?
    Do you know what the AI and Photoshop error messages mean? Could the issue
    be a mac vs PC concern? Or is it a corrupt file? Could it be a software
    version issue (old vs new) ... or Quark incompatibility?
    .... just guessing at this point....Any insight as to what different
    scenarios may apply in this situation would be greatly appreciated ..thank
    you.

  • Weird behavior in master-detail

    Dear Forum,
    I need to implement an application but I still have a halting error.
    I have this strange problem and I'll try to explain.
    I have this masterscreen with search functionality. When I do a search, I get a result. When I now enter the details screen of the second row of the search result and I change the fields on the details screen and do a commit, I get the message that the changes were made successfully, but I see the primary key jump to the value of the primary key from the details of the first row of the search results on the masterscreen.
    And when I look at the details of the first row, the changes were made in this details, and NOT in the details in which I needed to make the changes.
    And now more weird... I can only reproduce the problem in Internet Explorer and whatever I try, it works correct in Firefox.
    So the functionality should work as supposed, as it wouldn't work in Firefox.
    Has anyone encountered this problem before or does anyone has a solution or tip to get to the solution?
    Your help is much appreciated.
    Arjen

    Steven,
    When I tried to create the logs you requested, I ran up to a different problem, also affecting this behavior. When I repaired this, still the weird behavior took place in Internet Explorer. And in Firefox the problem was solved. So I tried to disable the cache in Internet Explorer. This solved the problem there as well..
    So this behavior doesn't happen anymore with the cache disabled, thus solved this problem.
    Thanks for the effort anyway.
    Arjen

  • Weird behavior in Classic or not?

    It has been a long time since I've needed to use Classic (on 10.4.something)  Today I needed to do something that could only be done in classic.  I thought I saw some weird behavior so I tried a couple of other classic apps.    All started Classic just fine, brought up their document window and menu bar.  But there was no classic desktop under the app's window and while the menu bar showed "finder" as an open application that could be switched to (the right-most menu item) but when I switched to it I got the OS X finder, not a OS 9 one.   Occasionally I can get what looks like a Finder menu bar, but that's on it are the Apple and Help and the app switcher.
    Recently I've been playing with Sheepshaver on a Snow Leopard system, which brings up an honest-to-goodness OS 9 desktop.
    Now, I am misremembering how Classic works (in effect, no desktop and no finder) or is something wrong.  I checked all three of my systems running Tiger and they have the same behavior.   (A G4 -- that will still boot into OS 9, a powerbook G4, and a mac-mini.)
    Ted Lee
    Minnetonka, MN

    OK, I found an article on rebuilding the desktop and it indicated that while there is a file for the OS9 desktop, in the classic environment it is invisible and can only be found through an alias that is created on the OS X desktop.  I suspect I've deleted that alias since I didn't have any particular need for it.   The article tells you how to re-create the alias from the terminal.  indeed there is a folder there and it is empty.  No particular use for it -- if you select Desktop from an OS 9 app you get the OS X desktop.   I can also see why there's no real OS 9 finder -- anything you could have done from it you can do from the OS X finder -- except the "Apple Menu" and that's why that's under the classic icon on the right half of an OS X menu bar.  There still is a "rebuild desktop" in the Classic prefs -- I assume that's so you get the right doc/app association in the classic environment, since I don't think OS X understands the classic creator/type info.
    So sounds very much like I'm misremembering!
    Ted Lee
    Minnetonka, MN

  • Weird behavior in opening Aperture images in Photoshop

    I have found a lot of really weird behavior when opening Aperture images in an external editor (in my case, Photoshop, so I'll use PS to refer to it):
    1) If the master image is opened in PS, a new version is created when the file is opened, not saved. So quitting PS without saving leaves you with a new version of the file, regardless of whether you actually saved any changes or not.
    2) If a version (not the master) is opened in PS, a new version is not created, either on open, or on save. So in other words, changes to that version in PS when saved overwrite that version, and the previous condition of that version is lost (with respect to versioning).
    3) If multiple versions of the same image are opened simultaneously in PS, there doesn't seem to be a way to tell the difference between them in PS, except for visually (possibly meta-data, but I haven't checked that, nor would I want to be forced to). The file names of all versions are exactly the same.
    I'm looking for feedback from anyone out there who can explain why this isn't completely quacky version control. I've been using version control almost my entire career (as a software programmer) and here's how I have seen almost invariably version control work:
    1) New versions of files are always created upon commit, i.e. saving of the file, not on opening a file. (Do not confuse this with working copies, think about what is present in the repository).
    2) Opening / editing any file version is never destructive. Any change to that file version that is saved (committed) results in a new version, not an overwrite to the same version.
    Aperture's interface basically has combined what traditional version management has represented separately, that being the client and repository views of a project. They are showing all versions of a file simultaneously. This is fine, but I'm really not liking the fact that some changes create new versions, other changes overwrite versions, and one case, merely opening the file creates a new version, whether there are any changes saved or not. In addition, when working with multiple versions in the editor, the file name and/or interface doesn't give any indication of what version you are working with. Easy to say that's the fault of the external editor, but I disagree -- all external editors are going to work with filenames, so Aperture should produce a unique namespace for any file version so that any external tool will be able to distinguish (visually) one file from another.
    Is this completely wacky version management, or is it just me?
    Brad
    Powerbook G4-1.33GHz-17" / Powermac G4-1.4GHz   Mac OS X (10.4.2)   PB: 1GB RAM, Radeon 9600-64MB / PM: 1.25GB RAM, Radeon 9000Pro-128MB

    Hi Bradley,
    Due to the way I personally use Photoshop, I want Aperture to behave as it does.
    That's because, with Photoshop, I use layers extensively. Any edits I do (levels, curves, saturation, sharpening) I do on layers. I can delete the layers at any time (or select to show or hide them). Because of this, I actually WANT Aperture to behave the way it does. Once I've done a bunch of edits in Photoshop, if I select again to edit that file in the external editor, I want to work on that specific file (to add another layer, or change one). I don't want another duplicate. I tinkered with this over the weekend, and it worked very nicely for me.
    Perhaps you work differently from within Photoshop? Do you ever use layers? If I were to have a bunch of Photoshop "versions," each with 5 layers, I'd have like 5 GB of "versions" for my original 8 MB RAW file, due to the size of PSD files. Yuck

  • Weird behavior in UCCX 7.0.1 SR05

    Hi team,
    I've got a weird behavior in a UCCX 7.01 SR05 installation.
    All incomming calls which go to an agent who is set "ready" set the agent to state "not ready" and go to queue...
    This behavior also occurs with standard script icd.aef.
    Had  anybody has same behavior in an UCCX 7 installation? Or can anybody  help me? I checked my configuration twise and couldn't find
    any issue.
    Thanks a lot,
    Tobias

    I've seen this happen before because of a CUCM configuration issue.  Check whether the CUCM Calling Search Space for the UCCX CTI ports can call the partition of the agent's extension.  My guess is that the call attempts to connect but CUCM will not allow it to go through.  UCCX then marks the agent as "Not Ready" and drops the call back in queue.

  • IDVD, the Quicktime format and 16:9

    Hi,
    I´ve got a problem with widescreen format and Mac. I´ve edited about 10 short clips with Premiere Pro CS3 on a PC, but when it came to authoring the DVD found I no software for the PC that could handle 16:9 and 5.1 well. I´ve now moved the videos to my friends Macbook Pro and try to author a DVD with iDVD6.
    I noticed that my problem was a common one; iDVD shows 16:9 material as 4:3 in preview (haven´t burned anything yet). Then I noticed that even when I play the video files on the Macbook, before even touching iDVD, they´re played in 4:3! On my PC, after being exported from Premiere Pro, they´re played as 16:9 (because they are 16:9!), but as soon as I move them to Macbook they´re played as 4:3.
    Here´s the settings I used to export the files in Premiere Pro CS3:
    File type : Microsoft DV
    Compressor : DV - PAL
    Frame Size : 720h 576 v 16:9
    Frame Rate 25,00 fps
    Pixel Aspect Ratio : D1/DV PAL Widescreen 16:9 (1.422)
    Channels : 5.1
    You see, the files are clearly 16:9 and they DO look weird when played on Macbook. I´m sure if I could figure out how to make Macbook/Quicktime player realise these are 16:9 videos, they would look correct in iDVD as well.
    Any ideas?
    Despite some problems, I really start to like the Mac.
    P.S. If I export with the same settings, but change file type to Quicktime:
    File type : Quicktime
    Compressor : DV - PAL
    Frame Size : 720h 576 v 16:9
    Frame Rate 25,00 fps
    Pixel Aspect Ratio : D1/DV PAL Widescreen 16:9 (1.422)
    Channels : 5.1
    I get a nice Quicktime file - in 4:3! What is the problem here, there´s plenty of settings showing that the export will be done in 16:9, but still the Quicktime format makes the final file a 4:3?
    Message was edited by: abrotherus

    abrotherus,
    Your files are anamorphic 16:9 (16:9 content squeezed down into the 4:3 standard definition format). The files need to have the 4:3/16:9 'flag' set correctly in the file format to be recognized as 16:9 by iDVD.
    One way to correct the files is to use Anamorphicizer which can be found at: http://homepage.mac.com/sith33/FileSharing34.html

  • Task Sequence Windows Server 2012 format and partition issue when using MDT2012

    Hi all,
    Currently I'm working on a task sequence to deploy a Windows Server 2012 image. We've integrated MDT2012 Update 1 in SCCM2012 SP1 and created a default 'Server Task Sequence'. This task sequence deploys the install.wim to a server which has multiple disks
    attached.
    We've configured multiple format and partition disk steps to create the following partition layout:
    Disk 0: 499MB BDEDrive (do not assign drive letter) + 40GB OSDisk
    Disk 1: 40GB Programs
    Disk 2: 40GB Data
    Disk 3: 25GB User
    When the task sequence is finished I've noticed the drive letters assigned to the disk are not correct. In some cases the BDEdrive gets drive letter D assigned, sometimes drive letters are assigned starting with E, thus skipping drive
    letter D. 
    The smsts.log files show an error when it's re-assigning drive letters after booting into Windows. Looks like an error in the DiskPartScript.txt.
    <![LOG[==============================[ OSDSetupHook.exe ]==============================]LOG]!><time="16:59:40.889-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776"
    file="osdsetuphook.cpp:186">
    <![LOG[Executing task sequence]LOG]!><time="16:59:40.905-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776" file="osdsetuphook.cpp:279">
    <![LOG[Loading the Task Sequencing Environment from "C:\_SMSTaskSequence\TSEnv.dat".]LOG]!><time="16:59:40.920-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776"
    file="basesetuphook.cpp:366">
    <![LOG[Environment scope successfully created: Global\{51A016B6-F0DE-4752-B97C-54E6F386A912}]LOG]!><time="16:59:40.936-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776"
    file="environmentscope.cpp:659">
    <![LOG[Environment scope successfully created: Global\{BA3A3900-CA6D-4ac1-8C28-5073AFC22B03}]LOG]!><time="16:59:40.936-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776"
    file="environmentscope.cpp:659">
    <![LOG[Debug shell is enabled]LOG]!><time="16:59:43.806-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776" file="basesetuphook.cpp:1440">
    <![LOG[Successfully enabled debug command shell support.]LOG]!><time="16:59:43.884-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776" file="debugwindow.cpp:156">
    <![LOG[Configuring local administrator account]LOG]!><time="16:59:43.884-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776" file="basesetuphook.cpp:1462">
    <![LOG[Re-assign all drive letters...]LOG]!><time="16:59:43.884-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776" file="diskutils.cpp:1941">
    <![LOG[Executing command line: "C:\WINDOWS\system32\diskpart.exe" /s "C:\WINDOWS\TEMP\DiskPartScript.txt"]LOG]!><time="16:59:43.900-120" date="05-10-2013" component="OSDSetupHook" context=""
    type="1" thread="776" file="commandline.cpp:827">
    <![LOG[Process completed with exit code 2147942487]LOG]!><time="16:59:50.249-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776" file="commandline.cpp:1123">
    <![LOG[Diskpart.exe STDOUT:
    Microsoft DiskPart version 6.1.7601
    Copyright (C) 1999-2008 Microsoft Corporation.
    On computer: SRV03
    Volume 1 is the selected volume.
    DiskPart successfully removed the drive letter or mount point.
    The volume you selected is not valid or does not exist.
    There is no volume selected.
    ]LOG]!><time="16:59:50.249-120" date="05-10-2013" component="OSDSetupHook" context="" type="3" thread="776" file="diskutils.cpp:1807">
    When I take a look at the generated diskpart_script.log file the volume D gets selected twice, which fails the second time because of the first remove drive letter command.
    This is the output in the diskpart_script.log file:
    select volume D
    remove letter=D
    select volume D
    remove letter=D
    select volume E
    remove letter=E
    select volume F
    remove letter=F
    select volume H
    remove letter=H
    select disk 0
    select partition 1
    assign
    select disk 1
    select partition 1
    assign
    select disk 2
    select partition 1
    assign
    select disk 3
    select partition 1
    assign
    It seems this error is caused by the first 'Format and Partition Disk' step before the 'Use Toolkit Package' step which is part of the default Server Task sequence. When I disable this Format and Partition step and create the partition manually
    all looks ok showing no errors in the smsts.log file.
    I've solved this by replacing the first 'Format and Partition Disk' step by an Powershell command which formats and partitions the disk. 
    Anyone seen this behavior?

    I have a similar problem when I install windows on some clients. Have you found any explanation for the behavior?

  • My macbook had a weird behavior on the display, now it won't go further than gray loading screen with the apple logo

    My macbook had a weird behavior on the display, now it won't go further than gray loading screen with the apple logo. It's a macbook pro early 2011. I've read that those are having issues, if there's someone i can contact for further information, report the issue since it's getting common or any temporal solution available. Thanks

    Reinstall Lion, Mountain Lion, or Mavericks without erasing drive
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported then click on the Repair Permissions button. When the process is completed, then quit DU and return to the main menu. Select Restart from the Apple menu.
    Reinstall Mountain Lion or Mavericks
    OS X Mavericks- Reinstall OS X
    OS X Mountain Lion- Reinstall OS X
         Note: You will need an active Internet connection. I suggest using Ethernet
                     if possible because it is three times faster than wireless.

  • TLF 2/2.1/3 Weird behavior with floating graphics?

    Hi guys,
    I'm working on a chat application running on RED5 / AS3 and I'm struggling to get my client "UI" working perfectly.
    My problem is related to the TL Framework, on every version available.
    Basicly, I want to display a picture ( for user messages ) and icons ( for notifications ) on the left side of my lines, like this :
    So, I'v been messing around with "float=start", "float=left" and such, but i'm always encountering weird behaviors whenever I scroll or resize my containerController. It's quite easy to reproduce with the following code :
    public class Main extends Sprite
              private var controller:ContainerController;
              public function Main():void
                        if (stage) init();
                        else addEventListener(Event.ADDED_TO_STAGE, init);
              private function init(e:Event = null):void
                        stage.scaleMode = StageScaleMode.NO_SCALE;
                        stage.align = StageAlign.TOP_LEFT;
                        removeEventListener(Event.ADDED_TO_STAGE, init);
                        var holder:Sprite = new Sprite();
                        addChild( holder );
                        var tFlow:TextFlow = new TextFlow();
                        for ( var i:int = 0; i < 50; i++ )
                             tFlow.addChild( createLine() );
                        controller = new ContainerController( holder, 400, stage.stageHeight  );
                        tFlow.flowComposer.addController( controller );
                        tFlow.flowComposer.updateAllControllers();
                        stage.addEventListener( Event.RESIZE, resizeController );
              private function resizeController( e:Event ):void
                        controller.setCompositionSize( 400, stage.stageHeight );
                        controller.textFlow.flowComposer.updateAllControllers();
              public function createLine( ):DivElement
                        var d:DivElement;
                        var p:ParagraphElement;
                        var im:InlineGraphicElement = new InlineGraphicElement();
                        im.source = new Bitmap( new BitmapData( 16, 16, true, 0x30FF0000 ) ); // 0x30 Alpha
                        im.float = "left";
                        d = new DivElement();
                        d.clearFloats = "both";
                        p = new ParagraphElement();
                        d.addChild( p );
                        p.addChild( im );
                        return d;
    Basicly, I'm stacking 50 transparent "floating" elements. It works fine most of time, but if I randomly resize my Flash Player Window, I can get the first "invisible" element to overlap the last "visible" :
    It seems to be happening right when the last "floating" element should disappear. Instead, it gets "over" the previous one. It happens upon container resize and scrolls. I'v encountered this issue on lastest 2, 2.1 and 3 TLF builds.
    Beside the visual "bug", it also screws up my container.getContentBounds().height calls - which can make scrolling "trembling", as the height gets reajusted.
    I'm running out of ideas about how to handle this. This bug appears whenever I use "floating" graphics and I can't think of any other way to display graphics on the left side of my chat-lines.
    Maybe someone ran into this very problem and figured out a way to make it work?
    Excuse my english, thanks in advance,
    Lionel.

    Thank you for your report. And I have found the root cause.
    In BaseCompose.as
    protected function composeFloat(elem:InlineGraphicElement, afterLine:Boolean):Boolean
    if (!floatFits && (_curParcel.fitAny || _curParcel.fitsInHeight(totalDepth, int(logicalFloatHeight))) && (!_curLine || _curLine.absoluteStart == floatPosition || afterLine))
                    floatFits = true;
    The condition of if is true, only when the weird behavior happens. We need to discuss about how to fix it.

  • URGENT Please help with weird behavior of test suite

    Hi All,
    I have a composite involving three operations of two different services. The weird behavior comes by the time on which I run the test suite on the EM, if I try to emulate two different operation response from one service, by the time that the flow, tries to emulate the second one, I always receive this error:
    part name="summary">
    <summary>oracle.fabric.common.FabricException: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Error writing stream: java.io.IOException: Can only write attribute within a tag.: WSDLException: faultCode=OTHER_ERROR: Error writing stream: java.io.IOException: Can only write attribute within a tag.</summary>
    </part>
    On the other hand if I emulate two responses of the same operation it works.
    Does any one have any idea of how to deal with this kind of test? Which seems a very simple test.
    Best regards,

    Hi thanks for your response, in detail my problem is as follows:
    1- I have a simple composite with two services and three invokes, all of the operations are two ways operations. Here´s the BPEL (Service1 Demandas, operation Actualizar; Service 2 Aviso, operations buscar, actualizar):
    <scope name="SINAUT_Aviso_SRV_Demandas_Actualizar">
    <bpelx:annotation xmlns:bpelx="http://schemas.oracle.com/bpel/extension">
    <bpelx:pattern patternName="bpelx:automated"/>
    <bpelx:analysis>
    <bpelx:property name="LastUpdateDate">9/10/10 9:35:50 AM</bpelx:property>
    <bpelx:property name="BusinessId">Scope_151babe7-bc1e-11df-3ca0-0015c5fce8ce</bpelx:property>
    </bpelx:analysis>
    </bpelx:annotation>
    <sequence>
    <bpelx:annotation xmlns:bpelx="http://schemas.oracle.com/bpel/extension">
    <bpelx:analysis>
    <bpelx:property name="BusinessId">Sequence_151babe7-bc1e-11df-3ca0-0015c5fce8ce</bpelx:property>
    <bpelx:property name="LastUpdateDate">9/10/10 9:35:50 AM</bpelx:property>
    </bpelx:analysis>
    </bpelx:annotation>
    <assign name="Assign_1">
    <copy>
    <from variable="inputVariable"
    query="/client:process/client:input/idDemada"
    part="payload"/>
    <to variable="Invoke_2_actualizar_InputVariable"
    part="payload" query="/payload/demanda/idDemanda"/>
    </copy>
    <copy>
    <from variable="inputVariable"
    query="/client:process/client:input/estadoDemanda/codigo"
    part="payload"/>
    <to variable="Invoke_2_actualizar_InputVariable"
    part="payload"
    query="/payload/demanda/estadoDemanda/codigo"/>
    </copy>
    </assign>
    <invoke name="Invoke_2"
    inputVariable="Invoke_2_actualizar_InputVariable"
    outputVariable="Invoke_2_actualizar_OutputVariable"
    partnerLink="SRV_Demandas"
    portType="ns2:SINAUT_Aviso_SRV_Demandas"
    operation="actualizar"/>
    </sequence>
    </scope>
    <scope name="SINAUT_Aviso_SRV_Avisos_Actualizar">
    <bpelx:annotation xmlns:bpelx="http://schemas.oracle.com/bpel/extension">
    <bpelx:pattern patternName="bpelx:automated"/>
    <bpelx:analysis>
    <bpelx:property name="LastUpdateDate">9/10/10 9:35:57 AM</bpelx:property>
    <bpelx:property name="BusinessId">Scope_c235386b-bc1f-11df-3ca0-0015c5fce8ce</bpelx:property>
    </bpelx:analysis>
    </bpelx:annotation>
    <sequence>
    <bpelx:annotation xmlns:bpelx="http://schemas.oracle.com/bpel/extension">
    <bpelx:analysis>
    <bpelx:property name="BusinessId">Sequence_c235386b-bc1f-11df-3ca0-0015c5fce8ce</bpelx:property>
    <bpelx:property name="LastUpdateDate">9/10/10 9:35:57 AM</bpelx:property>
    </bpelx:analysis>
    </bpelx:annotation>
    <assign name="Assign_2">
    <copy>
    <from variable="inputVariable"
    query="/client:process/client:input/ReferenciaPly"
    part="payload"/>
    <to variable="Invoke_1_actualizar_InputVariable"
    part="payload" query="/payload/aviso/referenciaPlyAviso"/>
    </copy>
    <copy>
    <from variable="inputVariable"
    query="/client:process/client:input/estadoAviso/codigo"
    part="payload"/>
    <to variable="Invoke_1_actualizar_InputVariable"
    part="payload" query="/payload/aviso/estadoAviso/codigo"/>
    </copy>
    </assign>
    <invoke name="Invoke_1"
    inputVariable="Invoke_1_buscar_InputVariable_1"
    outputVariable="Invoke_1_buscar_OutputVariable_1"
    partnerLink="SRV_Aviso"
    portType="ns1:SINAUT_Aviso_SRV_Avisos"
    operation="buscar"/>
    <assign name="Assign_4">
    <copy>
    <from expression="'12345'"/>
    <to variable="Invoke_3_actualizar_InputVariable"
    part="payload" query="/payload/aviso/referenciaPlyAviso"/>
    </copy>
    </assign>
    <invoke name="Invoke_3"
    inputVariable="Invoke_3_actualizar_InputVariable"
    outputVariable="Invoke_3_actualizar_OutputVariable_1"
    partnerLink="SRV_Aviso"
    portType="ns1:SINAUT_Aviso_SRV_Avisos"
    operation="actualizar"/>
    </sequence>
    </scope>
    2- My test suite is as follows:
    <wireActions wireSource="SINAUT_Aviso_PR_DemandasActualizar_TO_BE_/SRV_Demandas" operation="actualizar">
    <emulate duration="PT0S">
    <message>
    <part partName="payload">
    <content>
    <payload xmlns=""/>
    </content>
    </part>
    </message>
    </emulate>
    </wireActions>
    <wireActions wireSource="SINAUT_Aviso_PR_DemandasActualizar_TO_BE_/SRV_Aviso" operation="buscar">
    <emulate duration="PT0S">
    <message>
    <part partName="payload">
    <filePath>prueba_busqueda.xml</filePath>
    </part>
    </message>
    </emulate>
    </wireActions>
    <wireActions wireSource="SINAUT_Aviso_PR_DemandasActualizar_TO_BE_/SRV_Aviso" operation="actualizar">
    <emulate duration="PT0S">
    <message>
    <part partName="payload">
    <filePath>prueba_actualizar.xml</filePath>
    </part>
    </message>
    </emulate>
    </wireActions>
    3- When the test suite executes the second operation of the second service it throws this exception:
    <bpelFault><faultType>0</faultType><remoteFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>oracle.fabric.common.FabricException: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Error writing stream: java.io.IOException: Can only write attribute within a tag.: WSDLException: faultCode=OTHER_ERROR: Error writing stream: java.io.IOException: Can only write attribute within a tag.</summary></part><part name="detail"><detail>Can only write attribute within a tag.</detail></part></remoteFault></bpelFault>
    4- if I change the second operation with the first one(buscar), it doesn't throws any exception.
    5- If this is a limitation , how can I test a composite that involves n operations of the same service?
    Kind regards and thanks for all of your support

Maybe you are looking for