Nulls from HashMap.get(Object)

I understand that I get the nulls because the Object is not in the map. But is there some elegant way to have it default to the empty String?
Right now, after I grab all my data into variable with HashMap.get(Object), I go and check each once for null, and assign it the empty String instead. This is a lot of lines of code for something that is so basic.
I know i could initialize them all to the empty string, and then for each variable, check the HashMap with containsKey(Object) before assigning with HashMap.get(Object). Now, would I be correct in assuming the compiler would optimize this for me and not actually check the HashMap twice for the same Object? And... even if that is the case, its still just as many lines of code.
Is there perhaps some more elegant way?
String exchange = parameterMap.get("exchange");
String messageType = parameterMap.get("messagetype");
String traderTimeStamp = parameterMap.get("traderTimeStamp");
String exchangeTimeStamp = parameterMap.get("exchangeTimeStamp");
String sequence = parameterMap.get("sequence");
String product = parameterMap.get("product");
String quantity = parameterMap.get("quantity");
String price = parameterMap.get("price");
if (exchange == null)
exchange = "";
if (messageType == null)
messageType = "";
if (traderTimeStamp == null)
traderTimeStamp = "";
if (exchangeTimeStamp == null)
exchangeTimeStamp = "";
if (sequence == null)
sequence = "";
if (product == null)
product = "";
if (quantity == null)
quantity = "";
if (price == null)
price = "";

You could first put "" for all potential keys.
Or you could create a helper method
public String nonNull(String s) {
  return (s != null) ? s : "";
String exchange = nonNull(parameterMap.get("exchange"));

Similar Messages

  • Looking up values from Map/HashMap  when Objects are used as keys

    I'm trying to understand why Map/HashMap don't test for equals() when looking up a key ( which is an Object that overrides equals() and hashCode()) in the Map.
    I've written this code, based on some code from the SCJP book, but it is not exactly the same, this code talks about a different issue not addressed in the book.
    I've added my questions inside the comments below, I think that is the best way I can ask it.
    import java.util.*;
    class Bird{
         public String name;
         public Bird(String name){
              this.name = name;
         //Override equals()
         public boolean equals(Object o){
              if(((Bird)o).name.equals(this.name)){
                   return true;
              }else{
                   return false;
            //Override hashCode
         public int hashCode(){
              return name.length();
    class TestMapLookup{
         static public void main(String[] args){
              Map<Object, Object> hashMap = new HashMap<Object, Object>();
              Bird b = new Bird("crow");
              hashMap.put(b, "somevalue");
              //according to the book, the map object calls the key's (Bird object's)
              //hashCode() first and then equals()
              //to find this key in the map
              System.out.println(hashMap.get(b));
              //Using the b reference to lookup value
              //ouputs - somevalue
              System.out.println(hashMap.get(new Bird("crow")));
              //Using a new Bird object to lookup value
              //outputs - somevalue
              //because Bird overrides equals and hashCode
              //otherwise we'd get null
              //Now change the name of the bird in the b reference
              b.name = "sparrow";
              //Notice that the crow's hashCode is 4
              //sparrow's hashCode is 7 , in the above implementation of hashCode
              System.out.println(hashMap.get(b));
              //Again using b reference to lookup value
              //ouputs - null
              //because the hashCode of b.name does not match
              //the hashCode of any of the keys stored in the map
              System.out.println(hashMap.get(new Bird("crow")));
              //This also outputs null
              //for the same reason that there's no key in the map
              //with a hashcode of 7
              //This is where it becomes strange......................
              //Change the name of the bird in the b reference
              //so that the new name has the same hashCode, as the key in the map
              b.name = "dove";
              System.out.println(hashMap.get(b));
              //In the above - the hashCode matches
              //but equals() fails
              //even though equals() fails, the key is still located and the value is output
              //output is "somevalue"
              //same here:
              b.name = "1234";
              System.out.println(hashMap.get(b));
              //output is "somevalue" instead of null
              b.name = "abcd";
              System.out.println(hashMap.get(b));
              //output is "somevalue" instead of null
              //why does it output "somevalue" instead of null , even though when the map
              //looks up the key , equals() returns false?     
              System.out.println(hashMap.get(new Bird("crow")));
              //In this case ( new Bird reference ) it prints null
    }I'm aware of best practices in coding and coding conventions but haven't used them here, because this is in preparation for SCJP - which tests on a lot of different things.
    I appreciate any info.

    It is correct that b is referring to the same object that the map's key is pointing to, but why does the following
    print null , instead of "somevalue"?
    at these lines in the code above.
    b.name = "sparrow";
    System.out.println(hashMap.get(b));Because the hashCode used when you stored b was 4, and now it's 7. You should read the Wikipedia article on Hashtable, but a simplistic explanation is that a HashMap has a bunch of "buckets," say 10, each indexed with a number 0-9. To decide which bucket to put a new key-value pair in, you take the hashcode (say 2112) and take the remainder of hashcode/number of buckets (in this case, 2112%10=2). So when you store the key-value, it gets "put" in this bucket.
    When you change the hashcode of b by changing its name attribute, it doesn't change the fact that the pair is in that bucket. But, it now looks in the wrong bucket and so can't find the pair.
    A hashtable gets its good efficiency by not having to look through all values to find the pair. It can jump directly to the correct bucket, which takes constant time instead of being dependent on the number of items in the collection.
    endasil wrote:
    You should never, ever change an object being used as a key in a map.I guess this is a best practice, I just wanted to try changing the key object to test a few things for SCJP, which does not test on coding best practices but tests on how the code behaves.Yep, and what you should take away is that this is WHY it's bad to change the key :).

  • Getting intermittent AccessViolationExceptions when accessing stores from Outlook.Stores object

    We have a very strange situation in which we get random AccessViolationExceptions when trying to access stores (in particular our own) via the Outlook.Stores.
    Here's a code snippet of how we're calling this (currently done in our Outlook.ExplorerEvents_ActivateEventHandler handler, and only the first time is is called)
    Outlook.NameSpace ns = ThisAddIn.OutlookApplication.GetNamespace("MAPI");
    Outlook.Stores stores = ns.Stores;
    Outlook.Store store = null;
    int nStoreCount = stores.Count;
    for (int i = 1; i < nStoreCount; i++)
    store = stores[i];
    String name = store.DisplayName;
    store = null;
    When we get to the point of accessing a store via index, we will sometimes get the AccessViolationException, but only sometimes and only (as far as I can tell, since the order isn't always the same from run to run) our message store.
    We originally had this bit of code in our ThisAddin_Startup sequence, but it would actually crash Outlook completely when the exception occurred, so I moved it out of there and it at least now doesn't bring down the whole application.
    MFCMAPI has no trouble opening the message store ever.
    I have seen some references in my research to problems with .net 4.0 and earlier with regards to SynchronizationContext being null, and we are using 4.0 and getting null SynchronizationContext.current values. But we get that when the exception doesn't happen,
    too, so I don't know if that's a red herring. However, this code is a back-port from a newer version of our software that was coded against .Net 4.5, and we don't see the issue there at all. As this is going into a patch, build with VS2010, we can't change
    the target platform.
    I have tried moving the call to worker threads, and I even saw one suggestion of trying to do it in our Outlook.ExplorerEvents_SelectionChangeEventHandler code, but nothing seems to work.
    I should note that after the exception occurs, and the Outlook Explorer window opens and populates, if the user manually clicks our message store node, the MSProviderInit->IMSProvider::Logon sequence fires, and fires without the MDB_NO_DIALOG flag being
    sent in. During Outlook's start-up, we get that sequence of calls several times, but always with the MDB_NO_DIALOG set, so we return MAPI_E_LOGON_FAILED and don't execute the code which creates our IMsgStore object. So the user's manual operation causes our
    IMsgStore to get created and everything is fine. The reason the above code is added is to try to simulate the user's manual action and sort of 'tickle' the store creation process.
    When the AccessViolationException does not occur, we get the full MSProviderInit->IMSProvider::Logon, etc sequence. When it does except, we don't even get our MSProviderInit entry point called. It's almost as if our dll gets loaded and then Outlook loses
    it.
    Any thoughts on this?

    Hi Kevin Delgado,
    >>if somebody knows what these other flags mean/are defined as in the context of the IMSProvider::Logon call, that would be great<<
    Did you mean that the value of ulFlags? If yes, you can refer to the document below:
    ulFlags                               
    [in] A bitmask of flags that controls how the logon is performed. The following flags can be set:
    MAPI_DEFERRED_ERRORS                   
    The call is allowed to succeed even if the underlying object is not available to the calling implementation. If the object is not available, a subsequent call to the object might raise an error.
    MAPI_UNICODE                   
    The passed-in strings are in Unicode format. If MAPI_UNICODE is not set, the strings are in ANSI format.
    MDB_NO_DIALOG                   
    Prevents the display of logon dialog boxes. If this flag is set, the error value MAPI_E_LOGON_FAILED is returned if the logon is unsuccessful. If this flag is not set, the message store provider can prompt the user to correct a name or password, to insert
    a disk, or to perform other actions that are necessary to establish connection to the store.
    MDB_NO_MAIL                   
    The message store should not be used for sending or receiving mail. The flag signals MAPI not to notify the MAPI spooler that this message store is being opened. If this flag is set and the message store is tightly coupled with a transport provider,
    the provider does not need to call the IMAPISupport::SpoolerNotify method.
    MDB_TEMPORARY                   
    Logs on the store so that information can be retrieved programmatically from the profile section, without use of dialog boxes. This flag instructs MAPI that the store is not to be added to the message store table and that the store cannot be made permanent.
    If this flag is set, message store providers do not need to call the IMAPISupport::ModifyProfile method.
    MDB_WRITE                   
    Requests read/write permission.
    Also you can get more detail about IMSProvider::Logon function from link below:
    https://msdn.microsoft.com/en-us/library/office/cc842201.aspx
    Hope it is hlepful.
    Regards & Fei
    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.

  • !!! Storing and Getting data  from HashMap !!!

    Hi ,
    I have got a doubt if this is possible .. Please let me know if this can be implemented ..
    I have a Process1 running which stores data into HashMap one by one from the Users.
    Eg:
    Key Object
    1 ---> Karthik
    2 ---> Raaghav
    3 ---> Srikanth
    and so on ..
    Now what i internally do is i will wait for 5 min Duration (Session TimeOut).Once it is Over 5 min I will delete it from HashMap and Store it in a file ..
    Iam also using WebServer Eg:Iplanet .
    Now when i Shut down Iplanet all the data in the HashMap is Lost .
    My Requirement is to write another Process2 which will be invoked as soon as Iplanet is ShutDown and This process has to read the data from HashMap which is not Timed out .And write it into the File ..
    Q1)Please Let me know if this is can be Done ..
    Task Done :
    Process1 is already existing
    Doubts :
    Q2)If we write a Process2 will it spawn another VM or it will take the same VM that of the Process1.
    Becos if it spawns another VM then I will not be able to get the data from HashMap of the Process1..
    Thanks in Advance,
    [email protected]

    Thank You for the ..
    But my prblm is that the Process1 is already Existing which reads and writes in to HashMap ( Not a Servlets) ..Its a Pure Java Code ..
    And Now the requirement is another Process2 lets say which is put in thread (running in background )which gets the data from the HashMap of the Process1 or in other words Use the Same HashMap and not a different One ...
    Process1 ------------------>HashMap
    (write.java) (writes data ) /\
    |
    |
    |(get Data)
    |
    |
    |
    Process2
    I hope iam clear with my requirement ..
    If Any further explanation Required Iam perpared to give ..Please let me know
    thanks in advance ..

  • !!!! Storing and Getting Data from HashMap !!! VERY URGENT

    Hi ,
    I have got a doubt if this is possible .. Please let me know if this can be implemented ..
    I have a Process1 running which stores data into HashMap one by one from the Users.
    Eg:
    Key Object
    1 ---> Karthik
    2 ---> Raaghav
    3 ---> Srikanth
    and so on ..
    Now what i internally do is i will wait for 5 min Duration (Session TimeOut).Once it is Over 5 min I will delete it from HashMap and Store it in a file ..
    Iam also using WebServer Eg:Iplanet .
    Now when i Shut down Iplanet all the data in the HashMap is Lost .
    My Requirement is to write another Process2 which will be invoked as soon as Iplanet is ShutDown and This process has to read the data from HashMap which is not Timed out .And write it into the File ..
    Q1)Please Let me know if this is can be Done ..
    Task Done :
    Process1 is already existing
    Doubts :
    Q2)If we write a Process2 will it spawn another VM or it will take the same VM that of the Process1.
    Becos if it spawns another VM then I will not be able to get the data from HashMap of the Process1..
    Thanks in Advance,
    [email protected]

    You need to consider the following
    -------Normal execution:
    Keep a list of all instances of the HashMap and a timestamp for each. Start a timer thread (or use the jdk api Timer class). Fire it every minute, or 5 minutes, or hour - the length depends on how your system runs - load, fail-safe, etc. When the timer fires, any instances with expired timestamps are written.
    -------Graceful Shutdown:
    If you have a way to exit your application gracefully then rbyrom suggestion is needed. Basically it writes all existing instances in the list on shutdown.
    -------Abnormal events
    What do you do if the disk drive is full and you can't write data?
    -------Abnormal shutdown
    What happens if someone pulls the plug on the server? How important is the data?

  • Trying to create a Photomerge in Bridge, when the files open in Photoshop ( small jegs ) , I get a error message of " Unable to process latte files " / " null is not an object "

    Trying to create a Photomerge in Bridge, when the files open in Photoshop ( small jegs ) , I get a error message of " Unable to process latte files " / " null is not an object "
    Please help

    Wait a second, Photoshop can make lattes now?  Personally I prefer my coffee black, but man have I been under-utilizing this program.

  • How can I get the value of a custom property from a resource object?

    I am trying to get the value(s) of a custom property, called "status" within a method. The method has an object of type IResource available to it.
    I have tried the following:
    PropertyName propName = new PropertyName("","status");
    value = res.getProperty(propName).toString();
    However, I am getting a NullPointerException when I try to create the PropertyName instance.
    Is there a better way to get the value of a specific property from a resource object?
    Thanks,
      Tom

    Thanks Praveen.
    I was missing the default namespace of "http://sapportals.com/xmlns/cm" - I thought I could just pass an empty string for the namespace, but it looks like I must always specifiy, even if it is default.
    Tom

  • How can I get the Doc object from any other object?

    Dear colleagues,
    in FrameScript it is dead-simple to get to the document part of any object, just add .Doc to the variable.
    How can I achieve the same with ExtendScript? I amtired of passing the document object next to AFrames or Pgfs along into subroutines, because those objects already contain the information about their document. But how do I access this?
    Thanks for pointers,
    - Michael
    PS: Almost the same is true for the page an object lives on. With FrameScript we use .Page, with ExtendScript you have to move up the object tree until you reach the UnanchoredFrame.PageFramePage…
    PPS: It would be great to see some convenience properties like .Doc and .Page implemented natively.

    I'll preface this response by admitting this far from an elegant solution, but I did write a function addressing this question, mostly as an exercise.
    If passed an object with an InTextFrame property (Pgf, AFrame, Cell, Fn) that resides in an open document, the function will return the Doc object. Otherwise, it returns undefined.
    function getParentDoc(testObj) {
        //Get object for current page
        try { var curPage = testObj.InTextFrame.FrameParent.PageFramePage; }
        catch(er) {return;}
        //Step backwards to first page in document
        var prevPage = curPage.PagePrev;
        while (prevPage.ObjectValid())
            curPage = prevPage;
            prevPage = prevPage.PagePrev;
        //Compare with first pages of open documents
        var testDoc = app.FirstOpenDoc;
        while (testDoc.ObjectValid())
            if (curPage.id==testDoc.FirstBodyPageInDoc.id) return testDoc;
            testDoc = testDoc.NextOpenDocInSession;    
        return;
    To your PPS: Rather than seeing the native framework grow bloated to address additional features, I would love to see Adobe and other developers publish libraries of useful functions and class extensions.

  • How do I get date and time component from a DATE object?

    Hi All,
    I need to get date and time separately from a DATE object, does
    anyone know what function I should call? GetDate()? GetTime()?
    I need this in a SELECT statement.
    Thanks in advance and looking forward to your early reply.
    Regards.
    Gladywin
    30/11/2001

    Hello,
    See following SQL.
    select to_char(sysdate,'dd/mm/rrrr') today_date,
    to_char(sysdate,'hh24:mi') now_time
    from dual
    Adi

  • How to get the  name of color from the Color Object??

    hi all,
    i want to get the color name from the Color Object i.e say if the Color object is something like
    c=new Color(128,128,128);
    I should be a able to say this object is of gray color dynamically
    Can anyone help???

    You can't do this. There is no label for a color - what is 0x439803 called? 'Mud?' 'Rustic sludge?' 'Poo brown?' - and then that's just English, it might need to be 'Brun de Kaka' or something.
    If you want to check against a certain predefined color you could do the following,
    if (Color.GRAY.equals(myColor))Otherwise you'll have to write your own code to label colors.

  • How do I get the client IP Address from the HTTPServletRequest object

    Hi ppl,
    How do I get the IP address of the client machine from the HTTPServletRequest object?
    Thnx in advance,
    Manoj

    Take a look at: http://java.sun.com/products/servlet/2.2/javadoc/index.html and check for the ServletRequest Interface.
    Be aware also if your web server is using proxy, proxyReverse and so because you could end getting the servers' IP and not client one.

  • Map.get(K) and Map.get(Object)

    When I first saw the new 2.0 generics compiler, I was very pleased to see that the signature of Map.get() has changed (since 1.3) from:
        interface Map<K,V> { V get(Object obj); }to:
        interface Map<K,V> { V get(K key); }because it means buggy code like this:
        Map<File,Integer> fileSizeMap = new HashMap<File,Integer>();
        Integer sizeOfFile = fileSizeMap.get("/tmp/foo");
        if (sizeOfFile == null) {
            System.err.println("File not found in map");
        }(where I have mistakenly called Map.get() with a String rather than a File) will now get a compiler error rather than a fault raised several months after the application has gone live.
    So, as I say, I am very pleased with the new signature for Map.get(), although I would also like to see the following methods changed:
        boolean containsKey(Object)   -> boolean containsKey(K)
        boolean containsValue(Object) -> boolean containsValue(V)
        V remove(Object object)       -> V remove(K)However, I just read on http://cag.lcs.mit.edu/~cananian/Projects/GJ/Bugs/v20/map.html that Neal Gafter says that putting Map.get(K) into 2.0 was a mistake, and that it will be put back to Map.get(Object) in the next version.
    I do hope I haven't missed something obvious, but keeping these methods with Object parameters seems to me to be a backwards step from the excellent type safety benefits provided by Generics.
    Does anyone else agree with me that having get(K) would be beneficial in allowing the compiler to identify bugs that would otherwise only be discovered much later?
    Or, could someone explain to me why having get(Object) is preferable, and whether this reason is more important than the type safety issue I identified in my example code above?
    Many thanks in advance
    Geoff

    Gafter wrote:
    The reason the argument type is Object and not K is that existing code depends on the fact
    that passing the "wrong" key type is allowed, causes no error, and simply results in the
    key not being found in the map.But "existing code" does not use Generics, and therefore as with all other non-generic code, the authors of that code can choose to either leave it as it is (in which case their Maps will become Map<Object,Object> and Map.get() will then take an Object), or to upgrade it to Generics, and take advantage of the helpful compiler messages that may highlight some design flaws in the original code.
    In Jakarta Commons Collections (this is "existing code"), there's a class MultiHashMap which extends HashMap. When you call MultiHashMap.put(someKey, someValue) it appends someValue to an ArrayList that gets stored as the value in the HashMap. However when you call MultiHashMap.get(someKey), it returns a Collection of values, rather than just a single value.
    If they try to upgrade MultiHashMap to Generics, they are going to come up with a problem: they would be needing something like this:
        public class MultiHashMap<K,V> extends HashMap<K,V> {
            public V put(K key, V value) { ... }
            public Collection<V> get(K key) { ... }
        }which of course is not allowed, since Map<K,V>.get() returns V, not Collection<V>.
    Now, I don't hear anyone saying: This "existing code" relies on Map.get() returning an Object, so in Generics we're going to make Map.get() return Object rather than V.
    No, instead we (correctly) say: That MultiHashMap code was wrong to abuse the flexibility provided by the use of Object as the return value of Map.get(), and if it wishes to use Generics, it will either need to become MultiHashMap<K,Object>, or if it insists on being MultiHashMap<K,V>, it will not be allowed to extend HashMap.
    I really don't see the problem in using Generics (and a typesafe Java Collections API) as a means of highlighting problems in existing code. As I said before, existing code will continue to work as before, because List will become List<Object> and Map will become Map<Object,Object>.
    This is no worse than "accidentally" trying to get() with a key of the right
    type but the wrong value. Since none of these methods place the key into the
    map, it is entirely typesafe to use Object as the method's parameter.Suppose for a moment that when String.endsWith() was first written, it took an Object parameter instead of a String. If I were to say to you: This method needs to change its parameter from Object to String, would you tell me that that there's no need to make the change, because a String can only ever end in a String, and so it is entirely typesafe to use Object as the method's parameter?
    Geoff

  • ConcurrentModificationException when removing from hashmap

    Why when i remove an object from a HashMap in an iterator loop, i get: ConcurrentModificationException, in the call to Next()???
    This is the code:
    HashMap mapa;
    Object temp=null;
    Set keys=mapa.keySet();
    for(Iterator iter=keys.iterator();iter.hasNext();cont++){
    Object key=iter.next(); //getting an exception here after calling remove
    temp=mapa.get(key);
    SomeClass.process($temp);
    mapa.remove(key);
    is there a way to remove each object after i process it (to free memory)?

    DrLaszloJamf wrote:
    Exactly, what i think is , iter.remove() will remove the reference , but mapa.remove(key) will remove the reference and the object too, won't it?We seem to be talking around in circles, but I will give it another try:
    iter.remove() removes the (key, value) entry from the map (of the key last returned by iter.next()).
    mapa.remove(key) removes the (key, value) entry from the map (of the given key).Ok, i get it. The thing is that in the profiler , the number of objects doen't seem to decrease while i'm removin the objects while looping the hashmap, that's why i t thought it wasn't working, but i print the number of items left int the hashmap and it is decreasing....

  • Nullpointer exception while multiple users reading from XML DOM object

    We are getting a null pointer exception when we are trying to read from a Static XML DOM object . We are getting the exception in weblogic 7.1 very rarely but started getting the exception in weblogic 9.2 more frequently. When multiple users are trying to access the Static variable we are getting null pointer exception. I think it is a memory related issue. Making the whole method synchronized is resolving the issue. But that is not the right thing to do. Can any one know what might be the issue here?
    I am giving the code and the XML. I have tried to give the latest Xerces parser from the Apache site but got the same exception. Please help me in this regard.
    The XML is also provided below along with the code.
    package com.test;
    import java.beans.BeanInfo;
    import java.beans.Introspector;
    import java.util.ArrayList;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    //import org.apache.xml.serialize.XMLSerializer;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    public class ObjectPersistanceXMLParser {
         public static volatile Document configXML;
         * @param objectName
         * @param attributeName
         * @return
         * @throws Throwable
         public static ArrayList getData(String objectName,String attributeName) throws Exception
              Node ndDoc = getXMLDoc();
              Node ndRoot = ndDoc.getFirstChild();
              NodeList ndFirstList = ndRoot.getChildNodes();
              BeanInfo bi = Introspector.getBeanInfo(ndFirstList.getClass());
              System.out.println("****** "+bi.getBeanDescriptor().getBeanClass().getName());
              System.out.println("This is the number of child nodes present:"+ndFirstList.getLength()+":::"+ndFirstList.item(0).getNodeValue());
              ArrayList returnResult = null;
              String strReturnResult = null;
              for(int i=0;i<ndFirstList.getLength();i++)
                   if(ndFirstList.item(i).getNodeName().equals("ObjectDBMapping"))
                        NodeList ndObjectList = ndFirstList.item(i).getChildNodes();
                        for(int j=0;j<ndObjectList.getLength();j++)
                             if(ndObjectList.item(j).getNodeName().equals("Object"))
                                  if(ndObjectList.item(j).getAttributes().getNamedItem("NAME").getNodeValue().equalsIgnoreCase(objectName))
                                       NodeList ndFieldList = ndObjectList.item(j).getChildNodes();
                                       for(int k=0;k<ndFieldList.getLength();k++)
                                            if(ndFieldList.item(k).getNodeName().equals("field"))
                                                 if(ndFieldList.item(k).getAttributes().getNamedItem("NAME").getNodeValue().equalsIgnoreCase(attributeName))
                                                      returnResult = new ArrayList();
                                                      returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("SOURCE_TABLE").getNodeValue());
                                                      returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("SOURCE_COLUMN").getNodeValue());
                                                      returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("TYPE").getNodeValue());
                                                      returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("PERSIST").getNodeValue());
                                                      returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("DEFAULT_VALUE").getNodeValue());
                                                      returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("PRIMARY_KEY").getNodeValue());
                                                      returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("VERSIONABLE").getNodeValue());
                                                      returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("PRECISION").getNodeValue());
                                                      returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("FOREIGN_KEY").getNodeValue());
                                                      returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("PARENT_TABLE").getNodeValue());
                                                      returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("PARENT_COLUMN").getNodeValue());
                                                      returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("LEVEL").getNodeValue());
                                                      //return returnResult;
              if(strReturnResult == null){
                   System.out.println("This is the current state of dom: ");
                   //printDom((Document)ndDoc);
                   if(!attributeName.trim().equalsIgnoreCase("class") &&
                        !attributeName.trim().equalsIgnoreCase("operationFlag")&&
                        !attributeName.trim().equalsIgnoreCase("primaryKeyColumnName")&&
                        !attributeName.trim().equalsIgnoreCase("tableName"))               
                        System.out.println("No DB Mapping found for Object "+objectName+" and attribute "+attributeName);
              return returnResult;
         * @param objectName
         * @param tableName
         * @return
         * @throws Throwable
         public static int getMaxFields(String objectName,String tableName) throws Throwable
              Node ndDoc = getXMLDoc();
              Node ndRoot = ndDoc.getFirstChild();
              NodeList ndFirstList = ndRoot.getChildNodes();
              int returnResult = 0;
              for(int i=0;i<ndFirstList.getLength();i++)
                   if(ndFirstList.item(i).getNodeName().equals("ObjectDBMapping"))
                        NodeList ndObjectList = ndFirstList.item(i).getChildNodes();
                        for(int j=0;j<ndObjectList.getLength();j++)
                             if(ndObjectList.item(j).getNodeName().equals("Object"))
                                  if(ndObjectList.item(j).getAttributes().getNamedItem("NAME").getNodeValue().equalsIgnoreCase(objectName))
                                       NodeList ndFieldList = ndObjectList.item(j).getChildNodes();
                                       for(int k=0;k<ndFieldList.getLength();k++)
                                            if(ndFieldList.item(k).getNodeName().equals("field"))
                                                 if(ndFieldList.item(k).getAttributes().getNamedItem("SOURCE_TABLE").getNodeValue().equalsIgnoreCase(tableName) &&
                                                           ndFieldList.item(k).getAttributes().getNamedItem("PERSIST").getNodeValue().equalsIgnoreCase("Y"))
                                                      returnResult++;
              return returnResult;
         /*This method returns a Document Object of the ObjectConfig.xml file. This method is separated
         * out from the calling method to keep an option OPEN in case it is later decided to read XML
         * from memory instead of physical location.*/
         public static Document getXMLDoc() throws Exception
              if(configXML == null)
                   synchronized (ObjectPersistanceXMLParser.class)
                        if(configXML == null)
                             if(System.getProperty("OBJECT-CONFIG-XML") == null){
                                  System.out.println("System Property OBJECT-CONFIG-XML not found");
                             String filePath = System.getProperty("OBJECT-CONFIG-XML");
                             System.out.println("Reading CONFIG Xml from file - "+filePath);
                             DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
                             BeanInfo bi = Introspector.getBeanInfo(docBuilderFactory.getClass());
                             System.out.println("****** "+bi.getBeanDescriptor().getBeanClass().getName());
                             try
                        DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
                        configXML = docBuilder.parse(filePath);
                   }catch(Throwable t)
                        int errorCode = 111;
                        String errorMsg = "Problem in parsing OBJECT-CONFIG-XML file";
                        System.out.println(errorMsg);
              else
                   System.out.println("Config XML Loaded from memory.....new");
    return configXML;
         public static void main(String args[]) throws Throwable
         /*public synchronized static void printDom(Document doc){
              XMLSerializer ser = new XMLSerializer(System.out, null);
              try {
                   ser.serialize(doc);
              } catch (Throwable e) {
                   e.printStackTrace();
              System.out.flush();
    <?xml version="1.0"?><root>
         <ObjectDBMapping>
              <Object NAME="com.los.common.entity.LoanTask">
                   <field NAME="loanTaskId" SOURCE_TABLE="UW_LOAN_TASKS"
                        SOURCE_COLUMN="LOAN_TASK_ID" TYPE="NUMBER" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="Y"
                        VERSIONABLE="Y" FOREIGN_KEY="N" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="taskId" SOURCE_TABLE="UW_LOAN_TASKS"
                        SOURCE_COLUMN="TASK_ID" TYPE="NUMBER" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="Y" PARENT_TABLE="UWM_TASK_MASTER" PARENT_COLUMN="TASK_ID">
                   </field>
                   <field NAME="taskName" SOURCE_TABLE="UW_LOAN_TASKS"
                        SOURCE_COLUMN="TASK_NAME" TYPE="VARCHAR2" LENGTH="100"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="taskStatus" SOURCE_TABLE="UW_LOAN_TASKS"
                        SOURCE_COLUMN="TASK_STATUS" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="taskCreationDate" SOURCE_TABLE="UW_LOAN_TASKS"
                        SOURCE_COLUMN="TASK_CREATION_DATE" TYPE="DATE" LENGTH=""
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="taskClosureDate" SOURCE_TABLE="UW_LOAN_TASKS"
                        SOURCE_COLUMN="TASK_CLOSURE_DATE" TYPE="DATE" LENGTH=""
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="taskClosedBy" SOURCE_TABLE="UW_LOAN_TASKS"
                        SOURCE_COLUMN="TASK_CLOSED_BY" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="updatedDate" SOURCE_TABLE="UW_LOAN_TASKS"
                        SOURCE_COLUMN="UPDATED_DATE" TYPE="DATE" LENGTH=""
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="updatedBy" SOURCE_TABLE="UW_LOAN_TASKS"
                        SOURCE_COLUMN="UPDATED_BY" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="createdDate" SOURCE_TABLE="UW_LOAN_TASKS"
                        SOURCE_COLUMN="CREATED_DATE" TYPE="DATE" LENGTH=""
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="createdBy" SOURCE_TABLE="UW_LOAN_TASKS"
                        SOURCE_COLUMN="CREATED_BY" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
              </Object>
              <Object NAME="com.los.common.entity.LOSUnderwritingRules">
                   <field NAME="undwRunRuleId" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="UNDW_RUN_RULE_ID" TYPE="NUMBER" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="Y"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="underwritingRunNo" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="UNDERWRITING_RUN_NO" TYPE="NUMBER" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="underwritingRunId" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="UNDERWRITING_RUN_ID" TYPE="NUMBER" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="ruleGroup" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="RULE_GROUP" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="ruleName" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="RULE_NAME" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="messageCode" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="MESSAGE_CODE" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="messageText" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="MESSAGE_TEXT" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="passFail" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="PASS_FAIL" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="overrideAuthorityLevel" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="OVERRIDE_AUTHORITY_LEVEL" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="overrideYN" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="OVERRIDE_Y_N" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="overrideBy" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="OVERRIDE_BY" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="overrideOn" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="OVERRIDE_ON" TYPE="DATE" LENGTH=""
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="createdBy" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="CREATED_BY" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="updatedBy" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="UPDATED_BY" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="createdDate" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="CREATED_DATE" TYPE="DATE" LENGTH=""
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="updatedDate" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="UPDATED_DATE" TYPE="DATE" LENGTH=""
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="processName" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="PROCESS_NAME" TYPE="VARCHAR2" LENGTH="100"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="overrideReason" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="OVERRIDE_REASON" TYPE="VARCHAR2" LENGTH="1000"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="messageModule" SOURCE_TABLE="UW_UNDERWRITING_RULES"
                        SOURCE_COLUMN="MESSAGE_MODULE" TYPE="VARCHAR2" LENGTH="30"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
              </Object>
              <Object NAME="com.los.common.entity.Applicant">
                   <field NAME="applicantId" SOURCE_TABLE="UW_APPLICANT_MASTER"
                        SOURCE_COLUMN="APPLICANT_ID" TYPE="NUMBER" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="Y"
                        VERSIONABLE="N" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
              <field NAME="registrationNumber" SOURCE_TABLE="UW_APPLICANT_MASTER"
                        SOURCE_COLUMN="REGISTRATION_NUMBER" TYPE="NUMBER" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="N" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="cifNumber" SOURCE_TABLE="UW_APPLICANT_MASTER"
                        SOURCE_COLUMN="CIF_NUMBER" TYPE="NUMBER" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="N" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                        </field>
              <field NAME="customerStatus" SOURCE_TABLE="UW_APPLICANT_MASTER"
                        SOURCE_COLUMN="CUSTOMER_STATUS" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="N" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
              <field NAME="customerType" SOURCE_TABLE="UW_APPLICANT_MASTER"
                        SOURCE_COLUMN="CUSTOMER_TYPE" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="N" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
              <field NAME="applicantLastName" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                        SOURCE_COLUMN="APPLICANT_LAST_NAME" TYPE="VARCHAR2" LENGTH="100"
                        PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
              <field NAME="applicantFirstName" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="APPLICANT_FIRST_NAME" TYPE="VARCHAR2" LENGTH="100"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="applicantMiddleName" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="APPLICANT_MIDDLE_NAME" TYPE="VARCHAR2" LENGTH="100"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="applicantNameSuffix" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="APPLICANT_NAME_SUFFIX" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="nationality" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="NATIONALITY" TYPE="VARCHAR2" LENGTH="100"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="age" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="AGE" TYPE="NUMBER" LENGTH="5"
                   PRECISION="2" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="dateOfBirth" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="DATE_OF_BIRTH" TYPE="DATE" LENGTH=""
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="identificationType1" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="IDENTIFICATION_TYPE1" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="identificationType2" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="IDENTIFICATION_TYPE2" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="identificationType" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="IDENTIFICATION_TYPE" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="identificationNumber1" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="IDENTIFICATION_NUMBER1" TYPE="VARCHAR2" LENGTH="100"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="identificationNumber2" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="IDENTIFICATION_NUMBER2" TYPE="VARCHAR2" LENGTH="100"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="identificationNumber" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="IDENTIFICATION_NUMBER" TYPE="VARCHAR2" LENGTH="100"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="guarantorIndicator" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="GUARANTOR_INDICATOR" TYPE="VARCHAR2" LENGTH="50"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="separateCobDisclosureRequir" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="SEPARATE_COB_DISCLOSURE_REQUIR" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="domesticRisk" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="DOMESTIC_RISK" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="crossBorderRisk" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="CROSS_BORDER_RISK" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="title" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="TITLE" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="previousSurname" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="PREVIOUS_SURNAME" TYPE="VARCHAR2" LENGTH="50"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="legalName" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="LEGAL_NAME" TYPE="VARCHAR2" LENGTH="200"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="preferredName" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="PREFERRED_NAME" TYPE="VARCHAR2" LENGTH="50"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="gender" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="GENDER" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="seniorCitizenStatus" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="SENIOR_CITIZEN_STATUS" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="staffIndicator" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="STAFF_INDICATOR" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="warVeteranIndicator" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="WAR_VETERAN_INDICATOR" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="noOfDependants" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="NO_OF_DEPENDANTS" TYPE="NUMBER" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="maritalStatus" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="MARITAL_STATUS" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="educationStatus" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="EDUCATION_STATUS" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="detApplicantId" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="APPLICANT_ID" TYPE="NUMBER" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="Y" PARENT_TABLE="UW_APPLICANT_MASTER" PARENT_COLUMN="APPLICANT_ID">
              </field>
              <field NAME="detApplicantDetailId" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="APPLICANT_DETAIL_ID" TYPE="NUMBER" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="Y"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="usResidentIndicator" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="US_RESIDENT_INDICATOR" TYPE="VARCHAR2" LENGTH="1"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="employeeNumber" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="EMPLOYEE_NUMBER" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              <field NAME="isdefaulter" SOURCE_TABLE="UW_APPLICANT_DETAILS"
                   SOURCE_COLUMN="ISDEFAULTER" TYPE="VARCHAR2" LENGTH="20"
                   PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
                   VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
              </field>
              </Object>
              <Object NAME="com.los.common.entity.ApplicantContact">
                   <field NAME="applicantId" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
                        SOURCE_COLUMN="APPLICANT_ID" TYPE="NUMBER" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="Y" PARENT_TABLE="UW_APPLICANT_MASTER" PARENT_COLUMN="APPLICANT_ID">
                   </field>
                   <field NAME="contactId" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
                        SOURCE_COLUMN="CONTACT_ID" TYPE="NUMBER" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="Y"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="addressType" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
                        SOURCE_COLUMN="ADDRESS_TYPE" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="applicantAddressLine1" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
                        SOURCE_COLUMN="APPLICANT_ADDRESS_LINE_1" TYPE="VARCHAR2" LENGTH="100"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="applicantAddressLine2" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
                        SOURCE_COLUMN="APPLICANT_ADDRESS_LINE_2" TYPE="VARCHAR2" LENGTH="100"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="applicantAddressLine3" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
                        SOURCE_COLUMN="APPLICANT_ADDRESS_LINE_3" TYPE="VARCHAR2" LENGTH="100"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="applicantAddressLine4" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
                        SOURCE_COLUMN="APPLICANT_ADDRESS_LINE_4" TYPE="VARCHAR2" LENGTH="100"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="residingSince" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
                        SOURCE_COLUMN="RESIDING_SINCE" TYPE="DATE" LENGTH=""
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="residentialStatus" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
                        SOURCE_COLUMN="RESIDENTIAL_STATUS" TYPE="VARCHAR2" LENGTH="20"
                        PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
                        VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
                   </field>
                   <field NAME="applicantEMa

    Could you please provide the stack trace?

  • Error: The report source could not be retrieved from the state object.

    I have been trying to create a report in a JSF page. The relevant parts are below:
    Inside the JSP page, this is the code:
                  <jsp:useBean id="MyBean" class="com.nm.facade.rto.POJOViewerBean" scope="session" />
                    <jsp:setProperty name="MyBean" property="reportLocation" value="Report1.rpt" />
                   <v:reportPageViewer reportSource="#{MyBean.reportSource}"
                                           displayToolbarPrintButton="true"
                                           printMode="ActiveX"
                                           zoomPercentage="100"
                                           displayToolbarExportButton="true"
                                           displayToolbarRefreshButton="true"
                                           viewerName="My Viewer"
                   ></v:reportPageViewer>
    In the backing bean, this is the relevant code:
        public Object getReportSource() throws ReportSDKException
            if (propertiesChanged || reportSource == null)
                propertiesChanged = false;
                if (reportLocation == null)
                    throw new RuntimeException("The reportLocation property must be set before a report source is retrieved");
                ReportClientDocument rcd = new ReportClientDocument();
                rcd.setReportAppServer(ReportClientDocument.inprocConnectionString);
                rcd.open(reportLocation, 0);
                DatabaseController dbc = rcd.getDatabaseController();
                //Create the POJO collection and populate it with data
                ReportData[] data =
                  new ReportData("B.B.", "King", 6, new Date(25, 9, 16)),
                    new ReportData("Muddy", "Waters", 7, new Date(15, 4, 4)),
                    new ReportData("John Lee", "Hooker", 8, new Date(16, 8, 16)),
                    new ReportData("Otis", "Rush", 9, new Date(34, 4, 29)),
                    new ReportData("Buddy", "Guy", 10, new Date(36, 7, 30))
                //Create the result set from the collection of POJOs
                POJOResultSetFactory factory = new POJOResultSetFactory(ReportData.class);
                factory.setVerbose(true);
                POJOResultSet results = factory.createResultSet(data);
                ResultSetMetaData metaData = results.getMetaData();
                //Set the resultset as the report datasource
                      //Get the table name from the 'Set Datasource Location' dialog in the Crystal Reports designer
                String reportTable = "getReportDataDataSource";
                dbc.setDataSource(results, reportTable, reportTable);       
                IReportSource reportSource = rcd.getReportSource();
                if (reportSource == null)
                    throw new RuntimeException("Unable to get a report source.");
            return reportSource;
    In the CRConfig.xml, this is what is there:
    <?xml version="1.0" encoding="utf-8"?>
    <CrystalReportEngine-configuration>
        <reportlocation>../reports</reportlocation>
        <timeout>0</timeout>
        <ExternalFunctionLibraryClassNames>
             <classname></classname>
        </ExternalFunctionLibraryClassNames>
    </CrystalReportEngine-configuration>
    The report template 'Report1.rpt' is packaged under WEB-INF/reports in the war file.
    When I try to generate the report by accessing the JSF page, I am getting an error: "The report source could not be retrieved from the state object. "
    I am not sure what is wrong. Can someone help me in resolving this issue?
    Edited by: renshai on Jul 9, 2009 3:21 AM

    My formatting gets lost and the message looks unintelligible. After some experimentation, I found that if the message exceeds some length, the formatting is removed. Since I couldn't find any way to delete this post, I made another post with the same subject. Please ignore this post and help me to find a solution for the problem posted in the other thread with the same subject. Thanks in advance.

Maybe you are looking for

  • Installer failed to initialize... unable to install CS 5.5 - PLEASE HELP Student in finals week!

    Problem:  “Installer failed to initialize.  Please download Adobe Support Advisor to detect the problem” Background:  Windows 8 became corrupt and I had to perform a full Windows Recovery (the “Remove everything and reinstall Windows” type). Current

  • Quick question about BB Curve

    I am currenty with Roger's and I am switching my data plan to a BB data plan, I am about to purchase a BB Curve from EBay but before I do I am wondering if I need to buy an "unlocked" BB so that it will work with my provider?

  • Can I stream e mails from iPad to TV using Apple TV

    Can I stream e mails to a TV using iPad and Apple TV. I do not want to use TV as keep board only for visual purpose.

  • Audigy 2 zs Platinum Pro...Game Cras

    Ok I just recently built a new system. Doesn't matter what game whether it is FarCry, COD2, BF2, Doom3 any of them all crash at random parts. When Windows recovers it says it was due to a Creative driver. I have an Audigy 2 ZS Platinum Pro (which I h

  • Invalid Catalog btree depth information (4,1)

    What does this mean on my MacBookPro? Why can I no longer run Drive Genius to defrag the hard drive. Is my hard drive getting ready to fail or is this a leopard issue?