Proper way of handling errors in servlets?

Hi
What is the best way of handling errors in servlets? There are dozens of IOExceptions and SQLExceptions and I'm not quite sure what to with them. Now I just throw a new ServletException.

IOException and SQLException is throw by your own code, so I think you should catch the exception and handle it, for example, direct user to a error page and display the reason of the error.

Similar Messages

  • Proper way to handle people raising dead threads?

    Someone just 'bumped' a thread from 2008
    Re: Problem providing download link for BLOB data in apex report
    What is the polite way to handle this?
    thanks
    MK

    Yep, as jgarry points out, the lifetime of a thread is not fixed, and the mods have to look at each one in context.
    As an example, yesterday, someone dragged up an old(ish) thread that already had answers marked as correct and helpful (and I could see they were from experts and they were correct answers).  This new member had added their answer to it, which was just repeating answers that had already been given and added nothing new to the thread.  The nature of the question and the answers given meant that there really was nothing new that I could envisage being added to the discussion, and so I put a standard message about not reviving old threads on there, and locked it.
    In other examples, we have people dragging up old threads from years ago, just to ask the OP how they solved their problem.... an OP who quite clearly in a lot of cases is no longer active on the forums and isn't likely to answer them.  If the person dragging up the thread has an issue, they should start their own question, referencing that old thread if they need, but not drag it back out of history.
    The other problem is when people drag up an old thread to provide an answer, often saying that the previous answers are not good and that it can be done "this way...", providing some method of resolving the issue that uses new features of the database.... new features that weren't around when the question was originally asked e.g. using LISTAGG function of 11g to solve an issue that was asked around the time of 9i when sys_connect_by_path had to be used.  Posting such answers on old threads help nobody, as there are plenty of recent threads that already have examples of that new functionality being used to answer similar questions.  In these cases, I suspect that the person is just seeing a question that is 'unanswered' and thinking they can get some points for themselves, and perhaps haven't realised just how old the thread is, or that the OP is no longer around.
    Of course, there are those discussions which are open-ended, and can be revived after some time if people have new and relevant information to add.  Those sorts of discussions I wouldn't necessarily consider locking.
    There are no hard and fast rules for it, the moderators have to use discerned judgement.

  • How to handle errors in data templates

    Hi
    What is the recommended way to handle errors for example if one of your SQL statement in a data template returned no data how and where would you be able to create an error message for the user to find and read.
    Thanks,
    Mark

    The closest I have come to doing this is to put conditional statements into the format template. If a value matches an expected (ex. is null) you can return a message (in the report) via the format template (ex. "No Data Found").
    I am not sure this really answers your question as this is in the format template, but I generally view them as a matched pair that work together. I try to stick with data extraction in the data define, and do all my conditional stuff in the format templates.
    Scott

  • Handling Errors in Smartforms

    Smartform Experts,
    We are having issues with smartform and it errors out only in particular cases. Is there a way to handle Errors in Smartforms and find out exactly where the error occured in Form and catch the relevant Error message.
    Appropriate reward point will be awarded.
    Thanks
    Prasad

    Hi Prasad,
    You can debug smartform in 2 ways.
    1. put break-point in a program lines and debug.
    2. goto the smartform function module.
       Goto->Main Program
       double click on the last include program name, which will take you to the code which we write in smartform program lines.
    there select the appropriate line and click on STOP button to put a break point.
    then run the program, system will stop at the break point, from there you can debug line by line.
    i would prefer the 2nd way to debug smartforms than 1 way.
    coz in 1st way we have change the form, which is not possible in quality and production systems.
    if this suits your requirement, pls award the points.
    Satish

  • Adobe Air + Box2D.swc = TypeError: Error #1009 // New way to handle .swc files in Flash for iOS Apps?

    Hi,
    I need your help please - I have to update one of my iOS Apps. In this App I use Box2d for a simple maze game (it's an app for kids). When I publish & test this game on my Mac it works fine. I can drag my Hero (fish) through this Maze and all collision detections, gravity etc. work perfect.
    When I test it on my iPad it doesn't work. The device debugger shows this error message:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at global$init()
      at global$init()
      at Box2DAS.Common::b2Base$/initialize()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_ Retina/src/com/Box2DAS/Common/b2Base.as:31]
      at wck::WCK/create()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Retina/src/com/wck/ WCK.as:26]
      at misc::Entity/ensureCreated()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Retina/s rc/com/misc/Entity.as:50]
      at misc::Entity/handleAddedToStage()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Ret ina/src/com/misc/Entity.as:100]
      at misc::Entity/handleAddedToStage()
    Line 31: loader = new CLibInit();
    I guess "CLibInit" should come from the .swc file.
    The thing is:
    I didn't change anything in this maze game - it seems this has to do something with the new Flash and/or Adobe Air version. Box2D.swc file is included:
    It always worked like this - and it works when testing it on my Mac - but it is no longer working on my current system.
    So I started my Mac from an older system (10.9.5 on an external HD) and published the App from Flash CS6 and Adobe Air 13.0 - then it suddenly worked on my iPad as before. I was able to tap an the fish and drag it arround.
    The same project / app published from my current OS X 10.10 + Flash CC 2014 + Adobe Air 15.0.0.302 is not working. I always receive this Error Message - I can not drag the fish - nothing happens. And I have no idea why this happens and what else I could do. I searched the whole day for a solution but didn't find anything.
    So did anything change by the way Flash and/or Air handles .swc files? Is there an other way to include: import cmodule.Box2D.* / CLibInit ?
    Please - if anyone has a clue - please let me know!!
    Best regards
    Jan

    Update:
    There is also an Android Version of this App. I just published and tested a new version of it on my kindle fire & Samsung Galaxy Tab 2. On both Tablets the maze works perfect. I'm able to drag the fish around etc.
    Then I published this Android Version for iOS and tested it on my iPad. Again I'm getting the Error message:
    TypeError: Error #1009: Cannot access a property or method of a null object reference. 
      at global$init() 
      at global$init() 
      at Box2DAS.Common::b2Base$/initialize()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_ Retina/src/com/Box2DAS/Common/b2Base.as:31] 
      at wck::WCK/create()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Retina/src/com/wck/ WCK.as:26] 
      at misc::Entity/ensureCreated()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Retina/s rc/com/misc/Entity.as:50] 
      at misc::Entity/handleAddedToStage()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Ret ina/src/com/misc/Entity.as:100] 
      at misc::Entity/handleAddedToStage
    ...and the fish is stuck - I can't drag it - nothing happens. So this error only occurs when I publish the App for iOS - as an .ipa. Did anything change in the way Air handles .swc files?
    I'm totally confused
    If anybody has an idea what I could try - PLEASE LET ME KNOW!!

  • What is the proper way to reinstall iTunes after error 42404 without losing all my music?

    What is the proper way to reinstall iTunes after error 42404 without losing all my music?

    Here's what I do when I have iTunes problems and it works 9 out of 10 times.  I have Ccleaner; It's a wonderful tool to have.  If you don't have it, google it and install it, just the free version.  You'll see the list of all of your installed programs in there to unstall (among of a host of other things you could do with that program) but anyway, right click on Apple Software first to repair, when done then right click on Apple Application Support to repair, then when done with that, right click on iTunes to repair that and all should be well after that.  No uninstall should be necessary at all when you do all that.

  • Error propagating servlet user to peer?

    Hello,
    We currently have a Windows 2003 Server 32bit running ColdFusion 8.01 with 3 instances named: cfusion, Instance1 and Instance2. Instance 1 and Instance 2 are clustered together and serving all our sites in IIS. We're hosting just over 200 sites with approx. 6-7 hits a second.
    ColdFusion is running with all the latest hot fixes and patches. The JVM is version 1.6_24.
    For a while now one of the instances in the cluster randomly  locks up a few times a month, fails to return pages and has high cpu usage. We'd normally just restart the instance and things would return to normal. It's bad to ignore things but it's only recently I've had a chance to look into the cause of these lock ups.
    Last night both the instances appeared to fail. We have an external monitor that hits our sites every 5 minutes to ensure they are still running.
    Scanning through the JRun logs at about the time we received our first monitor warning there are a bunch of what appear to be propagation errors on both instances.
    Logs from Instance1:
    22/03 07:10:14 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:16 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:17 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:18 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:20 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:21 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:23 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:23 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:24 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:24 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:25 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:26 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:26 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:26 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:26 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:27 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:28 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:28 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:10:29 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketTimeoutException: Read timed out
    22/03 07:17:43 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset by peer: socket write error
    Logs from Instance2:
    22/03 07:10:40 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset by peer: socket write error
    22/03 07:10:40 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset
    22/03 07:10:40 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset
    22/03 07:10:40 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset by peer: socket write error
    22/03 07:10:40 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset by peer: socket write error
    22/03 07:10:40 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset by peer: socket write error
    22/03 07:10:40 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset by peer: socket write error
    22/03 07:10:40 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset by peer: socket write error
    22/03 07:10:40 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset by peer: socket write error
    22/03 07:10:40 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset by peer: socket write error
    22/03 07:10:40 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset by peer: socket write error
    22/03 07:10:41 info Clusterable service JRunRMIBroker discovered ClusterManager on xxx.xxx.xxx.xxx:3862, cluster domain: cluster1 (Lookup Service's JINI-ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
    22/03 07:10:42 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset
    22/03 07:10:42 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.io.EOFException
    22/03 07:10:42 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset
    22/03 07:10:42 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.net.SocketException: Connection reset
    22/03 07:10:42 warning Error propagating servlet user to peer: error during JRMP connection establishment; nested exception is:
        java.io.EOFException
    22/03 07:10:43 error ROOT CAUSE:
    java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:640)
    I suspect it's a JVM memory issue, however I have no way of extracting or creating memory logs without bringing all our sites down again.
    I only know the basics of how the JVM heap space works but my guess is that one of the instances can't create any more threads because the PermGen space has run out and it's killing the cluster.
    Here's our current JVM settings: java.args=-server -Xmx768m -Xms768m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Dcoldfusion.fckupload=true -Dcoldfusion.rootDir={application.home}/
    Has anyone come across this issue before or has any ideas on how to better debug the issue with minimal impact on uptime?

    Well the classes should be in WEB-INF/classes, but I don't think that's your problem.
    Getting an applet to connect to a db is notoriously difficult (so I've heard - I've never tried it), so having the applet talk to the servlet with the servlet in turn talking to the db is a good idea.
    "i cant see the error message because it wont print in the VM,"
    That doesn't sound right. What does your error handling code look like?
    " MySQL it also has access permissions for some weird reason."
    MySQL is set up so that user credentials are only valid from a specific host unless you explicitly tell it that a user can connect from anywhere. This is native to MySQL and has nothing to do with java or JDBC.
    Most of the code you posted throws Exceptions. Are you catching them, and if so what did they say?

  • What is the proper way to close all open sessions of a NI PXI-4110 for a given Device alias?

    I've found that, when programming the NI PXI-4110 that, if a the VI "niDCPower Initialize With Channels VI" (NI-DCPower pallette) is called with a device
    alias that all ready has one or more sessions open (due to an abort or other programming error) a device reference results from the reference out that has a (*) where "*" is post-fixed to the device reference where and is an integer starting that increments with each initialize call. In my clean up, I would like to close all open sessions. For example, let's said the device alias is "NIPower_1" in NI Max, and there are 5 open sessions; NIPower_1, NIPower_1 (1), NIPower_1 (2), NIPower_1 (3), and NIPower_1 (4). A simple initialize or reset (using niDCPower Initialize With Channels VI, or, niDCPower Initialize With Channels VI, etc.) What is the proper way to close all open sessions?
    Thanks in advance. Been struggleing with this for days!

    When you Initialize a session to a device that already has a session open, NI-DCPower closes the previous session and returns a new one. You can verify this very easily: try to use the first session after the second session was opened.
    Unfortunately, there is a small leak and that is what you encountered: the previous session remains registered with LabVIEW, since we unregister inside the Close VI and this was never called. So the name of the session still shows in the control like you noted: NIPower_1, NIPower_1 (1), NIPower_1 (2), NIPower_1 (3), and NIPower_1 (4), etc.
    There may be a way to iterate over the registered sessions, but I couldn't find it. However, you can unregister them by calling "IVI Delete Session". Look for it inside "niDCPower Close.vi". If you don't have the list of open sessions, but you have the device name, then you can just append (1), (2) and so forth and call "IVI Delete Session" in a loop. There's no problem calling it on sessions that were never added.
    However - I consider all this a hack. What you should do is write code that does not leak sessions. Anything you open, you should close. If you find yourself in a situation where there are a lot of leaked sessions during development, relaunching LabVIEW will clear it out. If relaunching LabVIEW is too much of an annoyance, then write a VI that does what I described above and run it when needed. You can even make it "smarter" by getting the names of all the NI-DCPower devices in your system using the System Configuration or niModInst APIs.
    Hope this helps.
    Marcos Kirsch
    Principal Software Engineer
    Core Modular Instruments Software
    National Instruments

  • What are the different ways to handle deadlocks?

    Hi,
    May I know what are the ways to solve a deadlock problem?
    Currently, I have the following code to catch the exception:
    catch (XmlException ex)
                   try
                        ex.printStackTrace();
                        txn.abort();
                   } catch (DatabaseException DbEx)
                        System.err.println("txn abort failed.");
                   }and the resulting error is:
    com.sleepycat.dbxml.XmlException: Error: DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock, errcode = DATABASE_ERROR
    Any other more efficient way to handle deadlock?
    Or better ways to prevent deadlock from happening?
    I am using this environment config
    EnvironmentConfig envConf = new EnvironmentConfig();
                   envConf.setAllowCreate(true); // If the environment does not exits,
                   // create it.
                   envConf.setInitializeCache(true); // Turn on the shared memory
                   // region.
                   // envConf.setCacheSize(25 * 1024 * 1024); // 25MB cache
                   envConf.setInitializeLocking(true); // Turn on the locking
                   // subsystem.
                   envConf.setInitializeLogging(true); // Turn on the logging
                   // subsystem.
                   envConf.setTransactional(true); // Turn on the transactional
                   // subsystem.
                   // envConf.setRunRecovery(true); //Turn on run recovery
                   // envConf.setTxnNoSync(true); // Cause BDB XML to not synchronously
                   // force any log data to disk upon transaction commit
                   envConf.setLogInMemory(true); // specify in-memory logging
                   envConf.setLogBufferSize(60 * 1024 * 1024); // set logging size.
                   // envConf.setTxnWriteNoSync(true); //method. This causes logging
                   // data to be synchronously written to the OS's file system buffers
                   // upon transaction commit.
                   // envConf.setThreaded(true); //default by Java that threaded = true
                   // envConf.setMultiversion(true);
                   envConf.setLockDetectMode(LockDetectMode.DEFAULT); // Reject a
                   // random lock
                   // requestThanks in advance for any help!
    :)

    Hi Vyacheslav,
    here is the code:
    package ag;
    import com.sleepycat.db.DatabaseException;
    import com.sleepycat.db.Environment;
    import com.sleepycat.db.EnvironmentConfig;
    import com.sleepycat.db.LockDetectMode;
    import com.sleepycat.dbxml.XmlContainerConfig;
    import com.sleepycat.dbxml.XmlDocumentConfig;
    import com.sleepycat.dbxml.XmlException;
    import com.sleepycat.dbxml.XmlManager;
    import com.sleepycat.dbxml.XmlContainer;
    import com.sleepycat.dbxml.XmlDocument;
    import com.sleepycat.dbxml.XmlManagerConfig;
    import com.sleepycat.dbxml.XmlTransaction;
    import com.sleepycat.dbxml.XmlUpdateContext;
    import inter.DBInterface;
    import java.io.*;
    import java.util.Properties;
    import cp.CheckPointer;
    public class SaveMessageinDB implements DBInterface
         Environment myEnv;
         XmlManager myManager;
         XmlContainer myContainer;
         XmlTransaction txn;
         XmlContainerConfig cconfig;
         Properties properties;
         // CheckPointer cp;
         int Counter;
         public SaveMessageinDB()
              try
                   properties = new Properties();
                   properties.load(ClassLoader
                             .getSystemResourceAsStream("Aggregator.properties"));
                   setXmlEnvrionment();
                   setXmlManager();
                   setXmlContainer();
                   // cp = new CheckPointer(myEnv);
                   // cp.start();
                   // System.out.println("Checkpointer started....");
                   Counter = 0;
              } catch (Exception ex)
                   ex.printStackTrace();
         public void saveMessage(String docName, String content) throws Exception
              addXMLDocument(docName, content);
         public void setXmlEnvrionment()
              try
                   File envHome = new File(properties.getProperty("DATABASE_LOCATION"));
                   EnvironmentConfig envConf = new EnvironmentConfig();
                   envConf.setAllowCreate(true); // If the environment does not exits,
                   // create it.
                   envConf.setInitializeCache(true); // Turn on the shared memory
                   // region.
                   envConf.setCacheSize(100 * 1024 * 1024); // 100MB cache
                   envConf.setInitializeLocking(true); // Turn on the locking
                   // subsystem.
                   envConf.setInitializeLogging(true); // Turn on the logging
                   // subsystem.
                   envConf.setTransactional(true); // Turn on the transactional
                   // subsystem.
                   // envConf.setRunRecovery(true); // Turn on run recovery
                   // envConf.setTxnNoSync(true); // Cause BDB XML to not synchronously
                   // force any log data to disk upon transaction commit
                   envConf.setLogInMemory(true); // specify in-memory logging
                   envConf.setLogBufferSize(60 * 1024 * 1024); // set logging size.
                   // envConf.setTxnWriteNoSync(true);
                   // This causes logging
                   // data to be synchronously written to the OS's file system buffers
                   // upon transaction commit.
                   envConf.setMultiversion(true); //Turn on snapshot isolation
                   envConf.setLockDetectMode(LockDetectMode.DEFAULT); // Reject a
                   // random lock
                   // request
                   // myEnv = new Environment(envHome, null); //To adopt Environment
                   // already set by others
                   myEnv = new Environment(envHome, envConf);
                   System.out.println("Environment created...");
              } catch (Exception ex)
                   ex.printStackTrace();
         // All BDB XML programs require an XmlManager instance.
         // Create it from the DB Environment, but do not adopt the
         // Environment
         public void setXmlManager()
              try
                   XmlManagerConfig mconfig = new XmlManagerConfig();
                   mconfig.setAllowAutoOpen(true);
                   mconfig.setAdoptEnvironment(true);
                   mconfig.setAllowExternalAccess(true);
                   myManager = new XmlManager(myEnv, mconfig);
                   // myManager = new XmlManager (mconfig);
                   System.out.println("Manager created...");
              } catch (Exception ex)
                   ex.printStackTrace();
         public void setXmlContainer()
              try
                   cconfig = new XmlContainerConfig();
                   cconfig.setNodeContainer(true);
                   cconfig.setIndexNodes(true);
                   cconfig.setTransactional(true); // set transaction need an
                   // cconfig.setAllowValidation(false);
                   // environment
                   // cconfig.setReadUncommitted(true); // This container allow
                   // uncommitted read (able to read dirty data and not set a deadlock
                   // cconfig.setMultiversion(true);
                   myContainer = myManager.openContainer(properties
                             .getProperty("DATABASE_LOCATION")
                             + properties.getProperty("CONTAINER_NAME"), cconfig);
                   System.out.println("Container Opened...");
              } catch (XmlException XmlE)
                   try
                        myContainer = myManager.createContainer(properties
                                  .getProperty("DATABASE_LOCATION")
                                  + properties.getProperty("CONTAINER_NAME"), cconfig);
                        System.out.println("Container Created...");
                   } catch (Exception e)
                        e.printStackTrace();
              } catch (Exception ex)
                   ex.printStackTrace();
         public void addXMLDocument(String docName, String content)
              try
                   txn = myManager.createTransaction(); // no need to create
                   // transaction. auto commit
                   // by the environment
                   XmlDocumentConfig docConfig = new XmlDocumentConfig();
                   docConfig.setGenerateName(true);
                   docConfig.setWellFormedOnly(true);
                   myContainer.putDocument(txn, docName, content, docConfig);
                   // commit the Transaction
                   txn.commit();
                   System.out.println("documents added.....");
                   Counter++;
                   System.out.println("Document no: " + Counter);
                   txn.delete();
              } catch (XmlException ex)
                   try
                        System.out.println("Occuring in addXMLDocument");
                        ex.printStackTrace();
                        txn.abort();
                   } catch (DatabaseException DbEx)
                        System.err.println("txn abort failed.");
         public void cleanup()
              try
                   if (myContainer != null)
                        myContainer.close();
                   if (myManager != null)
                        myManager.close();
                   if (myEnv != null)
                        System.out.println("All cleaned up done..in sm");
                        myEnv.close();
              } catch (Exception e)
                   // ignore exceptions in cleanup
    }Thanks!

  • Ways to handle large volume data (file size = 60MB) in PI 7.0 file to file

    Hi,
    In a file to file scenario (flat file to xml file), the flat file is getting picked up by FCC and then send to XI. In xi its performing message mapping and then XSL transformation in a sequence.
    The scenario is working fine for small files (size upto 5MB) but when the input flat file size is more then 60 MB, then XI is showing lots of problem like (1) JCo call error or (2) some times even XI is stoped and we have to strat it manually again to function properly.
    Please suggest some way to handle large volume (file size upto 60MB) in PI 7.0 file to file scenario.
    Best Regards,
    Madan Agrawal.

    Hi Madan,
    If every record of your source file was processed in a target system, maybe you could split your source file into several messages by setting up this in Recordset Per Messages parameter.
    However, you just want to convert you .txt file into a .xml file. So, try firstly to setting up
    EO_MSG_SIZE_LIMIT parameter in SXMB_ADM.
    However this could solve the problem in Inegration Engine, but the problem will persit in Adapter Engine, I mean,  JCo call error ...
    Take into account that file is first proccessed in Adapter Engine, File Content Conversion and so on...
    and then it is sent to the pipeline in Integration Engine.
    Carlos

  • How to handle errors in a file at sender side?

    Hi
    I have done a file to proxy scenario.
    I know how to handle errors on proxy.
    But on sender side when picking the file if one the record have worng fomat its throwing mapping error and its not processing any record..
    I wanted to process the records which have right format and data and  all remaining recrods which have wromg format should be send back to the sender as file.
    How to do this.
    How to handle error in sender file.
    Regards
    Sowmya

    Hello Sowmya,
    In your scenario Three ways you can validate the data.
    1) Before the data reaches into SAP system ie in XI system during Mapping or before mapping i,e in Adapter Module in the Sender side
    2) this option, is in the receiver applications side. ie. Validations will be taken care in the SAP system i.e in ABAP server proxy code.
    3)Through BPM, If Mapping Exception Occures then through exception Branch you can send bad formate file to sender again.
    Generally, it is prefer to more business critical validations in the Application System ie Receiver Application System (ABAP Server Proxy)
    In this, you can have more flexibility of the validations as you are validating some of the SAP payroll informations as Personal ID etc.
    Based on the complexity and flexibility of the requirement, you can either do this in the XI (if XI, ie Sender Adapter Module or Mapping) or in the ABAP proxy
    Thanks'
    Sunil Singh

  • Is there a way to handle system exception ERROR_MESSAGE?

    Hi,
    I have a program executed in background, which produces a bunch of consecutive documents for a set of Bulk Shipments -> TD Loading and TD Delivery Confirmation. To create those documents I use function modules 'OIGI_LOADING_CREATE' and 'OIGI_DEL_CONF_CREATE'  - both from Industry-Solution Oil-and_Gas (IS-Oil).
    In some cases these FM-s produces error messages (E-type) which cancel execution of the program and broke my flow-logic.
    Below are few messages recorded in a job log for my task:
    18.08.2005 15:56:41 Job started                                                                         
    18.08.2005 15:56:41 Step 001 started (program /PTRL/TAS_POSTPONDED_SYNC, variant , user name IMUTAFCHIEV)
    18.08.2005 15:56:58 Shipment 180753 saved                                                               
    18.08.2005 15:57:06 The plant data of the material 177 is locked by the user BMINKOV                    
    18.08.2005 15:57:06 The plant data of the material 177 is locked by the user BMINKOV                    
    18.08.2005 15:57:06 The plant data of the material 177 is locked by the user BMINKOV                    
    18.08.2005 15:57:06 Job cancelled after system exception ERROR_MESSAGE                                  
    Both function modules are not designed to handle any exceptions, and in owr environment (4.6c) there is no documented system exception 'ERROR_MESSAGE' which to be handled in CATCH-ENDCATCH block.
    Is there a way to handle this exception and to track the list of error messages produced by some FM into an internal table, log, whatever, as it is done in the log of the background job. I need to find a way write these messages in my log-tables and to proceed further with my flow-logic.
    FYI: my program executes an RFC call to a remote system and retrieve a list of documents which need to be synchronized with R/3. I loose information, if the R/3 broke my flow-logic.
    Any help would be highly appresiated.
    Many thanks in advance.
    Ivaylo Mutafchiev

    Sven,
    I made few programs where we used business scenario:
    IS-Oil Shipment => IS-Oil Loading Confirmation => IS-Oil Delivery Confirmation.
    All of them are based on Function Module call:
    1. OIGI_LOADING_CREATE and
    2. OIGI_DEL_CONF_CREATE.
    To load shipment I call 1st FM in a way:
      CALL FUNCTION 'OIGI_LOADING_CREATE' DESTINATION 'NONE'
           EXPORTING
                I_SUBRC     = 9  "save and commit
                I_SHNUMBER  = shNumber
                I_VEHICLE   = vehicle
                I_LDPLT     = plant
                I_LDDATE    = loadDate
                I_LDTIME    = loadTime
                I_LDCDAT    = loadDate
                I_VEH_NR    = veh_nr
           TABLES
                T_OIGISVMQ  = quantity_items
                T_OIGISVMQ2 = hpm_append
                T_OIGISIQ   = doc_quan_items
           EXCEPTIONS
                COMMUNICATION_FAILURE = 1 MESSAGE p_error
                SYSTEM_FAILURE = 2 MESSAGE p_error.
    To confirm shipment (status 4) I call the same FM with:
      CALL FUNCTION 'OIGI_LOADING_CREATE' DESTINATION 'NONE'
           EXPORTING
                I_SUBRC    = 39  "confirm & commit 2nd step
                I_SHNUMBER = shNumber
                I_VEHICLE  = vehicle
                I_LDPLT    = werks
           EXCEPTIONS
                COMMUNICATION_FAILURE = 1 MESSAGE sh_error
                SYSTEM_FAILURE = 2 MESSAGE sh_error.
    And finaly to finish process (status = 6) I call 2nd FM in a way:
      CALL FUNCTION 'OIGI_DEL_CONF_CREATE' DESTINATION 'NONE'
           EXPORTING
                I_SUBRC         = 19  "save, confirm and commit
                I_SHNUMBER      = shNumber
                I_RAPID_CONFIRM = 'X'
                I_DDCDAT        = loadDate
                I_DLDATE        = loadDate
                I_DLTIME        = loadTime
           EXCEPTIONS
                COMMUNICATION_FAILURE = 1 MESSAGE p_error
                SYSTEM_FAILURE = 2 MESSAGE p_error.
    FYI: It tooks me some time to 'investigate' and find correct use of these function modules. And I worked VERY CLOSE with our SD consultant.
    For details (what the export parameters and tables consist of) and sample code, please contact me at:
    ivaylo dot mutafchiev at vbs dot bg
    I would be glad to share my knowlege.
    Regards,
    Ivaylo

  • Event handler error

    I gets event handler error from the following applescript code if I leave the desktop space where "XLD" is running.
    Is there a way to avoid this error and keep running the applescript?
    tell application "System Events"
    set wnd to front window of application process "XLD"
    click button "Extract" of tool bar of wnd
    delay 1
    repeat while (name of front window of application process "XLD") = "Progress"
    end repeat
    end tell

    Do you have any Mail plug-ins installed? Mail Act-on, MailTags or whatever? If so, try disable them and then see if the scripts work.
    Alternatively, you can access the iPhoto Library from within Mail:
    Uploaded with plasq's Skitch!
    Just drag and drop to the message.
    Regards
    TD

  • Handle errors when makeing doc.submitForm()

    Hello,
    I am trying to submit PDF form by method doc.submitForm, example:
    doc.submitForm
            cURL: "http://localhost/reader_test.php?name=" + name.rawValue,
            cSubmitAs: "XML"
    A) With this approach, is it possible to handle connection errors and display custom error message (and cancel the original one) ?
    I have tried something like
    try{  doc.submitForm(...); } catch(e) { //handle code }
    but it seems to be run asynchronously.
    B) Is it possible to add custom HTTP headers to the POST ?
    I saw that FormCalc can do it in Post() funciton, but when using Post() function, the Reader displays Yello-bar security dialog, that made our previous SOAP-based solution too complicated for the end user.
    Appreciate any help.
    Radek

    Sofar I have not found the way how to handle errors when using doc.submitForms(), but there may be following workaround (mey be?):
    The server returns as a response to a submitForms() call a pdf content, which is displayed as a document in a new Reader's window. Is it possible to place some javascript into this new window, that would refer to parent window and send to it some message ? Or at least to detect at the "parent" window, that a "child" window was opened ?
    So is there any relation between the newly opened document with the response from server and the original document, that initiated calling of doc.submitForms()?
    Thanks.

  • How to handle Error Log in SSIS?

    Hi All,
    Can anyone please suggest me a best way to handle the below scenario?
    - I have an SSIS package which reads data from XML files, validate the business scenarios and process the data to database.
    - If any data from the source file (XML File) has invalid data/format errors/any errors which stops my package to run, package gives the error messages with the failure reasons.
    - How can I get the failure reasons given by the package to show it to end user rather handling in a custom way? so that they can correct the file and re-submit?
    Thanks & Regards,
    Sri

    You can make use of EVent Handlers for that
    Add a On Error event handler in the package for data flow and inside that use Send Mail Task to send the error file in a mail as an attachment. If you want you can log error details to a audit table in previous step and send that also as an attachment in
    the same mail inside Event handler
    see these examples
    https://www.simple-talk.com/sql/ssis/ssis-event-handlers-basics/
    http://vsteamsystemcentral.com/cs21/blogs/applied_business_intelligence/archive/2007/04/08/ssis-design-pattern-custom-error-handling.aspx
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

Maybe you are looking for

  • SAP GUI taking too much time to open transactions

    Hi guys, i have done system copy from Production to Quality server completely. after that i started SAP on Quality server, it is taking too much time for opening SAP transactions (it is going in compilation mode). i started SGEN, but it is giving tim

  • Itunes 7.4.1.2 interfering with wireless network

    This is a weird one, i hope someone can help!! I upgraded my ipod the other day to an 80Gb ipod classic (6th gen) and so i had to upgrade to the lastest version of iTunes. Having done this, 8 times out of 10 when i eject my iPod from within iTunes my

  • Can't add files to my iTunes library

    Since the iTunes 11.0 update, I have had problems with my iTunes library.  That update deleted my whole podcast library.  I have been able to recreate most of it.  However, some of the podcasts were not available in iTunes store so I have downloaded

  • Best itunes for iphone 4s windows 7 professional 64 bit

    I'm asking for advice, if someone has an idea, or maybe there's a moderator around to tell me~~which version of iTunes and which version of iOS would be best for my iPhone 4S using Windows 7 professional~~with all the current MS updates installed?  I

  • Question on reinstall to same PC ?

    Hello, Both my Photoshop Elements 9 and Premiere Elements 9 stopped suddenly working. I decided to reinstall. Removed Elements 9 to start with and did not deactivate license key because do not know how to do it and was not sure should it be deactivat