Error on getString

Dear All,
I am testing with MS's SQLServer.
In SQLServer database, I have a table with a column called "name" and data type is varchar(20).
Connection to SQLServer and retriving records is OK.
When I retrieve it using rs.getString("name"), receive follow error message.
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
Thanks,
Aung.

Does your code do this:
     sql = "select name, address from somewhere";
     ...execute it...
    String address = res.getString("address");
    String name     = res.getString("name");Accessing columns "out ot order" fails with certain jdbc drivers. First get "name", then "address". Or use the integer versions: getString(1), getString(2).

Similar Messages

  • Group degradation in perceived performance

    Hi there,
    We recently upgraded to SDK 4.5.1 and noticed that our application took a hit in perceived responsiveness in the process. After digging around a bit I ran into a change in the Group class that is responsible for this degradation, the change itself is in bold:
        override public function set scrollRect(value:Rectangle):void    {        // Work-around for Flash Player bug: if GraphicElements share        // the Group's Display Object and cacheAsBitmap is true, the        // scrollRect won't function correctly.         var previous:Boolean = canShareDisplayObject;        super.scrollRect = value;         if (numGraphicElements > 0 && previous != canShareDisplayObject)            invalidateDisplayObjectOrdering();          if (mouseEnabledWhereTransparent && hasMouseListeners)        {                    // Re-render our mouse event fill if necessary.            redrawRequested = true;            super.$invalidateDisplayList();        }    }
    Below please find a small application that illustrates this problem. Note that I have monkey patched Group in the default package so that it is possible to compile with and without the code above. I find that a large screen and Chrome help showcase the problem.
    The part that I am not getting is what was the code in bold trying to fix in the first place?
    Thanks!!
    ~ Miguel
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application
        minWidth="955" minHeight="600"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        xmlns:local="*">
        <fx:Script>
            <![CDATA[
                private var _moveMode:Boolean = false;
                protected function monkeypatchedgroup1_mouseMoveHandler(event:MouseEvent):void
                    // TODO Auto-generated method stub
                    if (_moveMode)
                        redBox.x = event.stageX;
                        redBox.y = event.stageY;
                protected function bordercontainer1_mouseDownHandler(event:MouseEvent):void
                    // TODO Auto-generated method stub
                    _moveMode = true;
                protected function monkeypatchedgroup1_mouseUpHandler(event:MouseEvent):void
                    // TODO Auto-generated method stub
                    _moveMode = false;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <local:MonkeyPatchedGroup
            width="100%" height="100%"
            mouseMove="monkeypatchedgroup1_mouseMoveHandler(event)"
            mouseUp="monkeypatchedgroup1_mouseUpHandler(event)">
            <s:BorderContainer id="redBox"
                width="50" height="50"
                backgroundColor="red"
                mouseDown="bordercontainer1_mouseDownHandler(event)"/>
        </local:MonkeyPatchedGroup>
    </s:Application>
    Here is the monkey patched group:
    //  ADOBE SYSTEMS INCORPORATED
    //  Copyright 2008 Adobe Systems Incorporated
    //  All Rights Reserved.
    //  NOTICE: Adobe permits you to use, modify, and distribute this file
    //  in accordance with the terms of the license agreement accompanying it.
    package
        import flash.display.BlendMode;
        import flash.display.DisplayObject;
        import flash.geom.Rectangle;
        import mx.core.FlexVersion;
        import mx.core.IFlexModule;
        import mx.core.IFontContextComponent;
        import mx.core.IUIComponent;
        import mx.core.IUITextField;
        import mx.core.IVisualElement;
        import mx.core.IVisualElementContainer;
        import mx.core.UIComponent;
        import mx.core.mx_internal;
        import mx.events.FlexEvent;
        import mx.graphics.shaderClasses.ColorBurnShader;
        import mx.graphics.shaderClasses.ColorDodgeShader;
        import mx.graphics.shaderClasses.ColorShader;
        import mx.graphics.shaderClasses.ExclusionShader;
        import mx.graphics.shaderClasses.HueShader;
        import mx.graphics.shaderClasses.LuminosityShader;
        import mx.graphics.shaderClasses.SaturationShader;
        import mx.graphics.shaderClasses.SoftLightShader;
        import mx.styles.IAdvancedStyleClient;
        import mx.styles.ISimpleStyleClient;
        import mx.styles.IStyleClient;
        import mx.styles.StyleProtoChain;
        import spark.components.ResizeMode;
        import spark.components.supportClasses.GroupBase;
        import spark.core.DisplayObjectSharingMode;
        import spark.core.IGraphicElement;
        import spark.core.IGraphicElementContainer;
        import spark.core.ISharedDisplayObject;
        import spark.events.ElementExistenceEvent;
        use namespace mx_internal;
        //  Events
         *  Dispatched when a visual element is added to the content holder.
         *  <code>event.element</code> is the visual element that was added.
         *  @eventType spark.events.ElementExistenceEvent.ELEMENT_ADD
         *  @langversion 3.0
         *  @playerversion Flash 10
         *  @playerversion AIR 1.5
         *  @productversion Flex 4
        [Event(name = "elementAdd", type = "spark.events.ElementExistenceEvent")]
         *  Dispatched when a visual element is removed from the content holder.
         *  <code>event.element</code> is the visual element that's being removed.
         *  @eventType spark.events.ElementExistenceEvent.ELEMENT_REMOVE
         *  @langversion 3.0
         *  @playerversion Flash 10
         *  @playerversion AIR 1.5
         *  @productversion Flex 4
        [Event(name = "elementRemove", type = "spark.events.ElementExistenceEvent")]
        //  Styles
         *  Color of text shadows.
         *  @default #FFFFFF
         *  @langversion 3.0
         *  @playerversion Flash 10
         *  @playerversion AIR 1.5
         *  @productversion Flex 4
        [Style(name = "textShadowColor", type = "uint", format = "Color", inherit = "yes", theme = "mobile")]
         *  Alpha of text shadows.
         *  @default 0.55
         *  @langversion 3.0
         *  @playerversion Flash 10
         *  @playerversion AIR 1.5
         *  @productversion Flex 4
        [Style(name = "textShadowAlpha", type = "Number", inherit = "yes", minValue = "0.0", maxValue = "1.0", theme = "mobile")]
        //  Excluded APIs
        [Exclude(name = "addChild", kind = "method")]
        [Exclude(name = "addChildAt", kind = "method")]
        [Exclude(name = "removeChild", kind = "method")]
        [Exclude(name = "removeChildAt", kind = "method")]
        [Exclude(name = "setChildIndex", kind = "method")]
        [Exclude(name = "swapChildren", kind = "method")]
        [Exclude(name = "swapChildrenAt", kind = "method")]
        [Exclude(name = "numChildren", kind = "property")]
        [Exclude(name = "getChildAt", kind = "method")]
        [Exclude(name = "getChildIndex", kind = "method")]
        //  Other metadata
        [ResourceBundle("components")]
        [DefaultProperty("mxmlContent")]
        [IconFile("Group.png")]
         *  The Group class is the base container class for visual elements.
         *  The Group container takes as children any components that implement
         *  the IUIComponent interface, and any components that implement
         *  the IGraphicElement interface.
         *  Use this container when you want to manage visual children,
         *  both visual components and graphical components.
         *  <p>To improve performance and minimize application size,
         *  the Group container cannot be skinned.
         *  If you want to apply a skin, use the SkinnableContainer instead.</p>
         *  <p><b>Note:</b> The scale grid might not function correctly when there
         *  are DisplayObject children inside of the Group, such as a component
         *  or another Group.  If the children are GraphicElement objects, and
         *  they all share the Group's DisplayObject, then the scale grid works
         *  properly.</p>
         *  <p>Setting any of the following properties on a GraphicElement child
         *  requires that GraphicElement to create its own DisplayObject,
         *  thus negating the scale grid properties on the Group.</p>
         *  <pre>
         *  alpha
         *  blendMode other than BlendMode.NORMAL or "auto"
         *  colorTransform
         *  filters
         *  mask
         *  matrix
         *  rotation
         *  scaling
         *  3D properties
         *  bounds outside the extent of the Group
         *  </pre>
         *  <p>The Group container has the following default characteristics:</p>
         *  <table class="innertable">
         *     <tr><th>Characteristic</th><th>Description</th></tr>
         *     <tr><td>Default size</td><td>Large enough to display its children</td></tr>
         *     <tr><td>Minimum size</td><td>0 pixels</td></tr>
         *     <tr><td>Maximum size</td><td>10000 pixels wide and 10000 pixels high</td></tr>
         *  </table>
         *  @mxml
         *  <p>The <code>&lt;s:Group&gt;</code> tag inherits all of the tag
         *  attributes of its superclass and adds the following tag attributes:</p>
         *  <pre>
         *  &lt;s:Group
         *    <strong>Properties</strong>
         *    blendMode="auto"
         *    mxmlContent="null"
         *    scaleGridBottom="null"
         *    scaleGridLeft="null"
         *    scaleGridRight="null"
         *    scaleGridTop="null"
         *    <strong>Events</strong>
         *    elementAdd="<i>No default</i>"
         *    elementRemove="<i>No default</i>"
         *  /&gt;
         *  </pre>
         *  @see spark.components.DataGroup
         *  @see spark.components.SkinnableContainer
         *  @includeExample examples/GroupExample.mxml
         *  @langversion 3.0
         *  @playerversion Flash 10
         *  @playerversion AIR 1.5
         *  @productversion Flex 4
        public class MonkeyPatchedGroup extends GroupBase implements IVisualElementContainer, IGraphicElementContainer, ISharedDisplayObject
             *  Constructor.
             *  @langversion 3.0
             *  @playerversion Flash 10
             *  @playerversion AIR 1.5
             *  @productversion Flex 4
            public function MonkeyPatchedGroup():void
                super();
            //  Variables
            private var needsDisplayObjectAssignment:Boolean = false;
            private var layeringMode:uint = ITEM_ORDERED_LAYERING;
            private var numGraphicElements:uint = 0;
            private static const ITEM_ORDERED_LAYERING:uint = 0;
            private static const SPARSE_LAYERING:uint = 1;
            //  Overridden properties
            //  baselinePosition
             *  @inheritDoc
             *  @langversion 3.0
             *  @playerversion Flash 10
             *  @playerversion AIR 1.5
             *  @productversion Flex 4
            override public function get baselinePosition():Number
                if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_5)
                    return super.baselinePosition;
                if (!validateBaselinePosition())
                    return NaN;
                var bElement:IVisualElement = baselinePositionElement;
                // If no baselinePositionElement is specified, use the first element
                if (bElement == null)
                    for (var i:int = 0; i < numElements; i++)
                        var elt:IVisualElement = getElementAt(i);
                        if (elt.includeInLayout)
                            bElement = elt;
                            break;
                if (bElement)
                    return bElement.baselinePosition + bElement.y;
                else
                    return super.baselinePosition;
            [Inspectable(category = "General", enumeration = "noScale,scale", defaultValue = "noScale")]
             *  @private
            override public function set resizeMode(value:String):void
                if (isValidScaleGrid())
                    // Force the resize mode to be scale if we
                    // have set scaleGrid properties
                    value = ResizeMode.SCALE;
                super.resizeMode = value;
             *  @private
            override public function set scrollRect(value:Rectangle):void
                // Work-around for Flash Player bug: if GraphicElements share
                // the Group's Display Object and cacheAsBitmap is true, the
                // scrollRect won't function correctly.
                var previous:Boolean = canShareDisplayObject;
                super.scrollRect = value;
                if (numGraphicElements > 0 && previous != canShareDisplayObject)
                    invalidateDisplayObjectOrdering();
                if (mouseEnabledWhereTransparent && hasMouseListeners)
                    // Re-render our mouse event fill if necessary.
                    redrawRequested = true;
                    trace("Calling invalidateDisplayList in GroupBase");
                    super.$invalidateDisplayList();
             * @private
            override mx_internal function set hasMouseListeners(value:Boolean):void
                if (mouseEnabledWhereTransparent)
                    redrawRequested = true;
                super.hasMouseListeners = value;
             *  @private
            override public function set width(value:Number):void
                if (_width != value)
                    if (mouseEnabledWhereTransparent && hasMouseListeners)
                        // Re-render our mouse event fill if necessary.
                        redrawRequested = true;
                        super.$invalidateDisplayList();
                super.width = value;
             *  @private
            override public function set height(value:Number):void
                if (_height != value)
                    if (mouseEnabledWhereTransparent && hasMouseListeners)
                        // Re-render our mouse event fill if necessary.
                        redrawRequested = true;
                        super.$invalidateDisplayList();
                super.height = value;
            //  Properties
            //  alpha
            [Inspectable(defaultValue = "1.0", category = "General", verbose = "1")]
             *  @private
            override public function set alpha(value:Number):void
                if (super.alpha == value)
                    return;
                if (_blendMode == "auto")
                    // If alpha changes from an opaque/transparent (1/0) and translucent
                    // (0 < value < 1), then trigger a blendMode change
                    if ((value > 0 && value < 1 && (super.alpha == 0 || super.alpha == 1)) || ((value == 0 || value == 1) && (super.alpha > 0 && super.alpha < 1)))
                        blendModeChanged = true;
                        invalidateDisplayObjectOrdering();
                        invalidateProperties();
                super.alpha = value;
            //  baselinePositionElement
            private var _baselinePositionElement:IVisualElement;
             *  The element used to calculate the GroupBase's baselinePosition
             *  @langversion 3.0
             *  @playerversion Flash 10
             *  @playerversion AIR 1.5
             *  @productversion Flex 4
            public function get baselinePositionElement():IVisualElement
                return _baselinePositionElement;
             *  @private
            public function set baselinePositionElement(value:IVisualElement):void
                if (value === _baselinePositionElement)
                    return;
                _baselinePositionElement = value;
                invalidateParentSizeAndDisplayList();
            //  blendMode
             *  @private
             *  Storage for the blendMode property.
            private var _blendMode:String = "auto";
            private var blendModeChanged:Boolean;
            private var blendShaderChanged:Boolean;
            [Inspectable(category = "General", enumeration = "auto,add,alpha,darken,difference,erase,hardlight,invert,layer,lighten,multiply,normal,subtract,screen,overlay,colordodge,colorburn,exclusion,softlight,hue,saturation,color,luminosity", defaultValue = "auto")]
             *  A value from the BlendMode class that specifies which blend mode to use.
             *  A bitmap can be drawn internally in two ways.
             *  If you have a blend mode enabled or an external clipping mask, the bitmap is drawn
             *  by adding a bitmap-filled square shape to the vector render.
             *  If you attempt to set this property to an invalid value,
             *  Flash Player or Adobe AIR sets the value to <code>BlendMode.NORMAL</code>.
             *  <p>A value of "auto" (the default) is specific to Group's use of
             *  blendMode and indicates that the underlying blendMode should be
             *  <code>BlendMode.NORMAL</code> except when <code>alpha</code> is not
             *  equal to either 0 or 1, when it is set to <code>BlendMode.LAYER</code>.
             *  This behavior ensures that groups have correct
             *  compositing of their graphic objects when the group is translucent.</p>
             *  @default "auto"
             *  @see flash.display.DisplayObject#blendMode
             *  @see flash.display.BlendMode
             *  @langversion 3.0
             *  @playerversion Flash 10
             *  @playerversion AIR 1.5
             *  @productversion Flex 4
            override public function get blendMode():String
                return _blendMode;
             *  @private
            override public function set blendMode(value:String):void
                if (value == _blendMode)
                    return;
                invalidateProperties();
                blendModeChanged = true;
                //The default blendMode in FXG is 'auto'. There are only
                //certain cases where this results in a rendering difference,
                //one being when the alpha of the Group is > 0 and < 1. In that
                //case we set the blendMode to layer to avoid the performance
                //overhead that comes with a non-normal blendMode.
                if (value == "auto")
                    _blendMode = value;
                    // SDK-29631: Use super.$blendMode instead of super.blendMode
                    // since Group completely overrides blendMode and we
                    // want to bypass the extra logic in UIComponent which
                    // has its own override.
                    // TODO (egeorgie): figure out whether we can share some
                    // of that logic in the future.
                    if (((alpha > 0 && alpha < 1) && super.$blendMode != BlendMode.LAYER) || ((alpha == 1 || alpha == 0) && super.$blendMode != BlendMode.NORMAL))
                        invalidateDisplayObjectOrdering();
                else
                    var oldValue:String = _blendMode;
                    _blendMode = value;
                    // If one of the non-native Flash blendModes is set,
                    // record the new value and set the appropriate
                    // blendShader on the display object.
                    if (isAIMBlendMode(value))
                        blendShaderChanged = true;
                    // Only need to re-do display object assignment if blendmode was normal
                    // and is changing to something else, or the blend mode was something else
                    // and is going back to normal.  This is because display object sharing
                    // only happens when blendMode is normal.
                    if ((oldValue == BlendMode.NORMAL || value == BlendMode.NORMAL) && !(oldValue == BlendMode.NORMAL && value == BlendMode.NORMAL))
                        invalidateDisplayObjectOrdering();
            //  mxmlContent
            private var mxmlContentChanged:Boolean = false;
            private var _mxmlContent:Array;
            [ArrayElementType("mx.core.IVisualElement")]
             *  The visual content children for this Group.
             *  This method is used internally by Flex and is not intended for direct
             *  use by developers.
             *  <p>The content items should only be IVisualElement objects.
             *  An <code>mxmlContent</code> Array should not be shared between multiple
             *  Group containers because visual elements can only live in one container
             *  at a time.</p>
             *  <p>If the content is an Array, do not modify the Array
             *  directly. Use the methods defined by the Group class instead.</p>
             *  @default null
             *  @langversion 3.0
             *  @playerversion Flash 10
             *  @playerversion AIR 1.5
             *  @productversion Flex 4
            public function set mxmlContent(value:Array):void
                if (createChildrenCalled)
                    setMXMLContent(value);
                else
                    mxmlContentChanged = true;
                    _mxmlContent = value;
                        // we will validate this in createChildren();
             *  @private
            mx_internal function getMXMLContent():Array
                if (_mxmlContent)
                    return _mxmlContent.concat();
                else
                    return null;
             *  @private
             *  Adds the elements in <code>mxmlContent</code> to the Group.
             *  Flex calls this method automatically; you do not call it directly.
             *  @langversion 3.0
             *  @playerversion Flash 10
             *  @playerversion AIR 1.5
             *  @productversion Flex 4
            private function setMXMLContent(value:Array):void
                var i:int;
                // if there's old content and it's different than what
                // we're trying to set it to, then let's remove all the old
                // elements first.
                if (_mxmlContent != null && _mxmlContent != value)
                    for (i = _mxmlContent.length - 1; i >= 0; i--)
                        elementRemoved(_mxmlContent[i], i);
                _mxmlContent = (value) ? value.concat() : null; // defensive copy
                if (_mxmlContent != null)
                    var n:int = _mxmlContent.length;
                    for (i = 0; i < n; i++)
                        var elt:IVisualElement = _mxmlContent[i];
                        // A common mistake is to bind the viewport property of a Scroller
                        // to a group that was defined in the MXML file with a different parent   
                        if (elt.parent && (elt.parent != this))
                            throw new Error(resourceManager.getString("components", "mxmlElementNoMultipleParents",
                                                                      [ elt ]));
                        elementAdded(elt, i);
            //  Properties: ScaleGrid
            private var scaleGridChanged:Boolean = false;
            // store the scaleGrid into a rectangle to save space (top, left, bottom, right);
            private var scaleGridStorageVariable:Rectangle;
            //  scale9Grid
             *  @private
            override public function set scale9Grid(value:Rectangle):void
                if (value != null)
                    scaleGridTop = value.top;
                    scaleGridBottom = value.bottom;
                    scaleGridLeft = value.left;
                    scaleGridRight = value.right;
                else
                    scaleGridTop = NaN;
                    scaleGridBottom = NaN;
                    scaleGridLeft = NaN;
                    scaleGridRight = NaN;
            //  scaleGridBottom
            [Inspectable(category = "General")]
             *  Specifies the bottom coordinate of the scale grid.
             *  @langversion 3.0
             *  @playerversion Flash 10
             *  @playerversion AIR 1.5
             *  @productversion Flex 4
            public function get scaleGridBottom():Number
                if (scaleGridStorageVariable)
                    return scaleGridStorageVariable.height;
                return NaN;
            public function set scaleGridBottom(value:Number):void
                if (!scaleGridStorageVariable)
                    scaleGridStorageVariable = new Rectangle(NaN, NaN, NaN, NaN);
                if (value != scaleGridStorageVariable.height)
                    scaleGridStorageVariable.height = value;
                    scaleGridChanged = true;
                    invalidateProperties();
                    invalidateDisplayList();
            //  scaleGridLeft
            [Inspectable(category = "General")]
             * Specifies the left coordinate of the scale grid.
             *  @langversion 3.0
             *  @playerversion Flash 10
             *  @playerversion AIR 1.5
             *  @productversion Flex 4
            public function get scaleGridLeft():Number
                if (scaleGridStorageVariable)
                    return scaleGridStorageVariable.x;
                return NaN;
            public function set scaleGridLeft(value:Number):void
                if (!scaleGridStorageVariable)
                    scaleGridStorageVariable = new Rectangle(NaN, NaN, NaN, NaN);
                if (value != scaleGridStorageVariable.x)
                    scaleGridStorageVariable.x = value;
                    scaleGridChanged = true;
                    invalidateProperties();
                    invalidateDisplayList();
            //  scaleGridRight
            [Inspectable(category = "General")]
             * Specifies the right coordinate of the scale grid.
             *  @langversion 3.0
             *  @playerversion Flash 10
             *  @playerversion AIR 1.5
             *  @productversion Flex 4
            public function get scaleGridRight():Number
                if (scaleGridStorageVariable)
                    return scaleGridStorageVariable.width;
                return NaN;
            public function set scaleGridRight(value:Number):void
                if (!scaleGridStorageVariable)
                    scaleGridStorageVariable = new Rectangle(NaN, NaN, NaN, NaN);
                if (value != scaleGridStorageVariable.width)
                    scaleGridStorageVariable.width = value;
                    scaleGridChanged = true;
                    invalidateProperties();
                    invalidateDisplayList();
            //  scaleGridTop
            [Inspectable(category = "General")]
             * Specifies the top coordinate of the scale grid.
             *  @langversion 3.0
             *  @playerversion Flash 10
             *  @playerversion AIR 1.5
             *  @productversion Flex 4
            public function get scaleGridTop():Number
                if (scaleGridStorageVariable)
                    return scaleGridStorageVariable.y;
                return NaN;
            public function set scaleGridTop(value:Number):void
                if (!scaleGridStorageVariable)
                    scaleGridStorageVariable = new Rectangle(NaN, NaN, NaN, NaN);
                if (value != scaleGridStorageVariable.y)
                    scaleGridStorageVariable.y = value;
                    scaleGridChanged = true;
                    invalidateProperties();
                    invalidateDisplayList();
            private function isValidScaleGrid():Boolean
                return !isNaN(scaleGridLeft) && !isNaN(scaleGridTop) && !isNaN(scaleGridRight) && !isNaN(scaleGridBottom);
            //  Overridden methods: UIComponent
             *  @private
             *  Whether createChildren() has been called or not.
             *  We use this in the setter for mxmlContent to know
             *  whether to validate the value immediately, or just
             *  wait to let createChildren() do it.
            private var createChildrenCalled:Boolean = false;
             *  @private
            override protected function createChildren():void
                super.createChildren();
                createChildrenCalled = true;
                if (mxmlContentChanged)
                    mxmlContentChanged = false;
                    setMXMLContent(_mxmlContent);
             *  @private
            override public function validateProperties():void
                super.validateProperties();
                // Property validation happens top-down, so now let's
                // validate graphic element properties after
                // calling super.validateProperties()
                if (numGraphicElements > 0)
                    var length:int = numElements;
                    for (var i:int = 0; i < length; i++)
                        var element:IGraphicElement = getElementAt(i) as IGraphicElement;
                        if (element)
                            element.validateProperties();
             *  @private
            override protected function commitProperties():void
                super.commitProperties();
                invalidatePropertiesFlag = false;
                if (blendModeChanged)
                    blendModeChanged = false;
                    // Figure out the correct blendMode value
                    // to set.
                    // SDK-29631: Use super.$blendMode instead of super.blendMode
                    // since Group completely overrides blendMode and we
                    // want to bypass the extra logic in UIComponent which
                    // has its own override.
                    // TODO (egeorgie): figure out whether we can share some
                    // of that logic in the future.
                    if (_blendMode == "auto")
                        if (alpha == 0 || alpha == 1)
                            super.$blendMode = BlendMode.NORMAL;
                        else
                            super.$blendMode = BlendMode.LAYER;
                    else if (!isAIMBlendMode(_blendMode))
                        super.$blendMode = _blendMode;
                    if (blendShaderChanged)
                        // The graphic element's blendMode was set to a non-Flash
                        // blendMode. We mimic the look by instantiating the
                        // appropriate shader class and setting the blendShader
                        // property on the displayObject.
                        blendShaderChanged = false;
                        switch (_blendMode)
                            case "color":
                                super.blendShader = new ColorShader();
                                break;
                            case "colordodge":
                                super.blendShader = new ColorDodgeShader();
                                break;
                            case "colorburn":
                                super.blendShader = new ColorBurnShader();
                                break;
                            case "exclusion":
                                super.blendShader = new ExclusionShader();
                                break;
                            case "hue":
                                super.blendShader = new HueShader();
                                break;
                            case "luminosity":
                                super.blendShader = new LuminosityShader();
                                break;
                            case "saturation":
                                super.blendShader = new SaturationShader();
                                break;
                            case "softlight":
                                super.blendShader = new SoftLightShader();
                                break;
                // Due to dependent properties alpha and blendMode there may be a need
                // for a second pass at committing properties (to ensure our new
                // blendMode or blendShader is assigned to our underlying display
                // object).
                if (invalidatePropertiesFlag)
                    super.commitProperties();
                    invalidatePropertiesFlag = false;
                if (needsDisplayObjectAssignment)
                    needsDisplayObjectAssignment = false;
                    assignDisplayObjects();
                if (scaleGridChanged)
                    // Don't reset scaleGridChanged since we also check it in updateDisplayList
                    if (isValidScaleGrid())
                        resizeMode = ResizeMode.SCALE; // Force the resizeMode to scale
             *  @private
            override public function validateSize(recursive:Boolean = false):void
                // Since IGraphicElement is not ILayoutManagerClient, we need to make sure we
                // validate sizes of the elements, even in cases where recursive==false.
                // Size validation happens bottom-up, so now let's
                // validate graphic element size before
                // calling super.validateSize()
                if (numGraphicElements > 0)
                    var length:int = numElements;
                    for (var i:int = 0; i < length; i++)
                        var element:IGraphicElement = getElementAt(i) as IGraphicElement;
                        if (element)
                            element.validateSize();
                super.validateSize(recursive);
             *  @private
            override public function setActualSize(w:Number, h:Number):void
                if (_width != w || _height != h)
                    if (mouseEnabledWhereTransparent && hasMouseListeners)
                        // Re-render our mouse event fill if necessary.
                        redrawRequested = true;
                        super.$invalidateDisplayList();
                super.setActualSize(w, h);
             *  @private
            override public function validateDisplayList():void
                // call super.validateDisplayList() and let updateDisplayList() run
                super.validateDisplayList();
                // If the DisplayObject assignment is still not completed, then postpone validation
                // of the GraphicElements. invalidateDisplayList() will be called during the next
                // commitProperties() call since needsDisplayObjectAssignment=true,
                // so we will be re-running validateDisplayList() anyways
                if (needsDisplayObjectAssignment && invalidatePropertiesFlag)
                    return;
                // DisplayList validation happens top-down, so we should
                // validate graphic element DisplayList after
                // calling super.validateDisplayList().  This is
                // gets tricky because of graphic-element sharing.  We clear
                // Group's graphic's object in updateDisplayList() and handle the
                // rest of the DisplayList validation in here.
                // Iterate through the graphic elements. If an element has a displayObject that has been
                // invalidated, then validate all graphic elements that draw to this displayObject.
                // The algorithm assumes that all of the elements that share a displayObject are in between
                // the element with the shared displayObject and the next element that has a displayObject.
                var sharedDisplayObject:ISharedDisplayObject = this;
                if (numGraphicElements > 0)
                    var length:int = numElements;
                    for (var i:int = 0; i < length; i++)
                        var element:IGraphicElement = getElementAt(i) as IGraphicElement;
                        if (!element)
                            continue;
                        // Do a special check for layer, we may stumble upon an element with layer != 0
                        // before we're done with the current shared sequence and we don't want to mark
                        // the sequence as valid, until we reach the next sequence.  
                        if (element.depth == 0)
                            // Is this the start of a new shared sequence?         
                            if (element.displayObjectSharingMode != DisplayObjectSharingMode.USES_SHARED_OBJECT)
                                // We have finished redrawing the previous sequence
                                if (sharedDisplayObject)
                                    sharedDisplayObject.redrawRequested = false;
                                // Start the new sequence
                                sharedDisplayObject = element.displayObject as ISharedDisplayObject;
                            if (!sharedDisplayObject || sharedDisplayObject.redrawRequested)
                                element.validateDisplayList();
                        else
                            // If we have layering, we don't share the display objects.
                            // Don't update the current sharedDisplayObject
                            var elementDisplayObject:ISharedDisplayObject = element.displayObject as ISharedDisplayObject;
                            if (!elementDisplayObject || elementDisplayObject.redrawRequested)
                                element.validateDisplayList();
                                if (elementDisplayObject)
                                    elementDisplayObject.redrawRequested = false;
                // Mark the last shared displayObject valid
                if (sharedDisplayObject)
                    sharedDisplayObject.redrawRequested = false;
             *  @private
            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                // let user's code (layout) run first before dealing with graphic element
                // sharing because that's when redraws can be requested
                super.updateDisplayList(unscaledWidth, unscaledHeight);
                // Clear the group's graphic because graphic elements might be drawing to it
                // This isn't needed for DataGroup because there's no DisplayObject sharing
                // This code exists in updateDisplayList() as opposed to validateDisplayList()
                // because of compatibility issues since most of this code was
                // refactored from updateDisplayList() and in to validateDisplayList().  User's code
                // already assumed that they could call super.updateDisplayList() and then be able to draw
                // into the Group's graphics object.  Because of that, the graphics.clear() call is left
                // in updateDisplayList() instead of in validateDisplayList() with the rest of the graphic
                // element sharing code.
                var sharedDisplayObject:ISharedDisplayObject = this;
                if (sharedDisplayObject.redrawRequested)
                    // clear the graphics here.  The pattern is usually to call graphics.clear()
                    // before calling super.updateDisplayList() so what happens in super.updateDisplayList()
                    // isn't erased.  However, in this case, what happens in super.updateDisplayList() isn't
                    // much, and we want to make sure super.updateDisplayList() runs first since the layout
                    // is what actually triggers the the shareDisplayObject to request to be redrawn.
                    graphics.clear();
                    drawBackground();
                    // If a scaleGrid is set, make sure the extent of the groups bounds are filled so
                    // the player will scale our contents as expected.
                    if (isValidScaleGrid() && resizeMode == ResizeMode.SCALE)
                        graphics.lineStyle();
                        graphics.beginFill(0, 0);
                        graphics.drawRect(0, 0, 1, 1);
                        graphics.drawRect(measuredWidth - 1, measuredHeight - 1, 1, 1);
                        graphics.endFill();
                if (scaleGridChanged)
                    scaleGridChanged = false;
                    if (isValidScaleGrid())
                        // Check for DisplayObjects other than overlays
                        var overlayCount:int = _overlay ? _overlay.numDisplayObjects : 0;
                        if (numChildren - overlayCount > 0)
                            throw new Error(resourceManager.getString("components", "scaleGridGroupError"));
                        super.scale9Grid = new Rectangle(scaleGridLeft,
                                                         scaleGridTop,
                                                         scaleGridRight - scaleGridLeft,
                                                         scaleGridBottom - scaleGridTop);
                    else
                        super.scale9Grid = null;
             *  @private
             *  TODO (rfrishbe): Most of this code is a duplicate of UIComponent::notifyStyleChangeInChildren,
             *  refactor as appropriate to avoid code duplication once we have a common
             *  child iterator between UIComponent and Group.
            override public function notifyStyleChangeInChildren(
                styleProp:String, recursive:Boolean):void
                if (mxmlContentChanged || !recursive)
                    return;
                var n:int = numElements;
                for (var i:int = 0; i < n; i++)
                    var child:ISimpleStyleClient = getElementAt(i) as ISimpleStyleClient;
                    if (child)
                        child.styleChanged(styleProp);
                        if (child is IStyleClient)
                            IStyleClient(child).notifyStyleChangeInChildren(styleProp,
                                                                            recursive);
                if (advanceStyleClientChildren != null)
                    for (var styleClient:Object in advanceStyleClientChildren)
                        var iAdvanceStyleClientChild:IAdvancedStyleClient = styleClient as IAdvancedStyleClient;
                        if (iAdvanceStyleClientChild)
                            iAdvanceStyleClientChild.styleChanged(styleProp);
             *  @private
             *  TODO (rfrishbe): Most of this code is a duplicate of UIComponent::regenerateStyleCache,
             *  refactor as appropriate to avoid code duplication once we have a common
             *  child iterator between UIComponent and Group.
            override public function regenerateStyleCache(recursive:Boolean):void
                // Regenerate the proto chain for this object
                initProtoChain();
                // Recursively call this method on each child.
                var n:int = numElements;
                for (var i:int = 0; i < n; i++)
                    var child:IVisualElement = getElementAt(i);
                    if (child is IStyleClient)
                        // Does this object already have a proto chain?
                        // If not, there's no need to regenerate a new one.
                        if (IStyleClient(child).inheritingStyles != StyleProtoChain.STYLE_UNINITIALIZED)
                            IStyleClient(child).regenerateStyleCache(recursive);
                    else if (child is IUITextField)
                        // Does this object already have a proto chain?
                        // If not, there's no need to regenerate a new one.
                        if (IUITextField(child).inheritingStyles)
                            StyleProtoChain.initTextField(IUITextField(child));
                // Call this method on each non-visual StyleClient
                if (advanceStyleClientChildren != null)
                    for (var styleClient:Object in advanceStyleClientChildren)
                        var iAdvanceStyleClientChild:IAdvancedStyleClient = styleClient as IAdvancedStyleClient;
                        if (iAdvanceStyleClientChild && iAdvanceStyleClientChild.inheritingStyles != StyleProtoChain.STYLE_UNINITIALIZED)
                            iAdvanceStyleClientChild.regenerateStyleCache(recursive);
            //  Content management
             *  @private
            override public function get numElements():int
                if (_mxmlContent == null)
                    return 0;
                return _mxmlContent.length;
             *  @private
            override public function getElementAt(index:int):IVisualElement
                // check for RangeError:
                checkForRangeError(index);
                return _mxmlContent[index];
             *  @private
             *  Checks the range of index to make sure it's valid
            private function checkForRangeError(index:int, addingElement:Boolean = false):void
                // figure out the maximum allowable index
                var maxIndex:int = (_mxmlContent == null ? -1 : _mxmlContent.length - 1);
                // if adding an element, we allow an extra index at the end
                if (addingElement)
                    maxIndex++;
                if (index < 0 || index > maxIndex)
                    throw new RangeError(resourceManager.getString("components", "indexOutOfRange",
                                                                   [ index ]));
             * @private
            private function isAIMBlendMode(value:String):Boolean
                if (value == "colordodge" || value == "colorburn" || value == "exclusion" || value == "softlight" || value == "hue" || value == "saturatio

    FYI - This regression has been filed here: http://bugs.adobe.com/jira/browse/SDK-31989

  • Runtime.exec() fails sometime to execute a command

    Hello,
    I have a program thats using Runtime.exec to execute some external programs sequence with some redirection operators.
    For e.g, I have some command as follows;
    1 - C:\bin\IBRSD.exe IBRSD -s
    2 - C:\bin\mcstat -n @punduk444:5000#mc -l c:\ | grep -i running | grep -v grep |wc -l
    3 - ping punduk444 | grep "100%" | wc -l
    ...etc.
    These command in sequence for a single run. The test program makes multiple such runs. So my problem is sometimes the runtime.exec() fails to execute some of the commands above (typically the 2nd one). The waitFor() returns error code (-1). That is if I loop these commands for say 30 runs then in some 1~4 runs the 2nd command fails to execute and return -1 error code.
    Can some one help me out to as why this is happening? Any help is appreciated
    Thanks,
    ~jaideep
    Herer is the code snippet;
    Runtime runtime = Runtime.getRuntime();
    //create process object to handle result
    Process process = null;
    commandToRun = "cmd /c " + command;
    process = runtime.exec( commandToRun );
    CommandOutputReader cmdError = new CommandOutputReader(process.getErrorStream());
    CommandOutputReader cmdOutput = new CommandOutputReader(process.getInputStream());
    cmdError.start();
    cmdOutput.start();
    CheckProcess chkProcess = new CheckProcess(process);
    chkProcess.start();
    int retValue = process.waitFor();
    if(retValue != 0)
    return -1;
    output = cmdOutput.getOutputData();
    cmdError = null;
    cmdOutput = null;
    chkProcess = null;
    /*******************************supporting CommandOutputReader class *********************************/
    public class CommandOutputReader extends Thread
    private transient InputStream inputStream; //to get output of any command
    private transient String output; //output will store command output
    protected boolean isDone;
    public CommandOutputReader()
    super();
    output = "";
    this.inputStream = null;
    public CommandOutputReader(InputStream stream)
    super();
    output = "";
    this.inputStream = stream;
    public void setStream(InputStream stream)
    this.inputStream = stream;
    public String getOutputData()
    return output;
    public void run()
    if(inputStream != null)
    final BufferedReader bufferReader = new BufferedReader(new InputStreamReader(inputStream), 1024 * 128);
    String line = null;
    try
    while ( (line = bufferReader.readLine()) != null)
    if (ResourceString.getLocale() != null)
    Utility.log(Level.DEBUG,line);
    //output += line + System.getProperty(Constants.ALL_NEWLINE_GETPROPERTY_PARAM);
    output += line + "\r\n";
    System.out.println("<< "+ this.getId() + " >>" + output );
    System.out.println("<< "+ this.getId() + " >>" + "closed the i/p stream...");
    inputStream.close();
    bufferReader.close();
    catch (IOException objIOException)
    if (ResourceString.getLocale() != null)
    Utility.log(Level.ERROR, ResourceString.getString("io_exeception_reading_cmd_output")+
    objIOException.getMessage());
    output = ResourceString.getString("io_exeception_reading_cmd_output");
    else
    output = "io exeception reading cmd output";
    finally {
    isDone = true;
    public boolean isDone() {
    return isDone;
    /*******************************supporting CommandOutputReader class *********************************/
    /*******************************supporting process controller class *********************************/
    public class CheckProcess extends Thread
    private transient Process monitoredProcess;
    private transient boolean continueLoop ;
    private transient long maxWait = Constants.WAIT_PERIOD;
    public CheckProcess(Process monitoredProcess)
    super();
    this.monitoredProcess = monitoredProcess;
    continueLoop =true;
    public void setMaxWait(final long max)
    this.maxWait = max;
    public void stopProcess()
    continueLoop=false;
    public void run()
    //long start1 = java.util.Calendar.getInstance().getTimeInMillis();
    final long start1 = System.currentTimeMillis();
    while (true && continueLoop)
    // after maxWait millis, stops monitoredProcess and return
    if (System.currentTimeMillis() - start1 > maxWait)
    if(monitoredProcess != null)
    monitoredProcess.destroy();
    //available for garbage collection
    // @PMD:REVIEWED:NullAssignment: by jbarde on 9/28/06 7:29 PM
    monitoredProcess = null;
    return;
    try
    sleep(1000);
    catch (InterruptedException e)
    if (ResourceString.getLocale() != null)
    Utility.log(Level.ERROR, ResourceString.getString("exception_in_sleep") + e.getLocalizedMessage());
    System.out.println(ResourceString.getString("exception_in_sleep") + e.getLocalizedMessage());
    else
    System.out.println("Exception in sleep" + e.getLocalizedMessage());
    if(monitoredProcess != null)
    monitoredProcess.destroy();
    //available for garbage collection
    // @PMD:REVIEWED:NullAssignment: by jbarde on 9/28/06 7:29 PM
    monitoredProcess = null;
    /*******************************supporting process controller class *********************************/

    Hi,
    Infact the command passed to the exec() is in the form of a batch file, which contains on of these commands. I can not put all commands in one batch file due to inherent nature of the program.
    But my main concern was that, why would it behave like this. If I run the same command for 30 times 1~3 times the same command can not be executed (returns with error code 1, on wiun2k pro) and rest times it works perfectly fine.
    Do you see any abnormality in the code.
    I ahve used the same sequence of code as in the article suggested by
    "masijade". i.e having threads to monitor the process and other threads to read and empty out the input and error streams so that the buffer does not get full.
    But I see here the problem is not of process getting hanged, I sense this because my waitFor() returns with error code as 1, had the process hanged it would not have returned , am I making sense?
    Regards,
    ~jaideep

  • Migration from Flex 3 to Flex 4

    I've migrated my project from flex 3 to flex 4 and all it's ok, the new project work fine.
    But I created my custom TitleWindow MX style and I created a swc library from Flash builder 4, all it's ok.
    When I use my custom TitleWindow in new project (compatible with mx+spark) it work fine when I add only mx component, when I add a <s:TextArea> for example, it throw this error in run-time: Skin for ForumTitleWindow1220.boxMessaggioInput.TextArea1227 cannot be found.
    where ForumTitleWindow1220 and boxMessaggioInput are my instance.
    in particolar the error is "throw(new Error(resourceManager.getString("components", "skinNotFound", [this])));"
    in SkinnableComponent to line 698.
    why?

    For Flex 4, in addition to developing new "Gumbo" components
    which have an improved skinning architecture and use TLF, the Flex
    team is also planning to make it possible to have a few TLF
    features such as bidirectional text in some or perhaps all of the
    Halo components from Flex 3. These components currently use a
    Player class known as TextField. A class called TLFTextField is
    being developed which uses TLF to implement the same APIs as
    TextField, and therefore can replace TextField in the Halo
    components.
    This work is underway but not yet complete. Only a few
    components are currently working with this approach and there is no
    way at the moment to turn on bidirectionality. We are also starting
    to develop a UI-mirroring feature to allow the entire user
    interface -- not just the text -- to become right-to-left.
    So what you need -- the ability to write Arabic and Hebrew
    applications using only legacy Halo components -- is planned for
    Flex 4.
    Gordon Smith
    Adobe Flex SDK Team

  • Exception not always caught in Sun Studio 12

    Hi,
    We're using Sun Studio 12 (Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25) on a Solaris 10 SPARC machine. In our applications an exception thrown is sometimes not caught in the try/catch statement and the program continues at an outer catch statement (which usually leads to the program exiting). So far I've not been able to reduce the code down to a simple example and I don't yet know what conditions causes this behaviour.
    In general the code has a big try/catch statement in main. Somewhere deep in the code there is a second try/catch statement which protects against a piece of code which we know may throw an exception. This is usually a smart pointer being dereferenced. The act of dereferencing the smart pointer in turn causes an exception to be thrown which is caught internally in a third try/catch inside the dereference code. The exception is successfully caught and some clean up is done. Then the exception is re-thrown by either using a throw; statement or a new throw xmsg("...");. All our exceptions are always of type xmsg which simply takes a string argument.
    When the problem manifests itself the second try/catch is ignored and the re-thrown exception is instead caught in the outer catch statement in main which causes the program to log an error and exit.
    We have lots of code which is structured the same way and the same style of code works in many cases only to fail in some specific case. It's an elusive problem because the problem moves around and it also depends on how the program is compiled. It only seems to happen when compiled in debug mode. If I compile with -xO4 the problem seems to go away.
    The problem also goes away or moves to a different place if the code has changed somewhere between compiles, i.e. some other developer has modified some code, not necessarily in the same are where the problem originally happened.
    One thing we have is a function we call DoThrow (used to suppress a warning on an older compiler) defined like this:
    void DoThrow(const std::string& msg)
      throw xmsg(msg);
    }As an experiment I replaced the call to DoThrow with a straight throw xmsg(...) at a place where the first exception was thrown and the problem went away. I'm not sure if removing the call to DoThrow fixed the problem or if the minor restructuring of the code was enough to move the problem elsewhere.
    For production releases we still use WorkShop 6, update 2 which does not have any problems like this. We really would like to upgrade to Sun Studio 12 because it's a much better compiler over all. We can't upgrade until we feel confident we have a workaround.
    Does anyone have any thoughts on what might be wrong or any ideas on what I can do to narrow down the problem?
    Thanks,
    Krister

    Many thanks. You've given me a few areas to focus on and I'll bring my house in order.
    The only external C++ library we depend on is STLport 5.0.2 which we compile ourselves. It's currently compiled with 5.3 on Solaris 8 and I will recompile it with 5.9 on Solaris 10. All other external libraries are C libraries. Our own code is put in static libraries and linked statically. I've read that exceptions thrown in shared libraries can be problematic.
    Your comment about complex conditional expressions (a ? f() : g()) is interesting. We've been bitten before by compiler bugs affecting those types of expressions. Destructors called twice or destructors called for temporaries never created. We may still have some conditional expressions like that.
    The exception is of type xmsg, defined this way:
    class xmsg
      public:
        xmsg(const char* s) : _msg(s) {}
        xmsg(const std::string& s) : _msg(s) {}
        const std::string& why() const { return _msg; }
      private:
        const std::string _msg;
    };There are three catch blocks involved and all the try/catch statement look like this:
    try
    catch(const xmsg& msg)
    }Here is a stack trace from dbx at the point where the exception is thrown the first time.
      [1] __exdbg_notify_of_throw(0xffbf4ae8, 0xffbf4ad0, 0x959b292c, 0xffff0000, 0x0, 0xfc00), at 0xfb6549b4
      [2] _ex_debug_handshake1(0x0, 0x101cb84, 0x1, 0x14ffc, 0xfb66a67c, 0xfb66ad38), at 0xfb655728
      [3] _ex_throw_body(0xfb66af80, 0x80b2ac, 0xfb66a67c, 0x14d9c, 0x0, 0xfb66af80), at 0xfb655934
      [4] __Crun::ex_throw(0xfb66afd0, 0x1460bf8, 0x7ead20, 0x0, 0x16538, 0x1), at 0xfb6558bc
    =>[5] TransportSource<User>::Activate(this = 0x1624810, r = CLASS, _ARG3 = CLASS), line 39 in "TransportSource.H"
      [6] Source<User>::DoActivate(this = 0x162486c, r = CLASS, e = CLASS), line 272 in "Factory.H"
      [7] BaseFactory::Load(this = 0x16020a8, e = CLASS), line 2799 in "BaseFactory.C"
      [8] GPAuthorizationSource::Load(this = 0x15d2440), line 110 in "GPAuthorization.C"
      [9] ExchangeServer::ExchangeServer(this = 0xffbfa95c, argc = 8, argv = 0xffbfbaec), line 380 in "exchangeServer.C"
      [10] main(argc = 8, argv = 0xffbfbaec), line 1525 in "exchangeServer.C"Here is the code for the Activate function in stack frame 5. The exception thrown is the second one.
        virtual T& Activate(const Reference& r, Exemplar<T>&)
          _transport->In().Write(r);
          DemarshallStream out;
          _transport->Method(Process::Activate, out);
          if(!out.Data())
         throw xmsg("Failed to call Activate on server " + _transport->Name());
          if(!out.GetBool())
         throw xmsg("Server returned error: " + out.GetString());
          const ClassHandle& h = out.GetClassHandle(&_connection);
          // don't need to pass refresh flag here because a call to Activate
          // means the object is being loaded for the first time.
          BaseExemplar* x = _handle.GetFactory().Demarshall(h, out, false,
         &_connection, this);
          BaseTransportSource::DoActivate(out);
          if(!x)
         throw xmsg("Failed to activate ref: " + r.ExternalValue());
          return static_cast<T&>(*x->GetInstance());
        }The exception is caught (frame 7 in the stack trace above) and re-thrown in the below code, at the last throw statement.
    void BaseFactory::Load(BaseExemplar& e)
      SourceMap::iterator p = _sources.find(&e._key->Type());
      if(p == _sources.end())
        throw xmsg("Factory<" + _handle.Name() + ">::Load - no source for: "
          + e._key->ExternalValue());
      AutoPointer<BaseGuard> g(Guard());
      std::list<BaseSource*>::iterator i = p->second.begin();
      while(true)
        try
          (*i)->_currentExemplar = &e;
          BO& x = (*i)->DoActivate(*e._key, e);
          (*i)->_currentExemplar = 0;
          if(!e._instance)
         e._instance = &x;
         Activate(e, ActivatedOld, 0);
          return;
        catch(const xmsg& msg)
          (*i)->_currentExemplar = 0;
          ++i;
          if(i == p->second.end())
         throw;
    }There is a second try/catch one level up (stack frame 8, the call to GPAuthorizationSource::Load). Here's a snippet of that piece of code.
        try
          const Exemplar<User>& user = UserFactory::Instance().CreateExemplar(
         *new UserReference(authorizationTable._login.Value()));
          *user;
        catch(const xmsg& msg)
          Logger::Instance() << LogHeader << MsgClass(MsgClass::Error)
         << "Error PMAutorizationSource: " << msg.why() << EndMsg;
        // ...I put a break-point in the catch block in the above code but I never hit the break point and the exception is caught in an outer try/catch, an error is printed and the program exits.
      try
      catch(const xmsg& msg)
        std::cerr << "ERROR: " << msg.why() << std::endl;
      }I'm sorry I have not yet been able to produce a smaller example that can be compiled and tested in isolation. I know that's important in order to track down the problem. It seems like the smallest change in seemingly unrelated parts of the code makes the problem come or go.

  • Calling PL/SQL procedure that returns boolean in java

    Hi All,
    Was not sure weather to post this on Java forum threads or PL/SQL forum threads. So posting at both locations.
    I have to call a PL/SQL procedure from java. This PL/SQL has IN/OUT parameters as well as return a Boolean value.
    The procedure definition is as follows:
    FUNCTION GET_NEXT(O_error_message IN OUT VARCHAR2,
    IO_item_no IN OUT ITEM_MASTER.ITEM%TYPE,
    I_item_type IN ITEM_MASTER.ITEM_NUMBER_TYPE%TYPE)
    return BOOLEAN;
    END ITEM_NUMBER_TYPE_SQL;
    And the java function I am using is as follows:
    This is in the ADF Application module impl code
    public String callNextItem(){
    CallableStatement callableStmt = null;
    String rmsUser = getDBTransaction().getConnectionMetadata().getUserName();
    String callableStatement = "begin ? := ITEM_NUMBER_TYPE_SQL.VALIDATE_FORMAT(?,?,?); end;";
    System.out.println("callableStatement "+callableStatement);
    try{
    callableStmt = getDBTransaction().createCallableStatement(callableStatement,0);
    callableStmt.registerOutParameter(1, Types.*BIT*);
    callableStmt.registerOutParameter(2, Types.VARCHAR);
    callableStmt.registerOutParameter(3, Types.VARCHAR);
    callableStmt.registerOutParameter(4, Types.VARCHAR);
    callableStmt.setBoolean(1, false);
    callableStmt.setString(2, "");
    callableStmt.setString(3, "");
    callableStmt.setString(4, "UPC-A");
    callableStmt.executeUpdate();
    System.out.println("STATUS : " + callableStmt.getString(3));
    System.out.println("ERROR : " + callableStmt.getString(2));
    String status = "";
    getDBTransaction().commit();
    System.out.println("commited ");
    callableStmt.close();
    return status;
    }catch(SQLException e){
    System.out.println("Error:" +e);
    throw new JboException(e);
    But this function never works. Throws "not valid expression type" error.
    I have called several PL/SQL procedures before, only difference being
    they never used to return any value. Particularly I feel the cause of the
    error is the Boolean type that is returned from the procedure.
    If you have any idea, please help.

    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html#34_05

  • Photoshop CC: Calling PIUGetInfoByIndex causes an exception when searching documents

    I have a function call in an automation plug-in that searches through the documents opened in Photoshop and attempts to get the name of each document (to compare it to a name that is passed in).  When this piece of code gets hit, if Photoshop has two documents open with the same name, a crash occurs when it tries to get the document information by index.  Below is the code, and I will highlight where the crash is occurring.  Note that this crash does not occur in Photoshop CS5 or Photoshop CS6.  This crash occurs in Photoshop CC regardless of the Photoshop SDK used to compile the plug-in (I tried with CS5 and CC).
    Apologies for the poor formatting.
    //Find the document index.
    int32 doc_index = -1;
    if (num_documents > 0)
      if(params.in_doc_name.length() > 0)
          string doc_name;
          char doc_name_holder[128];
          for (int32 doc_counter = 1; doc_counter <= num_documents && ! error; doc_counter++)
          GetDocumentName(doc_counter, doc_name_holder);
          doc_name = doc_name_holder;
          if(doc_name.find(params.in_doc_name) != std::string::npos)
          doc_index = doc_counter;
      else
          doc_index = num_documents;
      //If we didn't find the document to export in the document names, perform the export on the last document.
      if(doc_index == -1) doc_index = num_documents;
    //Gets the name of the document at the given index.
    SPErr GetDocumentName(int32 document_index, char* doc_name)
      PIActionDescriptor result;
      sPSActionDescriptor->Make(&result);
      SPErr error =
      PIUGetInfoByIndex( <--- from PIUGet.cpp
      document_index,
      classDocument,
      0,
      &result,
      NULL);
      error = sPSActionDescriptor->GetString(result, keyTitle, doc_name, 128);
      if(result) sPSActionDescriptor->Free(result);
      return error;
    <--- FROM PIUGet.cpp --->
    SPErr PIUGetInfoByIndex(uint32 index,
      DescriptorClassID desiredClass,
      DescriptorKeyID desiredKey,
      void * returnData,
      void * returnExtraData)
      SPErr error = kSPNoError;
        PIActionReference reference = NULL;
        PIActionDescriptor result = NULL;
      PIActionDescriptor * data;
      if (returnData == NULL)
      error = kSPBadParameterError;
      if (error) goto returnError;
      error = sPSActionReference->Make(&reference);
      if (error) goto returnError;
      if (desiredKey)
      error = sPSActionReference->PutProperty(reference,
      classProperty,
      desiredKey);
      if (error) goto returnError;
      error = sPSActionReference->PutIndex(reference,
      desiredClass,
      index);
      if (error) goto returnError;
      error = sPSActionControl->Get(&result, reference);   <----------------- CRASHES HERE
      if (error) goto returnError;
      if (desiredKey)
      error = PIUGetSingleItemFromDescriptor(result,
                                        desiredKey,
        returnData,
        returnExtraData);
      if (error) goto returnError;
      } else {
      data = (PIActionDescriptor *)returnData;
      *data = result;
      result = NULL;
    returnError:
      if (reference != NULL) sPSActionReference->Free(reference);
      if (result != NULL) sPSActionDescriptor->Free(result);
      return error;

    Hi Chris,
    I went to the official AMD website and updated it, and now it's working! Doing it through my control panel earlier didn't work.
    Thanks mate, that's a big help!

  • Runtime error in Visual C++ 2008 and 10.2.0.1.0 Express with getString()

    Hi,
    My configuration:
    Database: 10.2.0.1.0 Express
    Libs: OCCI 10.2.0.3.0 (patch 13) libraries for Microsoft Visual C++ 8
    IDE + Compiler: Visual C++ 2008 - 9.0.30729.1 SP
    I run into trouble with the following piece of code:
    stmt = con->createStatement("select 'XXXXXXXXXXXXXXXX' /* 16 */ from dual");
    res = stmt->executeQuery();
    res->next();
    std::string rs = res->getString(1); // <-- Causes a runtime error!
    The following code works fine:
    stmt = con->createStatement("select 'XXXXXXXXXXXXXXX' /* 15 */ from dual");
    res = stmt->executeQuery();
    res->next();
    std::string rs = res->getString(1);
    Obviously, the length of the selected string is an issue.
    Many thanks in advance.

    Hi,
    My configuration:
    Database: 10.2.0.1.0 Express
    Libs: OCCI 10.2.0.3.0 (patch 13) libraries for Microsoft Visual C++ 8
    IDE + Compiler: Visual C++ 2008 - 9.0.30729.1 SP
    I run into trouble with the following piece of code:
    stmt = con->createStatement("select 'XXXXXXXXXXXXXXXX' /* 16 */ from dual");
    res = stmt->executeQuery();
    res->next();
    std::string rs = res->getString(1); // <-- Causes a runtime error!
    The following code works fine:
    stmt = con->createStatement("select 'XXXXXXXXXXXXXXX' /* 15 */ from dual");
    res = stmt->executeQuery();
    res->next();
    std::string rs = res->getString(1);
    Obviously, the length of the selected string is an issue.
    Many thanks in advance.

  • OCCI-getString error

    The following is a small console program written with Visual C++
    6.0 sp 4.
    The program has a crash when it tries to destruct the
    string variable fodt in the while loop.
    Is this a known bug or is there an error in the code ?
    Bertil Reppen
    #include "stdafx.h"
    #include <iostream>
    //#include <string.h>
    #include <occi.h>
    using namespace std;
    using namespace oracle::occi;
    int main(int argc, char* argv[])
         const string username = "BERTIL";
         const string password = "REPPXX";
         const string url = "aoye.apintdom.no";
    Environment *env = Environment::createEnvironment (
    Environment::DEFAULT);
    try
              Connection *conn = env->createConnection
    (username, password, url);
              string sqlQuery = "SELECT pasientnr1,to_char
    (FODSELSDATO,'dd-mm-yyyy') FROM pasient_nr";
              Statement *stmt = conn->createStatement
    (sqlQuery);
              ResultSet *rs = stmt->executeQuery ();
              while (rs->next ())
                   long pasno = rs->getInt(1);
                   string fodt = rs->getString(2);
              stmt->closeResultSet (rs);
              conn->terminateStatement (stmt);
              env->terminateConnection (conn);
    catch (SQLException ea)
    cout << ea.what();
              catch (exception &excp)
         cout << excp.what() << endl;
    Environment::terminateEnvironment (env);
         return 0;

    Israel,
    Most of these errors do indeed arise from missing/wrong
    compilation flags/defines. Check out OCCI samples and
    the "make.bat" files in your %ORACLE_HOME%\rdbms\demo directory
    for the correct flags, includes, and libraries. Here is an
    example,
    :occimake
    cl -GX -DWIN32COMMON -I. -I%ORACLE_HOME%\oci\include -I. -D_DLL -
    D_MT %1.cpp /link /LIBPATH:%ORACLE_HOME%\oci\lib\msvc oci.lib
    msvcrt.lib msvcprt.lib oraocci9.lib /nod:libc
    Regards,
    Geoff
    the problem also occurs on VC 6.0 without any service pack.
    pay attention that the following expression:
    typeid(rs->getString(1)
    leads to a compiler internal error (getXXX other than string
    works just fine !!!).
    this, along with some other testings i've conducted might
    indicate that oraocci9.lib has been compiled with stl (or just
    string) which differs from the version supplied with msvc.
    it also can result from missing/wrong compilation flags/defines.
    i'm still working on this.
    if anyone finds the answer PLEASE contact me !!!
    regards,
    Israel Kalush

  • Oracle10.1.0 and gcc3.4.3 ,getString error

    environment:
    Red Hat Enterprise Linux AS release 4 (Nahant)
    Oracle Database 10g Enterprise Edition Release 10.1.0.3.0
    gcc3.4.3
    ORACLE_HOME = /u01/app/oracle/product/10.1.0/db_1
    compile command is:
    g++ -o a.out -I/u01/app/oracle/product/10.1.0/db_1/rdbms/public -L/u01/app/oracle/product/10.1.0/db_1/lib -L/u01/app/oracle/product/10.1.0/db_1/rdbms/lib/ -locci -lclntsh test.cpp
    I have a OCCI program test.cpp,
    if I use Oracle website's gcc3.2.3's lib,compile is ok,but when use ResultSet's getString, error:*** glibc detected *** double free or corruption (!prev): 0x083f5a98 ***
    but when changed to gcc3.4.3's lib, error:
    /u01/app/oracle/product/10.1.0/db_1/lib/libocci.so: undefined reference to `OCIClientVersion'
    /u01/app/oracle/product/10.1.0/db_1/lib/libocci.so: undefined reference to `OCILobArrayWrite'
    /u01/app/oracle/product/10.1.0/db_1/lib/libocci.so: undefined reference to `OCILobArrayRead'
    /u01/app/oracle/product/10.1.0/db_1/lib/libocci.so: undefined reference to `OCIPClearMxCtr'
    /u01/app/oracle/product/10.1.0/db_1/lib/libocci.so: undefined reference to `OCIPIsStmtSelectForUpdate'
    who can help me ?

    can you please refer this page and try again ?
    http://download-east.oracle.com/docs/cd/B19306_01/install.102/b15660/post_inst_task.htm#sthref939

  • I get this error help [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIStringBundle.GetStringFromName]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: XStringBundle :: getString :: line 17" data: no]

    [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIStringBundle.GetStringFromName]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: XStringBundle :: getString :: line 17" data: no] is the error I get whenever i open and change screens in Firefox

    Go under tools scroll down click on "options" click manage add-ons, near the top in that list will be Browser Defender toolbar, click on it then click "disable" and near the top will be a button to click to reboot--click that one.. Done.

  • Resultset.getString(). error

    I'm using Oracle 10g with jrockit 1.4.2_13.
    While looping through a cursor it blows up while executing resultset.getString().
    This code has been working for years and just blows up on a specific piece of data.
    The data it's trying to retrieve is .0548. Similar data is retrieved successfully.
    at oracle.sql.LnxLibThin.lnxnuc(LnxLibThin.java:6071)
    at oracle.sql.NUMBER.toText(NUMBER.java:2682)
    at oracle.jdbc.driver.NumberCommonAccessor.getString(NumberCommonAccessor.java:5303)
    at oracle.jdbc.driver.T4CNumberAccessor.getString(T4CNumberAccessor.java:83)
    at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:355)
    I've tried to upgrade to the latest ojdbc14.jar driver with negative results.
    Here is the code snippet:
    for(int i=1;i<=size;i++){
    str_columnName = (String)ht_elementMappings.get((i)+"");
    sbf_rowData.append("\t\t<"+str_columnName+">");
    //Blows up on the 18th column during the getString
    str_columnValue = rs_object.getString(i);
    sbf_rowData.append( str_columnValue );
    sbf_rowData.append("</"+str_columnName+">");
    sbf_rowData.append("\n");
    sbf_rowData.append("\t</ROW>");
    sbf_rowData.append("\n");
    bufferedWriter.write(sbf_rowData.toString());
    Thanks in advance for any thoughts.

    (1) and (3) are related to gcc versions to use with OCCI. OCCI 10.1 and 10.2 support gcc 3.2.3 (and gcc 2.96). In addition, OCCI 10.2 supports gcc 3.4.3 (libraries are available on OTN).
    2) For retreiving the column names in a ResutSet, you need to use the ResultSet::getColumnListMetaData() interface. You can implement your own solution to call ResultSet::getXXX methods by column name e.g :-
    vector<MetaData> md = rs->getColumnListMetaData();
    map<string, int> columns;//column names to number mapping
    for (int i = 0; i < md.size(); i++) columns[md[i].getString(MetaData::ATTR_NAME)] = i;
    //now "use" column names!
    string ename = rs->getString(columns["ENAME"));
    -Shankar

  • Java error [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIStringBundle.GetStringFromName]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: XStringBundle :: getString :: line 17" data: no]

    I am getting this Java error every time I open FireFox when it's not in safe mode.

    Go under tools scroll down click on "options" click manage add-ons, near the top in that list will be Browser Defender toolbar, click on it then click "disable" and near the top will be a button to click to reboot--click that one.. Done.

  • File not found error

    I get the following error, but don't know why it can't find the file. Is there anything in this script that would call "\" instead of "/"? Is there any line of code that will switch a wayward "\" back?
    01-09-24 09:37:02 - path="" :jsp: init
    2001-09-24 09:43:42 - path="" :LoginServlet: init
    2001-09-24 09:44:15 - path="" :CourseServlet: init
    2001-09-24 09:46:48 - path="" :LessonServlet: init
    2001-09-24 09:46:54 - path="" :Error: /usr/local/apache/sites/tesco.spinweb.net/htdocs/cmi/courses\Food Service/Intro/AU00.html (No such file or directory)
    The script is below. Thanks for any help anyone can provide me.
    import cmi.xml.AU;
    import cmi.xml.Block;
    import cmi.xml.CourseReader;
    import cmi.xml.CSFElement;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.PrintWriter;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.Enumeration;
    import java.util.Hashtable;
    import java.util.Vector;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpServlet;
    import org.jdom.JDOMException;
    public class LessonServlet extends HttpServlet
    public void init (ServletConfig config) throws ServletException
    super.init (config);
    try {
                   Class.forName (GlobalData.DatabaseDriverName);
                   _jdbcConnection = DriverManager.getConnection (GlobalData.DatabaseName, "tesco", "scorm");
    _jdbcConnection.setAutoCommit (true);
    //should I do this?
    //_jdbcConnection.setAutoCommit (false);
    //load serialized course data
    loadCourseData();
              catch (Exception xcp) {
                   xcp.printStackTrace();     
                   getServletContext().log("Error: " + xcp.getMessage());     
    public void doGet( HttpServletRequest request,
                             HttpServletResponse response)
              throws ServletException, IOException
    boolean normalMode = true;
    try {
    HttpSession session = request.getSession (true);
    //can I load the session given the id??
    //System.out.println ("Lesson.valid session " + session.getId() + ": " + request.isRequestedSessionIdValid());
    response.setContentType ("text/html");
    JDBCHelper dbHelper = new JDBCHelper (_jdbcConnection);
    //get student ID
    Integer studentID = (Integer) session.getAttribute ("studentID");
    //get course ID
    Integer courseID = (Integer) session.getAttribute ("courseID");
    //get lesson ID
    String lessonID = request.getParameter ("lessonID");
    if (lessonID == null) {
    lessonID = (String) session.getAttribute ("lessonID");
    if (studentID == null || courseID == null || lessonID == null) {
    //reset session data by re-logging the user
    sendProfileError (response.getOutputStream());
    return;
    //store lesson ID in session
    session.setAttribute ("lessonID", lessonID);
    String auID = request.getParameter ("auID");
    String mode = request.getParameter ("mode");
    if (mode != null) {
    session.setAttribute ("mode", mode);
    else {
    mode = (String) session.getAttribute ("mode");
    if (mode.equalsIgnoreCase ("review")) {
    normalMode = false;
    else {
    normalMode = true;
    //synchronize access to course hash table
    synchronized (_courseHash)
    //make sure _courseHash is in tact
    if (_courseHash == null) {
    //try reloading it....
    loadCourseData();
    if (_courseHash == null) {
    //error
    response.getOutputStream().close();
    throw new IOException ("Corrupt course data");
    if (! _courseHash.containsKey (courseID.toString())) {
    //try reloading it....
    loadCourseData();
    if (! _courseHash.containsKey (courseID.toString())) {
    //error
    response.getOutputStream().close();
    throw new IOException ("Corrupt course data (course not found)");
    if (auID == null) {
    //show course menu
    Hashtable hash = (Hashtable) _courseHash.get (courseID.toString());
    sendAvailableAUs (hash, studentID.intValue(), courseID.intValue(), lessonID, response.getOutputStream(), response, dbHelper);
    return;
    //if AU has not been attempted, initialize it
    Integer auDataID = new Integer (getAUDataID (studentID.intValue(), courseID.intValue(), lessonID, auID, dbHelper));
    //if (getAUDataID (studentID.intValue(), courseID.intValue(), lessonID, auID, dbHelper) == -1) {
    if (auDataID.intValue() == -1) {
    int newID = initializeAUData (studentID.intValue(), courseID.intValue(), lessonID, auID, dbHelper);
    dbHelper.addAUToPath (studentID.intValue(), courseID.intValue(), lessonID, auID);
    auDataID = new Integer (newID);
    session.setAttribute ("AUID", auID);
    session.setAttribute ("AUDataID", auDataID);
    sendAU (studentID.intValue(), courseID.intValue(), lessonID, auID, auDataID.intValue(), normalMode, response.getOutputStream(), dbHelper);
    //to do: detailed messages should be sent to the client depending on which
    // exception was thrown. Don't have one try/catch....have one for each situation
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    public void destroy()
              try {
                   if (_jdbcConnection != null) {
                        _jdbcConnection.close();
              catch (Exception ignored) {}
    private int initializeAUData (int studentID, int courseID, String lessonID, String auID, JDBCHelper dbHelper)
    String sqlQuery = null;
    ResultSet results = null;
    try {
    //get student's name
    sqlQuery = "SELECT Full_Name" +
    " FROM " + GlobalData.StudentTable +
    " WHERE Student_ID = " + studentID;
    results = dbHelper.doQuery (sqlQuery);
    if (! results.next()) {
    //error
    return -1;
    String studentName = results.getString (1);
    results.close();
    //the lock prevents CMIServlet from reading AU_ID before it's committed
    //sqlQuery = "LOCK TABLES " + GlobalData.AUDataTable + " WRITE;";
    //System.out.println (sqlQuery);
    //dbHelper.executeUpdate (sqlQuery);
    sqlQuery = "Insert Into " + GlobalData.AUDataTable +
    "(Course_ID, Lesson_ID, AU_ID, student_id, student_name, lesson_location, credit," +
    " lesson_status, entry, exit, score_raw, score_max, score_min, total_time," +
    " session_time, lesson_mode, suspend_data, launch_data, Evaluation_ID, Objective_ID)" +
    " Values (" + courseID + ", '" + lessonID + "', '" + auID + "', " + studentID + ", '" + studentName + "'," +
    " 'NA', 'credit'," + " 'not attempted', 'ab-initio', " + "'NA', " + 0 + ", " + 0 + ", " + 0 +
    ", '00:00:00.0', '00:00:00.0', " + " 'normal'" + ", 'NA', " + "'NA', " + 0 + ", " + 0 + ");";
    dbHelper.executeUpdate (sqlQuery);
    return getAUDataID (studentID, courseID, lessonID,auID, dbHelper);
    //sqlQuery = "UNLOCK TABLES;";
    //System.out.println (sqlQuery);
    //dbHelper.executeUpdate (sqlQuery);
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    return -1;
    private int getAUDataID (int studentID, int courseID, String lessonID, String auID, JDBCHelper dbHelper)
    throws SQLException
    String sqlQuery = "SELECT AUData_ID, lesson_status, lesson_mode, exit" +
                                  " FROM " + GlobalData.AUDataTable +
                                  " WHERE student_id = " + studentID +
                                  " AND Course_ID = " + courseID +
    " AND Lesson_ID = " + "'" + lessonID + "'" +
    " AND AU_ID = '" + auID + "';";
    ResultSet results = dbHelper.doQuery (sqlQuery);
    if (results.next()) {
    return results.getInt ("AUData_ID");
    return -1;
    private void sendAU (int studentID, int courseID, String lessonID, String auID, int auDataID, boolean normalMode, ServletOutputStream htmlOut, JDBCHelper dbHelper)
    throws IOException, ClassNotFoundException
    Hashtable hash = null;
    synchronized (_courseHash)
    hash = (Hashtable) _courseHash.get (String.valueOf (courseID));       
    if (hash == null) {
    loadCourseData();
    hash = (Hashtable) _courseHash.get (String.valueOf (courseID));
    if (hash == null) {
    throw new IOException ("Corrupt course data (course not found)");
    AU au = (AU) hash.get (auID);
    try {
    if (! normalMode) {
    dbHelper.setReviewMode (auDataID);
    String courseFileName = getFileName (String.valueOf (courseID), dbHelper);
    File file = new File (courseFileName);
    //create absolute path to file so we can resolve relative URLs
    String newFileName = file.getParent() + "\\" + au.getLaunchParams();
                   BufferedReader buf = new BufferedReader (new FileReader (newFileName));
    PrintWriter htmlWriter = new PrintWriter (htmlOut);
                   String temp;
    htmlWriter.write (getAUHtml (au.getLaunchParams()));
    htmlWriter.flush();
    htmlWriter.close();
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    private String getAUHtml (String path){
    path = path.replace ('\\','/');
    String response;
    response = "<html>\n" +
                        "<head>\n" +
    "</head>\n" +
    "<body>\n" +
    "<script language=\"JavaScript\">\n" +
    "document.location = \"/cmi/courses/" + path + "\"\n" +
    //"win = window.open ('','displayWindow','menubar=yes,scrollbars=yes,status=yes,width=300,height=300');\n" +
    //"window.onload = \"win.close();\"" +
    "</script>\n" +
    "</body>\n" +
    "</html>\n";
    return response;
    private void sendAvailableAUs (Hashtable hash, int studentID, int courseID, String lessonID, ServletOutputStream out, HttpServletResponse response, JDBCHelper dbHelper)
    StringBuffer buf = new StringBuffer (200);
    Block block = (Block) hash.get (lessonID);
    AU au = null;
    try {
    Vector completedAUs = dbHelper.getCompletedAUs (studentID, courseID, lessonID);
    buf.append ("<html>\n" +
                        "<head>\n" +
    "<title>" + block.getTitle() + " units</title>\n" +
    "<script language=\"JavaScript\">\n" +
    "function go() {\n" +
    " var form = document.goForm;\n" +
    " var index = form.gotoSelect.selectedIndex;\n" +
    " if (index == 0) {\n" +
    " document.location = \"/servlet/CourseServlet?courseID=" + courseID + "\";\n" +
    " }\n" +
    " else if (index == 1) {\n" +
    " top.restart();\n" +
    " }\n" +
    "}\n" +
    "</script>\n" +
    "</head>\n" +
    "<body background=\"/cmi/images/marble.jpg\">\n" +
    "<center><h1><b><u>" + block.getTitle() + "</u></b></h1></center>\n" +
    "<p></p>\n<p></p>\n" +
    "<b>" + block.getTitle() + " contains the following units: </b>\n" +
    "<dl>\n");
    Enumeration enum = block.getChildren();
    while (enum.hasMoreElements()) {
    String temp = (String) enum.nextElement();
    CSFElement element = (CSFElement) hash.get (temp);
    if (element.getType().equals ("au")) {
    au = (AU) element;
    if (completedAUs.contains (au.getID())) {
    buf.append ("<dt><p><img src=\"/cmi/images/node2.gif\"><a href=\"/servlet/LessonServlet?lessonID=" + block.getID() + "&auID=" + au.getID() + "&mode=review\">" + au.getTitle() + " (<i>review</i>) </a></p></dt>\n");
    else {
    buf.append ("<dt><p><img src=\"/cmi/images/node.gif\"><a href=\"" + response.encodeURL ("/servlet/LessonServlet?lessonID=" + block.getID() + "&auID=" + au.getID() + "&mode=normal") + "\">" + au.getTitle() + "</a></p></dt>\n");
    else if (element.getType().equals ("block")) {
    buf.append ("<dt><p><img src=\"/cmi/images/folder.gif\"><a href=\"" + response.encodeURL ("/servlet/LessonServlet?lessonID=" + element.getID() + "&mode=normal") + "\">" + element.getTitle() + "</a></p></dt>\n");
    buf.append ("</dl>\n" +
    "<br><br>\n" +
    "<form name=\"goForm\">\n" +
    "<select name=\"gotoSelect\">\n" +
    " <option value=\"lesson\">Lesson Menu</option>\n" +
    " <option value=\"exit\">Exit LMS</option>\n" +
    "</select>\n" +
    "<input type=\"button\" value=\"Go\" onClick=\"go()\">\n" +
    "</form>\n" +
    "</body>\n" +
    "</html>");
    PrintWriter writer = new PrintWriter (out);
    writer.write (buf.toString());
    writer.flush();
    writer.close();
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    private String getFileName (String courseID, JDBCHelper dbHelper)
    throws ClassNotFoundException, SQLException
              ResultSet results = null;
              String fileName = null;
    String sqlQuery = "SELECT CourseFile" +
                                  " FROM Course" +
                                  " WHERE Course_ID = " + Integer.parseInt (courseID) + ";";
    results = dbHelper.doQuery (sqlQuery);
              if (results.next()) {
                   fileName = results.getString (1);
              else {
    //need to do more than this :)
                   System.out.println("crap");
    results.close();
    return fileName;
    private void loadCourseData()
    throws IOException, ClassNotFoundException
    //load serialized course data
    File file = new File (GlobalData.DataFileName);
    if (! file.exists()) {
    //error
    throw new FileNotFoundException (GlobalData.DataFileName + " not found.");
    FileInputStream fis = new FileInputStream (GlobalData.DataFileName);
    ObjectInputStream ois = new ObjectInputStream (fis);
    _courseHash = (Hashtable) ois.readObject();
    ois.close();
    private void sendProfileError (ServletOutputStream out)
    String html = "<html>\n" +
    "<body>\n" +
    "<p>An error has occurred with your profile. Please " +
    "<a href=\"\" onClick=\"top.restart(); return true\">login again</a>" +
    "</body>\n" +
    "</html>\n";
    PrintWriter writer = new PrintWriter (out);
    writer.write (html);
    writer.flush();
    writer.close();
    private Connection _jdbcConnection;
    private Hashtable _courseHash;

    I know that is where my error is, but why and where is
    the script calling it up way?You wrote it right? check out the sendAU() method, there is line
    String newFileName = file.getParent() + "\\" + au.getLaunchParams();

  • Error while creating a section in bcc

    i have to create a section below promotions and coupons... foorepository..
    but i am getting an error when i when i select the subsection..
    15:39:40,314 INFO [STDOUT] [BlazeDS][ERROR] [Message.General] Exception when invoking service 'remoting-service': flex.messaging.MessageException: flex.messaging.MessageException: java.lang.NullPointerExcep
    incomingMessage: Flex Message (flex.messaging.messages.RemotingMessage)
    operation = drillDown
    clientId = CA84BCCD-E10C-521E-2803-99783445E2EB
    destination = /atg/remote/assetmanager/browse/service/BrowseService
    messageId = F504125F-54B5-D0F2-48C0-F1EE1F959682
    timestamp = 1361268580294
    timeToLive = 0
    body = null
    hdr(DSId) = CA849E7A-3509-FE43-3601-3DF11E009934
    hdr(DSEndpoint) = atg-amf
    Exception: flex.messaging.MessageException: flex.messaging.MessageException: java.lang.NullPointerException : null
    at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:225)
    at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1503)
    at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:884)
    at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121)
    at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
    at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
    at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
    at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146)
    at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:278)
    at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:322)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at atg.servlet.pipeline.TailPipelineServlet.service(TailPipelineServlet.java:161)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.servlet.pipeline.DispatcherPipelineServletImpl.service(DispatcherPipelineServletImpl.java:253)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.servlet.http.CookieBufferServlet.service(CookieBufferServlet.java:97)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.userprofiling.ExpiredPasswordServlet.service(ExpiredPasswordServlet.java:356)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.servlet.pipeline.MimeTyperPipelineServlet.service(MimeTyperPipelineServlet.java:206)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.droplet.DropletEventServlet.service(DropletEventServlet.java:565)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.epub.servlet.LocaleServlet.service(LocaleServlet.java:63)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.epub.servlet.ProjectServlet.service(ProjectServlet.java:87)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.epub.servlet.PublishingSecurityServlet.service(PublishingSecurityServlet.java:58)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.commerce.order.CommerceCommandServlet.service(CommerceCommandServlet.java:128)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.commerce.promotion.PromotionServlet.service(PromotionServlet.java:191)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.userprofiling.AccessControlServlet.service(AccessControlServlet.java:655)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.servlet.sessionsaver.SessionSaverServlet.service(SessionSaverServlet.java:2425)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.userprofiling.PageEventTriggerPipelineServlet.service(PageEventTriggerPipelineServlet.java:169)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.multisite.SiteSessionEventTriggerPipelineServlet.service(SiteSessionEventTriggerPipelineServlet.java:139)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.userprofiling.SessionEventTrigger.service(SessionEventTrigger.java:477)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.userprofiling.ProfilePropertyServlet.service(ProfilePropertyServlet.java:208)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.userprofiling.ProfileRequestServlet.service(ProfileRequestServlet.java:437)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.projects.store.servlet.pipeline.ProtocolSwitchServlet.service(ProtocolSwitchServlet.java:287)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.servlet.pipeline.CachePreventionServlet.service(CachePreventionServlet.java:119)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.servlet.pipeline.DynamoPipelineServlet.service(DynamoPipelineServlet.java:469)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.servlet.pipeline.URLArgumentPipelineServlet.service(URLArgumentPipelineServlet.java:280)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.servlet.pipeline.PathAuthenticationPipelineServlet.service(PathAuthenticationPipelineServlet.java:370)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.userprofiling.sso.PassportServlet.service(PassportServlet.java:554)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.servlet.security.ThreadUserBinderServlet.service(ThreadUserBinderServlet.java:91)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.dtm.TransactionPipelineServlet.service(TransactionPipelineServlet.java:212)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.multisite.SiteContextPipelineServlet.service(SiteContextPipelineServlet.java:302)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.servlet.pipeline.HeadPipelineServlet.passRequest(HeadPipelineServlet.java:1174)
    at atg.servlet.pipeline.HeadPipelineServlet.service(HeadPipelineServlet.java:857)
    at atg.servlet.pipeline.PipelineableServletImpl.service(PipelineableServletImpl.java:250)
    at atg.filter.dspjsp.PageFilter.doFilter(PageFilter.java:263)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: atg.flex.service.RemoteOperationException: flex.messaging.MessageException: java.lang.NullPointerException : null
    at atg.flex.messaging.services.TransactionalJavaAdapter.invoke(TransactionalJavaAdapter.java:157)
    at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
    ... 90 more
    Caused by: flex.messaging.MessageException: java.lang.NullPointerException : null
    at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:447)
    at atg.flex.messaging.services.TransactionalJavaAdapter.invoke(TransactionalJavaAdapter.java:140)
    ... 91 more
    Caused by: java.lang.NullPointerException
    at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
    at java.util.ResourceBundle.getString(ResourceBundle.java:334)
    at atg.core.i18n.SimpleI18NService.getString(SimpleI18NService.java:121)
    at atg.core.i18n.SimpleI18NService.format(SimpleI18NService.java:142)
    at atg.core.i18n.MultiBundleFormatter.format(MultiBundleFormatter.java:83)
    at atg.remote.assetmanager.browse.service.BrowseManager.createNodeStateForBrowseItem(BrowseManager.java:721)
    at atg.remote.assetmanager.browse.service.BrowseManager.getChildrenPage(BrowseManager.java:329)
    at atg.remote.assetmanager.browse.service.BrowseService.getChildren(BrowseService.java:583)
    at atg.remote.assetmanager.browse.service.BrowseService.getBrowseNavStateForContext(BrowseService.java:509)
    at atg.remote.assetmanager.browse.service.BrowseService.drillDown(BrowseService.java:265)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:421)
    ... 92 more
    plz help..!!

    It seems some issue with the resources that you have provided for item/attribute is coming as null. The actual exception is coming from ResourceBundle. I think the resource bundle you have given is coming as 'Null'.
    Cheers
    R

Maybe you are looking for