To handle Exception in CO and AM from navigation to Next option

Hi..
I have built one OA page..
I have used follwing code throw new OAException("PER","<Message_Name>",null,OAException.INFORMATION,null);
It gives error as
Information - Unexpected Error. Contact System Administrator
and allows user to go ahead.
But this error doesnt stop from navigatin.Its just like FYI.
Can I use throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
getEntityDef().getName(), // EO name
getPrimaryKey(), // EO PK
"OverTimeType", // Attribute Name
ReturnValue1, // Attribute value
"PER", // Message product short name
"Message_Name"); // Message name
But getEntityDef().getName(), getPrimaryKey() cannot be used from co.
I want to stop user from navigatiing till it changes the value to resolve the error.
Same happens when I throw error from AM.
I want that when user enter date, and it is invalid, then immeditaely he should get an error and he should not be ablt to move on next tab until it enters correct and valid date..
Plesae let me know if anyone has done same
Thansk in advance,
Nisha

Hi..
Thanks for help.
For some cases I am validating at attribute level so am throwing error at EO level. But at EO level also, say I have 5 fields, in which first field is date. I have put one validation in EO if eneterd date is after sysdate then I ma throwing error as
if (startDate > sysdate)
throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
getEntityDef().getName(), // EO name
getPrimaryKey(), // EO PK
"TripFrom", // Attribute Name
value, // Attribute value
"PER", // Message product short name
"HG_HR_OT_MSG_15"); // Message name
} where startDate is entered date.
Here If I enter invalid date then it doesnt throw erroe immediately, it allows me to enter details in other fields and when I click on submit buuton, which stores data in database , it throws error.
Is there any way by which I can throw erro immediatley after entering invalid value and it doesn not allow me to go on next filed till i enter correct value in first field.

Similar Messages

  • Handling exceptions of third party modules

    Hello,
    could you please help with handling exceptions in a right way from third party modules such as Smaato Advertising, how and where I can handle these exceptions to prevent app crash? One developer said his app sometimes crashes because of Smaato's
    module and he decided to delete it.

    Try to handle the exception in the
    Application.UnhandledException event.
    Ugly but should work.

  • Handle Exception from LCDS

    Hello,
    I am using Flex 4 with LCDS 3. I am having problems with properly handling 
    exceptions. 
    I have a simple commit service like; 
    var commitToken:AsyncToken = 
    _serviceName.serviceControl.commit(); // Commit the change. 
    commitToken.addResponder(new AsyncResponder( 
    function (event:ResultEvent, 
    token:Object=null):void 
    Alert.show("DATA DELETED"); 
    function (event:FaultEvent, 
    token:Object=null):void 
    Alert.show("Save failed: " + 
    event.fault.faultString, "Error"); 
    _serviceName.serviceControl.revertChanges(); 
    Now when I try to delete a row which has a child record I get the following 
    error in my tomcat log; 
    hdr(DSEndpoint) = my-rtmp 
    hdr(DSId) = 9AFF219A-AB2A-3B60-D990-9E87A3D7CF71 
    java.lang.RuntimeException: Hibernate jdbc exception on operation=deleteItem 
    error=Could not execute JDBC batch update : sqlError = from SQLException: 
    java.sql.BatchUpdateException: ORA-02292: integrity constraint (CATEGORY_FK) 
    violated - child record found 
    followed by; 
    [LCDS]Serializing AMF/RTMP response 
    Version: 3 
    (Command method=_error (0) trxId=10.0) 
    (Typed Object #0 'flex.messaging.messages.ErrorMessage') 
    rootCause = (Typed Object #1 'org.omg.CORBA.BAD_INV_ORDER') 
    minor = 0 
    localizedMessage = "The Servant has not been associated with an ORB 
    instance" 
    message = "The Servant has not been associated with an ORB instance" 
    cause = null 
    completed = (Typed Object #2 'org.omg.CORBA.CompletionStatus') 
    destination = "CATEGORY" 
    headers = (Object #3) 
    correlationId = "D4B6573F-F8C2-0732-BD1C-6FD1C5979763" 
    faultString = "Error occurred completing a transaction" 
    messageId = "9AFF6D9A-3C1C-E99B-B00F-92E72069B64E" 
    faultCode = "Server.Processing" 
    timeToLive = 0.0 
    extendedData = null 
    faultDetail = null 
    clientId = "C2F15FE1-2977-23AA-1ADD-6FD1C096A82F" 
    timestamp = 1.281776280572E12 
    body = null 
    In flex in my "event" in the fault function I can only get general data like 
    "Error occurred completing a transaction", but I cannot access the error 
    "ORA-02292:...". 
    Is there a way to access it, as I need to handle multiple exceptions that Oracle 
    will catch such as duplicate ID.....

    Hi Hong,
    I can confirm that 0xE8010014 represents a driver fault. Unfortunately without a dump or some other trace file it is hard to track this down. You could create a dump file if you can reproduce it, upload it to your OneDrive and then post the link here, I
    can grab it and take a look.
    >>This is reported by users. Unfortunately I am unable to reproduce it.
    Could you please collect the OS version which have this issue?
    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.

  • Handling exceptions from Future/FutureTask.get()  : a question

    Hello.
    While trying to understand the way (possible) exceptions from Future/FutureTask.get() method can be handled, I found the following example on how this could be done:
    [http://www.javaconcurrencyinpractice.com/listings.html]
    * StaticUtilities
    * @author Brian Goetz and Tim Peierls
    public class LaunderThrowable {
         * Coerce an unchecked Throwable to a RuntimeException
         * <p/>
         * If the Throwable is an Error, throw it; if it is a
         * RuntimeException return it, otherwise throw IllegalStateException
        public static RuntimeException launderThrowable(Throwable t) {
            if (t instanceof RuntimeException)
                return (RuntimeException) t;                // Line #1
            else if (t instanceof Error)
                throw (Error) t;                                    // Line #2
            else
                throw new IllegalStateException("Not unchecked", t);// Line #3
    }And here is an example on how this handler is supposed to be used:
    * Preloader
    * Using FutureTask to preload data that is needed later
    * @author Brian Goetz and Tim Peierls
    public class Preloader
        ProductInfo loadProductInfo() throws DataLoadException {
            return null;
        private final FutureTask<ProductInfo> future =
            new FutureTask<ProductInfo>(new Callable<ProductInfo>() {
                public ProductInfo call() throws DataLoadException {
                    return loadProductInfo();
        private final Thread thread = new Thread(future);
        public void start() { thread.start(); }
        public ProductInfo get()
        throws DataLoadException, InterruptedException
            try {
                return future.get();
            } catch (ExecutionException e) {
                Throwable cause = e.getCause();
                if (cause instanceof DataLoadException)
                    throw (DataLoadException) cause;
                else
                    throw LaunderThrowable.launderThrowable(cause);
        interface ProductInfo {  }
    class DataLoadException extends Exception { }Everything is clear in general, except for one thing:
    Why is the LaunderThrowable.launderThrowable() method re-throws Error and IllegalStateException (Line #2 and #3 above) and just returns RuntimeException (Line #1)? Especially taking into consideration that whatever is returned from launderThrowable() is re-thrown in any case...
    Any ideas?
    Thanks.

    ...Why is the LaunderThrowable.launderThrowable() method re-throws Error and IllegalStateException (Line #2 and #3 above) and just returns RuntimeException (Line #1)?this is explained in the end of paragraph [5.5.2. FutureTask|http://www.javaconcurrencyinpractice.com/]:
    +"...When get throws an ExecutionException in Preloader, the cause will fall into one of three categories: a checked exception thrown by the Callable, a RuntimeException, or an Error. We must handle each of these cases separately, but we will use the launderThrowable utility method in Listing 5.13 to encapsulate some of the messier exception-handling logic. Before calling launderThrowable, Preloader tests for the known checked exceptions and rethrows them. That leaves only unchecked exceptions, which Preloader handles by calling launderThrowable and throwing the result. If the Throwable passed to launderThrowable is an Error, launderThrowable rethrows it directly; if it is not a RuntimeException, it throws an IllegalStateException to indicate a logic error. That leaves only RuntimeException, which launderThrowable returns to its caller, and which the caller generally rethrows..."+
    ...Especially taking into consideration that whatever is returned from launderThrowable() is re-thrown in any case...As far as I understand, assumption about re-throwing in any case is not quite correct. launderThrowable is intended to be a general utility, #) so it leaves a way for client to handle the returned value in a way different from re-throwing.
    #) intended to be a general utility -- launderThrowable is used not only in Preloader, but in [other listings|http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fwww.javaconcurrencyinpractice.com%2Flistings+launderThrowable] as well

  • Hi I have 2 apple id's one which has pulled through everything except my calendars and one which has pulled through just my calendars. How do I move my calendars from one apple id to another?

    Hi I have 2 apple id's one which has pulled through everything into icloud except my calendars and one which has pulled through just my calendars. How do I move my calendars from one apple id to another so that I can see everything in icloud with one apple id?

    Having read some other posts I think I have answered my question. If I was somehow able to terminate my old (unwanted) account and Apple ID I would no longer be able to access the material I bought with that ID-  so I'm stuck. I have to learn how to manage that situation.
    This is unfortunate for Apple consumers. Life is complicated for families these days and this "rule" although it is in place to prevent cheating and fraud makes things unnnecessarily difficult for me and my family as in my niaevity (sic) with the online world I bumbled into this situation. Not everyone is out to rip off Apple - one of the worlds richest corporations- or the entertainers who market their work through iTunes.I would just like to be able to enjoy the entertainment I pay for where and when I like to on whichever computer is available to me. And I'm not terribly computer literate.   
    It would have been nice to have had the opportunity to speak just once to a real person in the employ of Apple to explain my situation to them.

  • I have paid for itunes match and have now lost all my music of my iphone except what I paid for from itunes, 964 songs gone not at all happy.  Can anyone help

    I have paid for itunes match and have now lost all my music off my iphone except what I paid for from itunes, 964 songs gone into the cloud. Can anyone help please?

    Enabling iTunes Match does not delete music from your computer. Why do you think it is now not in the iTunes library if it was before? If all of your music was in the iTunes library then it is also now in the cloud if iTunes has completed it's scan and all the music meets the match requirements. Enable the iCloud Status column in the iTunes browser by switching to Song view and pulling down View > View Options. Select iCloud Status then close the small window. Sort on the new column. Your music should be listed as "purchased," "matched" and "uploaded." Some tracks may be "ineligible." Post back and let us know.

  • While updating my iphone 4s to ios6, I had to restore it. Now every time I connect to itunes, I get the "Set Up Your iPhone" window with the set up as new iphone and restore from backup options. After the restore, I got everything except my apps back.

    While updating my iphone 4s to ios6, I had to restore it. Now every time I connect to itunes, I get the "Set Up Your iPhone" window with the set up as new iphone and restore from backup options. After the restore, I got everything except my apps and music back. Do I need to set the phone up as new again?

    Hi Vidbrent,
    If you are having issues updating or restoring your iPhone, you may find the following article helpful:
    Apple Support: If you can't update or restore your iOS device
    http://support.apple.com/kb/ht1808
    Regards,
    - Brenden

  • I just migrate settings and software from my PowerBook to a new Mac Pro. All the software download from CC is there and working, except for CC, and there is not way to install.

    I just migrate settings and software, include CC, from my PowerBook to a new Mac Pro. All the software download from CC is there and working, except for CC, and there is not way to install. I have try because every time I restar keep bothering asking for installation, (by the way, the link is not up to date). Will appreciate your help.

    never migrate adobe software.  it should be properly installed.
    uninstall all the cc programs you can, clean and then reinstall per, Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6

  • Just setting up my iphone 5, and its syncing everything from my previous iphone, except my photos and text messages. Ive been trying to fix this now for about 4-5 hours. Help!!!!!!

    So, I backed up my iphone 4. Set up my iphone 5, pressed sync and it did its job. However, its seems to have synced everything except my photos and text messages. Basically the most things I use on my phone! Ive searched for solutions all over the internet, tried them all and still no luck. this is driving me crazy, been working on it for hours now. someone please help!
    Much appreciated

    You do not sync text messages.
    Did you restore the iPhone 5 from a backup of your old phone?
    If not, do so to put everything back.  This is assuming you want/need you sms messages.
    Pictures should already be on the computer, then they can be synced to the device.

  • HT1349 I have suddenly lost the whole of my iTunes library, with the exception of music that I have bought and downloaded from iTunes Store.  It was all there yesterday and I haven't altered anything, as far as I know!

    I have suddenly lost the whole of my iTunes library, with the exception of music that I have bought and downloaded from iTunes Store.  It was all there yesterday and I haven't altered anything, as far as I know!  I hope it's something quite simple?
    Apologies, but none of the communities listed seems to fit this question - so I'm taking pot luck!

    For music that you've purchased from Apple that are on your iPhone you should be able to copy to your computer's iTunes via File > Transfer Purchases. Also if you are in the US then you should be able to re-download past music purchases for free : http://support.apple.com/kb/HT2519
    For your own music that you've copied, then if you haven't got a backup on, for example, external drives or CDs/DVDs then you could see if any of the utilities mentioned in this old post still exist and work

  • What is wrong? The "show my windows and tabs from last time" has not been working these past two or three days. It was fine before. Ive changed nothing except the last update from you. Thank you.

    What is wrong? The "show my windows and tabs from last time" has not been working these past two or three days. It was fine before. Ive changed nothing except the last update from you. Thank you.

    Make sure that you do not use "Clear Recent History" to clear the "Browsing History" when Firefox is closed because that prevails and prevents Firefox from opening tabs from the previous session.
    * https://support.mozilla.com/kb/Clear+Recent+History
    It is possible that there is a problem with the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    Delete the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    * Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    * http://kb.mozillazine.org/Session_Restore
    * http://kb.mozillazine.org/sessionstore.js
    If you use cleanup software like CCleaner then make sure that Session is unchecked in the settings for the Firefox application.

  • Problem with ArrayLists and writing and reading from a .dat file (I think)

    I'm brand new to this forum, but I'm sure hoping someone can help me with a problem I'm having with ArrayLists. This program was originally created with an array of objects that were displayed on a GUI with jtextFields, then cycling thru them via jButtons: First, Next, Previous, Last. Now I need to add the ability to modify, delete and add records. Both iterations of this program needed to write to and read from a .dat file.
    It worked just like it was suppose to when I used just the array, but now I need to use a "dynamic array" that will grow or shrink as needed: i.e. an ArrayList.
    When I aded the ArrayList I had the ArrayList use toArray() to fill my original array so I could continue to use all the methods I'd created for using with my array. Now I'm getting a nullPointerException every time I try to run my program, which means somewhere I'm NOT filling my array ???? But, I'm writing just fine to my .dat file, which is confusing me to no end!
    It's a long program, and I apologize for the length, but here it is. There are also 2 class files, a parent and 1 child below Inventory6. This was written in NetBeans IDE 5.5.1.
    Thank you in advance for any help anyone can give me!
    LabyBC
    package my.Inventory6;
    import java.awt.Container;
    import java.awt.Dimension;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.text.DecimalFormat;
    import javax.swing.JOptionPane;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import java.io.*;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.lang.IllegalStateException;
    import java.util.NoSuchElementException;
    import java.util.ArrayList;
    import java.text.NumberFormat;
    // Class Inventory6
    public class Inventory6 extends javax.swing.JFrame {
    private static InventoryPlusColor[] inventory;
    private static ArrayList inList;
    // create a tool that insure the specified format for a double number, when displayed
    private DecimalFormat doubleFormat = new DecimalFormat( "0.00" );
    private DecimalFormat singleFormat = new DecimalFormat( "0");
    // the index within the array of products of the current displayed product
    private int currentProductIndex;
    /** Creates new form Inventory6 */
    public Inventory6() {
    initComponents();
    currentProductIndex = 0;
    } // end Inventory6()
    private static InventoryPlusColor[] getInventory() {
    ArrayList<InventoryPlusColor> inList = new ArrayList<InventoryPlusColor>();
    inList.add(new InventoryPlusColor(1, "Couch", 3, 1250.00, "Blue"));
    inList.add(new InventoryPlusColor(2, "Recliner", 10, 525.00, "Green"));
    inList.add(new InventoryPlusColor(3, "Chair", 6, 125.00, "Mahogany"));
    inList.add(new InventoryPlusColor(4, "Pedestal Table", 2, 4598.00, "Oak"));
    inList.add(new InventoryPlusColor(5, "Sleeper Sofa", 4, 850.00, "Yellow"));
    inList.add(new InventoryPlusColor(6, "Rocking Chair", 2, 459.00, "Tweed"));
    inList.add(new InventoryPlusColor(7, "Couch", 4, 990.00, "Red"));
    inList.add(new InventoryPlusColor(8, "Chair", 12, 54.00, "Pine"));
    inList.add(new InventoryPlusColor(9, "Ottoman", 3, 110.00, "Black"));
    inList.add(new InventoryPlusColor(10, "Chest of Drawers", 5, 598.00, "White"));
    for (int j = 0; j < inList.size(); j++)
    System.out.println(inList);
    InventoryPlusColor[] inventory = (InventoryPlusColor[]) inList.toArray
    (new InventoryPlusColor[inList.size()]);
    return inventory;
    } // end getInventory() method
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents() {
    jPanel1 = new javax.swing.JPanel();
    IDNumberLbl = new javax.swing.JLabel();
    IDNumberField = new javax.swing.JTextField();
    prodNameLbl = new javax.swing.JLabel();
    prodNameField = new javax.swing.JTextField();
    colorLbl = new javax.swing.JLabel();
    colorField = new javax.swing.JTextField();
    unitsInStockLbl = new javax.swing.JLabel();
    unitsInStockField = new javax.swing.JTextField();
    unitPriceLbl = new javax.swing.JLabel();
    unitPriceField = new javax.swing.JTextField();
    invenValueLbl = new javax.swing.JLabel();
    invenValueField = new javax.swing.JTextField();
    restockingFeeLbl = new javax.swing.JLabel();
    restockingFeeField = new javax.swing.JTextField();
    jbtFirst = new javax.swing.JButton();
    jbtNext = new javax.swing.JButton();
    jbtPrevious = new javax.swing.JButton();
    jbtLast = new javax.swing.JButton();
    jbtAdd = new javax.swing.JButton();
    jbtDelete = new javax.swing.JButton();
    jbtModify = new javax.swing.JButton();
    jbtSave = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    searchIDNumLbl = new javax.swing.JLabel();
    searchIDNumbField = new javax.swing.JTextField();
    jbtSearch = new javax.swing.JButton();
    searchResults = new javax.swing.JLabel();
    jbtExit = new javax.swing.JButton();
    jbtExitwoSave = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Inventory Program"));
    IDNumberLbl.setText("ID Number");
    IDNumberField.setEditable(false);
    prodNameLbl.setText("Product Name");
    prodNameField.setEditable(false);
    colorLbl.setText("Product Color");
    colorField.setEditable(false);
    colorField.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    colorFieldActionPerformed(evt);
    unitsInStockLbl.setText("Units In Stock");
    unitsInStockField.setEditable(false);
    unitPriceLbl.setText("Unit Price $");
    unitPriceField.setEditable(false);
    invenValueLbl.setText("Inventory Value $");
    invenValueField.setEditable(false);
    restockingFeeLbl.setText("5% Restocking Fee $");
    restockingFeeField.setEditable(false);
    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel1Layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(unitPriceLbl)
    .addComponent(unitsInStockLbl)
    .addComponent(colorLbl)
    .addComponent(prodNameLbl)
    .addComponent(IDNumberLbl)
    .addComponent(restockingFeeLbl)
    .addComponent(invenValueLbl))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(IDNumberField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
    .addComponent(prodNameField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
    .addComponent(colorField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
    .addComponent(unitsInStockField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
    .addComponent(unitPriceField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
    .addComponent(restockingFeeField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE)
    .addComponent(invenValueField, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE))
    .addContainerGap())
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel1Layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(IDNumberLbl)
    .addComponent(IDNumberField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(prodNameLbl)
    .addComponent(prodNameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(colorField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(colorLbl))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(unitsInStockField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(unitsInStockLbl))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(unitPriceField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(unitPriceLbl))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(restockingFeeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(restockingFeeLbl))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE)
    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(invenValueField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(invenValueLbl))
    .addContainerGap())
    jbtFirst.setText("First");
    jbtFirst.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtFirstActionPerformed(evt);
    jbtNext.setText("Next");
    jbtNext.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtNextActionPerformed(evt);
    jbtPrevious.setText("Previous");
    jbtPrevious.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtPreviousActionPerformed(evt);
    jbtLast.setText("Last");
    jbtLast.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtLastActionPerformed(evt);
    jbtAdd.setText("Add");
    jbtAdd.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtAddActionPerformed(evt);
    jbtDelete.setText("Delete");
    jbtModify.setText("Modify");
    jbtModify.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtModifyActionPerformed(evt);
    jbtSave.setText("Save");
    jbtSave.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtSaveActionPerformed(evt);
    jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Search by:"));
    searchIDNumLbl.setText("Item Number:");
    jbtSearch.setText("Search");
    searchResults.setFont(new java.awt.Font("Tahoma", 1, 12));
    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
    jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel2Layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(searchIDNumLbl)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel2Layout.createSequentialGroup()
    .addGap(259, 259, 259)
    .addComponent(searchResults, javax.swing.GroupLayout.PREFERRED_SIZE, 213, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(jbtSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(searchIDNumbField, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)))
    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    jPanel2Layout.setVerticalGroup(
    jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel2Layout.createSequentialGroup()
    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(searchIDNumLbl)
    .addComponent(searchIDNumbField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel2Layout.createSequentialGroup()
    .addGap(32, 32, 32)
    .addComponent(searchResults, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addGroup(jPanel2Layout.createSequentialGroup()
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jbtSearch)))
    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    jbtExit.setText("Save and Exit");
    jbtExit.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtExitActionPerformed(evt);
    jbtExitwoSave.setText("Exit");
    jbtExitwoSave.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jbtExitwoSaveActionPerformed(evt);
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 44, Short.MAX_VALUE)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
    .addComponent(jbtExitwoSave, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addComponent(jbtExit)))
    .addGroup(layout.createSequentialGroup()
    .addComponent(jbtFirst)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jbtNext)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jbtPrevious)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jbtLast))
    .addGroup(layout.createSequentialGroup()
    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addGap(12, 12, 12)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(jbtAdd)
    .addComponent(jbtDelete)
    .addComponent(jbtModify)
    .addComponent(jbtSave))))
    .addContainerGap())
    layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jbtFirst, jbtLast, jbtNext, jbtPrevious});
    layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jbtAdd, jbtDelete, jbtModify, jbtSave});
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(21, 21, 21)
    .addComponent(jbtAdd)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jbtDelete)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jbtModify)
    .addGap(39, 39, 39)
    .addComponent(jbtSave))
    .addGroup(layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
    .addComponent(jbtFirst)
    .addComponent(jbtNext)
    .addComponent(jbtPrevious)
    .addComponent(jbtLast))
    .addGap(15, 15, 15)
    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addGroup(layout.createSequentialGroup()
    .addComponent(jbtExit)
    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
    .addComponent(jbtExitwoSave)))
    .addContainerGap())
    pack();
    }// </editor-fold>
    private void jbtExitwoSaveActionPerformed(java.awt.event.ActionEvent evt) {                                             
    System.exit(0);
    private void jbtSaveActionPerformed(java.awt.event.ActionEvent evt) {                                       
    String prodNameMod, colorMod;
    double unitsInStockMod, unitPriceMod;
    int idNumMod;
    idNumMod = Integer.parseInt(IDNumberField.getText());
    prodNameMod = prodNameField.getText();
    unitsInStockMod = Double.parseDouble(unitsInStockField.getText());
    unitPriceMod = Double.parseDouble(unitPriceField.getText());
    colorMod = colorField.getText();
    if(currentProductIndex == inventory.length) {
    inList.add(new InventoryPlusColor(idNumMod, prodNameMod,
    unitsInStockMod, unitPriceMod, colorMod));
    InventoryPlusColor[] inventory = (InventoryPlusColor[]) inList.toArray
    (new InventoryPlusColor[inList.size()]);
    } else {
    inventory[currentProductIndex].setIDNumber(idNumMod);
    inventory[currentProductIndex].setProdName(prodNameMod);
    inventory[currentProductIndex].setUnitsInStock(unitsInStockMod);
    inventory[currentProductIndex].setUnitPrice(unitPriceMod);
    inventory[currentProductIndex].setColor(colorMod);
    displayProduct(inventory[currentProductIndex]);
    private static void writeInventory(InventoryPlusColor i,
    DataOutputStream out) {
    try {
    out.writeInt(i.getIDNumber());
    out.writeUTF(i.getProdName());
    out.writeDouble(i.getUnitsInStock());
    out.writeDouble(i.getUnitPrice());
    out.writeUTF(i.getColor());
    } catch (IOException e) {
    JOptionPane.showMessageDialog(null, "I/O Exception writing data",
    "", JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    } //end writeInventory()
    private static DataOutputStream openOutputStream(String name) {
    DataOutputStream out = null;
    try {
    File file = new File(name);
    out =
    new DataOutputStream(
    new BufferedOutputStream(
    new FileOutputStream(file)));
    } catch (IOException e) {
    JOptionPane.showMessageDialog(null, "I/O Error", "", JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    return out;
    } // end openOutputStream()
    private static void closeFile(DataOutputStream out) {
    try {
    out.close();
    } catch (IOException e) {
    JOptionPane.showMessageDialog(null, "I/O Exception closing file",
    "", JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    } // end closeFile()
    private static DataInputStream getStream(String name) {
    DataInputStream in = null;
    try {
    File file = new File(name);
    in = new DataInputStream(
    new BufferedInputStream(
    new FileInputStream(file)));
    } catch (FileNotFoundException e) {
    JOptionPane.showMessageDialog(null, "The file doesn't exist",
    "", JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    } catch (IOException e) {
    JOptionPane.showMessageDialog(null, "I/O Error creating file",
    "", JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    return in;
    private static void closeInputFile(DataInputStream in) {
    try {
    in.close();
    } catch (IOException e) {
    JOptionPane.showMessageDialog(null, "I/O Exception closing file",
    "", JOptionPane.ERROR_MESSAGE);
    System.exit(0);
    } // end closeInputFile()
    private double entireInventory() {
    // a temporary double variable that the method will return ...
    // after each product's inventory is added to it
    double entireInventory = 0;
    // loop to control number of products
    for (int index = 0; index < inventory.length; index++) {
    // add each inventory to the entire inventory
    entireInventory += inventory[index].setInventoryValue();
    } // end loop to control number of products
    return entireInventory;
    } // end method entireInventory
    private void jbtLastActionPerformed(java.awt.event.ActionEvent evt) {                                       
    currentProductIndex = inventory.length-1; // move to the last product
    // display the information for the last product
    displayProduct(inventory[currentProductIndex]);
    private void jbtPreviousActionPerformed(java.awt.event.ActionEvent evt) {                                           
    if (currentProductIndex != 0) // it's not the first product displayed
    currentProductIndex -- ; // move to the previous product (decrement the current index)
    } else // the first product is displayed
    currentProductIndex = inventory.length-1; // move to the last product
    // after the current product index is set, display the information for that product
    displayProduct(inventory[currentProductIndex]);
    private void jbtNextActionPerformed(java.awt.event.ActionEvent evt) {                                       
    if (currentProductIndex != inventory.length-1) // it's not the last product displayed
    currentProductIndex ++ ; // move to the next product (increment the current index)
    } else // the last product is displayed
    currentProductIndex = 0; // move to the first product
    // after the current product index is set, display the information for that product
    displayProduct(inventory[currentProductIndex]);
    private void jbtFirstActionPerformed(java.awt.event.ActionEvent evt) {                                        
    currentProductIndex = 0;
    // display the information for the first product
    displayProduct(inventory[currentProductIndex]);
    private void colorFieldActionPerformed(java.awt.event.ActionEvent evt) {                                          
    // TODO add your handling code here:
    private void jbtModifyActionPerformed(java.awt.event.ActionEvent evt) {                                         
    prodNameField.setEditable(true);
    prodNameField.setFocusable(true);
    unitsInStockField.setEditable(true);
    unitPriceField.setEditable(true);
    private void jbtAddActionPerformed(java.awt.event.ActionEvent evt) {                                      
    IDNumberField.setText("");
    IDNumberField.setEditable(true);
    prodNameField.setText("");
    prodNameField.setEditable(true);
    colorField.setText("");
    colorField.setEditable(true);
    unitsInStockField.setText("");
    unitsInStockField.setEditable(true);
    unitPriceField.setText("");
    unitPriceField.setEditable(true);
    restockingFeeField.setText("");
    invenValueField.setText("");
    currentProductIndex = inventory.length;
    private void jbtExitActionPerformed(java.awt.event.ActionEvent evt) {                                       
    DataOutputStream out = openOutputStream("inventory.dat");
    for (InventoryPlusColor i : inventory)
    writeInventory(i, out);
    closeFile(out);
    System.exit(0);
    private static InventoryPlusColor readProduct(DataInputStream in) {
    int idNum = 0;
    String prodName = "";
    double inStock = 0.0;
    double pric

    BalusC -- The line that gives me my NullPointerException is when I call the "DisplayProduct()" method. Its a dumb question, but with NetBeans how do I find out which reference could be null? I'm not very familiar with how NetBeans works with finding out how to debug. Any help you can give me would be greatly appreciated.The IDE is com-plete-ly irrelevant. It's all about the source code.
    Do you understand anyway when and why a NullPointerException is been thrown? It is a subclass of RuntimeException and those kind of exceptions are very trival and generally indicate an design/logic/thinking fault in your code.
    SomeObject someObject = null; // The someObject reference is null.
    someObject.doSomething(); // Invoking a reference which is null would throw NPE.

  • New error with upgrade jboss/tomcat: "Connection handle has been closed and is unusable"

    Hi,
    This error suddenly appeared when we upgraded from jboss3/tomcat5.0 to jboss4.2/tomcat5.5.
    here's the usecase:
    1) User clicks on report link
    2) Crystal reports web componnent displays screen to fill in report parameters.
    3) user enters parameters and clicks submit
    4) System throws Exception
    The same reports worked fine with jboss 3.2.6/tomcat 5.0. We haven't touched anything in this realm.
    Log Excerpt:
    09:42:18,842 INFO  [datasource] Openning rowset
    09:42:18,904 ERROR [reportdefinition] com.crystaldecisions.reports.queryengine.driverImpl.m: JDBC Error: Connection handle has been closed and is unusable
    09:42:18,905 ERROR [datasource] Failed to open rowset: the query failed to open rowset
    com.crystaldecisions.reports.reportdefinition.datainterface.g: JDBC Error: Connection handle has been closed and is unusable
         at com.crystaldecisions.reports.reportdefinition.datainterface.d.a(Unknown Source)
    To try to narrow down the problem, I've updated the jdbc configuration to
         <track-statements>true</track-statements>   
    here's a recap:
    This Boolean element specifies whether to check for unclosed statements when a connection is returned to the pool. If it is true, a warning message is issued for each unclosed statement. If the log4j category org.jboss.resource.adapter.jdbc.WrappedConnection has trace level enabled, a stack trace of the connection close call is logged as well. This is a debug feature that can be turned off in production.
    Interestingly enough, this error appears slightly upstream:
    (CachedConnectionManager.java:526) - Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@c76003
    java.lang.Throwable: STACKTRACE
         at
    org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
         at com.crystaldecisions.reports.queryengine.driverImpl.k.a(Unknown Source)
         at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.new(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.ba.try(Unknown Source)
         at com.crystaldecisions.reports.common.av.a(Unknown Source)
         at com.crystaldecisions.reports.common.ag.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.e.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown
    So the question arises:
    1) Is the jboss datasource overly/aggressively closing result sets?
    2) or is there a coding error in CRXIR2?
    thanks,
    bill
    Full stack trace:
    [2008-03-13 17:26:18,905] [INFO ] org.jboss.resource.connectionmanager.CachedConnectionManager (CachedConnectionManager.java:526) - Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@c76003
    java.lang.Throwable: STACKTRACE
         at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
         at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:417)
         at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
         at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
         at com.crystaldecisions.reports.queryengine.driverImpl.k.a(Unknown Source)
         at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.new(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.ba.try(Unknown Source)
         at com.crystaldecisions.reports.common.av.a(Unknown Source)
         at com.crystaldecisions.reports.common.ag.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.e.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.y.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.r.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.cf.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.z.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ak.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ad.int(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.bk.for(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.v.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.v.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.setTableLocation(Unknown Source)
         at com.crystaldecisions.reports.sdk.DatabaseController.setTableLocation(Unknown Source)
         at org.apache.jsp.reports.processreport_jsp.switchTables(processreport_jsp.java:131)
         at org.apache.jsp.reports.processreport_jsp.loadReport(processreport_jsp.java:68)
         at org.apache.jsp.reports.processreport_jsp._jspService(processreport_jsp.java:227)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.shared.pagecache.client.PageCacheFilter.doFilter(PageCacheFilter.java:760)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.util.servlet.ExpiredPasswordFilter.doFilter(ExpiredPasswordFilter.java:92)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.pe.channels.client.servlet.ChannelUrlFilter.processUrl(ChannelUrlFilter.java:168)
         at com.participate.pe.channels.client.servlet.ChannelUrlFilter.doFilter(ChannelUrlFilter.java:100)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.util.servlet.BlockIpAddressFilter.doFilter(BlockIpAddressFilter.java:224)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.outstart.multiapp.filters.KeepOtherSessionsAliveFilter.doFilter(KeepOtherSessionsAliveFilter.java:88)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.participate.util.servlet.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:151)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Thread.java:619)

    <p>
    OK. I found the problem along with a workaround.
    </p>
    <p>
    <strong>The problem:</strong>
    </p>
    <p>
    a programming practice clashes with a new jboss 'safety check'.
    </p>
    <p>
    <strong>Programming practice:</strong>
    </p>
    <p>
    crystal reports gets a database connection in one jsp page, then tries to use it on another jsp/servlet
    </p>
    <p>
    <strong>Jboss safety check:</strong>
    Jboss/tomcat new comes configured out-of-the-box with a 'cached connection
    manager', which
    </p>
    <p>
    "Check[s] for unclosed connections and transaction terminated checks in servlets/jsps."
    </p>
    <p>
    <strong> Summary</strong>
    </p>
    <p>
    In short, if a servlet/jsp ends and it leaves a database connection open, Jboss will automatically close it.
    </p>
    <p>
    </p>
    <p>
    <strong>Workaround:</strong><br />
    Comment out two entries in these two files:
    </p>
    <p>
    1) conf/jboss4/pe/deploy/jboss-web.deployer/server.xml
    </p>
    <p>
    2) conf/jboss4/pe/deploy/jboss-web.deployer/META-INF/jboss-service.xml
    </p>
    <p>
    The two entries:
    </p>
    <p>
    </p>
    <p>
    1)
    </p>
    <p>
                 <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"<br />
                    cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"<br />
                    transactionManagerObjectName="jboss:service=TransactionManager" /><br />
    </p>
    <p>
    2)
    </p>
    <p>
          <depends>jboss.jca:service=CachedConnectionManager</depends><br />
    </p>
    <p>
    </p>
    <p>
    <strong>Comments on the workaround</strong>
    </p>
    <p>
    The 'cached connection manager' basically makes sure that the application cleans up after bad programmers. It seems most helpful in development, load testing, or trouble shooting.
    </p>
    <p>
    In production,  you can likely  comment them out with minimal
    impact on the application.
    </p>

  • How do I improve performance while doing pull, push and delete from Azure Storage Queue

           
    Hi,
    I am working on a distributed application with Azure Storage Queue for message queuing. queue will be used by multiple clients across the clock and thus it is expected that it would be heavily loaded most on the time in usage. business case is typical as in
    it pulls message from queue, process the message then deletes the message from queue. this module also sends back a notification to user indicating process is complete. functions/modules work fine as in they meet the logical requirement. pretty typical queue
    scenario.
    Now, coming to the problem statement. since it is envisaged that the queue would be heavily loaded most of the time, I am pushing towards to speed up processing of the overall message lifetime. the faster I can clear messages, the better overall experience
    it would be for everyone, system and users.
    To improve on performance I did multiple cycles for performance profiling and then improving on the identified "HOT" path/function.
    It all came down to a point where only the Azure Queue pull and delete are the only two most time consuming calls outside. I can further improve on pull, which i did by batch pulling 32 message at a time (which is the max message count i can pull from Azure
    queue at once at the time of writing this question.), this returned me a favor as in by reducing processing time to a big margin. all good till this as well.
    i am processing these messages in parallel so as to improve on overall performance.
    pseudo code:
    //AzureQueue Class is encapsulating calls to Azure Storage Queue.
    //assume nothing fancy inside, vanila calls to queue for pull/push/delete
    var batchMessages = AzureQueue.Pull(32); Parallel.ForEach(batchMessages, bMessage =>
    //DoSomething does some background processing;
    try{DoSomething(bMessage);}
    catch()
    //Log exception
    AzureQueue.Delete(bMessage);
    With this change now, profiling results show that up-to 90% of time is only taken by the Azure Message delete calls. As it is good to delete message as soon as processing is done, i remove it just after "DoSomething" is finished.
    what i need now is suggestions on how to further improve performance of this function when 90% of the time is being eaten up by the Azure Queue Delete call itself? is there a better faster way to perform delete/bulk delete etc?
    with the implementation mentioned here, i get speed of close to 25 messages/sec. Right now Azure queue delete calls are choking application performance. so is there any hope to push it further.
    Does it also makes difference in performance which queue delete call am making? as of now queue has overloaded method for deleting message, one which except message object and another which accepts message identifier and pop receipt. i am using the later
    one here with message identifier nad pop receipt to delete message from queue.
    Let me know if you need any additional information or any clarification in question.
    Inputs/suggestions are welcome.
    Many thanks.

    The first thing that came to mind was to use a parallel delete at the same time you run the work in DoSomething.  If DoSomething fails, add the message back into the queue.  This won't work for every application, and work that was in the queue
    near the head could be pushed back to the tail, so you'd have to think about how that may effect your workload.
    Or, make a threadpool queued delete after the work was successful.  Fire and forget.  However, if you're loading the processing at 25/sec, and 90% of time sits on the delete, you'd quickly accumulate delete calls for the threadpool until you'd
    never catch up.  At 70-80% duty cycle this may work, but the closer you get to always being busy could make this dangerous.
    I wonder if calling the delete REST API yourself may offer any improvements.  If you find the delete sets up a TCP connection each time, this may be all you need.  Try to keep the connection open, or see if the REST API can delete more at a time
    than the SDK API can.
    Or, if you have the funds, just have more VM instances doing the work in parallel, so the first machine handles 25/sec, the second at 25/sec also - and you just live with the slow delete.  If that's still not good enough, add more instances.
    Darin R.

  • How is it posible to get the File name, size and type from a File out the H

    How is it posible to get the File name, size and type from a File out the HttpServletRequest. I want to upload a File from a client and save it on a server with the client name. I want to conrole before saving the name, type and size of the file.How is it posible to get the File name, size and type from a File out the HttpServletRequest.
    form JSP
    <form name="form" method="post" action="procesuploading.jsp" ENCTYPE="multipart/form-data">
    File: <input type="file" name="filename"/
    Path: <input type="text" readonly="" name="path" value="c:"/
    Saveas: <input type="text" name="saveas"/>
    <input name="submit" type="submit" value="Upload" />
    </form>
    proces JSP
    <%@ page language="java" %>
    <%@ page import="java.util.*" %>
    <%@ page import="FileUploadBean" %>
    <jsp:useBean id="TheBean" scope="page" class="FileUploadBean" />
    <%
    TheBean.doUpload(request);
    %>
    BEAN
    import java.io.*;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletInputStream;
    public class FileUploadBean {
    public void doUpload(HttpServletRequest request) throws IOException
              String melding = "";
              String filename = request.getParameter("saveas");
              String path = request.getParameter("path");
              PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("test.java")));
              ServletInputStream in = request.getInputStream();
              int i = in.read();
              System.out.println("filename:"+filename);
              System.out.println("path:"+path);
              while (i != -1)
                   pw.print((char) i);
                   i = in.read();
              pw.close();
    }

    Thanks it works great.
    Here an excample from my code
    import org.apache.commons.fileupload.*;
    public class FileUploadBean extends Object implements java.io.Serializable{
    String foutmelding = "geen";
    String path;
    String filename;
    public boolean doUpload(HttpServletRequest request) throws IOException
         try
         // Create a new file upload handler
         FileUpload upload = new FileUpload();
         // Set upload parameters
         upload.setSizeMax(100000);
         upload.setSizeThreshold(100000000);
         upload.setRepositoryPath("/");
         // Parse the request
         List items = upload.parseRequest(request);
         // Process the uploaded fields
         Iterator iter = items.iterator();
         while (iter.hasNext())
         FileItem item = (FileItem) iter.next();
              if (item.isFormField())
                   String stringitem = item.getString();
         else
              String filename = "";
                   int temp = item.getName().lastIndexOf("\\");
                   filename = item.getName().substring(temp,item.getName().length());
                   File bestand = new File(path+filename);
                   if(item.getSize() > SizeMax && SizeMax != -1){foutmelding = "bestand is te groot.";return false;}
                   if(bestand.exists()){foutmelding ="bestand bestaat al";return false;}
                   FileOutputStream fOut = new FileOutputStream(bestand);     
                   BufferedOutputStream bOut = new BufferedOutputStream(fOut);
                   int bytesRead =0;
                   byte[] data = item.get();
                   bOut.write(data, 0 , data.length);     
                   bOut.close();
         catch(Exception e)
              System.out.println("er is een foutontstaan bij het opslaan de een bestand "+e);
              foutmelding = "Bestand opsturen is fout gegaan";
         return true;
         }

Maybe you are looking for

  • Schedule line getting confirmed when Ordered Quanity is greater than stock.

    Hi Sap Gurus, We have an issue in one of the sales scenario. In one of the sales orders the ordered quanity is purposely maintained greater than the stock at respective storage location(batch managed). In this case the schedule line should not get co

  • A/P Invoice no. with different serie on Check PLD

    Hi Experts, Please suggest how to pick A/P Invoice no on Check pld. I have tried with VPM2 table which picks docentry of A/P Invoice but this condition does not work with Mutiple A/P Invoice series. I am handling this issue on 2005B/PL34 Thanks Regar

  • 3D Apps on Microsoft Surface

    Hi, I am wondering about how to build 3D apps that can run on Microsoft Surface. For example, can we build the app in another platform, like say, the Unity3D game engine, and then integrate it into Surface? Or does the entire app have to be built in

  • How to access Time Capsule 2013 disk from Windows 7

    I have seen several (older) threads that suggest that you can access the Time Capsule disk from Windows 7 using Windows Explorer and navigating to \\Time-Capsule-Name.  However, I have tried this repeatedly and just cannot get it to work.  Could this

  • Sharpening in LR4, editing in CS5.

    Normally, I do basic cropping and tonal adjustments in LR, export tiffs to print size with a bit of sharpening. Then do the retouching in CS5. But I have a girl with really, really bat acne. So to save large retouched files on her, I am Cntrl/e'ing a