You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Patrick Garner <pg...@biostat.ufl.edu> on 2000/03/07 04:19:02 UTC
Problem with Cocoon 1.7 Installation
I have tried to get Cocoon v1.7 installed for two days now before
emailing this listserv so I could try to do it on my own, but I can't
solve this problem. If the solution is simple please forgive my
ignorance as I am a newbie.
I have the following setup:
Red Hat Linux 6.1
Apache 1.3.9
JDK 1.2.2
Jserv 2.1
All of the above have been successfully installed and are working.
/etc/httpd/conf/jserv/jserv.properties looks like this:
wrapper.classpath=/usr/lib/apache/ApacheJServ.jar
wrapper.classpath=/home/httpd/classes/servlet-2.0.jar
wrapper.classpath=/usr/local/jsdk2.1/servlet.jar
wrapper.classpath=/usr/local/jsdk2.1/server.jar
wrapper.classpath=/usr/local/jdk1.2.2/src.jar
wrapper.classpath=/usr/lib/pgsql/jdbc6.5-1.2.jar
wrapper.classpath=/usr/local/cocoon/bin/cocoon.jar
wrapper.classpath=/usr/local/cocoon/lib/xerces_1_0_1.jar
wrapper.classpath=/usr/local/cocoon/lib/xalan_0_19_4.jar
wrapper.classpath=/usr/local/cocoon/lib/fop_0_12_1.jar
I am unable to run /usr/local/cocoon/build.sh without errors. The error
messages are as follows:
*******************************************************************
Cocoon Build System
-------------------
Building with classpath
/usr/local/jsdk2.1/servlet.jar:/usr/lib/pgsql/jdbc6.5-1.
2.jar:.:/usr/local/jdk1.2.2/lib/tools.jar:./lib/xerces_1_0_1.jar:./lib/xalan_0_1
9_4.jar:./lib/fop_0_12_1.jar:./lib/servlet_2_2.jar:./lib/ant.jar:./lib/xml.jar
Starting Ant...
Buildfile: build.xml
Detected Java Version: 1.2
Project base dir set to: /usr/local/cocoon
------------------- Cocoon 1.7 [1999-2000] ----------------
Executing Target: prepare
Executing Target: prepare-xt
Executing Target: prepare-ecma
Executing Target: prepare-ldap
Executing Target: prepare-src
Executing Target: compile
Compiling 5 source files to /usr/local/cocoon/build/classes
/usr/local/cocoon/build/src/org/apache/cocoon/processor/xsp/library/XSPSessionLi
brary.java:107: Method getAttribute(java.lang.String) not found in
interface javax.servlet.http.HttpSession.
Object value = session.getAttribute(name);
^
/usr/local/cocoon/build/src/org/apache/cocoon/processor/xsp/library/XSPSessionLi
brary.java:130: Method getAttributeNames() not found in interface
javax.servlet.http.HttpSession.
Enumeration e = session.getAttributeNames();
^
/usr/local/cocoon/build/src/org/apache/cocoon/processor/xsp/library/XSPResponseL
ibrary.java:77: Method getLocale() not found in interface
javax.servlet.http.Htt
pServletResponse.
Locale locale = response.getLocale();
^
/usr/local/cocoon/build/src/org/apache/cocoon/processor/xsp/library/XSPResponseL
ibrary.java:97: Method addDateHeader(java.lang.String, long) not found
in interface javax.servlet.http.HttpServletResponse.
response.addDateHeader(name, date);
.
.
.
etc. etc. etc.
.
.
.
Note: /usr/local/cocoon/build/src/org/apache/cocoon/Utils.java uses or
overrides
*******************************************************************
I notice that although the missing methods are not found in
HttpServletRequest, there is an EngineWrapper class located in
/usr/local/cocoon/build/src/org/apache/cocoon/EngineWrapper.java that
uses HttpServletRequest and gives to it the above methods that are
"missing":
/**
* This class implements wrapping methods that allow the engine to be
* called even from other APIs or standalone applications.
*
* NOTE: this is a dirty hack and I know it. The problem is that Cocoon
is
* a servlet and the servlet API are not that easy to deal with when you
* enter other modes of operation (like command line or RMI).
*
* We will need to clean this up and remove the need of direct
* HttpServletRequest/Response emulation when we integrate with
Stylebook.
* But I have more important stuff to do right now.
*
* @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
* @version $Revision: 1.9 $ $Date: 2000/02/13 18:29:16 $
*/
.
.
.
/**
* Dummy implementation of the HttpServletRequest class to create a
* fake but funtional request for the main engine.
* NOTE: this works only with the default file producer.
*/
public class HttpServletRequestImpl implements HttpServletRequest {
private String path = "/";
private String document = null;
public HttpServletRequestImpl(File path) {
this(path, null);
}
public HttpServletRequestImpl(File path, String document) {
if (path != null) {
this.path = path.toString();
}
if (document != null) {
this.document = document;
}
}
HERE ARE ALL THE MISSING METHODS: --ed
public Enumeration getParameterNames() { return null; }
public String[] getParameterValues(String name) { return null; }
public int getContentLength() { return -1; }
public String getContentType() { return null; }
public String getProtocol() { return "none"; }
public String getScheme() { return "none"; }
public String getServerName() { return Cocoon.version(); }
public int getServerPort() { return -1; }
public String getRemoteAddr() { return null; }
public String getRemoteHost() { return null; }
public ServletInputStream getInputStream() throws IOException {
return null; }
public Object getAttribute(String name) { return null; }
public String getCharacterEncoding () { return null; }
public Cookie[] getCookies() { return null; }
public String getMethod() { return null; }
public String getRequestURI() { return null; }
public String getServletPath() { return null; }
public String getQueryString() { return null; }
public String getRemoteUser() { return null; }
public String getAuthType() { return null; }
public String getHeader(String name) { return null; }
public int getIntHeader(String name) { return -1; }
public long getDateHeader(String name) { return -1; }
public Enumeration getHeaderNames() { return null; }
public HttpSession getSession(boolean create) { return null; }
public String getRequestedSessionId() { return null; }
public boolean isRequestedSessionIdValid() { return false; }
public boolean isRequestedSessionIdFromCookie() { return false;
}
public boolean isRequestedSessionIdFromURL() { return false; }
public Enumeration getAttributeNames() { return null; }
public void setAttribute(String name, Object value) {}
public void removeAttribute(String name) {}
public Locale getLocale() { return null; }
What do I need to do? Is there a classpath that I need to add? I
greatly appreciate any help!
--Pat Garner
Re: Problem with Cocoon 1.7 Installation
Posted by Donald Ball <ba...@webslingerZ.com>.
I reckon it's that you're compiling against servlet-2.1 but cocoon
requires servlet-2.2 to compile. Mind you, cocoon should _run_ with 2.0,
2.1, or 2.2, but it must have 2.2 to compile properly. Note that you
should probably not have both servlet-2.0 and 2.1 in your server's
CLASSPATH...
- donald
On Mon, 6 Mar 2000, Patrick Garner wrote:
> I have tried to get Cocoon v1.7 installed for two days now before
> emailing this listserv so I could try to do it on my own, but I can't
> solve this problem. If the solution is simple please forgive my
> ignorance as I am a newbie.
>
> I have the following setup:
> Red Hat Linux 6.1
> Apache 1.3.9
> JDK 1.2.2
> Jserv 2.1
> All of the above have been successfully installed and are working.
>
> /etc/httpd/conf/jserv/jserv.properties looks like this:
>
> wrapper.classpath=/usr/lib/apache/ApacheJServ.jar
> wrapper.classpath=/home/httpd/classes/servlet-2.0.jar
> wrapper.classpath=/usr/local/jsdk2.1/servlet.jar
> wrapper.classpath=/usr/local/jsdk2.1/server.jar
> wrapper.classpath=/usr/local/jdk1.2.2/src.jar
> wrapper.classpath=/usr/lib/pgsql/jdbc6.5-1.2.jar
> wrapper.classpath=/usr/local/cocoon/bin/cocoon.jar
> wrapper.classpath=/usr/local/cocoon/lib/xerces_1_0_1.jar
> wrapper.classpath=/usr/local/cocoon/lib/xalan_0_19_4.jar
> wrapper.classpath=/usr/local/cocoon/lib/fop_0_12_1.jar
>
>
>
> I am unable to run /usr/local/cocoon/build.sh without errors. The error
> messages are as follows:
>
> *******************************************************************
> Cocoon Build System
> -------------------
>
> Building with classpath
> /usr/local/jsdk2.1/servlet.jar:/usr/lib/pgsql/jdbc6.5-1.
> 2.jar:.:/usr/local/jdk1.2.2/lib/tools.jar:./lib/xerces_1_0_1.jar:./lib/xalan_0_1
> 9_4.jar:./lib/fop_0_12_1.jar:./lib/servlet_2_2.jar:./lib/ant.jar:./lib/xml.jar
>
> Starting Ant...
>
> Buildfile: build.xml
> Detected Java Version: 1.2
> Project base dir set to: /usr/local/cocoon
> ------------------- Cocoon 1.7 [1999-2000] ----------------
> Executing Target: prepare
> Executing Target: prepare-xt
> Executing Target: prepare-ecma
> Executing Target: prepare-ldap
> Executing Target: prepare-src
> Executing Target: compile
> Compiling 5 source files to /usr/local/cocoon/build/classes
> /usr/local/cocoon/build/src/org/apache/cocoon/processor/xsp/library/XSPSessionLi
> brary.java:107: Method getAttribute(java.lang.String) not found in
> interface javax.servlet.http.HttpSession.
> Object value = session.getAttribute(name);
> ^
> /usr/local/cocoon/build/src/org/apache/cocoon/processor/xsp/library/XSPSessionLi
> brary.java:130: Method getAttributeNames() not found in interface
> javax.servlet.http.HttpSession.
> Enumeration e = session.getAttributeNames();
> ^
> /usr/local/cocoon/build/src/org/apache/cocoon/processor/xsp/library/XSPResponseL
> ibrary.java:77: Method getLocale() not found in interface
> javax.servlet.http.Htt
> pServletResponse.
> Locale locale = response.getLocale();
> ^
> /usr/local/cocoon/build/src/org/apache/cocoon/processor/xsp/library/XSPResponseL
> ibrary.java:97: Method addDateHeader(java.lang.String, long) not found
> in interface javax.servlet.http.HttpServletResponse.
> response.addDateHeader(name, date);
>
> .
> .
> .
> etc. etc. etc.
> .
> .
> .
>
> Note: /usr/local/cocoon/build/src/org/apache/cocoon/Utils.java uses or
> overrides
>
> *******************************************************************
>
> I notice that although the missing methods are not found in
> HttpServletRequest, there is an EngineWrapper class located in
> /usr/local/cocoon/build/src/org/apache/cocoon/EngineWrapper.java that
> uses HttpServletRequest and gives to it the above methods that are
> "missing":
>
> /**
> * This class implements wrapping methods that allow the engine to be
> * called even from other APIs or standalone applications.
> *
> * NOTE: this is a dirty hack and I know it. The problem is that Cocoon
> is
> * a servlet and the servlet API are not that easy to deal with when you
> * enter other modes of operation (like command line or RMI).
> *
> * We will need to clean this up and remove the need of direct
> * HttpServletRequest/Response emulation when we integrate with
> Stylebook.
> * But I have more important stuff to do right now.
> *
> * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
> * @version $Revision: 1.9 $ $Date: 2000/02/13 18:29:16 $
> */
>
> .
> .
> .
>
> /**
> * Dummy implementation of the HttpServletRequest class to create a
> * fake but funtional request for the main engine.
> * NOTE: this works only with the default file producer.
> */
> public class HttpServletRequestImpl implements HttpServletRequest {
>
> private String path = "/";
> private String document = null;
>
> public HttpServletRequestImpl(File path) {
> this(path, null);
> }
>
> public HttpServletRequestImpl(File path, String document) {
> if (path != null) {
> this.path = path.toString();
> }
>
> if (document != null) {
> this.document = document;
> }
> }
>
>
> HERE ARE ALL THE MISSING METHODS: --ed
>
>
> public Enumeration getParameterNames() { return null; }
> public String[] getParameterValues(String name) { return null; }
> public int getContentLength() { return -1; }
> public String getContentType() { return null; }
> public String getProtocol() { return "none"; }
> public String getScheme() { return "none"; }
> public String getServerName() { return Cocoon.version(); }
> public int getServerPort() { return -1; }
> public String getRemoteAddr() { return null; }
> public String getRemoteHost() { return null; }
> public ServletInputStream getInputStream() throws IOException {
> return null; }
> public Object getAttribute(String name) { return null; }
> public String getCharacterEncoding () { return null; }
> public Cookie[] getCookies() { return null; }
> public String getMethod() { return null; }
> public String getRequestURI() { return null; }
> public String getServletPath() { return null; }
> public String getQueryString() { return null; }
> public String getRemoteUser() { return null; }
> public String getAuthType() { return null; }
> public String getHeader(String name) { return null; }
> public int getIntHeader(String name) { return -1; }
> public long getDateHeader(String name) { return -1; }
> public Enumeration getHeaderNames() { return null; }
> public HttpSession getSession(boolean create) { return null; }
> public String getRequestedSessionId() { return null; }
> public boolean isRequestedSessionIdValid() { return false; }
> public boolean isRequestedSessionIdFromCookie() { return false;
> }
> public boolean isRequestedSessionIdFromURL() { return false; }
> public Enumeration getAttributeNames() { return null; }
> public void setAttribute(String name, Object value) {}
> public void removeAttribute(String name) {}
> public Locale getLocale() { return null; }
>
> What do I need to do? Is there a classpath that I need to add? I
> greatly appreciate any help!
>
> --Pat Garner
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>