Results 1 to 16 of 16
  1. #1
    lse123 is offline Senior Member
    Join Date
    Oct 2008
    Posts
    116
    Rep Power
    0

    Default Example 11-6 JSTL XML Web App / ModelFacade / commons.beanutils.PropertyUtils

    I look everywhere but I can not found error, libraries think ok positioned...well if I want a package from
    import org.apache.commons.beanutils.PropertyUtils
    what alternative exist to import?
    can you detect problem below? I failed during Ant run...

    Java Code:
    C:\Users\User\Documents\TextBooksDataFiles\R+.ex+.Practice works as on\xml-java\Examples11\
    Examples\Example 11-6 JSTL XML Web App>tree
    Folder PATH listing for volume HP
    Volume serial number is 004A0020 92B7:446D
    C:.
    ├───java
    └───webhomecover
        └───WEB-INF
            ├───classes
            │   └───com
            │       └───webhomecover
            │           ├───beans
            │           ├───model
            │           └───util
            └───lib
    
    C:\Users\User\Documents\TextBooksDataFiles\R+.ex+.Practice works as on\xml-java\Examples11\
    Examples\Example 11-6 JSTL XML Web App>ant
    Buildfile: build.xml
    Trying to override old definition of datatype resources
    
    compile:
        [javac] Compiling 5 source files to C:\Users\User\Documents\TextBooksDataFiles\R+.ex+.P
    ractice works as on\xml-java\Examples11\Examples\Example 11-6 JSTL XML Web App\webhomecover
    \WEB-INF\classes
        [javac] C:\Users\User\Documents\TextBooksDataFiles\R+.ex+.Practice works as on\xml-java
    \Examples11\Examples\Example 11-6 JSTL XML Web App\java\ModelFacade.java:5: package org.apa
    che.commons.beanutils does not exist
        [javac] import org.apache.commons.beanutils.PropertyUtils;
        [javac]                                    ^
        [javac] C:\Users\User\Documents\TextBooksDataFiles\R+.ex+.Practice works as on\xml-java
    \Examples11\Examples\Example 11-6 JSTL XML Web App\java\ModelFacade.java:18: cannot find sy
    mbol
        [javac] symbol  : variable PropertyUtils
        [javac] location: class com.webhomecover.model.ModelFacade
        [javac]    PropertyUtils.copyProperties(claim, bean);
        [javac]    ^
        [javac] 2 errors
    
    BUILD FAILED
    C:\Users\User\Documents\TextBooksDataFiles\R+.ex+.Practice works as on\xml-java\Examples11\
    Examples\Example 11-6 JSTL XML Web App\build.xml:57: Compile failed; see the compiler error
     output for details.
    
    Total time: 1 second
    C:\Users\User\Documents\TextBooksDataFiles\R+.ex+.Practice works as on\xml-java\Examples11\
    Examples\Example 11-6 JSTL XML Web App>
    Last edited by lse123; 02-09-2010 at 06:48 PM.

  2. #2
    lse123 is offline Senior Member
    Join Date
    Oct 2008
    Posts
    116
    Rep Power
    0

    Default line 5 of attachment error....

    line 5 of attachment error....

    5 import org.apache.commons.beanutils.PropertyUtils; // error here
    Attached Files Attached Files

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,036
    Rep Power
    20

    Default

    Does your build script know where the jar file is?
    Since you're getting that error I would guess not...

  4. #4
    lse123 is offline Senior Member
    Join Date
    Oct 2008
    Posts
    116
    Rep Power
    0

    Default

    Since this came from Parsons text java & xml by course.co.uk/course.com well you do not think this shouldn't be pre-configured and ready run .... is an example in chapter11 of

    Cengage Learning -Dynamic Web Application Development

    of EXAMPLE 11-6 of zip file of download: Chapter 11 ... can you detect?

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,036
    Rep Power
    20

    Default

    Sorry, I don't have time for running through build scripts and the like...

  6. #6
    lse123j is offline Member
    Join Date
    Feb 2010
    Posts
    6
    Rep Power
    0

    Default what statement to include in attached build.xml.txt

    can you at least tell me, script for the what statement to include in attached build.xml.txt for org.apache.commons.beanutils.PropertyUtils?
    jar in
    /WEB-INF/lib
    Attached Files Attached Files

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,036
    Rep Power
    20

    Default

    Java Code:
      <path id="project-classpath">
       <fileset dir="${tomcat-lib}">
        <include name="*.jar/" />
       </fileset>
       <fileset dir="${tomcat-home}\bin">
        <include name="*.jar/" />
       </fileset>
      </path>
    That bit defines where to look for the jar files needed for compilation.
    All you have in there at the moment is the tomcat directories...

  8. #8
    lse123 is offline Senior Member
    Join Date
    Oct 2008
    Posts
    116
    Rep Power
    0

    Default

    well if put in a tomcat dir may also work? now is in jars along standard.jar, jstl.jar...in web app folder, a non-tomcat folder...?

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,036
    Rep Power
    20

    Default

    You need to add the directory containing all the jars you need to compile this to, presumably, the project class path. DO you understand what that bit of the build file I posted means?

  10. #10
    lse123 is offline Senior Member
    Join Date
    Oct 2008
    Posts
    116
    Rep Power
    0

    Default

    you mean the build.xml who builds and deploy an app, via file.war then, these files (jar) you refer must be inside file.war or in the Tomcat?

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,036
    Rep Power
    20

    Default

    If you're compiling then you have the source files somewhere...before even having a war.

    wars should only have the compiled and deployable application in it.

  12. #12
    lse123 is offline Senior Member
    Join Date
    Oct 2008
    Posts
    116
    Rep Power
    0

    Default

    you mean all or most jars must be out of war?

  13. #13
    lse123 is offline Senior Member
    Join Date
    Oct 2008
    Posts
    116
    Rep Power
    0

    Default

    after put at > C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.18\lib\commons-beanutils-1.7.0.jar
    >I compile SUCCESS BUT GET ERROR[after form submit]:
    MAY FAULT may packages and file.java organization?
    exception

    org.apache.jasper.JasperException: An exception occurred processing JSP page /processclaim.jsp at line 11

    8: <jsp:useBean id="claimBean" class="com.webhomecover.beans.ClaimBean" scope="request"/>
    9: <jsp:setProperty name="claimBean" property="*" />
    10: <jsp:scriptlet>
    11: Claim claim = ModelFacade.createClaim(claimBean);
    12: request.setAttribute("claim",claim);
    13: </jsp:scriptlet>
    14: <jsp:forward page="xmlbeanserverpage.jsp" />


    Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handle JspException(JspServletWrapper.java:505)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:398)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)


    root cause

    javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    org.apache.jasper.runtime.PageContextImpl.doHandle PageException(PageContextImpl.java:852)
    org.apache.jasper.runtime.PageContextImpl.handlePa geException(PageContextImpl.java:781)
    org.apache.jsp.processclaim_jsp._jspService(proces sclaim_jsp.java:77)
    org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)


    root cause

    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    org.apache.commons.beanutils.ConvertUtilsBean.<ini t>(ConvertUtilsBean.java:130)
    org.apache.commons.beanutils.BeanUtilsBean.<init>( BeanUtilsBean.java:110)
    org.apache.commons.beanutils.BeanUtilsBean$1.initi alValue(BeanUtilsBean.java:68)
    org.apache.commons.beanutils.ContextClassLoaderLoc al.get(ContextClassLoaderLocal.java:80)
    org.apache.commons.beanutils.BeanUtilsBean.getInst ance(BeanUtilsBean.java:78)
    org.apache.commons.beanutils.PropertyUtilsBean.get Instance(PropertyUtilsBean.java:101)
    org.apache.commons.beanutils.PropertyUtils.copyPro perties(PropertyUtils.java:140)
    com.webhomecover.model.ModelFacade.createClaim(Unk nown Source)
    org.apache.jsp.processclaim_jsp._jspService(proces sclaim_jsp.java:65)
    org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)


    root cause

    java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
    org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1387)
    org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1233)
    java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:320)
    org.apache.commons.beanutils.ConvertUtilsBean.<ini t>(ConvertUtilsBean.java:130)
    org.apache.commons.beanutils.BeanUtilsBean.<init>( BeanUtilsBean.java:110)
    org.apache.commons.beanutils.BeanUtilsBean$1.initi alValue(BeanUtilsBean.java:68)
    org.apache.commons.beanutils.ContextClassLoaderLoc al.get(ContextClassLoaderLocal.java:80)
    org.apache.commons.beanutils.BeanUtilsBean.getInst ance(BeanUtilsBean.java:78)
    org.apache.commons.beanutils.PropertyUtilsBean.get Instance(PropertyUtilsBean.java:101)
    org.apache.commons.beanutils.PropertyUtils.copyPro perties(PropertyUtils.java:140)
    com.webhomecover.model.ModelFacade.createClaim(Unk nown Source)
    org.apache.jsp.processclaim_jsp._jspService(proces sclaim_jsp.java:65)
    org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)

  14. #14
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,036
    Rep Power
    20

    Default

    You're missing apache commons logging in your applications lib.

  15. #15
    lse123j is offline Member
    Join Date
    Feb 2010
    Posts
    6
    Rep Power
    0

    Default

    what is this briefly... is it file.jar or file.java or...?

  16. #16
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,036
    Rep Power
    20

Similar Threads

  1. small FTP app, commons-net-ftp, problems with run
    By metoda in forum New To Java
    Replies: 1
    Last Post: 11-28-2009, 05:19 PM
  2. Problems with ftp, commons library
    By jurka in forum Networking
    Replies: 0
    Last Post: 09-01-2008, 05:46 PM
  3. Commons Library Framework 0.8.0
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 10-02-2007, 04:13 PM
  4. Commons validator
    By aczuczor in forum Web Frameworks
    Replies: 0
    Last Post: 07-27-2007, 08:46 AM
  5. To use BeanUtils
    By Daniel in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 06-25-2007, 05:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •