Putting a Class Object into a Vector

HI all
I need to put a class object into another classes vector, then be able to read it and retrieve data.
I can put the object into the vector but all i seem to be able to retrieve is data like Account@2343c2.
Is this some sort of tag? How do i get to the data?
thankz
joey

That's what you get when you print an object which does not have its own toString() method to do anything different - it picks up the Object class's toString method instead. For example:
System.out.println(new Object());It sounds like you're doing something like this:
Vector v = new Vector();
v.add(new Account(42));If you were to do the following, you would see that sort of output:
System.out.println(v.get(0));The appropriate way to do this would be something like the following:
   // Use a List reference instead of a Vector reference, and create
   // an ArrayList object in preference to a Vector object
   List list = new ArrayList();
   list.add(new Account(42));
   // Iterate through the list of accounts - use an
   // iterator because this prevents off-by-one errors
   // that arise with direct indexing.
   Iterator i = list.iterator();
   while(i.hasNext()) {
      // Cast the reference returned by the iterator from
      // Object to Account so that we can call account-specific
      // methods.
      Account current = (Account)i.next();
      // Call the method specific to the Account class (getBalance
      // is just an example that I made up).
      System.out.println(current.getBalance());
   }

Similar Messages

  • How can I store a File object into a Vector and get it back

    hi there
    I need to store a number of File object into a Vector first, and later on I need to get each File object out and work with it.
    Vector mylist;
    File[] myfile;
    ....get a list of files from using File Chooser
    mylist = new Vetor();
    for (i=0;i<myfile.length;i++){
    mylist.add(myfile);
    ..how do I get them back? i try to do this way
    for (i=0;i<mylist.size(); i++)
    File tempfile = mylist.get(i);
    ..work with tempfile. but I got java.lang.object error: imcompatible types. what can I do?

    Vector mylist;
    File[] myfile;
    ....get a list of files from using File Chooser
    mylist = new Vetor();
    for (i=0;i<myfile.length;i++){
    mylist.add(myfile);
    ok try this: i don't reall understand what your trying to do though...
    File[] files;
    // get files
    Vector fileList = new Vector();
    for (int i = 0; i < files.length; i++)
      fileList.add(files);
    // to get them out.
    for (int i = 0; i < fileList.size(); i++)
    ((File)fileList.elementAt(i)).toString();
    // or
    // to get them out.
    for (int i = 0; i < fileList.size(); i++)
    File temp = (File)fileList.elementAt(i);
    System.out.println(temp.toString);

  • Class Object into Byte Array

    Is there a way to copy a class object into a byte array? If so, how?

    hi check out
    http://forum.java.sun.com/thread.jspa?threadID=562268&
    messageID=2766098This does not work in j2me. WriteObject does not exist, and there are no serialsation interfaces in j2me. So you'll have to do that on your own.
    look here: http://java.sun.com/developer/J2METechTips/2002/tt0226.html

  • Put database result set into a vector?

    I have a resultset rs I would like to put into a vector but I don't seem to get something fundamental. I can put individual items in with add() for instance but how do I dump a whole result set in there...
    and if I do so should I turn them all to strings before putting them into the vector?
    Any general advice would be appreciated, I've read a lot about Vectors today and have ended up more confused than I'd have expected. So I have come to seek some basic advice.
    private static void showResult (ResultSet rs) throws SQLException {
                            Vector vector = new Vector();
             try
                     // rs is the resultset output from a database
                                      vector.addAll(rs);
             catch(NullPointerException ex)
                    System.out.println("bugger - null pointer exception");
                    System.out.println();
                    ex.printStackTrace();
    }

    Iterate over the resultset, create your own object to store data for each row and add that object to the vector. There is no escape from this.
    catch(NullPointerException ex)You should not be handling Runtime exceptions. You need to take care not to let them occur through your coding logic.

  • NullPointerException when adding an object into a Vector Class

    So here is the code:
    package Image;
    import java.io.Serializable;
    import java.util.Vector;
    public class Album implements Serializable{
    private String name;
    private String password;
    Vector<ImageClass> allImages;
    public Album( String name, String password, Vector<ImageClass> allImages) {
    this.name = name;
    this.password = password;
    this.allImages = allImages;
    public Album() {
    public Vector<ImageClass> getAllImages() {
    return allImages;
    public void setAllImages(Vector<ImageClass> allImages) {
    this.allImages = allImages;
    public String getName() {
    return name;
    public void setName(String name) {
    this.name = name;
    public String getPassword() {
    return password;
    public void setPassword(String password) {
    this.password = password;
    public void addIC(ImageClass ic){
    allImages.add(ic);
    public ImageClass getIC(int pos){
    ImageClass ic = allImages.get(pos);
    return ic;
    Now I got an NullPointerException when I call the getIC Method from another class of another package
    Here is the part of code of that class.
    private void SaveMenuItemActionPerformed(java.awt.event.ActionEvent evt) {                                            
    ImageClass ic = new ImageClass();
    ic.setTitle(ImageTextField.getText());
    ic.setDescription(DescriptionTextArea.getText());
    try {
    ic.setReferenceNumber(Integer.parseInt(ReferenceTextField.getText()));
    } catch (NumberFormatException nfe) {
    JOptionPane.showMessageDialog(null, "Reference Number is not in a correct format");
    try {
    ic.setDate(new SimpleDateFormat("dd/MM/yyyy").parse(DateTextField.getText(), new ParsePosition(0)));
    } catch (IllegalArgumentException iae) {
    JOptionPane.showMessageDialog(null, "Date is not in correct format");
    ic.setImageData(imageData);
    if(a==null){
    JOptionPane.showMessageDialog(this,"Please, create or open an Album");
    }else{
    a.addIC(ic);
    try{
    ObjectOutputStream oos;
    FileOutputStream fos = new FileOutputStream(album, true);
    oos = new ObjectOutputStream(fos);
    oos.writeObject(a);
    oos.flush();
    oos.close();
    }catch(FileNotFoundException fnfe){
    fnfe.printStackTrace();
    }catch(IOException ioe){
    ioe.printStackTrace();
    }

    h1. The Ubiquitous Newbie Tips
    * DON'T SHOUT!!!
    * Homework dumps will be flamed mercilessly. [Feelin' lucky, punk? Well, do ya'?|http://www.youtube.com/watch?v=1-0BVT4cqGY]
    * Have a quick scan through the [Forum FAQ's|http://wikis.sun.com/display/SunForums/Forums.sun.com+FAQ].
    h5. Ask a good question
    * Don't forget to actually ask a question. No, The subject line doesn't count.
    * Don't even talk to me until you've:
        (a) [googled it|http://www.google.com.au/] and
        (b) had a squizzy at the [Java Cheat Sheet|http://mindprod.com/jgloss/jcheat.html] and
        (c) looked it up in [Sun's Java Tutorials|http://java.sun.com/docs/books/tutorial/] and
        (d) read the relevant section of the [API Docs|http://java.sun.com/javase/6/docs/api/index-files/index-1.html] and maybe even
        (e) referred to the JLS for "advanced" questions.
    * [Good questions|http://www.catb.org/~esr/faqs/smart-questions.html#intro] get better Answers. It's a fact. Trust me on this one.
        - Lots of regulars on these forums simply don't read badly written questions. It's just too frustrating.
          - FFS spare us the SMS and L33t speak! Pull your pants up, and get a hair cut!
        - Often you discover your own mistake whilst forming a "Good question".
        - Often you discover that you where trying to answer "[the wrong question|http://blog.aisleten.com/2008/11/20/youre-asking-the-wrong-question/]".
        - Many of the regulars on these forums will bend over backwards to help with a "Good question",
          especially to a nuggetty problem, because they're interested in the answer.
    * Improve your chances of getting laid tonight by writing an SSCCE
        - For you normal people, That's a: Short Self-Contained Compilable (Correct) Example.
        - Short is sweet: No-one wants to wade through 5000 lines to find your syntax errors!
        - Often you discover your own mistake whilst writing an SSCCE.
        - Often you solve your own problem whilst preparing the SSCCE.
        - Solving your own problem yields a sense of accomplishment, which makes you smarter ;-)
    h5. Formatting Matters
    * Post your code between a pair of &#123;code} tags
        - That is: &#123;code} ... your code goes here ... &#123;code}
        - This makes your code easier to read by preserving whitespace and highlighting java syntax.
        - Copy&paste your source code directly from your editor. The forum editor basically sucks.
        - The forums tabwidth is 8, as per [the java coding conventions|http://java.sun.com/docs/codeconv/].
          - Indents will go jagged if your tabwidth!=8 and you've mixed tabs and spaces.
          - Indentation is essential to following program code.
          - Long lines (say > 132 chars) should be wrapped.
    * Post your error messages between a pair of &#123;code} tags:
        - That is: &#123;code} ... errors here ... &#123;code}
        - OR: &#91;pre]&#123;noformat} ... errors here ... &#123;noformat}&#91;/pre]
        - To make it easier for us to find, Mark the erroneous line(s) in your source-code. For example:
            System.out.println("Your momma!); // <<<< ERROR 1
        - Note that error messages are rendered basically useless if the code has been
          modified AT ALL since the error message was produced.
        - Here's [How to read a stacktrace|http://www.0xcafefeed.com/2004/06/of-thread-dumps-and-stack-traces/].
    * The forum editor has a "Preview" pane. Use it.
        - If you're new around here you'll probably find the "Rich Text" view is easier to use.
        - WARNING: Swapping from "Plain Text" view to "Rich Text" scrambles the markup!
        - To see how a posted "special effect" is done, click reply then click the quote button.
    If you (the newbie) have covered these bases *you deserve, and can therefore expect, GOOD answers!*
    h1. The pledge!
    We the New To Java regulars do hereby pledge to refrain from flaming anybody, no matter how gumbyish the question, if the OP has demonstrably tried to cover these bases. The rest are fair game.

  • Recordset putting into a vector

    Hi. I have been struggling with this piece of code. What I am trying to do is, doing a "select all" query on a table and building a Category object from each record. Then I am putting each object into a vector and return the vector. But I keep getting a null pointer exceprion. Can anyone pls figure out whats wrong with this code?.
    Thanks a lot.
    private Vector doQuery(String sqlQuery)
              Vector list=null;
              Statement statement = null;
              ResultSet resultSet = null;
              Category c = new Category ();
              try{
                   statement = trManager.getDBConnection().createStatement();
                   resultSet = statement.executeQuery(sqlQuery);
                   if(resultSet!=null)
                        while(resultSet.next())
                             int i =1;
                             c.setCategoryCode(resultSet.getString(i++));
                             c.setCategoryName(resultSet.getString(i++));                              list.addElement(c);          
              catch(SQLException e)
                   System.out.println(e);               
              finally
                   trManager.closeResultSet(resultSet);
                   trManager.closeStatement(statement);
                   return list;          

    what is the query that ou are executed
    what is the no of rows expected from the query.
    If it is too large then the possible cause for EOF
    exception may be lack of memory/I doubt that this relates to OOM.... also the next() will not iterate over null returns so....
    Please post corrected code and the excption stack for clarity... :)

  • How to typecast Object Class object dynamically

    Hai every one
    i have a object of any particular class , but i don't know the variables in that class object. But i have string variable contains value of variables in that class object.
    So i use following method for get value of variables in that class object.
    class ObjectCLass
         Sub s=new Sub();
         public static void main(String[] args)
              ObjectCLass a=new ObjectCLass();
              try
                   System.out.println(*a.getClass().getDeclaredField("s").get(a)*);
              catch(Exception e)
                   System.out.println("Exception");
    class Sub
         int i=5;
         public void print()
              System.out.println("Hello World!");
    }Here the bolder line give Object class object. By using this Object class object i need access the variable i and method print(). So i need to cast Object class object into sub class
    so how can i typecast it
    i try with following methods , but i cant succeed
    1.(  *(a.getClass().getDeclaredField("s").get(a).getClass)*   a.getClass().getDeclaredField("s").get(a)   ).print() ;
    2.(  (Class.forName(�Sub�) ) a.getClass().getDeclaredField("s").get(a) ).print();Please any one one help me how to typecast it dynamically
    By
    Thiagu

    If you know you're going to invoke the "print" method on an object, then you also need to know the type of the class, or interface, which has that method.
    It seems what you are looking for is a tutorial on interfaces.
    http://java.sun.com/docs/books/tutorial/java/IandI/index.html
    In a nutshell, you can set up an interface which defines a "print" method, and create class(es) which implement that interface. Then as long as you have an object which implements that interface, but do not know the exact type of that object, you can simply cast it to the interface type and invoke the method.

  • Problem when adding java objects in a vector and passing thru web service

    Hi! I'm getting this error when I try to add a java object I created into a vector and passing it through a web service: java.lang.IllegalArgumentException: No Serializer found to serialize a 'testObj' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'
    This does not happen when I simply add strings or Integer objects into the vector. What am I missing?
    Thanks.

    just chek this
    http://forum.java.sun.com/thread.jspa?threadID=501189&messageID=2370914
    Edited by: garava on Jul 16, 2008 1:13 PM.
    It would be great if you could paste the wsdl part for that vector and just have a look for the complex typr cntent
    like for HashMap we have the following mapping
    <complexType name="HashMap">
      <sequence>
        <element name="item" minOccurs="0" maxOccurs="unbounded">
          <complexType>
            <sequence>
              <element name="key" type="anyType" />
              <element name="value" type="anyType" />
            </sequence>
          </complexType>
        </element>
      </sequence>
    </complexType>Since in Value it should again contain a mapping for the Object which you are trying to pass then only an appropriate serializer and deserilaizer would get generated. Hope this answers your query. For refernece
    http://www.theserverside.com/tt/articles/article.tss?l=Systinet-web-services-part-2
    [http://www.theserverside.com/tt/articles/article.tss?l=Systinet-web-services-part-2|For refernce tutorial]
    Thanks,
    Avadhoot Sawant.
    Edited by: garava on Jul 16, 2008 1:16 PM

  • Putting a class of objects in a Linked List?

    Hi,
    I copied a program from a book and I want to edit it and put studentRecord class in the Linked List. I've tried to play about with datum, but everything I try doesn't work. Can someone help me out? How could I put studentRecord in the LinkedList?
    import java.io.*;
    class IO
         static BufferedReader keyboard = new
              BufferedReader(new InputStreamReader(System.in));
         static PrintWriter screen = new PrintWriter(System.out, true);
    class studentRecord
         private String name;
         private int IDNumber;
    class LinkedList
         class Node
              protected Object datum;
              protected Node link;
              public Node() {}
              public Node(Object item, Node pointer)
                   datum = item;
                   link = pointer;
         private Node head;
         private Node tail;
         private Node temporary;
         private int nodeCount = 0;
         //constructor
         public LinkedList()
              head = null;
              tail = null;
              temporary = null;
         //method to insert an object into the linked list
         public void insert(Object datum)
              if (head == null) // list empty
                   head = new Node(datum, head);
                   tail = head;
              else
                   temporary = new Node(datum, temporary);
                   tail.link = temporary;
                   tail = temporary;
                   temporary = null;
              nodeCount++;
    Full program can be found: http://dil3mma.tripod.com/LinkedList.txt
    Thanks in advance.

    Hi jverd,
    Thanks for replying. I've tried to change the program liked you said but there is 1 error I can't seem to fix(Im sure there are more tho). The error is "cannot resolve symbol" I typed in caps the line it happens on so it's easy to see. Any idea what it could be? Is it cause I'm comparing a String with Object?
    import java.io.*;
    class IO
         static BufferedReader keyboard = new
              BufferedReader(new InputStreamReader(System.in));
         static PrintWriter screen = new PrintWriter(System.out, true);
    class sRecord
         private String name;
         private int IDNumber;
    class LinkedList
         class Node
              protected sRecord datum;
              protected Node link;
              public Node() {}
              public Node(sRecord item, Node pointer)
                   datum = item;
                   link = pointer;
         private Node head;
         private Node tail;
         private Node temporary;
         private int nodeCount = 0;
         //constructor
         public LinkedList()
              head = null;
              tail = null;
              temporary = null;
         //method to insert an object into the linked list
         public void insert(sRecord datum)
              if (head == null) // list empty
                   head = new Node(datum, head);
                   tail = head;
              else
                   temporary = new Node(datum, temporary);
                   tail.link = temporary;
                   tail = temporary;
                   temporary = null;
              nodeCount++;
         //method to delete an object from the linked list
         public boolean delete(Object scrap)
              Node previous = head;
              //for every node in the linked list
              for (Node current = head; current != null; current = current.link)
                   //node to be deleted is at the head of the list
                   if (current.datum.equals(scrap) && previous == current)
                        head = current.link;
                        if (head == null) tail = null;
                        nodeCount--;
                        return true;
                   //node to be deleted is after the first node and before the last
                   else if (current.datum.equals(scrap) && (current.link != null))
                        previous.link = current.link;
                        nodeCount--;
                        return true;
                   //node to be deleted is at the ned of list
                   else if (current.datum.equals(scrap) && (current.link == null))
                        tail = previous;
                        previous.link = null;
                        nodeCount--;
                        return true;
                   previous = current;
              return false;
         //method to display the contents of a linked list
         public void displayList()
              Node temporary = head;
              if (head == null)
                   IO.screen.println("linked list is empty");
                   return;
              while (temporary != null)
                   IO.screen.println(temporary.datum);
                   temporary = temporary.link;
         //method to return true if the linked list is empty
         public boolean isEmpty()
              return (nodeCount == 0);
         //method to return the number of nodes in the linked list
         public int nodes()
              return nodeCount;
         //method to display a menu to insert data into the linked list
         static private char menu()
              char response = '\u0000';
              IO.screen.println("Do you want to ");
              IO.screen.print("nsert, [D]elete, [L]ist, [E]xit? ");
              IO.screen.flush();
              boolean done=false;
              do
                   try
                        String data = IO.keyboard.readLine();
                        response = Character.toUpperCase(data.charAt(0));
                        done = true;
                   catch (Exception e)
                        IO.screen.println("Please input a single character I, D, L or E");
              } while (! done);
              return response;
         static public void main(String[] args) throws IOException
              LinkedList list = new LinkedList();
              String datum;
              char choice;
              //get information from menu
              choice = menu();
              for (;;)
                   //Menu
                   switch (choice)
                        case 'I' :
                             IO.screen.println("type quit to finish input");
                             IO.screen.print("Enter a word ");
                             IO.screen.flush();
                             datum = IO.keyboard.readLine();
                             while (! datum.equals("quit"))
    THE ERROR HAPPENS HERE ON THIS LINE          list.insert(datum.name);
                                  IO.screen.print("Enter another word");
                                  IO.screen.flush();
                                  datum = IO.keyboard.readLine();
                             break;
                   case 'D' :
                        //if list is empty deletion not possible
                        if (list.isEmpty())
                             IO.screen.println("linked list is empty");
                             break;
                        IO.screen.println("type quit to finish input");
                        IO.screen.print("Delete? ");
                        IO.screen.flush();
                        datum = IO.keyboard.readLine();
                        while (! datum.equals("quit"))
                             if (list.delete(datum))
                                  IO.screen.println(datum+" was scrapped!");
                             //if list is empty deletion is not possible
                             if (list.isEmpty())
                                  IO.screen.println("linked list is empty");
                                  break;
                             IO.screen.print("Delete? ");
                             IO.screen.flush();
                             datum = IO.keyboard.readLine();
                        break;
                   case 'L' :
                        list.displayList();
                        IO.screen.println("number of nodes " + list.nodes());
                        break;
                   case 'E' : System.exit(0);
              //get information from menu
              choice = menu();

  • Putting Resultset objects in an Vector

    Can anybody help me, I have to put all my results from the ResultSet in a Vector.
    But I don't know how.
    Thanx in advance.

    for a vector of vector ....
    public static Vector prepareData(ResultSet rs)
         Object lValue=null;
         Vector returnedVector=new Vector();
         try
              Enumeration lEnum=null;
              rs.beforeFirst();
              while (!rs.isLast())
                   lEnum=this.elements();
                   Vector lLine=new Vector();
                   int i=0;
                   rs.next();
                   while (lEnum.hasMoreElements())
                        lValue=rs.getObject(i);
                        lLine.add(lValue);
                        i++;
                   returnedVector.add(lLine);
         catch (SQLException e)
              e.printStackTrace();
         return returnedVector;          

  • Requirements to put my own value object into the context

    Hello,
    are there any requirements to put my own value object into the context?
    I got following exception
    An error has occurred:
    "Failed to process the request."
    Please contact your system administrator.
    Hide details
    Web Dynpro product information:
    Product: null, Vendor: SAP AG, Version: null, Build ID: 6.3006.00.0000.20040617153350.0000, Build Date: Mon Aug 16 09:18:37 CEST 2004
    Error stacktrace:
    java.lang.ClassCastException
         at com.sap.tc.webdynpro.progmodel.context.Paths.getAttributeInfoFor(Paths.java:186)
         at com.sap.tc.webdynpro.clientimpl.html.uielib.standard.uradapter.DropDownByKeyAdapter.setViewAndNodeElement(DropDownByKeyAdapter.java:230)
         at com.sap.tc.webdynpro.clientimpl.html.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:230)
         at com.sap.tc.webdynpro.clientimpl.html.uielements.adaptmgr.URAdapterManager.getAdapterFor(URAdapterManager.java:63)
         at com.sap.tc.webdynpro.clientimpl.html.uielib.standard.uradapter.TableAdapter$ContentCell.getContent(TableAdapter.java:1295)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.SapTableCellRenderer.render(SapTableCellRenderer.java:57)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.SapTableRowRenderer.renderSapTableRowFragment(SapTableRowRenderer.java:67)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.SapTableRowRenderer.render(SapTableRowRenderer.java:33)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.SapTableDefaultBodyRenderer.renderSapTableDefaultBodyFragment(SapTableDefaultBodyRenderer.java:96)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.SapTableDefaultBodyRenderer.render(SapTableDefaultBodyRenderer.java:29)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.SapTableRenderer.renderSapTableFragment(SapTableRenderer.java:394)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.SapTableRenderer.render(SapTableRenderer.java:49)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.renderGridLayoutCellFragment(GridLayoutRenderer.java:609)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.renderGridLayoutRowFragment(GridLayoutRenderer.java:312)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.renderGridLayoutFragment(GridLayoutRenderer.java:250)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.render(GridLayoutRenderer.java:57)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ScrollContainerRenderer.renderScrollContainerFragment(ScrollContainerRenderer.java:235)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ScrollContainerRenderer.render(ScrollContainerRenderer.java:41)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ViewContainerRenderer.renderViewContainerFragment(ViewContainerRenderer.java:93)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ViewContainerRenderer.render(ViewContainerRenderer.java:33)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.renderGridLayoutCellFragment(GridLayoutRenderer.java:609)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.renderGridLayoutRowFragment(GridLayoutRenderer.java:312)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.renderGridLayoutFragment(GridLayoutRenderer.java:250)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.GridLayoutRenderer.render(GridLayoutRenderer.java:57)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ScrollContainerRenderer.renderScrollContainerFragment(ScrollContainerRenderer.java:235)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ScrollContainerRenderer.render(ScrollContainerRenderer.java:41)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ViewContainerRenderer.renderViewContainerFragment(ViewContainerRenderer.java:93)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.ie6.ViewContainerRenderer.render(ViewContainerRenderer.java:33)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.UiWindowRenderer.render(UiWindowRenderer.java:32)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:268)
         at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:94)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendHtml(HtmlClient.java:454)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendResponse(HtmlClient.java:286)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendResponse(HtmlClient.java:178)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:632)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:57)
         at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:249)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:139)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:101)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:45)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:383)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:333)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:311)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:811)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:235)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:144)

    Hi Jurgen,
    Can you please explain what you are trying to do in detail. Do you want to create a Node dynamically in the context or, you want to populate a Node in a Context???
    The stack trace, does not reveal what you want to do with the value object!
    Thanks and Regards,
    Vishnu Prasad Hegde

  • Passing objects into a class constructor

    I've created a frame for inputting a patient's medical results. There are lots of buttons for temperature, blood pressure, etc. I've created a separate, inner class that creates a NumberPad frame to enter the patient's results. Press the "Temp." button, for example, a NumberPad appears, you enter the temperature, press the "Enter" button on the NumberPad and the number appears in a Label next to the "Temp." button.
    The problem is that I've written the constructor of the NumberPad with a label parameter so that the right label gets updated. e.g.
    class NumberPad extends Frame implements ActionListener
    public NumberPad(Label aLabel)
    However, because I've implemented ActionListener, I've had to override the actionPerformed method and I don't know how to pass the aLabel object that I give to the NumberPad constructor into the actionPerformed method so that, for example
    public actionPerformed(ActionEvent evt)
    String s = evt.getActionCommand
    if (s.equals("ENTER")
    aLabel.setText(display of numberpad);
    How do I transfer the aLabel object into the actionPerformed method so that the correct label gets updated?

    Store the label as an instance variable.
    class NumberPad extends Frame implements ActionListener {
        private Label aLabel;
        public NumberPad(Label aLabel) {
            this.aLabel = aLabel;
        public actionPerformed(ActionEvent evt) {
            String s = evt.getActionCommand;
            if (s.equals("ENTER") {
                aLabel.setText(display of numberpad);
    }[/code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Can I put a class into a jsp??

    I want to put this class into a jsp.. and reference it when I need it... can i just dumped it into a jsp... or do I have to do anything specific to it...
    public class areaformat {
         public synchronized static String replace(String str, char oldchar, String newstr)     {
              StringBuffer sb = new StringBuffer(str);
              int len = sb.length();
              try     {
                   for (int i=0; i<=len; i++)     {
                        if (sb.charAt(i) == oldchar)     {
                             sb = sb.replace(i, i, newstr);
                             sb.deleteCharAt(i + newstr.length());
                             i = i + newstr.length() - 1;
              }catch(StringIndexOutOfBoundsException sioobe)     {
                   if (len == 1 && str.equals("'")) {
                        sb = new StringBuffer(newstr);
              return sb.toString();
    Thx RIch

    No, you can't. You can put only the function in the beginning of your jsp file like:
    <%!
    public void myFunction(...){
    %>
    So, you can use myFunction wherever you want in the page.
    The other method is to compile your class in a file called "javac className.java" and the put the .class file generated in your WEB-INF/classes folder of your web-container.

  • [svn:fx-trunk] 11575: Put default style declarations into one class per application or module.

    Revision: 11575
    Author:   [email protected]
    Date:     2009-11-09 11:34:57 -0800 (Mon, 09 Nov 2009)
    Log Message:
    Put default style declarations into one class per application or module.
    Generate all the default styles in one class instead of a class for each style. The name of the style class will be based on the application or module name. An application named ?\226?\128?\156foo?\226?\128?\157 will have a style class named ?\226?\128?\156_foo_Style?\226?\128?\157. The idea is to allow applications to be compiled with different themes and get their owns styles. Currently this is not possible because a global style in both themes will have the same class name, _globalStyle. Whatever class the top-level application loads the sub-applications and modules will have to use the same class because of the flash player first-class-in-wins rule. Now each application and module will have their own style class.
    QE notes: None.
    Doc notes: None.
    Bugs: SDK-22454
    Reviewer: Paul, Pete
    Tests run: checkintests, all mustella tests.
    Is noteworthy for integration: No.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22454
    Modified Paths:
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleDef.vm
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StylesContainer.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java

    Revision: 11575
    Author:   [email protected]
    Date:     2009-11-09 11:34:57 -0800 (Mon, 09 Nov 2009)
    Log Message:
    Put default style declarations into one class per application or module.
    Generate all the default styles in one class instead of a class for each style. The name of the style class will be based on the application or module name. An application named ?\226?\128?\156foo?\226?\128?\157 will have a style class named ?\226?\128?\156_foo_Style?\226?\128?\157. The idea is to allow applications to be compiled with different themes and get their owns styles. Currently this is not possible because a global style in both themes will have the same class name, _globalStyle. Whatever class the top-level application loads the sub-applications and modules will have to use the same class because of the flash player first-class-in-wins rule. Now each application and module will have their own style class.
    QE notes: None.
    Doc notes: None.
    Bugs: SDK-22454
    Reviewer: Paul, Pete
    Tests run: checkintests, all mustella tests.
    Is noteworthy for integration: No.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22454
    Modified Paths:
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleDef.vm
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StylesContainer.java
        flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java

  • SCOM 2012 - Use Powershell to put specific server and contained objects into Maintenance Mode

    I am still trying to develop what I thought was going to be an easy script, to put a specific server and all it's contained objects into maintenance mode in SCOM 2012.   Not a group, but just one specific server and all it's stuff.
    My script to START maintenance mode has two parameters:
    1.  The FQDN.  So for example: server1.contoso.com
    2.  The amount of minutes to put into maintenance mode
    Then it does the following to START maintenance mode:
    Import-Module OperationsManager
    $Instance = Get-SCOMClassInstance -Name $FQDN
    If ($Instance)
    $newEnd = ((Get-Date).AddMinutes($minutes))
    Start-SCOMMaintenanceMode -Instance $Instance -end $newEnd -Reason "PlannedOther" -Comment "Comments here"
    This seems to work from what I can tell.  I know that when you schedule maintenance mode manually in SCOM, there is an option to apply to "Selected objects and all their contained objects".  I do not know if that is occurring based on
    my code above.   But I think that is what I want to happen.   I just want all monitoring and alerting for the specified server to stop.   So if you think I need to change the above code so that it gets all the "contained
    objects" please let me know.
    The second part, which I know for a fact isn't fully working, is intended to stop maintenance mode for a server.
    My script to STOP maintenance mode has only one parameter:
    1.  The FQDN.  So for example: server1.contoso.com
    Then it does the following to STOP maintenance mode:
    Import-Module OperationsManager
    $Instance = Get-SCOMClassInstance -Name $FQDN
    If ($Instance)
    $MMEntry = Get-SCOMMaintenanceMode -Instance $Instance
    If ($MMentry)
    #basically sends an end time of 1 minute from when the script is run
    $newEnd = ((Get-Date).AddMinutes(1))
    Set-SCOMMaintenanceMode -MaintenanceModeEntry $MMEntry -EndTime $NewEnd -Comment "Removing from Maintenance Mode"
    This part does seem to work partially.   It does remove the server from maintenance mode.  However, I suspect that it's not removing all the "contained objects" from maintenance mode because when I run the script to stop maintenance
    mode on a server, the little maintenance mode icon in SCOM does go away but the overall light for the server stays set to "Not Monitored".   It never turns back to the green checkbox and says "Healthy".   When I start
    and stop maintenance mode manually I can see that the green Healthy checkbox comes back.  But when I try to run my above code to do it via script, it stays at "Not Monitored" instead.
    Can someone help me out here?  Looking for answers to two questions:
    1.  Does my Start maintenance mode code look ok? Will that put a server and all it's contained objects into maintenance mode?
    2.  What do I need to hadd to my Stop maintenance mode code, so that it correctly stops maintenance mode on the server and all its objects and everything starts to be monitored again?
    Thanks in advance!  Please let me know if you need any more information in order to be able to help me!

    Hello, thanks for your response.  Unfortunately, it does not appear that the link you provided works.
    As far as not including "selected objects and all their contained objects" I am wondering if there is a way for me to tell for sure. One thing I found was that if I run this script and put the server into maintenance mode, then I go into
    SCOM and click on Edit Maintenance Mode for that server, it shows me the details.   It has some comment, and my selected reason, based on the code I posted above.   It also DOES have "selected objects and all their contained objects"
    selected at top.  So it seems to me like it is working correctly, and does contain all the objects.   If you think that 'Edit' screen would be inaccurate for some reason, please let me know.  Or if you know of a way for me to check and
    confirm, please let me know that as well.
    As for REMOVING it from maintenance mode, I did eventually find a line of code that I think works.  Here's what my code looks like now:
    Import-Module OperationsManager
    $Instance = Get-SCOMClassInstance -Name $FQDN
    If ($Instance)
    $MMEntry = Get-SCOMMaintenanceMode -Instance $Instance If ($MMentry)
    $Instance.StopMaintenanceMode([DateTime]::Now.ToUniversalTime(),[Microsoft.EnterpriseManagement.Common.TraversalDepth]::Recursive);
    When I use the above code to STOP maintenance mode, the green checkmark does reappear for the server, and everything seems to be being monitored again.   Unlike before, where the maintenance mode icon would go away, but it would never change back
    to saying 'Monitored' again.  So I think that changing that one line to stop maintenance mode seems to have done the trick.
    So I guess my last concern now is just putting in maintenance mode initially, as I was talking about above.  If you still think the 'Edit Maintenance Mode' screen is not a good indicator of what my code does, please let me know.

Maybe you are looking for

  • Goods Receipt / Goods Issue / Transfer Posting

    Hi Scenario: A pack contains 6 materials of same type but of 3 different colors viz Red:2; Yellow:2; White:2. I purchase this pack and sell the same pack. If sales of this pack is not not much, then i do a Goods Issue to a Cost Center. And then i wan

  • Update Problem on X3-02

    Model: X3-02 Version: 05.68 Yesterday I updated my phone. After update my applications, contacts, settings deleted.  Like first day I bought my phone. Than I saw my memory card asking for password. I never put password on my memory card. I need help.

  • I can't view all the app in appstore

    I'm a new iphone user, I'm using an Iphone5. The problem is when I go to appstore, go to feature and choose the category: Photo & Video. There are only well maybe 50 apps, but when I go to appstore on itunes there are alot more apps.  Can you tell me

  • Report for LSO

    Hi All, How to generate report which shows last event date of a course type? (except generate Course Date report and sort the date) Thanks! Vivian

  • Query Analyzer - issue in variables

    Hello, In query analyzer, I have a requirement for 3 keyfigures. 1 -> Current Month budget 2 -> Next Month budget 3 -> Cummulated Yr to Month budget for eg. I fI am in month 02.2006 column 1-> budget for 02.2006 column 2-> budget for 03.2006 column 3