lavnish lalchandani

Ranch Hand
+ Follow
since Feb 28, 2007
Merit badge: grant badges
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by lavnish lalchandani

I have a war file (GWT app) which

  • works fine in UAT Env 1
  • works fine in Production environment
  • gives below error when deploying in UAT Env 2
  • the jar files ... servlet-api.jar , gwt-user.jar is located in same folder in all the environment
  • as per suggestion below tried deleting the gwt-user.jar from the folder , still same issue just the first line of error disappears

  • INFO: validateJarFile(/.../tomcat/webapps/abc-browser/WEB-INF/lib/gwt-user-1.7.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    Aug 21, 2013 2:35:46 PM org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart
    Aug 21, 2013 2:35:46 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/abc-browser] startup failed due to previous errors

    I have seen similar issues in this forum which advice
    1) link 1 : to delete servlet-api.jar in tomcat\lib : i tried this doesnt help :
    2) link 2 : to change the pom.xml : but same war file ( hence pom ) is working fine in other environments ( esp prod ) :

    Not sure if there is some more debug points , solution ?
    Tried Solution 1 (failed) : manually deleting the gwt-user-1.7.0.jar from WEB-INF\lib of the web application

    Tried Solution 2 (failed) : From dependency tree i get below

    [INFO] +-
    [INFO] | \-
    [INFO] | +- com.extjs:gxt:jar:2.0.1:compile
    [INFO] | \-

    I tried changing the scope of to provided , doesnt help

    Tried Solution 3 (failed) : add exclusion like below


    10 years ago
    thanks for the help guys
    found these links
  • ( clearly says Many applications require the ability to download information from an information repository and operate on this information even when out of range or disconnected. )

  • I guess this is the better approach will try some POC
    11 years ago
    Thanks for the reply chetan & Ulf
    @ Ulf
    so what you are saying if i buy a new Android / iOS phone then it has SQLLite installed on it be default ? to extend this further if i want to use DB for this task then its just a matter of making a new Schema in existing DB server on the mobile ??

    can you point me to more docs , i want to check on different devices ( even ones less memory like 2GB) do they have SQL lite or not
    11 years ago

    I have never written a mobile app , planning to write one now. Need advice on architecture of same.

    Let me first brief on the functionality :

  • Its a kind of "General Knowledge Ques & Ans" application.
  • There will be different categories & in each category there will be different questions.
  • User can scroll through all questions in a category (using Next or Back button) ,
  • For each question there is a "show answer" button , after user has thought of answer can check the same using the button.

  • something like

    Other features
  • should work on all platforms (androids , ios , windows mobile , etc ) hence planning to use phonegap
  • The list of Q&A should be up-datable , like i can give updates having totally new Q&A , or better ans to old questions , or new categories etc
  • The Q&A should be non copyable , like if someone installs the app on his mobile , he should not be able to copy the Q&A list
  • The Q&A list should be stored securely on the mobile
  • allow users to bookmark some ques and later go through only the bookmarked lists
  • should allow users to browse through Q&A in offline mode

  • Planning to use PhoneGap for it. What i am not sure is how to "best" store the Q&A Data securely and efficiently so that my app is not very heavy also ???

    I am aware of two options

    1) Android SQLLite .. if i use this i am sure its secure , and easily updatable BUT i am not sure what to do for iOS and other operating system ? is there a cross platform SQL engine ? wont this be heavy ? i mean every user who wants to use my app would need to install this as well

    2) cant i store the Q&A as encrypted xml files ?? this way it should be easily updatable and what algo should i use for encryption ? will it be safe enough ?? any cross platform library implementing encryption algorithm ?

    3) any other suggestions by experts out there ??
    11 years ago
    i understand your first para , but not 2nd

    Is there any way I can put off persisting to DB till I am done with processing and work with in memory JPA entities.

    regarding above question , you may choose not to do session.comit() till you wish
    but having so much of data in your memory and session level cache will make JVM slow you may see lot of GC and or out of memory

    can you explain more on your 2nd para

    may be by example
    Can you try two things
    1) use query.list() instead of query.getResultList()
    2) also instead of session.createQuery("SELECT p FROM Person p"); you can try session.createQuery("FROM Person");

    one issue i see is ... you are using SETs but not implementing equals() and hashcode() in your POJOs
    may be if you do that then you may not see double inserts
    can you give more details , class structure , also let us know if you are executing using HQL or Criteria or some other way ?
    did you try checking the SQL logs

    ALSO in your config files
    Add lines


    and tell us what is the Exact SQL query is generated
    I understand difference between 1st level and 2nd level cache.
    Wanted to understand How is query level cache different from 1st and 2nd Level Cache

    as per my understanding if i run a query with ? ie

    from employee emp where

    then only it can be cached in a 2nd Level cache … so query like

    from employee emp where

    will not be cached .. to cache these a query cache is used , right ?

    BUT in my code if i have queries as below ... do we see one DB hit or Two DB hit

    from employee emp where

    from employee e where
    // extra spaces in query string + e used instead of emp

    Try iterating over the exception class

    The doc says

    Returns an iterator over the chained SQLExceptions. The iterator will be used to iterate over each SQLException and its underlying cause (if any).

    did you try adding

    to web.xml

    In the JSP you can have If then else ...

    Have been going thru this
    Here in the end example is like

    And in explanation the author says that the result is not picked from cache BUT from DB reason being ... isGettable() method returns false ... i am not sure what is this method ? defined in which standard class or interface ?? AND what to do to make it true / false ??
    doing some further research found this
    But still my questions remain same