Everyone who is good at constructing batch in java come here!

Dear all,
recently i suffer so lots about null pointer exception in my batch program and i really want to konw the logic about launch a batch.
*(1)*blow is my code by brief:
public class CmlMBTUPFileConversationLZBatchABC extends CmlMBTUPFileConversationLZBatchABC_Gen {
     private static String filePathIn;
     private static FeatureConfiguration featureConfiguration;
     private static String failureCauses;
     public void validateSoftParameters(boolean arg0) {
          filePathIn = getParameters().getFILE_PATH_IN().trim();
          initlizeParam();
     private void initlizeParam() {
          Iterator<FeatureConfigurationOption> iterOptions = featureConfiguration.getOptions().iterator();
          FeatureConfigurationOption wfmOpt;
          while (iterOptions.hasNext()) {
               wfmOpt = (FeatureConfigurationOption) iterOptions.next();
               if (wfmOpt.getId().getOptionType().trim().equals(CmlMBTCaseCharacteristicLookup.constants.ENCODE_IN.trimmedValue())) {
                    failureCauses = wfmOpt.getValue().trim();
     public static class CmlMBTUPFileConversationLZBatchABCWorker extendsCmlMBTUPFileConversationLZBatchABCWorker_Gen {
          String st[] arr= failureCauses.split("/");
          public ThreadExecutionStrategy createExecutionStrategy() {
               // return new SingleTransactionStrategy(this);
               return new CommitEveryUnitStrategy(this);
public void initializeThreadWork(boolean initializationPreviouslySuccessful)throws ThreadAbortedException, RunAbortedException {}
          public WorkUnitResult executeWorkUnitDetailedResult(ThreadWorkUnit unit)throws ThreadAbortedException, RunAbortedException {}
*(2)*When i run the batch, some time it appears nullpointer exception, and i tack the cause: it's the variable failureCauses is null when running the code: String st[] arr = failureCauses.split("/");
so i solve the promble quickly: initialize the varible String st[] arr in the overrided method of initializeThreadWork;
Actually I konw the principle about the sequence of initialize inter static class and its outter class, its seems the exception would appear when inner class initalize before his outter class
*(3)* i'm afrid i will meet the same promble if i don't konw the sequece of initalization method in outter class and inner class,
and what i want to konw right now is:
would the override method named validateSoftParameters in outter batch class always before the inner work class's mehods? and the inner worker class's overrided method of initializeThreadWork? and it's would be great helpful to me for telling me the principle of launching a bach. any help would be appreciated.
Edited by: Eric ZHOU on 2010-8-6 下午11:54
Edited by: Eric ZHOU on 2010-8-7 上午1:20

Phones are currently shipping directly from Apple and are arriving at random intervals not set by Best Buy®.  They will continue to arrive from Apple until our allotment is reached.
If Nokia was a Mod, it would say so next to his user name like mine says Admin.
Thanks,
Jacob|Web Planner | Best Buy® Corporate

Similar Messages

  • Goods Receipt and Batch Number

    Hi everyone,
    I'm trying to create batch numbers automaticly by using the external ref number, the document date and a UDF at row level. Nevertheless I cannot do this because the objects seems not to be available.
    Has anyone done this?

    Hi João,
    the Business Object for your solution should be "Documents" and the type should be either "oInventoryGenEntry" or "oPurchaseDeliveryNotes".
    There is a very good example in the samples folder called "SerialAndBatch". Have you checked this out yet? You will be able to locate it in your Business One installation folder in the subfolder "SamplesCOM DIVB.NET04.SerialAndBatch". It should provide you with some guidance and hopefully the right answers.
    Regards,
    Torsten

  • When I create a photo stream in ios6, everyone who is logged in to my iCloud account can see and edit my stream (on their iPhones only). Not just the email addressees that I sent the photo stream link to. Is that how photo stream security is meant to work

    When I create a photo stream in ios6, everyone who is logged in to my iCloud account can see and edit my stream (on their iPhones only). Not just the email addressees that I sent the photo stream link to. Is that how photo stream security is meant to work? Is so it means my whole family can see any photo stream I set up. Hence no security? Can't share the pics with the wife then :(

    The whole idea to an icloud account is that one user uses it and has all their devices synced together.  Different users need different Apple IDs to create their own icloud accounts.  Note that everyone can still use the same ID for an iTunes account (to share purchases).
    To create a new icloud account, go to
    http://www.apple.com/icloud/setup/

  • I updated my Iphone4S this week to the newest IOS 7.1 and now everyone who calls me says the calls are not clear, muffled.  Is there something I can do to clear this?  4 people in 4 different states that called me all said the same thing.

    I updated my Iphone4S this week to the newest IOS 7.1 and now everyone who calls me says the calls are not clear, muffled.  Is there something I can do to clear this?  4 people in 4 different states that called me all said the same thing.

    Settings > General > Reset > Reset Network Settings
    Contact the carrier to troubleshoot.

  • To everyone who thinks the fonts are too small on ...

    To everyone who thinks the fonts are too small on the N9 i suggest you contact Nokia about this issue. I know i am!

    please see my post here: /t5/Maemo-and-MeeGo-Devices/N9-Font-too-small/m-p/1338481#M32968

  • Microsoft Project Server 2010 - Need a query/report to show everyone who did not submit timesheet last week

    I need to create a MSPS 2010 query/report to send out to my project managers that show them everyone who did not submit their timesheet for the previous week.  I would like to be able to filter it by project/client but would settle for just a list
    of all unsubmitted timesheets at this point.  Every link I have found point to old reports for MSPS 2007 and the queries do not work because of schema changes between MSPS 2007 and 2010.  Please help!

    Thanks Elli!  Is there any way to also pull in the active resources that have not created a timesheet in the timeframe I am filtering on as well?
    Here is the query I had came up with.  Looks like I was on the right track...  I did two actually.  First one to give me a roll up list of employees with outstanding time sheets for last week and the hours, then the same data with an explosion
    by employee by project and also pull in their associated time sheet manager:
    --Everyone with an timesheet for last week where status  is not 'Approved' or 'Submitted'
    SELECT DISTINCT
            CONVERT(varchar(10),b.StartDate,1) + ' - ' + CONVERT(varchar(10),b.EndDate,1) as [Timesheet Date]
          , [ResourceName]
          , [TimesheetStatus]     
          , SUM([ActualWorkBillable]) as [Hours Entered]
      FROM 
        [dbo].[MSP_TimesheetLine_UserView] a
      , [dbo].[MSP_TimesheetPeriod] b
      WHERE
          a.PeriodUID = b.PeriodUID 
      and [TimesheetStatus] NOT IN ('Approved', 'Submitted')
      and DATEADD(dd,-7,GETDATE()) BETWEEN b.[StartDate] AND b.[EndDate]
      GROUP BY 
        b.[StartDate]
      , b.[EndDate]
      , [ResourceName]
      , [TimesheetStatus]
    GO
    --Everyone with an timesheet for last week where status  is not 'Approved' or 'Submitted' w/ Project/Customer explosion
    SELECT
     CONVERT(varchar(10),b.StartDate,1) + ' - ' + CONVERT(varchar(10),b.EndDate,1) as [Timesheet Date]
    , r.ResourceName AS [Resource Name]
    , [TimesheetStatus]     
    , [ProjectName]     
            , ([ActualWorkBillable]) as [Hours Entered]
    , isnull(rm.ResourceName,'<No Timesheet ManagerInformation Available>') AS [Timesheet Manager]
    FROM
          dbo.MSP_EpmResource_UserView r 
     LEFT OUTER JOIN
          dbo.MSP_EpmResource_UserView as rm 
       ON r.ResourceTimesheetManagerUID = rm.ResourceUID
    ,[MSP_TimesheetLine_UserView] as a
    ,[MSP_TimesheetPeriod] as b
    WHERE
          a.PeriodUID = b.PeriodUID 
      AND a.ResourceUID = r.ResourceUID
      AND  [TimesheetStatus] NOT IN ('Approved', 'Submitted')
      AND  DATEADD(dd,-7,GETDATE()) BETWEEN b.[StartDate] AND b.[EndDate]
      AND (r.ResourceIsActive = 1)
      AND (r.ResourceType = 2)
      AND (r.ResourceIsGeneric = 0)
    ORDER BY 
       r.ResourceName
     , ProjectName
    GO

  • Retrieve email addresses from everyone who ever sent me an email?

    Hello all,
    Is there a way to retrieve every email address from everyone who has ever sent me an email? Is there a file somewhere? I don't mind if I have to cut and paste them into my address book. I have never used my address book, which was not too smart.
    OS 10.5
    Mail 3.6
    Message was edited by: MilliMac

    there is no file but you can do it using Mail Scripts. http://homepage.mac.com/aamann/Mail_Scripts.html
    It has a script to import addresses from selected emails into Address Book. select all emails in your inbox and use it.

  • Who knows good iPad apps for using in school?

    Hey,
    Soon I'm gonna use my iPad in school. But I don't know good apps for using in school.
    Specially for using my iPad a notebook.
    I'm looking for an app that can write and draw. I also want to keep my notes organized.
    Who has good suggestions?
    Thanks in advance,
    Thijs
    PS. Sorry for my bad English

    I would recommend Evernote, a cloud storage app that allows you to organize notes and access them anywhere, over the built-in Notes. For handwriting drawing, I use Notability and email my notes directly from there to my Evernote account; Penultimate is (in my opinion) not as good a writing app, but works better with Evernote. Paper is another good writing app. If you want handwriting recognition, check out Writepad (also works well with Evernote).

  • What is a good app to batch edit multiple photos on a MacBookPro  ?

    what is a good app to batch edit multiple photos on a MacBookPro  ?

    iPhoto will batch edit names, and albums.  
    http://www.lemkesoft.com/ GraphicConverter can do other sorts of batch editing you may be interested in.

  • Good exception handling policy for Java web application

    I'm looking for a good exception handling policy for Java web application. First I found this Java exception handling best practices - How To Do In Java which says that you should never catch the Trowable class nor use e.printStackTrace();
    Then I found this Oracle page The Message-Driven Bean Class - The Java EE 6 Tutorial, which does just that. So now I'm confused. Is there a good page online for an exception handling policy for Java EE Web applications? I have a hard time finding one. I've read that you should not catch the Exception class. I've been catching it previously to make sure that some unknown exception doesn't slip through early in the loop and stops all other customers from executing later on in the loop. We have a loop which runs once a minute implemented using the Quartz framework. Is it OK if you just change the implementation to catch the RuntimeException class instead of the Exception class? We're using Java 7 and the Jetty Servlet Container.

    I'm looking for a good exception handling policy for Java web application.
    If you have not done so I suggest you start by reviewing the several trails in The Java Tutorials.
    Those trails cover both HOW to use exceptions and WHEN to use them.
    This trail discusses  the 'controversy' you mention regarding 'Unchecked Exceptions'
    http://docs.oracle.com/javase/tutorial/essential/exceptions/runtime.html
    Unchecked Exceptions — The Controversy
    Because the Java programming language does not require methods to catch or to specify unchecked exceptions (RuntimeException, Error, and their subclasses), programmers may be tempted to write code that throws only unchecked exceptions or to make all their exception subclasses inherit from RuntimeException. Both of these shortcuts allow programmers to write code without bothering with compiler errors and without bothering to specify or to catch any exceptions. Although this may seem convenient to the programmer, it sidesteps the intent of the catch or specify requirement and can cause problems for others using your classes.
    Why did the designers decide to force a method to specify all uncaught checked exceptions that can be thrown within its scope? Any Exception that can be thrown by a method is part of the method's public programming interface. Those who call a method must know about the exceptions that a method can throw so that they can decide what to do about them. These exceptions are as much a part of that method's programming interface as its parameters and return value.
    The next question might be: "If it's so good to document a method's API, including the exceptions it can throw, why not specify runtime exceptions too?" Runtime exceptions represent problems that are the result of a programming problem, and as such, the API client code cannot reasonably be expected to recover from them or to handle them in any way. Such problems include arithmetic exceptions, such as dividing by zero; pointer exceptions, such as trying to access an object through a null reference; and indexing exceptions, such as attempting to access an array element through an index that is too large or too small.
    Generally don't catch an exception unless you plan to HANDLE the exception. Logging, by itself is NOT handliing.
    First I found this Java exception handling best practices - How To Do In Java which says that you should never catch the Trowable class nor use e.printStackTrace(); 
    That article, like many, has some good advice and some poor or even bad advice. You get what you pay for!
    I've read that you should not catch the Exception class.
    Ok - but all that does is indicate that a problem of some sort happened somewhere. Not very useful info. Java goes to a lot of trouble to provide specific exceptions for specific problems.
    I've been catching it previously to make sure that some unknown exception doesn't slip through early in the loop and stops all other customers from executing later on in the loop.
    If the exception is 'unknown' then maybe it NEEDS to 'stop all other customers from executing later on in the loop'.
    That is EXACTLY why you don't want to do that. You need to identify which exceptions should NOT stop processing and which ones should.
    Some 'unknown' exceptions can NOT be recovered and indicate a serious problem, perhaps with the JVM itself. You can NOT just blindly keep executing and ignore them without risking data corruption and/or the integrity of the entire system Java is running on.
    Is it OK if you just change the implementation to catch the RuntimeException class instead of the Exception class? We're using Java 7 and the Jetty Servlet Container.
    No - not if you want a well-behaved system.
    Don't catch exceptions unless you HANDLE/resolve them. There are times when it makes sense to log the exception (which does NOT handle it) and then raise it again so that it gets handled properly later. Yes - I know that is contrary to the advice given in that article but, IMHO, that article is wrong about that point.
    If you have ever had to maintain/fix/support someone else's Java code you should already understand how difficult it can be to find WHERE a problem occurs and WHAT the exact problem is when exceptions are not handled properly.

  • I don't know who will see this, but i'm writing this here, because i cound't find any problem report places anywhere.

    I don't know who will see this, but i'm writing this here, because i cound't find any problem report places anywhere. Your site are too confusing. I just wanna say that css3 isn't working properly in mozilla. It lags. Other transitions doesn't work at all. Check this site http://css3exp.com/moon/ on your and on chrome browser to see differences. Could you write me a reply to this... question...? [email protected]

    It appears you have accidentally subscribed to a community and were getting e-mails for all related posts. I have removed the subscriptions, so you should be getting no more e-mails. Thank you for bringing this to our attention. I'm sorry you recieved so many e-mails you did not want.

  • HT5361 Using 10.8.5 - mail requires that I trash emails up to six times before they disappear. Trashed emails reappear in Inbox every time I open my MacBook Pro or when a new batch of emails comes in. Anybody have a solution?

    Using 10.8.5 - Apple mail requires that I trash emails up to six times before they disappear. Trashed emails reappear in Inbox every time I open my MacBook Pro or when a new batch of emails comes in. Anybody have a solution?

    Are you using an icloud account ?
      is the Account Type iCloud IMAP ?
    I just deleted an email withing my iCloud IMAP account
      I right-clicked on the Trash and selected Erase Deleted Items
        and the email is gone..

  • I just got InDesign CS6 and am running it on an iMac and I know the license is good for two computers which will come in very handy for me.  How do I set it up to access it from my second iMac?

    I just got InDesign CS6 and am running it on an iMac and I know the license is good for two computers which will come in very handy for me.  How do I set it up to access it from my second iMac?

    I just had an afterthought, Peter, if I could bother you further; if the downstairs iMac that I want to access it from is in my wife's name and not mine (even though I'll be the one using it on her computer) does that affect anything or can I simply load the software straight into her computer without any complications?

  • Which Book is good for e-commerce using JAVA & XML

    I want to find a Book that is good for e-commerce using JAVA & XML,
    or where can find JAVA & XML new and develop?
    can you suggest me?
    Thanks very much!

    I can recommend "Java and XML" from O'Reilly. It's a very good book.

  • Goods Movement with Batch Management

    Hi,
    During Goods Receipt or One Step transfer posting, I need to search first for a batch with characteristic values, and if a batch already exists in the system with the same characteristic values it posts to the same batch number. If a batch doesn't exist with the characteristic then it assigns a new batch number for the items to be received.
    Ex. I have batch num 1 in the system with characteristics X and Y. I receive new item, and input characteristics X and Z...since it doesnt exist it creates a new batch 2. but if I receive another item with characteristics X and Y, it uses batch 1.
    Is this possible?
    Thanks,
    Lee

    Hi PSantosh,
    How does Batch Derivation exactly work? My purpose is just to get the Batch Number unique with the Lot num and Expiration Date.
    So I cannot have an entry for example:
    Batch Num 001, Lot1234, 01/25/2008
    Batch Num 002, Lot1234, 01/25/2008
    During goods receipt, if I get a material with Lot1234, 01/25/2008 from a Vendor, it must post only to the existing Batch num with Lot1234, 01/25/2008. If it doesn;t exist thats when a new batch is created.
    Thanks,
    Lee

Maybe you are looking for