Java 1 vs. Java 2 Event Handling

Prelude: This question relates to writing code for event handling.
Java 1 is based on a hierarchy model to handle events, ie. inheritance from superclasses. Java 2 uses delagation event handling method. Java 2 code will not compile if it includes Java 1 code still modeled according to Java 1 event handling.
Question:
Is it generally easier to start completely over in trying to convert Java 1 code into Java 2 code by not retaining any Java 1 code and begin reconceptualizing what is needed for a conversion to Java 2?

From what I understand java2 should support both models, however not both at the same time, you cant mix the modles...
I also think that the older models methods or at least most have been depreciated, meaning that the old model will, if it hasnt allready in the latest release, dissapear.. For that single reason I would recommend updating the event model to the delegation model if you hope to keep it around and running for years to come. You gain a bit by doing this since the newer model is much faster!!!

Similar Messages

  • Java 2 console event handling

    Hi all,
    Is there any way to handle the console events? I need something like AWT's WindowListener but for handling console events - "on close" in particular. I've written basic server app for a game, and it does not have gui (it only listens on specific port and sends messages from point A to point B). As usually on any Java app launch I get a console window (if not disabled of course...). The problem is, when I shut down the server, users don't get notified that the server was shut down, and they "loose" connection with each other without knowing it. So, I need an event listener which would catch the "On Close" or "On Exit" event of the console window when I press the "X" and CTRL+C to close server, where I would add code to send messages to all users to inform off server offline status.
    Any help would be greatly appreciated,
    Oleg

    thanks, acneto. But then again, I would need a listener for keys for console events? Is there one? But even if there is, users won't bother themselves typing anything (they will have the server app too), they'll just close it by pressing the "X" or CTRL+C, and other users won't get notified, so it's better to have a console window listener or something... Well, if this is not possible then I guess it'll be easier to just create a simple gui and then I'd add usual AWT listener... just curious anyways. If anyone has any other suggestions, I'd gladly hear them.
    Oleg

  • Difference in event handling between Java and Java API

    could anyone list the differences between Java and java-API in event handling??
    thanks,
    cheers,
    Hiru

    the event handling mechanisms in java language
    features and API (java Application Programming
    Features)features .no library can work without a
    language and no language has event handling built in.
    I am trying to compare and contrast the event
    handling mechanisms in the language and library
    combinations such as java/ java API.
    all contributions are welcome!
    thanks
    cheersSorry, I'm still not getting it. I know what Java is, and I know what I think of when I hear API. (Application Programming Interface.) The API is the aggregation of all the classes and methods you can call in Java. If we agree on that, then the event handling mechanisms in Java and its API are one and the same.
    So what do you want to know?
    %

  • Event handling from class to another

    i get toolbarDemo.java which make event handling to JTextArea in the same class
    http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/index.html#ToolBarDemo
    but i have another class and i make object of toolBar class and i move toolBar icons only how can i move the event handling as open ,save,copy,paste to my another class
    i want to ignore actionPerformed of toolBar class and listen to my another's class actionPerformed
    thanks

    Rather than trying to use the ToolBarDemo class as-is you can use/modify the methods in it for your own class, like this:
    import java.awt.*;
    import java.awt.event.*;
    import java.net.URL;
    import javax.swing.*;
    import javax.swing.text.TextAction;
    public class ToolBarIconTest implements ActionListener
        static final private String OPEN  = "open";
        static final private String SAVE  = "save";
        static final private String COPY  = "copy";
        static final private String PASTE = "paste";
        public void actionPerformed(ActionEvent e)
            String cmd = e.getActionCommand();
            if (OPEN.equals(cmd))
                System.out.println("show a JFileChooser open dialog");
            if (SAVE.equals(cmd))
                System.out.println("show a JFileChooser save dialog");
        private JToolBar getToolBar()
            JToolBar toolBar = new JToolBar();
            addButtons(toolBar);
            return toolBar;
        protected void addButtons(JToolBar toolBar) {
            JButton button = null;
            //first button
            button = makeGeneralButton("Open24", OPEN,
                                       "To open a document",
                                       "Open", this);
            toolBar.add(button);
            //second button
            button = makeGeneralButton("Save24", SAVE,
                                       "To save a document",
                                       "Save", this);
            toolBar.add(button);
            //third button
            button = makeGeneralButton("Copy24", COPY,
                                       "Copy from focused text component",
                                       "Copy", copy);
            toolBar.add(button);
            //fourth button
            button = makeGeneralButton("Paste24", PASTE,
                                       "Paste to the focused text component",
                                       "Paste", paste);
            toolBar.add(button);
        protected JButton makeGeneralButton(String imageName,
                                            String actionCommand,
                                            String toolTipText,
                                            String altText,
                                            ActionListener l) {
            //Look for the image.
            String imgLocation = "toolbarButtonGraphics/general/"
                                 + imageName
                                 + ".gif";
            URL imageURL = ToolBarIconTest.class.getResource(imgLocation);
            //Create and initialize the button.
            JButton button = new JButton();
            button.setActionCommand(actionCommand);
            button.setToolTipText(toolTipText);
            button.addActionListener(l);
            if (imageURL != null) {                      //image found
                button.setIcon(new ImageIcon(imageURL, altText));
            } else {                                     //no image found
                button.setText(altText);
                System.err.println("Resource not found: "
                                   + imgLocation);
            return button;
        private Action copy = new TextAction(COPY)
            public void actionPerformed(ActionEvent e)
                JTextComponent tc = getFocusedComponent();
                int start = tc.getSelectionStart();
                int end = tc.getSelectionEnd();
                if(start == end)
                    tc.selectAll();
                tc.copy();
        private Action paste = new TextAction(PASTE)
            public void actionPerformed(ActionEvent e)
                getFocusedComponent().paste();
        private JPanel getTextFields()
            JPanel panel = new JPanel(new BorderLayout());
            panel.add(new JTextField(12), "North");
            panel.add(new JTextField(12), "South");
            return panel;
        public static void main(String[] args)
            ToolBarIconTest test = new ToolBarIconTest();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(test.getToolBar(), "North");
            f.getContentPane().add(test.getTextFields());
            f.setSize(360,240);
            f.setLocation(200,200);
            f.setVisible(true);
    }Use the -cp option as shown in the ToolBarDemo class comments
    C:\jexp>java -cp .;path_to_jar_file/jlfgr-1_0.jar ToolBarIconTest

  • Event handling operation on other software windows

    Hi friends
    I am able to execute another external program through java code using
    Runtime.getRuntime().exec();
    But now I want to perform Event Handling operation on such a opened external program(software) window.
    Is it possible in Java to perform Event Handling operation on other software windows.
    Thanks

    Can anybody give me some idea. I already gave you hte idea. I told you to write the C++ code to do it. There is no other way. You cannot do that from Java.
    WRT the sockets post:
    whether you use JNI or sockets: the accessing code will still not be written in Java. Hence you still can't do it in Java.

  • Call to pl/sql from java event-handler

    How can I call pl/sql procedure or function from java-script event handler
    Thanks,
    Anna

    Anna,
    You cannot call any arbitrary PLSQL code from the forms, only "standard"/custom event handlers can be called through do_event Javascript fuction, syntax :
    do_event(this.form,this.name,1,'ON_CLICK,'');
    where:
    1 - button intstance, if you have more than one instance of the same button on the screen this should be 2,3,4.....
    'ON_CLICK' - is the predefined event type
    '' - the last argument is any user defined string which will passed down to the PLSQL event handler.
    Thanks,
    Dmitry
    null

  • Event Handling with Java API.: Adding to a hierarchy table throws 2events

    I´m having some problems with the event handling. I´ve registered a Class with extends AbstractDataListener as EventListener. When there are changes in the product hierarchy table, some extra work should be done. However if i add a new record into the hierarchy, two events are fired.
    DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R17;Getra?nke, SEW
    DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R17;32 Zoll, B&R
    DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R18;56 Zoll, Lenze
    DEBUG DataEventListener.java:123 - Added:Development;PRODUCT_HIERARCHY;R18;20 Zoll, allgemein
    In this case, i added the records "32 Zoll, B&R" and then "20 Zoll, allgemein". As you can see in both cases two events are fired and the first event seems to come with wrong data. The reported id for the newly created record is R17. For the logging, i did lookup the entry in the hierarchy table by id and use the displayvalue of the record. But the first event always shows the displayvalue from some already existing entry.
    How can i avoid duplicate events or if this is not possible, how i can recognize that the display value of the first event is not valid.

    I have not tetsted it yet, because I'm waiting for my server to be updated, but SAP told me that the API version 5.5.42.67 should fix the problem.
    Thanks for your post.

  • Java Event Handling in JSP Pages

    Dear All:
    This is what I wanna do. when user enters text in my <input type="text" ... > in my JSP page, I want to take this user entered data and convert it in another language simultaneously as the user is inputting text in another textarea.
    Right now the only choice I have is onChange="convert()" Javascript function.
    But I dont want to use Javascript as I already have a Java class which does that for the Swing GUI client.
    Is their a way i can embed java for event handling in jsp.
    thanks,
    Chetan

    only if you use an applet, javascript, etc.
    remember, jsp is server-side, not client-side
    what the client sees is html or whatever (i.e. static content)

  • *ACTUAL* event handling mechanism in java

    Hi there! Could someone please help me find resources that explain how EXACTLY the event handling mechanism works in java?
    My searches on google and java.sun take me to pages that explain how to code or something close to that. But what I actually want to know is how is all this handled BY Java- how does the event source or VM know how/when to fire and event? how the event is fired? how do objects keep track of the listener objects?...and all the background stuff like that.
    I've downloaded the Java source code, too. But it seems like an ocean to me to wade through. Would be a great help if someone could 'point out the right path'.
    Thank you very much!

    Hi there! Could someone please help me find
    resources that explain how EXACTLY the event
    handling mechanism works in java?My counter question is why do you care how EXACTLY the mechanism works? It works, and that's all most people need to know.
    How it works is an implementation issue, likely to change from release to release, or as more efficient mechanisms are discovered.
    But what I actually want to know is how is all this
    handled BY Java- how does the event source or VM
    know how/when to fire and event?Native peers attached to a component (AWT) or the frame (Swing) notify Java that an event has occurred in some way. (This will likely change somewhat from platform to platform)
    An AWTEvent is created to represent the native event (Swing requiring more overhead to locate the source of the event) which is added to the EventQueue.
    how the event is fired? how do objects keep track of
    the listener objects?...and all the background stuff like
    that.The above is done on a native thread - not the event thread. The event thread is sitting in the event queue waiting for an event to come along. It processes events in the queue and sends them to the object which "generated" them. This object informs each of its listeners in turn about the event.
    Objects keep track of listeners however they want. AWT objects seem to use java.awt.AWTEventMulticaster. Swing objects seem to use an javax.swing.event.EventListenerList. I tend to use multiple ArrayLists.
    Note that native events are sent through the EventQueue because they originate from non-event-thread threads. Often when specialising events, in particular sending custom events in response to, say, a button press, the event firing will be done in-place, since it is already in the event thread. Custom events that originate from outside the event thread are customarily added to the EventQueue with EventQueue.invokeLater or invokeAndWait.
    This is from inspection of the Java 1.3 source (specifically java.awt.Button and javax.swing.JComponent) and knowledge of the APIs.

  • Force to java to listen events

    My problem is this: when When i�m executing certain loop in my application, the JVM doesn�t listen the events that occurs (that is, the actionPerformed method isn�t invocated when i push a JButton). When the loop finished, the problem dissapear. �Anybody knows some call that force to java to listen events?. I�ve tried to implement this loop in a thread but the problem doesn�t dissapear.
    Thanks.

    if the loop is started from a gui event handler, take a look at SwingUtilities.invokeLater() method
    Nic

  • Java.sql.SQLException: statement handle not executed

    hello,
    i am calling a stored procedure and its returns a REF CURSOR and i am getting intermittent exceptions below,
    org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute query; uncategorized SQLException for SQL [{call
    xxxx_pkg(?,?)}]; SQL state [99999]; error code [17144]; statement handle not executed; nested exception is java.sql.SQLException: statement handle not executed
    and
    org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute query; uncategorized SQLException for SQL [{call
    xxxx_pkg(?,?,?)}]; SQL state [99999]; error code [17009]; Closed Statement; nested exception is java.sql.SQLException: Closed Statement
    any clue what could be the issue,
    Regards
    GG

    its pretty simple have a java class calling hibernateTemplate's findByNamedQueryAndNamedParam method by passing the procedure name and binding parameters/values, and here is the stack
    org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute query; uncategorized SQLException for SQL [{call
    xxx_pkg(?,?)}]; SQL state [99999]; error code [17144]; statement handle not executed; nested exception is java.sql.SQLException: statement handle not executed
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
    at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
    at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
    at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
    at org.springframework.orm.hibernate3.HibernateTemplate.findByNamedQueryAndNamedParam(HibernateTemplate.java:1006)
    Caused by: java.sql.SQLException: statement handle not executed
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:229)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:403)
    at oracle.jdbc.driver.T4CStatement.doDescribe(T4CStatement.java:701)
    at oracle.jdbc.driver.OracleStatement.getColumnIndex(OracleStatement.java:3355)
    at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:2009)
    at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:494)
    at org.hibernate.type.StringType.get(StringType.java:18)
    at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163)
    at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154)
    at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
    at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2091)
    at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1380)
    at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1308)
    at org.hibernate.loader.Loader.getRow(Loader.java:1206)
    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:580)
    at org.hibernate.loader.Loader.doQuery(Loader.java:701)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
    at org.hibernate.loader.Loader.doList(Loader.java:2217)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2108)
    at org.hibernate.loader.Loader.list(Loader.java:2103)
    at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
    at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1696)
    at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
    at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
    at org.springframework.orm.hibernate3.HibernateTemplate$34.doInHibernate(HibernateTemplate.java:1015)
    at org.springframework.orm.hibernate3.HibernateTemplate$34.doInHibernate(HibernateTemplate.java:1)
    at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)

  • Java.io.StreamCorruptedException: illegal handle value

    Hi
    I am using Oracle Coherence 3.3 in my application. I my application we are taking the objects from Webservices and storing them in the Cache(Replicated). And then retrieve them from the Cache.
    But now on our application Linux server we are getting "java.io.StreamCorruptedException: illegal handle value"
    Can anybody tell the reason of this. I am not sure whether it is a Coherence issue.
    The log of error which i am getting is this. Please do reply. Its really urgent.
    [6/7/08 11:23:36:287 EDT] 00004442 SystemErr R (Wrapped: CacheName=UMAChannelZipCache, Key=44120) java.io.StreamCorruptedException: illegal handle value
         at java.io.ObjectInputStream.readHandle(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
         at java.util.HashMap.readObject(HashMap.java(Compiled Code))
         at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
         at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
         at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java(Compiled Code))
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
         at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
         at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
         at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
         at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
         at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
         at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
         at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
         at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
         at java.util.TreeMap.buildFromSorted(TreeMap.java(Inlined Compiled Code))
         at java.util.TreeMap.readTreeSet(TreeMap.java(Inlined Compiled Code))
         at java.util.TreeSet.readObject(TreeSet.java(Compiled Code))
         at sun.reflect.GeneratedMethodAccessor167.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
         at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
         at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java(Compiled Code))
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
         at java.util.HashMap.readObject(HashMap.java(Compiled Code))
         at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
         at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
         at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java(Compiled Code))
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java(Compiled Code))
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
         at com.tangosol.util.ExternalizableHelper.readSerializable(ExternalizableHelper.java(Inlined Compiled Code))
         at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java(Compiled Code))
         at com.tangosol.coherence.component.net.Message.readObject(Message.CDB(Inlined Compiled Code))
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.ReplicatedCache$ConverterFromInternal.convert(ReplicatedCache.CDB(Compiled Code))
         at com.tangosol.coherence.component.util.CacheHandler.getCachedResource(CacheHandler.CDB(Compiled Code))
         at com.tangosol.coherence.component.util.CacheHandler.get(CacheHandler.CDB(Compiled Code))
         at com.tangosol.coherence.component.util.SafeNamedCache.get(SafeNamedCache.CDB(Compiled Code))
         at com.att.uma.cache.ChannelCacheManager.checkCacheByZip(ChannelCacheManager.java(Compiled Code))
         at com.att.uma.channel.UMAChannelServices.getChannelsByZip(UMAChannelServices.java(Compiled Code))
         at com.att.uma.channel.RetrieveChannelLineup.performTask(RetrieveChannelLineup.java(Compiled Code))
         at com.att.uma.channel.RetrieveChannelLineup.doPost(RetrieveChannelLineup.java(Compiled Code))
         at com.att.uma.channel.RetrieveChannelLineup.doGet(RetrieveChannelLineup.java(Compiled Code))
         at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
         at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java(Compiled Code))
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java(Compiled Code))
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java(Compiled Code))
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java(Compiled Code))
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java(Compiled Code))
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java(Compiled Code))
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java(Compiled Code))
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java(Compiled Code))
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java(Compiled Code))
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))

    Hi user628020,
    Since you are using standard Java serialization, the only two reasons I can think of are:
    1) a bug in serialization routines for any of the classes your objects use (e.g. TreeMap)
    2) concurrent modification of the same object by another thread at the same time
    With urgent support questions I would suggest using the Oracle Metalink.
    Regards,
    Gene

  • Java API for Error Handling

    There are some common error tables storing error IDs information ( IDs like error type, project id, interface id, message id etc.) in Operational Database (is not on source or target system) which we have to update using java API. We need to call java API (java code) whenever error occurs. We have to provide all the IDs to this function and then API will take care of DB updating. We can call java API in mapping program by creating user-defined java function, this will trap all the errors which are in source file as well as in mapping and mapping lookup. Query is:
    A-      A- Do we have any other place after the mapping to call this java API and trap the errors through it?
    B-      Can we call Java API using BPM and pass error IDs to it.

    Hi Anand,
    You Have to write Module For that(if you wanna call Java API after Mapping)at the receiver.
    To write Module Here is a link which will help you in.....
    ==>http://help.sap.com/saphelp_nw04s/helpdata/en/84/2e3842cd38f83ae10000000a1550b0/frameset.htm
    ==>http://help.sap.com/saphelp_nw04s/helpdata/en/e4/6019419efeef6fe10000000a1550b0/frameset.htm
    ==>http://help.sap.com/saphelp_nw04s/helpdata/en/f4/0a1640a991c742e10000000a1550b0/frameset.htm
    Enjoy Coding....:)
    Regards,
    Sundararamaprasad.

  • How can I execute an external program from within a button's event handler?

    I am using Tomcat ApacheTomcat 6.0.16 with Netbeans 6.1 (with the latest JDK/J2EE)
    I need to execute external programs from an event handler for a button on a JSF page (the program is compiled, and extremely fast compared both to plain java and especially stored procedures written in SQL).
    I tried what I'd do in a standalone program (as shown in the appended code), but it didn't work. Instead I received text saying the program couldn't be found. This error message comes even if I try the Windows command "dir". I thought with 'dir' I'd at least get the contents of the current working directory. :-(
    I can probably get by with cgi on Apache's httpd server (or, I understand tomcat supports cgi, but I have yet to get that to work either), but whatever I do I need to be able to do it from within the button's event handler. And if I resort to cgi, I must be able to maintain session jumping from one server to the other and back.
    So, then, how can I do this?
    Thanks
    Ted
    NB: The programs that I need to run do NOT take input from the user. Rather, my code in the web application processes user selections from selection controls, and a couple field controls, sanitizes the inoputs and places clean, safe data in a MySQL database, and then the external program I need to run gets safe data from the database, does some heavy duty number crunching, and puts the output data into the database. They are well insulated from mischeif.
    NB: In the following array_function_test.pl was placed in the same folder as the web application's jsp pages, (and I'd tried WEB-INF - with the same result), and I DID see the file in the application's war file.
            try {
                java.lang.ProcessBuilder pn = new java.lang.ProcessBuilder("array_function_test.pl");
                //pn.directory(new java.io.File("K:\\work"));
                java.lang.Process pr = pn.start();
                java.io.BufferedInputStream bis = (java.io.BufferedInputStream)pr.getInputStream();
                String tmp = new String("");
                byte b[] = new byte[1000];
                int i = 0;
                while (i != -1) {
                    bis.read(b);
                    tmp += new String(b);
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + tmp);
            } catch (java.io.IOException ex) {
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + ex.getMessage());
            }

    Hi Fonsi!
    One way to execute an external program is to use the System Exec.vi. You find it in the functions pallet under Communication.
    /Thomas

  • Swing: when trying to get the values from a JTable inside an event handler

    Hi,
    I am trying to write a graphical interface to compute the Gauss Elimination procedure for solving linear systems. The class for computing the output of a linear system already works fine on console mode, but I am fighting a little bit to make it work with Swing.
    I put two buttons (plus labels) and a JTextField . The buttons have the following role:
    One of them gets the value from the JTextField and it will be used to the system dimension. The other should compute the solution. I also added a JTable so that the user can type the values in the screen.
    So whenever the user hits the button Dimensiona the program should retrieve the values from the table cells and pass them to a 2D Array. However, the program throws a NullPointerException when I try to
    do it. I have put the code for copying this Matrix inside a method and I call it from the inner class event handler.
    I would thank you very much for the help.
    Daniel V. Gomes
    here goes the code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import AdvanceMath.*;
    public class MathF2 extends JFrame {
    private JTextField ArrayOfFields[];
    private JTextField DimOfSis;
    private JButton Calcular;
    private JButton Ativar;
    private JLabel label1;
    private JLabel label2;
    private Container container;
    private int value;
    private JTable DataTable;
    private double[][] A;
    private double[] B;
    private boolean dimensionado = false;
    private boolean podecalc = false;
    public MathF2 (){
    super("Math Calcs");
    Container container = getContentPane();
    container.setLayout( new FlowLayout(FlowLayout.CENTER) );
    Calcular = new JButton("Resolver");
    Calcular.setEnabled(false);
    Ativar = new JButton("Dimensionar");
    label1 = new JLabel("Clique no bot�o para resolver o sistema.");
    label2 = new JLabel("Qual a ordem do sistema?");
    DimOfSis = new JTextField(4);
    DimOfSis.setText("0");
    JTable DataTable = new JTable(10,10);
    container.add(label2);
    container.add(DimOfSis);
    container.add(Ativar);
    container.add(label1);
    container.add(Calcular);
    container.add(DataTable);
    for ( int i = 0; i < 10 ; i ++ ){
    for ( int j = 0 ; j < 10 ; j++) {
    DataTable.setValueAt("0",i,j);
    myHandler handler = new myHandler();
    Calcular.addActionListener(handler);
    Ativar.addActionListener(handler);
    setSize( 500 , 500 );
    setVisible( true );
    public static void main ( String args[] ){
    MathF2 application = new MathF2();
    application.addWindowListener(
    new WindowAdapter(){
    public void windowClosing (WindowEvent event)
    System.exit( 0 );
    private class myHandler implements ActionListener {
    public void actionPerformed ( ActionEvent event ){
    if ( event.getSource()== Calcular ) {
    if ( event.getSource()== Ativar ) {
    //dimensiona a Matriz A
    if (dimensionado == false) {
    if (DimOfSis.getText()=="0") {
    value = 2;
    } else {
    value = Integer.parseInt(DimOfSis.getText());
    dimensionado = true;
    Ativar.setEnabled(false);
    System.out.println(value);
    } else {
    Ativar.setEnabled(false);
    Calcular.setEnabled(true);
    podecalc = true;
    try {
    InitValores( DataTable, value );
    } catch (Exception e) {
    System.out.println("Erro ao criar matriz" + e );
    private class myHandler2 implements ItemListener {
    public void itemStateChanged( ItemEvent event ){
    private void InitValores( JTable table, int n ) {
    A = new double[n][n];
    B = new double[n];
    javax.swing.table.TableModel model = table.getModel();
    for ( int i = 0 ; i < n ; i++ ){
    for (int j = 0 ; j < n ; j++ ){
    Object temp1 = model.getValueAt(i,j);
    String temp2 = String.valueOf(temp1);
    A[i][j] = Double.parseDouble(temp2);

    What I did is set up a :
    // This code will setup a listener for the table to handle a selection
    players.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    ListSelectionModel rowSM = players.getSelectionModel();
    rowSM.addListSelectionListener(new Delete_Player_row_Selection(this));
    //Class will take the event and call a method inside the Delete_Player object.
    class Delete_Player_row_Selection
    implements javax.swing.event.ListSelectionListener
    Delete_Player adaptee;
    Delete_Player_row_Selection (Delete_Player temp)
    adaptee = temp;
    public void valueChanged (ListSelectionEvent listSelectionEvent)
    adaptee.row_Selection(listSelectionEvent);
    in the row_Selection function
    if(ex.getValueIsAdjusting()) //To remove double selection
    return;
    ListSelectionModel lsm = (ListSelectionModel) ex.getSource();
    if(lsm.isSelectionEmpty())
    System.out.println("EMtpy");
    else
    int selected_row = lsm.getMinSelectionIndex();
    ResultSetTableModel model = (ResultSetTableModel) players.getModel();
    String name = (String) model.getValueAt(selected_row, 1);
    Integer id = (Integer) model.getValueAt(selected_row, 3);
    This is how I got info out of a table when the user selected it

Maybe you are looking for

  • Sending email using DirectEmail including inline images?

    I need Director to send an email with images using the DirectEmail Xtra. The email format is HTML. When I've done this in the past I've always linked the images via a URL from my own server. This time around the images must be embedded into the email

  • Since upgrading to 10.1 the slider bar under the timeline has disappeared. How do i get it back?

    The slider bar is no longer visible. When using the timeline I have to either use the zoom or the  play head to navigate through my project. Anyone know how to make it visible?

  • Floating inactive photos behind photoshop window in CS6 for Mac

    My inactive photos go behind the active CS6 Photoshop window on my Mac.  This forces me to minimize Photoshop and then get the inactive photos and drag them back into Photoshop. This makes it awkward for layering photos.  Any suggestions how to corre

  • A page layout

    Hello all, I need to create a page that is compound from a wide and a narrow part. When I created a page I chose such a layout. The problem is that I need the narrow part to be more narrow. How can I do that? Thanks for your time, Varda.

  • Adjustment Brush being picky

    So in camera RAW CC, (and I've had this happen in CS6), I'm pretty sure I pressed the wrong key somewhere, and now my brush is being "selective" on which areas it affects. I'd like it to go back to simply affecting the area (with feather effect) norm