Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-09-2010, 07:45 PM
Member
 
Join Date: Oct 2008
Posts: 57
Rep Power: 0
lse123 is on a distinguished road
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...

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 07:48 PM.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 02-09-2010, 07:50 PM
Member
 
Join Date: Oct 2008
Posts: 57
Rep Power: 0
lse123 is on a distinguished road
Default line 5 of attachment error....
line 5 of attachment error....

5 import org.apache.commons.beanutils.PropertyUtils; // error here
Attached Files:
File Type: zip ModelFacade.zip (495 Bytes, 0 views)
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 02-10-2010, 10:09 AM
Senior Member
 
Join Date: Apr 2009
Posts: 944
Rep Power: 1
Tolls is on a distinguished road
Default
Does your build script know where the jar file is?
Since you're getting that error I would guess not...
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 02-10-2010, 10:31 AM
Member
 
Join Date: Oct 2008
Posts: 57
Rep Power: 0
lse123 is on a distinguished road
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?
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 02-10-2010, 11:02 AM
Senior Member
 
Join Date: Apr 2009
Posts: 944
Rep Power: 1
Tolls is on a distinguished road
Default
Sorry, I don't have time for running through build scripts and the like...
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 02-10-2010, 11:44 AM
Member
 
Join Date: Feb 2010
Posts: 4
Rep Power: 0
lse123j is on a distinguished road
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:
File Type: txt build.txt (4.6 KB, 1 views)
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 02-10-2010, 11:59 AM
Senior Member
 
Join Date: Apr 2009
Posts: 944
Rep Power: 1
Tolls is on a distinguished road
Default
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...
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 02-10-2010, 12:46 PM
Member
 
Join Date: Oct 2008
Posts: 57
Rep Power: 0
lse123 is on a distinguished road
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...?
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 02-10-2010, 12:58 PM
Senior Member
 
Join Date: Apr 2009
Posts: 944
Rep Power: 1
Tolls is on a distinguished road
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?
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 02-10-2010, 03:26 PM
Member
 
Join Date: Oct 2008
Posts: 57
Rep Power: 0
lse123 is on a distinguished road
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?
Bookmark Post in Technorati
Reply With Quote
  #11 (permalink)  
Old 02-10-2010, 03:33 PM
Senior Member
 
Join Date: Apr 2009
Posts: 944
Rep Power: 1
Tolls is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #12 (permalink)  
Old 02-10-2010, 06:52 PM
Member
 
Join Date: Oct 2008
Posts: 57
Rep Power: 0
lse123 is on a distinguished road
Default
you mean all or most jars must be out of war?
Bookmark Post in Technorati
Reply With Quote
  #13 (permalink)  
Old 02-10-2010, 11:52 PM
Member
 
Join Date: Oct 2008
Posts: 57
Rep Power: 0
lse123 is on a distinguished road
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?
Quote:
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)
Bookmark Post in Technorati
Reply With Quote
  #14 (permalink)  
Old 02-11-2010, 10:46 AM
Senior Member
 
Join Date: Apr 2009
Posts: 944
Rep Power: 1
Tolls is on a distinguished road
Default
You're missing apache commons logging in your applications lib.
Bookmark Post in Technorati
Reply With Quote
  #15 (permalink)  
Old 02-11-2010, 11:36 AM
Member
 
Join Date: Feb 2010
Posts: 4
Rep Power: 0
lse123j is on a distinguished road
Default
what is this briefly... is it file.jar or file.java or...?
Bookmark Post in Technorati
Reply With Quote
  #16 (permalink)  
Old 02-11-2010, 11:57 AM
Senior Member
 
Join Date: Apr 2009
Posts: 944
Rep Power: 1
Tolls is on a distinguished road
Default
It's a jar file.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
small FTP app, commons-net-ftp, problems with run metoda New To Java 1 11-28-2009 06:19 PM
Problems with ftp, commons library jurka Networking 0 09-01-2008 06:46 PM
Commons Library Framework 0.8.0 JavaBean Java Announcements 0 10-02-2007 05:13 PM
Commons validator aczuczor Web Frameworks 0 07-27-2007 09:46 AM
To use BeanUtils Daniel Enterprise JavaBeans 1 06-25-2007 06:22 AM


All times are GMT +2. The time now is 03:14 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org