Tomcat default webapp
Hi Everyone,
I apologise if this is the wrong place for this post but the majority of everyone here has a vast knowledge of tomcat and I have recieved alot of help when writing it from this forum.
So I have created a simple web application, registered my domain and have mapped the ip of my web server with my domain registrar, so all requests for my web site are redirected to my static IP address.
By default when tomcat receives a request to port 80 or 8080 whichever you are using it looks for the <welcome-file> you specify in your web.xml. In this case by default it looks for the index.jsp file in the webapps\ROOT directory.
What I wish to do is configure it to look in
webapps\myWebApp\index.jsp
as opposed to root whenever a request comes in.
Can anyone tell me how this is configured? i have read through some docs at
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/manager-howto.html
but didn't find the answer.
Also if this is the wrong way to deploy my app please let me know.
Thanks in advance.
Tas
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html
Under the section on "path"
" If you specify a context path of an empty string (""), you are defining the default web application for this Host, which will process all requests not assigned to other Contexts. The value of this field must not be set except when statically defining a Context in server.xml, as it will be infered from the filenames used for either the .xml context file or the docBase."
Similar Messages
-
Deploying a .war file - outside of Tomcat default webapps?
I would like to deploy a war file outside of the [tomcat]/webapps directory.
How can I get tomact to recognize AND unpack a war file in a location other then the default webapps directory?
I have tried the following;
altering server.xml -
added context pointing directly to .war in other directory.
adding context.xml entry to my war -
added context.xml to META-INF of my war file, indicating that the docBase should be in outside directory.
Neither of these created the desired result.
Any suggestions?The following is from tomcat docs
- http://tomcat.apache.org/tomcat-5.5-doc/config/host.html
appBase : The Application Base directory for this virtual host. This is the pathname of a directory that may contain web applications to be deployed on this virtual host. You may specify an absolute pathname for this directory, or a pathname that is relative to the $CATALINA_BASE directory. Going by that. try making the change as below in your server.xml
<Host name="localhost" appBase="your_directory"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false" deployXML="true">I am going by what the doc says.
I havent tried it out myself, so do let us know if that worked.
cheers,
ram. -
Hello I'm using Tomcat 4.0 for Win. I'm trying to create a file in my JSP, however no matter how I enter the directory string on where to put the file it will put it into the directory I start tomcat from. C:\apache tomcat 4.0\bin. How do I define I want to put it into the C:\apache tomcat 4.0\webapps\root\videos directory? I've tried using the ..\webapps\root\videos, but no matter what I put it will always put the new file in the bin directoty. Thanks,
RobLets say you have a Web App named "Bull", your directory structure would be ..
<code>
tomcat 4--
webapps
--Bull
or
...(tomcat install directory)\webapps\Bull
</code>
You would put your JSP page in the Bull directory. Lets say that the JSP page is called .. bullpoop.jsp and you put this file into your Bull directory. You would execute tis JSP page by typing;
//If you did not change your port number it will be the default 8080.
http://localhost:8080/Bull/bullpoop.jsp
//If you changed your port to 80 then its just;
http://localhost/Bull/bullpoop.jsp
It is case sensitive, or i have found it to be, so becareful just in case!!! (ok that was a bad joke =P )
IF you want to use classes in a package structure and ONLY use them in the "Bull" webapp then install them into the following;
<code>
tomcat 4--
webapps
Bull
WEB-INF
classes
package hierarchy
or
(tomcat install directory)\webapps\Bull\WEB-INF\classes\(package hierarchy)
</code>
By package Hierarchy i mean the following;
lets say you have a class called "Poop". You package the "Poop" class into the
package bull.stinky;
your directory structure would be;
<code>
bull--
stinky
--Poop.class
or
(tomcat install directory)\webapps\Bull\WEB-INF\classes\bull\stinky\Poop.class
</code>
In your case you want to have a Video in a directory on its own. The following would work.
<code>
tomcat 4--
webapps
Bull
video
or
(tomcat install directory)\webapps\Bull\video\
</code>
You would then reference that directory the following way in your code ..
/Bull/video/myvideo.mpg
If you want to change your port number from 8080 to 80 (if its not already being used. DO the following (Your URL's will look a lot cleaner)
You need to open the server.xml file in the conf directory and that is located here ..
<code>
tomcat 4--
conf
--server.xml
or
...\(tomcat install directory)\conf\server.xml
</code>
Change the port to 80 from 8080
<Connector
className="org.apache.catalina.connector.http.HttpConnector"
port="8080" ...
... />
I hope that helps.
Here are a coupleof sites that will help.
www.coreservlets.com and www.moreservlets.com
If you have not purchased these books DO IT NOW ! ! ! !! hehe they are excellent!!!!!!!!! They explain in great detail servlets and JSP.
Good luck =)
Oh yah in www.moreservlets.com there is a section on setting up Tomcat 4. www.coreservlets.com has set up for Tomcat 3.2
again GOOD LUCK =) -
Forward to JSP in default-webapp
I have a servlet in a deployed .war file on Sun Java System Web Server 6.1. I have a JSP that is not deployed in any .war file. How do I forward from the servlet to the JSP. I can't figure out how to obtain a context to the jsp pages in the default webapp which are outside of a .war file.
I see that the jsp .class files are in /opt/sun/web/https-c3qweb1/ClassCache/https-c3qweb1/default-webapp where https-c3qweb1 is the name of our virtual server. There is not an explicit WEBAPP entry for the default webapp in server.xml.
Is it possible to obtain the context of these jsps which are outside of .war files?I got this to work by doing the following:
ServletConfig currentConfig = getServletConfig();
ServletContext otherContext = currentConfig.getServletContext().getContext("/");
RequestDispatcher dispatch = otherContext.getRequestDispatcher("/mbttest.jsp");
request.setAttribute("anattribute", "set by DispatchOtherContext redirector servlet");
dispatch.forward(request, response); -
How to get virtual hosts to have their own default webapps?
Is there a way to have several virtual hosts to have their own default
webapps?
I have five virtual hosts on my server, and I used to be able to deploy the
webapps to the server, target a server and a virtual host, and then the
default app to use. But I can't see that anymore in wls8.1. I looked
around the web for some help, and all I could find was some reference to the
<context-root> node. The problem with that solution is, when I put that in
each of the webapps for the virtual hosts, only one gets the "/"
context-root, and the rest can't use that.
I would like to be able to have users just type out the virtual hosts URL to
get access to the webapp. Surely a server as powerful as WebLogic can do
that. I used to be able to do this in 7.0sp1. Any ideas? Thanks.Unfortunately you cannot split (nor merge) items purchased with an AppleID. I am not clear on what you will have to do to allow them continued access to their music on your account. Apple no longer has DRM protection in its music but then I also hear people have all kinds of authorization issues when trying to synch so it sounds like they still keep restrictions on what you can do with the music when trying to move it about. I'll let somebody more experienced with syncing answer this part. You may have to authorize their computers and devices to your AppleID to allow them all functionality with the music.
Ideally you would have set them up with their own AppleIDs years ago but...
Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card - http://support.apple.com/kb/HT2534 - only works for new accounts! -
Unable to display Tomcat default homepage
When i am not connected to internet, i get the default Apache Tomcat homepage after successfully starting the Tomcat server. However, once i get my internet connections enabled, I am unable to get the default Apache Tomcat home page.
I tried to change the port 8080 in server.xml just incase it was being used by some other application when i get connected to net. But it doesn't solve my problem. Can anyone please help me. I am new at java and tomcat and hence would request a detailed solution to the problem.try access through localhost:8080
regards
Shanu -
TagLib in Default WebApp??
Hi,
I can use Taglib with WEB-INF/web.xml, taglib.tld in my specified web
application in WebLogic 5.1. but, how can i make it work for the default
web application under myserver/public_html ??
Insted of htttp://host:7001/myapp/tagtest.jsp, i want to use
http://host:7001/tagtest.jsp.
Where to put the WEB-INF dir to make weblogic recognize my taglib?
Thanks in advance.
Best Regards
Li Zhongling (Alex)
Carpe Diem, Seize the Day !!
Hi, Michael
Thank you for your answer. I tried again, still there is some difference
between the root webapp and customerize ones.
1. I put WEB-INF under public_HTML, but i can not use web.xml to define
anything there.
2. I have to specify the uri of my taglib.tld directly, because i can not use
web.xml to config it. For example, before, I use "uri=/mytag/tag1", then in
web.xml I specify this uri map to mytag1.tld. Now here, in every jsp under
public_html, I must directly say "uri=mytag1.tld", then put mytag1.tld under
public_html/WEB-INF/
3. The classes under public_html/WEB-INF/classes can not be found
automatically, as other web apps do. Now I still put all the classes under
myserver/servletclasses
After that, everything works fine.
Li Zhongling
Michael Girdley wrote:
> You may deploy the Web Application as an expanded directory hierarchy under
> public_html.
>
> Thanks,
> Michael
>
> --
> ----
> Michael Girdley
> Product Manager, WebLogic Server & Express
> BEA Systems Inc
>
> Li Zhongling (Alex) <[email protected]> wrote in message
> news:[email protected]...
> > Hi,
> >
> > I can use Taglib with WEB-INF/web.xml, taglib.tld in my specified web
> > application in WebLogic 5.1. but, how can i make it work for the default
> > web application under myserver/public_html ??
> >
> > Insted of htttp://host:7001/myapp/tagtest.jsp, i want to use
> > http://host:7001/tagtest.jsp.
> > Where to put the WEB-INF dir to make weblogic recognize my taglib?
> >
> > Thanks in advance.
> >
> > --
> >
> > Best Regards
> >
> > Li Zhongling (Alex)
> >
> > --
> > Carpe Diem, Seize the Day !!
> >
> >
Best Regards
Li Zhongling (Alex)
Carpe Diem, Seize the Day !!
-
Change tomcat default port with JBoss
Hello,
I was looking for the server.xml file for tomcat that's deployed with jboss to change its port but I cannot seem to find that file. Question: how to change the port setting for tomcat that's shipped with jboss 3.2.3?
Thanks in advance!
Alan
09:00:45,554 INFO [SARDeployer] nested deployment: file:/C:/user/product/JBoss/jboss-3.2.
3-src/build/output/jboss-3.2.3/server/default/deploy/jbossweb-tomcat41.sar/tomcat41-servic
e.jar
09:00:46,676 INFO [STDOUT] Apache Tomcat/4.1.29
09:00:46,796 ERROR [Http11Protocol] Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind:8080
at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:30
2)
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:184)sorry, it is in the jboss-service.xml file and here is my modification (8080 to 8088)
<!-- A HTTP/1.1 Connector on port 8088 -->
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
address="${jboss.bind.address}" port="8088" minProcessors="2" maxProcessors="100"
enableLookups="true" acceptCount="10" debug="0"
connectionTimeout="20000" useURIValidationHack="false"/>
JMi -
Changing Tomcat Default Port.
Hi.... All
How can i change the default Port (8080) in Tomcat.
In Which file do i need to change this manually.
thanxchange this on the server.xml,
the connector part.
<Connector port="8080" maxHttpHeaderSize="8192"
the port attribute here -
Tomcat 4.1.2 default servlet request handling
I have a problem which seems to be pretty common. I have a servlet that I would like to make the default servlet in my webapp. I have mapped the servlet to <url-pattern>/</url-pattern>. I would like this servlet to handle all requests, EXCEPT, for those with static content (images, .html files, etc.). The problem it seems is this: The Tomcat default servlet, which is also mapped to "/", in the /conf/web.xml file handles all static content. When I make my servlet the default servlet in my app, it overrides the tomcat default servlet, thus no static content is served. There must be a soulution to this problem other than writing a jsp redirect file??????
Thanks,
KevinYou can write a servlet which extends the default FileServlet of the tomcat.
and in the service method check if the reques is for *.jpg or *.html
If YES call super.service(); and return;
If NO continue your work..
There must be a soulution to this problem other than
writing a jsp redirect file??????Redirect !!! I guess it won't work. Redirect will again hit the servlet mapped with "/" .. and it goes on in a contnious loop.
Hope this helps. -
Webapp deployment in Tomcat 5.0
Hello. I'm having trouble deploying my simple webapp in Tomcat 5.0. Specifically, I can't hit my servlets. My directory structure looks like this:
Tomcat Home -> webapps -> myWebApp -> WEB-INF
Inside WEB-INF, I have web.xml file with servlet-mapping elements defining each servlet, along with the "classes" dir that contains my servlets.
I can run the example servlets fine by typing in: "http://localhost:8080/servlets-examples/servlet/HelloWorldExample". It's fine. However, when I try to do the same with my servlets, it can't find the mapping. I've verified that my web.xml is correct since I just copied the known good one from the examples and changed the names.
I guess my question is: Is there anything that I need to do with Tomcat's config files to tell it how to find myWebApp? All I've done is pasted the directory structure into /webapps and tried to run it. The tomcat docs didn't help me very much, unfortunately.
Any ideas?Build a war file for your web app and put it in the webapps directory of tomcat. Then when you start the server, it would automatically explode the war into the directory structure. I know this works with Tomcat 4.0.3 . It should work with version 5 as well.
HTH -
How to set Tomcat server to read library files from webapps \lib
I am trying to put all the web apllication used library files into their own directories instead of puting at the <tomcat-home>\common\lib\
but it doesnt seem to be working, the server keep telling me that
the library file could not found, what action should i take to let the server know that my library files is in the <tomcat-home>\webapps\<webapp>\lib?
thankWhat library files are you referring to here?
Things like struts.jar or jstl.jar used in a web app? They should be fine in WEB-INF/lib
Or things like database drivers?
In order to use connection pooling the database driver has to be in /common/lib, because the server needs to access that code.
Have you tried putting them in /shared/lib?
That makes files accessible to all web apps, but not to the server. -
Problem with Tomcat 404 Redirects & Internet Explorer
Hello All --
I am running Tomcat 5.5.9 stand alone on a linux server. My default application is loading when you visit http://*IPAddress*/
I have set up the standard <error-page> tags in my context web.xml, located in: TOMCAT-INSTALL/webapps/contextname/WEB-INF.
Browsing to an invalid link through FireFox correctly displays my error page. However, browsing to the same invalid link through IE 6 displays the standard IE 404 Not Found Error message.
The strange thing is, if I visit a correct page through IE, then go back and change it so it is incorrect, THEN IE sees my custom error page.
For example, if I visit
http://siteaddress.com/products.jsp?product_id=12345, the page loads correctly. If I change the address to
http://siteaddress.com/products.js?product_id=12345, IE then sees my custom error.
But if I enter the incorrect address right away in a new IE window, I receive the standard IE 404 error messaging.
Could someone please explain why this is happening and what I can do to resolve the problem?
Thank you in advance for your help!
-- ChrisHi,
I got this to work finally and documented it here:
http://markashworth.objectis.net/Tutorial/tomcat404IE
Hope this helps.
Mark Ashworth -
Has anyone run the connection pooling for mysql & tomcat successfully?
I'm trying to set up connection pooling. I'm following the how-to page at
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
But when i test the DBTest/test.jsp file, tomcat displays an error =
could not load jdbc driver class 'null'(msdos)
i have placed all the required .jar files in the tomcat lib.
below is the cofiguration i did to the server.xml file
<!-- Example Server Configuration File -->
<!-- Note that component elements are nested corresponding to their
parent-child relationships with each other -->
<!-- A "Server" is a singleton element that represents the entire JVM,
which may contain one or more "Service" instances. The Server
listens for a shutdown command on the indicated port.
Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level.
-->
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<!-- Uncomment these entries to enable JMX MBeans support -->
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
debug="0"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
debug="0"/>
<!-- Global JNDI resources -->
<GlobalNamingResources>
<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" (and therefore the web applications visible
within that Container). Normally, that Container is an "Engine",
but this is not required.
Note: A "Service" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level.
-->
<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Tomcat-Standalone">
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Each Connector passes requests on to the
associated "Container" (normally an Engine) for processing.
By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
You can also enable an SSL HTTP/1.1 Connector on port 8443 by
following the instructions below and uncommenting the second Connector
entry. SSL support requires the following steps (see the SSL Config
HOWTO in the Tomcat 4.0 documentation bundle for more detailed
instructions):
* Download and install JSSE 1.0.2 or later, and put the JAR files
into "$JAVA_HOME/jre/lib/ext".
* Execute:
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
with a password value of "changeit" for both the certificate and
the keystore itself.
By default, DNS lookups are enabled when a web application calls
request.getRemoteHost(). This can have an adverse impact on
performance, so you can disable it by setting the
"enableLookups" attribute to "false". When DNS lookups are disabled,
request.getRemoteHost() will return the String version of the
IP address of the remote client.
-->
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8081 -->
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8080" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="100" debug="0" connectionTimeout="20000"
useURIValidationHack="false" disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to -1 -->
<!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<!--
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8443" minProcessors="5" maxProcessors="75"
enableLookups="true"
acceptCount="100" debug="0" scheme="https" secure="true"
useURIValidationHack="false" disableUploadTimeout="true">
<Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
clientAuth="false" protocol="TLS" />
</Connector>
-->
<!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8009" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="20000"
useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
<!-- Define an AJP 1.3 Connector on port 8009 -->
<!--
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>
-->
<!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
<!-- See proxy documentation for more information about using this. -->
<!--
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8082" minProcessors="5" maxProcessors="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" debug="0" connectionTimeout="20000"
proxyPort="80" useURIValidationHack="false" />
-->
<!-- Define a non-SSL legacy HTTP/1.1 Test Connector on port 8083 -->
<!--
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="8083" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" />
-->
<!-- Define a non-SSL HTTP/1.0 Test Connector on port 8084 -->
<!--
<Connector className="org.apache.catalina.connector.http10.HttpConnector"
port="8084" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" />
-->
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host). -->
<!-- Define the top level container in our container hierarchy -->
<Engine name="Standalone" defaultHost="localhost" debug="0">
<!-- The request dumper valve dumps useful debugging information about
the request headers and cookies that were received, and the response
headers and cookies that were sent, for all requests received by
this instance of Tomcat. If you care only about requests to a
particular virtual host, or a particular application, nest this
element inside the corresponding <Host> or <Context> entry instead.
For a similar mechanism that is portable to all Servlet 2.3
containers, check out the "RequestDumperFilter" Filter in the
example application (the source for this filter may be found in
"$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
Request dumping is disabled by default. Uncomment the following
element to enable it. -->
<!--
<Valve className="org.apache.catalina.valves.RequestDumperValve"/>
-->
<!-- Global logger unless overridden at lower levels -->
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/>
<!-- Because this Realm is here, an instance will be shared globally -->
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
debug="0" resourceName="UserDatabase"/>
<!-- Comment out the old realm but leave here for now in case we
need to go back quickly -->
<!--
<Realm className="org.apache.catalina.realm.MemoryRealm" />
-->
<!-- Replace the above Realm with one of the following to get a Realm
stored in a database and accessed via JDBC -->
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost/authority"
connectionName="test" connectionPassword="test"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
connectionName="scott" connectionPassword="tiger"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="sun.jdbc.odbc.JdbcOdbcDriver"
connectionURL="jdbc:odbc:CATALINA"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<!-- Define the default virtual host -->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="/my-jsp" docBase="c:\JSP-Files" debug="0"
privileged="true" reloadable="true" />
<Context path="" docBase="c:\Inetpub\wwwroot" debug="0" privileged="true" />
<Context path="/sharon" docBase="C:\Tomcat 4.1\webapps\sharon" debug="0" privileged="true" />
<!-- Normally, users must authenticate themselves to each web app
individually. Uncomment the following entry if you would like
a user to be authenticated the first time they encounter a
resource protected by a security constraint, and then have that
user identity maintained across all web applications contained
in this virtual host. -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn"
debug="0"/>
-->
<!-- Access log processes all requests for this virtual host. By
default, log files are created in the "logs" directory relative to
$CATALINA_HOME. If you wish, you can specify a different
directory with the "directory" attribute. Specify either a relative
(to $CATALINA_HOME) or absolute path to the desired directory.
-->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
-->
<!-- Logger shared by all Contexts related to this virtual host. By
default (when using FileLogger), log files are created in the "logs"
directory relative to $CATALINA_HOME. If you wish, you can specify
a different directory with the "directory" attribute. Specify either a
relative (to $CATALINA_HOME) or absolute path to the desired
directory.-->
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>
<!-- Define properties for each web application. This is only needed
if you want to set non-default properties, or have web application
document roots in places other than the virtual host's appBase
directory. -->
<!-- Tomcat Root Context -->
<!--
<Context path="" docBase="ROOT" debug="0"/>
-->
<!-- Tomcat Examples Context -->
<Context path="/examples" docBase="examples" debug="0"
reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_DBTest_log." suffix=".txt"
timestamp="true"/>
<Ejb name="ejb/EmplRecord" type="Entity"
home="com.wombat.empl.EmployeeRecordHome"
remote="com.wombat.empl.EmployeeRecord"/>
<!-- If you wanted the examples app to be able to edit the
user database, you would uncomment the following entry.
Of course, you would want to enable security on the
application as well, so this is not done by default!
The database object could be accessed like this:
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
UserDatabase database =
(UserDatabase) envCtx.lookup("userDatabase");
-->
<!--
<ResourceLink name="userDatabase" global="UserDatabase"
type="org.apache.catalina.UserDatabase"/>
-->
<!-- PersistentManager: Uncomment the section below to test Persistent
Sessions.
saveOnRestart: If true, all active sessions will be saved
to the Store when Catalina is shutdown, regardless of
other settings. All Sessions found in the Store will be
loaded on startup. Sessions past their expiration are
ignored in both cases.
maxActiveSessions: If 0 or greater, having too many active
sessions will result in some being swapped out. minIdleSwap
limits this. -1 means unlimited sessions are allowed.
0 means sessions will almost always be swapped out after
use - this will be noticeably slow for your users.
minIdleSwap: Sessions must be idle for at least this long
(in seconds) before they will be swapped out due to
maxActiveSessions. This avoids thrashing when the site is
highly active. -1 or 0 means there is no minimum - sessions
can be swapped out at any time.
maxIdleSwap: Sessions will be swapped out if idle for this
long (in seconds). If minIdleSwap is higher, then it will
override this. This isn't exact: it is checked periodically.
-1 means sessions won't be swapped out for this reason,
although they may be swapped out for maxActiveSessions.
If set to >= 0, guarantees that all sessions found in the
Store will be loaded on startup.
maxIdleBackup: Sessions will be backed up (saved to the Store,
but left in active memory) if idle for this long (in seconds),
and all sessions found in the Store will be loaded on startup.
If set to -1 sessions will not be backed up, 0 means they
should be backed up shortly after being used.
To clear sessions from the Store, set maxActiveSessions, maxIdleSwap,
and minIdleBackup all to -1, saveOnRestart to false, then restart
Catalina.
-->
<!--
<Manager className="org.apache.catalina.session.PersistentManager"
debug="0"
saveOnRestart="true"
maxActiveSessions="-1"
minIdleSwap="-1"
maxIdleSwap="-1"
maxIdleBackup="-1">
<Store className="org.apache.catalina.session.FileStore"/>
</Manager>
-->
<Environment name="maxExemptions" type="java.lang.Integer"
value="15"/>
<Parameter name="context.param.name" value="context.param.value"
override="false"/>
<Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
type="javax.sql.DataSource"/>
<Resource name="jdbc/TestDB"
auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/TestDB">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- Maximum number of dB connections in pool. Make sure you
configure your mysqld max_connections large enough to handle
all of your db connections. Set to 0 for no limit.
-->
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<!-- Maximum number of idle dB connections to retain in pool.
Set to 0 for no limit.
-->
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<!-- Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely.
-->
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<!-- MySQL dB username and password for dB connections -->
<parameter>
<name>user</name>
<value>javauser</value>
</parameter>
<parameter>
<name>password</name>
<value>javadude</value>
</parameter>
<!-- Class name for mm.mysql JDBC driver -->
<parameter>
<name>driverClassName</name>
<value>org.gjt.mm.mysql.Driver</value>
</parameter>
<!-- The JDBC connection url for connecting to your MySQL dB.
The autoReconnect=true argument to the url makes sure that the
mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
connection. mysqld by default closes idle connections after 8 hours.
-->
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
</parameter>
</ResourceParams>
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"/>
<ResourceParams name="mail/Session">
<parameter>
<name>mail.smtp.host</name>
<value>localhost</value>
</parameter>
</ResourceParams>
<ResourceLink name="linkToGlobalResource"
global="simpleValue"
type="java.lang.Integer"/>
</Context>
</Host>
</Engine>
</Service>
<!-- The MOD_WEBAPP connector is used to connect Apache 1.3 with Tomcat 4.0
as its servlet container. Please read the README.txt file coming with
the WebApp Module distribution on how to build it.
(Or check out the "jakarta-tomcat-connectors/webapp" CVS repository)
To configure the Apache side, you must ensure that you have the
"ServerName" and "Port" directives defined in "httpd.conf". Then,
lines like these to the bottom of your "httpd.conf" file:
LoadModule webapp_module libexec/mod_webapp.so
WebAppConnection warpConnection warp localhost:8008
WebAppDeploy examples warpConnection /examples/
The next time you restart Apache (after restarting Tomcat, if needed)
the connection will be established, and all applications you make
visible via "WebAppDeploy" directives can be accessed through Apache.
-->
<!-- Define an Apache-Connector Service -->
<!--
<Service name="Tomcat-Apache">
<Connector className="org.apache.catalina.connector.warp.WarpConnector"
port="8008" minProcessors="5" maxProcessors="75"
enableLookups="true" appBase="webapps"
acceptCount="10" debug="0"/>
<Engine className="org.apache.catalina.connector.warp.WarpEngine"
name="Apache" debug="0">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="apache_log." suffix=".txt"
timestamp="true"/>
<Realm className="org.apache.catalina.realm.MemoryRealm" />
</Engine>
</Service>
-->
</Server>
Pleas4 help!!!you have your driver jar in Tomcat\common\lib?
if so, check your classpath, it could be that. -
Error in deploying the java studio creator application to tomcat
Hi,
I'm trying to deploy my Sun Java Studio application to Apache Tomcat 5.0.28.
A simple JSF web application built using the creator works fine after deploying the war file under tomcat/weapps directory.
In case of a application with databse connection I'm getting the
" com.sun.rave.web.ui.appbase.ApplicationException: org.apache.jasper.JasperException: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' "
above error. My application connects to Oracle database using the Oracle Server type provided by the Studio Creator.
I have copied
jstl.jar
standard.jar
to webapps\%app%\WEB-INF\lib
The below url is currently not available ( Page not Found )stated as a solution in most of the querries regarding the deplyment to tomcat.
http://developers.sun.com/prodtech/javatools/jscreator/reference/tips/deploy_to_tomcat.html
Thanks for any help
abhiI had similar problems.
I used mysql with tomcat and have mysql in my Creator environment as well but still had the driver message you experienced.
I found that simply copying the WAR file into the webapp directory in tomcat caused a faulty deployment (it was creating /etc/tomcat5/localhost/YourProject.xml as a directory, not as a file)
I updated my Projects/MyProject/build.xml to include a deploy target and I manually execute the ant deploy step (having not figured out how to tweak the internal ant within Creator)
Note that this requires two jar files (see comments in the ant definition)
<project name="YourRoster" default="default" basedir=".">
<description>Builds, tests, and runs the project YourProject.</description>
<import file="nbproject/build-impl.xml"/>
<property file="build.properties"/>
<property name="appdir" value="."/>
<property name="distdir" value="${appdir}/dist"/>
<property name="warfile" value="${distdir}/${app}.war"/>
<property name="builddir" value="${appdir}/build"/>
<path id="classpath">
<pathelement location="${servlet.api.jar}"/>
<pathelement location="${jsp.api.jar}"/>
<fileset dir="${builddir}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
</path>
<!-- requires tomcat/server/lib/catalina-ant.jar -->
<target name="lrp-init">
<tstamp/>
<fail unless="app" message="Run ant -Dapp=... or update 'build.properties'"/>
</target>
<target name="deploy-tomcat" depends="dist"
description="Deploy web application.">
<echo message="Deploying ${app} ..."/>
<taskdef name="deploy"
classname="org.apache.catalina.ant.DeployTask"/>
<deploy url="${manager.url}" username="${username}"
password="${password}" path="/${app}"
war="file:${warfile}"/>
</target>
<target name="undeploy-tomcat" depends="lrp-init"
description="Undeploy web application.">
<echo message="Undeploying ${app} ..."/>
<taskdef name="undeploy"
classname="org.apache.catalina.ant.UndeployTask"/>
<undeploy url="${manager.url}" username="${username}"
password="${password}" path="/${app}"/>
</target>
<!-- requires ant-contrib (http://ant-contrib.sourceforge.net) -->
<target name="try.undeploy-tomcat" depends="lrp-init"
description="Call the undeploy task (which may fail).">
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<trycatch>
<try>
<ant target="undeploy-tomcat"/>
</try>
<catch/>
</trycatch>
</target>
<target name="redeploy-tomcat" depends="try.undeploy-tomcat,deploy-tomcat"
description="Undeploy and deploy web application.">
</target>
</project>In addition, the build.properties...
jsf.dir=/opt/jsf-1_1_01
tomcat.dir=/opt/tomcat5
app=YourProject
username=tomcatAdminUser
password=tomcatPassword
manager.url=http://localhost:8080/manager
servlet.api.jar=${tomcat.dir}/common/lib/servlet-api.jar
jsp.api.jar=${tomcat.dir}/common/lib/jsp-api.jar
jsf.lib.dir=${jsf.dir}/lib
jstl.lib.dir=${tomcat.dir}/webapps/jsp-examples/WEB-INF/lib
commons.lib.dir=${tomcat.dir}/server/lib
jsf.libs=jsf-api.jar,jsf-impl.jar
jstl.libs=jstl.jar,standard.jar
commons.libs=commons-beanutils.jar,commons-digester.jarHope this helps.
...Lyall
Maybe you are looking for
-
Can't drag video into timeline premiere cc
Been working with PP CC since it came out and have had almost no problems. Now I have a head scratcher. I can't drag a video clip from the project panel to the sequence. The audio comes but the video won't. All I get is the close hand with a line thr
-
Drivers for network card Extreme 802.11 n
I´m running Mac OS X and windows vista on bootcamp. Mac OS X is functional, ofcourse, but Vista doesn't recognise the network card. I need Windows drivers for this. Where can I find this?
-
Hi guys, I wanted to report that updating your iPod touch 4th generation to iOS 6.1.6 will surely fix some security flaws, whi8le it will make your device super slow. It's frustrating. The battery on moderate / airplane usageisedlast almost 5 hours b
-
9i Oracle Installer fails on Gentoo Linux
When I try to run the Oracle Installer on my Gentoo Linux system, I get a segmentation fault. My system configuration: Gentoo Linux 1.4.2.8 kernel 2.4.21-pre3-aa1 binutils 2.13.90.0.16 glibc 2.3.1-r2 Here's the crash output: Initializing Java Virtual
-
Hi Friends! I need create a graph in wad, and one of the series should be u201Cobjetiveu201D. This value will be constant and could be modified on runtime (then, is not possible put it as a query variable). The char will be in columns and objective