In Tomcat 5.5 I had each app configured as a Host, being served by a
differente domain.
For example these two enabled two different sites under
imobiliario.lardocelar.com and sites_empresa.lardocelar.com
And without any problems. When I wanted to turn off one of them I
would simply comment the Host element (for faster development trial &
error as we have a dozen big apps).
<Host name="imobiliario.lardocelar.com" debug="0"
appBase="c:/caixatec/webapps/imobiliario.com.pt/"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="" debug="1"/>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="imobiliario_log." suffix=".txt"
timestamp="true"/>
</Host>
<Host name="sites_empresa.lardocelar.com" debug="0"
appBase="c:/caixatec/webapps/sites_empresa/"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="" debug="1"/>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="site_empresa_log." suffix=".txt"
timestamp="false"/>
</Host>
My global context.xml is
<Context privileged="true">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<Manager pathname="" />
</Context>
I tried putting the file context.xml in META-INF folder and using an
empty <Context/>
With
<Context/>
I've got a blank page accessing http://sites_empresa.lardocelar.com:8080/
With
<Context path="" docBase=""/>
http://sites_empresa.lardocelar.com:8080/ is OK but underlying folders
are being considered apps and ence the 404 errors for the includes.
So what I need is the value to use in docBase that tells tomcat that
each folder is part of the application served in
http://sites_empresa.lardocelar.com:8080
Or the totally new config that sets my apps as they were in Tomcat 5.5
I am avoiding having my appBase as c:/caixatec/webapps/ and setting
docBase as sites_empresa because that would load all the apps under
webapps folder.
On Fri, Apr 30, 2010 at 12:01 PM, Pid <[email protected]> wrote:
> On 30/04/2010 10:58, Nuno Faria wrote:
>> contactos is a folder in my sites_empresa.lardocelar.com application
>> so the URLs should work fine.
>> In server.xml I have
>>
>> <Engine name="Catalina" defaultHost="localhost">
>>
>> <Host name="localhost" appBase="webapps"
>> unpackWARs="true" autoDeploy="true"
>> xmlValidation="false" xmlNamespaceAware="false">
>>
>> <Host name="sites_empresa.lardocelar.com" debug="0"
>> appBase="c:/caixatec/webapps/sites_empresa/"
>> unpackWARs="true" autoDeploy="true"
>> xmlValidation="false" xmlNamespaceAware="false">
>>
>> <Context path="" docBase="" debug="1"/>
>
> There's a problem with the above, the docBase should not be set to an
> empty value. If you've named the app:
>
> /caixatec/webapps/sites_empresa/ROOT
>
> Then you don't need the above Context definition. Instead place the
> following in:
>
> ROOT/META-INF/context.xml
>
> <Context/>
>
> I think the 'debug' attribute has been removed. See the following URL
> for any attributes you might need to set:
>
> http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
>
>
> p
>
>> <Logger className="org.apache.catalina.logger.FileLogger"
>> directory="logs" prefix="site_empresa_log." suffix=".txt"
>> timestamp="false"/>
>>
>> </Host>
>>
>> </Engine>
>>
>> Following Martin tip I noticed something different from what I would
>> see in Tomcat 5.5.
>>
>> All the JSP files that are on my app ROOT folder compile just fine and
>> the java and classes are generated in
>> C:\caixatec\programs\Apache Software Foundation\Tomcat
>> 6.0\work\Catalina\sites_empresa.lardocelar.com\_\org\apache\jsp
>>
>> However the URL
>> http://sites_empresa.lardocelar.com:8080/includes/application_logger.jsp
>>
>> Generated its class and java files in
>> C:\caixatec\programs\Apache Software Foundation\Tomcat
>> 6.0\work\Catalina\sites_empresa.lardocelar.com\includes\org\apache\jsp
>>
>> Is this normal behaviour in Tomcat 6? I was expecting them at
>> C:\caixatec\programs\Apache Software Foundation\Tomcat
>> 6.0\work\Catalina\sites_empresa.lardocelar.com\_\org\apache\jsp\includes
>
> Yes, the faulty Context definition in server.xml is likely to be causing
> the includes dir to be deployed as it's own application.
>
>
> p
>
>> My problem is that my Tomcat does not compile the JSP files with
>> includes that are in folders under the app root dir.
>> I created test.jsp in folder /contactos/ with simply Hello in its body
>> and all is fine when calling
>> http://sites_empresa.lardocelar.com:8080/contactos/test.jsp
>>
>> Then I changed the content of test.jsp to
>> <%...@include file="/includes/application_logger.jsp"%>
>> Hello
>>
>> Hit refresh and
>>
>> org.apache.jasper.JasperException: /test.jsp(1,2) File
>> "/includes/application_logger.jsp" not found
>>
>> org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
>>
>> org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
>>
>> org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
>>
>> org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:297)
>>
>> org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:330)
>> org.apache.jasper.compiler.Parser.parseDirective(Parser.java:438)
>> org.apache.jasper.compiler.Parser.parseFileDirectives(Parser.java:1745)
>> org.apache.jasper.compiler.Parser.parse(Parser.java:127)
>>
>> org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
>>
>> org.apache.jasper.compiler.ParserController.parseDirectives(ParserController.java:120)
>> org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:180)
>> org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
>> org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
>> org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
>>
>> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
>>
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
>>
>> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
>> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>
>> and
>> http://sites_empresa.lardocelar.com:8080/includes/application_logger.jsp
>>
>> is ok.
>>
>> It can be a relative vs absolute path thing but I don´t have a clue
>> where to fix it.
>>
>>
>> On Thu, Apr 29, 2010 at 9:33 PM, Konstantin Kolinko
>> <[email protected]> wrote:
>>> 2010/4/29 Nuno Faria <[email protected]>:
>>>> Strange thing. This is a fresh install of a 6.0.26 and I had created
>>>> the example from scratch.
>>>> But I did as you suggested and cleaned my work folder and now it compiles!?
>>>>
>>>> The names I used where slightly different but I reverted to mine to
>>>> check it back.
>>>> I attached the files and every one with /subdir/*_nested* gave me a
>>>> compile error that it is now fixed.
>>>>
>>> I cannot reproduce the error with any pages in the examples.zip that
>>> you attached.
>>>
>>> By the way, this list removes attachments, but sometimes they are
>>> visible -- probably when both the sender and the recipient use gmail.
>>>
>>>> Then if i try the missing file
>>>> http://sites_empresa.lardocelar.com:8080/includes/site_parameters.jsp
>>>>
>>>> I get (from the first include in the file)
>>>>
>>>> org.apache.jasper.JasperException: /site_parameters.jsp(6,1) File (...)
>>>
>>> Note that the above line should have mentioned
>>> "/includes/site_parameters.jsp", not "/site_parameters.jsp" as it
>>> does.
>>>
>>> The correct way to call the included file will be
>>> http://sites_empresa.lardocelar.com:8080/contactos/includes/site_parameters.jsp
>>>
>>> if contactos is your web application.
>>>
>>> The paths in @include are relative to the web application and not to
>>> the site root.
>>>
>>> Best regards,
>>> Konstantin Kolinko
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]