Wierd XPath behaviour

I have elements with subelements and I'm trying to select elements using values of attributes of element and its sub-elements:
//*[@t=1 and ./a[@a1=44 and @a2=2]]
the result depends on order of conditions in the query
physically in document a1 is located before a2 in sub-element, so query above works fine, but this one will return nothing:
//*[@t=1 and ./a[@a2=2 and @a1=44]]
modifying query to one below fixes the issue
//*[@t=1 and ./a[@a2=2] and ./a[@a1=44]]

I don't have that exact code anymore as I took different approach... I'll reproduce it when I'll have a time.
here though another one
this function works fine:
declare function pg:myf2 ( $type as xs:string, $attrRef as xs:string, $attrType as xs:string )
for $i in pg:myf1 ( $type )
return if ( $attrType = '00000000000000000000000000000000' )
then if ( $attrRef = '00000000000000000000000000000000' )
then $i
else $i[./pg:*[@pg:ref=$attrRef]]
else if ( $attrRef = '00000000000000000000000000000000' )
then $i[./pg:a[@pg:at=$attrType] or ./pg:r[@pg:rt=$attrType]]
else $i[./pg:*[@pg:ref=$attrRef] and (./pg:a[@pg:at=$attrType] or ./pg:r[@pg:rt=$attrType])]
but if call it this way:
pg:myf2 ( '00000000020000000000000000000002', '00000000000000000000000000000000', '00000000000000000000000000000000' )[./pg:r[@pg:rt='00000000020000000000000000000300']]
parser fails with error:
(6, 'Error: Variable :attrType does not exist [err:XPST0008], <query>:189:67')
_dbxml.XmlQueryParserError
in source XML element pg:a has attribute pg:at, element pg:r has attribute pg:rt and both these elements have attribute pg:ref
here is example of XML:
<pg:i xmlns:pg="http://www.my.com" pg:tmc="2007-01-12T09:23:24" pg:id="8c5f9359d619341682cfe8e55a95dd0a" pg:tmm="2007-01-12T09:23:28" pg:ns="00000000000000000000000002000000" pg:type="00000000020000000000000000000002" pg:name="AA"><pg:r pg:rt="00000000020000000000000000000302" pg:ref="0f0b40d357d530a0927e10a220e553fc"/><pg:r pg:rt="00000000020000000000000000000300" pg:ref="234b98f24b2b329a854421bb5be7c92f"/><pg:r pg:rt="00000000020000000000000000000300" pg:ref="cea98a9d452d3b18901b75a3471216ce"/><pg:r pg:rt="00000000020000000000000000000300" pg:ref="92d97554da1a399883070c6df48f60af"/><pg:r pg:rt="00000000020000000000000000000300" pg:ref="0c85945cff0e3ed3a7577c98609aee64"/><pg:r pg:rt="00000000020000000000000000000300" pg:ref="f64141277e0831929c25890f11670acc"/><pg:r pg:rt="00000000020000000000000000000300" pg:ref="65b257dd4f8b3375bac2556349802eb6"/><pg:r pg:rt="00000000020000000000000000000301" pg:ref="e8ab9588d583351e98bc64d9690fceb3"/><pg:r pg:rt="00000000020000000000000000000301" pg:ref="c766578c99ca30f78323a7988094650b"/><pg:a pg:ref="00000000000000000000000000001501" pg:at="00000000020000000000000000000108"/><pg:a pg:ref="51627c14890f334a86839a5fb8f1813b" pg:at="00000000020000000000000000000202"/><pg:a pg:ref="03e46098200a3aea8f3b10e86454c7da" pg:at="00000000020000000000000000000101"/><pg:a pg:ref="00000000020000000000000000010002" pg:at="00000000020000000000000000000201"/><pg:a pg:at="00000000020000000000000000000107">1548</pg:a><pg:a pg:ref="00000000020000000000000000010001" pg:at="00000000020000000000000000000109"/><pg:a pg:ref="00000000000000000000000000001502" pg:at="00000000020000000000000000000104"/><pg:a pg:ref="00000000000000000000000000001502" pg:at="00000000020000000000000000000103"/><pg:a pg:ref="ae4952666b163987bd97ad6f9a6aec82" pg:at="00000000020000000000000000000105"/><pg:a pg:ref="025f5aa2dd5f3ce7b02cea5393d326d0" pg:at="00000000020000000000000000000102"/><pg:a pg:ref="8681baa575083759b7b6d08e891a80c2" pg:at="00000000020000000000000000000200"/></pg:i>

Similar Messages

  • Wierd painting behaviour with menus and cardlayout

    I am using a menu to select a panel in a card layout. What happens is that objects on the panels in the card layout do not get drawn in the right place. For example clicking on an item in a table highlights the item but the highlighted item gets drawn outside of the table area (up and left by a few pixels). Similarly a combo box on one of the panels is drawn out of place by a few pixels when another window on the display comes to the top.
    Has anyone experienced this before?
    public class MyProgram extends JFrame {
    * Entry point - create an application window
    public static void main(String args[]){
         JFrame frame = new JFrame("MyProgram");
         ContentFrame a = new ContentFrame(frame,args);
         JMenuBar mainBar = a.getMainMenu();
         frame.getContentPane().setLayout(new FlowLayout());
         frame.setJMenuBar(mainBar);
         frame.getContentPane().add(a);
         frame.setDefaultCloseOperation(3);
         frame.pack();
         frame.setVisible(true);
    ContentFrame extends JPanel {
    ContentFrame () {
    JScrollPane sp = new JScrollPane(new CardFrame());
    setLayout BorderLayout()
    add(sp, CENTER}
    CardFrame extends JPanel {
    CardFrame() {
    JPanel cards = new Jpanel();
    setLayout(new BorderLayout());
    cards = new HJPanel();
    cards.setLayout(new CardLayout());
    addSomeJPanelsToCards();
    add(cards,BorderLayout.CENTER);

    1. Some of your code is missing
    2. It's not a good idea to extend every class unless you need to add some functionality which doesn't exist in the class you are extending. You aren't doing that. Here's a better way to code it.import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test extends JFrame {
        String[] cardNames = {"Card One", "Card Two", "Another Card",
                   "Yet Another", "Final Card"};
        CardLayout clo = new CardLayout();  // accessed from inner class
        JPanel cardPanel = new JPanel(clo);
        public Test() {
         super("MyProgram");
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         Container content = getContentPane();
         content.add(cardPanel, BorderLayout.CENTER);
         JMenuBar jmb = new JMenuBar();
         setJMenuBar(jmb);
         JMenu jm = new JMenu("Pick Card");
         jmb.add(jm);
         for (int i=0; i<cardNames.length; i++) {
             JPanel card = new JPanel();
             final String cardName = cardNames;
         card.add(new JLabel("Card Label("+cardName+")"));
         cardPanel.add(cardName,card);
         JMenuItem jmi = new JMenuItem(cardName);
         jm.add(jmi);
         jmi.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent ae) {
              clo.show(cardPanel,cardName);
         setSize(300,200);
         show();
    public static void main(String[] args) { new Test(); }
    }This is just a sample because I don't know what you are doing. Try running it before you tell me its not exactly what you wanted.

  • New Match account - wierd device behaviour

    Team,
    I am new to Match so still trying to get my head round it!!
    I have an initial observation that I just can't fathom.  On both my iPhone and iPad, if I look at the "Album" view, I see all my albums.  However, if I switch to the "Artists" view, many of them can't be seen.  For instance, I have a number of Beatles albums that appear in the "Albums" view but most (except for two) disappear in the "Artists" view.  This has only happened since matching. The full collection is available in both views on the iTunes PC library.
    Any ideas?
    Thanks

    Firstly, thanks for taking the time to respond.
    Keith,
    It seems that the "missing"  albums do not have an entry in the "Album Artist" field. So I think that you are close to the issue.  However, as I was checking this out, I realised that the "missing" albums were, in fact, stacked up behind the top one.  i.e. I am showing one Beatles album but the others are under the same icon.
    Michael,
    Tried this but it opened all my albums into single tracks with the associated album covers!  Interesting to see thousands of albums!
    So, just need to work out how to give the albums their own slot on the "Artists" view!
    rgds

  • NavigateToURL bug in FireFox?

    Hi all,
    I'm expreiencing a strange bug with FireFox... I have the
    following example application:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import flash.net.navigateToURL;
    private function onClick():void {
    navigateToURL(new URLRequest("abc.html"));
    ]]>
    </mx:Script>
    <mx:Button label="test" click="onClick()"/>
    </mx:Application>
    So, basically, when I click the "test" button, the browser
    should go to "abc.html".
    Now, if I run the application locally, it works perfectly as
    expected in both IE and FF. But, if I run the application off my
    webserver (Apache2), then IE still works perfectly, but FF doesn't.
    The behaviour I get in FF is as follows: when I click on the
    button, roughly half of the time it will work as expected (ie opens
    "abc.html" in a new tab), and the other half of the time FF
    displays a "FireFox prevented this site from opening a popup
    window" message.
    Now the fact that this only occurs when the application is
    served remotely is obviously due to FF's security model. But the
    weird part (bug?) is that the "blocking" occurs randomly. If I just
    click the "test" button a dozen times (slow or fast) the result
    will be around half a dozen new windows, with the other half a
    dozen blocked :(
    So, has anyone experienced this problem before? Can you spot
    anything wrong with the code in my example above? I've tried the
    example on another PC, and it has exactly the same problem - both
    PC's are running FireFox 1.5.
    Any thoughts would be really appreciated.
    Paul.

    Hi leotemp, thanks for you reply. I've had a play with the
    IFrame approach in the past, and it introduces some other problems
    for the type of app I'm writing (can't really say what that app is
    yet).
    I've done some more playing with the problem, and how's this
    for wierd mis-behaviour? ... I wrote an openNewWindow() JavaScript
    function and placed it into the HTML wrapper that loads the swf
    file. Then, if I call that function using navigateToURL, the same
    problem occurs. But if I call that function using
    ExternalInterface.call("openNewWindow","abc.html") then it *almost*
    works... you see, the ExternalInterface version works well if the
    call is made from a click handler (like the example above), but
    unfortunately, I need it to work in the result handler of a SOAP
    service call... and there, it is blocked again! Though this time
    the blocking is a lot more consistant... ie it blocks about 9 out
    of 10 tries :(
    I'm assuming that the problem is due to FF trying to
    differentiate between popups that are the direct result of user
    clicks, versus popups that result from automatic scripts - blocking
    the latter, but not the former.
    Any other ideas?!
    Paul.

  • Complete Component Confusion

    Hi, I'm coding in AS2, writing a component (external SWC) in
    external .as files extending from MovieClip (no, not from UIObject
    or UIComponent)
    My component works as expected when I run the FLA that I am
    using to design it. When I compile the SWC it behaves as expected
    in the design-time in the FLA into which I import it. However, when
    I run the second FLA it does not work. The component loads in a
    certain number of other elements at run-time and positions them
    around the screen. The computer reports that this is going ahead in
    the third scenario, but no objects appear. I have put a trace at
    the top of every function. In all three scenarios exactly the same
    functions are called in exactly the same order.
    Needless to say, I am beginning to wish I'd never started
    it... I have spent more time trying to solve this problem than I
    did writing the component in the first place (no
    exaggeration).

    ARGH.
    I think I've found the problem, which is of course what
    happens when you post a thread... but the solution is so
    unsatisfactory that I would still require someone's assistance.
    If I copy the objects that I am attaching into the component
    into the library of the second FLA then the component works. But
    this is absurd; the movieclips that I am trying to attach using
    attachMovie must already be compiled into the component SWC in
    order for live-preview to work. If I have to duplicate these
    movieclips into the second FLA, then the compiled SWF will
    duplicate a host of movieclips unnecessarily? Is there anyway of
    fooling attachMovie to look into the SWC root rather than the SWF
    root? I really don't want to muck around with a duplicateMovieClip
    workaround, though this currently looks like the only viable
    solution.
    Eh bien, another triumph of wierd Flash behaviour.

  • Wierd Behaviour of IF then ELSE standard function

    Hi All,
    I am facing a very wierd behaviour of the IF then ELSE function in a mapping.
    Condition to be checked:   if GDS_id = 1, then (condition 1 -  RFC lookup ) ElSE (condition 2 - JDBC Lookup followed by an RFC  lookup).
    Issue:  The input payload is 0-unbounded with a possibility of a different GDS_id values.
    Case 1 :
    As shown below, in case the input payload has 3 repitions of the RECORD, with the Fit set having GDS_ID = 01, the mapping runs perfectly fine . All the If then Else branches are getting executed.
    Case 2:
    Where as iF the first GDS_ID != 01 (not 01) , thenthe target value is not getting populated properly .
    I have tried all the possibilities and combinations but i am unable to resolve this. Please help.
    Attached the screen shot of the message mapping, and sample test results of both the use cases.
    For instance, below is a sample payload:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:mt_EMERGO_common xmlns:ns0="http://sabreEMERGO_common.com">
    <Record>
          <booking_date>08012013</booking_date>
          <iata_code>2325540</iata_code>
          <gds_id>01</gds_id>
          <pos_code>RD3A</pos_code>
          <gds_code>01</gds_code>
          <net_booking>11</net_booking>
       </Record>
    <Record>
          <booking_date>08012013</booking_date>
          <iata_code>2325540</iata_code>
         <gds_id>02</gds_id>
          <pos_code>54S8 </pos_code>
          <gds_code>02</gds_code>
          <net_booking>11</net_booking>
    </Record>
      </ns0:mt_EMERGO_common>

    Hi All,
    I have changed the message mapping like below. Even though i am not getting my target filed as value. As per my requirement if GDS_ID=01  then perform the RFC lookup and pass the value to target fields KUNNR and else GDS_ID=02 then perform the JDBC LOOKUP and JDBC LOOKUP output to RFClookup .RFC LOOKUP output pass to my target field KUNNR.
    Result of my mapping is 1st record only populated KURNNR in Target side and 2nd record not showing as KUNNR filed in target side .But I have taken look on display queue in If then else out showing 2 values but it is not passing to target filed.
    Please provide any suggestion to resolve this issue.
    Please find the mapping logic:
    Please find the test screen:
    Please find the test Data:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:mt_EMERGO_common xmlns:ns0="http://sabreEMERGO_common.com">
       <Record>
          <booking_date>08012013</booking_date>
          <iata_code>2325540</iata_code>
         <gds_id>02</gds_id>
          <pos_code>54S8 </pos_code>
          <gds_code>AA</gds_code>
          <net_booking>11</net_booking>
       </Record>
       <Record>
          <booking_date>08012013</booking_date>
          <iata_code>2325540</iata_code>
          <gds_id>01</gds_id>
          <pos_code>RD3A</pos_code>
          <gds_code>AA</gds_code>
          <net_booking>11</net_booking>
       </Record>
    </ns0:mt_EMERGO_common>
    Regards,
    Ramesh

  • Wierd behaviour in 10.2.0.2

    Hi Guys,
    I have this wierd behaviour.
    I have the parameter *.sessions=885 in my spfile.
    However few days back when i do a query in my db "show parameter sessions", the output is 1105.
    can advise?
    thanks

    SESSIONS doesn't have to be explicitly set, most DBAs would only set PROCESSES and let Oracle auto-compute SESSIONS.
    Since SESSIONS is not modifiable in memory, it is likely that it was modified when the instance was running with
    ALTER SYSTEM SET SESSIONS=885 SCOPE=SPFILE;which would have updated the SPFILE but not changed the value for the instance currently running.
    Go through your alert.log to see if any ALTER SYSTEM has been issued since the database instance was started up.
    Hemant K Chitale

  • Forms 6i, Stacked & Tabbed Canvas- Wierd behaviour

    Hi,
    I am having a wierd problem:
    Scenario:
    I have a datablock of 40 columns.
    I put 1 (say col-1 on page_1 and col-21 on page_2) column each on two different TAB pages.
    I created 2 stacked canvases: page_1_stacked & page_2_stacked
    I put col-2 to col-10 on page_1_stacked
    and col-22 to col-40 on page_2_stacked
    I used the following code to show/hide the appropriate cols/stack canvases when the users changes Tab pages:
    [when-tab-page-changed
    if (:system.tab_new_page ='PAGE_1')
         then
         show_view('PAGE_1_STACKED');
         hide_view(''PAGE_2_STACKED'');
    elsif (:system.tab_new_page ='PAGE_2')
         then
         hide_view('PAGE_1_STACKED');
         show_view(''PAGE_2_STACKED'');
    end if;
    Problem:
    Everything seems to work fine, the stacked canvases show/hide as expected, but --->as soon as I put my cursor in any column on TABBED PAGE (here col-1 or col-21), all the stacked canvases vanish
    -->if as a result of above case where I put the cursor in a tabbed-page col and canvas vanished, I navigate to the next field (which is on canvas), the canvas shows up (which is normal)....but then this canvas wont get hidden with my hide view... and end up with all stacked canvases shown together or none at all
    I have played around with all the properties and am really trapped.
    Please help!
    Thanks.

    Devang, are you aware that if you put the cursor focus in a field, Forms will ignore any show_view or hide_view commands if they cause the cursor to disappear? And if your cursor focus is in a field in a stacked view, hide_view will not work. Forms will not let you hide or cover up what ever item is identified by :System.Cursor_Item.
    I do not know why you need Col_1 or col_21 on the tab canvas. Put them on your stacked canvasses, too.
    Use a when-new-item-instance block-level trigger to determine which tab page should be displayed. If :System.trigger_item = col_1 through col_20, make sure Page_1 is displayed, and for col_21 through col_40, make sure Page_2 is displayed.
    Similarly, use a when-tab-page-changed trigger to move the cursor to the correct canvas. You wouldn't even need to use show_view or hide_view, Forms will do that for you each time you move into an item on either canvas.
    And why are you using two canvases anyway? Since you are using a horizontal scrollbar, why not put them all on a single canvas? (And then you wouldn't need the tab pages.)

  • Wierd behaviour of BufferedInputStream.available.

    Hi All.
    I've something that has me stumped.
    I have the code below. It connects to a ScriptServlet, passes in some commands and expects to read back the output of the servlet. The servlet sets the content type to "text/xml" and the data is source from a DB2 database.
                codeBase = new URL("http://localhost:9080/dial/softphone/");
                URL url = new URL(codeBase, "../ScriptServlet?cmd=" + command);
                URLConnection urlConnection = url.openConnection();
                InputStream in = urlConnection.getInputStream();
                BufferedInputStream bis = new BufferedInputStream(in, 32768);
                int available1 = bis.available();
                int available2 = bis.available();
                int available3 = bis.available();
                int available4 = bis.available();
                AgentApplet.println("Bytes Available 1: " + available1);
                AgentApplet.println("Bytes Available 2: " + available2);
                AgentApplet.println("Bytes Available 3: " + available3);
                AgentApplet.println("Bytes Available 4: " + available4);Most of the time, everything works. I see the correct number of bytes output by the servlet, and I see the expected output of:
    AgentApplet [    31] :: Bytes Available 1: 7524
    AgentApplet [    32] :: Bytes Available 2: 7524
    AgentApplet [    33] :: Bytes Available 3: 7524
    AgentApplet [    34] :: Bytes Available 4: 7524I read the 7524 bytes and I'm all happy.
    However, sometimes something really silly happens, and this is the output that I do not understand:
    AgentApplet [    41] :: Bytes Available 1: 9936
    AgentApplet [    42] :: Bytes Available 2: 18121
    AgentApplet [    43] :: Bytes Available 3: 19209
    AgentApplet [    44] :: Bytes Available 4: 0The 19209 is the correct figure, as output by the servlet.
    There are no reads occurring in between the successive calls to avail().
    So what is going on?
    I'm stumped!
    Help!
    -Chris

    With TCP you can rely on it, that was the wholepoint
    of it. If it was UDP, then yes, I'd totally agree
    with you.Other way around. With UDP you can rely on datagrams
    being sent and received the same way, with message
    boundaries preserved. TCP is a byte-stream protocol
    without message boundaries and you cannot rely on any
    particular received-size behaviour.Ok, now I get you. You were talking "receive-size". I agree. I was talking "received at all".
    What I don't get, is why/how the bytes available
    suddenly drops to zero. Where do they go?
    You must have read the buffer before the zero
    reading. I can't think of any other explanation.Nope. And that is what has me stumped.
    This is the complete routine:
        private String sendCommand(String command)
            try
                codeBase = new URL("http://localhost:9080/dial/softphone/");
                AgentApplet.println("codeBase = " + codeBase);
                URL url = new URL(codeBase, "../ScriptServlet?cmd=" + command);
                URLConnection urlConnection = url.openConnection();
                InputStream in = urlConnection.getInputStream();
                BufferedInputStream bis = new BufferedInputStream(in, 32768);
                int available1 = bis.available();
                int available2 = bis.available();
                int available3 = bis.available();
                int available4 = bis.available();
                AgentApplet.println("Bytes Available 1: " + available1);
                AgentApplet.println("Bytes Available 2: " + available2);
                AgentApplet.println("Bytes Available 3: " + available3);
                AgentApplet.println("Bytes Available 4: " + available4);
                byte data[] = new byte[bis.available()];
                int read = bis.read(data);
                AgentApplet.println("Bytes Read: " + read);
                if (read == 0)
                    read = bis.read(data);
                    AgentApplet.println("Bytes Read (1): " + read);
                bis.close();
                in.close();
                String str = new String(data);
                return str;
            catch (MalformedURLException me)
                AgentApplet.println("MalformedURLException: " + me);
                return null;
            catch (IOException ioe)
                AgentApplet.println("IOException: " + ioe);
                return null;
        }

  • Wierd behaviour

    Recently bought a copy of fireworks, like it so far except
    for a very annoying behaviour when working with library buttons.
    If I set the size of the button to be say 100x100... and then
    resize it to 60x60....
    How come when I drag the button onto the main screen it still
    thinks that the size of the button is 100x100 but the shape of the
    button is 60x60
    is this a bug? or am I resizing it improperly...

    Jo.CMP wrote:
    > Hi Linda,
    >
    > Thanks for replying.
    > Let me just clarify what I've been doing. I have been
    editing it in the button
    > editor (double clicking on library of buttons)
    Not the library of buttons. Once you have imported a button
    from the
    library, double click on it to open the button editor.
    Linda Rathgeber [PVII] *Adobe Community Expert-Fireworks*
    http://www.projectseven.com
    Fireworks Newsgroup:
    news://forums.projectseven.com/fireworks/
    CSS Newsgroup: news://forums.projectseven.com/css/
    http://www.adobe.com/communities/experts/

  • Creative T4 wierd behaviour, help wanted from another owner please

    Hi there
    Got a set of these a month ago. If you alter the volume with the remote, the unit then responds to any other IR remote when you press and hold a key down. Eventually got the unit replaced under warranty to find the new unit does the exact same thing. I am looking for a helpful T4 owner to try to replicate this please.
    If anyone could please do the following and report back, it would help a lot....
    Set the T4 to digital input
    Reduce the volume to zero using the creative remote
    Increase the volume slightly using the creative remote
    Point a different remote at the unit and press and hold a key
    On mine the volume increases and the orange light flashes indicating it is receiving a signal.
    This behaviour can be cancelled by pressing a key other than volume on the creative remote.
    My thinking is that the chances of 2 units having the same fault is quite small and am wondering if this is a design fault.
    Many thanks in advance to anyone who can help.

    I thought I would post my thoughts on Creative as a company. I purchased their flagship speaker system back in February and the system has a fault with the remote volume control. Communication with Creative CS is slow and laborious but eventually they offer a firmware update that renders the speakers inoperable. I am requested to send the speakers back which are replaced with a set that has the exact same problem. I have been waiting ever since for a reply from the so called technical people.
    My thoughts are 2 sets with the exact same problem is far more than coincidence. It is not my environment that is to blame as I have tested the speakers in different buildings (work and home), same problem. I have tried to communicate this to Creative but at every point, I am just told to be patient. I have had the speakers too long now to return and as yet, no one can or wants to answer my question.
    My point is be very careful buying Creative products, especially the T4 speaker system. If you need help, I'm sorry to say, the assistance is very poor.
    I feel sorry for the poor bloke within Creative who is acting as the go between on this one. He seems a nice chap but I think he is experiencing the same thing as I am, in that no one seems to care about the customer.
    I had expected much better from Creative and their flagship product.

  • ServletInputStream - wierd behaviour

    I have following code inside servlet. Response times are not consistent at all. I don't see any problems in the code except that it might be something inside ServletInputStream that's slow. Below is the code and the result. Results below are so wierd sometimes it takes longer to read for smaller file size as compared to the file that has larger size. There are plenty of available threads and resources, memory etc. on box
    Please help!
        public byte[] getBytes(HttpServletRequest req) {
            InputStream inp = null;
            ByteArrayOutputStream ostr = null;
            byte[] data = null;
            try {
                long l = System.currentTimeMillis();
                ostr = new ByteArrayOutputStream();
                inp = req.getInputStream();
                logger.info("Took 1 " + (System.currentTimeMillis() - l));
                int c = 0, cnt = 0;
                byte[] b = new byte[1024 * 4];
                while (-1 != (c = inp.read(b))) {
                    ostr.write(b, 0, c);
                    cnt += c;
                logger.info("Took 2 " + (System.currentTimeMillis() - l));
                data = ostr.toByteArray();
                logger.info("Took 3 " + (System.currentTimeMillis() - l) + " for length " + cnt);
            } catch (Exception e) {
                logger.error("Couldn't read Input Stream ", e);
            } finally {
                try {
                    if (null != inp) {
                        inp.close();
                    if (null != ostr) {
                        ostr.close();
                } catch (Exception e) {
                    e.printStackTrace();
            return data;
        }Results:
    09-02-25 11:33:06,123 INFO [:http-8080-12] - Took 2 33719
    2009-02-25 11:33:06,123 INFO [:http-8080-12] - Took 3 33719 for length 234934
    2009-02-25 11:33:06,162 INFO [:http-8080-7] - Took 1 0
    2009-02-25 11:33:06,168 INFO [:http-8080-7] - Took 2 6
    2009-02-25 11:33:06,168 INFO [:http-8080-7] - Took 3 6 for length 228412
    2009-02-25 11:33:06,183 INFO [:http-8080-11] - Took 1 0
    2009-02-25 11:33:06,188 INFO [:http-8080-11] - Took 2 6
    2009-02-25 11:33:06,188 INFO [:http-8080-11] - Took 3 6 for length 228370
    2009-02-25 11:33:06,640 INFO [:http-8080-11] - Took 1 0
    2009-02-25 11:33:06,643 INFO [:http-8080-11] - Took 2 3
    2009-02-25 11:33:06,643 INFO [:http-8080-11] - Took 3 3 for length 111169
    2009-02-25 11:33:06,682 INFO [:http-8080-7] - Took 1 0
    2009-02-25 11:33:06,685 INFO [:http-8080-7] - Took 2 3
    2009-02-25 11:33:06,685 INFO [:http-8080-7] - Took 3 3 for length 111232
    2009-02-25 11:33:06,749 INFO [:http-8080-4] - Took 2 1177
    2009-02-25 11:33:06,750 INFO [:http-8080-4] - Took 3 1178 for length 239050
    2009-02-25 11:33:06,779 INFO [:http-8080-1] - Took 2 2233
    2009-02-25 11:33:06,779 INFO [:http-8080-1] - Took 3 2233 for length 111104
    2009-02-25 11:33:08,232 INFO [:http-8080-10] - Took 2 4628
    2009-02-25 11:33:08,232 INFO [:http-8080-10] - Took 3 4628 for length 225770
    2009-02-25 11:33:08,419 INFO [:http-8080-9] - Took 2 4811
    2009-02-25 11:33:08,420 INFO [:http-8080-9] - Took 3 4812 for length 232581
    2009-02-25 11:33:08,451 INFO [:http-8080-8] - Took 2 4633
    2009-02-25 11:33:08,451 INFO [:http-8080-8] - Took 3 4633 for length 225509
    2009-02-25 11:33:09,123 INFO [:http-8080-5] - Took 2 4631
    2009-02-25 11:33:09,123 INFO [:http-8080-5] - Took 3 4631 for length 228427
    2009-02-25 11:33:10,169 INFO [:http-8080-3] - Took 2 15257
    2009-02-25 11:33:10,170 INFO [:http-8080-3] - Took 3 15258 for length 239099
    2009-02-25 11:33:14,248 INFO [:http-8080-6] - Took 2 20500
    2009-02-25 11:33:14,248 INFO [:http-8080-6] - Took 3 20500 for length 146626
    2009-02-25 11:33:02,889 INFO [:http-8080-7] - Took 3 2282 for length 111165
    2009-02-25 11:33:03,107 INFO [:http-8080-9] - Took 2 2231
    2009-02-25 11:33:03,107 INFO [:http-8080-9] - Took 3 2231 for length 111257
    2009-02-25 11:33:03,192 INFO [:http-8080-10] - Took 1 0
    2009-02-25 11:33:03,194 INFO [:http-8080-10] - Took 2 2
    2009-02-25 11:33:03,195 INFO [:http-8080-10] - Took 3 3 for length 111079
    2009-02-25 11:33:03,202 INFO [:http-8080-7] - Took 1 0
    2009-02-25 11:33:03,205 INFO [:http-8080-7] - Took 2 3
    2009-02-25 11:33:03,205 INFO [:http-8080-7] - Took 3 3 for length 111196
    2009-02-25 11:33:03,211 INFO [:http-8080-8] - Took 1 0
    2009-02-25 11:33:03,224 INFO [:http-8080-8] - Took 2 13
    2009-02-25 11:33:03,225 INFO [:http-8080-8] - Took 3 14 for length 234934
    -----

    session is not getting replicated. I noticed that the class name of          HttpSession
              > is weblogic.servlet.internal.session.MemorySessionData on solaris servers
              and
              > its weblogic.servlet.internal.session.ReplicatedSessionData on windows
              clustered
              > servers. So the fail over doesn't really work correctly
              It sounds like you need to double/triple check the configuration of the
              servers in the cluster. The servers apparently don't know to use the
              clustered sessions, and that is a configuration item, not part of the app.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com/coherence.jsp
              Tangosol Coherence: Clustered Replicated Cache for Weblogic
              "Praveen Peddi" <[email protected]> wrote in message
              news:3f09e877$[email protected]..
              >
              

  • Custom Table wierd behaviour

    Hi All,
    I have a custom table. when i view this custom table in SE11, it looks somewhat different than what i see in SE16n. When I see in SE16n, it shows one field to be non-primary, although it shows it that field primary when viewed in SE11.
    That particular field is also non-primary when viewed in SM30.
    Please help me understand why this is happening.
    Thanks
    Rohit

    Hi Rohit,
    Did you activated the Custom Table multiple times. You can have a check at the following SE11-> Table name and then Display -> Utilities-> Runtime Object -> Check .
    It will give you the status of the generate object and will let you know if there is any problem with the table. You can once again make a small change in the table ( Change description) and then can again activate it.
    Hope this will help.
    Thanks,
    Samantak.

  • Strange behaviour using XPath functions

    Hi guis,
    I have next simple code:
    DECLARE
    v_xmltype XMLTYPE;
    l_xml LONG := '<?xml version="1.0" encoding="UTF-8"?>
    <document xmlns="http://www.sepbulgaria.com/services/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.sepbulgaria.com/services/ myschema.xsd ">
    <person>
    <name>Joe</name>
    </person>
    <person>
    <name>Smith</name>
    </person>
    <person>
    <name>Peter</name>
    </person>
    </document>';
    BEGIN
    v_xmltype := xmltype(l_xml);
    FOR rec IN (SELECT t.COLUMN_VALUE.extract('/person/name/text()').getStringVal() name
    FROM TABLE(xmlsequence(v_xmltype.extract('document/person'))) t) LOOP
    dbms_output.put_line('name = ' || rec.name);
    END LOOP;
    END;
    The purpose is to iterate over person elements and to read the value of name element for each. But this does not iterate in this variant. When I remove the attribute xmlns="http://www.sepbulgaria.com/services/" from the document element, it works.
    I wonder what I'm doing wrong!
    Thank you in advance!
    G.Cholakov

    Don't forget namespaces.
    SQL> DECLARE
      2  v_xmltype XMLTYPE;
      3  l_xml LONG := '<?xml version="1.0" encoding="UTF-8"?>
      4  <document xmlns="http://www.sepbulgaria.com/services/"
      5  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      6  xsi:schemaLocation="http://www.sepbulgaria.com/services/ myschema.xsd ">
      7  <person>
      8  <name>Joe</name>
      9  </person>
    10  <person>
    11  <name>Smith</name>
    12  </person>
    13  <person>
    14  <name>Peter</name>
    15  </person>
    16  </document>';
    17  BEGIN
    18  v_xmltype := xmltype(l_xml);
    19
    20  FOR rec IN (SELECT t.COLUMN_VALUE.extract('/person/name/text()','xmlns="http://www.sepbulgaria.com/services/"').getStringVal() name
    21  FROM TABLE(xmlsequence(v_xmltype.extract('document/person','xmlns="http://www.sepbulgaria.com/services/"'))) t) LOOP
    22  dbms_output.put_line('name = ' || rec.name);
    23  END LOOP;
    24
    25  END;
    26  /
    name = Joe
    name = Smith
    name = PeterBTW, why are you doing in plsql what can easily be accomplished in sql?
    Best regards
    Maxim

  • Wierd behaviour in Sample Edit

    In Logic Pro 8 in the sample edit window logic start cycling from the begining of the region with cycle off. and the only way to get it to stop is to close the window. And then when you open it up it starts cycling again. And btw whats up with no key command to play what you've highlighted in the sample edit window?

    Well it turned out my preferences got corrupted, but still whats up with no play selection command in the sample edit window. And who thought it was a good idea to remove the output selector from the edit window and make a prelisten object in the environment?

Maybe you are looking for

  • IPod visible in iTunes but not Windows explorer

    Hi there, I recently upgraded from windows 7 to Windows 8.1 and since then, my iPod touch and Windows do not seem to be getting along very well. Below is a screen shot of my device manager showing that very sad little yellow triangle next to my iPod.

  • Reg : PGI delivery using ws_delivery_update

    Hi All, I want to PGI delivery using function module ws_delivery_update . What are the mandatory fields to be supplied and in what way to PGI delivery successfully using the above FM Or is there any other function module specifically suited to PGI de

  • Delivery as net yet been put away/picked completly

    Dear All. i have problem when VL01N..delivery of the goods...E VL 609 error log i am getting the error as mentioned in subject..what i need to if i am getting this error... Praveen

  • Help - Aperture won't open

    Help - Aperture won't open because graphics card does not meet minimum standard - Mac is only 4 yrs old- suggestions?

  • Help my ipad is giving trouble

    for some odd reason my ipad wont turn off the screen is blank with the circular thingy in the middle