Same system being shown multiple time in Solution for Early Watch Report
Hi Gurus ,
I have some satellite system configured to Solution Manager . Today I can see the same system entry multiple time in the
Operations: Solution Monitoring -> Early Watch Alert.
eg .,
I have a system whose SID is ABC , i can see the ABC entry for todays date (i.e., 4 FEB 08) nearly 4 time .And this systems are not rescheduled for the next EWR (i.e scheduled for 11 FEB 08- since we have kept a period of 7 days )
Please suggest
Anthony
Hi Anthony,
There was an error, that EWA sessions for one systems were scheduled multiple times per week.
Please check [SAP Note 1083108 - Duplicate EarlyWatch Alerts|http://service.sap.com/sap/support/notes/1083108]
Search for SAP Notes with key words: EWA, multiple, duplicate.
Application area: SV-SMG-OP
What's the software configuration of your SolMan?
Best regards,
Ruediger
Similar Messages
-
Select an artist in the 'view' & the same album is shown multiple times
Hi, my top 'view' has Genre, Artist, Album as selection criteria. If I select 'The beatles' in the second pane (Artist) all Beatles albums are displayed but multiple times. E.G The album is shown 16 times, with one track on each entry. I just want it to show each album once in the main view ?
Can this be changed or can I reset all settings ?
Any help appreciated.
Thanks
Chris
Message was edited by: chriskkkkkkkkkArticle on that:
http://support.apple.com/kb/TS1468
That article is for itunes 7. The Compilation box has moved to the Options tab in itunes 8. -
Same artist is shown multiple times
In iTunes, I downloaded a song not through the iTunes store, then added the .mp3 file to iTunes. When I enter in the artist information for sorting, it lists that artist separate from the same artist I've added in the past.
I am 100% positive that the sorting fields are exactly the same, no extra spaces anywhere or incorrect spelling. Is there any reason that this would be happening if the sorting fields are exactly the same?
I also tried consolidating the files, and iTunes put the new song and the previous songs into the same Artist folder, but still separates them in iTunes.
Edit:I looked at the ID3 tags, and the tags for the old songs were v2.3, and the tag for the new song is v2.4 . Would that be the cause?Solution
Well after some googling around, I figured out the answer.
Yes, the difference between the versions of the ID3 tags was the exact problem. Apparently iTunes doesn't like the different versions. I solved the problem by getting an ID3 tag editor, changing the version of the new song from v2.3 to v2.4, then like magic, iTunes sorted them together. -
The Early Watch report is being send in mail but not in PDF.
Hi All,
We ahve recently configured CEN system which is configured for early watch report using mails but it is not being sent in pdf
it is being send in html.
Can some one pleas ehelp
Regards
YogeshHello Yogesh,
Earlywatch reports can only be generated in HTML and Word. Please take a look at below link for more details.
http://help.sap.com/saphelp_sm32/helpdata/en/87/50cce344ae495bae240add66a28ed7/content.htm
Thanks,
Siva Kumar -
Early watch Report deletions from archive queue in Solution Manager
Hi Experts ,
I am working on Solution manager EHP1 (SP24). Here more than 100 satellite systems are connected .
and every week approximately 100 Early watch reports are getting generated into the system .
Is there any way to delete the early watch reports from the archive queue of the system which are 6 months
older.
A quick help is highly appreiciable
Thanks,
Kamal Kumar>
Kamal Kumar wrote:
> I am working on Solution manager EHP1 (SP24). Here more than 100 satellite systems are connected .
> and every week approximately 100 Early watch reports are getting generated into the system .
>
> Is there any way to delete the early watch reports from the archive queue of the system which are 6 months
> older.
Hi Kamal,
Have you already tried report RDSMOPREDUCEDATA
It offers the deletion of service session, documents and download data.
Best regards,
Ruediger -
Finalize() method being called multiple times for same object?
I got a dilly of a pickle here.
Looks like according to the Tomcat output log file that the finalize method of class User is being called MANY more times than is being constructed.
Here is the User class:
package com.db.multi;
import java.io.*;
import com.db.ui.*;
import java.util.*;
* @author DBriscoe
public class User implements Serializable {
private String userName = null;
private int score = 0;
private SocketImage img = null;
private boolean gflag = false;
private Calendar timeStamp = Calendar.getInstance();
private static int counter = 0;
/** Creates a new instance of User */
public User() { counter++;
public User(String userName) {
this.userName = userName;
counter++;
public void setGflag(boolean gflag) {
this.gflag = gflag;
public boolean getGflag() {
return gflag;
public void setScore(int score) {
this.score = score;
public int getScore() {
return score;
public void setUserName(String userName) {
this.userName = userName;
public String getUserName() {
return userName;
public void setImage(SocketImage img) {
this.img = img;
public SocketImage getImage() {
return img;
public void setTimeStamp(Calendar c) {
this.timeStamp = c;
public Calendar getTimeStamp() {
return this.timeStamp;
public boolean equals(Object obj) {
try {
if (obj instanceof User) {
User comp = (User)obj;
return comp.getUserName().equals(userName);
} else {
return false;
} catch (NullPointerException npe) {
return false;
public void finalize() {
if (userName != null && !userName.startsWith("OUTOFDATE"))
System.out.println("User " + userName + " destroyed. " + counter);
}As you can see...
Every time a User object is created, a static counter variable is incremented and then when an object is destroyed it appends the current value of that static member to the Tomcat log file (via System.out.println being executed on server side).
Below is the log file from an example run in my webapp.
Dustin
User Queue Empty, Adding User: com.db.multi.User@1a5af9f
User Dustin destroyed. 0
User Dustin destroyed. 0
User Dustin destroyed. 0
User Dustin destroyed. 0
User Dustin destroyed. 0
USER QUEUE: false
INSIDE METHOD: false
AFTER METHOD: false
User Dustin destroyed. 1
User Dustin destroyed. 1
User Dustin destroyed. 1
User Dustin destroyed. 1
USER QUEUE: false
INSIDE METHOD: false
AFTER METHOD: false
User Dustin destroyed. 2
User Dustin destroyed. 2
User Dustin destroyed. 2
User Dustin destroyed. 2
User Dustin destroyed. 2
User Dustin destroyed. 2
User Dustin destroyed. 2
User Dustin destroyed. 2
USER QUEUE: false
INSIDE METHOD: false
AFTER METHOD: false
User Dustin destroyed. 3
User Dustin destroyed. 3
User Dustin destroyed. 3
User Dustin destroyed. 3
User Dustin destroyed. 3
User Dustin destroyed. 3
User Dustin destroyed. 3
User Dustin destroyed. 3
User Dustin destroyed. 3
USER QUEUE: false
INSIDE METHOD: false
AFTER METHOD: false
User Dustin destroyed. 4
User Dustin destroyed. 4
User Dustin destroyed. 4
User Dustin destroyed. 4
User Dustin destroyed. 4
User Dustin destroyed. 4
User Dustin destroyed. 4
User Dustin destroyed. 4
User Dustin destroyed. 4
USER QUEUE: false
INSIDE METHOD: false
AFTER METHOD: false
User Dustin destroyed. 5
User Dustin destroyed. 5
User Dustin destroyed. 5
User Dustin destroyed. 5
User Dustin destroyed. 5
User Dustin destroyed. 5
User Dustin destroyed. 5
User Dustin destroyed. 5
User Dustin destroyed. 5
USER QUEUE: false
INSIDE METHOD: false
AFTER METHOD: false
User Dustin destroyed. 6
User Dustin destroyed. 6
User Dustin destroyed. 6
User Dustin destroyed. 6
User Dustin destroyed. 6
User Dustin destroyed. 6
User Dustin destroyed. 6
User Dustin destroyed. 6
User Dustin destroyed. 6
User Dustin destroyed. 6
Joe
USER QUEUE: false
INSIDE METHOD: false
AFTER METHOD: false
User Dustin pulled from Queue, Game created: Joe
User Already Placed: Dustin with Joe
User Dustin destroyed. 7
User Dustin destroyed. 7
User Dustin destroyed. 7
User Dustin destroyed. 7
User Dustin destroyed. 7
User Dustin destroyed. 7
User Dustin destroyed. 7
User Dustin destroyed. 7
User Dustin destroyed. 7
User Dustin destroyed. 7
INSIDE METHOD: false
INSIDE METHOD: false
USER QUEUE: true
INSIDE METHOD: false
INSIDE METHOD: false
User Dustin destroyed. 9
User Joe destroyed. 9
User Dustin destroyed. 9
User Dustin destroyed. 9
User Dustin destroyed. 9
User Dustin destroyed. 9
INSIDE METHOD: true
INSIDE METHOD: false
USER QUEUE: true
INSIDE METHOD: false
INSIDE METHOD: false
INSIDE METHOD: true
INSIDE METHOD: false
USER QUEUE: true
INSIDE METHOD: false
INSIDE METHOD: false
It really does seem to me like finalize is being called multiple times for the same object.
That number should incremement for every instantiated User, and finalize can only be called once for each User object.
I thought this was impossible?
Any help is appreciated!Thanks...
I am already thinking of ideas to limit the number of threads.
Unfortunately there are two threads of execution in the servlet handler, one handles requests and the other parses the collection of User objects to check for out of date timestamps, and then eliminates them if they are out of date.
The collection parsing thread is currently a javax.swing.Timer thread (Bad design I know...) so I believe that I can routinely check for timestamps in another way and fix that problem.
Just found out too that Tomcat was throwing me a ConcurrentModificationException as well, which may help explain the slew of mysterious behavior from my servlet!
The Timer thread has to go. I got to think of a better way to routinely weed out User objects from the collection.
Or perhaps, maybe I can attempt to make it thread safe???
Eg. make my User collection volatile?
Any opinions on the best approach are well appreciated. -
Simple Event being Displayed Multiple Times
I have a simple event from the past that is being displayed multiple times. There are no other UIDs that are the same in iCal and no other event has the same SUMMARY name.
This particular event shows up 9 times. I can also reproduce the result from Automator by searching the specific calendar and looking for events in the date range.
The event is as follows:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Apple Inc.//iCal 3.0//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
SEQUENCE:5
TRANSP:OPAQUE
UID:EC6F5DBC-9BCC-4007-87F2-4A9C796C8551
DTSTART:20070330T000000
DTSTAMP:20071206T205550Z
SUMMARY:Babysit Paul
CREATED:20080919T173959Z
DTEND:20070401T120000
END:VEVENT
END:VCALENDAR
I am not very familiar with the format but it looks pretty straight forward.
The calendar is being synched via Mobile Me and is shared by another two computers. Not sure why this should be relevant since the entry on the computer and on Mobile Me both show this duplication of the event.
The reason I was looking at all was because of the hangs in iCal since I set the sync to automatic.
Any ideas welcome,
RichardPost Author: foghat
CA Forum: Data Connectivity and SQL
If all the records you are displaying in your report
truly are duplicated, you could try check off 'select distinct records'
from the File --> Report Options menu. While this may solve the problem for you, it would be worthwhile to determine if you are actually joining your tables correctly.
likely the records aren't an exact duplicate and the problem is with your join criteria. To verify this you can: start by removing table b from the database expert altogether. does
that solve your problem of multiple rows? If it does, you are not joining to table b correctlyIf you still have
multiple rows, loan_id on its own must not make a record unique. Is
loan_id duplicated in either of your tables? Just because loan_id is a
primary key does not necessarily mean it is unique - often a record
will have 2 or more primary keys and only when all primary keys are
used is the record unique. If you display all of the columns
from both tables, you will hopefully see some (maybe just one) columns
where the value is different between your seemingly duplicate data.
You may need to join on this value as well.as for the type of join you are using (inner, not enforced) you should be fine. Good luck -
Email being sent multiple times (3 times) when actions are triggered after creating an incident.
Below is the snip of "Scheduled Actions" of the created Incident.Hi Ritesh
Email is triggered based upon conditions and you set
on closer look it is 3 different email on three 3 different requirement for e.g
email triggered to reporter on new status
email trigerred to processor on Proposed solution and New status
Therefore, check the start condition for above 2 email actions and refer below blog
Sending E-Mail from Support Message
Thanks
Prakhar -
On Execute operation, the bean getter is being called multiple times
Hi,
I have a JCR data control, i am trying to write a method that returns predicate, but this method is being called multiple times, when executing the advanced search operation.
public List<Predicate> getPredicates() {
ArrayList<Predicate> predicates = new ArrayList<Predicate>();
// predicates.add(new Predicate("jcr:content/idc:metadata/idc:xScope",Operator.EQUALS,"GLOBAL"));
DCBindingContainer bc=(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
JUCtrlListBinding attrBinding=(JUCtrlListBinding) bc.findCtrlBinding("StateId");
Object stateId= attrBinding.getSelectedValue();
if(stateId instanceof Row){
predicates.add(new Predicate("jcr:content/idc:metadata/idc:xState"
, Operator.EQUALS
,((Row)stateId).getAttribute("StateId").toString()));
attrBinding=(JUCtrlListBinding) bc.findCtrlBinding("DistrictId");
Object districtId=attrBinding.getSelectedValue();
if(districtId instanceof Row){
predicates.add(new Predicate("jcr:content/idc:metadata/idc:xDistrict",Operator.EQUALS,((Row)districtId).getAttribute("DistrictId").toString()));
attrBinding=(JUCtrlListBinding) bc.findCtrlBinding("Scope");
Object scopeId=attrBinding.getSelectedValue();
if(scopeId instanceof Row){
predicates.add(new Predicate("jcr:content/idc:metadata/idc:xScope",Operator.EQUALS,((Row)scopeId).getAttribute("ScopeType")));
AttributeBinding tempAttrBinding=(AttributeBinding)bc.findCtrlBinding("CreatedDate");
Object createdDate=tempAttrBinding.getInputValue();
if(createdDate!=null){
predicates.add(new Predicate("jcr:content/jcr:created",Operator.EQUALS,createdDate.toString()));
if (predicates.size()>0){
return predicates;
return Collections.emptyList();
} The problem is while it's being called multiple times different list's are being returned which is causing the method not to work . The bean is in pageFlowScope .That is bc ADF life cicle... Is always executing 2 times...
-
Hello,
I have a problem with the CFMCPopupMenu in a Visual Studio Professional 2013 Update 4 created MFC DLL (Regular DLL using shared MFC DLL) and in a dialog based MFC application (others I didn't test - maybe in an SDI application too).
If the menu key (VK_APPS) is pressed multiple times, the context menu is created and shown multiple times.
When pressing the Alt (VK_MENU) key or clicking with the mouse buttons the menu is not shown multiple times.
It seems to be bug in CDialogImpl::PreTranslateMessage case WM_CONTEXTMENU where it is tested if a popup menu is already shown
and if there is an active popup menu this popup menu is closed, but only if the pMsg->wParam == VK_MENU.
The problem occurs in a dialog based MFC application and in dialog's in regular DLL's.
In case of MFC MDI applications the problem does not occur,
because in the CFrameImpl::ProcessKeyboard the key is passed to the popup menu for processing pActivePopupMenu->SendMessage(WM_KEYDOWN, nKey); and eaten up.
You can reproduce the problem in the following way:
1. Create a dialog based MFC application with the Visual Studio 2013 wizard.
2. Add a menu IDR_MENU1 to the resource.
3. Add a ON_WM_CONTEXTMENU / OnContextMenu message handler to the dialog.
4. Insert the following code into the OnContextMenu handler of the dialog:
_ASSERT(!CMFCPopupMenu::GetSafeActivePopupMenu());
CMenu m;
m.LoadMenu(IDR_MENU1);
CMFCPopupMenu* pPopupMenu = new CMFCPopupMenu;
pPopupMenu->SetAutoDestroy(FALSE);
VERIFY(pPopupMenu->Create(this, 100, 100, m.GetSafeHmenu(), TRUE, TRUE));
5. Compile and start the application and press the Menu Key (VK_APPS) multiple times.
-> You run into the ASSERT.
If you press the Alt-Key or left click with the mouse multiple times all is fine.
You can also add a tracepoint in the constructor and destructor to see that the CMFCPopup menu is created multiple times if the Menu-Key is pressed.
Kind regards,
Andreas.
AndreasHi Andreas,
Thanks for posting in MSDN forum.
Yes, I can reproduce this issue on my side. After look into the afxdialogimpl.cpp and afxframeimpl.cpp file, It really is a issue in the dialog message translate. I have no workaround to avoid this. But maybe we can try to use
CMenu class and handle WM_RBUTTONDOWN message instead of WM_CONTEXTMENU.
void CMFCPopupMenuTestDlg::OnRButtonDown(UINT nFlags, CPoint point)
// TODO: Add your message handler code here and/or call default
CMenu menu;
VERIFY(menu.LoadMenu(IDR_MENU1)); //IDR_MENU_POPUP是新建菜单ID
CMenu* popup=menu.GetSubMenu(0);
ClientToScreen(&point);
popup->TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON, point.x, point.y, this );
CDialogEx::OnRButtonDown(nFlags, point);
By using this, we can avoid the VK_APP message caused multi pop up menu.
Also have you tried submit this issue to Microsoft connect?
https://connect.microsoft.com/VisualStudio
Best regards,
Shu Hu
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
The same podcast shows up multiple times
In iTunes, the same podcast shows up multiple times. There is only one copy of the file on my computer, and the file it located in the right location, but in iTunes, the same podcast is repeated two or more times. When I delete a single podcast and try to play its copies, iTunes notifies me that it can't find the file. I believe this happens when I use the import folder utility and add music in the iTunes music default location (which includes the podcasts as well as the music I want to import). Does anyone know how to keep this from happening?
ThanksWell, the easiest way would be to stop using the import folder utility. Sounds like you're adding the podcast multiple times. You're probably doing it to other files as well...
-
0ASSET_AFAB shown multiple times
I loaded cube 0FIAA_C01 and there is a standard query 0FIAA_C01_Q001.
The difficulty I am having is that the Depreation Area [0ASSET_AFAB] is shown multiple times (like 20) in the pull down when I execute the query and the variable entry screen is shown.
Is there something wrong with how the Master Data as loaded?
Here is a snippet of the [0ASSET_AFAB] master data:
comp code attachment sub_number depre area
5000 1000000000 0 12
5000 1000000001 0 12
5000 1000000002 0 12
5000 1000000003 0 12
5000 1000000004 0 12
5000 1000000005 0 12
5000 1000000009 0 12
5000 1000000012 0 12
5000 1000000013 0 12
5000 1000000014 0 12
5000 1000000015 0 12
5000 1000000016 0 12
5000 1000000017 0 12
5000 1000000018 0 12
5000 1000000019 0 12
Thanks,
Mike
I looked at the object 0ASSET_MAIN and it shows:
comp code attachment long description
5000 1000000000 N10121409
5000 1000000001 N10121409
5000 1000000002 N10121409
5000 1000000003 N10121409
5000 1000000004 N10121409
5000 1000000005 N10121409
5000 1000000006 N10121409
5000 1000000007 N10121409
5000 1000000008 N10121409
5000 1000000009 N10121409
5000 1000000010 N10121409
5000 1000000011 N10121409
5000 1000000012 N10121409
5000 1000000013 N10121409
Edited by: Michael Hill on Mar 4, 2008 11:37 PMOk ... Cool, better but I still get this in the java web:
Book Depreciation 1
Acqisition Adjustment 2
Net Acquisition Cost 3
Federal Tax 10
Alternative Minimum Tax 11
Adjusted Current Earnings 12
Local Currency of Book Depreciation 31
Cost of Money 90
Book Depreciation 1
Acqisition Adjustment 2
Net Acquisition Cost 3
Federal Tax 10
Alternative Minimum Tax 11
Adjusted Current Earnings 12
Local Currency of Book Depreciation 31
Cost of Money 90
and it repeats !!
In the abap web its sorted like:
Book Depreciation 1
Book Depreciation 1
Acqisition Adjustment 2
Acqisition Adjustment 2
Is that normal?
Mike -
RFC configuration for system monitoring / Early Watch reports
Hello Basis Gurus:
Please help me out.....
The early watch reports in the solution manager of my system are failing consistently to execute.This is happening for all the 3 systems DEV,QAS,PRD.when i click on individual earlywatch reports it takes me to a screen which says "data for this report is overdue.....go to your satellite system SDCCN to see why the data was not sent...."
It says ...check the following things.....
"The RFC connection for the SAP Solution Manager system is not working.
The 'Task Processor' background job, which collects the session data, has been changed.
Problems arose while data was being collected (see the detail log for the task that collects the session data).
A periodic 'SDCC Maintenance Package' task has not been scheduled to check whether your SAP Solution Manager system requests session data."
I can see the task processor job , and the periodic Maintenance package scheduled everyday and completed sucessfully.So is it the RFC which is causing the problem.
Im SM59 of the solman, i can see system generated RFCs for the PRD,DEV,QAS and SND (...3 for each of these systems...).
say for PRD, these are the 3 RFCs.
1.)SM_PRDCLNT<client#>_READ.
2.)SM_PRDCLNT<client#>_TMW.
3.)SM_PRDCLNT<client#>_TRUSTED.
I am not sure which RFCs among the 3 for any given system does the solman use to communicate to the satellite systems.
*The user id section in the Logon Data of any of these RFCs is blank.and the password says "is initial"...*is this correct.Does the user id have to be a communication type of user...
PLeaase advise as to what could be going wrong..
Regards.Hi,
The system uses ABAP Connection (Connection Type 3) to connect to different Systems to execute Functional Calls.
Now in your case, there are 3 different connections meaning your Basis Team has used 3 connections for different connection activities. This is totally a business dependent scenario.
Now each time you create a RFC Connection, the system will need the following information to remotely call another system, they are:
Host Details of Target System
Logon Details to remotely login
For RFC Connections the User Type has to be Communications User. But there are companies which use Dialog User Types as well to remotely login for some cases. When the User ID is created for an RFC User and a Password is assigned to it, this Password is considered as the Initial Password by the system. This Password is taken as the Initial Password in the RFC Connection as well.
There can be cases where the system is Trusted and there is no need of a password, but an Username is mandatory in all cases. Remember if you set the system as Trusted, the password option gets deactivated and the connection wont work, if the system does not have the Trusted status.
But in any case you must assign the Username alongwith the Client and Language Details in the RFC Connection for it to work.
Hope this helps.
/Manoj -
Early watch report - Status as it is in Solution manager
Dear All,
I have configure early watch report in solution manager.
1. I have created new service for our production server.
2. click on newly created service
3. Press button "call Service Data Control Center"
4 System ask for prodction password.
5 now SDCCN's screen of production server open.
6. Create a new task "Refresh sessions" with selecting "Now" option.
7. Start a New task is created.
8. Task is complited successfuly but sessio data not transmited to solution manager.
I have also tried with "Start service processing. But still service is in "wait for session data". This status remains same as newly created service.
Request you to please suggest solution
Thanks in advance,
NiravHello,
When you press call Service Data Control Center, is it that there is a red flag for the EWA and when you click it you get that button? This means the EWA is scheduled in Solman, but on the managed system there is an issue with the SDCCN EWA task or the *_BACK RFC.
First, the Maintenance Package task is what should be schedyuled daily. It will 1 Refresh the service defintions regularly and aslo perform a refresh sessions task. You should not be scheduling the refresh session task ( unless you want to send to SAP or a second Solution Manager sytem).
The refresh session task will create an EWA task, and you did not mention this task was created from the refresh session task.
If the EWA task is not created on the satellite once the refresh session is run, then there was no session. This would indicate an error in SMSY defintions, such as the installation number there does not maych the actual installation number, as a for instance.
SDCCN task logs have to be looked at as they may have errors inside, but the task has a green check.
Also visit http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=228262728
Regards,
Paul -
Default button being clicked multiple times when enter key is pressed
Hello,
There seems to be a strange difference in how the default button behaves in JRE 1.4.X versus 1.3.X.
In 1.3.X, when the enter key was pressed, the default button would be "pressed down" when the key was pressed, but wouldn't be fully clicked until the enter key was released. This means that only one event would be fired, even if the enter key was held down for a long time.
In 1.4.X however, if the enter key is pressed and held for more than a second, then the default button is clicked multiple times until the enter key is released.
Consider the following code (which is just a dialog with a button on it):
public class SimpleDialog extends JDialog implements java.awt.event.ActionListener
private JButton jButton1 = new JButton("button");
public SimpleDialog()
this.getContentPane().add(jButton1);
this.getRootPane().setDefaultButton(jButton1);
jButton1.addActionListener(this);
this.pack();
public void actionPerformed(ActionEvent e)
if (e.getSource() == jButton1)
System.out.println("button pressed");
public static void main(String[] args)
new SimpleDialog().show();
When you compile and run this code under 1.3.1, and hold the enter key down for 10 seconds, you will only see one print line statement.
However, if you compile and run this code under 1.4.1, and then hold the enter key down for 10 seconds, you will see about 100 print line statements.
Is this a bug in 1.4.X or was this desired functionality (e.g. was it fixing some other bug)?
Does anyone know how I can make it behave the "old way" (when the default button was only clicked once)?
Thanks in advance if you have any advice.
DaveHello all,
I think I have found a solution. The behaviour of the how the default button is triggered is contained withing the RootPaneUI. So, if I override the default RootPaneUI used by the UIDefaults with my own RootPaneUI, I can define that behaviour for myself.
Here is my simple dialog with a button and a textfield (when the focus is NOT on the button, and the enter key is pressed, I don't want the actionPerformed method to be called until the enter key is released):
package focustests;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
public class SimpleDialog extends JDialog implements java.awt.event.ActionListener
private JButton jButton1 = new JButton("button");
public SimpleDialog()
this.getContentPane().add(new JTextField("a text field"), BorderLayout.NORTH);
this.getContentPane().add(jButton1, BorderLayout.SOUTH);
this.getRootPane().setDefaultButton(jButton1);
jButton1.addActionListener(this);
this.pack();
public void actionPerformed(ActionEvent e)
if (e.getSource() == jButton1)
System.out.println("button pressed");
public static void main(String[] args)
javax.swing.UIManager.getDefaults().put("RootPaneUI", "focustests.MyRootPaneUI");
new SimpleDialog().show();
and the MyRootPaneUI class controls the behaviour for how the default button is handled:
package focustests;
import javax.swing.*;
* Since we are using the Windows look and feel in our product, we should extend from the
* Windows laf RootPaneUI
public class MyRootPaneUI extends com.sun.java.swing.plaf.windows.WindowsRootPaneUI
private final static MyRootPaneUI myRootPaneUI = new MyRootPaneUI();
public static javax.swing.plaf.ComponentUI createUI(JComponent c) {
return myRootPaneUI;
protected void installKeyboardActions(JRootPane root) {
super.installKeyboardActions(root);
InputMap km = SwingUtilities.getUIInputMap(root,
JComponent.WHEN_IN_FOCUSED_WINDOW);
if (km == null) {
km = new javax.swing.plaf.InputMapUIResource();
SwingUtilities.replaceUIInputMap(root,
JComponent.WHEN_IN_FOCUSED_WINDOW, km);
//when the Enter key is pressed (with no modifiers), trigger a "pressed" event
km.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER,
0, false), "pressed");
//when the Enter key is released (with no modifiers), trigger a "release" event
km.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER,
0, true), "released");
ActionMap am = SwingUtilities.getUIActionMap(root);
if (am == null) {
am = new javax.swing.plaf.ActionMapUIResource();
SwingUtilities.replaceUIActionMap(root, am);
am.put("press", new HoldDefaultButtonAction(root, true));
am.put("release", new HoldDefaultButtonAction(root, false));
* This is a copy of the static nested class DefaultAction which was
* contained in the JRootPane class in Java 1.3.1. Since we are
* using Java 1.4.1, and we don't like the way the new JRE handles
* the default button, we will replace it with the old (1.3.1) way of
* doing things.
static class HoldDefaultButtonAction extends AbstractAction {
JRootPane root;
boolean press;
HoldDefaultButtonAction(JRootPane root, boolean press) {
this.root = root;
this.press = press;
public void actionPerformed(java.awt.event.ActionEvent e) {
JButton owner = root.getDefaultButton();
if (owner != null && SwingUtilities.getRootPane(owner) == root) {
ButtonModel model = owner.getModel();
if (press) {
model.setArmed(true);
model.setPressed(true);
} else {
model.setPressed(false);
public boolean isEnabled() {
JButton owner = root.getDefaultButton();
return (owner != null && owner.getModel().isEnabled());
This seems to work. Does anyone have any comments on this solution?
Tjacobs, I still don't see how adding a key listeners or overriding the processKeyEvent method on my button would help. The button won't receive the key event unless the focus is on the button. There is no method "enableEvents(...)" in the AWTEventMulticaster. Perhaps you have some code examples? Thanks anyway for your help.
Dave
Maybe you are looking for
-
I need help with bridge app being open and I cant start any new projects in ID or PS
-
Downloading a binary file using sockets without length known
Hi all, I'm trying to download a binary(.exe) file using socket, where the length of the file is not known. Please take a look at the code I'm using: var readBin = socketBin.read(); <-- Here comes the code that checks for http Content-leng
-
Hi Friends, I am learning XI, and right now working on simple scenerio of Idoc to Idoc transfer, i.e. from sandbox to IDes. I am sending Sales order notification from one system to other. I am able to do that with ale. but Now i am trying XI.For this
-
I have just finished to write my web-application, I developed everything on Netbeans using Tomcat 5.0. As you should know I have a .war archive with my web application inside. I was wondering if I'd change the application-server (I mean the web engin
-
Sorry if this is a wrong section for this question. I have set one of the apache vhosts to point to an encrypted mounted DMG file. If i navigate to the website, i get a 403 error. It seems that something is wrong with permissions. For some reason, ap