Problem notifing objects.

One object do that:
boolean ack_recibido = peticion.enviarRequest(request,this);
          if (ack_recibido==true)
               try {
                    wait(timeout); 
                    System.out.println("timeout passed");
                    return reply;
               } catch (InterruptedException e) {
                    e.printStackTrace();
          return null;and another do that:
     public void devolverRespuesta(byte[] reply) {
               System.out.println("estamos en la clase peticiones");
               System.out.println(new String(reply));
               arrayComandosRecibidos[contadorComandos-1].setReply(reply);
               arrayComandosRecibidos[contadorComandos-1].notifyAll();
          }arrayComandosRecibidos[contadorComandos-1] is the objectt which is waiting, and setreply works, but it not wake up until timeour.
�How can I wake up the onject if notify does not work?
Thanks for the answer.

arrayComandosRecibidos[contadorComandos-1] is the objectt
which is waitingNote that it is not the object that is waiting, but the thread.
When calling wait on a given object (this in your case), the current thread waits until another thread calls notify(All) on this object (or until given timeout expires.)
So what threads are implied in your code ?
Are you sure that one thread calls wait, and then another thread calls notifyAll (before timeout expires) ?

Similar Messages

  • I'm having problems Sorting Objects

    Hello everyone!
    I'm having problems sorting objects. Here is what I got at moment... I'm trying using "Collections.sort" with objects, and I think my problem is there but I don't know how to do in other way the sorting.
    Some help will be appreciated! Thank you!
    Movie.java
    import java.util.ArrayList;
    public class Movie
             public int itemNum;
             private String title;
             public String director;
             public Movie()
                 itemNum = -1;
                 title = "";
                 director = "";
             public Movie(int itemNum, String title, String director)
                this.itemNum = itemNum;
                this.title = title;
                this.director = director;
             public int getItemNum()
                 return itemNum;
             public String getTitle()
                 return title;
             public String getDirector()
                 return director;
               public void setItemNum(int a)
                  itemNum = a;
             public void setTitle(String b)
                 title = b;
             public void setDirector(String c)
                 director = c;
             public String toString()
                   String MovieInfo = title + "\t" + itemNum + "\t" + director ;
                   return MovieInfo;
    }MovieCollection.java
    import java.util.*;
    public class MovieCollection
        private ArrayList Movies;
         public MovieCollection()
                Movies = new ArrayList();
         public ArrayList getMovies()
                return Movies;
         public void add(Movie aMovie)
                Movies.add(aMovie);
    }MovieCollectionMenu.java
    import java.io.*;
    import java.util.*;
    public class MovieCollectionMenu
              private MovieCollection model;
              public MovieCollectionMenu ()
                   model = new MovieCollection();
            public MovieCollection getModel()
                return model;
             private static Scanner Insert = new Scanner(System.in);
              public static void main (String[] args)
                  MovieCollectionMenu menu = new MovieCollectionMenu();
                   while(true)
                 System.out.println("Movies Menu");
                 System.out.println("");     
                 System.out.println("1 - Add Movie");
                 System.out.println("2 - List Movies");
                 System.out.println("3 - Sort Movies");
                 System.out.println("0 - Exit");
                    System.out.print("\nSelect your option: ");
                 int option = Insert.nextInt();
                      switch(option)
                           case 0:   System.exit(0);break;
                         case 1:   menu.addMovie(); break;
                         case 2:   menu.listMovies(); break;
                         case 3:   menu.sortMovie(); break;
                         default:  System.out.println("Invalid Selection!");
                      System.out.println("\n");
              private void addMovie()
                   Movie aMovie = new Movie();
                System.out.print("\nEnter movie name: ");
                   aMovie.setTitle(Insert.next());
                 System.out.print("Enter number of copies: ");
                aMovie.setItemNum(Insert.nextInt());
                System.out.print("Enter director name: ");
                aMovie.setDirector(Insert.next());
                model.add(aMovie);
            private void listMovies()
                   ArrayList Movies = model.getMovies();
                   for (int i=0; i<Movies.size(); i++)
                        System.out.println(Movies.get(i).toString());
              private void sortMovie()
                 ArrayList Movies = model.getMovies();
                 Collections.sort(Movies);
    }

    JBStonehenge, Melanie_Green, paulcw thank u so much for ur support!!!!
    I did many changes in my code, and I think in a simple way... I can sort the strings, but I'm having problems to sort the integers from the array I created..
    I read a lot of sorting and this was the best I could do, please can you change my code to sort the integers?
    Thank u people!
    Here it is my code:
    import java.io.*;
    import java.util.*;
    public class MyMovies {
         public static void main(String[] args) {
              MyMovies Movies = new MyMovies();
              Movies.runEverything();
         private static final int MAX_SIZE = 100;
         private static int numberOfMovies = 0;
         private static Movie[] array = new Movie[MAX_SIZE];
         public void runEverything(){
              Scanner input = new Scanner(System.in);
              while (true) {
                   Menu();
                   int option;
                   try {
                        option = Integer.parseInt(input.nextLine());
                   } catch (NumberFormatException e) {
                        System.out.println("You must enter a number!");
                        continue;
    switch (option) {
                   case 1:
                        addMovie(input);
                        System.out.println("\nThis movie was added:");
                        printMovie(numberOfMovies - 1);
                        break;               
                   case 2:
                        sortMoviesByTitle();
                        break;
                   case 3:
                        sortMoviesByYear();
                        break;
                   case 4:
                        sortMoviesByDirector();
                        break;
                   case 5:
                        printAllMovies();
                        break;
                   case 6:
                        System.out.println("You logout with success!");
                        input.close();
                        System.exit(0);
                        break;
              default:
                        System.out.println("You entered a wrong option! Please try again.");
                        break;
         private static void Menu() {
              System.out.println("\n1 - Add a movie");
              System.out.println("2 - Sort movies by name");
              System.out.println("3 - Sort movies by year");
              System.out.println("4 - Sort movies by director");
              System.out.println("5 - Display movies");
              System.out.println("6 - Quit");
              System.out.print("\nPlease enter an option:");
              private static void printMovie(int i) {
              if (i < numberOfMovies) {
                   System.out.println("\"" + array.getTitle() + "\", " + array[i].getYear() + ", \"" + array[i].getDirector() + "\"");
         private void printAllMovies() {
              for (int i = 0; i < numberOfMovies; i++) {
                   System.out.print(String.valueOf(i+1) + "-");
                   printMovie(i);
         private static void addMovie(Scanner input) {
              System.out.print("Enter movie:");
              String title = input.nextLine();
              int year = 0;
              while (true) {
                   try {
                        System.out.print("Enter the year of movie:");
                        year = Integer.parseInt(input.nextLine());
                        break;
                   } catch (NumberFormatException e) {
                        System.out.println("You must enter an integer!");
                        continue;
              System.out.print("Please enter the director:");
              String director = input.nextLine();
              array[numberOfMovies] = new Movie(title, year, director);
              numberOfMovies++;
         private void sortMoviesByTitle(){
         boolean swapped = true;
              int i = 0;
              String tempTitle, tempDirector;
              int tempYear;
              while (swapped) {
                   swapped = false;
                   i++;
                   for (int j = 0; j < numberOfMovies - i; j++) {
                        if ( array[j].getTitle().compareToIgnoreCase(array[j + 1].getTitle()) > 0) {   
                             tempTitle = array[j].getTitle();
                             tempYear = array[j].getYear();
                             tempDirector = array[j].getDirector();
                             array[j].setTitle(array[j + 1].getTitle());
                             array[j].setYear(array[j + 1].getYear());
                             array[j].setDirector(array[j + 1].getDirector());
                             array[j + 1].setTitle(tempTitle);
                             array[j + 1].setYear(tempYear);
                             array[j + 1].setDirector(tempDirector);
                             swapped = true;
              System.out.println("The movies are sorted by title.");
         private void sortMoviesByYear(){
         boolean swapped = true;
              int i = 0;
              String tempTitle, tempDirector;
              int tempYear;
              while (swapped) {
                   swapped = false;
                   i++;
                   for (int j = 0; j < numberOfMovies - i; j++) {
                        if ( array[j].getYear().compareToIgnoreCase(array[j + 1].getYear()) > 0) {   
                             tempTitle = array[j].getTitle();
                             tempYear = array[j].getYear();
                             tempDirector = array[j].getDirector();
                             array[j].setTitle(array[j + 1].getTitle());
                             array[j].setYear(array[j + 1].getYear());
                             array[j].setDirector(array[j + 1].getDirector());
                             array[j + 1].setTitle(tempTitle);
                             array[j + 1].setYear(tempYear);
                             array[j + 1].setDirector(tempDirector);
                             swapped = true;
              System.out.println("The movies are sorted by year.");
         private void sortMoviesByDirector(){
         boolean swapped = true;
              int i = 0;
              String tempTitle, tempDirector;
              int tempYear;
              while (swapped) {
                   swapped = false;
                   i++;
                   for (int j = 0; j < numberOfMovies - i; j++) {
                        if ( array[j].getDirector().compareToIgnoreCase(array[j + 1].getDirector()) > 0) {   
                             tempTitle = array[j].getTitle();
                             tempYear = array[j].getYear();
                             tempDirector = array[j].getDirector();
                             array[j].setTitle(array[j + 1].getTitle());
                             array[j].setYear(array[j + 1].getYear());
                             array[j].setDirector(array[j + 1].getDirector());
                             array[j + 1].setTitle(tempTitle);
                             array[j + 1].setYear(tempYear);
                             array[j + 1].setDirector(tempDirector);
                             swapped = true;
              System.out.println("The movies are sorted by director.");
    /* ----- My Movie Class ----- */
    class Movie {
         private String title;
         private int year;
         private String director;
         public Movie(String title, int year, String director) {
              setTitle(title);
              setYear(year);
              setDirector(director);
         public String getTitle() {
              return title;
         public void setTitle(String title) {
              this.title = title;
         public int getYear() {
              return year;
         public void setYear(int year) {
              this.year = year;
         public String getDirector() {
              return director;
         public void setDirector(String director) {
              this.director = director;
    }Edited by: AntiSignIn on Mar 24, 2010 7:30 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Notification objects entry problem

    Dear all,
    my client needs to enter multiple functional locations and equipment to the pm notification. is it possible and in which tab? i know similar tab in order but can not find in notification...
    thanks

    Dear John,
    Multiple functional Locations and Equipments in a single notification is not possible in standard SAP. Only it can be possible Z transactions.
    Also there is no use of multiple selections in single notification. It will not serve u the proper requirements and tracking/Analysis.
    For information purpose you can use the user entry fields / Long text to mention the different locations and equipements or you can select the higher level hierarchy in functional location.
    In item tab you can select different assemblys and you can use short text field. From this you can develope a Z reports to track the multiple items in single notification. in case this is a regular business process. but not a standard best practice. Better inform user to avoid such type of process and mentor them to follow best practices in business.
    Hope you understd. If you feel satisfaction with this. pl close this thread.
    Regards,
    Guna

  • S/A bridge problem: No object type found for the message

    Hi all,
    I've been spending days looking into the following problem. I have a RFCXIFile scenario. The R3 system sends data via an RFC to XI and XI post the data as a flat file on a certain server using FTP.
    This scenario worked just fine for 1 exception. I could only run this scenario once. The second time I got timeouts when checking the data sent to my RFC destination using SM58. When I reactivated my RFC communcation channel I could again send 1 RFC to the system. All subsequent tries would fail.
    I guess this is due to the fact that I use a synchonous call (RFC) to an asynchronous one. Thus the adapter is still waiting for the response from the XI system and will not accept any further new calls from R3.
    So I figure let's use this pattern called the S/A bridge. So I designed everything according to guides and examples and I'm quite certain everything is configured right but when I run the scenario I get the following message:
    <i> <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIAdapter</SAP:Category>
      <SAP:Code area="BPE_ADAPTER">UNKNOWN_MESSAGE</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>No object type found for the message. Check that the corresponding process is activated</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error></i>
    It seems that the adapter cannot find any integration process to send the message into!?
    I've looked at numerous threads on sdn and tried all kinds of stuff (looked at the cache==> code 0 = OK , tried to reactivate my integration process, checked the interface determination,...), but to no avail. Does anybody has an idea what could be wrong ?
    Any help would be greatly appreciated for I'm all out of clues....
    Bob

    First of all, Thank you for trying to help me out here.
    Some answer to your suggestions/questions:
    The IP has return code 0 in SXI_CACHE. so that doesn't seem to be the problem.
    I've checked the BPM for syntax errors. I doesn't have any.
    I've reimported the BPM into the integration directory.
    And did a full cache refresh in SXI_CACHE. Return code is (stays) zero, so that's OK.
    I've already included the error message from SXI_MONI. It is in the last step ("Call Adater") that the error occurs.
    The other steps execute just fine...
    The RFC communcation channel accepts the incoming RFC call and puts into the pipeline, so no problems with the communication channel either. the problem is actually when the pipeline is trying to forward the message into an IP trhough the BPE_ADAPTER (according to SXMB_MONI).
    Therefore I'm not able to go to into PE, because the workflow is never started. the BPE_ADAPTER does not find any active process for the interface determination i've entered.
    So i can not debug the IP in the PE and check container variables, like some of you mentioned.
    Maybe some more information about the scenario:
    The RFC is called from an R3 system to XI over the interface "CONTROL_RECIPE_DOWNLOAD", which is an imported RFC, with a request and response message type.
    Then I got a receiver and interface determination with lead the incoming RFC message to the IP, into interface "XI_ERP_MF_MD_CONTROL_RECIPE_REQ_AI_MI".
    This is an abstract synchronous interface based on the request and response types of the "CONTROL_RECIPE_DOWNLOAD" imported RFC.
    This interface is used the first step (receive) of my BPM as the synchronous interface to open the S/A bridge.
    The message (container var)  used in this step is
    name: CORREQ
    Category: Abstract interface
    type: "XI_ERP_MF_MD_CONTROL_RECIPE_REQ_AI_MI"
    The interface "XI_ERP_MF_MD_CONTROL_RECIPE_REQ_AI_MI" is an abstract, asynchronous interface based on the request type of the "CONTROL_RECIPE_DOWNLOAD".
    Then there are 2 send steps for putting the flat files into place and finally i close the the S/A bridge using message:
    name: CORRES
    Category: Abstract interface
    type: "XI_ERP_MF_MD_CONTROL_RECIPE_RES_AI_MI"
    The interface "XI_ERP_MF_MD_CONTROL_RECIPE_RES_AI_MI" is an abstract, asynchronous interface based on the response type of the "CONTROL_RECIPE_DOWNLOAD".
    I hope this information gives you guys a better understanding of hte problem.
    Really looking forward to see more suggestions and to solve this nasty problem ...
    Regards,
    Bob

  • Problem removing Objects from the stage in Flash CS4 (AS3.0)

    I have a problem with this code:
    this.addEventListener(Event.ENTER_FRAME, vanish);
    function vanish(event:Event):void{
         if(character_mc.hitTestObject(vanish_mc)){
              vanish_mc.parent.removeChild(vanish_mc);
    There are two overlapping objects on my stage: character_mc and vanish_mc.
    As soon as i start the scene[Ctrl+Enter] vanish_mc is VISUALLY removed. But the code still sees a collision somehow. How can i Entirely remove the object vanish_mc?
    Thank you for help and advice.

    Ah I think the problem is what my problem not which I proposed, my bad I was trying to keep it simple.
    the remove code in my problem actually looks like this:
    if(character_mc.hitTestObject(this["dollar_mc_"+String(i)])){
         removeChild(this["dollar_mc_"+String(i)]);
    I wanted it to be that way so I could add infinite "dollar_mc_" ' s without writing myself to death with code and or getting confused.
    Imagine it like a game where a character it picking up dollars, which would disappear once they intersect.
    And that exactly is what gives me that argument.
    Do you know a way i could write this code, or do you suggest to leave it that way...because it does run and work im just getting this argument while debugging.
    Thank you for all the help~

  • Problem with Object removal...

    Greetings,
    In a game I'm working on, I have two levels so far. Level0 is the menu, Level1 is the first game level. I wrote a custom class that calls lots of other custom classes to manage all the MovieClips (and their children, and operate on global variables) on Level 1:
    var level1:Level1 = new Level1(player,bkg1,wayback1,waywayback1,player.frontLeg,player.backLeg,player.barrel);
    Getting into Level1 works fine and with a SHIFT-M you can remove all the Level1 MovieClips from the display list and get back to the menu.
    The problem is that when I go back to Level1 from the menu after having been on Level1 once already, it is clear from the way the MovieClips are behaving that they are now being acted on by a second 'level1' object. If I go back a third time, the MovieClips are acted on by a third 'level1' object, etc.
    I've been reading threads, and then seem to be saying that I need to remove all references to this object and then it will be garbage collected.  I'm removing all the MovieClips the 'Level1' class operates on, what else do I need to do to get rid of it?
    Thanks,
    Jeremy

    HI,
    i've set up a mail domain "domain.com.pl" and then
    using delgated admin web acces i've removed that
    domain. The problem is that i'm not able to recreate
    it back. I still have got the message: "Entry or
    value already exists"
    Any clue?
    delegated admin just marks the domain as deleted
    you need to run the imadmin domain purge command to
    actually delete the domain info from the directory
    for more, see:
    http://docs.sun.com/source/816-6020-10/da_cmds.htm#14694
    Peter
    Ps: situation is the same when you delete a user, imadmin user purge should be run to actually remove the user from the directory

  • Problem with object view with primary-key based object identifier

    Hello!
    I met such problem.
    t1 is persinstent-capable class:
    class t1 : public PObject { .... };
    T1OV is object view, based on object table T1OT
    I1 is primary key of the table T1OT.
    Next code:
    t1* t = new (conn, "T1OV") t1(...);
    conn->commit();
    try
    t->markDelete();
    conn->commit(); // exception throws here
    Works fine if T1OV defined as:
    create view t1ov of t1 with object identifier default
    as select * from t1ot;
    And throws an exception
    "ORA-22883: object deletion failed"
    if:
    create view t1ov of t1 with object identifier (I1)
    as select * from t1ot;
    Such problem also occurs when object view is based on relational table/view (OID is primary-key based).
    Also it occurs when
    t->markModified() used insted of t->markDelete()
    I am using Oracle 9i second release for windows and
    MS VC++
    Thank You

    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_85a.htm#2065512
    You can specify constraints on views and object views. You define the constraint at the view level using the out_of_line_constraint clause. You define the constraint as part of column or attribute specification using the inline_constraint clause after the appropriate alias.
    Oracle does not enforce view constraints. However, operations on views are subject to the integrity constraints defined on the underlying base tables. This means that you can enforce constraints on views through constraints on base tables.
    Restrictions on View Constraints
    View constraints are a subset of table constraints and are subject to the following restrictions:
    You can specify only unique, primary key, and foreign key constraints on views. However, you can define the view using the WITH CHECK OPTION clause, which is equivalent to specifying a check constraint for the view.
    Because view constraints are not enforced directly, you cannot specify INITIALLY DEFERRED or DEFERRABLE.
    View constraints are supported only in DISABLE NOVALIDATE mode. You must specify the keywords DISABLE NOVALIDATE when you declare the view constraint, and you cannot specify any other mode.
    You cannot specify the using_index_clause, the exceptions_clause clause, or the ON DELETE clause of the references_clause.
    You cannot define view constraints on attributes of an object column.
    Rgds.

  • Problem with object state...

    Hi guys
    So I have this grid with 25 pictures.
    And I would like to use each of these pictures as a button. This button will trigger a frame with text in the center of the grid, like so :
    The X close the text frame and the user go back to the grid.
    But, I have 2 problems. I can mak a object state of the text frame and the button triggers one state (open/close for exemple) and it work. But if I click on the second square without closing the first text frame, the text frame linked to the first square is still there, underneath...
    Is there a way to 1 : a click triggers the texte square link to it AND close all the other
    Or is there an easier way to do it without object state?
    Thanks

    You have the grid of pics as your background. Then buld a state for each photo/description.
    If you have have 16 pictures  you'd build 16 different states for them. Combine them all into one MSO.
    You'll need to put the buttons into each state to make it work and you'll need one state with only the buttons with no fill or stroke over the background grid.
    You'll need to experiment to decide if you want the buttons to be live for all of the images in each state. It's lots of buttons and there's no automated way to do it, but it works well and avoids the problem that you're having now.
    Bob

  • Problem with Object returning previously set values, not current vlaues

    Please help if you can. I can send the full code directly to people if they wish.
    My problem is I enter title details for a book via an AWT GUI. When the user clicks the OK button it should display a new screen with the values just entered by the user. I added debug lines and found that the newInstance method has the values I set and the setObject created an object that was not null.
    However the first time you submit the details when it tries to get the object to display them back to the user it is null. However when you try and enter the details for a second time it will display the details entered on your first entry. Likewise if you went to enter a third title and put blank details in it would display the second set of details back to the user when they click OK.
    I'm very confused as to how it when I fetch an object I've just set it is out of step and points to previous values or null when used for the first time.
    Right onto the code.
    ----Shop.class - contains
    public static Object
    getObject()
    if ( save_ == null)
    System.out.println("Return save_ but it is null");
    return save_;
    public static void
    setObject( Object save )
    save_ = save;
    if ( save == null)
    System.out.println("Just taken save but it is null");
    if ( save_ == null)
    System.out.println("Just set save_ but it is null");
    ----AddTitlePanel.class contains
    private void okButtonActionPerformed(ActionEvent evt)
    ConfirmAddTitlePanel confirmAddTitlePanel =
    new ConfirmAddTitlePanel();
    // Gets the textField values here
    model.Title mss = model.Title.newInstance( fullISBN,
    ISBN,
    title,
    author,
    copiesInStock,
    price );
    model.Shop.setObject( mss );
    // Fetch reference to Graphical so buttons can use it to
    // display panels
    graph = model.Shop.getGraphical();
    graph.display( confirmAddTitlePanel );
    This creates a newInstance of Title and creates a copy using setObject when the user clicks on "OK" button. It also calls the ConfirmAddTitlePanel.class to display the details back to the user.
    ----ConfirmAddTitlePanel.class contains:
    private void
    setValues() throws NullPointerException
    model.Title mss = (model.Title) model.Shop.getObject();
    if ( mss != null )
    model.Field[] titleDetails = mss.getFullDetails();
    //model.Field[] titleDetails = model.Title.getFullDetails();
    fullISBNTextField.setText( titleDetails[0].asString() );
    //ISBNTextField.setText( titleDetails[1].asString() );
    titleTextField.setText( titleDetails[2].asString() );
    authorTextField.setText( titleDetails[3].asString() );
    copiesInStockTextField.setText( titleDetails[4].asString() );
    priceTextField.setText( titleDetails[5].asString() );
    else
    System.out.println( "\nMSS = null" );
    This is getting the Object back that we just set and fetching its details to display to the user by populating the TextFields.
    As I say first time you enter the details and click OK it displays the above panel and outputs "MSS = null" and cannot populate the fields. When you enter the next set of title details and click "OK" getObject is no longer setting mss to null but the values fetched to set the TextFields is the data entered for the first title and not the details just entered.
    ----Title.class contains:
    public static Title
    newInstance( String fullISBN,
    String ISBN,
    String title,
    String author,
    int copiesInStock,
    int price )
    Title atitle = new Title( fullISBN,
    ISBN,
    title,
    author,
    copiesInStock,
    price );
    System.out.println("Created new object instance Title\n");
    System.out.println( "FullISBN = " + getFullISBN() );
    System.out.println( "ISBN = " + getISBN() );
    System.out.println( "Title = " + getTitle() );
    System.out.println( "Author = " + getAuthor() );
    System.out.println( "Copies = " + getCopiesInStock() );
    System.out.println( "Price = " + getPrice() );
    return atitle;
    I'm really stuck and if I solve this I should hopefully be able to make progress again. I've spent a day and a half on it and I really need some help. Thanks in advance.
    Mark.

    Hi Mark:
    Have a look of the method okButtonActionPerformed:
            private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
             // if you create the confirmAddTitlePanel here, the value of
             // Shop.save_ is null at this moment (first time), becaouse you
             // call the methode setValues() in the constructor, bevore you've
             // called the method Shop.setObject(..), which has to initialize
             // the variable Shop.save_!!!
             // I think, you have to create confirmAddTitlePanel after call of
             // method Shop.setObject(...)!
             // ConfirmAddTitlePanel confirmAddTitlePanel = new ConfirmAddTitlePanel();
            ConfirmAddTitlePanel confirmAddTitlePanel = null;
            String fullISBN            = fullISBNTextField.getText();
            String ISBN                = "Test String";
            String title               = titleTextField.getText();
            String author              = authorTextField.getText();
            String copiesInStockString = copiesInStockTextField.getText();
            String priceString         = priceTextField.getText();
            int copiesInStock          = 0;
            int price                  = 0;
            try
                copiesInStock = Integer.parseInt( copiesInStockString );
            catch ( NumberFormatException e )
                // replace with error output, place in status bar or pop-up dialog
                // move focus to copies field
            try
               price = Integer.parseInt( priceString );
            catch ( NumberFormatException e )
                // replace with error output, place in status bar or pop-up dialog
                // move focus to price field
            model.Title mss = model.Title.newInstance( fullISBN,
                                     ISBN,
                                     title,
                                     author,
                                     copiesInStock,
                                     price );
            model.Shop.setObject( mss );
            // ---------- now, the Shop.save_ has the value != null ----------        
            confirmAddTitlePanel = new ConfirmAddTitlePanel();     
            // Fetch reference to Graphical so buttons can use it to
            // display panels
            graph = model.Shop.getGraphical();
            graph.display( confirmAddTitlePanel );
        }//GEN-LAST:event_okButtonActionPerformedI hope, I have understund your program-logic corectly and it will help you.
    Best Regards.

  • [SOLVED] Problem copying objects in Inkscape 0.48.0-4

    I have problems when I copy any object when using inkscape. Even after removing the config directories and using a completely blank document.
    I create a simple rect and press ctr+c (or use the context menu) and this error comes up:
    El script inkex.py y, por lo tanto, esta extensión necesitan la envoltura lxml («lxml wrapper») para libxml2. Descargue
    e instale la última versión de http://cheeseshop.python.org/pypi/lxml/ o mediante su gestor de paquetes con un
    comando similar a este: sudo apt-get install python-lxml
    It says "inkex.py", which comes with the package, needs python-lxml. So I install the package, close inkscape, remove the configuration directories and try again.
    Now it throws this error message:
    No matching node for expression: /svg:svg/@sodipodi:docname
    Traceback (most recent call last):
    File "gimp_xcf.py", line 185, in <module>
    e.affect()
    File "/usr/share/inkscape/extensions/inkex.py", line 215, in affect
    self.effect()
    File "gimp_xcf.py", line 43, in effect
    docname = self.xpathSingle('/svg:svg/@sodipodi:docname')[:-4]
    TypeError: 'NoneType' object is not subscriptable
    The script "gimp_xcf.py" also comes with the package. No clue why it is calling it since I'm only trying to copy (not even paste) from a clean svg document.
    I click accept and this error message comes up asking me to install uniconvertor:
    You need to install the UniConvertor software.
    For GNU/Linux: install the package python-uniconvertor.
    For Windows: download it from
    http://sk1project.org/modules.php?name=Products&product=uniconvertor
    and install into your Inkscape's Python location
    I install uniconvertor, delete the configuration directories and try again. The previous "gimp_xcf.py" error message comes up, I click accept again only to get another error dialog:
    No layers found
    I click accept again and now I can paste the object. But the "gimp_xcf.py" and "No layers found" dialogs keep coming up in a loop which can only be stopped by killing inkscape.
    I doubt very much this is a upstream issue since I couldn't find it in inkscape's bug tracker (such obvious bug would have been reported already) I also cannot find any report in arch's bug tracker. So I'm unsure if I should report this, anyone else has this problem? All related packages are up to date.
    Last edited by dresb (2011-02-07 16:21:08)

    I found I was having this problem running xfce4.8
    There seems to be some talk about it here https://bugs.launchpad.net/inkscape/+bug/418242
    It seems that clipboard managers may be causing the problem. I wasn't running xfce4-clipman but I found that killing xfce4-settings-helper fixed the problem for me.
    Hope this helps.

  • Problem with objective-c troubleShooting

    Hi there,
    i'm all new to mac & iOS developement and am getting startet by working throught what appeared to be a great book "Einstieg in Objective-C 2.0 and Cocoa inkl iPhone programming".
    what im doing right now is creating an Weblog App for the iPhone by following stepBy step coding and interface instructions by this book.
    problem: everything seems to work just fine, i can compile and everything. but one funktion does not work which is creating a new article.
    the errorcode looks like that:
    +2011-01-25 14:59:28.775 WeblogClientTouch[12682:207] Fehler beim Anlegen eines neuen Artikels+
    and is produced by an NSLog:
    if (![managedObjectContext save:&error]) {
    NSLog(@"Fehler beim Anlegen eines neuen Artikels");
    so apparently the saving of a new entity 'article' does not work. here some code snippets that might help, first the function that creates a new article in which the error occurs:
    - (IBAction)neuerArtikel
    //erzeuge artikel
    NSEntityDescription *artikelDescription = [[fetchedResultsController fetchRequest]entity];
    NSManagedObject *newArtikel = [NSEntityDescription insertNewObjectForEntityForName:[artikelDescription name]
    inManagedObjectContext:managedObjectContext];
    //befülle artikel mit standardwerten
    [newArtikel setValue:NSLocalizedString(@"Neuer Artikel", nil)
    forKey:@"titel"];
    [newArtikel setValue:[NSDate date] forKey:@"datum"];
    [newArtikel setValue:@"Markus" forKey:@"autor"];
    //speichere artikel
    NSError *error;
    if (![managedObjectContext save:&error]) {
    NSLog(@"Fehler beim Anlegen eines neuen Artikels");
    //Tableview aktualisieren
    [self.tableView reloadData];
    in my datamodel i have only one entity named "Artikel" with the attributes: autor, titel, datum, inhalt.
    i would be very glad about some tips, because i've been trying to solve the problem for nearly 3 hours now and i dont think it can be that tricky..
    Message was edited by: sfluecki
    Message was edited by: sfluecki

    allRight.
    i got it working so far that there's no more errors.
    --> i can now klick on 'new article' without any errors, but my tableView does not show the new allocated articles
    --> after i restart the app (rebuild, reRun in simulator) the previously added articles are showing in the tableView.
    --> somehow my tableView does just update itself whilst starting the app.
    in the end of the 'addNewArticle' function i have the following:
    [self.tableView reloadData];
    the tableView itself is defined by the following:
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    NSArray *sections = [fetchedResultsController sections];
    NSUInteger count = 0;
    if ([sections count]) {
    id <NSFetchedResultsSectionInfo> sectionInfo = [sections objectAtIndex:section];
    count = [sectionInfo numberOfObjects];
    return count;
    and
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    static NSString *CellIdentifier = @"Cell";
    //Zelle aus dem Cache holen oder erzeugen wenn nicht orhanden
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle
    reuseIdentifier:CellIdentifier] autorelease];
    NSManagedObject *artikel = [fetchedResultsController objectAtIndexPath:indexPath];
    //Titel als haupttext der zelle
    cell.textLabel.text= [artikel valueForKey:@"titel"];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    //Autor und Name als Detailtext der Zelle
    NSDateFormatter *dateFormatter = [NSDateFormatter new];
    [dateFormatter setDateStyle:NSDateFormatterMediumStyle];
    NSString *dateString = [dateFormatter stringFromDate:[artikel valueForKey:@"datum"]];
    cell.detailTextLabel.text = [NSString stringWithFormat:NSLocalizedString(@"%@ am %@",nil), [artikel valueForKey:@"autor"], dateString];
    [dateFormatter release];
    return cell;
    whilst the function fetchedResultsController looks like this.
    - (NSFetchedResultsController *)fetchedResultsController
    if (fetchedResultsController != nil)
    return fetchedResultsController;
    //FetchRequest initialisieren
    NSFetchRequest *fetchedRequest = [NSFetchRequest new];
    NSEntityDescription *artikelDescription = [NSEntityDescription entityForName:@"Artikel"
    inManagedObjectContext:managedObjectContext];
    [fetchedRequest setEntity:artikelDescription];
    NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc]initWithKey:@"datum" ascending:NO];
    NSArray *sortDescriptors = [[NSArray alloc]initWithObjects:sortDescriptor, nil];
    [fetchedRequest setSortDescriptors:sortDescriptors];
    //FetchedResultsController initialisieren
    fetchedResultsController = [[NSFetchedResultsController alloc]initWithFetchRequest:fetchedRequest
    managedObjectContext:managedObjectContext
    sectionNameKeyPath:nil
    cacheName:@"Overview" ];
    fetchedResultsController.delegate = self;
    //aufräumen
    [fetchedRequest release];
    [sortDescriptor release];
    [sortDescriptors release];
    return fetchedResultsController;
    i'm sorry to bother you with that lot of code.. but i'm stuck here since now 8h,
    and wouldnt probably be any step further without your help in the first place,
    so thanks a lot for the first inputs =)

  • Performance problem using OBJECT tag

    I have a performance problem using the java plugin and was wondering if anyone else was has seen the same thing. I have a rather complex applet that interacts with java script in a web page using the LiveConnect API. The applet both calls javascript in the page and is called by java script.
    Im using IE6 with the java plugin that ships with the 1.4.2_06 JVM. I have noticed that if I deploy the applet using the OBJECT tags, the application seems the trash everytime I call a java method on the applet from javascript. When I deplot the same applet using the APPLET tag the perfomance is much better. I would like to use the OBJECT tag because it applet bahaves better and I have more control over the caching.
    This problem seems to be on the boundaries of IE6, JScript, the JVM and my Applet (and I suppose any could be the real culprit). My application is IE5+ specific so I can not test the applet in isolation from the surround HTML/JavaScript (for example in another browser).
    Does anyone have any idea?
    thanks in advance.
    dennis.

    I have a performance problem using the java plugin and was wondering if anyone else was has seen the same thing. I have a rather complex applet that interacts with java script in a web page using the LiveConnect API. The applet both calls javascript in the page and is called by java script.
    Im using IE6 with the java plugin that ships with the 1.4.2_06 JVM. I have noticed that if I deploy the applet using the OBJECT tags, the application seems the trash everytime I call a java method on the applet from javascript. When I deplot the same applet using the APPLET tag the perfomance is much better. I would like to use the OBJECT tag because it applet bahaves better and I have more control over the caching.
    This problem seems to be on the boundaries of IE6, JScript, the JVM and my Applet (and I suppose any could be the real culprit). My application is IE5+ specific so I can not test the applet in isolation from the surround HTML/JavaScript (for example in another browser).
    Does anyone have any idea?
    thanks in advance.
    dennis.

  • Image scaling problem with object handles

    Hi,
    I am facing scaling problem.I am using custom actionscript component called editImage.EditImage consists imageHolder a flexsprite which holds
    image.Edit Image component is uing object handles to resize the image.I am applying mask to the base image which is loaded into imageholder.
    My requirement is when I scale the editImage only the mask image should be scaled not the base image.To achieve this I am using Invert matix .With this
    the base image is not scaled but it  is zoomed to its original size.But the base image should not zoomed and it should fit to the imageholder size always. When I scale the editImage only the mask image should scale.How to solve this.Please help .
    With thanks,
    Srinivas

    Hi Viki,
    I am scaling the mask image which is attached to imageHolder.When i  scale
    the image both the images are scaled.
    If u have time to find the below link:
    http://fainducomponents.s3.amazonaws.com/EditImageExample03.html
    u work with this component by masking the editImage.If u find any solution
    for scale only mask ,plz share the same.
    thanks,
    Srinivas

  • ExternalInterface.call problem with object-orientation

    Hi
    I am using an swf inside a PDF. In a PDF-context the ExternalInterface-class works much the same as it does within a website. So far calling a function in the document-script works.
    The thing now is, that I really try to use an object-oriented approach as often as I can. In this case I have a function I could call using
    var jsCaller:Object = ExternalInterface.call("myFunction",parameters);
    This works as expected.
    However, I have now made that function a method in an object, so I can access it within JS using dot-notation: myCoolObject.myFunction(); This works as well, so the problem is not the function itself. However, the call
    var jsCaller:Object = ExternalInterface.call("myCoolObject.myFunction",parameters);
    does not work.
    This means there's either something I'm missing, or it's a limitation of ExternalInterface, or it's a limitation of externalInterface in a pdf-context.
    Anyone to enlighten me?

    If EI calls eval it should be able to resolve the object-path. However, this doesn't seem to be the case. Also note that my parameter is an array, so this probably wouldn't work, even if the syntax did.
    Anyway, I tested your syntax in my PDF, and it showed the same behaviour as before (i.e. the function in which the EI-call was placed could not be executed, and acrobat claimed there was no such function). It didn't work with my normal function, and not even with a simple console.println-statement that way. So in PDFs it definitely doesn't work like that.
    But thanks for the suggestion!

  • JPA and JSF - Problem persisting object

    Hi all.
    I'm having some trouble with JPA, persisting an object to a MySQL table.
    Let's say I have a simple bean, Message:
    package my.package
    import java.io.Serializable;
    import javax.persistence.Id;
    import javax.persistence.Entity;
    import javax.persistence.Column;
    import javax.persistence.Table;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    @Entity
    @Table(name="messages")
    public class Message implements Serializable {
         @Id
         @GeneratedValue(strategy=GenerationType.AUTO)
         private int id;
         @Column(name="message_text")
         private String message;
         @Column(name="message_author")
         private String author;
         public String getMessage() {
              return this.message;
         public void setMessage(String message) {
              this.message = message;
         public String getAuthor() {
              return this.author;
         public void setAuthor(String author) {
              this.author = author;
    }And a controller for this Message bean:
    package my.package;
    import javax.annotation.Resource;
    import javax.persistence.Query;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.PersistenceUnit;
    import javax.transaction.UserTransaction;
    public class MessageController {
         @PersistenceUnit(unitName="em1")
         private EntityManagerFactory emf;
         @Resource
         private UserTransaction utx;
         private Message message;
         public Message getMessage() {
              return this.message;
         public void setMessage(Message message) {
              this.message = message;
         public String save() {
              EntityManager em = null;
              String returnValue = "";
              try {
                   em = this.emf.createEntityManager();
                   utx.begin();
                   em.persist(this.message);
                   utx.commit();
                   returnValue = "success";
              } catch(Exception e) {
                   e.printStackTrace();
                   returnValue = "failure";
              return returnValue;
    }Relevant code from the faces-config.xml:
    <managed-bean>
         <managed-bean-name>MessageController</managed-bean-name>
         <managed-bean-class>my.package.MessageController</managed-bean-class>
         <managed-bean-scope>request</managed-bean-scope>
         <managed-property>
              <property-name>message</property-name>
              <property-class>my.package.Message</property-class>
              <value>#{Message}</value>
         </managed-property>
    </managed-bean>
    <managed-bean>
         <managed-bean-name>Message</managed-bean-name>
         <managed-bean-class>my.package.Message</managed-bean-class>
         <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>This is my simple persistence.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0"
         xmlns="http://java.sun.com/xml/ns/persistence"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
        <persistence-unit name ="em1">
             <jta-data-source>jdbc/__glfish</jta-data-source>
        </persistence-unit>
    </persistence>The __glfish resource is all set up via Glassfish to point to my MySQL server, via a MySQLPool.
    Can anyone see what I'm doing wrong? The Message doesn't get added to the table in my database, and I get a NullPointerException in the method MessageController.save() on the property MessageController.message - which I have specified in the faces-config.xml. Shouldn't that be enough? What have I missed?

    Ok, I have (re-)located the problem. It's not my Message property which gets a NullPointerException - it seems like the problem is with my EntityManagerFactory instance. The PersistenceUnit don't get assigned, even though I declare it in my persistence.xml file.
    Maybe it is something wrong with my file structure?
    The .war file have this structure:
    - WEB-INF
         - classes
              - my
                   - package
                        Message.class
                        MessageController.class
         - lib
              [external jars goes here]
              - META-INF
                   persistence.xml
         faces-config.xml
         web.xml
    [*.jsp/*.xhtml goes here]Can anyone see what's wrong?

Maybe you are looking for