Results 1 to 16 of 16
- 02-09-2010, 06:45 PM #1
Senior Member
- Join Date
- Oct 2008
- Posts
- 116
- Rep Power
- 0
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.
- 02-09-2010, 06:50 PM #2
Senior Member
- Join Date
- Oct 2008
- Posts
- 116
- Rep Power
- 0
line 5 of attachment error....
line 5 of attachment error....
5 import org.apache.commons.beanutils.PropertyUtils; // error here
- 02-10-2010, 09:09 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Does your build script know where the jar file is?
Since you're getting that error I would guess not...
- 02-10-2010, 09:31 AM #4
Senior Member
- Join Date
- Oct 2008
- Posts
- 116
- Rep Power
- 0
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?
- 02-10-2010, 10:02 AM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Sorry, I don't have time for running through build scripts and the like...
- 02-10-2010, 10:44 AM #6
Member
- Join Date
- Feb 2010
- Posts
- 6
- Rep Power
- 0
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
- 02-10-2010, 10:59 AM #7
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
That bit defines where to look for the jar files needed for compilation.Java Code:<path id="project-classpath"> <fileset dir="${tomcat-lib}"> <include name="*.jar/" /> </fileset> <fileset dir="${tomcat-home}\bin"> <include name="*.jar/" /> </fileset> </path>
All you have in there at the moment is the tomcat directories...
- 02-10-2010, 11:46 AM #8
Senior Member
- Join Date
- Oct 2008
- Posts
- 116
- Rep Power
- 0
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...?
- 02-10-2010, 11:58 AM #9
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
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?
- 02-10-2010, 02:26 PM #10
Senior Member
- Join Date
- Oct 2008
- Posts
- 116
- Rep Power
- 0
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?
- 02-10-2010, 02:33 PM #11
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
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.
- 02-10-2010, 05:52 PM #12
Senior Member
- Join Date
- Oct 2008
- Posts
- 116
- Rep Power
- 0
you mean all or most jars must be out of war?
- 02-10-2010, 10:52 PM #13
Senior Member
- Join Date
- Oct 2008
- Posts
- 116
- Rep Power
- 0
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)
- 02-11-2010, 09:46 AM #14
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
You're missing apache commons logging in your applications lib.
- 02-11-2010, 10:36 AM #15
Member
- Join Date
- Feb 2010
- Posts
- 6
- Rep Power
- 0
what is this briefly... is it file.jar or file.java or...?
- 02-11-2010, 10:57 AM #16
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Similar Threads
-
small FTP app, commons-net-ftp, problems with run
By metoda in forum New To JavaReplies: 1Last Post: 11-28-2009, 05:19 PM -
Problems with ftp, commons library
By jurka in forum NetworkingReplies: 0Last Post: 09-01-2008, 05:46 PM -
Commons Library Framework 0.8.0
By JavaBean in forum Java SoftwareReplies: 0Last Post: 10-02-2007, 04:13 PM -
Commons validator
By aczuczor in forum Web FrameworksReplies: 0Last Post: 07-27-2007, 08:46 AM -
To use BeanUtils
By Daniel in forum Enterprise JavaBeans (EJB)Replies: 1Last Post: 06-25-2007, 05:22 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks