Using Chart Annotation Element

I have a rather strange issue which I just can't get my head around. Basically I have a function which looks like the below - This simply draws a box around half of the data canvas.
private function draw():void
                canvas.clear();
                canvas.beginFill(0x62dce1);
                var canvasWidth:Number = canvas.width;
                var canvasHeight:Number = canvas.height;
                var minPt:Array = canvas.localToData(new Point(0, 0));
                var maxPt:Array = canvas.localToData(new Point(canvasWidth/2,canvasHeight));
                canvas.drawRect(minPt[0]-1, maxPt[1], maxPt[0]-1, minPt[1]);
                canvas.endFill();
This works perfectly well when using data that is loaded locally - i.e. data that is stored within an array collection with the MXML file. However, the momeny I use a HTTP:Service to pull in the data, once the button is click to draw the rectangle - NOTHING appears on the data canvas.
Does anyone know why this might be happening? Im assuming its something to do with the data canvas updating as soon as the chart is loaded and isn't waiting for the asyncronose HTTP service?
Any ideas would be greatly appreciated.
Thanks
Full Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="getGoogleData.send()">
    <mx:Script>
        <![CDATA[
            import mx.events.FlexEvent;
            import mx.collections.ArrayCollection;
            import mx.containers.HBox;
              import mx.charts.LinearAxis;
              import mx.containers.Box;
            import mx.collections.ArrayCollection;
               import mx.charts.series.items.ColumnSeriesItem;
            import mx.charts.ChartItem;
            import mx.charts.chartClasses.CartesianCanvasValue;
            import mx.charts.chartClasses.CartesianTransform;
             [Bindable]
             public var profits:ArrayCollection = new ArrayCollection([
        {Month:1, Profit:1300},
        {Month:2, Profit:750},
        {Month:3, Profit:1100},
        {Month:4, Profit:1000},
        {Month:5, Profit:980},
        {Month:6, Profit:1500},
        {Month:7, Profit:2060},
        {Month:8, Profit:1700},
        {Month:9, Profit:1690},
        {Month:10, Profit:2200},
        {Month:11, Profit:2550},
        {Month:12, Profit:3000}
            [Bindable]
            private var summaryGoogleData:ArrayCollection = new ArrayCollection;
            [Bindable]
            public var folderLocation:String = "http://79.99.65.19/VISA/PHP";
            import mx.rpc.events.ResultEvent;
            private function recieveGoogleData(evt:ResultEvent):void
                var tmpArray:Object = new Object;
                tmpArray = evt.result.data.graphdata;
                for each (var o : Object in tmpArray)
                    if (o.pagepath == "/bbva")
                        summaryGoogleData.addItem(o);
                test.dataProvider = summaryGoogleData;
            public var drawnOnChart:Boolean = false;
            private function drawOnChart(evt:Event):void
                if (drawnOnChart == false)
                    var p:Point = canvas.dataToLocal(10,600);
                    if (isNaN(p.x) || isNaN(p.y))
                        trace ("Nan");
                    else
                        trace ("Not NaN");
                        var x:Number = p.x;
                          var y:Number = p.y;
                          //drawSquareBox();       
            //updateComplete="drawOnChart(event)"
             private function draw():void
                canvas.clear();
                canvas.beginFill(0x62dce1);
                var canvasWidth:Number = canvas.width;
                var canvasHeight:Number = canvas.height;
                var minPt:Array = canvas.localToData(new Point(0, 0));
                var maxPt:Array = canvas.localToData(new Point(canvasWidth/2,canvasHeight));
                canvas.drawRect(minPt[0]-1, maxPt[1], maxPt[0]-1, minPt[1]);
                canvas.endFill();
        ]]>
    </mx:Script>
    <!-- GET THE SUMMARY OF VISITS (GOOGLE) -->
    <mx:HTTPService id="getGoogleData" showBusyCursor="true" result="recieveGoogleData(event)" fault="getGoogleData.send()" method="GET" url="{folderLocation}/get_summaryGoogleData.php" useProxy="false"/>
    <mx:Legend dataProvider="{linechart1}" x="755" y="10"/>
    <mx:DataGrid x="357" y="315" id="test">
    </mx:DataGrid>
    <mx:Button x="52" y="323" label="Button" click="draw()"/>
    <mx:Panel x="10" y="10" width="830" height="265" layout="absolute">
        <mx:LineChart x="0" y="0" id="linechart1" height="222" width="800" dataProvider="{profits}">
            <mx:horizontalAxis>
                <mx:CategoryAxis categoryField="Month"/>
            </mx:horizontalAxis>
            <mx:series>
                <mx:LineSeries displayName="Series 1" yField="Profit"/>
            </mx:series>
            <mx:annotationElements>
                <mx:CartesianDataCanvas alpha=".25" id="canvas" includeInRanges="true"  />
            </mx:annotationElements>
        </mx:LineChart>
    </mx:Panel>
</mx:Application>

I have a rather strange issue which I just can't get my head around. Basically I have a function which looks like the below - This simply draws a box around half of the data canvas.
private function draw():void
                canvas.clear();
                canvas.beginFill(0x62dce1);
                var canvasWidth:Number = canvas.width;
                var canvasHeight:Number = canvas.height;
                var minPt:Array = canvas.localToData(new Point(0, 0));
                var maxPt:Array = canvas.localToData(new Point(canvasWidth/2,canvasHeight));
                canvas.drawRect(minPt[0]-1, maxPt[1], maxPt[0]-1, minPt[1]);
                canvas.endFill();
This works perfectly well when using data that is loaded locally - i.e. data that is stored within an array collection with the MXML file. However, the momeny I use a HTTP:Service to pull in the data, once the button is click to draw the rectangle - NOTHING appears on the data canvas.
Does anyone know why this might be happening? Im assuming its something to do with the data canvas updating as soon as the chart is loaded and isn't waiting for the asyncronose HTTP service?
Any ideas would be greatly appreciated.
Thanks
Full Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="getGoogleData.send()">
    <mx:Script>
        <![CDATA[
            import mx.events.FlexEvent;
            import mx.collections.ArrayCollection;
            import mx.containers.HBox;
              import mx.charts.LinearAxis;
              import mx.containers.Box;
            import mx.collections.ArrayCollection;
               import mx.charts.series.items.ColumnSeriesItem;
            import mx.charts.ChartItem;
            import mx.charts.chartClasses.CartesianCanvasValue;
            import mx.charts.chartClasses.CartesianTransform;
             [Bindable]
             public var profits:ArrayCollection = new ArrayCollection([
        {Month:1, Profit:1300},
        {Month:2, Profit:750},
        {Month:3, Profit:1100},
        {Month:4, Profit:1000},
        {Month:5, Profit:980},
        {Month:6, Profit:1500},
        {Month:7, Profit:2060},
        {Month:8, Profit:1700},
        {Month:9, Profit:1690},
        {Month:10, Profit:2200},
        {Month:11, Profit:2550},
        {Month:12, Profit:3000}
            [Bindable]
            private var summaryGoogleData:ArrayCollection = new ArrayCollection;
            [Bindable]
            public var folderLocation:String = "http://79.99.65.19/VISA/PHP";
            import mx.rpc.events.ResultEvent;
            private function recieveGoogleData(evt:ResultEvent):void
                var tmpArray:Object = new Object;
                tmpArray = evt.result.data.graphdata;
                for each (var o : Object in tmpArray)
                    if (o.pagepath == "/bbva")
                        summaryGoogleData.addItem(o);
                test.dataProvider = summaryGoogleData;
            public var drawnOnChart:Boolean = false;
            private function drawOnChart(evt:Event):void
                if (drawnOnChart == false)
                    var p:Point = canvas.dataToLocal(10,600);
                    if (isNaN(p.x) || isNaN(p.y))
                        trace ("Nan");
                    else
                        trace ("Not NaN");
                        var x:Number = p.x;
                          var y:Number = p.y;
                          //drawSquareBox();       
            //updateComplete="drawOnChart(event)"
             private function draw():void
                canvas.clear();
                canvas.beginFill(0x62dce1);
                var canvasWidth:Number = canvas.width;
                var canvasHeight:Number = canvas.height;
                var minPt:Array = canvas.localToData(new Point(0, 0));
                var maxPt:Array = canvas.localToData(new Point(canvasWidth/2,canvasHeight));
                canvas.drawRect(minPt[0]-1, maxPt[1], maxPt[0]-1, minPt[1]);
                canvas.endFill();
        ]]>
    </mx:Script>
    <!-- GET THE SUMMARY OF VISITS (GOOGLE) -->
    <mx:HTTPService id="getGoogleData" showBusyCursor="true" result="recieveGoogleData(event)" fault="getGoogleData.send()" method="GET" url="{folderLocation}/get_summaryGoogleData.php" useProxy="false"/>
    <mx:Legend dataProvider="{linechart1}" x="755" y="10"/>
    <mx:DataGrid x="357" y="315" id="test">
    </mx:DataGrid>
    <mx:Button x="52" y="323" label="Button" click="draw()"/>
    <mx:Panel x="10" y="10" width="830" height="265" layout="absolute">
        <mx:LineChart x="0" y="0" id="linechart1" height="222" width="800" dataProvider="{profits}">
            <mx:horizontalAxis>
                <mx:CategoryAxis categoryField="Month"/>
            </mx:horizontalAxis>
            <mx:series>
                <mx:LineSeries displayName="Series 1" yField="Profit"/>
            </mx:series>
            <mx:annotationElements>
                <mx:CartesianDataCanvas alpha=".25" id="canvas" includeInRanges="true"  />
            </mx:annotationElements>
        </mx:LineChart>
    </mx:Panel>
</mx:Application>

Similar Messages

  • WebI report on SAP Mobile BI for iOS that contains a chart with element linking issue

    Hi gurus. I have the following issue:
    I have element linking based filters on my chart # 1 to filter values on chart # 2.  It worked fine on Ipad. And it worked fine on BI Launch Pad.
    But after some time I check my webi report and it stopped working on IPAD.
    Filters are not shown on the graph.
    However it still works fine on BI LaunchPad
    Have you faced this issue before?
    Using: BI mobile 5.1.12
    Before, example:
    After some time, I opened sap mobile and it is not showing up the filter anymore
    Now: We upgraded to SAP Bi Mobile 6.0.8.12 but issue persists.
    Could you do the test?
    Steps to reproduce:
    Create a simple Webi report with a table.
    Copy that table and paste it to the report.
    Turn the original table into a column chart
    Add element linking from the chart to table. (When user filters on the chart it should change the table as well)
    Test that the element link works in BI LaunchPad.
    Save the report to the Mobile category and test on iPad.
    Open report on iPad
    Tap chart bars. Yellow filters, that are supposed to show up, are not displayed.

    Hi Erika,
    Is this report element linking defined as 'All Objects' or 'Single Object' in Webi.
    I ask this that report element linking on 'All Objects' is not supported yet. This support is expected to come in later releases.
    However, if this is single object then it should be working. Can you verify this on latest app store build and confirm. If still it does not work for you, then please raise a support ticket for the same.
    Regards,
    Ashutosh

  • I have been using Adobe Photoshop Elements 11 for two years. I got a new printer and installed it although I did not remove my old printer from my computer. I used this program and my new printer for quite a few months, but today I deleted my old printer

    I have been using Adobe Photoshop Elements 11 for along time now. When I first used the program I had a different printer than I have now. Although I changed printers I never removed the software from my old one. Now this was never a problem until today. When I choose a printer I still had option to use the old one but always chose my new HP Envy 5530 and Adobe never had a problem printing from that new printer. However today I decided to remove my old printer from my computer and now my Adobe cannot find my new printer.  How can I make it find the HP printer?

    Try this --
    Go to the bottom of the link I gave you, and you will see
    click that link and then click the chat button to talk to an Adobe agent

  • Report using charts not work on non-development machine

    Post Author: ftsoft
    CA Forum: .NET
    using visual studio report uses charts.  works fine on development machine when I move the web app to a test machine which does NOT contain visual studio, the chart report does not worknote: other reports which only display data records work fine. the space where the charts should be displayed contain the following two lines CrystalReportViewer - CrystalReportViewer1 Error: Fail to render the page.  any help would be appreciated

    Solution suggested worked for me. 
    On my test server Crystal was trying to use the c:\temp directory to write the temporary images, my report always ran ok on the test server.  On the live server CRW was running under with the ASPNET account and / or my own user account. 
    I ran FileMon and filtered on the aspnet_wp.exe process across both servers and ran the application up to the point of generating the issue.  The FileMon output from the test server showed no issues we as the output from FileMon off the live server showed an access denied message.
    I gave access right to the relevant accounts on the relevant folders on the live server and the report ran fine.

  • How to use the same element in different photoshop files?

    It occurs to me often that I use the same element in different photoshop files, a header or footer shown in the example below. So when the footer changes in one document, I need to change this footer in every other single document.
    Is there a possibility to use some kind of template, one single document,  that can be placed in different files , which is still editable afterwards?
    Thanks in advance.
    I'm using Photoshop CS6

    In a single document you can have several pages and these pages may have headers and footers that share smart objects.  If you replace the contents of the an embedded smart object on one page page that is shared on an other page the pages you will see both pages contents are changed. For they share the common object.   It is also possibly to have independent smart object layers. It depends how you create the layers in the single document.
    Example one sharing a smart object hi-light a smart object layer and use menu layer>Duplicate Layer... This will create a second smart object layer that share a common smart object. Each layer has is own associated transform. Do it again and you will have three layers the share a common smart object. So you can use each layer associated transform to position and size the layers contents. Make a picture package for example. When you hi-light any of the three smart layers and you use menu Layer>Smart Objects>Replace Contents... all three layers contents will be replace with the new smart object.  Care must be taken to replace the smart object with an identical size object for only the object is replaced the three associated transform for the three layers are not replaced or changed.
    Example two independent smart objects  hi-light a smart object layer and use menu layer>Smart Objects>New Smart Object via Copy.  This will  create a second smart object layer that has it own embedded smart object copy.  Do it again and you will have three all have independent embedded smart object that are identical.  However they do not have to remain identical.  For example if the first smart object layer was created by using ACR to open a RAW file as a smart object layer the embedded object is a copy of the raw file and its associated RAW conversion settings.  Double clicking on one of the smart object layers and you will see ACR open on its embedded RAW file with the embedded RAW conversion setting.  Changing these settings will update the layer smart object content with new ACR setting and pixel when you click OK in ACR. Repeat for the third and you will find you have three different raw conversions in Photoshop you can mask and blend together to bring out detail.
    I think what your missing is that a smart object contains a copy of the original object.  Changing the original after creating a smart object layer in document will not effect the smart object layer at all. Its independant from the original having a copy of the original. Only changes to the smart object layer and its embedded smart object effect smart object layers.

  • Error while using '*'in the NTE (EDI 850) Segment where '*' is also used as Data Element

    Hi All,
    I am facing below mentioned error while using '*'in the NTE (EDI 850) Segment where '*' is also used as Data Element
    Error: 1 (Field level error)
      SegmentID: NTE
      Position in TS: 70
      Data Element ID: NTE02
      Position in Segment: 2
      Data Value:
      3: Too many data elements
    For Eg: NTE*GEN*My Text *goes here
    Here, NTE02 should be My Text *goes here. So, how can I use "*" here without changing anything in the EDI message?
    Can it be done?
    Thanks.

    Sorry, no.
    X12 does not support an escape character so whatever is used for delimiters become reserved characters.
    If you want to allow '*' in the data, you will have to chooser a different Element delimiter.  The receiver should read the from this from the ISA Segment so it's supposed to be dynamic but that's not always the case in practice.

  • I have Ps CS4.  I run Apple OS X 10.9.5  on a new MacPro 3GHz 8-core Intel Xeon E5 - 64 GB.    I hardly ever use CS4 ( preferring Elements for my low level needs), but I now want to use it's function for stitching together a landscape.  I fire it up and g

    I have Ps CS4.  I run Apple OS X 10.9.5  on a new MacPro 3GHz 8-core Intel Xeon E5 - 64 GB.    I hardly ever use CS4 ( preferring Elements for my low level needs), but I now want to use it's function for stitching together a landscape.  I fire it up and get Error 150:30 with the suggestion to contact you  - hence this message

    I have Ps CS4.  I run Apple OS X 10.9.5  on a new MacPro 3GHz 8-core Intel Xeon E5 - 64 GB.    I hardly ever use CS4 ( preferring Elements for my low level needs), but I now want to use it's function for stitching together a landscape.  I fire it up and get Error 150:30 with the suggestion to contact you  - hence this message

  • Use of text elements in wirte_form function module.

    Hi guru's,
    Could any one tell me  what is the use of text elements in write_form functional module SAP SCRIPTS. As per my knowledge text elements are used for multi language purpose is there any other advantage other than that.
    Thanks in advance.
    Vardhan.

    Hello.
    A text element is a block in script that can be written several times in your document. You can put fixed texts, variables, include texts, images, etc etc
    When you see WRITE_FORM, element 'X', you know that everything that is inside element /E X of your script is writen. It's very usefful to organize your script, and it eases to construct a very complex script.
    It's also usefull to translations in SE63.
    Best regards.
    Valter Oliveira.
    Edited by: Valter Oliveira on May 27, 2008 10:05 AM

  • Use of text element in function module

    hi friends what is the use of text element i.e list headings, selection texts,text symbols in a function module. where a can see these things after giving some text into it and activated.
                                        kumar.

    hi
    <b>Text Symbols</b>
    A text symbol is a named data object that is generated when you start the program from the texts in the text pool of the ABAP program. It always has the data type c. Its field length is that of the text in the text pool.
    Text symbols, along with the program title, list headings, and selection texts, belong to the text elements of a program. Text elements allow you to create language-independent programs. Any text that the program sends to the screen can be stored as a text element in a text pool. Different text pools can be created for different languages. When a text element is changed or translated, there is no need to change the actual program code. Text elements in an ABAP program are stored in the ABAP Editor (see Text Element Maintenance).
    In the text pool, each text symbol is identified by a three-character ID. Text symbols have a content, an occupied length, and a maximum length.
    Examples for text symbols in an ABAP program:
    ID
    Contents
    Occupied length
    Maximum length
    010
    Text symbol 010
    15
    132
    030
    Text symbol 030
    15
    100
    AAA
    Text symbol AAA
    15
    15
    In the program, you can address text symbols using the following form:
    text-###
    This data object contains the text of the text symbol with ID ### in the logon language of the user. Its field length is the same as the maximum length of the text symbol. Unfilled characters are filled up with spaces. You can address text symbols anywhere in a program where it is also possible to address a variable.
    If there is no text symbol ### in the text pool for the logon language, the name text-### addresses the predefined data object space instead.
    You can also address text symbols as follows:
    ... 'textliteral'(###) ...
    If the text symbol ### exists in the text pool for the logon language, this is the same as using text-###. Otherwise, the literal 'textliteral' is used as the contents of the text symbol. This is only possible at positions in the program where a variable can occur. You can create a text symbol for any text literal by double-clicking the literal in the ABAP Editor and replacing the literal with the text symbol.
    You should use text symbols in your program whenever they need to be language-specific - for example, in a WRITEstatement.
    If you program a list whose layout depends on field lengths, you should be careful, since the field length of text symbols will be different in different languages. You should therefore set the maximum field length of the field symbol so that there is enough space to translate it into other languages. For example, the English word 'program' has seven letters, but its equivalent German translation 'Programm' has eight.
    The following example shows the use of text symbols in WRITE statements.
    SET BLANK LINES ON.
    WRITE:   text-010,
           / text-aaa,
           / text-020,
           / 'Default Text 030'(030),
           / 'Default Text 040'(040).
    If the text symbols of the above screen shots are linked to this program, the output looks as follows:
    Text symbols 020 and 040 have no text symbols. For text symbol 020, the system displays a space. This is only displayed in this case because the blank line suppression has been turned off (see Creating Blank Lines).
    regards
    ravish
    <b>plz reward if helpful</b>

  • I use Adobe Photoshop Elements and Adobe Bridge. Do these come in a package together?

    I'm going to update my current set up. I use Adobe Photoshop Elements and Adobe Bridge. Do these come in a package together? What would be the best way to go about this upgrade?

    Bridge comes with Photoshop but not with Elements.

  • Using Adobe Photoshop Elements installed on another volume

    I am using Photoshop Elements 6 on a Mac computer running OS 10.9.
    I am working on a video project that will not open in OS 10.9. My hard drive is partitioned to include an older Mac OS (OS 10.6) which I boot into when working on the project. This procedure works fine until I need to use Adobe Photoshop Elements to make changes to still photos within the project. The problem is that the Photoshop Elements application that exists within my main hard drive boot volume will not run within the OS 10.6 volume, even though it previously did when OS 10.6 was the current OS.
    I get an error message that states that “Licensing for this product has stopped working.” and it says that I need to reinstall the product. For various reasons, I don’t wish to install Photoshop on two separate volumes of the same physical hard drive. There must be a way to make the same application work with both volumes, just as most other applications do. Is there a way to do this?

    Here are some excerpts from this web page:
    http://ask.metafilter.com/194687/Unix-vs-Apple-OS
    Apple's operating system, which is to say Mac OS X, is actually a specific implementation of UNIX. "UNIX" is a trademark owned by The Open Group, who controls who gets to apply it to their products, based on whether they meet certain requirements (the Single UNIX Specification). Apple got Mac OS X certified a few years ago, meaning that it is actually a UNIX implementation.
    Linux, interestingly, isn't a UNIX because it's never been certified by The Open Group and differs in some technical ways from the Single Unix Specification. But from a purely functional standpoint, using a Linux distro probably feels more like a traditional UNIX environment than Mac OS X, mostly because Linux uses XWindows/Xorg in its GUI layer in common with traditional UNIX environments, while Mac OS X has a proprietary GUI (Aqua).

  • Can we use xsl:param element in XSLT mapping...?

    Hi Guys
    Can we use <xsl:param> element in XSLT mapping in XI..?
    Is there any documentation out there for XSLT mapping?
    Thanking in advance

    Hi,
    Check this link for an example:
    https://www.sdn.sap.com/sdn/url.sdn?res=/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/6c514a4f-0501-0010-038c-994da5200215
    Regards,
    Sridhar

  • Hi.  I have just started using Adobe Photo Elements 11 and Adobe Premiere Elements 11.  I have many pictures in my photo gallery that I would like to use for a project that I am working on.  I opened my photo gallery and it indicated that I could not use

    Hi.  I have just started using Adobe Photo Elements 11 and Adobe Premiere Elements 11.  I have many pictures in my photo gallery that I would like to use in a project that I am working on.  When I opened the photo gallery it said I could not use the photo gallery because it has not been updated.  Can someone please help me with this...let me know how to do this...or...Thank you,

    BNN, even though I understand what KT is saying, your thought resonates with mine. When it comes to building and maintaining my website, I see myself more as a photographer than as a web designer. Hence, even though Apple may not be actively developing (and we are guessing on this one, arent we) iWeb, the existing functionality should do plenty of good to me for next couple years at least.
    That said, they released a point update a few days back and with the whole cloud thing building momentum and mobile me going for free, why would Apple want to pull the plug on such a fantastic product?

  • Can I use Adobe Photoshop Element 11 to manage my photos rather than iPhoto?

    What are the problems, if any, with by passing iPhoto and using Adobe Photoshop Elements 11?

    Are you referring to actually managing the image files with the Adobe Elements 11 organizer as well as editing the photos or just use PSE 11 to edit the photos? 
    The latter is easy.  The former would have you abandon iPhoto, move you photos out of it to folders and then manage the folders and their contents.
    What exactly are you wantng to do:  manage and edit or just edit.
    By the way the file management capability of PSE is far less capable than the photo managementcapability of iPhoto which is a DAM (digital asset management) application.
    OT

  • Message-Driven Bean using @Resource annotation

    I am trying to run a Message-Driven Bean very simple example in https://glassfish.dev.java.net/javaee5/ejb/examples/MDB.html
    I configured MDBQueueConnectionFactory and MDBQueue properly on glassfish admin console.
    I cannot run the example using @Resource annotation. I don't understand why.
    @Resource(mappedName="MDBQueueConnectionFactory")
    private static QueueConnectionFactory queueCF;
    @Resource(mappedName="MDBQueue")
    private static Queue mdbQueue;But I can run this example modifying the source code using InitialContext instance and looking up for JMS Resources.
    InitialContext ctx = new InitialContext();
    QueueConnectionFactory queueCF=(QueueConnectionFactory)ctx.lookup("MDBQueueConnectionFactory");
    QueueConnection queueCon = queueCF.createQueueConnection();
    Queue mdbQueue=(Queue)ctx.lookup("MDB");
    queueSender.send(mdbQueue, msg);
    ...I want to figure out why @Resource annotation do not work well. Any help?
    Thanks in advanced any help.

    Thanks for your reply.
    The error that I get is a simple NullPointerException. Nothing else.
    Like you said, I develop a servlet and I can use @Resource annotation without static reference, and it works.
    public class TestMDB extends HttpServlet {
         private static final long serialVersionUID = 1L;
         @Resource(mappedName="MDBQueueConnectionFactory")
         private QueueConnectionFactory queueCF;
         @Resource(mappedName="MDB")
         private Queue mdbQueue;
         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              PrintWriter out = response.getWriter();
              out.println("TEST MDB "+queueCF);
              QueueConnection queueCon;
              try {
                   queueCon = queueCF.createQueueConnection();
                   QueueSession queueSession = queueCon.createQueueSession
                   (false, Session.AUTO_ACKNOWLEDGE);
                   QueueSender queueSender = queueSession.createSender(null);
                   TextMessage msg = queueSession.createTextMessage("hello");
                   queueSender.send(mdbQueue, msg);
                   out.println("Sent message to MDB");
                   queueCon.close();
              } catch (JMSException e) {
                   e.printStackTrace();
    }But my question were about using @Resource annotation on a standalone client. I always get NullPointerException.
    public class MDBClient {
        @Resource(mappedName="MDBQueueConnectionFactory")
        private static QueueConnectionFactory queueCF;
        @Resource(mappedName="MDB")
        private static Queue mdbQueue;
        public static void main(String args[]) {
         try {
                QueueConnection queueCon = queueCF.createQueueConnection();
                QueueSession queueSession = queueCon.createQueueSession
                    (false, Session.AUTO_ACKNOWLEDGE);
                QueueSender queueSender = queueSession.createSender(null);
                TextMessage msg = queueSession.createTextMessage("hello");
                queueSender.send(mdbQueue, msg);
                System.out.println("Sent message to MDB");
                queueCon.close();
            } catch(Exception e) {
                e.printStackTrace();
    }

Maybe you are looking for

  • Adding music

    i think i deleted a smart playlist, and now it wont let me add music. every time i go to sync songs, a window pops up that says "songs in the ipod cannot be synced because all of the playlists selected for syncing have been deleted." help!!!

  • Do I need a new airport or antennae or booster? advice please

    I have an old airport graphite base station in my house. I want to send the signal to an outbuilding with no phone socket, to be picked up by my old titanium powerbook with an airport card, a Mac G4, and a PC, both of which will also need wireless ca

  • Customer Statement of Account

    Dear All, What is the T-code for Customer Statement of Account. (Required for period i.e. From 1/04/2007 to 31/3/2008). Regards, Srikanthraj

  • Friends macbook won't boot

    My friend got his macbook 2.0GHZ from this guy 6 months ago, now he told me one night it won't boot. It has sign it's working by the indicator while asleep. I am thinking it's the logic board, what else could it be? Can a mac not work if it's HD is f

  • Hosting suggestions

    hey all, i have just finished a site using dw cs3. i have a domain purchased through godaddy and planned on using them for hosting. this is my first website and i was looking for some suggestions/warnings/recommendations when uploading a site to a se