Get all JNDI names - EJBLocalHome

Hello,
I've tried to get all JNDI names that are deployed on the J2EE Server RI Version 1.3.1. It worked fine with the JNDI names of the EJBs with Remote Client view (EJBHome), but did not work with EJBs with local Client View (EJBLocalHome).
Does anyone knows how could work? Or wether it isn't possible.
Thanks
Here's my code:
InitialContext ct = new InitialContext();
NamingEnumeration bindings = ct.listBindings("");
while (bindings.hasMore() ) {
Binding b = (Binding) bindings.next() ;
Object object = b.getObject();
if(object instanceof Context) {
Context aCon = (Context)object;
NamingEnumeration n = aCon.listBindings("");
while (n.hasMore()) {
Binding b2 = (Binding) n.next() ;
if (b2.getClassName().equals("javax.naming.Reference")) {
Object objRef = ct.lookup("ejb/"+ b2.getName());
if (objRef instanceof EJBLocalHome) {
     System.out.println("localHome");
//here I want to access the EJBLocalHome Interface
     else if (objRef instanceof EJBHome) {
     System.out.println("Home");
     else                              System.out.println("nothing");
                    

I use the listBindings() method in order to get all References to a JNDI name. I do not know how to get all JNDI names that are local. How can I check them?

Similar Messages

  • How to get the JNDI name of an EJB from within itself

    Hello,
    I'm trying to find a way to get the JNDI name of a session bean from
    within itself.
    In the application I'm working on we need to support multiple
    customers. In order to do that, each EJB has a normal home and remote
    interface, a base class bean implementation and different children
    bean implemetations for each customer (when the logic for the
    customers is different). JNDI is used to get the proper implementation
    based on the customer.
    I've got an EJB that provides some services that are the same for all
    customers, except for the fact that it contains one variable that
    should have a different value depending on the customer. I don't want
    to creat subclasses just for that. What I want is to be able to get
    the JNDI name and set the variable based on the it.
    Is there a way to get the JNDI name for the EJB from within itself?
    TIA
    MJ

    Hi Pradeep,
    Please try referring to this post which is discussed earliar and seems its also answered.
    http://forums.adobe.com/thread/504861
    Thanks,
    Bhasker Chari

  • How to get all property names and values of an bean instance at runtime?

    How can I get all property names and values of an bean instance at runtime?
    (The class of the bean instance is dynamic and I can not know before I write the code .)

    Look at Class. It has a way to get at all public methods and attributes.
    If you need to get to private attributes you can do what the Introspector does and expect the methods to follow the Bean pattern and pull the attributes out based upon that. Privates are all hidden from direct access but through the Bean Pattern they can be figured out.

  • How get all table name from database

    hi master
    sir
    how get all table name from database

    The big question is 'why'.
    Selecting from view 'dba_tables' will indeed give the list of all tables in the database, but that includes the dictionary tables and the internal tables, and many others that are probably not of interet to a person who needs to ask this question. Besides, the dba_tables view requires access to a DBA account.
    There are several other views: "user_tables" will list all the tables in this user's schema; and "all_tables" will list all the tables this user can access in some way.
    The above do not, of course, include any information about synonyms, sequences, views, indexes and so on.
    The correct answer and the meaningful answer may be two different things.

  • Get All instance names in the stage

    hi,
    is there any way to get all instance name of the objects presents on the stage ? trace them for example
    thank you

    thank you, it's the correct answer but i still can't solve my problem ,
    the thing is that am using a code from http://www.freeactionscript.com that make enemie follow the player, but i need to do some modification, i need to detect collision between enemies so they will not get the one into the other and the thing that i cannot found their instance name, even when i used your function i only get "player_mc : _level0.player_mc" at the output,
    here is the code, i will be really greatful if you can find a way to help me solve this problem .
    ps :
    am trying to write my own code that make enemie follow the player, coz this one looks very complicated
    thank you
    the code :
    * Game Enemy AI Behavior - Run Away & Follow Player
    * Version:           1.0
    * Author:           Philip Radvan
    * URL:                     http://www.freeactionscript.com
    var enemiesArray:Array = new Array();
    var radians:Number = 180/Math.PI;
    createEnemies(5, "typeA", "e1");
    createEnemies(5, "typeB", "e2");
    createEnemies(5, "typeC", "e3");
    // createEnemies(number of enemies, behavior)
    // use ex: createEnemies(10, "slow", "myLinkedMovieClip);
    function createEnemies(enemyAmount:Number, enemyBehavior:String, enemyLibraryClip:String):Void
              //run a for loop based on the amount of enemies
              for(var i = 0; i < enemyAmount; i++)
                        //set temporary variable that will hold the new enemy attributes
                        var tempEnemy:MovieClip = _root.attachMovie(enemyLibraryClip, "enemy"+_root.getNextHighestDepth(),_root.getNextHighestDepth())
                        //give new enemy a random x/y position based on stage width/height
                        tempEnemy._x = random(Stage.width);
                        tempEnemy._y = random(Stage.height);
                        tempEnemy._rotation = random(360);
                        //set enemy behavior
                        if(enemyBehavior == "typeA")
                                  //define enemy characteristics
                                  tempEnemy.speed = 1
                                  tempEnemy.turnRate = .05
                                  tempEnemy.agroRange = 200;
                                  tempEnemy.mode = "follow"
                        else if(enemyBehavior == "typeB")
                                  //define enemy characteristics
                                  tempEnemy.speed = 4
                                  tempEnemy.turnRate = .5
                                  tempEnemy.agroRange = 200;
                                  tempEnemy.mode = "follow"
                        else if(enemyBehavior == "typeC")
                                  //define enemy characteristics
                                  tempEnemy.speed = 1
                                  tempEnemy.turnRate = .2
                                  tempEnemy.agroRange = 100;
                                  tempEnemy.mode = "run"
                        //define variables that are used to calculate following
                        //*don't change these*
                        tempEnemy.distanceX = 0;
                        tempEnemy.distanceY = 0;
                        tempEnemy.distanceTotal = 0;
                        tempEnemy.moveDistanceX = 0;
                        tempEnemy.moveDistanceY = 0;
                        tempEnemy.moveX = 0;
                        tempEnemy.moveY = 0;
                        tempEnemy.totalmove = 0;
                        //add new enemy to array
                        enemiesArray.push(tempEnemy)
    //Update enemies function
    function updateEnemies():Void {
              //run a for loop based on the amount of enemies
              for(var i = 0; i < enemiesArray.length; i++)
                        //set temporary variable that will hold the new enemy attributes
                        var tempEnemy:MovieClip = enemiesArray[i];
                        //run follow function with temporary enemy as the follower
                        updatePosition(tempEnemy, player_mc);
    // updatePosition(follower, target)
    // use ex: updatePosition(myEnemyMovieClip, playerMovieClip)
    function updatePosition(follower:MovieClip, target:MovieClip) {
              //calculate distance between follower and target
              follower.distanceX = target._x-follower._x;
              follower.distanceY = target._y-follower._y;
              //get total distance as one number
              follower.distanceTotal = Math.sqrt(follower.distanceX * follower.distanceX + follower.distanceY * follower.distanceY);
              //check if target is within agro range
              if(follower.distanceTotal <= follower.agroRange){
                        //calculate how much to move
                        follower.moveDistanceX = follower.turnRate * follower.distanceX / follower.distanceTotal;
                        follower.moveDistanceY = follower.turnRate * follower.distanceY / follower.distanceTotal;
                        //increase current speed
                        follower.moveX += follower.moveDistanceX;
                        follower.moveY += follower.moveDistanceY;
                        //get total move distance
                        follower.totalmove = Math.sqrt(follower.moveX * follower.moveX + follower.moveY * follower.moveY);
                        //apply easing
                        follower.moveX = follower.speed * follower.moveX / follower.totalmove;
                        follower.moveY = follower.speed * follower.moveY / follower.totalmove;
                        //move & rotate follower
                        if(follower.mode == "follow")
                                  follower._x += follower.moveX;
                                  follower._y += follower.moveY;
                                  follower._rotation = Math.atan2(follower.moveY, follower.moveX) * radians;
                        else if(follower.mode == "run")
                                  follower._x -= follower.moveX;
                                  follower._y -= follower.moveY;
                                  follower._rotation = (Math.atan2(follower.moveY, follower.moveX) * radians)+180;
    //onEnterFrame that executes the updatePosition updateEnemies every frame
    _root.onEnterFrame = function(){
              updateEnemies();
    //start/stop drag for player_mc
    player_mc.onPress = function(){
              startDrag(this);
    player_mc.onRelease = function(){
              stopDrag();

  • How to get all parameter names along with their values in stored procedure which is being executed

    Im using sql server 2012, is there any possible way to get all the parameters of a stored procedure along with the values passed to it.
    I need these things to build a xml. I mean this should happen in the procedure which being executed and it should be common for all the procedures.
    For example, let us suppose we have to procedures,
    uspSave, @name='test' @age=20
    uspDelete @id=2
    now in uspSave procedure, i need to get @name, @age and the values 'test', 20 and in uspDelete, i should get @id with value 2.
    For getting the column names, i tried this,
    select parameter_name from information_schema.PARAMETERS where specific_name=OBJECT_NAME(@@procid)
    now is it possible to loop through the result of above query and can we get the values.

    I think  you need running SQL Server Profiler to capture this info even in SQL Server 2012.
    Best Regards,Uri Dimant SQL Server MVP,http://sqlblog.com/blogs/uri_dimant/
    Blog : MS SQL Development and Optimization
    Blog : Large
    scale of database and cleansing

  • Function Module to get all feild names in a structure

    Hello Friends,
    Is there a function module,where i give the structure name and get all the feild names within that structure.
    regards
    kaushik

    Hi,
    You can use the for run time type descriptor classes to do this :
    Here is a simple example :
    REPORT  z_assign_comp.
    TYPE-POOLS : slis.
    include <icon>.
    "&   Dynamic Programming ! Using Structure Descriptior Class.          *
    DATA: BEGIN OF line OCCURS 0,
            col1 TYPE i,
            col2(10) TYPE c,
            col3 TYPE i,
          END OF line.
    FIELD-SYMBOLS : <fs> TYPE ANY.
    FIELD-SYMBOLS : <itab_line> TYPE ANY.
    DATA : BEGIN OF t_comp OCCURS 0,
            comp(5) TYPE c,
           END OF t_comp.
    DATA : l_struc TYPE REF TO cl_abap_structdescr.
    DATA : l_typedesc TYPE REF TO cl_abap_typedescr.
    DATA : lt_comp TYPE abap_compdescr_tab,
           w_comp LIKE LINE OF lt_comp.
    line-col1 = 11.line-col2 = 'SAP'.line-col3 = 33.
    APPEND line.
    line-col1 = 44.line-col2 = 'P.I.'.line-col3 = 66.
    APPEND line.
    ASSIGN line TO <itab_line>.
    "Call the static method of the structure descriptor describe_by_data
    CALL METHOD cl_abap_structdescr=>describe_by_data
      EXPORTING
        p_data      = <itab_line>
      RECEIVING
        p_descr_ref = l_typedesc.
    "The method returns a reference of  a type descriptor class therefore we
    "need to Cast the type descriptor to a more specific class i.e
    "Structure Descriptor.
    l_struc ?= l_typedesc.
    "Use the Attribute COMPONENTS of the structure Descriptor class to get
    "the field names of the structure
    lt_comp = l_struc->components.
    LOOP AT line.
      WRITE :/ 'Row : ', sy-tabix.
      LOOP AT lt_comp INTO w_comp.
    "   Using the ASSIGN component ,assigns a data object to a field symbol.
        ASSIGN COMPONENT w_comp-name OF STRUCTURE line TO <fs>.
        WRITE :/ w_comp-name, ' ', <fs>.
      ENDLOOP.
    ENDLOOP.
    Hope this helps.
    regards,
    Advait

  • How to get all GroupSpaces name using Spaces API, irrespective of user logged in?

    Hi
    Can anyone please tell me, how to retrieve list of all group spaces using Spaces API. I have used this method getGroupSpaces(null) to retrieve all group spaces, however it returns only the logged in members groups.
    Is there any way to get all groupspaces details?
    Regards
    Raj

    i don't think so other than admin user can get all group spaces informaiton, is it possible in webcenter portal:spaces default deployment?

  • Method to get all File names in a directory

    Hallo together,
    has Java any method, to get the file names in a specific directory?
    Regards,
    Martin

    ... or simply list() if you're interested in file names only.

  • How to get all step names within a group or a sequence?

    Hi,
    I'd like to show all the names of the steps within a sequence or a group.
    I wonder if there is a simple function which can be used directly, such as RunState.PreviousStep.Name.
    I tried via a foolish way to append each step name, though it shows all the step names but I still think there is a simple function can access all the step names.
    Can anyone give me some suggestion, thanks a lot!!!
    Solved!
    Go to Solution.
    Attachments:
    ShowAllStepName.seq ‏8 KB

    I've doctored up your sequence a little.  But yes you have to loop.
    Also, what format do you want the names in?
    Hope this helps,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~
    Attachments:
    ShowAllStepName.seq ‏8 KB

  • Get the jndi names

    i have the next code for conect to one weblogic server.
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.T3InitialContextFactory");
    p.put(Context.PROVIDER_URL, url);
    using the jndi name i can load the ejb but how can i list the jndi names?
    thanks

    I am using ejb 2, jdk 1.4.2 and weblogic 8.1 and for listing i haven't list() into the context.
    can you help me please?
    thanks

  • Getting all service names and users

    Hi all,
    Can i ger all service names in database and users related to that service names .
    Thanks in advance.

    Hi,
    I don't think that's possible in one query given the fact that you can connect to only one instance/database at a time...
    You could post this question also at the [Database-General|http://forums.oracle.com/forums/forum.jspa?forumID=61&start=0] forum, though...

  • Get all file names in a folder, set each as text variable

    First off, I do not know if this is possible.
    For an app I'm writing, I need it to get a list of all the file names inside of a folder, then set a text variable for each of the file names. The app will then display a list of those items, which I know what to do from there.
    If anyone knows how I would be able to do this, or alternatives, I would be extremely grateful.
    Thanks in advance!

    just use any colon separated path (i.e., the desktop would be {color:blue}HD:Users:yourname:Desktop:{colors}) basically, path specifiers come in a number of types:
    # text designations - HD:Users:yourname:Desktop (just a normal text line)
    # posix designations - /Users/yourname/Desktop (how unix expects paths to be written)
    # alias designations - alias "HD:Users:yourname:Desktop" (a pointer to an actual, existing file system element
    # file system referents - file "HD:Users:yourname:Desktop:somefile", folder "HD:Users:yourname:Desktop", etc -
    # file system objects - Folder "Desktop" of folder "yourname" of folder "Users" of disk "HD"
    each has its advantages and disadvantages, and you can coerce between them (though not completely - you need to convert #5 to text before you can convert it to #3, for instance.

  • Getting jms queue jndi name via jmx

    Hi all,
    I'm writing a utility that will help us migrate jms messages to new servers, stores, etc. I would like to connect to a server and programmatically discover the jndi names of all the queues and topics on that server. I know how to get all the destination mbeans via jmx, but I don't see a way to get the jndi names for them. They have a Name attr, but it's not the jndi name. Is this possible with WLS 9.2?
    thanks

    I believe the attribute on the Destination Bean would be JNDIName, but I would use WLST to browse the information available via JMX. I.e.
    1) connect to the domain
    2) cd into the approriate jms system resource. Then perform ls() and cd() until you find the right information.
    3) Then use print cmo - this will give you the JMX object name. ls() will show you the attribute name.
    4) So you can either look up the MBeans directly using JMX or walk down the domain hierarchy

  • Getting jndi name for jms queue via jmx?

    All,
    I'm trying to write a utility that will do a 9.2-style message export against 8.1 I think I have it all figured out except that I don't know how to get the jndi name of a queue or topic via jmx. I'm using jmx to find queues and subscriptions that have messages waiting, then trying to connect to them to siphon off the messages. I can't just browse jndi for any queue I find because I also want to access the durable subscriptions, for which I need the client and subscriptions ids. Is there a way to map from the jms destination runtime mbean to the jndi name? The getDestination() method isn't supported (throws an exception.)
    thanks

    Hi John,
    You can get destination JNDI names by looking up their value in the JMX configuration mbeans rather than the runtime mbeans. The client-id and subscription-name are available on the JMSDurableSubscriberRuntime mbean.
    Regards,
    Tom

Maybe you are looking for

  • Rental lock up

    i just downloaded a rental movie, but started the video about half way through the download.  Everything was fine until the movie locked up (froze) and became unresponsive.  Even iTunes became unresponsive.  i had to force quit to even use my Mac. no

  • Need to fix a Windows 7 Ethernet IP Configuration?

    Background There is a need to see, my MacBook Pro external or internal hard-drives while using Windows 7 Home Premium running from BOOTCAMP, from my MacBook using an Ethernet cable. While using the Mac OS X on both computers there is no problem with

  • Sub contracting vendor returns

    Hi, We have an issue that, when we return to vendor a sub contract Finished goods from Quality Inspection (T code QA32).System will return components(mvmt 544) also along with FG but my clients want only the FG should be returned to Vendor not compon

  • SQL Developer Connection Problem (osx)

    Hi, I have a macbook pro with 10.5 and I installed sqldeveloper to acess a db (through a proxy). By clicking TEST I got "I/O exception: The network adapter could not establish the connection". I seems that I have a problem connecting the DB. However

  • Unable to launch sapgui for Java 7.00

    Hi, I encountered the following error when launching sapgui for java: [root@family home]# /opt/SAPClients/SAPGUI7.00/bin/guistart /H/n4shost/S/3201&expert=true [1] 6939 [root@family home]# ############################# ERROR #########################