Simple custom class issue

So this doesn't make sense. Here is my class....
package com.test.util;
public class locationGen {
String loc;
public String location(String department)
if (department == "D22")
loc = "New York";
if (department == "D33")
loc = "Chicago";
if (department == "D44")
loc = "Seattle";
return loc;
Here is my xpress
<set name='myclass'>
<new class='com.test.util.locationGen'/>
</set>
<set name='user.global.location'>
<invoke name='location'>
<ref>myclass</ref>
<ref>user.global.department</ref>
</invoke>
</set>
Yet location is null. I set department to D33 earlier in the workflow. Help!

So I think it was the way I was comparing strings. I even got fancy and explored different ways to do compares Here is what my final class looks like...
package com.test.util;
public class locationGen {
     String deptLocation;
     public String location(String department)
if (department.equalsIgnoreCase("D22"))
deptLocation = "New York";
if (department.equalsIgnoreCase("D33"))
deptLocation = "Chicago";
if (department.equalsIgnoreCase("D44"))
deptLocation = "Seattle";
return deptLocation;
Here is what it looks like calling it in xpress....
<set name='user.global.location'>
<invoke name='location'>
<new class='com.test.util.locationGen'/>
<ref>user.global.department</ref>
</invoke>
</set>
INFO:
<ref>user.global.department</ref>
INFO: --> D22
INFO:
</invoke> --> New York
Thanks all, this thread helped my understanding a lot.

Similar Messages

  • Arrays within custom Classes - same array for different instances?

    Hello all,
    I have made a very simple custom class for keeping track of groups of offices for a company.  The class has a Number variable to tell it how many different offices there are, and an Array to store the individual offices by name.  It looks like this.
    class officeCluster
        static var _className:String = "officeCluster";
        // variables
        var numOffices:Number;
        var locationArray:Array = new Array();
        // functions
        function officeCluster()
            trace("officeCluster constructor");
    Very simple!
    Now, it is my understand that when I create different instances of the class, they will each have their own version of "numOffices" and their own version of "locationArray".
    When I run traces of "numOffices", this seems to be true.  For example,
    trace(manufacturingOfficeCluster.numOffices);
    trace(servicesOfficeCluster.numOffices);
    yields
    5
    4
    In the output panel, which is correct.  However, there is trouble with the locationArray.  It seems that as I assign different values to it, regardless of what instance I specify, there is only ONE array- NOT one for each instance.
    In other words,
    trace(manufacturingOfficeCluster.locationArray[1].theLocation);   // theLocation is a String.  The locationArray itself holds Objects.
    trace(servicesOfficeCluster.locationArray[1].theLocation);
    yields
    New Haven, CT
    New Haven, CT
    even though I have defined elsewhere that they are different!
    Is anyone aware of any issues partaining to using Arrays within Class instances?  Any help would be appreciated!
    note:  I've been able to work around this by creating multiple arrays within the class and using a different one for each instance, but this seems very sloppy.

    Unfortunately, the code segment you attached results in:
    12
    12
    in the output panel.   So the problem must lie elsewhere!  Let me give some more detail...
    There are several files involved. The "officeCluster" class file looks like this:
    class officeCluster
         static var _className:String = "officeCluster";
         // variables
         var numOffices:Number;
         var locationArray:Array = new Array();
         // functions
         function officeCluster()
            trace("officeCluster constructor");
    I have two actionscript files which contain object data for the individual offices.  They look like this...
    var servicesOfficeCluster = new officeCluster();
    servicesOfficeCluster.numOffices = 4;
    var newHope:Object = new Object();
    newHope.locationName = "New Hope Office";
    newHope.theLocation = "New Hope, NJ";
    //more data
    servicesOfficeCluster.locationArray[0] = newHope; //array index is incremented with each entry
    //more Objects...
    and like this...
    var manufacturingOfficeCluster = new officeCluster();
    manufacturingOfficeCluster.numOffices = 5;
    var hartford:Object = new Object();
    hartford.locationName = "Hartford Office";
    hartford.theLocation = "Hartford, CT";
    //more data
    manufacturingOfficeCluster.locationArray[0] = hartford; //array index is incremented with each entry
    //more Objects...
    As you can see, the only difference is the name of the officeCluster instance, and of course the Object data itself.  Finally, these are all used by the main file, which looks like this- I have commented out all the code except for our little test -
    import officeCluster;
    #include "manufacturingList.as"
    #include "servicesList.as"
    /*lots of commented code*/
    manufacturingOfficeCluster.locationArray[1].theLocation = "l1";
    servicesOfficeCluster.locationArray[1].theLocation = "l2";
    trace(manufacturingOfficeCluster.locationArray[1].theLocation);
    trace(servicesOfficeCluster.locationArray[1].theLocation);
    Which, unfortunately, still yields
    12
    12
    as output :\  Any ideas?  Is there something wrong with the way I have set up the class file?  Something wrong in the two AS files?  I'm really starting to bang my head against the wall with this one.
    Thanks

  • Unicode issue for custom CLASS

    Hi Experts,
    we have a custom CLASS 'Z_ADD_INN_SALES' as part of unicode conversion i have corrected all the unicode compliants found in the UCCHECK transaction associated with the CLASS and also marked unicode check in the properties of the class. But still it is saying it is not compatible for unicode. I am not able to activate the object because of this error. Kindly let me know whether i need to do any thing else which i have missed for unicode check.
    Regards,
    Ram

    Hello Ram
    Apparently there is a coding-related Unicode error in the class. Check it with UCCHECK and analyze the error message.
    For more details refer to:
    [ABAP and Unicode|http://help.sap.com/saphelp_nw04/helpdata/en/62/3f2cadb35311d5993800508b6b8b11/content.htm]
    Regards
      Uwe

  • Securing Web Services based on simple Java Classes

    Hi @all!
    We`ve got the following problem.
    There`s a .NET client calling our Web services deployed on Bea Weblogic 8.1 (without
    SP).
    The Web Services are generated by the ANT task servicegen. They are based on simple
    Java classes containing the service methods as public members.
    Is there a possibility to secure these methods without using the console menu
    item "Define Security Policy" ?
    We can`t use this menu because it has got a javascript bug with methods returning
    an array.
    Thanks in advance for help.
    Michael

    Hi Michael,
    Could you use transport level security, SSL [1]?
    I'm not sure what limitation you are experiencing with the console? Is
    there a traceback? Have you contacted customer support on this issue?
    Thanks,
    Bruce
    [1]
    http://edocs.bea.com/wls/docs81/webserv/security.html#1053203
    Michael Albrecht wrote:
    >
    Hi @all!
    We`ve got the following problem.
    There`s a .NET client calling our Web services deployed on Bea Weblogic 8.1 (without
    SP).
    The Web Services are generated by the ANT task servicegen. They are based on simple
    Java classes containing the service methods as public members.
    Is there a possibility to secure these methods without using the console menu
    item "Define Security Policy" ?
    We can`t use this menu because it has got a javascript bug with methods returning
    an array.
    Thanks in advance for help.
    Michael

  • Customer Service Issue

    I just finished speaking with your customer service department and have found myself MORE frustrated then when I called.  I have been a LONG standing Verizon customer (longer then the 2003 that I was told) and have always spoken quite highly about your services until now.
    Approximately three months ago we called to upgrade our home internet service and that started the frustration with your teams.  We were told that the service would be an additional $10 per month and we would see that charge after six months.  The first month the bill was wrong. We called and in theory it was straightened out.  We had to call the following month and again were told it was straightened out.  Month three I notice that my bill is astronomical and I call.  Yup straw that broke the camels back.  I call in and explain my frustrations with the first issues and now this HUGE overage in my cell phone bill.  I explain that when I took the phones I was told ANY Verizon phone was free; I was IMMEDIATELY corrected that Verizon land lines were never the case.  Well Verizon that has been your policy however a customers knowledge is usually what the person they signed up with has led them to believe.  If you review the bills you will see that the usage has gone up considerably.  So clearly this was only brought to my attention today since I was under the impression that the increase in my bills was due to the computer line.  Absolutely, my bad for not thoroughly reading the statements and it is my responsibility to review my statements.  Since the bills rarely fluctuate I am among the legions that don't review it. 
    This morning I went on line when I noticed that I received my bill and gasped.  How could my bill be so much?  It became clear to me when I reviewed it what the problem was.  I asked myself why didn't I receive a call from the company that I have bragged about for their outstanding service to say we noticed your habits have changed and we wanted to review your account with you?  Most companies do this....I work for a bank and we call our customers on a daily basis to touch base with those that have been flagged as changes in their normal habits.......wouldn't my cell phone company do this?
    So the first person that I spoke to kept quoting policy when I explained what I was looking for; I told her I was a long standing Verizon customer.  I was frustrated with the bill I just opened since I was under the impression from when I took the phones that Verizon to Verizon (including land lines) were part of the package and I thought my bill was ridiculous and I was looking to change plans and see if there was anything Verizon could do to help me.  While I am sure that the representative was not aware of how she was addressing me I felt as though I was an uneducated individual; policy, policy, policy.  I completely understand that every company has policies and procedures, I am completely aware that I have a responsibility to review my bill on a monthly basis but she truly inflamed me.  Does not the $325 dollars a month that I pay for land line, computer service and cell phones mean anything to Verizon?  Nope. 
    I asked to speak with a supervisor since I did not want to take my frustrations out on this service representative and I explained this to her.  I told her that while I was positive that she didn't realize it she made me feel as though I was being spoke down to and I didn't appreciate it.  Since I work in a highly regulated industry also (banking) I understand that ALL companies have policies but the truth in the matter was that no one cares to hear that word or not feel as though they've been heard.  I asked to speak with a supervisor.
    Audra was the supervisor that came on the line.  I explained to her my frustrations, said I was looking to see what could be done for again here was the litany of my frustrations.  I was told that the POLICY was she could give me $90 towards this overage but Verizon never allowed land lines to be included in their service.  Again I know that now and probably should have known it then and moving forward I'll be sure to ask so many questions that I have the person selling me the service wondering if the sale is really worth it.  I voiced my annoyance (I am annoyed) about policy and the $90; it's truly not the $90 it's how the word policy keeps creeping into the conversation.  It's as though that word can be used as a "shield" to stop a customer's annoyance; it doesn't.  I then asked for the termination without penalty; well if I'm terminating then as a matter of policy she would not give me the $90 credit.  Do you see where this is getting worse? 
    I then ask for the address to write a formal complaint to and the phone number; as a matter of policy you don't give it out?  Seriously, okay.  I then inform Audra that I will be contacting the FCC to file this complaint also; looking back customer service or the poor service truly isn't in their realm but not giving an address to your own company?  It's a matter of your policy? 
    I move along to the upgrade in my service and taking the $90 credit since I have two early termination fees; I'm all set.  I do need to go on line and register the 10 phone numbers that I want for friends and family.  I find this strange; you know which numbers I call most frequently; suggestion - with all of the technology that's out there I would think you could do an analysis and send an email to the users about this and ask if this works for them.  Simple customer service. 
    I say that given the size of the bill I would like to make  arrangements to pay this over two months; I'm told I'll have to call that number.  Really she couldn't transfer me? 
    So Verizon, we all know that a dissatisfied customer tells 10 people before there was internet and social networking sites.  I'd love a phone call to discuss this message so please feel free to contact me.
    Sincerely,
    Unhappy customer

    I am totally guessing that you were calling a VZ landline thinking it was ok to call and not be billed. The literature is very clear it is Mobile 2 mobile or Verizon wireless customers to Verizon wireless customers that you can call without using minutes.
    As for Friends and Family. Be happy they are letting you have numbers to call for free. There is no need for them to give you the information. Lets say you have a family plan and they choose all your teenage kids friends and not anyone you want.

  • How to  get the profile object in simple java class  (Property accessor)

    Hi All,
    Please guide me how to get the profile object in simple java class (Property accessor) which is extending the RepositoryPropertyDescriptor.
    I have one requirement where i need the profile object i.e i have store id which is tied to profile .so i need the profile object in the property accessor of the SKU item descriptor property, which is extending RepositoryPropertyDescriptor.
    a.I dont have request object also to do request.resolvename.
    b.It is not a component to create setter and getter.It is simple java class which is extending the RepositoryPropertyDescriptor.
    Advance Thanks.

    Iam afraid you might run into synchronization issues with it. You are trying to get/set value of property of a sku repository item that is shared across various profiles.
    Say one profile A called setPropertyValue("propertyName", value).Now another profile B accesses
    getPropertyValue() {
    super.getPropertyValue() // Chance of getting value set by Profile A.
    // Perform logic
    There is a chance that profile B getting the value set by Profile A and hence inconsistency.
    How about doing this way??
    Create PropertyDescriptor in Profile (i.e user item descriptor), pass the attribute CustomCatalogTools in userProfile.xml to that property.
    <attribute name="catalogTools" value="atg.commerce.catalog.CustomCatalogTools"/>
    getPropertyValue()
    //You have Profile item descriptor and also storeId property value.
    // Use CustomCatalogTools.findSku();
    // Use storeId, profile repository item, sku repository item to perform the logic
    Here user itemdescriptor getPropertyValue/setPropertyValue is always called by same profile and there is consistency.
    -karthik

  • Accessing custom classes from JSP

    Hi Guys,
    I am having some problems accessing my custom classes from my JSP.
    1) I've created a very simple class, SimpleCountingBean that just has accessors for an int. The class is in the package "SimpleCountingBean". I compiled this class locally on my laptop and uploaded the *.class file to my ISP.
    2) I've checked my classpath and yes, the file "SimpleCountingBean/SimpleCountingBean.class" is located off of one of the directories listed in the classpath.
    3) When I attempt to use this class in my JSP, via the following import statement:
    import "SimpleCountingBean.*"
    I get the following compile error
    java.lang.NoClassDefFoundError: SimpleCountingBean/SimpleCountingBean
    I'm pretty sure that my classpath is properly setup because when I purposely garble the import statement, I get the "package not found" compile error.
    Do I need to upload some other files in addition to the class file? Any suggestions would of course be appreciated.
    Sonny.

    Trying to get some clearer view.. so don't mind..
    So you uploaded all your .jsp files into your account which is:
    home/sonny
    and it compiles and work. But custom classes doesn't seems to be working, where did you place your classes?
    From my knowledge of tomcat, classes are normally placed in, in this case:
    home/sonny/web-inf/classes
    Maybe it differs from windows enviroment to *nix enviroment.. well, I'm just saying out so if its not the case.. don't mind me.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to access MC's textfield created in a custom class?

    I have a custom class which creates a new MC using a library MC. The  library MC contains a dynamic textfield called productName.
    The custom class object gets created fine and is displaying on the  stage. It's also holding custom properties I set as well.
    How do I control the dynamic textfield inside the MC, which is inside  the custom class object?
    My Product.as:
    package {
         import flash.display.MovieClip;
         public class Product extends MovieClip {
             public var prodName:String;
             public var prodCategory:String;
             public var prodQuality:String;
             public function Product():void {
                 var productMC:MovieClip = new cellMC();
                 addChild(productMC);
    My .FLA first frame:
    var myProd1:Product = new Product();
    myProd1.prodCategory = "Heaters";
    myProd1.x = 150;
    myProd1.y = 140;
    addChild(myProd1);
    // THE FOLLOWING DOES NOT WORK
    myProd1.productMC.productName.text = "ABC 123";
    I figure something like this would work, but with lots of variations, still nothing works
    I get errors telling me it can't find productMC.
    UPDATE:
    Using GetByChildName it seems I can access productMC. For example this works:
    myProd1.getChildByName("productMC").visible = false;
    But this does not work:
    myProd1.getChildByName("productMC").getChildByName("productName").text = "dgdhdhdhrgh";
    If I take the textfield out of the library MC, and create it in the class, then this works:
    myProd1.getChildByName("productName").visible = false;
    BUT this does not work:
    myProd1.getChildByName("productName").text = "sdgsgdfsg";

    Hi Otto,
    If I well understood your situation, the solution  might be quite simple.
    Since your Product class is a  MovieClip (and not a Sprite), you could solve your problem many ways  knowing that a MovieClip is a dynamic class.
    But first,  the thing is that you created your productMC object on the fly inside  your Product class.
    So either you correct it like this:
    package {
         import  flash.display.MovieClip;
         public class  Product extends MovieClip {
             public var  prodName:String;
             public var prodCategory:String;
              public var prodQuality:String;
             public var productMC:MovieClip; // *****
             public function  Product():void {
                 productMC = new  cellMC(); // *********
                 addChild(productMC);
    Or use this cheap trick (a MovieClip is a dynamic class):
    package {
         import  flash.display.MovieClip;
         public class  Product extends MovieClip {
             public var  prodName:String;
             public var prodCategory:String;
              public var prodQuality:String;
             public function  Product():void {
                 var productMC:MovieClip = new  cellMC();
                 this.productMC = productMC; // **************
                 addChild(productMC);
    Although it is possible that, for this one, you need to reforce the dynamic property:
    package {
         import  flash.display.MovieClip;
         dynamic public class  Product extends MovieClip {
    I am not sure, but anyway, you will see for yourself.
    Plus, you try to change text to a MovieClip object? Either there is already a TextField in you cellMC object and you are not targeting it, or productMC should be instanciated as a TextField and not a MovieClip. I think you know the answer to that.
    Design Cyboïde
    Designer web Montreal

  • How to create a ActiveX Object with custom classes

    Hi
    I am trying to create a Active X object for some of the work I have done in Java to be used with VB, but I cannot get the Active X object to generate and it always come up with the following error:
    Exception occurred during event dispatching:
    java.lang.NoClassDefFoundError: uk/co/agena/minerva/model/Model
    at java.lang.Class.getMethods0(Native Method)
    at java.lang.Class.getDeclaredMethods(Unknown Source)
    at java.beans.Introspector$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.beans.Introspector.getPublicDeclaredMethods(Unknown Source)
    at java.beans.Introspector.getTargetEventInfo(Unknown Source)
    at java.beans.Introspector.getBeanInfo(Unknown Source)
    at java.beans.Introspector.getBeanInfo(Unknown Source)
    at sun.beanbox.JarInfo.<init>(Unknown Source)
    at sun.beanbox.JarLoader.createJarInfo(Unknown Source)
    at sun.beanbox.JarLoader.loadJar(Unknown Source)
    at sun.beans.ole.Packager.loadBean(Unknown Source)
    at sun.beans.ole.Packager.generate(Unknown Source)
    at sun.beans.ole.Packager.actionPerformed(Unknown Source)
    at java.awt.Button.processActionEvent(Unknown Source)
    at java.awt.Button.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForComponent(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForComponent(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    This appears to be beacuse the class uk/co/agena/minerva/model/Model is a custom class which is based on the software I am using. Does anyone know how I can get around this issue. I have tried incluijng those class files for the custom classes within the jar file, but I continue to get the same issue?
    Any help would be gratefully received.
    Thanks
    Angie

    This error is no longer coming up, it is now saying that it has an unsupported class version error. I believe this may be because the class file and library files have been complied under different versions, is there a method to check this?

  • Sqlite, moving sqlstatements to a custom class

    I'm working on a FB AIR app.
    I have a main.mxml file with a source to a main.as file.
    My main.as file is getting very bloated with sqlstatements. I want to move these to a custom class, but I don't know how to proceed.
    I found an example of a package on this page: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/data/SQLConnectio n.html#begin()
    about a 3rd of the way down.
    The example above is exactly what I want to do, but I don't know how to adapt this for use in my main.as file beyond importing the class and instantiating it. How do I assign my values to the class file? How do I use the class to load up the dataProvider, etc...
    Also, in the example above the class extends Sprite. This sounds like it's meant for a Flash application. Would I still extend Sprite in Flex 4? I have done a couple of simple events, passing data back to the main app with the Flash.Events.Event, so the use of Sprite causes some confusion.
    In a previous post, Amy suggested using Robotlegs. I think I need to get a handle on using Flex before I explore other architectures. I'm just not that sophisticated yet.
    Thanks
    Kristin

    ok, a quick example
    make a new package called utilities and then a new actionscript class called DatabaseManager
    package utilities
         import flash.data.SQLConnection;
         import flash.data.SQLResult;
         import flash.data.SQLStatement;
         import flash.filesystem.File;
         import mx.collections.ArrayCollection;
         public class DatabaseManager
              private var sqlConnection:SQLConnection;
              private var stm:SQLStatement;
              public function DatabaseManager()
                   //connect to database
                   sqlConnection = new SQLConnection();
                   sqlConnection.open(File.applicationStorageDirectory.resolvePath("whatever"));
                   //create tables if not exist
                   stm = new SQLStatement();
                   stm.sqlConnection = sqlConnection;
                   stm.text = "create your table here";
                   stm.execute();
                   //create more tables
              public function getThings():ArrayCollection
                   stm = new SQLStatement();
                   stm.sqlConnection = sqlConnection;
                   stm.text = "your query";
              public function addStuff(stuff:Object):int
    then in your main file you need to import
    import utilities.DatabaseManager;
    instantiate the class, this connects and creates tables
    private var myDB:DatabaseManager = new DatabaseManager();
    then to use it
    var listFromDatabase:ArrayCollection = myDB.getThings();
    insertid = myDB.addStuff(thingToAdd);
    hope that gives you an idea 

  • Importing a Custom Class

    Hi everyone...
    I'm working on one final part of a Flash piece that's ended being quite a bear for me. So looking forward to wrapping it up! I'm a big-time newbie. This has been an amazing learning experience but boy it has made my brain hurt!
    The final issue I'm having invloves importing a custom class that calls a custom application. It's a class/application that I downloaded and am trying to apply to my project. It is an application that adds transform handles around targeted objects.
    I'm importing the class as I think I am supposed to but it doesn't work. There aren't any erros but it simply doesn't work.
    Here's how I'm doing it...
    My .FLA, FloorPlan.FLA, is located in my root folder along with the class file, ApplicationMain.as.
    ApplicationMain.as has an import that imports the application called TransformTool.as. TransformTool.as is located in the root as well.
    So in scenen 1 on frame 1 of FloorPlan.FLA I have an import written like so...
    import ApplicationMain;
    In the file ApplicationMain.as I have an import to grab the file TransformTool.as that is written like so...
    package  {
        import flash.display.MovieClip;
        import flash.geom.Rectangle;
        import flash.events.MouseEvent;
        import TransformTool;
        public class ApplicationMain extends MovieClip
            private var _transformTool;
            public function ApplicationMain ()
                _transformTool = new TransformTool();           
                _transformTool.mode = TransformTool.ROTATE;
                _transformTool.iconScale = new HandleHintScale();         
                _transformTool.iconRotate = new HandleHintRotate();
                // _transformTool.boundaries = new Rectangle(50, 50, 475, 260);
                addChild(_transformTool);
            // register targets //   
                _transformTool.targets = [content_MC.e1, content_MC.e2, content_MC.e3, content_MC.e4, content_MC.f1, content_MC.f2, content_MC.f3, content_MC.f4, content_MC.f5, content_MC.f6, content_MC.f7, content_MC.f8];
                _transformTool.activeTarget = content_MC.f8;
            // register radio buttons //   
                  // radio1.addEventListener(MouseEvent.CLICK, changeToolMode);
              //  radio2.addEventListener(MouseEvent.CLICK, changeToolMode);             
            private function changeToolMode(evt:MouseEvent):void
                _transformTool.mode = evt.currentTarget.label.toLowerCase();
    Everything but this class/application is working just fine. It doesn't cause any erros and make other items not function. It simply isn't working. And I had it working at the very beginning of the project so I know its not the class/application files causing the problem; other than possible path issues.
    I'm stumped, yet again! 
    Thanks in advance for your help!

    HandleHintScale and HandleHintRotate are movie clips in the library of the .fla

  • WOW! what do you have to do to get a simple customer support answer?

    Error 213:19

    Thank you for the response, Pat.
       I'm not very good with computer chatting. the replys' didn't really
    help. II have resolved the issue on my own. I needed to change to
    administrator privileges, even though I was logged in as one. Once
    again, thank you for the response. Jason
    Pat Willener http://forums.adobe.com/people/pwillener created the
    discussion
    "Re: WOW! what do you have to do to get a simple customer support answer?"
    To view the discussion, visit:
    http://forums.adobe.com/message/5789766#5789766

  • Creating event dispatching in custom class

    I have been trying to create an event dispatcher in a custom
    data transfer object class. It's a simple class and I don't know
    how to make it dispatch an event. I tried extending the
    EventDispatcher class but that doesn't appear to work either. Any
    help would be greatly appreciated.

    I have attached the code for the application and the custom
    class. This should work from what I have read, but I can not get
    the application to catch the event.
    APPLICATION
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="initThis()" layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    private var _tester:TestClass = new TestClass();
    private function initThis():void{
    addEventListener(TestClass.TEST_ACTION, onTestHandler);
    private function onTestHandler(event:Event):void{
    Alert.show("Event Dispatched");
    ]]>
    </mx:Script>
    <mx:Button x="312" y="150" label="Button"
    click="{_tester.testEvents()}"/>
    </mx:Application>
    CLASS
    package
    import flash.events.EventDispatcher;
    import flash.events.Event;
    public class TestClass extends EventDispatcher
    public static const TEST_ACTION:String = "test";
    public function testEvents():void{
    dispatchEvent(new Event(TestClass.TEST_ACTION));
    }

  • Detecting when exception was thrown using custom class loader

    Hello all,
    I would like to implement the solution described here - http://stackoverflow.com/questions/75218/how-can-i-detect-when-an-exceptions-been-thrown-globally-in-java - that uses custom class loader in order to detect when an Exeption thrown somewhere in the JVM hosting my app, please note that exceptions might be thrown from 3rd party jars the app is using. So, thanks to help I got from another post, I've managed to code the custom class loader. My question is how can the class loader wrap the original exception, as the methods in ClassLoader deals with classes, not instances. So where should I set the original exception?
    Thanks!
    Edited by: user9355666 on Sep 28, 2010 10:48 PM

    user9355666 wrote:
    I think I'm missing something fundumental, forgive me for being slow...
    This is what I did so far. For the exception wrapper I made a simple class extens Exception that recieve Exception in its ctor and store it. I also subclassed ClassLoader and override its loadClass(). I've registered it as the system classloader. My thinking was to check in that point that if the requested class is instance of Exception and if yes, returning my wrapper class wrapping this exception. But, since loadClass() return class, how can I set in the wrapper the original exception?
    In addition, let's say 2 different places in the code throws NPE, to my understanding the classloader will load NPE only once, so how throwing the NPE in the second time can be detected?you are missing a key point. you should creating a custom implementation of the NPE class which hooks into your detection code in its constructor. from that point forward, anytime any NPE (which is your custom class) is constructed, you can detect it.

  • Getting Error 'Custom Class not Assignable'

    Hello,
    I am new to ADF and Linux. I have created an ADF application (following the steps in: http://docs.oracle.com/cd/E18941_01/tutorials/jdtut_11r2_55/jdtut_11r2_55_2.html) with the corresponding View objects, Entity Objects and Application Module. When I try to run the 'Application Module', I get the following error. So I am kind of stuck at this point from going forward.
    I appreciate any help/pointers to resolve this issue.
    Thanks!
    oracle.jbo.CustomClassNotFoundException: JBO-26023: Custom class oracle.apps.model.applicationModule.AppModuleAMImpl is not assignable to oracle.jbo.server.ApplicationModuleImpl
         at oracle.jbo.common.JBOClass.findCustomClass(JBOClass.java:224)
         at oracle.jbo.server.RemotableCompDef.loadFromXML(RemotableCompDef.java:147)
         at oracle.jbo.server.ApplicationModuleDefImpl.loadFromXML(ApplicationModuleDefImpl.java:1128)
         at oracle.jbo.server.ApplicationModuleDefImpl.loadFromXML(ApplicationModuleDefImpl.java:1068)
         at oracle.jbo.server.MetaObjectManager.loadFromXML(MetaObjectManager.java:562)
         at oracle.jbo.mom.DefinitionManager.loadLazyDefinitionObject(DefinitionManager.java:1192)
         at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:617)
         at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:537)
         at oracle.jbo.mom.DefinitionManager.findDefinitionObject(DefinitionManager.java:519)
         at oracle.jbo.server.MetaObjectManager.findMetaObject(MetaObjectManager.java:784)
         at oracle.jbo.server.ApplicationModuleDefImpl.findDefObject(ApplicationModuleDefImpl.java:282)
         at oracle.jbo.server.ApplicationModuleImpl.createRootApplicationModule(ApplicationModuleImpl.java:471)
         at oracle.jbo.server.ApplicationModuleHomeImpl.create(ApplicationModuleHomeImpl.java:87)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.createApplicationModule(DefaultConnectionStrategy.java:158)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.createApplicationModule(DefaultConnectionStrategy.java:73)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.instantiateResource(ApplicationPoolImpl.java:2913)
         at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:580)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2473)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2347)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3246)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:592)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:525)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:520)
         at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:523)
         at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:869)
         at oracle.jbo.jbotester.binding.TesterBinding.getConnectionInfo(TesterBinding.java:214)
         at oracle.jbo.jbotester.MainFrame.initializeDataControl(MainFrame.java:906)
         at oracle.jbo.jbotester.MainFrame.loadConfiguration(MainFrame.java:632)
         at oracle.jbo.jbotester.MainFrame.processArgs(MainFrame.java:597)
         at oracle.jbo.jbotester.MainFrame.main(MainFrame.java:428)
    [968] JUErrorHandlerDlg.reportException(oracle.jbo.jbotester.ErrorHandler$ExceptionWrapper)
    [969] UIMessageBundle (language base) being initialized Sep 14, 2012 12:15:33 PM oracle.jbo.jbotester.MainFrame exit
    INFO: BC4J Tester exit code(-3)

    Thanks Vinod for your response! I checked both the files as you mentioned: So my Model.jpx looks like this:
    For this, I tried entering "oracle.apps.model.applicationModule.AppModuleAMImpl" for the value attribute, but that did not seem to work.
    <DesignTime>
    <Attr Name="_jprName" Value="../../../../Model.jpr"/>
    <Attr Name="_jbo.TypeMapEntries"
    Value="oracle.apps.fnd.applcore.oaext.typemap.OATypeMapEntries"/>
    <Attr Name="_NamedConnection" Value="RoomConnection"/>
    <Attr Name="_appModuleNames0"
    Value="oracle.apps.model.applicationModule.AppModuleAM"/>
    </DesignTime>
    <Containee
    Name="applicationModule"
    PackageName="oracle.apps.model.applicationModule"
    ObjectType="JboPackage">
    <DesignTime>
    <Attr Name="_AM" Value="true"/>
    </DesignTime>
    and my AM.xml looks like this:
    Name="AppModuleAM"
    Version="11.1.1.63.37"
    InheritPersonalization="true"
    ComponentClass="oracle.apps.model.applicationModule.AppModuleAMImpl"
    ClearCacheOnRollback="true"
    DefClass="oracle.apps.model.applicationModule.AppModuleAMDefImpl">
    Thanks for all your help!

Maybe you are looking for

  • MacBook Air Hard Drive Problems?

    Ok, so I have a MacBook Air. I don't know the exact model, but it's a school laptop from Oxford Hills Comprehensive High School in Maine. I was watching a movie on the laptop, and I went to use Google Chrome, and Finder froze, and I got the little ra

  • Count column in query

    Hi all, I work with forms 6i and database oracle 8. I want to know if it's possible to count the number of column in a sql query. For exemple, i have : "select id, name, dtbirth from table". In this query, I have 3 column. But I don't know how can I

  • Multiple 850 definitions

    Hi, I am currently trying to use two different ecs files for the 850 document type. Here are the steps I followed: 1. Copied the "base" 850.ecs to <Partner1>850.ecs. Made modifications to <Partner1>850.ecs. 2. While creating the operational capabilit

  • Can I install OS x 10.5 (Leopard)?

    I've got an aging G5, which couldn't handle Snow Leopard (sniff). I was just going to live with it but now my new iPhone 4 requires the latest iTunes, which I can't install on OS X 10.4.11 (Tiger). Can I install Leopard on this machine (please say ye

  • Salary Ranges based on Personnel Areas

    Hi, is there a way to configure a salary range for a particular job based on Personnel Area.  I know in Compensation Management you can define pay grades and level and set the min and max salary but this is based on country grouping. Is the a way to