Incorrect/confused MBeanHome object

Hello, World.
I am having an issue using the weblogic.management api's, which is pretty serious for me.
I am using WebLogic 8.1 SP3: (From the Start Log)
<13:40:15 IST 09/12/2004> <Info> <Management> <BEA-141107><Version: WebLogic Server 8.1 SP3 Tue Jun 29 23:11:19 PDT 2004 404973
If I get an MBeanHome reference for 2 different servers using the weblogic.management.Helper class, the second object I get will not communicate correctly with its server. A SecurityException is thrown. It appears that the second MBeanHome is using (at least) the username from the first MBeanHome that was acquired.
I have a trimmed down example showing the problem (you will have to change the usernames, passwords, and url's of course):
import weblogic.management.MBeanHome;
import weblogic.management.Helper;
public class GetMBeanHomes {
    public static void main(String [] args) {
        MBeanHome home1 = null;
        MBeanHome home2 = null;
        System.out.println("Get MBeanHomes...");
        home1 = Helper.getAdminMBeanHome("admin", "foobar11", "http://10.90.18.65:7001");
        System.out.println("    Home 1 : " + home1);
        home2 = Helper.getAdminMBeanHome("weblogic", "weblogic", "http://10.90.18.108:7001");
        System.out.println("    Home 2 : " + home2);
        if (home1 == home2) {
            System.out.println("MBeanHome vars refer to the same object...");
        else {
            System.out.println("MBeanHome vars refer to different objects...");
        System.out.println("Get the server lists...");
        java.util.Set serverSet1 = home1.getMBeansByType("Server");
        System.out.println("    Home1 Server Set : " + serverSet1);
        // The next line (of code) will throw a java.lang.SecurityException
        // The username that it shows in the "principals" list is the username
        // from "home1" not "home2". Text of exception:
        // Exception in thread "main" java.lang.SecurityException:
        //  [Security:090398]Invalid Subject: principals=[admin, Administrators]
        java.util.Set serverSet2 = home2.getMBeansByType("Server");
        System.out.println("    Home2 Server Set : " + serverSet2);
}I believe it is fairly important to have different user names (and/or passwords) for each server to see the problem. If the same username (and password) is used on both servers, it would probably "accidentally" work.
Any insights or solutions to this problem would be very much appreciated!
Thanks,
William Headrick

Hello William,
I tried the same thing with your code for two WLS on seperate machines, and it worked fine. I had just changed the protocol from http to t3 and it worked fine( with different boot up password as well).
home1 = Helper.getAdminMBeanHome("weblogic", "weblogic", "t3://localhost:8001");
home2 = Helper.getAdminMBeanHome("saurabhd", "saurabhd", "t3://192.168.114.103:7001");
And got following output
Get MBeanHomes...
Home 1 : weblogic.rmi.internal.BasicRemoteRef@102 - hostID: '681230346049884984S:10.61.4.233:[8001,8001,-1,-1,8001,-1,-1,0,0]:UNDERSTANDING_MIGRAT_TARGETS_8001:myserver', oid: '258'
Home 2 : weblogic.rmi.internal.BasicRemoteRef@102 - hostID: '-6724224952649365762S:192.168.114.103:[7001,7001,-1,-1,7001,-1,-1,0,0]:kuldomain:myserver', oid: '258'
MBeanHome vars refer to different objects...
Get the server lists...
Home1 Server Set : [[Caching Stub]Proxy for UNDERSTANDING_MIGRAT_TARGETS_8001:Name=MyServer-3,Type=Server, [Caching Stub]Proxy for UNDERSTANDING_MIGRAT_TARGETS_8001:Name=MyServer-1,Type=Server, [Caching Stub]Proxy for UNDERSTANDING_MIGRAT_TARGETS_8001:Name=MyServer-2,Type=Server, [Caching Stub]Proxy for UNDERSTANDING_MIGRAT_TARGETS_8001:Name=myserver,Type=Server]
try this out.
Regards,
Kuldeep Singh,
BEA Tech Support

Similar Messages

  • Confused about objects in ArrayLists

    Alright, this is what I am trying to do:
    1.I collect the first name, last name, number, points, rebounds, assists, and fouls all in the stats object.
    Here is my main code:
        public static void main(String[] args) {
            String input;
            String input1;
            String firstName;
            String lastName;
            int gameNumber = 0;
            int points = 0;
            int rebounds = 0;
            int fouls = 0;
            int assists = 0;
            int i = 0;
            ArrayList<Stats> player = new ArrayList<Stats>();
            do{
                Stats stats = new Stats();
                Scanner keyboard = new Scanner(System.in);
                System.out.println("Do you want to enter data or quit(E-enter, Q-quit)?");
                input1 = keyboard.nextLine();
                if (input1.equalsIgnoreCase("E")){
                    System.out.println("What is player's first name? ");
                    firstName = keyboard.nextLine();
                    stats.setFirstName(firstName);
                    System.out.println("What is player's last name? ");
                    lastName = keyboard.nextLine();
                    stats.setLastName(lastName);
                    System.out.println("What is player's game number? ");
                    gameNumber = keyboard.nextInt();
                    stats.setGameNumber(gameNumber);
                    System.out.println("How many points were scored? ");
                    points = keyboard.nextInt();
                    stats.setPoints(points);
                    System.out.println("How many rebounds? ");
                    rebounds = keyboard.nextInt();
                    stats.setRebounds(rebounds);
                    System.out.println("How many fouls? ");
                    fouls = keyboard.nextInt();
                    stats.setFouls(fouls);
                    System.out.println("How many assists? ");
                    assists = keyboard.nextInt();
                    stats.setAssists(assists);
                    player.add(stats);
                System.out.println(stats);
                System.out.println("Do you want to get a players info or average, enter or quit (I-Info, A-average,E-entry,Q-quit)?");
                input = keyboard.nextLine();
                System.out.println(input);
            } while (!input.equalsIgnoreCase("Q"));
    }I also have a Stats.java code that gets/sets each points rebounds...etc.
    And thats all fine.... but now I want to put stats in an ArrayList, and be able to access each added stats by the user typing a last name.
    AKA:
    Input: Thompson
    Output: points, rebounds, assists, fouls
    So am I on the right road by just adding stats into player every loop, and how do I access it with just a last name?
    If u do not understand just ask and Ill explain better.
    Thanks guys

    Ight thanks, I got that to work but now I have another question....
    Here is my code:
      public static void main(String[] args) {
            String input;
            String input1;
            String firstName;
            String lastName;
            int gameNumber = 0;
            int points = 0;
            int rebounds = 0;
            int fouls = 0;
            int assists = 0;
            ArrayList s1 = new ArrayList<Stats>();
            do{
                Stats stats = new Stats();
                Scanner keyboard = new Scanner(System.in);
                System.out.println("Do you want to enter data or quit(E-enter, Q-quit)?");
                input1 = keyboard.nextLine();
                if (input1.equalsIgnoreCase("E")){
                System.out.println("What is player's first name? ");
                firstName = keyboard.nextLine();
                stats.setFirstName(firstName);
                s1.add(firstName);
                System.out.println("What is player's last name? ");
                lastName = keyboard.nextLine();
                stats.setLastName(lastName);
                s1.add(lastName);
                System.out.println("What is player's game number? ");
                gameNumber = keyboard.nextInt();
                stats.setGameNumber(gameNumber);
                s1.add(gameNumber);
                System.out.println("How many points were scored? ");
                points = keyboard.nextInt();
                stats.setPoints(points);
                s1.add(points);
                System.out.println("How many rebounds? ");
                rebounds = keyboard.nextInt();
                stats.setRebounds(rebounds);
                s1.add(rebounds);
                System.out.println("How many fouls? ");
                fouls = keyboard.nextInt();
                stats.setFouls(fouls);
                s1.add(fouls);
                System.out.println("How many assists? ");
                assists = keyboard.nextInt();
                stats.setAssists(assists);
                s1.add(assists);
                System.out.println("Do you want to get a players info or average, enter or quit (I-Info, A-average,E-entry,Q-quit)?");
                input = keyboard.nextLine();
                System.out.println(input);
                /*if (input.equalsIgnoreCase("I")){
                    System.out.println("Enter player's last name: ");
                    String lastNameInfo = keyboard.nextLine();
                    for (int i=1; i<s1.size(); i=i+7){
                        if (lastNameInfo.equalsIgnoreCase((String)s1.get(i))) {
                            System.out.println((String)s1.get(i-1) + (String)s1.get(i) + " had " +
                                    (String)s1.get(i+2) + " points, " + (String)s1.get(i+3) +
                                    " rebound, " + (String)s1.get(i+4) + "fouls, and " +
                                    (String)s1.get(i+5) + "assists.");
                        } else;
                        System.out.println("That player is not on the roster.");
            } while (input.equalsIgnoreCase("E"));
    }And here is my output:
    init:
    deps-jar:
    compile:
    run:
    Do you want to enter data or quit(E-enter, Q-quit)?
    e
    What is player's first name?
    Jon
    What is player's last name?
    Doe
    What is player's game number?
    1
    How many points were scored?
    1
    How many rebounds?
    1
    How many fouls?
    1
    How many assists?
    1
    Do you want to get a players info or average, enter or quit (I-Info, A-average,E-entry,Q-quit)?
    BUILD SUCCESSFUL (total time: 13 seconds)Why does it not let the user put an answer in for the last question ("Do you want to get a players info or average, enter or quit (I-Info, A-average,E-entry,Q-quit)?")
    Thanks

  • Confusion with Object class

    We all know that all classes implements Object directly or indirectly. That is why we get all public methods available in Object class.
    But as the definition says, if our class extends Object class indirectly and we are able to get public methods like notify(), notifyAll() etc why are we unable to get the protected method clone() of this class even our class extends Object class??
    I mean to say either both type of methods must not be available or must be available.
    Hope I am clear about my issue??
    Can any of you guys explain it???
    Regards.

    Your class needs to implement Cloneable interface.
    For example this will throw an exception -
    public class TestClone {
              void foo() throws Exception {
              clone();
              public static void main(String args[]){
                   try {
                        new TestClone().foo();
                   }catch (Exception ex){
                        ex.printStackTrace();
    This will not -
    public class TestClone implements Cloneable{
              void foo() throws Exception {
              clone();
              public static void main(String args[]){
                   try {
                        new TestClone().foo();
                   }catch (Exception ex){
                        ex.printStackTrace();
    }

  • Confusion about object naming

    i have 3 jsp files, b1.jsp, b2.jsp, b3.jsp which are similar files (all with similar contents, except that b1.jsp has a form while the other 2 don't), all using the same class (Bean2.java), with id="bea". when b1.jsp is run and i refresh the page, a certain attribute of the bea object is changed (i think due to the form) such that the result displayed is different.
    i believe it has to do with my form. but why is it that when i run b2.jsp and b3.jsp, that same attribute is also changed? is it cos i give the same name to the object of Bean2 class?
    hope u all know what i sam saying.

    hope to make myself clearer. b1.jsp is changed cos it has the form. but i din't know y b2.jsp n b3.jsp also has that particular attr changed

  • Ps CS6 Problem: Incorrect rendering of pasted Adobe Illustrator vector objects

    Ps CS6 v13.0.1
    OS X 10.6.8
    Problem: Ps CS6 incorrectly renders vector objects pasted from Adobe Illustrator. CS5.1 does not exhibit the problem.
    Below is screenshot of artwork in Illustrator and which is copied to clipboard, followed by screenshot of "Paste as Smart Object" in Ps CS5.1 then screenshot of same paste in CS6. "Paste as Pixels" gives identical good rendering in CS5.1 and poor rendering (gray pixels which should be pure white in this example) in CS6. This is repeatable with other artwork.
    Several weeks ago there was a complaint in this forum that Photoshop CS6 poorly renders vector artwork that is pixel-aligned in Illustrator. The Adobe response was that Photoshop is correct. Strange that CS5.1 can render pasted vector artwork perfectly and only CS6 makes a mess.

    What's the explanation for the following sequence?
    1. Paste as Smart Object, at moment after pasting and before clicking the commit icon (no transform was made) in options bar. The object is rendered pixel-perfect.
    2. After the commit. The object is poorly rendered with gray pixels which should be white.
    3. Press Cmd+T for transform mode. The object is rendered pixel-perfect again.
    4. After canceling transform mode, the object is poorly rendered again.

  • Cost center object number incorrect

    Hi All,
    During migration, cost centers were created with incorrect object number in master data table (the controlling area was incorrect in the object number).
    Due to this, the transactional data in CO were updated with the incorrect object number in tables like COEP & COSP.
    Thus, line items reports like KSB1 do not show any vaue against the cost center.
    We have corrected the master data. Any pointers towards correcting the already posted transactional data would be appreciated.
    Regards,
    Nisha

    you must contact SAP with an oss-message:
    I think you cannot correct tables cosp etc. of your own, because you don't know all dependencies.
    the source code would be like this:
    1) selection of incorrect data:
    concatenate 'KS' false_kokrs '%' into key.
    select *from (table) into table itab
      where objnr like key.
    2) correct data and insert through another internal table itab1.
    3) delete data from dbtab through itab (1).
    regards Andreas

  • 3.0EA1: Recent Objects and synonyms

    When opening an object tab where the object is based on a synonym which references an object in a different schema, the information displayed in Recent Objects is not consistent with what is displayed elsewhere. Further, if the synonym "renames" the object, the information displayed in Recent Objects is not correct.
    For example, if I open the object for ABC_ACTUAL_TABLE (a synonym to the table ABC.ABC_ACTUAL_TABLE), the Connection pane and the Table tab both show ABC_ACTUAL_TABLE, but Recent Objects shows ABC.ABC_ACTUAL_TABLE. As the schema is not shown for all objects, this can be a bit confusing when the next object in Recent Objects (a table owned by my current schema) shows as MY_ACTUAL_TABLE.
    If however, my synonym renames the table - ie MY_SYNONYM_TABLE is a synonym to ABC.ABC_ACTUAL_TABLE, the Connection pane and the Table tab both show MY_SYNONYM_TABLE, but Recent Objects shows ABC.MY_SYNONYM_TABLE, which is incorrect - such an object doesn't exist. As part of testing this, I have noticed that the tooltip on the Table tab shows ABC.MY_SYNONYM_TABLE@MYCONN, which is also incorrect.
    theFurryOne

    2.1 production (63.73) improved this by including "Body" after package bodies on the recent object list, but there is still no way to tell which schema or connection the objects relate to. Can we please have connection and schema included somehow in the recent object list?
    theFurryOne

  • Object oriented Concept

    Hi all, I feel confuse on object oriented.
    Basic, I get change to developer some online form. I use java bean , Servlet, JSTL and Mysql. In my java bean I only have the attribute set and get pattern. I just wonder I put my delete , search and update action on Servlet , not in the java bean , is that means that Is not object oriented enough? How to improve it ?
    thank you!

    Thank you for the reply, I did use some of the Spring in my Project, but only limit in flower control , such as simple spring + acegi , a lot of control still in servlet. I also try some other new stuff like display tag , but that only work on if your jsp page is out of the WEB-INF. I also go through some tutorials on JSF , but not time to figure out how JSF work with acegi yet.
    1 mention the display tag and JSF just try to explain, I looking for a new framework. But don?t want the whole framework to tire me up. For example in simple servlet I can use ? /WEB-INF/ + target to send my flower to any JSP page depend on the link that I click , but I don?t how to handle it spring. May be I did not get the real concept of spring yet. I looking for some framework that allow me to use new technology , but still allow me to use some old technology , like servlet then I can finish my project on time.
    But what is the relation between web framework and object oriented concept??

  • Runtime error related to incorrect reference passing

    Hi All,
    Very strange problem this one, I know exactly what the problem is (I knew it was 1 of 2 things instantly), but have no idea why the JVM is doing it!!! The short answer is Java is incorrectly passing some values by reference. It is incorrectly linking some objects when it shouldn't. Even worse looking at the memory address they are different objects in different memory sectors, so why are they linked???????
    Details:
    I'm building a simple little app just to brush up on my Java, at the moment it using RMI, Swing, SAX & JDBC, but none of these are particular importatly for my problem.
    In the DB I hold a table of roles (CODE + DESC). To access the DB I've written various CLASS_NAMEORM classes that do my Object to Relational Mapping.
    One of these methods queries the DB for all the roles, and then builds a Role Object for it, before adding it to a Vector. The return for the method is the Vector [Typed as a List] so I can use it in the Swing GUI object to populate a ComboBox for selection.
    The method returns the List as I would expect but, the List is always populated with the same Role object.
    This is of course pointed to 1 of 2 problems:
    I wasn't calling Iterator.next() in my method
    The objects I was adding to the Vector were by reference, so they were in fact the "same"
    Looking at my code I quickly ruled out 1, and 2 doesn't make any sense either as I initialise the Role object in a While loop, so the JVM should causes a new Object to be created in a sector of memory.
    The code I'm using is:
       * Method to return all the roles in the system
       * @throws SQLException
       * @return List
      public List getAllRoles() throws SQLException{
        String SQLQuery;
        SQLQuery = "SELECT cd_role, ds_role FROM TB_ROLE ORDER BY cd_role;";
        SQLResults = theStatement.executeQuery(SQLQuery);
        Vector results = new Vector();
        while (SQLResults.next()){
          Role role;
          role = new Role(SQLResults.getString("cd_role"),SQLResults.getString("ds_role"));
          results.add(role);
        SQLResults.close();
        return results;
      }Now this returns a List where all the objects contain the last element. Well that's what I thought till I watched the debugger. Things get a little strange from here on here..... you need to read this carefully!!
    On of the first loop the role is initialised to a Role object containing "Admin" "Adminstrator" (in the variables) held at memory location 72d
    The role then gets added to the Vector so Vector[0] = Role.role@72d = "Admin" "Adminstrator"
    On of the second loop the role is initialised to a Role object containing "MTH_MHGR" "Method Manager" (in the variables) held at memory location 72e. (Note the different memory adress!)
    At this point instantly the variables of the first element of the Vector also becomes "MTH_MHGR" "Method Manager", yet according to the debugger the role items are not related because they are in different memory locations!!
    The role then gets added to the Vector so Vector[0] = Role.role@72d = "MTH_MNGR" "Method Manager", Vector[1] = Role.role@72e = "MTH_MNGR" "Method Manager"
    Now this puzzles me greatly as the JVM should not be doing this....... any insight would be most welcome!!!
    Out of interest a near identical method in another of my ORM classes works fine!!!
       * Method to get all the tests in the DB
       * @throws SQLException
       * @return List
      public List getAllTests() throws SQLException{
        String SQLQuery;
        SQLQuery = "SELECT cd_test, ds_test, fl_repetitive FROM TB_TEST ORDER BY cd_test;";
        SQLResults = theStatement.executeQuery(SQLQuery);
        Vector results = new Vector();
        while (SQLResults.next()){
          Test test;
          test = new Test(SQLResults.getString("cd_test"),SQLResults.getString("ds_test"), SQLResults.getBoolean("fl_repetitive"));
          results.add(test);
        SQLResults.close();
        return results;
      }

    sorry guys hit post, rather than preview..... there's a more correct version (where I cleaned up the English)

  • Find object name of particular tcode

    hi, i am new  in sap security so i am very confused with object relation with tcodes. like when we give su01 tcode in pfcg then in profile generator we hav to give activities for that role like for su01 in which object we will hav to give activities like create,change, delete, display for that role only? how can we find out which object reflects that particular tcode?
    like another example in se38 if i want to restrict a user for change option and allow only display option then in profile generator how can i find out under which object activity does it works?
    like i tell earlier im new in this field so please help me out from this confusion.
    Thanks
    Jimmy Batra

    Sorry I misunderstood your question.
    But there is no easy way to find the authorization object used for particular transaction unless you debug the program.
    Generally it is mention in the documentation of that particular functionality.
    For example if you want to find out the authorization objects checked in pfcg then you need to go through the following document http://help.sap.com/saphelp_nw70/helpdata/en/ce/17533e5ff4d064e10000000a114084/frameset.htm and set the activity based on your requirement.
    Same for function transactions, either you need to find the related document or need to consult the functional consultant to get the required value for that particular object.
    Hope this will help.
    -Pinkle

  • Object serialization failure during OutOfMemory error (EOFException)

    Hello all,
    We are seeing a very strange situation when writing a serializable object to a flat file, specifically during an OutOfMemory condition. Our application saves the state of an object if an error occurs, and retries at a later point by reviving the object from its serialized form. We recently encountered a series of EOFExcetions when trying to reload the serialized object. Looking at the serialized data, we see that the file is indeed incomplete, and that it appears to be the serialized representation of the data contained within the object that is missing (the structure of the object appears to be stored in the serialized file, but not the runtime data).
    The code that produces and consumes these serialized objects is used in a variety of locations, and even in the case where these EOF errors occurred usually works as expected. The difference appears to be that the error condition which lead to the object serialization was in-fact an OutOfMemory error. That is, we had an OOM error elsewhere in our application, which caused our objects to be serialized to disk. During this serialization process we end up with corrupt (incomplete) serialization data.
    So.. the question is: Is it possible that the OutOfMemory situation causes the JVM to incorrectly serialize an object (without an error), and specifically to omit runtime data (variables) from the serialized form of the object?
    Thanks/

    jasonpolites wrote:
    So.. the question is: Is it possible that the OutOfMemory situation causes the JVM to incorrectly serialize an object (without an error), and specifically to omit runtime data (variables) from the serialized form of the object?you're sure that the serialization process completed without an error? how do you know the the OOME did not cause the serialization to fail (because the serialization process itself will require more memory, hence if it is happening while the system is near the memory peak, it is likely to fail as well)? generally, when a jvm starts throwing OOME's all bets are off. failures in random places can easily cause the whole internal state of a system to become invalid.

  • [Help] Using a class at the other class

    hi guys, i'm still new to java. So that i tried to learn by myself.
    i got 2 class: 'Person.java' and 'Ex1.java'
    basically, Person just a class for making an object of Person. and the main function is made at Ex1.java.
    my problem is: i made 2 Person objects (p1 and p2). then i tried to initialise them in 2 ways (using default constructor and user-defined constructor). Why when i print 'em (p1.print() and p2.print()), it printed p1 attributes only. I tried many ways to do this, but can't find the way out. pls help me...
    * Person.java *
    public class Person {
         // attributes
         private static String name;
         private static int age;
         // constructor
         public Person() {
              name = "";
              age = -1;
         public Person(String n, int a) {
              name = n;
              age = a;
         // mutator
         public static void setName( String n ) { name = n; }
         public static void setAge( int a) { age = a; }
         // other methods
         public static void print() {
              System.out.println( name + " (" + age + " years old)" );
    * Ex1.java *
    public class Ex1{
         private static Person p1;
         private static Person p2;
         public static void main(String args[]) {
              p1 = new Person();
              p2 = new Person("Jessica", 25);
              p1.setName("Antonio");
              p1.setAge(20);
              p1.print();
              p2.print();
    }

    Change
    public class Person {
         // attributes
         private static String name;
         private static int age;
    to
    public class Person {
         // attributes
         private String name;
         private int age;
    You're using incorrectly static for object attributes:)

  • Circular Linked List

    Hello,
    I am working with circular linked Lists. Now the thing is that my assignment was to make this. I had to write a set of methods. Now the thing is that I had to write a method that removes the last value. I made it but it doesnt wark and also i am confused
    public Object removeFirst()
             if(size()==0)
                return "empty list";
             Object temp = last.getNext().getValue();
             last.setNext(last.getNext().getNext());
             size--;
             return temp;
          //doesnt Work
           public Object removeLast()
              public Object removeLast()
             if (size()==0)
                return "empty list";
             Object temp= null;
             temp = last.getNext().getValue();
             last = last.getNext();
             size--;
             return temp;  
          }

    Well what is wrong with the code?
    Does it compile?
    Does it throw an error at runtime?
    Does it give you an unexpected answer?
    For solving problems like this with next/prev "pointers" I find diagramming boxes with arrows to help understand is an absolute requirement. Try figuring it out on paper.
    If you are removing the last item in the list, that means that the item directly before this one, has to the next one in the list
    Assuming you have a structure like this:
    ...-->  (n-1)  -->  (n)  --> (1) --> (2) -->...(n-1)Then removing item (n) you have to make (n-1) point at item (1) as item (n-1) becomes the new "last"
    So you have to have the item before the "last" element to keep the next/prev pointers correct.

  • Language dependent information about Outlook fields to sort on

    Hi,
    In the next code I found on the forum I use the .sort method with a field name to sort on. I have a Dutch version of Outlook and my question is where can I find the transalation of the Outlook mail items field list in Dutch.
    Looking forward to an answer,
    Kind Regards,
    Marcel Kollenaar
    Sub SortByDate()
    Dim myOlApp As New Outlook.Application
    Dim myNameSpace As Outlook.Namespace
    Dim myFolder As Outlook.MAPIFolder
    Dim myItems As Outlook.Items
    Dim myItem As Outlook.MailItem
    Set myNameSpace = myOlApp.GetNamespace("MAPI")
    Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
    Set myItems = myFolder.Items
    myItems.Sort "[Ontvangen]", False '<<<<< Dutch
    'myItems.Sort "[Received]", False '<<<<< English
    For Each myItem In myItems
    MsgBox myItem.Subject & "-- " & myItem.ReceivedTime
    Next myItem
    Set myItem = Nothing
    Set myItems = Nothing
    Set myFolder = Nothing
    Set myNameSpace = Nothing
    Set myOlApp = Nothing
    End Sub

    Hi Narcel,
    Try to remove square brackets.
    'myItems.Sort "Received", False '<<<<< English
    Here is what MSDN states:
    The Jet query syntax is the easiest to learn and use in your code, but it does not have the power of DASL. Jet queries can create restrictions for most built-in and custom properties. When you create a Jet query, be aware that there are certain computed
    and binary properties that are invalid and will cause Outlook to raise an error. Jet query syntax also does not support the new content indexer keywords that leverage the Instant Search feature in Outlook 2007. Consequently, Jet queries will return results
    slower than DASL queries provided that Instant Search is installed and enabled.
    Property Specifiers
    Jet property specifiers use the English name of the property enclosed in square brackets to represent built-in properties in Jet queries. The English name of the property is identical with the object model name of the property. Based on this convention,
    you can use [Subject] in your Jet query independent of locale to create a restriction on the Subject property of an item. Custom properties use the locale-specific name of the property enclosed in square brackets.
    Tip Don’t confuse the object model name of the property with the Field Chooser name of the property, which is localized. For example, if French is the user interface (UI) language, then the Field Chooser will display a field named Sujet that represents the
    Subject property of a MailItem object. In a Jet equivalence query for "Office 2007" using the Subject property, the filter would be [Subject] = 'Office 2007' whether the UI language is French or English. Be aware that object model names for built-in
    properties have no spaces or special characters, whereas the Field Chooser name can contain both spaces and special characters. For example, the object model name for an assistant’s phone number is AssistantTelephoneNumber. In the Field Chooser, this property
    is Assistant’s Phone. Always use the object model name in your Jet queries.

  • Centering a table in Word LabWindows

    Hello all!
        I create a table in Word using Microsoft Word 9.0 Object Library (word2000.fp) and I have a problem with centering a table in document. I have created correctly table but I can't centered a table in my document page. I have tired all possible of ways to center a table but no results. I don't know what I'm doing wrong. Please help on the issue. Below I add a piece of my code written in Labwindows/CVI:
         Word_GetProperty (docHandle, NULL, Word_DocumentApplication,
                                  CAVT_OBJHANDLE, &appHandleL);
         Word_GetProperty (appHandleL, NULL, Word_ApplicationSelection,
                       CAVT_OBJHANDLE, &currSelHandleL);
         // adding paragraph
         Word_SelectionTypeParagraph (currSelHandleL, NULL);
         Word_GetProperty (currSelHandleL, NULL, Word_SelectionRange,
                       CAVT_OBJHANDLE, &rangeHandleL);
         // creating a table
         Word_GetProperty (docHandle, NULL, Word_DocumentTables, CAVT_OBJHANDLE, &tablesHandleL);
          Word_TablesAdd (tablesHandleL, NULL, rangeHandleL, 5, 6,CA_VariantInt(1) , 
                      CA_VariantInt(0), &tableHandleL );  
          //Word_TableSelect (tableHandleL, NULL);
          // centering a table
          Word_GetProperty (currSelHandleL, NULL, Word_SelectionTables, CAVT_OBJHANDLE, &tablesHandleL);
          //Word_SetProperty (tablesHandleL, NULL, Word_RowsWrapAroundText, CAVT_BOOL, FALSE);
          Word_SetProperty (tablesHandleL, NULL, Word_RowsAlignment, CAVT_LONG,
                    WordConst_wdAlignRowCenter);
    What am I doing wrong? How should be correctly it?
          I greet    Theodore
    Solved!
    Go to Solution.

    Hi Tamás Simon,
       My version of CVI and OS what I'm using it's: CVI 8.5 and Windows XP Professional SP3, but ones are alright. I have found solution to my problem. The issue was lying in incorrect use of objects in the called function Word_SetProperty ( ). I used the syntax:
          Word_SetProperty (tablesHandleL, NULL, Word_RowsAlignment, CAVT_LONG, WordConst_wdAlignRowCenter);
    and it should be as:
          Word_SetProperty (WordObjRows, NULL, Word_RowsAlignment, CAVT_LONG, WordConst_wdAlignRowCenter);
    The entrie code source to create a table with centering should look like this:
    int CVICALLBACK Add_Table (int panel, int control, int event,
                  void *callbackData, int eventData1, int eventData2)
         WordObj_Columns                   WordObjColumns;
         WordObj_Rows                        WordObjRows;
         WordObj_ParagraphFmt          WordObjParagraphsFmt;
         WordObj_Paragraphs              WordObjParagraphs;
         WordObj_Range                      rangeHandleL;
         WordObj_Table                        tableHandleL;
         WordObj_Tables                      tablesHandleL;
         WordObj_Selection                  currSelHandleL;
         WordObj_Application               appHandleL;
         switch (event)
          case EVENT_COMMIT:
              Word_GetProperty (docHandle, NULL, Word_DocumentApplication,
                                  CAVT_OBJHANDLE, &appHandleL);
              Word_GetProperty (appHandleL, NULL, Word_ApplicationSelection,
                                  CAVT_OBJHANDLE, &currSelHandleL);
              // adding paragraph with centering property
              Word_GetProperty (docHandle, NULL, Word_DocumentParagraphs,
                                  CAVT_OBJHANDLE, &WordObjParagraphs);
              Word_GetProperty (WordObjParagraphs, NULL, Word_SelectionParagraphFormat,
                                  CAVT_OBJHANDLE, &WordObjParagraphsFmt);
              Word_SetProperty (WordObjParagraphsFmt, NULL, Word_SelectionParagraphFormat,
                                  CAVT_OBJHANDLE, &WordObjParagraphsFmt);
              Word_SetProperty (WordObjParagraphsFmt, NULL, Word_ParagraphFmtAlignment,
                                  CAVT_LONG, WordConst_wdAlignParagraphCenter);
              Word_SelectionTypeParagraph (currSelHandleL, NULL);
              Word_GetProperty (currSelHandleL, NULL, Word_SelectionRange,
                                  CAVT_OBJHANDLE, &rangeHandleL);
               // creating a table
              Word_GetProperty (docHandle, NULL, Word_DocumentTables, CAVT_OBJHANDLE, &tablesHandleL);
              Word_TablesAdd (tablesHandleL, NULL, rangeHandleL, 5, 6,
                                 CA_VariantInt(1), CA_VariantInt(0), &tableHandleL);
              // setting rows and columns size the table
              Word_GetProperty (tableHandleL, NULL, Word_TableRows, CAVT_OBJHANDLE,
                                 &WordObjRows);
              Word_GetProperty (tableHandleL, NULL, Word_TableColumns,
                                CAVT_OBJHANDLE, &WordObjColumns);
              Word_SetProperty (WordObjRows, NULL, Word_RowsHeight, CAVT_FLOAT, 20.5);
              Word_SetProperty (WordObjColumns, NULL, Word_ColumnsPreferredWidth,
                                CAVT_FLOAT, 40.5);
              // centering the table
              Word_SetProperty (WordObjRows, NULL, Word_RowsAlignment, CAVT_LONG,
                                WordConst_wdAlignRowCenter);
            break;
     return 0;
    I added also some table properties, such as size rows and columns, paragraph with centering. I hope that it will be useful to someone.
             I would like to thank you for your help and wish you all the best
             Theodore85

Maybe you are looking for

  • The RFX before upgrade does not allow me to add items from catalog

    hello gurus I have a problem with the RFX, we did an upgrade to SRM7.0 from SRM5.0. The RFX that existed before upgrade in the server does not allow me to add new items from catalog. each RFx I created after the upgrade works fine. My client needs to

  • App crashing after lollipop update

    I have noticed that after my handset got updated to lollipop certain app will crash for no particular reason.  For instance I may be reading an article usually in Chrome and it just kick me out to my home screen.  This is very frustrating when I am  

  • Fact table have tow column reference the same dim table

    In my analytic domain, my fact table have tow column reference the same dim table, but in physical diagram, between two table ,can only have one join, so i create a copy of the dim table, then finish the join in physical. This method can resolve this

  • Weblogic server crash

    I need help.....I've been getting this error and I can't resolve this issue...please help..below are the error that I get... An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0xfe7de06c Fun

  • Need better alternative to Adobe AIR Application Installer

    In order to build a double-clickable desktop application, apparently one has to use the Adobe AIR Application Installer. This is bad for a few reasons: It's not scriptable. It hard-wires the name of the swf file to load into the generated binary. For