CX_SHM_EXTERNAL_REFERENCE exc. when passing Class instance to Shared memory

Hi all,
when setting up the writing to a shared memory (using the SHMA and SHMM transactions), we get an exception mentioning CX_SHM_EXTERNAL_REFERENCE
This problem is raised because we are trying to move an instantiated class from the calling development to the Shared memory class.
Therefore, this exception is raised, the sap standard documentation tells me:
"There are still references from the current area instance version to a different area instance of the shared objects memory, or to the internal session."
How can we work around this problem, I really want to pass the instantiated class to the Shared memory?
Thanks in advance for any help,
Pascal Decock

My problem is that I would like to embed a Standard SAP class into this shared memory.
Therefore, I'm obliged to accept the 'Create object' references that are written in standard SAP code.
That also means that it is impossible to include an instantiated SAP class into a shared object memory?

Similar Messages

  • SAP HA ASCS Instance service Shared Memory Problem

    Hi Gurus,
    I have completed the setup of ASCS and ERS instance for SAP HA.  The system was working fine, but yesterday when I was trying to start the ASCS instance, it shows following error in the dev_enqsrv log file.
    ShadowTable:attach: ShmCreate - pool doesn't exist
    Enqueue: EnqMemStartupAction Utc=1267507616
    Enqueue Info: replication enabled
    Enqueue Info: enque/replication_dll not set
    ShadowTable:attach: ShmCreate - pool doesn't exist
    ERROR => EnqRepAttachOldTable: failed to get information on old replication table: rc=-1 [enxxmrdt.h   393]
    EnqRepRestoreFromReplica: failed to attach to old replication table: rc=-1
    enque/backup_file disabled in enserver environment
    ***LOG GEZ=> Server start [encllog.cpp  493]
    For resolving this error, I have performed following steps:
    1. cleanipc 04 remove ( where 04 is the instance no for ASCS instance)
    2. saposcol -k to stop the saposcollector and release the shared memory.
    3. Also performed some steps like saposcol -d, kill , leave, quit.
    After doing this steps, the same error is been generated in the dev_enqsrv log file. The only problem with this is the ASCS instance is starting , but while checking the log file available.log, it is changing the staus from available to unavailable every 30 secs.
    Appreciate any response.
    Regards,
    Raj.

    Hi,
    important to know is your NW kernel version and the setup of your file systems.
    The error message could be no real error. It could be just the indication that there is no replicated enqueue table available and therefore the enqueue server of the starting ASCS instance is not able to attach to any existing table. It would create a new one. But: If you start your ASCS on the node where the ERS was running and you see that error message, that indicates that the replicated enqueue table couldn't be attached on your starting enqueue server, which is a critical error in a failover scenario.
    Check following help.sap.com site for details how enqueue table replication works:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/e023f3bf423c83e10000000a42189c/frameset.htm
    The available.log has this confusing entries if you have your /usr/sap/<SID>/<Instance>/work directory on a clustered file system which is present on both nodes. In that case, the sapstartsrv of the ASCS on the active node will write to the log file that the instance is available, whereas the sapstartsrv of the ASCS on the passive node will write to the log file that the instance is not available. It's a bug, but there are several possibilities to workaround.
    If you need documentation of SAP HA on SLES or RHEL, I can post the links of the whitepapers here.
    Best regards,
    Matthias

  • Shared memory area & triggering "client" actions

    Hi all,
    I'm playing around with shared objects, and I would like to accomplish one thing:
    I have a shared memory and a "client" class which uses it.
    When one of the instances of this client class calls a specific method of the shared memory root class, another instance of the client class should receive a message from the root class. This other instance would be running under a different user.
    Since no events are allowed for shared memory area root classes, event handling on the side of the client class is not possible. I even tried to store references to instances of the client class in the shared memory but this would not work either (surprise! surprise! - CX_SHM_EXTERNAL_REFERENCE
    So apart from periodically querying the root class from the client, is there really no way how to initialize the SHMA->client communication from the shared memory area side ?
    thanks,
    Stanislav Mikulas

    If your clients keep the read connection to the shared memory, is there a way to follow this connection back to the clients?
    But even if so, how could you trigger an event at the client?
    Actually, I think there is no solution besides polling the shared memory objects for changes periodically.

  • Shared memory (System V-style) - High usage of phys memory and page outs

    Hi!
    I get a much higher usage of physical memory when I use shared memory than I would expect. Please, I would really need someone to confirm my conclusions, so that I can revise my ignorance in this subject.
    In my experiments I create a shared memory segment of 200 MB and I have 7 processes attaching to it. I have a ws of 1 GB.
    I expect to see what I see when I attach to the shared memory segment in terms of virtual size, i.e. SIZE in prstat. After attaching (mapping it) to the process all 7 processes are about ~203 MB each and this makes sense. RSS, in prstat, is about 3 MB for each process and this is ok to me too.
    It is what I see when each of the 7 processes start to write a simple string like 'Hello!' in parallel to each page in their shared memory segment that I get surprised. I run out of memory on my ws after a while and the system starts to wildly page out physical memory to disk so that the next 'Hello!' can be written to the next page in the shared memory segment. It seems that each page written to in the shared memory chunk is mapped into each process private address space. This means that the shared memory is not physically shared, just virtually shared. Is this correct?
    Can memory be physically shared, so that my 7 processes only use 200 MB? ISM? DISM?
    I create a shared memory segment in a C-program with the following calls:
    shmid = shmget(key, SHM_SIZE, 0644 | IPC_CREAT)
    data = shmat(shmid, (void *)0, 0);Thanks in advance
    /Sune

    Your problem seemed reasonable. What were you doing wrong?
    Darren

  • SHARED MEMORY 문제(ORA-7329, ORA-7331, ORA-7279)

    제품 : ORACLE SERVER
    작성날짜 : 2004-07-22
    SHARED MEMORY 문제(ORA-7329, ORA-7331, ORA-7279)
    ================================================
    PURPOSE
    다음은 shared memory 문제가 발생하는 경우(ora-7329,ora-7331,
    ora-7279) 에 대해서 알아본다.
    Explanation
    1. 왜 Problem 이 생기나?
    * Oracle 은 Process와 SGA(System Global Area) 간의
    Communication를 위해 Shared Memory와 Semaphore 를 사용한다.
    Oracle Instance 가 뜰 때 SGA를 Create하기 위해 Main Memory의
    임의의 부분을 할당하는데 이 때 Shared Memory 나 Semaphore 가
    적절하지 않으면 이에 관련한 Error가 발생한다.
    2. 해결 방안
    SGA는 Shared Memory 안에 생기므로 Shared Memory 는 각 Process에게
    사용 가능해야 한다.
    Shared memory 와 Semaphore parameter 는
    - SHMMAX = 1개의 shared memory segment 의 maximum size,
    SGA 크기 이상
    - SHMMIN = 1개의 shared memory segment 의 minimum size, 1 byte
    - SHMMNI = shared memory identifier의 숫자, 100 이상
    - SHMSEG = 1개의 process에 attach되는 shared memory segment의
    maximum 갯수, 10 이상
    - SEMMNS = system의 semaphore 갯수, 200 이상
    - SEMMNI = 시스템에서 identifier를 setting하는 semaphore 수,
    70 이상
    - SEMMSL = semaphore set 당 최대 semaphore 갯수,
    initSID.ora 의 processes 값 이상
    * 추천하는 Semaphore와 Shared Memory Parameter
    Operating System Shared Memory Parameters Semaphore
    ================================================================
    Sun OS
    SHMSIZE = 32768 SEMMNS = 200
    SHMMNI = 50 SEMMNI = 50
    Solaris
    SHMMAX = 8388608 SEMMNS = 200
    SHMSEG = 20 SEMMSL = 50
    SHMMNI = 100 SEMMNI = 70
    HP/UX
    SHMMAX = 0x4000000(64Mb) SEMMNS = 128
    SHMSEG = 12 SEMMNI = 10
    Digital Unix (DEC Alpha OSF/1)
    SHMMAX = 4194304 SEMMNS = 60
    SHMSEG = 32 SEMMSL = 25
    Ultrix Use System Default     SEMNS SEMMSL = 5
    AT&T Unix
              SHMMAX = RAM-Dependant     SEMMNS = 200
    8 or 16Mb RAM
              SHMMAX = 5 Mb     For All RAM
    32 Mb RAM
              SHMMAX = 8 Mb Values
    64 Mb RAM
              SHMMAX = 16 Mb
    128 Mb RAM
              SHMMAX = 32 Mb
    256 Mb RAM
              SHMMAX = 64 Mb
    512 Mb RAM
              SHMMAX = 128 Mb
    1024 Mb RAM
              SHMMAX = 256 Mb
    2048 Mb RAM
              SHMMAX = 512 Mb
              SHMSEG = 6 for all RAM Values
              SHMMIN = 1 for all RAM Values
    Dynix/PTX
              SHMMAX = 11010048 SEMMNS = 200
              SHMSEG = 20 SEMMSL = 85
    Other Parameter     NOFILES = 128
    DG/UX
              SHMMAX = 4194304 SEMMNS = 200
              SHMSEG = 15
    Shared Memory 와 Semaphore Parameter는 OS 의 Kernel Configuration
    화일에 반드시 지정되어야 하며, File의 위치는 OS마다 차이가 있다.
    현재의 Shared Memory 와 Semaphore Configuration 을 알기 위해서는
    다음의 Command를 이용한다.
    $ sysdef |more
    * HP-UX (relevant sections only) 에서의 예:
    Semaphore 관련 Parameters
    - maximum value for semaphores(semaem)= 16384
    - Semaphore map(semmap)= 4098
    - number of semaphore identifiers(semmni) = 4096
    - total number of semaphores in the system(semmns) = 8192
    - number of semaphore undo structures(semmnu) = 1536
    - semaphore undo entries per process(semume) = 512
    - semaphore maximum value(semvmx) = 32767
    Shared Memory 관련 Parameters
    - maximum shared memory segment size in bytes(shmmax) = 536870912
    - minimum shared memory segment size in bytes(shmmin) = 1
    - maximum shared memory segments in system (shmmni) = 512
    - maximum shared memory segments per process(shmseg) = 512
    NOTE: SHMMAX는 현 system에 8개의 instance가 수행될 수 있는
    충분한 값이다.
    * Shared memory 또는 semaphore parameters 를 변경하기 위해서는 ...
    1. Oracle Instance를 Shutdown 한다.
    2. OS의 Kernel Configuration File이 있는 곳으로 간다.
    3. System Utility 또는 Editor를 이용해서 필요한 값을 바꾼다.
    System Utility는 다음과 같다
    | OS |     Utility     |
    | HP/UX | SAM     |
    | SCO     |     SYSADMSH |
    | AIX     |     SMIT     |
    | Solaris |     ADMINTOOL |
    4. Kernel 을 Reconfigure 한다.
    5. System을 Reboot 한다.
    6. Oracle Instance를 startup시킨다.
    [ 예제 ] Solaris 2.3/2.4 parameters and commands:
    1. SQLDBA 에서 :
    SQLDBA> shutdown
    SQLDBA> exit
    2. Superuser(root)로 login 하고 :
    # cd /etc
    3. /etc/system file 에 다음을 추가 한다:
    set shmsys:shminfo_shmmax=8388608
    set shmsys:shminfo_shmmin=1
    set shmsys:shminfo_shmmni=100
    set shmsys:shminfo_shmseg=20
    set semsys:seminfo_semmns=200
    set semsys:seminfo_semmni=70
    4. Kernel을 reconfigure 한다:
    # touch /reconfigure
    5. Machine 을 reboot 한다:
    #init 6
    6. SQLDBA 에서 :
    SQLDBA> startup
    SQLDBA> exit
    Oracle의 init<SID>.ora 파라미터 화일에는 SGA에 영향을 주는
    Parameter들이 있다. OS의 Shared Momory와 Semaphore Parameter에
    연결된 이 Parameter의 setting은 System과 Oracle의 Performance에
    중요한 영향을 미친다.
    Reference Documents
    <Note:1011658.6>

    system does not seem to using memory correctly, lots of swapping on an 8GB real memory system.We could start (for example) with this question - How big is your SGA or how much of 8GB RAM takes your SGA?
    The doc says to set /etc/system to:
    shmsys:shminfo_shmmax project.max-shm-memory 4294967296
    but infers that this is not used.From documentation:
    In Solaris 10, you are not required to make changes to the /etc/system file to implement the System V IPC. Solaris 10 uses the resource control facility for its implementation. However, Oracle recommends that you set both resource control and /etc/system/ parameters. Operating system parameters not replaced by resource controls continue to affect performance and security on Solaris 10 systems.
    Then, the doc states to set a project shared mem value of 2GB:
    # projmod -sK "project.max-shm-memory=(privileged,2G,deny)" group.dba
    Why is this number different?It's an example how "To set the maximum shared memory size to 2 GB"
    By setting to to 2G as documented oracle did not work at all Docs says:
    On Solaris 10, verify that the kernel parameters shown in the following table are set to values greater than or equal to the recommended value shown.
    If your SGA was greater than 2G I'm nor wondering why "oracle did not work at all".
    So for 4GB SGA (for example) you need allow allocation of 4G of shared memory.
    Note: shmsys:shminfo_shmmax != project.max-shm-memory. "project.max-shm-memory" is replacement of "shmsys:shminfo_shmmax" but function of these parameters differs.
    "project.max-shm-memory resource control limits the total amount of shared memory of one project, whereas previously, the shmsys:shminfo_shmmax parameter limited the size of a single shared memory segment."
    Relevant link to Sun docs: http://docs.sun.com/app/docs/doc/819-2724/chapter1-33

  • Sharing memory between executables?

    I'm working on a set of three programs: one camera interface and two vision processing routines.  Currently, the camera interface runs independently of the two vision processing routines, and the images are simply passed through Labview's shared memory.  In other words, the interface just runs and creates an image with a known name, and the other two routines use the name to read in that image and make their own local copy to operate on.
    However, eventually these programs need to be compiled to executables, where this method will no longer work.  The two programs need to remain separate, so I can't build them into the same executable.  They will both be run on the same computer, so I was wondering if there was another way to write to and read from the computer’s memory that will still work for Labview-built executables.

    TCP should be a perfectly acceptable solution. It's a common interface for exchanging data between processes, even on the same machine. The code for sending data really isn't that complicated. Just take a look at some of the TCP shipping examples in LabVIEW.
    You could use something like ActiveX if you're running Windows for interprocess communication between the LabVIEW-built exe's, but that would add a bit of overhead and complexity to the matter. Also, that would really only allow you to access a subset of VI Server methods, such as setting control values. Sending and receiving data wouldn't be all that quick.
    Another alternative would be writing the data to a shared file, but that makes it hard to stream data continuously.
    Jarrod S.
    National Instruments

  • Mysterious NullPointerException when loading class by RMI

    Hi,
    I have a distributed application where an RMI server puts tasks in a queue and clients connect to the server to obtain tasks to process. My problem is the following. When I install the task code on the clients, and just use RMI to obtain tasks from the server (i.e. no dynamic code loading is being done), everything works fine. However, this approach is not efficient since every time the task definition changes, I'll have to reinstall code on the clients. Therefore, I use RMI to load the task class dynamically and instantiate it on the client (note: a task does not implement Remote, nor is it serializable, for reasons that I'll explain below. Instead I obtain the task class from the RMI server and instantiate it on the client). When I take this approach, I get a NullPointerException inside the task code, that does not occur when I install exactly the same code manually on the clients. The exception always occurs at the same point in the code, but not at the same moment (e.g., sometimes a client processes 100 tasks before it happens, another time 5000, etc.). Moreover, when this happens, all client processes running on the same physical machine (but different JVMs) stop processing, but without throwing any error.
    My question is if anyone has seen this kind of problem before. I know the above description is rather vague, but the specifics are a bit of a long story. Here they come:
    RMI server code snippet:
    public interface ConcurrentEvaluationManager extends Remote {
    //An Individual is serializable and constitutes the data needed for the task
    Individual pollNextToEvaluate(long timeout, TimeUnit unit) throws RemoteException;
    //A FitnessFunction is not Remote nor serializable and constitutes the task algorithm
    //(Performance evaluation of Individual, involving some heavy physics simulations)
    Class<? extends FitnessFunction> getFitnessFunctionDef() throws RemoteException;
    }Code for the class that loads the FitnessFunction code dynamically:
    public class RemoteEvaluatorLoader {
    public static void main(String args[]) {
    //Obtain evaluation manager from RMI registry
    ConcurrentEvaluationManager evalMgr = getRemoteManager(hostName, rmiServerName, port);
    //Obtain fitness function definition and instantiate it
    Class<? extends FitnessFunction> fitnessClass = evalMgr .getFitnessFunctionDef();
    FitnessFunction evalFunction = fitnessClass.newInstance();
    //Start getting Individuals from the manager and evaluate them using the fitness function until the
    //manager says there will be no more Individuals to evaluate
    Evaluator eval = new Evaluator(evalFunction, evalMgr);
    eval.run();
    }Specifically, a task consists of evaluating the performance of a robotic controller using some heavy physics simulations. A task is therefore made up of two things: the encoding of the controller (an Individual, basically a list of numbers), and the performance measure/simulation (the FitnessFunction). The latter is subject to frequent change, so I want to load this code dynamically on the clients using RMI. I can't pass an instance (either serialized copy or remote reference) of the simulation to the client, since it involves communication with a native DLL.
    Stack trace of the error:
    Exception in thread "main" java.lang.NullPointerException
            at Insect.execMotorCommand(Insect.java:152)
            at Experiment.doStep(Experiment.java:62)
            at Experiment.doSteps(Experiment.java:69)
            at InsectFitnessFunction.evaluate(InsectFitnessFunction.java:32)
            at InsectFitnessFunction.evaluate(InsectFitnessFunction.java:1)
            at jbeagle.concurrent.Evaluator.run(Evaluator.java:72)
            at jbeagle.concurrent.RemoteEvaluatorLoader.main(RemoteEvaluatorLoader.java:33)The line where the error happens is where the insect robot tries to move its legs. One of the legs is null. Again, this doesn't happen when I run the application without loading the code dynamically and install the code for the InsectFitnessFunction, Experiment etc. on the client manually. In the current scenario, all code (InsectFitnessFunction, Experiment, Insect, and other necessary classes) is loaded dynamically and instantiated locally on the client (of course, the necessary native library and the JNI wrapper for it are installed manually on the clients).
    Has anyone encountered something like this before? Might there be a problem with the way I am dynamically loading and instantiating the class? At first I thought it might be due to some problem with distributed garbage collection, but I don't see how since the relevant classes are instantiated locally, even though they are loaded from a remote codebase.
    An alternative version of the error is one where my JVM crashes (error log below). I believe this is basically the same problem, except when the JVM crashes the null pointer happens in the native library.
    # A fatal error has been detected by the Java Runtime Environment:
    #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x034e75f8, pid=3908, tid=1588
    # JRE version: 6.0_18-b07
    # Java VM: Java HotSpot(TM) Client VM (16.0-b13 mixed mode, sharing windows-x86 )
    # Problematic frame:
    # C  [PhysXCore.dll+0x1675f8]
    ---------------  T H R E A D  ---------------
    Current thread (0x003b6800):  JavaThread "main" [_thread_in_native, id=1588, stack(0x009a0000,0x009f0000)]
    siginfo: ExceptionCode=0xc0000005, reading address 0xdddddde5
    Registers:
    EAX=0xdddddddd, EBX=0x00000000, ECX=0x03c41ec8, EDX=0x03b79fc0
    ESP=0x009ef740, EBP=0x009ef7cc, ESI=0x00000000, EDI=0x03c41cf0
    EIP=0x034e75f8, EFLAGS=0x00010206
    Top of Stack: (sp=0x009ef740)
    0x009ef740:   009ef8d8 009ef7d8 00000000 cccccccc
    0x009ef750:   cccccccc cccccccc cccccccc cccccccc
    0x009ef760:   cccccccc cccccccc cccccccc cccccccc
    0x009ef770:   cccccccc cccccccc cccccccc cccccccc
    0x009ef780:   cccccccc cccccccc 037b1d60 037ddc40
    0x009ef790:   cccccccc cccccccc cccccccc cccccccc
    0x009ef7a0:   cccccccc cccccccc cccccccc cccccccc
    0x009ef7b0:   cccccccc cccccccc cccccccc cccccccc
    Instructions: (pc=0x034e75f8)
    0x034e75e8:   f9 02 74 38 8d 64 24 00 8b 57 58 8b 0c b2 8b 01
    0x034e75f8:   8b 50 08 ff d2 84 c0 74 5c 8b 47 58 8b 0c b0 f6
    Stack: [0x009a0000,0x009f0000],  sp=0x009ef740,  free space=13d009ef274k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C  [PhysXCore.dll+0x1675f8]
    C  [JPhysX.dll+0xf197f]
    J  com.jphysx.JPhysXAdapterJNI.NxScene_createActor(JLcom/jphysx/NxScene;JLcom/jphysx/NxActorDescBase;)J
    J  ActorFactory.createApproximateCylinder(Lcom/jphysx/NxVec3;FFI)Lcom/jphysx/NxActor;
    j  Insect.createBody(LActorFactory;)V+36
    J  Insect.create(LActorFactory;LJointFactory;IFFF)LInsect;
    j  Experiment.recreateScene()V+63
    j  Experiment.reset()V+8
    j  InsectFitnessFunction.preEvaluation(Ljbeagle/core/ListIndividual;)V+56
    j  InsectFitnessFunction.evaluate(Ljbeagle/core/ListIndividual;)V+24
    j  InsectFitnessFunction.evaluate(Ljbeagle/core/Individual;)V+5
    j  jbeagle.concurrent.Evaluator.run()V+76
    j  jbeagle.concurrent.RemoteEvaluatorLoader.main([Ljava/lang/String;)V+97
    v  ~StubRoutines::call_stub
    V  [jvm.dll+0xf072c]
    V  [jvm.dll+0x17fd51]
    V  [jvm.dll+0xf07ad]
    V  [jvm.dll+0xf9e55]
    V  [jvm.dll+0x101ba2]
    V  [jvm.dll+0x11246b]
    C  [java.exe+0x2155]
    C  [java.exe+0x85b4]
    C  [kernel32.dll+0xb729]Any suggestions are much appreciated.
    Thanks,
    Matt

    Never mind. I have now managed to reproduce this condition without RMI, so it seems to be due to something else after all. Marking this thread as answered.

  • How to get a reference to the owner of a class instance?

    Within a method of a class, how can I get a reference to the
    object containing the class instance?
    To be clear: I have class B that contains a method, say
    "myfunc()". Class A (say, the application itself or a custom
    component) instantiates a new instance of Class B : myclassB=new
    ClassB()
    Now, from within myfunc() can I get a reference to Class A?
    The simplest way here is to pass a "this" reference when
    calling myfunc(), i.e. "myclassB.myfunc(this)" but I would prefer
    not to have to remember to always use 'this'.

    Are these objects within each other. Does classA own classB?
    If that is the case, then Greg is correct and it should be
    available in parentDocument.
    In projects in the past we have created a central
    refObjectLocator object that is available to all objects.
    Mostly we use events to communicate between objects. Dispatch
    an event and let whoever listen for it.
    Here is a copy of our reflocator if you are interested.
    package com.goconfigure.model {
    import mx.collections.ArrayCollection;
    import com.adobe.cairngorm.model.ModelLocator;
    import com.goconfigure.util.HashMap;
    [Bindable]
    public class RefObjectLocator implements ModelLocator {
    // this instance stores a static reference to itself
    private static var refObject : RefObjectLocator;
    public var refObjectHM : HashMap = new HashMap();
    // singleton: constructor only allows one model locator
    public function AppLocator() : void {
    if ( RefObjectLocator.refObject != null )
    throw new Error( "Only one RefObjectLocator instance should
    be instantiated" );
    // singleton: always returns the one existing static
    instance to itself
    public static function getInstance() : RefObjectLocator {
    if ( refObject == null )
    refObject = new RefObjectLocator();
    return refObject;
    public function addRefObject( pRefObject : Object, pName :
    String ) : void {
    refObjectHM.put(pName,pRefObject);
    public function getRefObject( pName : String ) : Object {
    return refObjectHM.getValue(pName);
    public function removeRefObject( pName : String ) : void {
    refObjectHM.remove(pName);
    public function clearRefObject() : void {
    refObjectHM.clear();

  • [svn] 2700: With the Marshal Plan, when create an instance of a manager, we need to talk to the system manager.

    Revision: 2700
    Author: [email protected]
    Date: 2008-07-31 21:12:03 -0700 (Thu, 31 Jul 2008)
    Log Message:
    With the Marshal Plan, when create an instance of a manager, we need to talk to the system manager. Unfortunately sometimes these manager instances can be created before the Application class is created and/or before the systemManager property is set on the application. So to get the reference to the system manager from the manager instances, we can't use ApplicationGlobals.application.systemManager. We need to use SystemManagerGlobals.topLevelSystemManagers[0] instead. This property is set in the SystemManager constructor, and fortunately for us, Flash runs your root display object's constructor before anything else, even before static initializers (atleast ones not defined in SystemManager or a dependency of it).
    QE: Yes
    Doc: No
    Bugs: SDK-16207, SDK-16208, SDK-16209
    Reviewer: Alex
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-16207
    http://bugs.adobe.com/jira/browse/SDK-16208
    http://bugs.adobe.com/jira/browse/SDK-16209
    Modified Paths:
    flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/CursorManagerImpl.a s
    flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl. as

    an instance p for Point class is created like this?
    Instead we can create and instance of Point class
    as:
    Point p = new Point();
    Can any one of you explain this?Your Point() constructor doesn't throw exceptions, so there's no need to catch them. The Class.forName() and Class.getInstance() methods can throw exceptions, so it's necessary to handle them if they arise. Check out the docs for those methods, it lists what exceptions they can throw.
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#forName(java.lang.String)
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#newInstance()
    2) In the above Class Point what is the use of
    creating an instance of Point with in that Point
    class?
    static Point origin = new Point(0,0);
    What the reason to create an instance like this
    within the same class. We can create this instance of
    point
    class when ever we need. There doesn't seem to be any in your code, since that variable is never accessed. It could be useful if you wanted to have a Point that was shared across all instances. This is not a good example of that though.

  • Creating custom class instances for XML nodes

    Hi guys,
    I'm trying to load an external XML document in my application
    and create an instance of a custom class for each node in the XML
    based on the value of some of their elements. The instances created
    will eventually end up in a DataGrid by the way. The problem I'm
    having is there seems to be many ways of doing small parts of this
    and I have no idea how to make them all gel. Initially I'm using
    HTTPService to load the XML file but I've seen people just use an
    XML object. Then, after that, I initially set the loaded XML to an
    ArrayCollection but others have used XMLList or XMLListCollection.
    I've no idea what's the best way to do this.
    Eventually, when I've created all of these instances by
    looping over the XML and creating them how will I make them
    bindable to the data grid? I'm guessing I'll have to group them
    somehow...
    Any help would be greatly appreciated. Thanks

    Hey Tracy,
    That is exactly what I was talking about in a previous post
    you replied to
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=585&threadid=1344350
    Anyhow, Below is some code I created to do what your saying
    somewhat dynamically. The idea being you can have many different
    object types that you may want to populate with data from XML. In
    my case I am using e4x as the result type from my web services. At
    present I have about 6 different classes that call this function.
    I'd love to get some opinions on the function. Good bad or
    ???? Any improvements etc????
    package . . . .
    import flash.utils.describeType;
    import flash.utils.getDefinitionByName;
    import flash.utils.getQualifiedClassName;
    import mx.utils.ObjectUtil;
    * Utility class to convert xml based Objects to class
    instances.
    * Takes a value object as the destination and an xmlList of
    data
    * Look through all the items in the value object. Note we
    are using classInfo..accessor since
    * our objects are bound all variables become getter /
    setter's or accessors.
    * Also note, we can handle custom objects, arrays and
    arrayCollections.
    * History
    * 03.11.2008 - Steven Rieger : Created class
    public final class XMLToInstance
    public static function xmlToInstance( destinationObject :
    Object, sourceXMLList : XMLList ) : void
    // Get the class definition in XML, from the passed in
    object ( introspection so to speak )
    var classInfo : XML = describeType( destinationObject );
    // Loop through each variable defined in the class.
    for each ( var aVar : XML in classInfo..accessor )
    // If this is String, Number, etc. . . Just copy the data
    into the destination object.
    if( isSimple( aVar.@type ) )
    destinationObject[aVar.@name] = sourceXMLList[aVar.@name];
    else
    // Dynamically create a class of the appropriate type
    var className : String = aVar.@type;
    var ObjectClass : Class = getDefinitionByName( className )
    as Class;
    var newDestObject : Object = Object( new ObjectClass());
    // If this is a custom type
    if( isCustomType( className ) && ObjectClass != null
    // Recursively call itself passing in the custom data type
    and the data to store in it.
    // I haven't tested nested objects more than one level. I
    suppose it should work.
    // Note to self. Check.
    xmlToInstance( newDestObject, sourceXMLList[aVar.@name] );
    else
    // Must be some sort of Array, Array Collection . . .
    if( ObjectClass != null )
    var anXMLList : XMLList = new XMLList(
    sourceXMLList[aVar.@name] );
    for each( var anItem : XML in anXMLList )
    // I'm sure there are more types, just not using any of them
    yet.
    if( newDestObject is Array )
    newDestObject.push( anItem )
    else
    newDestObject.addItem( anItem );
    // Add the data to the destination object. . . .
    destinationObject[aVar.@name] = newDestObject;
    } // end function objectToInstance
    public static function isSimple( dataType : String ) :
    Boolean
    * This function is pretty self explanatory.
    * Check to see if this is a simple data type. Did I miss
    any?
    * History
    * 03.11.2008 - Steven Rieger : Created function
    switch( dataType.toLowerCase() )
    case "number":
    case "string":
    case "boolean":
    return true;
    return false;
    } // end isSimple
    public static function isCustomType( className : String ) :
    Boolean
    * This function is pretty self explanatory.
    * Check to see if this is a custom data type. Add them here
    as you need. . .
    * History
    * 03.11.2008 - Steven Rieger : Created function
    var aClassName : String = className.replace( "::", "."
    ).toLowerCase();
    aClassName = aClassName.substr( aClassName.lastIndexOf( "."
    ) + 1, aClassName.length - aClassName.lastIndexOf( "." ) );
    switch( aClassName )
    case "ndatetimevo":
    case "expenselineitemvo":
    return true;
    return false;
    } // end isCustomType
    } // end class
    } // end package

  • Any way to for a class instance to ask what its instance name is?

    Hey. I have a class which needs to create a movie clip on the
    stage. Since each instance of the class will only ever have 1 movie
    clip on the stage at a time, it seems reasonable that I have the
    instance create a movie clip with its own name, prefixed with "mc_"
    or something of the sort.
    Here's where I don't know quite what to do... How do I get at
    this information? For instance, when you a dealing with an XMLNode,
    you can simply use...
    the_answer = xmlNodeInstance.nodeName;
    ...I know the analogy fails, but hopefully you know what I'm
    looking for.
    Thanks!

    hu....
    and when you create your movie clip, (assuming you don't just
    build it at authoring time) you specify an instance id through the
    createEmptyMovieClip function....
    taking a cue from this, I'm guessing that my answer is to
    change the structure of what I'm doing a little... instantiate my
    object with an instance name as a parameter given to the Class
    Constructor... that way the class can have it's own name on file.
    I guess my only concern there is how do I keep the "name"
    variable from being just completely arbitrary...?
    I guess I'm getting away from application (becaust I don't
    know when I'd do this...) and into theory.... but for instance,
    let's say I create my class like this:
    var instanceReference:mySuperCoolClass = new
    mySuperCoolClass("instanceName");
    So. I have my class instance... ideally, the class would
    exist on the stage as "instanceName", with "instanceReference"
    being another way to reference the instance. That would be ideal...
    but how do I make that happen? Because in the scenario of what I've
    just done, I see the class instance existing on the stage as
    "instanceReference", and I've just passed it a fun, but meaningless
    bit of data called "instanceName"...
    I suppose I could have the class go back to "_parent" and
    create it's own object.... but here again I'm getting into
    territory that feels a lot like i have no idea what I'm doing...
    haha!
    I guess I have enough info to get back to coding for now...
    But I'm deffinately open to more tips... I feel like I'm still
    missing how a lot of this works.
    (I'm at that awkward place where I can easily explain what
    OOP is, but I'm far from experienced in how to implement it... I've
    only written about half a dozen classes so far... so I still have a
    lot to learn. Thanks for your patience, all of you!)

  • Script fails when passing values from pl/sql to unix variable

    Script fails when passing values from pl/sql to unix variable
    Dear All,
    I am Automating STATSPACK reporting by modifying the sprepins.sql script.
    Using DBMS_JOB I take the snap of the database and at the end of the day the cron job creates the statspack report and emails it to me.
    I am storing the snapshot ids in the database and when running the report picking up the recent ids(begin snap and end snap).
    From the sprepins.sql script
    variable bid number;
    variable eid number;
    begin
    select begin_snap into :bid from db_snap;
    select end_snap into :eid from db_snap;
    end;
    This fails with the following error:
    DB Name DB Id Instance Inst Num Release Cluster Host
    RDMDEVL 3576140228 RDMDEVL 1 9.2.0.4.0 NO ibm-rdm
    :ela := ;
    ERROR at line 4:
    ORA-06550: line 4, column 17:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    ( - + case mod new not null &lt;an identifier&gt;
    &lt;a double-quoted delimited-identifier&gt; &lt;a bind variable&gt; avg
    count current exists max min prior sql stddev sum variance
    execute forall merge time timestamp interval date
    &lt;a string literal with character set specification&gt;
    &lt;a number&gt; &lt;a single-quoted SQL string&gt; pipe
    The symbol "null" was substituted for ";" to continue.
    ORA-06550: line 6, column 16:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    ( - + case mod new not null &lt;an identifier&gt;
    &lt;a double-quoted delimited-identifier&gt; &lt;a bind variable&gt; avg
    count current exists max min prior sql stddev su
    But when I change the select statements below the report runs successfully.
    variable bid number;
    variable eid number;
    begin
    select '46' into :bid from db_snap;
    select '47' into :eid from db_snap;
    end;
    Even changing the select statements to:
    select TO_CHAR(begin_snap) into :bid from db_snap;
    select TO_CHAR(end_snap) into :eid from db_snap;
    Does not help.
    Please Help.
    TIA,
    Nischal

    Hi,
    could it be the begin_ and end_ Colums of your query?
    Seems SQL*PLUS hs parsing problems?
    try to fetch another column from that table
    and see if the error raises again.
    Karl

  • How can i change the code in when new form instance trigger using JDAPI

    Hi all,
    Can anyone tell me how can i use JDAPI to modify the when-new-form-instance trigger in all my forms,coz we have around 500 FMB's ,if this is possible by using jdapi it will be better for us..
    Thanks in advance..
    Najeeb

    Hi Najeeb,
    The code I've given you should cover the basic steps - you will need to have a basic knowledge of Java if you want to use the JDAPI, there's no way around that unless you go and buy one of the off-the-shelf products for this kind of thing (I think there's one called orcltoolbox..?)
    I've written an application that does all kinds of things to Forms specific to our needs, so it's a bit tricky to just pull out the code you need, but again, the basics will be:
    String formName="C:\some_dir\some_form.fmb";
    FormModule mForm=FormModule.open(formName);
    Trigger myWNFITrig=Trigger.find(mForm,"WHEN-NEW-FORM-INSTANCE");
    String myText=myWNFITrig.getTriggerText();
    And there you have your trigger text, to do with what you please. You could put this code in the main() method of one class if you want to keep things really simple - but see how you get on, if you have any more specific questions, do come back.
    Eric - that's a very good point about using Regular Expressions. I haven't used them in my JDAPI app because I wanted to keep all my .fmbs 6i-compatible for the short-term, and a posting I saw somewhere recommended sticking to Java 1.3. Which rules out the regex facility, which only appeared in Java 1.4. Now, though, I think I needn't have worried - it surely shouldn't matter which version of Java I use to make the changes to the .fmbs. My stupid!
    James

  • WebUtil doesn't work when called from WHEN-NEW-FORM-INSTANCE trigger

    I need WEBUTIL_CLIENTINFO functions to know some information from the client, like IP, JavaVersion, Hostname, OS user, etc. This functions I call through WHEN-NEW-FORM-INSTANCE TRIGGER and this doesn't nor work. I obtain the next message and error:
    oracle/forms/webutil/clientinfo/GetClientInfo.class not found. WEBUTIL_CLIENTINFO.GET_IP_ADDRESS.
    But when I call this WebUtil functions through WHEN-WINDOW-ACTIVATED trigger or through a button it works. Why?. I need call WebUtils in the WHEN-NEW-FORM-INSTANCE trigger!
    Any help will be of great value.

    Basically make a timer...
    Do you have the wu_test_106.fmb file that comes with the webutil install?
    If you look in the wnfi trigger you will see this...
    declare
         fake_timer TIMER;
    begin
         -- Purpose of the fake timer is the we cannot call webutil in this trigger since the
         -- beans have not yet been instantiated.  If we put the code in a when-timer-expired-trigger
         -- it means that this timer will not start running until Forms has focus (and so the webutil
         -- beans will be instantiated and so call canbe made.
         fake_timer:= CREATE_TIMER('webutil',100,NO_REPEAT);
         --create_blob_table;
         null;
    end;And in the form level when-timer-expired you will see this...
         :global.user_home := webutil_clientinfo.get_system_property('user.home');
         :OLE.FILENAME := :global.user_home||'\temp.doc';
         SET_ITEM_PROPERTY('builtins.text_io_item',PROMPT_TEXT,'Write to '||:global.user_home||'\helloworld.txt');
         SET_ITEM_PROPERTY('files.userdothome',PROMPT_TEXT,:global.user_home);

  • Webutil-Problem (not the usual "PRE-FORM", "WHEN-NEW-FORM-INSTANCE" etc.)

    Hello,
    We have an application with lots of modules, where we use webutil to create text files on the client for data exports. The export is called in a WHEN-BUTTON-PRESSED Trigger and usually works fine, but we have the following problem:
    If two modules, where webutil is used, are opened at the same time and one module is closed, webutil does not function anymore in the other module. If we then try to create a text file after closing on module, we get the following error-message:
    Oracle.forms.webutil.file.FileFunctions bean not found.
    WEBUTIL.FILE.FILE_SELECTION_DIALOG_INT will not work.
    It’s not only the FileFunctions bean, all other webutil functions do not work also anymore in the remaining module.
    This is not the usual “PRE-FORM”, “WHEN-NEW-FORM-INSTANCE” etc. Webutil-Problem.
    As I said before, webutil works, but when we close one module with webutil used, it does not work in another open module anymore.
    Any Idea, why this happens and how to solve the problem???
    Kind regards
    Udo

    Hello,
    Yes, both modules work in the the same session and session is not disconnected, when one of the modules is closed.
    Webutill.pll is attached on both forms and all forms in our application using webutil usually work fine with the exception mentioned above.
    It's a bit difficult to explain, what happens in our application, but I try:
    Our application consists of modules that call other modules with call_form or go_form , when the module is open, all in the same session. "Global" Parameters are passed with SHARE_LIBRARY_DATA. Usually the calling forms stays open.
    In the following constellation webutil does not work anymore at a certain point :
    - Open module A (with webutil attached) and webutil works
    - Then module A calls module B (with webutil attached) and webutil works in module B
    - GO_FORM (module A) and webutil still works (while module B is still open)
    - CALL_FORM (module C) (in our case webutil is not attached to this module, but I think that is not the problem) module C closes module B (while module A stays open)
    - After making a choice in module C, module C closes itself with EXIT_FORM.
    - Go back to the open module A, make a new query with the choice made in module C and webutil does not work anymore in module A
    Regards
    Udo

Maybe you are looking for

  • Can't share Safari link via Twitter on iPhone5

    Hi all, I've just upgraded to an iPhone5, latest iOS (6.1.4) and restored my old iPhone 4 set-up via iCloud back-up. Everything's fine so far, except for my Twitter account. It works fine, until I try to share a page I've opened in Safari via Safari

  • Import Format

    Hi Friends ! We are planning to import the Item & Customer data. How we know the file format for these as we need to arrange the excel in the same sequence? Plz advise. With Regards Rekha

  • Vista Install Problems

    Hello, I've been having some problems trying to install SQL Sever 2005 on my local Vista machine.  Using the ISO file that I've downloaded from the MSDN site (twice now) I get an error stating that the Sql.cab file is corrupt.  I at first thougt that

  • Problems exporting to PDF in CS4, InDesign stops working

    I'm getting an "InDesign has Stopped Working" message when exporting to PDF. It's a 370 page document and the error comes at the very end of the creation process. My only option at that point is to shut it down and try again. Funny thing is, when I e

  • Imac USB not recognised

    Hi everyone, my iMac does not recognise anything I plug into the USB- not my Garmin, nor Kindle, not even a USB memory stick. I have tried everything, it just doesn't see it! Anybody got any ideas? Thanking you in advance. karen