Uniquly Identifying Enterprise Applications? - Websphere

This is a discussion on Uniquly Identifying Enterprise Applications? - Websphere ; I am implementing a new ApplicationProperties Module for a Clustered Environment. In any given node, there may be 2 or more instances of the same codebase found in separate Enterprise Applications. I've noticed in there is a java system property ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: Uniquly Identifying Enterprise Applications?

  1. Uniquly Identifying Enterprise Applications?

    I am implementing a new ApplicationProperties Module for a Clustered Environment.
    In any given node, there may be 2 or more instances of the same codebase found in separate Enterprise Applications.

    I've noticed in there is a java system property the Websphere loads named "server.root"

    in the server root there is a logs folder. and in that there are of course logs. another interesting fact is that Websphere has created per Application, a folder in which the System.out/System.err are being written to. The exact names of these folder found in the logs directory are numerous places throughout the system.

    Oh Great! It seems that Websphere has some sort-of unique ApplicationId. I'll just refer to this illusive name as the "instanceId"

    funny thing is, I have no Idea what I'm really doing here. Is my hunt for the illusive instanceId on the right track? should I be using JNDI to get this instanceId?

    please throw this noobie a bone!

    -Thanks

    Ryan


  2. Re: Uniquly Identifying Enterprise Applications?

    *** CORRECTION ***

    I am implementing an ApplicationProperties Module for a Clustered Application.
    per our configuration requirements, In any given cell, there may be 2 or more instances of the same codebase found in separate/paralell Enterprise Applications.

    I've noticed in there is a java system property in Websphere, named "server.root" which basicly takes me to directory containing the applications for a particular node.

    ***in the ${server.root}/logs/* there are some folders that seem to have unique per Application names associated to them. EXP: the System.out/System.err are being written to a unique folder; the name seem to be quite possibly a Unique instanceID(I'll just call it instanceID from here on out). This instanceID can also be found in various places throughout enclosing cluster.

    Oh Great! It seems that Websphere has some sort-of unique ApplicationId or what I like to call the 'instanceId'

    funny thing is, I have no Idea what I'm really doing here. Is my hunt for this illusive instanceId on the right track? should I be using JNDI to get this instanceId?

    please throw this noobie a bone!

    -Thanks again

    Ryan






  3. Re: Uniquly Identifying Enterprise Applications?

    rheaghen@gmail.com wrote:
    > I am implementing a new ApplicationProperties Module for a Clustered
    > Environment. In any given node, there may be 2 or more instances of
    > the same codebase found in separate Enterprise Applications.
    >
    > I've noticed in there is a java system property the Websphere loads
    > named "server.root"
    >
    > in the server root there is a logs folder. and in that there are of
    > course logs. another interesting fact is that Websphere has created
    > per Application, a folder in which the System.out/System.err are
    > being written to. The exact names of these folder found in the logs
    > directory are numerous places throughout the system.
    >
    > Oh Great! It seems that Websphere has some sort-of unique
    > ApplicationId. I'll just refer to this illusive name as the
    > "instanceId"
    >
    > funny thing is, I have no Idea what I'm really doing here. Is my
    > hunt for the illusive instanceId on the right track? should I be
    > using JNDI to get this instanceId?


    What problem are you trying to solve ?

  4. Re: Uniquly Identifying Enterprise Applications?

    rheaghen@gmail.com wrote:
    > Basically My Clustered Application is going through an identity crisis.
    >
    > I've got cells with 2 or more instances of the same application. I want each instance of this application to identify it's self.
    >
    >


    To what purpose? The whole point of clustering is that every instance is
    identical and interchangeable.

  5. Re: Uniquly Identifying Enterprise Applications?

    Basically My Clustered Application is going through an identity crisis.

    I've got cells with 2 or more instances of the same application. I want each instance of this application to identify it's self.



  6. Re: Uniquly Identifying Enterprise Applications?

    yes, I completely agree that every instance should identical and this is exactly what we're moving towards, as were still migrating to a clustered environment. Our code base has just recently become generic. just last year was driven by a large configuration.properties file running on Jrun3, that contained all the hard coded references to everything.

    well... try putting that on 2 different boxes and voowalla! Stack traces galore!

    I simply want a way to identify which instance is which so when I write logs through log4j, I can write them to a specific destination per instance.

    This wasn't a problem until I was notified that there will be parallel installs per cell. I still have no Idea why this is going to be better, but hey, I'm still just a 3rd year developer.

    before I was using the WAS_NODE environment variable to accomplish establishing an instanceID.

    Thanks for your help!

    --Ryan


  7. Re: Uniquly Identifying Enterprise Applications?

    rheaghen@gmail.com wrote:
    > yes, I completely agree that every instance should identical and this
    > is exactly what we're moving towards, as were still migrating to a
    > clustered environment. Our code base has just recently become
    > generic. just last year was driven by a large
    > configuration.properties file running on Jrun3, that contained all
    > the hard coded references to everything.
    >
    > well... try putting that on 2 different boxes and voowalla! Stack
    > traces galore!
    >
    > I simply want a way to identify which instance is which so when I
    > write logs through log4j, I can write them to a specific destination
    > per instance.



    Are you trying to get your application logging into the same file that
    WAS logs to? This will happen automatically if you use java logging. See:

    http://publib.boulder.ibm.com/infoce..._addtrace.html

  8. Re: Uniquly Identifying Enterprise Applications?

    Logging is not the core issue, gut an accessory. What I really want is a way to uniquely identify each server instance by its already existing variables such as WAS_SERVER_NAME. Is there an easy way to retrieve this variable?



  9. Re: Uniquly Identifying Enterprise Applications?

    Look here
    http://publib.boulder.ibm.com/infoce...inService.html

    The getLocalServer() method will return an MBean which you can query to
    retrieve the server name, among other things. A potential problem with that
    is it might be too late for your log4j initialization. If log4j is
    configured in a properties file, then your application logic wouldn't be
    executed until after log4j is up and running. You would have to figure out
    some custom way to start log4j (or post configure log4j) after retrieving
    the server name.

    wrote in message
    news:1636567228.1186460987110.JavaMail.wassrvr@lts gwas009.sby.ibm.com...
    > Logging is not the core issue, gut an accessory. What I really want is a
    > way to uniquely identify each server instance by its already existing
    > variables such as WAS_SERVER_NAME. Is there an easy way to retrieve this
    > variable?
    >
    >




  10. Re: Uniquly Identifying Enterprise Applications?

    FYI: starting log4j manually is very easy:

    org.apache.log4j.xml.DOMConfigurator.configure("c:\\log4j.xml");

    I just keep it out of the classes directory so the init process can be controled.

    this alos gives us the opportunity to load java properties that log4j picks up in token form like this:


    ...

    ...


    Thanks Again for helping!

    //crude method example
    //Websphere 6.1
    public static String get_WAS_SERVER_NAME(){
    String result = null;
    com.ibm.websphere.management.AdminService admin =
    com.ibm.websphere.management.AdminServiceFactory.g etAdminService();
    String mbeanIdentifier =
    admin.
    getLocalServer().
    getKeyProperty("mbeanIdentifier");
    String splitter = "[\\u002f]";
    String[] values = mbeanIdentifier.split(splitter);
    if(values.length == 7){
    result = values[5];
    }
    return result;
    }

    Thanks Again!

+ Reply to Thread