Announcement Announcement Module
Collapse
No announcement yet.
Ant-generated WAR file produces odd results compared to Eclipse results Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ant-generated WAR file produces odd results compared to Eclipse results

    I typically develop my application with Eclipse WTP, and run Tomcat using their Servers plugin tool. I have now tried to use an ant build.xml file to create a warfile for distribution purposes.

    However, when I load up the warfile by placing it in webapps/ then starting tomcat, it produces odd results. This SimpleFormController view doesn't work at all.
    When I was using Eclipse to run this application, this login screen is fully functional (and there is no ${status.expression} text).

    It doesn't seem totally broken, because for a non-form Controller which just retrieves data from the DB via Hibernate, it works fine.

    Anyone have any ideas as to what could be wrong for my WAR file creation process?

    In my logs, I don't see any warnings or anything serious. Using this
    Code:
    log4j.logger.org.hibernate.tool.hbm2ddl=DEBUG
    log4j.logger.org.springframework=DEBUG
    org.apache.catalina=DEBUG
    log4j.logger.courses=DEBUG
    With Ant, my classpath is the same for both building and for the WEB-INF. It is pointing to a directory containing these jar files:
    Code:
    $ ls WebContent/WEB-INF/lib/ | cat
    activation.jar
    antlr-2.7.6rc1.jar
    asm-attrs.jar
    asm.jar
    cglib-2.1.3.jar
    commons-beanutils-1.7.0.jar
    commons-collections-2.1.1.jar
    commons-lang-2.1.jar
    commons-logging-1.0.4.jar
    commons-logging.jar
    CVS
    db-ojb-1.0.4.jar
    displaytag-1.1.jar
    displaytag-export-poi-1.1.jar
    dom4j-1.6.1.jar
    dom4j-1.6.jar
    ehcache-1.1.jar
    hibernate3.jar
    hsqldb.jar
    itext-1.3.jar
    javax.servlet.jar
    jstl.jar
    jta.jar
    junit.jar
    log4j-1.2.11.jar
    mail.jar
    mysql-connector-java-5.0.3-bin.jar
    quartz-1.5.1.jar
    servlet-api.jar
    spring-hibernate3.jar
    spring.jar
    spring-mock.jar
    standard.jar
    The logs specific to displaying this login screen seem to be okay to me:
    Code:
    2006-10-11 13:31:04,605 DEBUG [courses.controller.LoginController] - Displaying new form 2006-10-11 13:31:04,605 DEBUG [courses.controller.LoginController] - Creating new command of class [courses.command.LoginCredentialsCommand] 2006-10-11 13:31:04,610 DEBUG [org.springframework.beans.CachedIntrospectionResults] - Using cached introspection results for class [courses.command.LoginCredentialsCommand] 2006-10-11 13:31:04,611 DEBUG [courses.controller.LoginController] - showForm()
    2006-10-11 13:31:04,611 DEBUG [courses.controller.LoginController] - loggedInPerson is null 2006-10-11 13:31:04,612 DEBUG [org.springframework.web.servlet.DispatcherServlet] - Rendering view [org.springframework.web.servlet.view.InternalResourceView: name '/WEB-INF/jsp/login.jsp'; URL [/WEB-INF/jsp/login.jsp]] in DispatcherServlet with name 'courses'
    2006-10-11 13:31:04,616 DEBUG [org.springframework.web.servlet.view.InternalResourceView] - Rendering view with name '/WEB-INF/jsp/login.jsp' with model {command=courses.command.LoginCredentialsCommand@1fbc355, org.springframework.validation.BindException.command=org.springframework.validation.BindException: BindException: 0 errors} and static attributes {} 2006-10-11 13:31:04,616 DEBUG [org.springframework.web.servlet.view.InternalResourceView] - Added model object 'org.springframework.validation.BindException.command' of type [org.springframework.validation.BindException] to request in InternalResourceView '/WEB-INF/jsp/login.jsp'
    2006-10-11 13:31:04,617 DEBUG [org.springframework.web.servlet.view.InternalResourceView] - Added model object 'command' of type [courses.command.LoginCredentialsCommand] to request in InternalResourceView '/WEB-INF/jsp/login.jsp'
    2006-10-11 13:31:04,619 DEBUG [org.springframework.beans.BeanWrapperImpl] - About to invoke read method [public java.lang.String courses.command.LoginCredentialsCommand.getUsername()] on object of class [courses.command.LoginCredentialsCommand]
    2006-10-11 13:31:04,621 DEBUG [org.springframework.beans.BeanWrapperImpl] - About to invoke read method [public java.lang.String courses.command.LoginCredentialsCommand.getPassword()] on object of class [courses.command.LoginCredentialsCommand]
    2006-10-11 13:31:04,622 DEBUG [org.springframework.web.servlet.view.InternalResourceView] - Forwarded to resource [/WEB-INF/jsp/login.jsp] in InternalResourceView '/WEB-INF/jsp/login.jsp'

    Any ideas? Thanks

  • #2
    I now realize that the other form type views seem to be fine. So, everything is fine except for this login screen which apparently doesn't bind, or something.

    Still debugging..

    Comment


    • #3
      Problem Fixed

      I fixed the problem, yet I don't understand it yet.

      I was using the implicit commandName = 'command'.
      I changed it to use commandName='login' in the bean xml file, than replaced the word 'command' with 'login' in my login.jsp page.

      It now works

      I have no clue why..

      [edit] and remember that having commandName='command' works fine for eclipse, just not the ant-generated WAR file
      Last edited by veraction; Oct 11th, 2006, 01:22 PM.

      Comment

      Working...
      X