cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kowshik.Pod...@wdr.com
Subject RE: Re: problems reading properties parameter in Tomcat web.xml
Date Fri, 28 Apr 2000 14:07:00 GMT
ok, so now I am using absolute paths in my web.xml as follows:

<web-app>
    <servlet>
        <servlet-name>
            cocoon
        </servlet-name>
        <servlet-class>
            org.apache.cocoon.Cocoon
        </servlet-class>

        <init-param>
            <param-name>
                properties
            </param-name>
            <param-value>
                
/home/podderko/docman/tomcat/webapps/cocoon-demo/cocoon.properties
            </param-value>
        </init-param>
    </servlet>

    <servlet-mapping>
        <servlet-name>
            cocoon
        </servlet-name>
        <url-pattern>
            *.xml
        </url-pattern>
    </servlet-mapping>
</web-app>

However, for some reason Cocoon still comes up with a 
FileNotFoundException, loooking for "cocoon" rather than 
"cocoon.properties". Why? 

So I then copied the cocoon.properties file to a file called cocoon, 
and this time there is no FileNotFoundException, but instead this error 
message comes up:

org.xml.sax.SAXException: The markup in the document preceding the root 
element must be well-formed. [FATAL ERROR] [File: 
"file:/home/podderko/docman/tomcat_3.1-final/webapps/cocoon-demo/" 
Line: 1 Column: 1]
              at java.lang.Throwable.fillInStackTrace(Native Method)
              at java.lang.Throwable.fillInStackTrace(Compiled Code)
              at java.lang.Throwable.(Compiled Code)
              at java.lang.Exception.(Compiled Code)
              at org.xml.sax.SAXException.(SAXException.java:71)
              at 
org.apache.cocoon.parser.AbstractParser.fatalError(AbstractParser.java:1
05)
              at 
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1347)
              at 
org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(Compi
led Code)
              at 
org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.dispatc
h(Compiled Code)
              at 
org.apache.xerces.framework.XMLDocumentScanner.parseSome(Compiled Code)
              at 
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1208)
              at 
org.apache.cocoon.parser.XercesParser.parse(XercesParser.java:82)
              at 
org.apache.cocoon.parser.AbstractParser.parse(AbstractParser.java:83)
              at 
org.apache.cocoon.producer.AbstractProducer.getDocument(AbstractProducer
..java:96)
              at org.apache.cocoon.Engine.handle(Compiled Code)
              at org.apache.cocoon.Cocoon.service(Cocoon.java:145)
              at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at 
org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code)
              at 
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:
597)
              at 
org.apache.tomcat.servlets.InvokerServlet.service(InvokerServlet.java:25
7)
              at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at 
org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code)
              at 
org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
              at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(H
ttpConnectionHandler.java:160)
              at 
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java
:338)
              at java.lang.Thread.run(Compiled Code)

Notice that the file not found message refers to the just the directory 
element of the path to the properties file - could someone explain to 
me what's wrong now?

Thanks,

Kosh


> -----Original Message-----
> From: paul 
> Sent: 28 April 2000 14:29
> To: cocoon-users
> Cc: paul
> Subject: FW: Re: problems reading properties parameter in 
> Tomcat web.xml
> 
> 
> The properties path should be a fully qualified path, not one 
> relative to
> the servlet engine. Cocoon doesn't use the servlet engine to open the
> properties file.
> 
> 
> 
> > I'm having a problem understanding how contexts resolve 
> paths given to
> > them. I'm trying to pass Cocoon its initial parameter "properties"
> > which points to it's properties file, and after trying several
> > different paths it still doesn't work.
> >
> > I currently have the following in my context's web.xml file:
> >
> > <web-app>
> >     <servlet>
> >         <servlet-name>
> >             cocoon
> >         </servlet-name>
> >         <servlet-class>
> >             org.apache.cocoon.Cocoon
> >         </servlet-class>
> >
> >         <init-param>
> >             <param-name>
> >                 properties
> >             </param-name>
> >             <param-value>
> >                 /cocoon.properties
> >             </param-value>
> >         </init-param>
> >     </servlet>
> >
> >     <servlet-mapping>
> >         <servlet-name>
> >             cocoon
> >         </servlet-name>
> >         <url-pattern>
> >             *.xml
> >         </url-pattern>
> >     </servlet-mapping>
> > </web-app>
> >
> > From what I have read, I assumed that this would look for the
> > cocoon.properties file in the context root (in this case
> > webapps/cocoon-demo), but Cocoon responds with a 
> FileNotFoundException.
> > I have tried paths relative to the context and tomcat, as 
> well absolute
> > paths on the filesystem - placing the properties file in 
> various places
> > -  but none of these have worked. I get the following error 
> when I call
> > Cocoon by itself, e.g. 
> http://mytomcatserver/cocoon-demo/servlet/cocoon
> >
> >
> >       java.io.FileNotFoundException: /cocoon.properties (No 
> such file
> > or directory)
> >               at java.io.FileInputStream.open(Native Method)
> >               at java.io.FileInputStream.open(Compiled Code)
> >               at java.io.FileInputStream.(Compiled Code)
> >               at
> > org.apache.cocoon.framework.Configurations.(Configurations.java:89)
> >               at
> > org.apache.cocoon.framework.Configurations.(Configurations.java:77)
> >               at org.apache.cocoon.Cocoon.init(Cocoon.java:111)
> >               at
> > org.apache.tomcat.core.ServletWrapper.initServlet(Compiled Code)
> >               at
> > org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code)
> >               at
> > 
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWra
> pper.java:
> > 597)
> >               at
> > 
> org.apache.tomcat.servlets.InvokerServlet.service(InvokerServl
> et.java:25
> > 7)
> >               at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >               at
> > org.apache.tomcat.core.ServletWrapper.handleRequest(Compiled Code)
> >               at
> > 
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
> >               at
> > 
> org.apache.tomcat.service.http.HttpConnectionHandler.processCo
> nnection(H
> > ttpConnectionHandler.java:160)
> >               at
> > 
> org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEnd
> point.java
> > :338)
> >               at java.lang.Thread.run(Thread.java:479)
> >
> > Can someone who's got Cocoon working with Tomcat, explain to me how
> > they have configured the properties parameter?
> > I'm doing wrong?
> >
> > Cheers,
> >
> > Kosh
> >
> >
> > This message contains confidential information and is intended only
> > for the individual named.  If you are not the named addressee you
> > should not disseminate, distribute or copy this e-mail.  Please
> > notify the sender immediately by e-mail if you have received this
> > e-mail by mistake and delete this e-mail from your system.
> >
> > E-mail transmission cannot be guaranteed to be secure or error-free
> > as information could be intercepted, corrupted, lost, destroyed,
> > arrive late or incomplete, or contain viruses.  The sender therefore
> > does not accept liability for any errors or omissions in 
> the contents
> > of this message which arise as a result of e-mail transmission.  If
> > verification is required please request a hard-copy version.  This
> > message is provided for informational purposes and should not be
> > construed as a solicitation or offer to buy or sell any 
> securities or
> > related financial instruments.
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 


This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.


Mime
View raw message