FlexSession and states

Hello
I am a new user, so first of all: I am Sara, I'm italian and
new to flex and actionscript development :)
I am trying to build an LDAP browser using Flex 3 and JavaEE
(Tomcat, Java6, BlazeDS).
My application is composed by two mx:states, a login state
and an application state accessible only if the user authenticates
against out LDAP server.
The authentication part looks good: I create a RemoteObject
that performs the various lookups in LDAP. Since I need to store
LDAP environment informations, I create also a FlexSession object
in which this information is stored.
Through the Tomcat SessionManager I can verify that the LDAP
environmnet data are stored correctly.
At this point, I need to "populate" my main state, the
authState, if the user is authenticated.
I want to show to the user some data regarding his LDAP
entry, for example the principal. Using the same FlexSession class,
in the login phase I add to the session some other data such as the
user's principal string. The Tomcat session manager shows me that
the attribute "principal" is not null, but the flex client does not
retrieve this string.
While debugging I notice that the method by which the client
should retrieve the string is not called. The flex client correctly
calls the login() method but not the getPrincipal() method. If I
try to call it directly from actionscript, for example
[Bindable]
public var princ:String = "EMPTY";
public function doLogin():void
if (session.login(txUsername.text, txPassword.text)){
princ = session.getPrincipal().lastResult as String;
lbWelcome.text = "Welcome, " + princ;
the client throws an exception because session.getPrincipal()
returns a null object, BUT the attribute "principal" is populated
in the session.login() method (and exists in the tomcat session).
My doubt is: is FlexSession bound to a specific mx:state?
Should I retrieve the existing session in an other RemoteObject,
and then try to call attributes in the retrieved session? And how?
Thanks in advance
Sara

You have to write these statements in result hanlder. Coz, here you have just sent a request to server and in the next statement you are checking the result. At that time you will not get any result, actually some time will be spent to comeback from server.
princ = session.getPrincipal().lastResult as String;
lbWelcome.text = "Welcome, " + princ;
So handle everything in coll back.
<mx:RemoteObject id="Server" destination="ServerDestination" fault="faultHandler(event)">
    <mx:method name="getPrincipal" result="getPrincipalHandler(event)"/>
</mx:RemoteObject>
private function getPrincipalHandler(event:ResultEvent):void
    princ = event.result as String;
Try this, and let me know your results or concerns...

Similar Messages

  • I am connected to a time capsule both wirelessly and through ethernet...and state of the time capsule is solid green...the internet however doesn't work...The internet works fine when directly connected to my macbook pro but it won't work through the tc

    I have deleted time machine preferences...restarted the modem a bunch of times, restored time capsule to it's original settings...after I first set it up in Airport Ulitity its shows a page quickly that states there is a internet problem, but the page quickly goes away before I can read what it says exaclty and states the internet connection problem is resolved...
    However it's not resolved, I'm also having trouble doing a back up to my time capsule...I recently purchased a new macbook and retrieved/restore what was on the time capsule to the new computer...that worked fine...wireless worked fine...however when I tried to back up the new macbook...it would faii stating that there isn't enough room on the TC to do a back up...
    I didn't end up keeping the new macbook, I was just using it/trying it out while my current macbook pro was being repaired (logic board)
    Ever since I got my current macbook back from repair...my backups have failed due to their not being enough space to perform the back up...in the past the back ups would happen and old back ups would be replaced...
    I think this has to do with my current computer having a new name after the repair..."Adam's macbook pro 2" vs "Adam's macbook pro"
    The internet was working fine wirelessly through the TC a day ago, but it wasn't allowing my other laptop that was connected via ethernet access to the internet...I had a self assigned IP address error then...I don't have that problem now, but it's not transmitting internet at all...even though it's in a solid green state.
    I have no problem completely wiping out my TC including the previous back ups on it...just don't know how to go about it...I have restored it to factory settings a bunch of times and created the network from scratch...just hasn't fixed the issue
    Is there more prefences files I should delete

    If the modem is also a router, either use the modem in bridge and run pppoe client on the TC.. that is assuming ADSL or similar eg vdsl. If it is cable service.. and the modem is a router, then bridge the TC.. go to internet page and select connect by ethernet and below that set connection sharing to bridge.
    Please tell us more about the modem if the above gives you issues.

  • Implicit vs explicit close of resultsets and statements?

    Hi friends.I am a newbie Java Developer..Okay Here goes
    I have just made a LAN based Java application using Swing,JDBC with backend as MS-Access..The backend is on a shared network drive..
    The application is distributed as jar files on the LAN PCs..
    Everywhere I have connected to the database I have just closed the connection explicitly like this
    con.close();
    I do not close the associated resultset and statement explicitly
    The specification says associated statements and resultsets close when you close
    the connection,even if you don't explicitly close them
    Also I am not using connection pool..its simple basic connection using DriverManager
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url = "jdbcdbcSN name";
    String user = "";
    String pw = "";
    con = DriverManager.getConnection(url, user, pw);
    Statement stmt = con.createStatement();
    String select = "" ;
    ResultSet rows = stmt.executeQuery(select);
    On the net everyone says to explicitly close everything..but I did not know that
    earlier..
    If specification says everything closes on
    closing connection why do ppl insist on closing everything explicitly..?
    Or is this driver dependent..don't the drivers go through the specification..
    My driver is the Sun JDBC ODBC bridge.....
    I found this method DriverManager.setLogwriter()
    It prints out a trace of all JDBC operations..
    So I ran a sample program with this method included...
    I redirected output to a log file..
    In that program I just explicitly close the connection without closing the
    statements and resultsets explicitly...
    After running the program and seeing the log I saw that the statements
    and resultsets are closed implicitly If I just close the connection explicitly..
    I am putting the log file and the code..
    Have a look at the end of the log file..
    Code
    import java.sql.;
    import java.io.;
    class gc4test
    public static void main(String args[])
    Connection con = null;
    try
    FileWriter fwTrace = new FileWriter("c:\\log.txt");
    PrintWriter pwTrace= new PrintWriter(fwTrace);
    DriverManager.setLogWriter(pwTrace);
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url = "jdbc:odbc:pravahcon";
    String user = "admin";
    String pw = "ash123";
    con = DriverManager.getConnection(url, user, pw);
    Statement stmt = con.createStatement();
    Statement stmt1 = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    Statement stmt2 = con.createStatement();
    Statement stmt3 = con.createStatement();
    Statement stmt4 = con.createStatement();
    Statement stmt5 = con.createStatement();
    Statement stmt6 = con.createStatement();
    Statement stmt7 = con.createStatement();
    String select = "SELECT * FROM Users" ;
    ResultSet rows = stmt.executeQuery(select);
    ResultSet rows1 = stmt1.executeQuery(select);
    while(rows.next())
    con.close();
    catch (ClassNotFoundException f)
    System.out.println(f.getMessage());
    System.exit(0);
    catch (SQLException g)
    System.out.println(g.getMessage());
    System.exit(0);
    catch (Exception e)
    System.out.println(e.getMessage());
    System.exit(0);
    End of Log File
    Setting statement option (SQLSetStmtAttr), hStmt=50275112, fOption=25
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    Fetching (SQLFetch), hStmt=50274224
    End of result set (SQL_NO_DATA)
    *Connection.close
    8 Statement(s) to close
    *Statement.close
    Free statement (SQLFreeStmt), hStmt=50281544, fOption=1
    deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@2e7263
    *Statement.close
    Free statement (SQLFreeStmt), hStmt=50277224, fOption=1
    deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@1bf216a
    *Statement.close
    *ResultSet.close
    *ResultSet has been closed
    Free statement (SQLFreeStmt), hStmt=50274224, fOption=1
    deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@156ee8e
    *Statement.close
    Free statement (SQLFreeStmt), hStmt=50280464, fOption=1
    deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@c20e24
    *Statement.close
    Free statement (SQLFreeStmt), hStmt=50278304, fOption=1
    deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@12ac982
    *Statement.close
    *ResultSet.close
    *ResultSet has been closed
    Free statement (SQLFreeStmt), hStmt=50275112, fOption=1
    deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@e0e1c6
    *Statement.close
    Free statement (SQLFreeStmt), hStmt=50276144, fOption=1
    deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@6ca1c
    *Statement.close
    Free statement (SQLFreeStmt), hStmt=50279384, fOption=1
    deregistering Statement sun.jdbc.odbc.JdbcOdbcStatement@1389e4
    Disconnecting (SQLDisconnect), hDbc=50271048
    Closing connection (SQLFreeConnect), hDbc=50271048
    Closing environment (SQLFreeEnv), hEnv=50270880
    So like what these implicitly closed statements and resultsets are different from explicitly closed
    resultsets and statements..?

    Please do not crosspost/doublepost the same question again. It is rude in terms of netiquette.
    Stick to one topic: [http://forums.sun.com/thread.jspa?threadID=5393387&messageID=10745794#10745794].

  • Closing resultset and statements

    Hi!
    I just got told that I do not need to close my resultsets and statements in the code, it it enough that the connection are closed. Is this correct?
    Eg:
    public method myMethod() {
    ResultSet rs = null;
    Statement sqlStmt = null;
    try {
    query = "SELECT something";
    rs = sqlStmt.executeQuery(query);
    if (rs.next())
    do something...
    // close rs
    if (rs != null) {
    rs.close();
    rs = null;
    sqlStmt.close();
    sqlStmt = null;
    } // end try
    catch (errors)...
    finally {
    if (con != null) {                   <-- Is this line enough to close everything and release connections?
    try {
    con.close();
    catch (exception)...
    } // end finally

    No, you have to explicitly close the resultset, statement, and connection in order to release resources allocated to each of them. Closing the connection will only relase the connection, not the resultset, and statement.
    you could do all of it in the finally as follows:
    finally {
         try {
              if (rs != null) {
                   rs.close();
              if (stmt != null) {
                   stmt.close();
              if (conn != null) {
                   conn.close();
         } catch (Exception e) {}
    also there is no need to set rs = null, stmt = null after the close()

  • I finally got my iphone out of recovery mode, after 7.1.1 but now it won't accept my Icloud info and states "An error occrured while trying to save the Icloud account?" What do I do????

    I tried updating my iphone 4 to 7.1.1 and it went straight into recovery mode.... I finally got my iphone out of recovery mode, but now it won't accept my Icloud info and states "An error occrured while trying to save the Icloud account?" What do I do????

    Same situation. I installed iOS 8 beta 4 on my iPhone 5 and a few days later my iCloud account disappeared. My contacts and calendar entries are gone.
    My Mac Mini and MacBook do sync as they should with iCloud.
    When I try to log in to iCloud on the iPhone (the username shows "[email protected]" and password shows "required"), I put in my username and password and tap "Sign In", It says "Verifying" at the top and after a while checkmarks appear next to my username and password. Then I get an error message saying "An error occurred while trying to save the iCloud account". If I tap OK the message goes away, leaving my username and password intact (checkmarks are now gone). If I tap "Sign In" again I get a message saying " '[email protected]' is Already Added. This iCloud account has already been added to your iPhone". If I go back to Settings and then go into iCloud again it's not set up and appears as I stated at the beginning of this paragraph.
    Nothing works and the sync does not occur. Contacts are empty and Calendar has no entries.

  • Retrieve city and state from zip code that is entered by user

    I am trying to use AJAX to retrieve city and state from a table based on a zip code that is entered by the user. Two are text fields (zip code and city) and one is a SELECT field (state).
    1. I defined an application item called TEMPORARY_APPLICATION_ITEM.
    2. I defined an application process called SET_CITY_STATE as follows:
        a. Process point: on demand
        b. type: anonymous block
        c. process text:
    <pre>
    DECLARE
    v_city VARCHAR2 (100);
    v_state VARCHAR2 (2);
    CURSOR cur_c
    IS
    SELECT city, state
    FROM ZIP
    WHERE zip = v ('TEMPORARY_APPLICATION_ITEM');
    BEGIN
    FOR c IN cur_c
    LOOP
    v_city := c.city;
    v_state := c.state;
    END LOOP;
    apex_util.set_session_state('P2_CO_CITY',v_city);
    apex_util.set_session_state('P2_CO_STATE',v_state);
    EXCEPTION
    WHEN OTHERS
    THEN
    apex_util.set_session_state('P2_CITY','Unknown city');
    apex_util.set_session_state('P2_STATE',null);
    END;
    </pre>
    3. Javascript is defined in the region header:
    <pre>
    <script language="JavaScript" type="text/javascript">
    <!--
    function pull_city_state(pValue){
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Set_City_State',0);
    if(pValue){
    get.add('TEMPORARY_APPLICATION_ITEM',pValue)
    }else{
    get.add('TEMPORARY_APPLICATION_ITEM','null')
    gReturn = get.get('XML');
    get = null;
    //-->
    </script>
    </pre>
    4. In the HTML Form Element Attributes of the P2_CO_ZIP text item: onchange="pull_city_state(this.value)";
    The city and state are not being populated. I checked the select statement and it is retreiving the city and state in SQL WORKSHOP > SQL COMMANDS.
    I would like to use it for the mailing address as well, so I would need to make the application process / javascript a bit more generic to be used in two places.
    I placed the application on apex.oracle.com:
    Workspace: RGWORK
    Application: Online Certification Application (28022)
    Can someone assists, please.
    Thank you,
    Robert
    Edited by: sect55 on Jun 2, 2009 4:11 PM

    Hi Robert,
    Try using XML instead of session state -
    Change the application on demand process with the following script -
    >
    DECLARE
    v_city VARCHAR2 (100);
    v_state VARCHAR2 (2);
    CURSOR cur_c
    IS
    SELECT city, state
    FROM ZIP
    WHERE zip = v ('TEMPORARY_APPLICATION_ITEM');
    BEGIN
    FOR c IN cur_c
    LOOP
    v_city := c.city;
    v_state := c.state;
    END LOOP;
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<body>');
    HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
    HTP.prn ('<item id="P2_CO_CITY">' || v_city || '</item>');
    HTP.prn ('<item id="P2_CO_STATE">' || v_state || '</item>');
    HTP.prn ('</body>');
    EXCEPTION
    WHEN OTHERS
    THEN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<body>');
    HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
    HTP.prn ('<item id="P2_CITY">' || 'Unknown city' || '</item>');
    HTP.prn ('<item id="P2_STATE">' || '' || '</item>');
    HTP.prn ('</body>');
    END;
    >
    in your javascript make sure you typing the application process name correctly as it is case sensitive.
    Hope this helps,
    Regards,
    M Tajuddin
    web: http://tajuddin.whitepagesbd.com

  • What's the difference between "PreparedStatement" and "Statement"?

    What's the difference between "PreparedStatement" and "Statement"?
    Which is better??????

    Read the docs for the two classes. The differences are apparent there.
    Which one is better depends on your needs. I think that constructing and executing a PreparedStatement can be a bit less performant than just a Statement, if you're only executing the query one time. But I don't think that difference will normally be noticable in the context of a given application.
    Additionally, if you have to pass any dates or strings to the query, you'll want PreparedStatement's parameters, rather than trying to format and escape things in the query string.

  • Vendor Master - street addr and PO box/different city and state

    Issue:  Check print for vendor is wrong when both street and PO Box address are populated in Vendor Master.  Print Preview shows correct PO Box with correct city and state, but when check prints using the PO Box, it uses the city from the street address.  Please help.
    Example:
    Street address for vendor is Westport, CN.
    PO Box for vendor is Newark, NJ.
    Edited by: Jan Ackerman on Sep 17, 2008 10:48 PM  Meant to type CT, not CN.

    If we change the Print Program to use the PO Box, will the SAP Print Program still know to use the street address for vendors that don't have a PO Box?  Please confirm. Thank you!

  • How to get the name of the city and state of the current location of the user

    Hi all
             i need to get the name of the city and state (full address) of the current location of the user.
    need help.

    The best way to do this is to put the monitor name as a property bag in the script and pass that to your event details. Otherwise, we're looking at querying the database each time the monitor generates an event, and this is overhead that is really not
    necessary. The other option, which is just even worse in terms of performance, is to use powershell to query the SDK for the monitor name. Both of these options are not going to be a good solution, because now you need to implement action accounts that can
    either query the database or the sdk.
    Jonathan Almquist | SCOMskills, LLC (http://scomskills.com)

  • Printing the Name and State of Servers

    Hi,
    Please can somebody help in executing the below mentioned code which will print the name and state of the servers.
    Below Java file taken from the following location : http://docs.oracle.com/cd/E23943_01/apirefs.1111/e13951/core/index.html
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.util.Hashtable;
    import javax.management.MBeanServerConnection;
    import javax.management.MalformedObjectNameException;
    import javax.management.ObjectName;
    import javax.management.remote.JMXConnector;
    import javax.management.remote.JMXConnectorFactory;
    import javax.management.remote.JMXServiceURL;
    import javax.naming.Context;
    public class PrintServerState {
    private static MBeanServerConnection connection;
    private static JMXConnector connector;
    private static final ObjectName service;
    // Initializing the object name for DomainRuntimeServiceMBean
    // so it can be used throughout the class.
    static {
    try {
    service = new ObjectName(
    "com.bea:Name=DomainRuntimeService,Type=weblogic.management.
    mbeanservers.domainruntime.DomainRuntimeServiceMBean");
    }catch (MalformedObjectNameException e) {
    throw new AssertionError(e.getMessage());
    * Initialize connection to the Domain Runtime MBean Server
    public static void initConnection(String hostname, String portString,
    String username, String password) throws IOException,
    MalformedURLException {
    String protocol = "t3";
    Integer portInteger = Integer.valueOf(portString);
    int port = portInteger.intValue();
    String jndiroot = "/jndi/";
    String mserver = "weblogic.management.mbeanservers.domainruntime";
    JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname,
    port, jndiroot + mserver);
    Hashtable h = new Hashtable();
    h.put(Context.SECURITY_PRINCIPAL, username);
    h.put(Context.SECURITY_CREDENTIALS, password);
    h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
    "weblogic.management.remote");
    connector = JMXConnectorFactory.connect(serviceURL, h);
    connection = connector.getMBeanServerConnection();
    * Print an array of ServerRuntimeMBeans.
    * This MBean is the root of the runtime MBean hierarchy, and
    * each server in the domain hosts its own instance.
    public static ObjectName[] getServerRuntimes() throws Exception {
    return (ObjectName[]) connection.getAttribute(service,
    "ServerRuntimes");
    * Iterate through ServerRuntimeMBeans and get the name and state
    public void printNameAndState() throws Exception {
    ObjectName[] serverRT = getServerRuntimes();
    System.out.println("got server runtimes");
    int length = (int) serverRT.length;
    for (int i = 0; i < length; i++) {
    String name = (String) connection.getAttribute(serverRT,
    "Name");
    String state = (String) connection.getAttribute(serverRT[i],
    "State");
    System.out.println("Server name: " + name + ". Server state: "
    + state);
    public static void main(String[] args) throws Exception {
    String hostname = args[0];
    String portString = args[1];
    String username = args[2];
    String password = args[3];
    PrintServerState s = new PrintServerState();
    initConnection(hostname, portString, username, password);
    s.printNameAndState();
    connector.close();
    When executing the above mentioned code getting the following error
    Exception in thread "main" java.net.MalformedURLException: Bad IPv6 address: t3:
    //localhost
    at javax.management.remote.JMXServiceURL.validateHost(Unknown Source)
    at javax.management.remote.JMXServiceURL.validateHost(Unknown Source)
    at javax.management.remote.JMXServiceURL.validate(Unknown Source)
    at javax.management.remote.JMXServiceURL.<init>(Unknown Source)
    at PrintServerState.initConnection(PrintServerState.java:39)
    at PrintServerState.main(PrintServerState.java:84)
    Caused by: java.net.UnknownHostException: t3://localhost
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source)
    at java.net.InetAddress.getAddressesFromNameService(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getAllByName(Unknown Source)
    at java.net.InetAddress.getAllByName(Unknown Source)
    at java.net.InetAddress.getByName(Unknown Source)
    ... 6 more

    Hi,
    Copy the below code and save it as PrintServerState.java,
    I also have copied the code from
    http://docs.oracle.com/cd/E21764_01/web.1111/e13728/accesswls.htm#i1116377
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.util.Hashtable;
    import javax.management.MBeanServerConnection;
    import javax.management.MalformedObjectNameException;
    import javax.management.ObjectName;
    import javax.management.remote.JMXConnector;
    import javax.management.remote.JMXConnectorFactory;
    import javax.management.remote.JMXServiceURL;
    import javax.naming.Context;
    import java.lang.*;
    public class PrintServerState {
    private static MBeanServerConnection connection;
    private static JMXConnector connector;
    private static final ObjectName service;
    // Initializing the object name for DomainRuntimeServiceMBean
    // so it can be used throughout the class.
    static {
    try {
    service = new ObjectName(
    "com.bea:Name=DomainRuntimeService,Type=weblogic.management.
    mbeanservers.domainruntime.DomainRuntimeServiceMBean");
    }catch (MalformedObjectNameException e) {
    throw new AssertionError(e.getMessage());
    * Initialize connection to the Domain Runtime MBean Server
    public static void initConnection(String hostname, String portString,
    String username, String password) throws IOException,
    MalformedURLException {
    String protocol = "t3";
    Integer portInteger = Integer.valueOf(portString);
    int port = portInteger.intValue();
    String jndiroot = "/jndi/";
    String mserver = "weblogic.management.mbeanservers.domainruntime";
    JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname,
    port, jndiroot + mserver);
    Hashtable h = new Hashtable();
    h.put(Context.SECURITY_PRINCIPAL, username);
    h.put(Context.SECURITY_CREDENTIALS, password);
    h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
    "weblogic.management.remote");
    connector = JMXConnectorFactory.connect(serviceURL, h);
    connection = connector.getMBeanServerConnection();
    * Print an array of ServerRuntimeMBeans.
    * This MBean is the root of the runtime MBean hierarchy, and
    * each server in the domain hosts its own instance.
    public static ObjectName[] getServerRuntimes() throws Exception {
    return (ObjectName[]) connection.getAttribute(service,
    "ServerRuntimes");
    * Iterate through ServerRuntimeMBeans and get the name and state
    public void printNameAndState() throws Exception {
    ObjectName[] serverRT = getServerRuntimes();
    System.out.println("got server runtimes");
    int length = (int) serverRT.length;
    for (int i = 0; i < length; i++) {
    String name = (String) connection.getAttribute(serverRT,
    "Name");
    String state = (String) connection.getAttribute(serverRT[i],
    "State");
    System.out.println("Server name: " + name + ". Server state: "
    + state);
    public static void main(String[] args) throws Exception {
    String hostname = args[0];
    String portString = args[1];
    String username = args[2];
    String password = args[3];
    PrintServerState s = new PrintServerState();
    initConnection(hostname, portString, username, password);
    s.printNameAndState();
    connector.close();
    Now compile it as javac -d . PrintServerState.java
    Then Execute WL_HOME/weblogic92/server/bin/setWLSEnv.sh
    Now Execute ur class file generated as
    java -classpath .:WL_HOME/weblogic92/server/lib/wljmxclient.jar PrintServerState ipaddress port username password
    The output will be as follows
    Server name: Server3.   Server state: RUNNING
    Server name: Server2.   Server state: RUNNING
    Server name: Server1.   Server state: RUNNING
    Server name: Server4.   Server state: RUNNING
    Regards
    Fabian

  • When signing into icloud on a second hand ipad2 i bought with my apple Id, it would let me and states the maximimum number of free accounts have been activated on this ipad.

    Hey
    When signing into icloud with my apple Id on a second hand Ipad 2 i bought it won't let me and states 'The maxium number of free accounts have been activated on this ipad. How do i sign into icloud then? Help

    Welcome to the Apple Community.
    Make sure you are using the sign in option and not trying to create a new one. If you need to create a new ID...
    Unfortunately once all the 3 iCloud accounts have been created on your device, you cannot create any more regardless of what you do. You will need to re-use one of the accounts that you have already created or create your new account on another iOS device or Mac computer.

  • Lexmark Optra S 1255 and mac 10.6.8--not working?  I have a 1284 cable, installed drivers, but it just swirls and states "printer offline"?  Anybody?  I really like this old laser printer.  thanks for looking

    1.  Hello
    2.  Problem with old laser printer and compatibility.
    3.  My computer is a iMac
    4.  running 10.6.8
    5.  printer:  Lexmark Optra S 1255
    6.  bought a IEEE 1284 printer cable
    7.  installed drivers
    8.  When I add the printer, it just swirls and state"printer offline"
    9.  Any advise would be greatly appreciated?

    Explain #8.
    Did you restart after adding the drivers?
    If you open the System Profiler, under Firewire or Printers what do yo see?
    (Apple Menu/About this Mac/More Info/Firewire or Printer)
    If it sees them then you know it's a configuration problem.

  • HT1338 hi, my firefox and safari are both having difficulty loading certain parts of web pages. previous to this my firefox would freeze and state that a script was not responding. i would stop the script and reload the page and everything would be fine.

    hi, my firefox and safari are both having difficulty loading certain parts of web pages. previous to this my firefox would freeze and state that a script was not responding. i would stop the script and reload the page and everything would be fine. now though the pages just load very very slowly or load leaving out certain pictures and video content. i've tried clearing my cache's and cookies, resetting my browser etc, but it seems like its a system issue as both safari and firefox are having issues. i've run Avast to screen for malware and it came up empty. any suggestions?

    10.4.8's been a pain for Networking... not sure of all the reasons though, or whether all the complaints might not be MS working around Bugs/Non-compliance, but at this point I think you should get Applejack...
    http://www.versiontracker.com/dyn/moreinfo/macosx/19596
    After installing, boot holding down CMD+s, then when the prompt shows, type in...
    applejack AUTO
    Then let it do all 5 of it's things.
    Fixes a lot of problems, and besides, if your Mac ever gets to the point it won't Boot... this is a life saver!
    After you run that... let's see where we are.
    BTW, several ISPs seem to have trouble with their DNS Servers lately, might try these insead...
    208.67.222.222
    208.67.220.220

  • Qualification Proficiency and State of Individual Development in an Infoset

    Hi All,
    We have a requirement as part of the Training and Event Management module to create an infoset query to display the fields from IT0024 Qualifications. We are able to get most of the fields but are unable to display the fields 'proficiency' (under tab Qualifications) and State (under tab Individual Development). Please let me know if this can be displayed and what should be done in order to have these fields displayed.
    Request your help on this one.
    Thanks,
    Shilpa

    Hi,
    In the infoset you can get the fields which are in the infotype only .
    For your issue you have write a Zprogram for the same .. Bcoz the value were stored in the Structuce which will not able to pick as per your requirement.
    Hope this will helps you
    All the best
    KRC

  • AR Invoices and Statements

    After creating a template and data definition for AR invoices and Statements, where in the application does this get mapped or setup. Thanks in advance for your help.

    That depends on your Apps release.
    1. Pre-11i10 - your users will have a two step process to generate output
    2. Post 11i10 - your users carry on as they were, they can now pick a template to use at runtime.
    As to what to do next ... you need to get the template and datasource registered in the XMLP Admin pages, make an update to the conc prog definition and you're done !
    More details in the manual and this paper, http://www.oracle.com/technology/products/xml-publisher/docs/XMLEBSRep.pdf
    Regards, Tim

Maybe you are looking for