You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tomas Rodriguez <ad...@yahoo.ca> on 2009/03/20 09:21:20 UTC
mysql + tomcat work already but I need to reconfigurate the tomcat for load the examples in other location of the hard driver
Hi everyone
Thanks for the help.
I have mysql server + tomcat 6.0 running together already, but now I have a
problem.
my page jsp example I save in the directory
c:/tomcat6.0/webapps/examples/jsp, because I tried to copy for other
location in the server W2K and dosen't work when I load in the IE, by this
reason I decided to save for that location.
but now I wanna have in other directory my web pages examples, for instance
in d:\websites\examplesJSP,
what variable I need to change in the apache tomcat for work?, what files in
the server apache tomcat can I change?
Somebody can Help me again please!!!
thanks
have a good day
TOMAS
--------------------------------------------------
From: "Rusty Wright" <ru...@gmail.com>
Sent: Thursday, March 19, 2009 8:40 PM
To: "Tomcat Users List" <us...@tomcat.apache.org>
Subject: Re: configuration about tomcat for work with mysql/J connector
> http://lmgtfy.com/?q=tomcat+mysql+tutorial
>
> E.g.,
>
> http://www.roseindia.net/mysql/mysqldatabase.shtml
>
>
> Tomas Rodriguez wrote:
>> Hi all
>> I'm new in Tomcat and java, I installed already Tomcat 6.0 for windows
>> 2000, I have to mysql server and the connector/j for work together mysql
>> and Tomcat.
>> I declare a variable for connector mysql/j in panel
>> control/system/advance(enviroment variable) , this variable have the
>> mysql connector path,
>> I test the tomcat doing http://localhost:8080 and every is ok, but my
>> problem is.
>>
>> How Can I know that my connector java work with mysql without any
>> problem?, what file I'll need change in the directory tomcat .
>> please somebody can help me, I wanna learn tomcat for developer a project
>> very important to me.
>>
>> thanks
>> have a great day.
>> sincerely
>> TOMAS
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: HTTP Status 500 The server encountered an internal error ()
that prevented it from fulfilling this request
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Tomas Rodriguez [mailto:admhardsoft@yahoo.ca]
> Subject: Re: HTTP Status 500 The server encountered an internal error
> () that prevented it from fulfilling this request
> I put inside of the directory example/jsp my pagejava1jsp and I loaded
> with IE at the http://127.0.0.1:8080/examples/jsp/pagejava1.jsp
> and the web page work fine, but I change for other location in
> d:/websites/tomcatwebsite , then the page not work and show me error
> 500.
This is very confusing. What do you mean by "other location"? Please post your conf/server.xml, and the contents of all files you have in Tomcat's conf/Catalina/localhost directory.
> I have http apache in my pc too.
Why? You don't need it to run Tomcat, and it will only complicate things at this point.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: HTTP Status 500 The server encountered an internal error () that prevented it from fulfilling this request
Posted by Tomas Rodriguez <ad...@yahoo.ca>.
That's very odd - never seen it before. Your Tomcat installation may be
damaged, or you may have added extra classes that you shouldn't have to your
webapp. Refresh our memories:
I put inside of the directory example/jsp my pagejava1jsp and I loaded with
IE at the http://127.0.0.1:8080/examples/jsp/pagejava1.jsp
and the web page work fine, but I change for other location in
d:/websites/tomcatwebsite , then the page not work and show me error 500.
howevere here is the information that you requested me.
> 1) What version of Tomcat are you using?
6.0.18
> 2) What JRE/JDK are you using?
1.5
> 3) Have you added any jars or classes to Tomcat's lib directory?
NONE
> 4) What jars are in your webapp's WEB-INF/lib directory?
conection to mysql server 5
> 5) What classes are in your webapp's WEB-INF/classes directory?
NONE
I wanna have in other directory all example in java that I wanna build by
myself, that all, that I wanna.
I have http apache in my pc too.
thanks so much
TOMAS
--------------------------------------------------
From: "Caldarale, Charles R" <Ch...@unisys.com>
Sent: Saturday, March 28, 2009 12:07 PM
To: "Tomcat Users List" <us...@tomcat.apache.org>
Subject: RE: HTTP Status 500 The server encountered an internal error ()
that prevented it from fulfilling this request
>> From: Tomas Rodriguez [mailto:admhardsoft@yahoo.ca]
>> Subject: HTTP Status 500 The server encountered an internal error ()
>> that prevented it from fulfilling this request
>>
>> I don't know what is the context for my new file web.xml
>
> Simple webapps may not need a WEB-INF/web.xml at all.
>
>> I wrote this context inside it.
>> ----------------------------------------------------------
>> <?xml version="1.0" encoding="iso-8859-1"?>
>>
>> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>> http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
>> version="2.5">
>>
>> <welcome-file-list>
>> <welcome-file>index.html</welcome-file>
>> <welcome-file>index.htm</welcome-file>
>> <welcome-file>index.jsp</welcome-file>
>> </welcome-file-list>
>> </web-app>
>> --------------------------------------------------
>
> The above is a waste of time, since it merely duplicates configuration
> data in conf/web.xml, which is automatically included in all webapps. It
> doesn't hurt, but it doesn't accomplish anything.
>
>> java.lang.ClassCastException:
>> org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to
>> org.apache.AnnotationProcessor
>> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:146)
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
>> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
>> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
> That's very odd - never seen it before. Your Tomcat installation may be
> damaged, or you may have added extra classes that you shouldn't have to
> your webapp. Refresh our memories:
>
> 1) What version of Tomcat are you using?
>
> 2) What JRE/JDK are you using?
>
> 3) Have you added any jars or classes to Tomcat's lib directory?
>
> 4) What jars are in your webapp's WEB-INF/lib directory?
>
> 5) What classes are in your webapp's WEB-INF/classes directory?
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: HTTP Status 500 The server encountered an internal error ()
that prevented it from fulfilling this request
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Tomas Rodriguez [mailto:admhardsoft@yahoo.ca]
> Subject: HTTP Status 500 The server encountered an internal error ()
> that prevented it from fulfilling this request
>
> I don't know what is the context for my new file web.xml
Simple webapps may not need a WEB-INF/web.xml at all.
> I wrote this context inside it.
> ----------------------------------------------------------
> <?xml version="1.0" encoding="iso-8859-1"?>
>
> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
> version="2.5">
>
> <welcome-file-list>
> <welcome-file>index.html</welcome-file>
> <welcome-file>index.htm</welcome-file>
> <welcome-file>index.jsp</welcome-file>
> </welcome-file-list>
> </web-app>
> --------------------------------------------------
The above is a waste of time, since it merely duplicates configuration data in conf/web.xml, which is automatically included in all webapps. It doesn't hurt, but it doesn't accomplish anything.
> java.lang.ClassCastException:
> org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to
> org.apache.AnnotationProcessor
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:146)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
That's very odd - never seen it before. Your Tomcat installation may be damaged, or you may have added extra classes that you shouldn't have to your webapp. Refresh our memories:
1) What version of Tomcat are you using?
2) What JRE/JDK are you using?
3) Have you added any jars or classes to Tomcat's lib directory?
4) What jars are in your webapp's WEB-INF/lib directory?
5) What classes are in your webapp's WEB-INF/classes directory?
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: HTTP Status 500 The server encountered an internal error ()
that prevented it from fulfilling this request
Posted by Martin Gainty <mg...@hotmail.com>.
you may have wrong version catalina.jar in your classpath
I would try renaming stray catalina.jar (possibly in WEB-INF/lib folder)
and reload the webapp
see if that helps
Saludos Cordiales desde EEUU
Martin
______________________________________________
Disclaimer and confidentiality note
This message is confidential and may be privileged. If you are not the intended recipient, we kindly ask you to please inform the sender. Any unauthorised dissemination or copying hereof is prohibited. This message serves for information purposes only and shall not have any legally binding effect. Given that e-mails can easily be subject to manipulation, we can not accept any liability for the content provided.
> From: admhardsoft@yahoo.ca
> To: users@tomcat.apache.org
> Subject: HTTP Status 500 The server encountered an internal error () that prevented it from fulfilling this request
> Date: Sat, 28 Mar 2009 10:24:31 -0400
>
> Thanks Charles.
>
> I have been following you , I created all file and directory step by step,
> but I don't know what is the context for my new file web.xml, however I
> wrote this context inside it.
> ----------------------------------------------------------
> <?xml version="1.0" encoding="iso-8859-1"?>
>
> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
> version="2.5">
>
> <welcome-file-list>
> <welcome-file>index.html</welcome-file>
> <welcome-file>index.htm</welcome-file>
> <welcome-file>index.jsp</welcome-file>
> </welcome-file-list>
> </web-app>
> --------------------------------------------------
>
> That it. what context should I include inside?. I'm not use any servlet, my
> example is simple, a few line for connection with a DB in mysql and that it.
> I don't have any other file such as classes or servlet or something like
> that.
>
> in the file create the file C:\tomcat6.0\conf\Catalina\localhost\tomas.xml
> I wrote this.
> ------------
> <?xml version="1.0" encoding="iso-8859-1"?>
> <Context docBase="D:/websites/tomcatwebsite" />
> ------------
>
> when I tried to load my example page http://127.0.0.1:8080/tomas, the
> navigator show me this error now.
>
> --------------------------------------------------------------------------------
> HTTP Status 500 -
>
> type Exception report
>
> message
>
> description The server encountered an internal error () that prevented it
> from fulfilling this request.
>
> exception
>
> org.apache.jasper.JasperException: java.lang.ClassCastException:
> org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to
> org.apache.AnnotationProcessor
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
>
> root cause
>
> java.lang.ClassCastException:
> org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to
> org.apache.AnnotationProcessor
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:146)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
>
> note The full stack trace of the root cause is available in the Apache
> Tomcat/6.0.18 logs.
>
> -----------------------------------------
>
> thanks charles for huge help to me.
> have a good day.
> sincerely
> Tomas Rodriguez
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
_________________________________________________________________
Internet Explorer 8 – Get your Hotmail Accelerated. Download free!
http://clk.atdmt.com/MRT/go/141323790/direct/01/
HTTP Status 500 The server encountered an internal error () that prevented it from fulfilling this request
Posted by Tomas Rodriguez <ad...@yahoo.ca>.
Thanks Charles.
I have been following you , I created all file and directory step by step,
but I don't know what is the context for my new file web.xml, however I
wrote this context inside it.
----------------------------------------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
version="2.5">
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
--------------------------------------------------
That it. what context should I include inside?. I'm not use any servlet, my
example is simple, a few line for connection with a DB in mysql and that it.
I don't have any other file such as classes or servlet or something like
that.
in the file create the file C:\tomcat6.0\conf\Catalina\localhost\tomas.xml
I wrote this.
------------
<?xml version="1.0" encoding="iso-8859-1"?>
<Context docBase="D:/websites/tomcatwebsite" />
------------
when I tried to load my example page http://127.0.0.1:8080/tomas, the
navigator show me this error now.
--------------------------------------------------------------------------------
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it
from fulfilling this request.
exception
org.apache.jasper.JasperException: java.lang.ClassCastException:
org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to
org.apache.AnnotationProcessor
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.ClassCastException:
org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to
org.apache.AnnotationProcessor
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:146)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.18 logs.
-----------------------------------------
thanks charles for huge help to me.
have a good day.
sincerely
Tomas Rodriguez
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: error with tomcat HTTP Status 404 The requested resource() is
not available
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Tomas Rodriguez [mailto:admhardsoft@yahoo.ca]
> Subject: error with tomcat HTTP Status 404 The requested
> resource() is not available
>
> c:\tomcay6.0\conf\Catalina\localhost\tomas.xml
I hope that was tomcat6.0, not tomcay6.0.
> <Context docBase="d:/examplestomcat">
You're missing the closing slash; the above should be:
<Context docBase="d:/examplestomcat"/>
> I wrote http://127.0.0.1:8080/tomas, but at the end I can see
> anything, just show me an error.
>
> the error is:
>
> HTTP Status 404 - /tomas/
Did you put a welcome file in D:\examplestomcat? If not, you should get a 404.
> The requested resource (/tomas/) is not available.
What's in the Tomcat logs? Did you get any errors trying to deploy the webapp?
> I don't know what should I do with the web.xml.
Read the servlet spec, and build a web.xml appropriate for your webapp.
> I just copied the orginal web.xml from tomcat directory
What Tomcat directory? There are numerous web.xml files distributed with Tomcat. Regardless, copying any existing web.xml is almost always wrong.
> to d:/examplestomcat/web.xml
That's not where web.xml belongs, even if you had an appropriate one. Read the servlet spec. Also read this:
http://tomcat.apache.org/tomcat-6.0-doc/appdev/deployment.html
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
error with tomcat HTTP Status 404 The requested resource() is not available
Posted by Tomas Rodriguez <ad...@yahoo.ca>.
Ok thanks a lot Charles, jus I followed your advise, I created all
directory(WEB-INF
/lib, web-inf/classes) under my folder d:/examplestomcat, and I created too
the file tomas.xml at the directory
c:\tomcay6.0\conf\Catalina\localhost\tomas.xml
with the <Context docBase="d:/examplestomcat">, I executed the IE and the
via URL I wrote http://127.0.0.1:8080/tomas, but at the end I can see
anything, just show me an error.
the error is:
HTTP Status 404 - /tomas/
--------------------------------------------------------------------------------
type Status report
message /tomas/
description The requested resource (/tomas/) is not available.
--------------------------------------------------------------------------------
Apache Tomcat/6.0.18
--------------------------------------------------
I reboot the tomcat services, but I can't get any good result, well I don't
know what should I do with the web.xml. I just copied the orginal web.xml
from tomcat directory to d:/examplestomcat/web.xml, I didn't change anything
in this file.
and I copied as well the mysql/J connect from tomcat/lib to my
d:/examplestomcat/WEB-INF\lib
I sorry for bother you, but I need to finish with this configuration.
thanks so much
have a great day
sincerely
TOMAS
From: "Caldarale, Charles R" <Ch...@unisys.com>
Sent: Saturday, March 21, 2009 5:49 PM
To: "Tomcat Users List" <us...@tomcat.apache.org>
Subject: RE: mysql + tomcat work already but I need to reconfigurate the
tomcat for load the examples in other location of the hard driver
>> From: Tomas Rodriguez [mailto:admhardsoft@yahoo.ca]
>> Subject: Re: mysql + tomcat work already but I need to
>> reconfigurate the tomcat for load the examples in other
>> location of the hard driver
>>
>> please tell me how can I create the server.xml and
>> build.xml
>
> You're on your own for the build.xml; setting that up depends entirely on
> the organization of your source files.
>
>> I will need to create a file named
>> conf/Catalina/[host]/[appName].xml containing a
>> <Context> element with a docBase attribute whose
>> value is the absolute location of the webapp.
>
> Correct. Unless you are supporting multiple web sites, the existing
> <Host> will do; you don't have to create another one, so you shouldn't
> have to add anything to server.xml. You appear to have decided to place
> your own examples in the D:\examplestomcat directory, so that's what your
> docBase attribute will point to. The only missing piece of information is
> the URL name used to access your webapp; for brevity, we'll use the name
> tomas, but you're of course free to use anything you want.
>
> 1) no changes are needed to server.xml
>
> 2) create the file C:\tomcat6.0\conf\Catalina\localhost\tomas.xml
>
> 3) the contents of the above file are just:
> <Context docBase="D:/examplestomcat" />
>
> 4) under D:\examplestomcat, you should have:
> WEB-INF\web.xml - contains your servlet mappings
> WEB-INF\lib - contains jar files (if any) for your webapp
> WEB-INF\classes - contains individual class files (if any) for your webapp
> index.html - the home page of your webapp.
>
> You would access the above via the URL http://127.0.0.1:8080/tomas,
> assuming your browser is on the same machine that Tomcat is running on and
> you're using the default server.xml.
>
> You can, of course, vary #4 considerably to meet your needs, as long as
> you stick with the structure required by the servlet spec.
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: mysql + tomcat work already but I need to reconfigurate the
tomcat for load the examples in other location of the hard driver
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Tomas Rodriguez [mailto:admhardsoft@yahoo.ca]
> Subject: Re: mysql + tomcat work already but I need to
> reconfigurate the tomcat for load the examples in other
> location of the hard driver
>
> please tell me how can I create the server.xml and
> build.xml
You're on your own for the build.xml; setting that up depends entirely on the organization of your source files.
> I will need to create a file named
> conf/Catalina/[host]/[appName].xml containing a
> <Context> element with a docBase attribute whose
> value is the absolute location of the webapp.
Correct. Unless you are supporting multiple web sites, the existing <Host> will do; you don't have to create another one, so you shouldn't have to add anything to server.xml. You appear to have decided to place your own examples in the D:\examplestomcat directory, so that's what your docBase attribute will point to. The only missing piece of information is the URL name used to access your webapp; for brevity, we'll use the name tomas, but you're of course free to use anything you want.
1) no changes are needed to server.xml
2) create the file C:\tomcat6.0\conf\Catalina\localhost\tomas.xml
3) the contents of the above file are just:
<Context docBase="D:/examplestomcat" />
4) under D:\examplestomcat, you should have:
WEB-INF\web.xml - contains your servlet mappings
WEB-INF\lib - contains jar files (if any) for your webapp
WEB-INF\classes - contains individual class files (if any) for your webapp
index.html - the home page of your webapp.
You would access the above via the URL http://127.0.0.1:8080/tomas, assuming your browser is on the same machine that Tomcat is running on and you're using the default server.xml.
You can, of course, vary #4 considerably to meet your needs, as long as you stick with the structure required by the servlet spec.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: mysql + tomcat work already but I need to reconfigurate the tomcat for load the examples in other location of the hard driver
Posted by Tomas Rodriguez <ad...@yahoo.ca>.
thanks a lot to Christopher and Charles for great help, but I have a doubt
yet,
please tell me how can I create the server.xml and build.xml for
personalized my examples made for myself and leave the original examples
tomcat where tomcat installed.
inmy case I wanna have two webapps one for the original examples and other
one for my examples(d:\exmaplestomact). bt accodrding with the information
that gave me Charles I will need to
create a file named conf/Catalina/[host]/[appName].xml containing a
<Context> element with a docBase attribute whose value is the absolute
location of the webapp.
where host= name or address IP
appName=?
please somebody can explain me a litte more.
actually I am developer in php, asp.net but never I work with tomcat by this
reason I have this doubt.
thanks a lot to all good peoples in this list.
TOMAS
--------------------------------------------------
From: "Christopher Schultz" <ch...@christopherschultz.net>
Sent: Friday, March 20, 2009 10:34 AM
To: "Tomcat Users List" <us...@tomcat.apache.org>
Subject: Re: mysql + tomcat work already but I need to reconfigurate the
tomcat for load the examples in other location of the hard driver
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Thomas,
>
> On 3/20/2009 4:21 AM, Tomas Rodriguez wrote:
>> but now I wanna have in other directory my web pages examples, for
>> instance in d:\websites\examplesJSP,
>> what variable I need to change in the apache tomcat for work?, what
>> files in the server apache tomcat can I change?
>
> I know this seems like a simple question, and users new to Tomcat (or
> any servlet server) have a bit of difficulty, but it has a complex
> answer. Let me try to explain things a little bit:
>
> The most basic unit of work for a servlet container is the servlet
> itself. JSP files are translated on the fly into Java classes which are
> also servlets. Although the servlet is the most basic unit of work, the
> "webapp" is really the focus of the server, and the concept that is most
> difficult to grasp for someone coming from a PHP or Perl or other CGI
> background.
>
> A Java webapp is a collection of servlets, JSPs, static content, helper
> classes, and libraries all bundled together, often into a WAR file. A
> WAR file is just a JAR file with a specific directory layout to
> facilitate webapp deployment.
>
> A webapp needs to look like this (structurally):
>
> / The root of the webapp. Anything can go in here like
> static content, subdirectories of static content, etc.
> /WEB-INF This directory contains webapp configuration files
> /WEB-INF/web.xml This is the "deployment descriptor" which defines the
> mapping from URLs to servlets, as well as some other
> things. Read the web.xml from any Tomcat example
> to get an idea of what you can do.
> /WEB-INF/classes This directory contains your Java class files, in
> package directories (like com/mycompany/MyClass.class)
> /WEB-INF/lib This directory contains any JAR files on which your
> code depends.
> /META-INF This directory holds information about the JAR/WAR
> itself. The "jar" utility will add a MANIFEST.MF file
> here to indicate how it was created, etc.
> /META-INF/context.xml This file is a Tomcat-specific deployment file.
> You will want to look at some Tomcat examples for
> more information. This file is optional if you
> do not have any special configuration. Note that
> in your case, you probably want one of these files,
> and you probably want to use it to set up your
> database connections.
>
> This page gives you a start-to-finish example of how to build a web
> application. I hope it helps:
>
> http://www.adp-gmbh.ch/blog/2004/october/13.html
>
> Unfortunately, most of the Tomcat documentation assumes that the reader
> already knows all about Java webapps and just needs to know how to get
> things running on Tomcat. That's because there is already so much
> information out there online about Java webapps that the Tomcat folks
> don't really need to repeat everything.
>
> I hope that helps you out a bit.
>
> Good luck,
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAknDqVgACgkQ9CaO5/Lv0PBg0wCdHAbw0YMojQKSlxK9CCIbMGC7
> YzgAniWD6UGgLQgH0Po3TkKmKeWJVkNl
> =FCuB
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: mysql + tomcat work already but I need to reconfigurate the tomcat
for load the examples in other location of the hard driver
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Thomas,
On 3/20/2009 4:21 AM, Tomas Rodriguez wrote:
> but now I wanna have in other directory my web pages examples, for
> instance in d:\websites\examplesJSP,
> what variable I need to change in the apache tomcat for work?, what
> files in the server apache tomcat can I change?
I know this seems like a simple question, and users new to Tomcat (or
any servlet server) have a bit of difficulty, but it has a complex
answer. Let me try to explain things a little bit:
The most basic unit of work for a servlet container is the servlet
itself. JSP files are translated on the fly into Java classes which are
also servlets. Although the servlet is the most basic unit of work, the
"webapp" is really the focus of the server, and the concept that is most
difficult to grasp for someone coming from a PHP or Perl or other CGI
background.
A Java webapp is a collection of servlets, JSPs, static content, helper
classes, and libraries all bundled together, often into a WAR file. A
WAR file is just a JAR file with a specific directory layout to
facilitate webapp deployment.
A webapp needs to look like this (structurally):
/ The root of the webapp. Anything can go in here like
static content, subdirectories of static content, etc.
/WEB-INF This directory contains webapp configuration files
/WEB-INF/web.xml This is the "deployment descriptor" which defines the
mapping from URLs to servlets, as well as some other
things. Read the web.xml from any Tomcat example
to get an idea of what you can do.
/WEB-INF/classes This directory contains your Java class files, in
package directories (like com/mycompany/MyClass.class)
/WEB-INF/lib This directory contains any JAR files on which your
code depends.
/META-INF This directory holds information about the JAR/WAR
itself. The "jar" utility will add a MANIFEST.MF file
here to indicate how it was created, etc.
/META-INF/context.xml This file is a Tomcat-specific deployment file.
You will want to look at some Tomcat examples for
more information. This file is optional if you
do not have any special configuration. Note that
in your case, you probably want one of these files,
and you probably want to use it to set up your
database connections.
This page gives you a start-to-finish example of how to build a web
application. I hope it helps:
http://www.adp-gmbh.ch/blog/2004/october/13.html
Unfortunately, most of the Tomcat documentation assumes that the reader
already knows all about Java webapps and just needs to know how to get
things running on Tomcat. That's because there is already so much
information out there online about Java webapps that the Tomcat folks
don't really need to repeat everything.
I hope that helps you out a bit.
Good luck,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAknDqVgACgkQ9CaO5/Lv0PBg0wCdHAbw0YMojQKSlxK9CCIbMGC7
YzgAniWD6UGgLQgH0Po3TkKmKeWJVkNl
=FCuB
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: mysql + tomcat work already but I need to reconfigurate the
tomcat for load the examples in other location of the hard driver
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Tomas Rodriguez [mailto:admhardsoft@yahoo.ca]
> Subject: mysql + tomcat work already but I need to
> reconfigurate the tomcat for load the examples in other
> location of the hard driver
>
> but now I wanna have in other directory my web pages
> examples, for instance
> in d:\websites\examplesJSP,
> what variable I need to change in the apache tomcat for
> work?, what files in
> the server apache tomcat can I change?
Once you've followed Chris' advice and learned how to build a webapp, you can specify the webapp location via a <Context> element in Tomcat. Webapps are normally deployed in the directory specifed by the appBase attribute of the <Host> element in conf/server.xml; if you want a different default location for all webapps, change that.
If you just want to put a small number of webapps in a different location, create a file named conf/Catalina/[host]/[appName].xml containing a <Context> element with a docBase attribute whose value is the absolute location of the webapp.
Relevant documentation links:
http://tomcat.apache.org/tomcat-6.0-doc/appdev/index.html
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
http://tomcat.apache.org/tomcat-6.0-doc/config/host.html
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org