Persistence problems

Hello. I have made myself a web app using Java Server Faces which I am running on Glass Fish V2.
The problem that I am having is that while the program complies and runs without throwing any exceptions. My entities are not beeing saved to the database when I call the persist() method on them. The primary key of the entity objects (which is set to auto generate) is updated after the call to persist(), and the sequence database table is also updated. But no data is entered in to the database table for the entity object.
My app reads data from the database that I have inserted via SQL commands by running Queries made in the Java persistencve query lanuage and returns entity objects as you would expect.
Here is the entity object I am trying to save.
@Entity
@NamedQueries({
@NamedQuery(name="getTimeSheetsBetween",
            query="Select ts From TimeSheet ts Where ts.startDate >= :startDate AND ts.endDate <= :endDate"),
@NamedQuery(name="getTimeSheetsFor",
            query="Select ts From TimeSheet ts Where ts.timeSheetUser = :user")})
public class TimeSheet implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    @ManyToOne
    private TimeSheetUser timeSheetUser;
    @Temporal(TemporalType.DATE)
    private Date startDate;
    @Temporal(TemporalType.DATE)
    private Date endDate;
    private boolean signedOff;
    @OneToMany(cascade=CascadeType.ALL)
    private List<TimeSheetDay> timeSheetDays;
    public TimeSheet(){
    public TimeSheet(TimeSheetUser pUser, Calendar pStartDate, Calendar pSettingsStartDate, int pLength){
        Calendar testEndDate = (GregorianCalendar) pSettingsStartDate.clone();//modifications to objects passed as method parameters are not reverted after the method is finished
        Calendar testStartDate = (GregorianCalendar) pSettingsStartDate.clone();//so we create new date values to change which will not effect the pSettingsStartDate object
        testEndDate.add(Calendar.DAY_OF_MONTH, pLength);
        while(!(pStartDate.after(testStartDate) && pStartDate.before(testEndDate))){
            testStartDate.add(Calendar.DAY_OF_MONTH, pLength);
            testEndDate.add(Calendar.DAY_OF_MONTH, pLength);
        }//not sure if this is the best way to work this out. Refacter later
        startDate = testStartDate.getTime();
        endDate = testEndDate.getTime();
        signedOff = false;
        timeSheetUser = pUser;
        timeSheetDays = new ArrayList(pLength);
        for(int counter = 1; counter <= pLength; counter++){
            TimeSheetDay day = new TimeSheetDay(testStartDate.getTime());
            timeSheetDays.add(day);
            testStartDate.add(Calendar.DATE, 1);
    Here is the method that saves data
package timesheet2;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.persistence.EntityExistsException;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.PersistenceUnit;
import javax.persistence.TransactionRequiredException;
import timesheet2.entities.PayPeriodSettings;
import timesheet2.entities.TimeSheet;
import timesheet2.entities.TimeSheetUser;
import timesheet2.exceptions.*;
public class DataBaseAccess implements Serializable{
    private static final Logger logger = Logger.getLogger("timeSheet.DataBaseAccess");
    private List<PayPeriodSettings> periodSettings;
    private TimeSheetUser currentUser;
    @PersistenceUnit
    private EntityManagerFactory emf;
    public DataBaseAccess() throws Exception{
        logger.log(Level.INFO, "DBAO being created, timeSheet.DataBaseAccess");
            try{
                emf = Persistence.createEntityManagerFactory("TimeSheet2PU"); //emf is not injected into the object, don't know why.
            catch(Exception e){
                System.out.println("there was a problem with making the em " + e.getMessage());
    public TimeSheet getTimeSheet(TimeSheetUser pUser, Date pDate)throws NoPeriodSettingsFound, UserNotFound{
        EntityManager em;
        List<TimeSheet> userTimeSheets = pUser.getTimeSheets();    
        for(TimeSheet ts : userTimeSheets){           
            if(pDate.after(ts.getStartDate()) && pDate.before(ts.getEndDate())) return ts;
        //if we get this far the user does not have a time sheet that covers the given date
        Calendar date = new GregorianCalendar();
        date.setTime(pDate);
        PayPeriodSettings settings = getPayPeriodSettings(date);
        TimeSheet timeSheet = new TimeSheet(pUser, date, settings.getSettingsStartDate(), settings.getPeriodLength());
        try{
            em = emf.createEntityManager();
            System.out.println("Time sheet id = " + timeSheet.getId());
            em.persist(timeSheet);
            System.out.println("Time sheet id = " + timeSheet.getId()); //id is updated at this time.
        catch(EntityExistsException e){
            System.out.println("EntityExistsException with persist method call. " + e.getMessage());
        catch(IllegalStateException ise){
            System.out.println("IllegalStateException with persist method call. " + ise.getMessage());
        catch(IllegalArgumentException iae){
            System.out.println("IllegalArgumentException with persist method call. " + iae.getMessage());
        catch(TransactionRequiredException tre){
            System.out.println("TransactionRequiredException with persist method call. " + tre.getMessage());
        catch(Exception e){
            logger.log(Level.INFO,"Exception: DateBaseAccess.getTimeSheet", e);
        pUser.addTimeSheet(timeSheet);
        return timeSheet;
    }

Hi,
We are using JDeveloper 11.1.1.6. We have enabled the MDS on this setup.
Though its working fine with all the defined components , its not working for af:panelsplitter.
Can you please update if MDS is working fine with af:panelsplitter in JDeveloper 11.1.1.6?

Similar Messages

  • My iMac 27" Late 2012 has Image Persistence Problem

    I'm wondering what to do about an annoying image persistence problem on my 27" late 2012 iMac. I got the iMac just a few days ago. Monday actually, so 4 days ago.
    It's the 3.4GHz i7, 8GB, NVIDIA 680MX 1TB fusion drive model.
    Overall it has become the love of my life, but the image persistence thing is getting harder to ignore. This happens after only a few minutes of use. If I follow Apple's instruction on dealing with LCD image persistence, I can make it go away for a while, but it comes back very quickly.
    It is extremely noticeable on a plan dark background. It looks as thought he screen has been left on for a very long time with the same windows open, but it occurrs in less than 5 minutes of use with nothing more intense than a bit of web surfing.
    I've read that this is happening a great deal on these new iMacs, particularly teh 27" machines.
    While the problem seems to be known to those of us afflicted I don't know if Apple has acknowledged an issue or not.
    Here is a sample of the complaints: http://forums.macrumors.com/showthread.php?t=1509571
    I can make the ghost image vanish by bringing up an all white scree for a minute or so or using LCD Scrub.
    I'm wondering if anyone else has foun a solution other than asking for a replacement computer, which Apple seems to be granting on this issue?

    Avoiding image persistence on Apple (IPS) displays
    Avoiding image persistence on Apple LCD displays
    If you cannot resolve the issue yourself, then return the computer for a replacement. You may do this freely within 14 days from date of purchase, so don't delay.

  • Recent batches 30" with shadow imprint/persistence problems

    Recently changed 2!!! displays, and both 30" had the same shadow imprints or what some would call persistence. You do not need to leave the display on for a long time, just on it for about a minute, and set any coloured image on a dark bg, eg dark blue, and later switch to the complete bg which had the same dark blue background, u'll definetly be able to see the imprint or shadow coloured image which u viewed previously, its so obvious u wouldnt miss it.

    from wat i understand, it is the vendor thats supplying apple with the "problematic" panels..so the recent batches of the 30" all have the shadow imprint problem, thats why apple is saying that its within specification as they cant reject all the panels from the vendor. Right now i am being in a difficult position as i know i will get back a recent batch with the same problem even if i changed another display.

  • Persistence problems wit seam/hibernate and EntityHome

    This is the scenario(using JBoss Seam 2.2 and JBoss Application Server 5.1.0.):
    I've got TestCases and TestSteps. One TestCase has multiple TestSteps. I have a table that displays the steps and actions like "addStep" and "deleteStep".
    I use rich:inplaceInput to edit existing steps. This works perfectly.
    Adding or deleting a step however does not. When adding, I create an "empty" step which is displayed in the table and the user can then edit it.
    I can't explain how it persists changes to existing steps, but doesn't cooperate when list TestCaseHome.testSteps changes in size.
    Entity TestStep:
    @Entity
    @Table(name = "teststeps")
    public class TestStep implements java.io.Serializable {
         private static final long serialVersionUID = 6534546556882292702L;
         private long id;
         private TestCase testCase;
         private String test;
         private String expectedResult;
         private long ordering;
         @ManyToOne(fetch = FetchType.LAZY)
         @JoinColumn(name = "tc_id")
         public TestCase getTestCase() {
              return this.testCase;
         public void setTestCase(TestCase testCase) {
              this.testCase = testCase;
    }Entity TestCase: Entity CoreTestObject isn't really relevant, TestCase just inherits it's id from it.
    @Entity
    @Table(name = "testcases")
    @PrimaryKeyJoinColumn(name="id")
    public class TestCase extends CoreTestObject implements java.io.Serializable{     
         private Set<TestStep> testSteps = new HashSet<TestStep>(0);
         public TestCase(Set<TestStep> testSteps, ...) {
              this.testSteps = testSteps;
         @OneToMany(fetch = FetchType.LAZY, mappedBy = "testCase")
         @OrderBy("test")
         public Set<TestStep> getTestSteps() {
              return this.testSteps;
         public void setTestSteps(Set<TestStep> testSteps) {
              this.testSteps = testSteps;
    }TestCaseHome:
    @Name("testCaseHome")
    @Scope(ScopeType.CONVERSATION)
    public class TestCaseHome extends EntityHome<TestCase> {     
         @DataModel
         private List<TestStep> testSteps;
         /*@param step The Step after which the new Step is to be inserted*/
         public void addStep(TestStep step){
              testSteps = new ArrayList<TestStep>(this.getInstance().getTestSteps());
              long id, ordering;
              [...] // here I find the id and ordering of step
              testSteps.add(new TestStep(id+1, this.getInstance(), "", "", ordering+1));     
              this.getInstance().setTestSteps(new HashSet<TestStep>(testSteps));
         /*@param step The Step to be deleted*/
         public void deleteStep(TestStep step){
              int index = testSteps.indexOf(step);          
              testSteps.remove(index);
              this.getInstance().setTestSteps(new HashSet<TestStep>(testSteps));          
    }EntityHome:
    public class EntityHome<E> extends Home<EntityManager, E>
       @Transactional
       public String update()
          joinTransaction();
          getEntityManager().flush();
          updatedMessage();
          raiseAfterTransactionSuccessEvent();
          return "updated";
       @Transactional
       public String persist()
          getEntityManager().persist( getInstance() );
          getEntityManager().flush();
          assignId( PersistenceProvider.instance().getId( getInstance(), getEntityManager() ) );
          createdMessage();
          raiseAfterTransactionSuccessEvent();
          return "persisted";
    }View:
    <rich:dataTable value="#{testCaseHome.testSteps}" var="_testStep"
              id="testStepsTable" rowKeyVar="row" autoresize="true">
         <rich:column sortBy="#{_testStep.ordering}"
              sortOrder="ASCENDING" style=" width : 20px;">
              <f:facet name="header">Order</f:facet>
              <rich:inplaceInput layout="block" value="#{_testStep.ordering}"
                   selectOnEdit="true" editEvent="onclick">
                   <a:support event="onviewactivated" ajaxSingle="true"
                        reRender="testStepsTable" />
              </rich:inplaceInput>
         </rich:column>
         <rich:column sortBy="#{_testStep.expectedResult}" [...] </rich:column>     
         <rich:column sortBy="#{_testStep.test}"> [...] </rich:column>
         <rich:column style=" width : 80px;">
              <f:facet name="header">
                   Action
                        </f:facet>
              <a:commandLink ajaxSingle="true" id="deletelink"
                   reRender="testStepsTable"
                   action="#{testCaseHome.deleteStep(_testStep)}">
                   <h:graphicImage value="/img/delete.gif" />
                   <f:param name="testCaseId" value="#{testCaseHome.instance.id}" />
                   <f:param name="testStepFrom" value="TestCase" />
              </a:commandLink>
              <a:commandLink ajaxSingle="true" id="addlink"
                   reRender="testStepsTable"
                   action="#{testCaseHome.addStep(_testStep)}">
                   <h:graphicImage value="/img/plus_icon.gif" style=" width : 16px; height : 16px;"/>
                   <f:param name="testCaseId" value="#{testCaseHome.instance.id}" />
                   <f:param name="testStepFrom" value="TestCase" />
                   <s:conversationId />     <!-- <<<<I thought that might help but it didn't-->
              </a:commandLink>
         </rich:column>
    </rich:dataTable>
    <div class="actionButtons">
         <h:commandButton id="save"
              value="Save" action="#{testCaseHome.persist}"
              disabled="#{!testCaseHome.wired}"
              rendered="#{!testCaseHome.managed}" />
         <h:commandButton id="update"
              value="Save" action="#{testCaseHome.update}"
              rendered="#{testCaseHome.managed}" />
    </div>I cut a lot from the code, I hope I didn't leave anything relevant out. I also hope this is the right place for this question, excuse me if not (noob here).
    I would very much appreciate your help since I'm trying to fix this for weeks. Thank you!

    Hello gimbal2,
    yes, I initialized the collection by myself now and it works better.
    But I think there is a general Problem in the order-Example. The Example isn't implemented as described in the written part of the tutorial and has several other
    bugs with persistence in this example.
    I've installed the turorial with Update Tool. Is it possible that the samples in the update contain a newer/older version than the code that is described in the PDF?
    Thanks,
    Johann

  • * newbie alert * kodo persistence problem

    Trying to follow this oh so easy example:
    http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/JDev11gExperience/JDev11gExperience.html
    Here's the last few lines of the exception error...
    The following providers:
    kodo.persistence.PersistenceProviderImpl
    org.apache.openjpa.persistence.PersistenceProviderImpl
    Returned null to createEntityManagerFactory.
         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:154)
         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
         at sample.model.JavaServiceFacade.<init>(JavaServiceFacade.java:12)
         at sample.model.JavaServiceFacade.main(JavaServiceFacade.java:19)
    Process exited with exit code 1.
    Connecting through an JDBC-ODBC bridge to an Ingres database (other locking issues make it difficult to connect using native ODBC driver)
    fairly simple logic... connect to a single table then display one field out of the table to the console
    [Tuserprof.java]
    @Entity
    @NamedQueries({
    @NamedQuery(name = "TUserprof.findAll", query = "select o from TUserprof o")
    [JavaServiceFacade.java]
    public static void main(String [] args) {
    final JavaServiceFacade javaServiceFacade;
    javaServiceFacade = new JavaServiceFacade();
    // TODO: Call methods on javaServiceFacade here...
    List<TUserprof> emps = javaServiceFacade.getTUserprofFindAll();
    for (TUserprof tUserprof : emps) {
    System.out.println(tUserprof.getFirst_name());
    Here's the persistence.xml file
    <?xml version="1.0" encoding="windows-1252" ?>
    - <persistence 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" version="1.0">
    - <persistence-unit name="Model-1" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>sample.model.TUserprof</class>
    - <properties>
    <property name="eclipselink.jdbc.driver" value="sun.jdbc.odbc.JdbcOdbcDriver" />
    <property name="eclipselink.jdbc.url" value="jdbc:odbc:sys10 sql" />
    <property name="eclipselink.jdbc.user" value="report" />
    <property name="eclipselink.jdbc.password" value="C21EECE0FBC5CC41A77C390BE52548ED" />
    <property name="eclipselink.logging.level" value="FINER" />
    <property name="eclipselink.target-server" value="WebLogic_10" />
    </properties>
    </persistence-unit>
    - <persistence-unit name="Model">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>java:/app/jdbc/jdbc/sys10sqlDS</jta-data-source>
    <class>sample.model.TUserprof</class>
    - <properties>
    <property name="eclipselink.target-server" value="WebLogic_10" />
    <property name="javax.persistence.jtaDataSource" value="java:/app/jdbc/jdbc/sys10sqlDS" />
    </properties>
    </persistence-unit>
    </persistence>
    NO CLUE on how to solve the error... any assistance would be appreciated...
    Edited by: shawnc on Mar 14, 2011 2:58 PM

    NO CLUE on how to solve the errorFirst step STOP using a JEE server to figure out the problem.
    Write a simple Java console app to test your ODBC set up. If you can't get that to work then you can't get it to work in JEE.

  • Use persistEntity problem

    Dear all:
    I hava dropped a constructor and a persistEntity from the Data controls palette ,to insert a record ,and in this table has a column which type is number(6,2), when i run the project and click the persistEntity button,errors diplay as follows:
    JBO-29000: Unexpected exception caught: java.lang.IllegalArgumentException, msg=argument type mismatch,
    and the af:inputText's value is number(10.00 or 10),why is that?
    Thanks

    Thanks for you help and it runs well!
    but i am confused about when i use ${bindings.VsaMirOfferInfo.result} ,except the double type column has problem, other type columns(e.g:Intger String) are good.
    Alex

  • HT5455 image persistence problem on Macbook Pro Retina 15"

    Is it a faulty or normal behaviour if we see an image persistence after 5 minutes ( less than 15 minutes "Default setting of Energy Saver while using Power Adapter" to sleep/ turn off the display of Macbook Pro Retina 15 inch)?
    Today, the Technical support checked my screen using the gray.html and it did not appear. And She said it is a normal behaviour to have an image persistence, because the retina bla bla bla (i don't remember exactly) and just dont leave the laptop too long.
    http://r238.local/display/gray.html
    Just now after playing a Chess (appx 30 minutes) , and run that test. The image persistence appeared and I guess I need to make appointment again..
    Any solution and suggestion?
    or We will stick with what the technical support said "Normal Behaviour" ?

    The warranty entitles you to complimentary phone support for the first 90 days of ownership.
    If you bought the product in the U.S. directly from Apple (not from a reseller), you have 14 days from the date of delivery in which to exchange or return it for a refund. In other countries, the return policy may be different. If you bought from a reseller, its return policy applies.

  • Retina Display MacBook Pro image persistence problem.

    Hello,
    I have recently ( about 3 months ago) bought a Retina MacBook Pro and installed Windows via Bootcamp on it. I unfortunately am used to Windows. Well recently I tried to migrate to OS X and use it more often. Whilst doing so something caught my eyes on the desktop/Screen. There appears to be Ghosting images of the Finder/Safari windows I open which look extremely annoying and terrible for a machine I payed 3000 dollars for. I have contacted Apple support via a phone call and they said they will replace it...the screen...if i brought it and gave it to them myself. The problem is, I live out of the US and I ordered this from a friend that has went there to buy one for me as we both live in Saudi Arabia and the Premium Resellers here sell it for a very high profit rate. My issue is that I live out of the US with a Malfunctioning Laptop worth $ 3,000, and can't send it to Apple as I don't know anybody going there including myself. I have researched and this problem happens only on LG manufactured screens, I have found out mine is also indeed an LG screen via a terminal code I found on the Internet. Is there any way Apple can replace the laptop or the screen from Saudi Arabia as there are premium resellers. The support guy was not very helpful as I was a rare case out of the US and the service of the resellers here said they would like to look at the display, I don't think they would fix it for free...Don't apple devices have an international warranty?
    Thanks,

    an hour on my MBP by itself (someone else's office, a hotel room, an airplane, my lazy sofa) and my eyes lose the ability to focus --and I'm toast.
    Ok, I'll explain why.
    First off your iPad and iPhone screen is smaller, thus doesn't reflect as much as a larger display will.
    Your other displays are in a static environment where you have reduced the glare or it's been reduced just by chance.
    When you take the glossy screen laptop to another location without adequate environmental features to reduce glare imposed (no overhead lights, closed windows, low light etc.) on the screen, thus your getting eyestrain from the glare.
    It's caused by the slightly out of focus reflections verses the screen image, your eyes are automatically refocusing between the two images.
    Your solution in this matter is to apply a anti-glare film to the laptops glossy screen, unfortunately it's going to cost money and be replaced often as it gets dirty, dries out and peels at edges etc.
    Ideally a anti-glare matte screen would be the choice in the first place. I use my Mac for 12 hours a day, 7 days a week and don't have the eyestrain problem anymore.

  • JMS persistence problem

              Hi,
              I have persistence half working on WLS6.1 Messages are being written to the database
              ok. When I crash the server, the message is still there. When I bring the server
              back up the message appears in the destination but is removed from the database.
              Therefore if the server crashes before the message is consumed it is lost.
              Any help appreciated.
              Fraser
              

    The message appears in the destination but is removed
              from the database? That is strange behavior, and I
              have no explanation. I highly recommend contacting
              customer support. I also
              recommend trying the latest SP, just to see if that makes
              a difference.
              Tom, BEA
              Fraser wrote:
              > Hi,
              >
              > I have persistence half working on WLS6.1 Messages are being written to the database
              > ok. When I crash the server, the message is still there. When I bring the server
              > back up the message appears in the destination but is removed from the database.
              > Therefore if the server crashes before the message is consumed it is lost.
              >
              > Any help appreciated.
              > Fraser
              

  • Plugged-in Persistence problem

    We are having problem in using imqdbmgr to 'create tbl' to mysql.
    The error msg said :
    'java.sql.SQLException: Syntax error or access violation: You have an error in your SQL syntax near '100),DEST TINYBLOB,primary key(DID))' at line 1'
    I think it's a problem of data type used in imqdbmgr incompatible with mysql.
    I found other post in this forum with the same problem with Sybase.
    I think if the data store db schema be published, this problem can be resolved by manual creating the tables.

    Jeffrey,
    We haven't tested MQ running with mySQL, and
    we're not prepared to support customers tweaking
    the SQL yet. Even if you get the tables created I'm
    not very confident the rest of our SQL will work.
    We're looking to support the ability to modify the SQL
    in the field in an upcomming release.
    FYI the JDBC data type used in the table being created
    below are VARCHAR(100) and LONGVARBINARY. MySQL appears
    to map LONGVARBINARY to TINYBLOB.
    Sorry for the inconvenience,
    Joe Di Pol
    Sun Microsystems, Inc.
    We are having problem in using imqdbmgr to 'create
    tbl' to mysql.
    The error msg said :
    'java.sql.SQLException: Syntax error or access
    violation: You have an error in your SQL syntax near
    '100),DEST TINYBLOB,primary key(DID))' at line 1'
    I think it's a problem of data type used in imqdbmgr
    incompatible with mysql.
    I found other post in this forum with the same
    problem with Sybase.
    I think if the data store db schema be published,
    this problem can be resolved by manual creating the
    tables.

  • EJB Persistence problem [Data modified outside EJB]

    Hello,
    There is an EJB in the system which corresponds to a db table, say it "AppBean", and a corresponding session bean AppSession which provides insert/remove/query service. There is another program, a webapp which might runs on another server, also makes modifications to that table.
    But the EJB seems to be totally unaware of data changes made by others ... Is there a simple mechanism that would allow notification to the EJB to ask it to reload data from DB? JMS or MDB seems to be too complicated ...
    Thanks in advance.
    layman

    Hello,
    Thanks for your reply first.
    Do you mean that the webapp shall call the EJB's
    ejbLoad method in remote interface? or is there anyway
    to set a "validation" flag, as we do to Session State?Well, I actually mean that shall the webapp call the EJB's ejbLoad through it's local interface(ejb-local-ref in web.xml)? Isn't there some more elegant way to achieve this? A Java guru told me that JMS might be an "easy" way, but I know almost nothing about that.
    tHANK YOU.
    layman

  • Problem with JMenus that Persist - Is this a Java bug?

    I am having a problem with JMenus that persist. By this I mean
    that my drop down menus persist on the screen even after they have
    been selected.
    I've checked the Java bug database, and the following seems
    to come closest to my problem:
    Bug ID: 4235188
    JPopupMenus and JMenus persist when their JFrame becomes visible
    State: Closed, not a bug
    http://developer.java.sun.com/developer/bugParade/bugs/4235188.html
    This page says that the matter is closed and is not a bug. The
    resolution of this matter printed at the bottom of the page
    is completely abstruse to me and I would appreciate any
    comments to understand what they are talking about.
    The code at the end of my message illustrates my problem.
    1. Why should paintComponent() make any difference to
    Menu behavior?
    2. Is this a bug?
    3. What's the workaround if I have to paint() or repaint()?
    Thanks
    Tony Lin
    // Example of Menu Persistence Problem
    // Try running this with line 41, paintComponent(), and without line 41
    // Menus behave normally if line 41 is commented out
    // If line 41 exists, menus will persist after they have been selected
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class P2 extends JPanel {
    JMenuItem[] mi;
    public P2() {
    JFrame thisFrame = new JFrame();
    thisFrame.getContentPane().add(this);
    JMenu menu = new JMenu("My Menu");
    JMenuBar mb = new JMenuBar();
    mi = new JMenuItem[4];
    for (int i=0; i<mi.length; i++) {
    mi[i] = new JMenuItem("Menu Item " + String.valueOf(i));
    menu.add(mi);
    mb.add(menu);
    thisFrame.setJMenuBar(mb);
    thisFrame.setSize(400,200);
    thisFrame.setLocation(150,200);
    thisFrame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent we) {
    System.exit(0);
    thisFrame.setVisible(true);
    public void paintComponent(Graphics g) {} //Affects menu behavior!
    public static void main(String[] args) {
    new P2();

    Well, my understanding of the way painting works is that a component doesn't UNPAINT itself. Instead a message is sent to the component under the coordinates of the menu to REPAINT itself.
    In your demo program the JFrame is the component under the JMenu. The paintComponent() method of JFrame is empty, so nothing gets repainted.
    I added super.paintComponent(g); to the method and everything works fine.

  • Problems with new update of Numbers for Maverick

    When opening any of my documents creted on a alder version of Numbers, I lose the format that I had on the page. The table or spreadsheet stays intact, but no the document perse. Where is the "Show Print View" feature on the new update of Numbers. I am frustrated and disappointed with the new changes, since I had to recreate all the spreadsheets that I had for my personal use and work.

    Hi Sarafinna
    Welcome to http://supportforums.blackberry.com/
    Trying to restart the BlackBerry to see if it works and works well the OS on your BlackBerry.
    If evidences the persistence problem I recommend you do a hard reset
    By pressing the plus and minus volume along with the power button for about 30 seconds.
    BBM Channels  PIN: C0007093A
    Do not forget to give LIKE    Those people who help you and advise you about your doubts.  if the review has been SOLVED** # 4LL  #ÉliteRoad  Make a backup of your BlackBerry
    BlackBerry Protect and  BlackBerry Link constantly.  #ichooseBlackBerry10 Gutijose14 Forums Veteran I

  • One more 23" image persistence discussion, share stories.

    I had one 23" that had a huge line down the middle so I sent it to apple to be repaired.. they put a new LCD on it. Now the monitor had major image persisence problem with this new LCD. So I complained.. They sent me a new one monitor. This new monitor also has image persistence problems.
    I have been following apple's guidlines. Here..
    http://docs.info.apple.com/article.html?artnum=88343
    It helps out to getting rid of the image persistence, but once I start working again, and go to a dark gui, where I really see the image persistence, I have to go back to the white screen, again, and keep doing this over and over....
    Do I have to spend most of my work day looking at a white screen? Or will image persistence eventually get bettter? Meaning will I eventually not have to look at a white screen when switching apps???
    dual 2gig G5   Mac OS X (10.4.5)  

    I have a similar problem.
    ghosting. started out of the box.
    at least here there's a privacy/security issue as well with various people using accts on the same machine, the ghosting remains from acct to acct. so if admin logs in then logs out and user logs in, admin's screen ghost remains visible.
    I'm hoping when I get my replacement it will be a 2006 model as it seems on this board that people having this problem are those who received monitors made in 2005, as is the case with mine.
    s

  • Strange short-term persistent image problem

    Hello,
    I'm well aware of the typical image persistence problem, where an image can stay "burned in" after the monitor displays the same thing for hours on end.
    I have a much shorter-term persistent image problem. Let's say I open a web-page, leave it open for 10 seconds and then open a new window in Safari (thus getting a pure white page). Well when that happens, the previous web-page is still shadowed on the new white.
    30 seconds later it has faded, but then the same thing will happen again with anything else that's displayed.
    Any ideas?
    thanks
    Loa

    Huh, now I'm really stumped. The cyan border is also present in FCE once I render, but it doesn't seem to happen for each instance when the paper image is used. Did you import the paper image as a .gif or something else? And did you add any filters to it? Did you also add any effects? The only I'm using with the paper image is the page peel and I have not tried any other effects to see if the cyan effect comes up.
    I've put a screen capture of my FCE project showing the cyan border present in the canvas as my movie is playing. Its on my idisk as FCE movie problem.tiff
    http://idisk.mac.com/gindacu-Public?view=web
    Thanks again for the help.

Maybe you are looking for

  • Clip notes a pig in a poke

    old southern expression for buying something without seeing it i'm allready mad about upgrade priceing from cs3 production premium to cs4master costing me 1700.00 now i send an hour long documentary to customer for approval and i can't see thier note

  • JoinFieldValue function and custom object 4,5

    Hi, Can JoinFieldValue function be used for custom objects 4 and 5? If I want to update the Account field on custom object 5 based on the Account field in custom object 4, can this be done using JoinFieldValue ? How? Regards, Ani.

  • 'NotAllowedError:' - when trying to import a picture in acrobat reader v7

    Hi I am desperately trying to create a pdf template that people can use in Acrobat Reader V.7 - V7.1. I want the functionality that enables the user to click on a placeholder button/area and it will bring up the dialogue box enabling them to navigate

  • Average battery life of 3GS?

    How long should I expect the battery to last in an iPhone 3GS while in Airplane Mode? Since upgrading to 4.1, my phone's battery will discharge completely overnight, even if left in Airplane mode. I am not asking for any fixes (I've already performed

  • Windows 8.1 Side menu(s) doesn't work

    Hello. My start button  has not been working properly for a while(bottom left corner of the screen), but since I could use my start button on my keyboard, I've not payed too much attention to it. Today the problem evolved. My side bars stopped workin