How to add an object in JNDI when a server starts?

I have an integration app. The app contains EJB project. The project contains EJB which reads data from LDAP.
My first version of EJB contains the following code:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, strProvider);
env.put(Context.SECURITY_AUTHENTICATION, strAuth); env.put(Context.SECURITY_PRINCIPAL,strPrincipal); env.put(Context.SECURITY_CREDENTIALS,strCredentials);
DirContext dirCtx = new InitialDirContext(env); // exception
All connection properties are hardcoded and it is not a good practice.
Also I can put those properties into deployment descriptor. But I am going to have some EJBs and each EJB has to have those properties into descriptors. It is not useful.
My idea: I would like to have whatever object which is called automatically when a server starts; this object creates InitialDirContext and put the context into JNDI. All EJBs lookup the context by a name. But I don't know how to do that.
And another question: how to change connection properties dynamically? My idea is putting the properties in XML Cache. And my object (which creates InitialDirContext) reads the properties from XML Cache. Can I handle a message that my properties in XML Cache have been changed and in this cases my object reads new properties and calls rebind() to update InitialDirContext?
Thanks,
Ivan

To bind an object into the JNDI tree check the documentation here:
http://e-docs.bea.com/wls/docs81/jndi/jndi.html#475702
If this is to be used by all your applications that you deploy on the server check out the startup/shutdown class documentation here:
http://edocs.bea.com/wls/docs81/ConsoleHelp/startup_shutdown.html
Cheers
IV

Similar Messages

  • How to Add New Object?

    HI,
    Any body can say how to add new object. For Example: The Document need to link with Invoice Transaction (T.Code: VF01, Table: VBRK/VBRP).
    Points will be rewarded, if information is useful.
    Tks
    Mani.

    Hi
    You can create New objects using the T.code: SE80.
    You can make an object link to SAP objects that are not shown in the possible entries list. To do this, proceed as follows:
    1. In the standard system, there are already two special screens for the module pools SAPLCV130 and SAPLCV140 for the linked SAP object.
    You must create two new screens with the same number for the module pools SAPLCV130 and SAPLCV140. The processing logic must follow that of screen 1204 in program SAPLVC130.
    2. Create function module OBJECT_CHECK_XXXX (XXXX = object name) If the object can be classified, this function module already exists .
    Otherwise copy the function module for linking equipment DOCUMENT_CHECK_EQUI and change it as required for the new object.
    Regards
    S.Sivakumar
    Reward points if useful----

  • How do I make objects fade in when scrolling?

    How do I make objects fade in when scrolling? Thanks!

    Do you know of a way to make Edge animations play when scrolled into view on a Muse website?
    Apple does this well here: http://www.apple.com/ios/ios7/features/

  • Help-Cubes are not getting started when Analytical server started in 11.1.1

    Installed Oracle Essbase Analytical server along with Shared Services, Provider Services and Integration Services thru EPM v11.1.1.3. Shared services and provider services on Windows 2003 and Essbase Analytical Services and Integration Services on UNIX/AIX. All the components got configured successfully. Copied the essbase.sec from the server which has previous version (v11.1.1.1.0) of Essbase. We have been encountering couple of problems. The first one is the applications(cubes) didn't start when the analytical server started. The second one is when trying to start using MAXL script, the applications took long time (more than 30 minutes) to start.
    Any suggestions that you may have in resolving this are appreciated. Thanks,

    In the application properties, is the box 'Start application when Essbase server starts' checked? If not, that's why they didn't automatically start. Also, once you started them manually, does it still take 30 minutes to start? Or is shutdown and startup faster now?
    Sabrina

  • How to add an object on mouse click?

    i am trying to add an object on user's mouse click...but not getting how?
    can anyone help me?

    You could create the movieclip object and put it in the library with a linkage name, e.g. mcExample and then on the main _root. timeline add something like:
    this.onMouseDown = function(){
    mcExample = this.attachMovie("mcExample", "mcExample", 1);
    This attaches the movieclip from the library onto the stage when the left mouse button is pressed. You can then manipulate the movieclip like any other using its identifier: mcExample. If you want to change the name of the attached movieclip then change the second parameter of attachMovie

  • How to add a new excel sheet  when the row count exceed more than 65 k

    am working on business intellignence am able to export the data to excel sheet but my data exceeds the sheet limit so how to add to another sheet when the last row is hit ..???
    any suggestions warm welcome...
    help me to fix this issue...

    You've not specified how you're generating the Excel file. Are you using POI? JExcel? What?
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • How to bind an object to JNDI tree in iAS?

    Hi all,
    When I try to bind a string object to jndi tree, the following exception
    occurs:
    javax.naming.NamingException: Unable to get object instance from reference.
    Roo
    t exception is javax.naming.NamingException: Can't bind instance of class
    java.lang.String
    at com.netscape.server.jndi.RootContext.bindCtx(Unknown Source)
    at com.netscape.server.jndi.RootContext.rebind(Unknown Source)
    at com.netscape.server.jndi.RootContext.rebind(Unknown Source)
    at javax.naming.InitialContext.rebind(InitialContext.java:385)
    at jsp.APPS.bmx.test2._jspService(test2.java:76)
    at jsp.APPS.bmx.test2.service(test2.java:42)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    The code fragment is:
    Context ctx = new InitialContext();
    String str = "hell,every one!";
    ctx.rebind("abc", str);
    Can anyone give some help? Thanks in advance.
    Johnson

    To bind an object into the JNDI tree check the documentation here:
    http://e-docs.bea.com/wls/docs81/jndi/jndi.html#475702
    If this is to be used by all your applications that you deploy on the server check out the startup/shutdown class documentation here:
    http://edocs.bea.com/wls/docs81/ConsoleHelp/startup_shutdown.html
    Cheers
    IV

  • How to add  z object to root object in BOL

    hi,
    I have to add my z object to BuilStandardAddress (standard object for BP Address ).I hav created a external object by using ztable.I can see that object in transaction GENIL_MODEL_BROWSER as a Root Object but I hav to add this object as dependent object under BuilStandardAddress .
    Please suggest any possible solution for this.
    Thanks in Advance.
    Hem

    hi carsten,
    Thanks a lot for reply.
    Acc to my opinion there is 2 method first one is enhance standard implementaion class.
    second one is to use this class.CL_CRM_GENIL_GEN_TABLE_OBJ
    I opt. second mehtod:
    Actually ,Our requirement is that we hav to add some custom  fields in addresss view.If weadd custom fields through EEWB then it adds fields to builheader rather then standard address.To achieve this I have created a external object and assign a impleimentation class (CL_CRM_GENIL_GEN_TABLE_OBJ). after this I hav define Object defination in which I define this object as dependent object of builstandardaddress.and give my z table name.After that I hav define Model defination in which i hav define relationship.By doing this I am able to use my object in view.Now I added this z attribute to the standardaddress node of standaddress view of component BP_ADDR.
    Now, I can see this field on UI screen but My Implementation Class has some methods(like modify, Save )that will save the data in z table.these methods are not calling at runtime.
    Plz suggest any solution
    Hem
    Edited by: janawa hemlata on Dec 4, 2008 7:31 AM

  • How to add new object class to a material ?

    Hi experts,
    I have to add new object class to a material ( classification class ) and then add new characteristics values for the material ....But i do not know which FM to do this , If you please to give me the solution for this problem
    PS: rewards immediately
    Thanks,

    Hi,
    Check this  CALL FUNCTION 'CLVM_CLASS_BOOK' Run it for IN UPDATE TASK
    Reward if useful,

  • How to add Documents object faster(DI-API)

    Hello,
    I investigated the time concerning adding to Order Document using DI-API.
    Result,339sec per 300 document(for each document has
    4 items ,program was not use Start/End transaction).
    This result is not so bad, but i wish faster time.
    Please suggest faster way to add Documents object using
    DI-API.
    My source code is below.
    vINV = vCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOders)
    For I = 1 To 300
    vINV.CardCode = "test"
    vINV.Docdate = "2005/12/31"
    vINV.DocDueDate = "2005/12/31"
    vINV.NumAtCard = "test"
       For J = 0 To 3
         vINV.Lines.ItemCode = "test"
         vINV.Lines.Quantity = 1
         vINV.Lines.Price = 400
         if J <> 3 Then
           vINV.Lines.add()
         End If 
        Next J
       RetVal = vINV.Add
    Next I

    Hi Jiro,
    I have never worked with this before, but maybe you can investigate using the DI Server. Search the forum for the DI Server. Herewith an extract from the DI Server help file:
    <i>SAP Business One - Data Interface Server (DI Server) is a Component Object Model (COM) service running on a server that enables multiple clients to access and manipulate SAP Business One company database, using SOAP version 1.1 messages.
    The DI Server uses the DI core to enable the same functionality provided by the DI API with the following advantages:
    - Server architecture.
    - <b>Improved performance.</b>
    - Connection pooling mechanism.
    - Generic interface.
    The DI Server operates with SAP Business One application version 2004.</i>
    Hope it helps,
    Adele

  • Executing a program when the server starts

    I have developed a chat program and to run it I have type "java ChatManager".
    Is there a way where this program can start automatically when I start the tomcat.
    Regards,
    Sharad

    The chat application is a java file. I need to keep it running so that I can use it in my applet. The problem is after I start the tomcat, I have start the chat application and for this I open a new window and type "java ChatManager". Once this is done I can start using the chat applet. Is there a way, where the chat application starts automatically when the tomcat starts. Do I need to add something in the server.xml file for this.
    Regards,
    Sharad

  • Initialising class when J2EE server starts

    Hi,
    I am facing a problem. I wish to instantiate a class when the J2EE/ tomcat server starts. This is similar to the property set in weblogic as
    weblogic.system.startupClass.startup = <name of ur startup class>
    Here we can specifiy the class to be instantiated during startup of server.
    Can i do something similar in tomcat/ j2ee server?
    I do not wish to use a servlet since my webapplication contains jsps and other supporting classes and my own apis.
    Thank you in adv.
    ...supriya.

    if you use ServletContext Listeners you should be ready as far as web app is concerned. Most servers I believe offer JMX integration so that you can listen for server startups. : )

  • Start deployed applications when J2EE Server starts

    Hi experts,
    This is my problem.
    I've updated my Netweaver 04s Developer Workplace from SPS1 to SPS10.
    The problem I have is that when I start my J2EE Server via MMC, the applications (j2ee,ear,webdynpro,...) I deployed don't start.
    If in my Visual Administrator I go to server->services->deploy most of them are not started. I can start them manually, but that's not a solution...
    I suppose there are any possibities to set this applications to start when the server is started.
    Any ideas?
    Thanks a lot.
    Alberto.

    Hi Alberto
    If you can start the services manually w/o problems, then maybe you can try to change the startup mode to 'always' so that the service is started automatically. You should be able to check this via Configtool. Switch to the 'configuration editor' mode and go to cluster_data -> server -> cfg -> services. Look for the service and make click on the propertysheet. Usually you can modify the startup mode there.
    I hope this helps.
    Regards,
    Désiré

  • How to add two objects on scene and how to rotate them?

    I am beginer on 3d. I am trying do write applet where are 3x3x3 rubic.
    My plans are to have 27 litle cubes. There are 6 flats (9 cubes in a flat) so i have six objects groups. My problem at this moment is that i cant find out how to make two objets. Each of this two objects consists from couple more litle objects. Some of litle objects can be in first and second big object. For example it can be two flats of rubic (corner).
    Is anybody have some examples or somehow to hepl me to find out.
    Thanks a lot

    I have code :
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.behaviors.mouse.*;
    import com.sun.j3d.utils.universe.SimpleUniverse;
    import javax.media.j3d.*;
    import javax.vecmath.AxisAngle4f;
    import javax.vecmath.Color3f;
    import javax.vecmath.Vector3f;
    public class RubicApplet extends Applet implements MouseListener
         TransformGroup objRotate = null;
    public BranchGroup createSceneGraph(SimpleUniverse su,Canvas3D canvas)
         // Create the root of the branch graph
         BranchGroup objRoot = new BranchGroup();
         objRoot.setCapability(BranchGroup.ALLOW_DETACH);
    Transform3D transform = new Transform3D();
         transform.setRotation(new AxisAngle4f(.5f,1f,1f,.5f));
    BoundingSphere behaveBounds = new BoundingSphere();
    // create Cube and RotateBehavior objects
    objRotate = new TransformGroup(transform);
    objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
    objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
    objRotate.setCapability(TransformGroup.ENABLE_PICK_REPORTING);
    // Colors
    Color3f gray = new Color3f(0.2f,0.2f,0.2f);
    Color3f red = new Color3f(1.0f,0.0f,0.0f);
    Color3f white = new Color3f(1.0f,1.0f,1.0f);
    Color3f yellow = new Color3f(1.0f,1.0f,0.0f);
    Color3f green = new Color3f(0.0f,1.0f,0.0f);
    Color3f blue = new Color3f(0.0f,0.0f,1.0f);
    Color3f purple = new Color3f(1.0f,0.0f,1.0f);
         // Object possition
    float x=-0.5f;
    float y=-0.5f;
    float z=-0.5f;
    objRoot.addChild(objRotate);
         // colors for: back, front, right, left, bottom, top
    Color3f[] myColors0 = {white,gray,gray,red,blue,gray};
    RCube cube1 = new RCube(myColors0,new Vector3f(x-1,y-1,z-1));
         // colors for: back, front, right, left, bottom, top
    Color3f[] myColors1 = {gray,gray,gray,red,blue,gray};
         RCube cube2 = new RCube(myColors1,new Vector3f(x-1,y-1,z+1));
         // colors for: back, front, right, left, bottom, top
    Color3f[] myColors2 = {gray,yellow,gray,red,blue,gray};
         RCube cube3 = new RCube(myColors2,new Vector3f(x-1,y-1,z+3));
    // colors for: back, front, right, left, bottom, top
    Color3f[] myColors3 = {white,gray,gray,red,gray,gray};
         RCube cube4 = new RCube(myColors3,new Vector3f(x-1,y+1,z-1));
    objRotate.addChild(cube1);
    objRotate.addChild(cube2);
    objRotate.addChild(cube3);
    objRotate.addChild(cube4);
    MouseRotate myMouseRotate = new MouseRotate();
    myMouseRotate.setTransformGroup(objRotate);
    myMouseRotate.setSchedulingBounds(new BoundingSphere());
    objRoot.addChild(myMouseRotate);
    MouseTranslate myMouseTranslate = new MouseTranslate();
    myMouseTranslate.setTransformGroup(objRotate);
    myMouseTranslate.setSchedulingBounds(new BoundingSphere());
    objRoot.addChild(myMouseTranslate);
    MouseZoom myMouseZoom = new MouseZoom();
    myMouseZoom.setTransformGroup(objRotate);
    myMouseZoom.setSchedulingBounds(new BoundingSphere());
    objRoot.addChild(myMouseZoom);
    // Let Java 3D perform optimizations on this scene graph.
    objRoot.compile();
         return objRoot;
    public RubicApplet()
    setLayout(new BorderLayout());
    GraphicsConfiguration config =SimpleUniverse.getPreferredConfiguration();
    Canvas3D canvas3D = new Canvas3D(config);
    canvas3D.addMouseListener(this);
    add("Center", canvas3D);
    SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
    BranchGroup scene = createSceneGraph(simpleU,canvas3D);
         simpleU.getViewingPlatform().setNominalViewingTransform();
    simpleU.addBranchGraph(scene);
    public static void main(String[] args)
    Frame frame = new MainFrame(new RubicApplet(), 600, 600);
         public void mouseClicked(MouseEvent e)
         public void mouseEntered(MouseEvent e)
         public void mouseExited(MouseEvent e)
         public void mousePressed(MouseEvent e)
         public void mouseReleased(MouseEvent e)
    I need to rotate with some event two cubes and with some other event rotate three cubes

  • How to add new Object Type In Mass

    Hi Expert,
    We have to required change Payment term of Customer (ZTERM) in scheduled Agreement,
    we have gone through Mass, but presently no object type available to change in scheduled Agreement, So can we add the new object in Mass? & How? Please help.
    Regards
    BK GAIKWAD

    Hi,
    Presently no standard object type avaialble for Sch. agr.(Sales)
    Go for BDC for updation of your field (try with LSMW also)
    Thanks
    Chidambaram

Maybe you are looking for