JsfJpa Netbeans WebApp Example
I am a beginner. I have NetBeans 6.5 bundled with Tomcat 6.0.18 and Glassfish. I can run basic example servlets from Samples --> Java Web.
I open JsfJpa example and run it on Glasfish with no problems... but something seems not right after in project properties I change server to Tomcat.
It looks like this:
http://images31.fotosik.pl/418/ad289b6cc3a7e5b9.jpg
Any tip to run it on Tomcat ?
JSF 1.2 library IS included. Do I need something else ?
In the future please copypaste/typeover the compilation error here rather than posting a screenshot.
OK, thus you got a 'Cannot find symbol' on javax.transaction.UserTransaction?
That simply means that the mentioned class is missing in the classpath. You need to add the Transaction API (and implementation) to your classpath to get it to work. It is part of JPA. Glassfish by default ships with Sun's own JPA reference implementation, but Tomcat doesn't. You need to look for an 3rd party JPA implementation. Commonly used ones are Hibernate, Toplink and OpenJPA. Good luck.
Similar Messages
-
Setting up NetBeans WebApp without default JSP Page
Hi all,
I'm trying to create some basic servlet apps which can be accessed by stand alone java classes. I'm using netBeans to create a default Web Application and now i'm trying to remove the JSP (index.jsp) page which is created by default. Is there any simple why of doing this? I've trying removing it but errors are thrown by other project files.
Many thanks for any help!By default the size of out (implicit object of JSPWriter) object is 8kb. Since OA.jsp and RF.jsp are JSPs my assumption is that they inherit a standard JSPWriter when creating the out object and therefore use the default page buffer size of 8kb. One of the jsp performance tips is to modify the page buffer size to better match the standard amount of output. The use of page buffer is mentioned in the Oracle JSP best practices document. It is pretty common to see this set in the standard 11i JSPs. A number of the jtf JSPs use a value of 24kb for the page size, while other apps module JSPs use various sizes from 12kb up to 200kb. I have also seen some analysis that showed that setting the page buffer size to correspond better to the amount of output being generated improves the garbage collection and heap management in hotspot. My goal is better performance, and I believe that setting the page buffer size to a value that is closer to my average page size would improve overall performance.
-
Tomcat 4.0 Example webapp startup error
Hello,
I get the following error in when I try to hit the example servlets or jsps. The errors are in the example_webapp logfile. I have just installed tomcat 4.04 (ga) running jdk1.4. Has anyone else run across these errors?
Any help would be greatly welcomed.
Sunit.
--- start error logs ----
2002-07-17 16:59:49 WebappLoader[examples]: Deploying class
2002-07-17 16:59:51 StandardContext[examples]: Exception starting filter Set Cha
racter Encoding
java.lang.ClassNotFoundException: filters.SetCharacterEncodingFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoad
er.java:1424)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoad
er.java:1270)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(Application
FilterConfig.java:252)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Applicat
ionFilterConfig.java:314)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFil
terConfig.java:120)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.j
ava:3092)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:34
80)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at org.apache.catalina.core.StandardService.start(StandardService.java:49
7)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2185
at org.apache.catalina.startup.Catalina.start(Catalina.java:510)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
ava:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
orImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
2002-07-17 16:59:51 StandardContext[examples]: Exception starting filter Compres
sion Filter
java.lang.ClassNotFoundException: compressionFilters.CompressionFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoad
er.java:1424)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoad
er.java:1270)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(Application
FilterConfig.java:252)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Applicat
ionFilterConfig.java:314)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFil
terConfig.java:120)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.j
ava:3092)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:34
80)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at org.apache.catalina.core.StandardService.start(StandardService.java:49
7)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2185
at org.apache.catalina.startup.Catalina.start(Catalina.java:510)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
ava:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
orImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
2002-07-17 16:59:51 StandardContext[examples]: Context startup failed due to pre
vious errors
2002-07-17 16:59:51 ContextListener: attributeReplaced('org.apache.catalina.WELCO
ME_FILES', '[Ljava.lang.String;@94d372')
2002-07-17 16:59:51 ContextListener: attributeReplaced('org.apache.catalina.WELCO
ME_FILES', '[Ljava.lang.String;@c5fde0')
2002-07-17 16:59:51 ContextListener: attributeReplaced('org.apache.catalina.WELCO
ME_FILES', '[Ljava.lang.String;@9e8329')
2002-07-17 16:59:51 SessionListener: contextDestroyed()
2002-07-17 16:59:51 ContextListener: contextDestroyed()Make sure you check the following file: $CATALINA_HOME/webapps/examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.class. Make sure it's spelled .class and not .clas. When Stuffit tries to expand it, the name gets truncated.
-
Example jsp page is not displaying in browser
HI,
I have just installed tomcat serve and want to dispaly an example jsp page from "http://localhost:8080/webapps/examples/jsp/dates/date.jsp" but the following message is coming:
HTTP Status 404 - /webapps/examples/jsp/dates/date.jsp
type Status report
message /webapps/examples/jsp/dates/date.jsp
description The requested resource (/webapps/examples/jsp/dates/date.jsp) is not available.
Apache Tomcat/4.1.27try the url:
http://localhost:8080/examples/jsp/dates/date.jsp
The tomcat webapps directory doesn't appear in the url. -
In Tomcat's example, how can it find HelloWorldExample servlet?
I looked up the examples/web-inf/web.xml, but I cann't find the mapping info for HelloWorldExample servlet. When I browse the servlets/index.html and click Execute HelloWorld, how can Tomcat find it?
I use Tomcat 3.3.2
The file is in:
tomcat_dir/webapps/examples/WEB-INF/classes
See the file server.xml in:
tomcat_dir/conf -
Hello,
i have made a small website; All its class files are in folder
c:\tomcat\webapps\examples\web-inf\classes\mysite\
and all of the jsp pages are in
c:\tomcat\webapps\examples\jsp\mysite\
but, somebody told me there is some procedure to be followed like ...
PROCEDURE
make a folder named "mysite" in "webapps" and then make a folder
"web-inf" and then folder named as "classes" and keep class files there.... Then set class path.
i am using tomcat 4.1.27
Now my question is,
Please tell me these things,what to do?,where to keep class files and jsp pages, and how to change classpath.
And also please tell me if i have to edit some other files like web.xml etc...
Thanks in Advance ....
you can also contact me at [email protected]Normally, the structure is like this:
webapps/
webapps/myapp/
webapps/myapp/images/ (or other special content folders)
webapps/myapp/WEB-INF/ (should be all caps, I think)
webapps/myapp/WEB-INF/classes/
webapps/myapp/WEB-INF/lib/
webapps/myapp/WEB-INF/src/
In the src directory, I put the web app class file sources in their package structure. I have a build script that compiles them to the classes director. In the classes directory goes your compiled class files in their package structure. I'm assuming you now about packages and directories (if not, you should start with something other then JSP).
In the lib directory goes and jar files for other library packages.
In the WEB-INF directory itself is the web.xml and any tag library definition files, etc.
I usually just put my JSP pages into the myapp directory itself, but some people will put them in a jsp subdirectory there or something. I don't find that useful, personally.
As for WAR files, I don't use them during development, only when needing to deploy the app. It seems to me a waste of time to create it and let it unpack to test. -
Tomcat JDBC Realm Database Connection Error
Hello all,
I am trying to edit the server.xml file on Tomcat so I can use the JDBC Realm instead of the MemoryRealm. Hence, I will be able to read users, passwords and roles from a relational database instead of from the tomcat-users.xml.
I have tried following all the guides on the net I can find, my server.xml looks as follows (after making changes to allow it to use JDBC realm). The only problem is, when I try to run the application the server outputs the following: (after all of these errors have been kicked up a pop-up box then appears titled "Tomcat Manager Application", it asks for a User Name and Password. I have tried the standard user name of "ide" and the password next to it in tomcat-users.xml but it won't accept it. (I am using the netbeans IDE)).
Please could someone suggest any ideas of how I can get the server.xml to work with JDBC realm?
Using CATALINA_BASE: C:\Documents and Settings\Administrator\.netbeans\5.0beta\jakarta-tomcat-5.5.7_base
Using CATALINA_HOME: C:\Program Files\netbeans-5.0beta\enterprise2\jakarta-tomcat-5.5.7
Using CATALINA_TMPDIR: C:\Documents and Settings\Administrator\.netbeans\5.0beta\jakarta-tomcat-5.5.7_base\temp
Using JAVA_HOME: C:\j2sdk1.4.2_08
Created MBeanServer with ID: 1f934ad:107444b1d2b:-8000:ravinder-rdnzoa:1
31-Oct-2005 01:29:33 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8084
31-Oct-2005 01:29:34 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8443
31-Oct-2005 01:29:34 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2174 ms
31-Oct-2005 01:29:34 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
31-Oct-2005 01:29:34 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.7
31-Oct-2005 01:29:34 org.apache.catalina.realm.JDBCRealm start
SEVERE: Exception opening database connection
java.sql.SQLException: org.gjt.mm.mysql.Driver
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:646)
at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:720)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
31-Oct-2005 01:29:34 org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
31-Oct-2005 01:29:36 org.apache.catalina.startup.ContextConfig validateSecurityRoles
INFO: WARNING: Security role name IBM used in an <auth-constraint> without being defined in a <security-role>
31-Oct-2005 01:29:36 org.apache.catalina.startup.ContextConfig validateSecurityRoles
INFO: WARNING: Security role name Auditor used in an <auth-constraint> without being defined in a <security-role>
31-Oct-2005 01:29:37 org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
INFO: Tiles definition factory loaded for module ''.
31-Oct-2005 01:29:37 org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
31-Oct-2005 01:29:37 org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from '/WEB-INF/validation.xml'
31-Oct-2005 01:29:38 org.apache.catalina.startup.ContextConfig validateSecurityRoles
INFO: WARNING: Security role name IBM used in an <auth-constraint> without being defined in a <security-role>
31-Oct-2005 01:29:38 org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
INFO: Tiles definition factory loaded for module ''.
31-Oct-2005 01:29:38 org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
31-Oct-2005 01:29:38 org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from '/WEB-INF/validation.xml'
31-Oct-2005 01:29:39 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8084
31-Oct-2005 01:29:39 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8443
31-Oct-2005 01:29:40 org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
31-Oct-2005 01:29:40 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/60 config=null
31-Oct-2005 01:29:40 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
31-Oct-2005 01:29:40 org.apache.catalina.startup.Catalina start
INFO: Server startup in 5738 ms
31-Oct-2005 01:29:40 org.apache.catalina.realm.JDBCRealm authenticate
SEVERE: Exception performing authentication
java.sql.SQLException: org.gjt.mm.mysql.Driver
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:646)
at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:344)
at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)
31-Oct-2005 01:29:40 org.apache.catalina.realm.JDBCRealm authenticate
SEVERE: Exception performing authentication
java.sql.SQLException: org.gjt.mm.mysql.Driver
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:646)
at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:344)
at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)The server.xml looks as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!-- 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="8025" shutdown="SHUTDOWN">
<!-- Comment these entries out to disable JMX MBeans support used for the
administration web application -->
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
<!-- 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 -->
<!-- RAV
<Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml"/>
-->
</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="Catalina">
<!-- 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 5 documentation bundle for more detailed
instructions):
* If your JDK version 1.3 or prior, 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 HTTP/1.1 Connector on port 8080 -->
<Connector port="8084" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="utf-8"/>
<!-- Note : To disable connection timeouts, set connectionTimeout value
to 0 -->
<!-- Note : To use gzip compression you could set the following properties :
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml"
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
<Connector port="8443"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3"/>
<!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
<!-- See proxy documentation for more information about using this. -->
<!--
<Connector port="8082"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" acceptCount="100" connectionTimeout="20000"
proxyPort="80" disableUploadTimeout="true" />
-->
<!-- 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). -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
-->
<!-- Define the top level container in our container hierarchy -->
<Engine name="Catalina" defaultHost="localhost">
<!-- 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.4
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"/>
-->
<!-- 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. -->
<!-- RAV
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" 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"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost:3306/tomcatusers"
connectionName="root" connectionPassword="sikhism1"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm"
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"
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
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false">
<!-- Defines a cluster for this node,
By defining this element, means that every manager will be changed.
So when running a cluster, only make sure that you have webapps in there
that need to be clustered and remove the other ones.
A cluster has the following parameters:
className = the fully qualified name of the cluster class
name = a descriptive name for your cluster, can be anything
mcastAddr = the multicast address, has to be the same for all the nodes
mcastPort = the multicast port, has to be the same for all the nodes
mcastBindAddr = bind the multicast socket to a specific address
mcastTTL = the multicast TTL if you want to limit your broadcast
mcastSoTimeout = the multicast readtimeout
mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
in case of multiple ethernet cards.
auto means that address becomes
InetAddress.getLocalHost().getHostAddress()
tcpListenPort = the tcp listen port
tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
has a wakup bug in java.nio. Set to 0 for no timeout
printToScreen = true means that managers will also print to std.out
expireSessionsOnShutdown = true means that
useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
false means to replicate the session after each request.
false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager)
<%
HashMap map = (HashMap)session.getAttribute("map");
map.put("key","value");
%>
replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
* Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
* Synchronous means that the thread that executes the request, is also the
thread the replicates the data to the other nodes, and will not return until all
nodes have received the information.
* Asynchronous means that there is a specific 'sender' thread for each cluster node,
so the request thread will queue the replication request into a "smart" queue,
and then return to the client.
The "smart" queue is a queue where when a session is added to the queue, and the same session
already exists in the queue from a previous request, that session will be replaced
in the queue instead of replicating two requests. This almost never happens, unless there is a
large network delay.
-->
<!--
When configuring for clustering, you also add in a valve to catch all the requests
coming in, at the end of the request, the session may or may not be replicated.
A session is replicated if and only if all the conditions are met:
1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
2. a session exists (has been created)
3. the request is not trapped by the "filter" attribute
The filter attribute is to filter out requests that could not modify the session,
hence we don't replicate the session after the end of this request.
The filter is negative, ie, anything you put in the filter, you mean to filter out,
ie, no replication will be done on requests that match one of the filters.
The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
ending with .gif and .js are intercepted.
The deployer element can be used to deploy apps cluster wide.
Currently the deployment only deploys/undeploys to working members in the cluster
so no WARs are copied upons startup of a broken node.
The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
When a new war file is added the war gets deployed to the local instance,
and then deployed to the other instances in the cluster.
When a war file is deleted from the watchDir the war is undeployed locally
and cluster wide
-->
<!--
<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
managerClassName="org.apache.catalina.cluster.session.DeltaManager"
expireSessionsOnShutdown="false"
useDirtyFlag="true"
notifyListenersOnReplication="true">
<Membership
className="org.apache.catalina.cluster.mcast.McastService"
mcastAddr="228.0.0.4"
mcastPort="45564"
mcastFrequency="500"
mcastDropTime="3000"/>
<Receiver
className="org.apache.catalina.cluster.tcp.ReplicationListener"
tcpListenAddress="auto"
tcpListenPort="4001"
tcpSelectorTimeout="100"
tcpThreadCount="6"/>
<Sender
className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
replicationMode="pooled"
ackTimeout="15000"/>
<Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/>
<Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/"
deployDir="/tmp/war-deploy/"
watchDir="/tmp/war-listen/"
watchEnabled="false"/>
</Cluster>
-->
<!-- 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" />
-->
<!-- 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"/>
-->
<!-- 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.
This access log implementation is optimized for maximum performance,
but is hardcoded to support only the "common" and "combined" patterns.
-->
<!--
<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
-->
<!-- 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.
This access log implementation is optimized for maximum performance,
but is hardcoded to support only the "common" and "combined" patterns.
This valve use NIO direct Byte Buffer to asynchornously store the
log.
-->
<!--
<Valve className="org.apache.catalina.valves.ByteBufferAccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
-->
</Host>
</Engine>
</Service>
</Server>Many thanks, and apologies for "dumping" all of the code here.So looking through the java api docs, I found that the tcUtilJDBCOperations has a connect string for the database. Below is the info it outlines. The questions I have it this. How do you specify the psdriver and URL along with do I need to do this as a persistent instance then add my selectstatement as a part of this or can I just specify this and the select statement will use this connection? Any help you can give would be appreciated.
tcUtilJDBCOperations
public tcUtilJDBCOperations(java.lang.String psDriver,
java.lang.String psUrl,
java.lang.String psUsername,
java.lang.String psPassword)Contructor that sets the parameters for connecting to a database
Parameters:
psDriver - The class name of the jdbc driver
psUrl - The URL of the database
psUsername - The username required to access the database
psPassword - The password for the above username
Nick -
Error in starting weblogic commerce server on Win2000
I downloaded the evaluation release of Weblogic Commerce 3.1 and th licence,
and installed it on Windows 2000 Professional,
I have a Weblogic Application Server 5.1 installed
the server did not start and gave an error, please help us as to what the
problem is and how to get it running.
=========== Error Message ===============
JAVA_CLASSPATH IS
C:\jdk\lib\tools.jar;C:\weblogic\lib\weblogic510sp6boot.jar;C:
\weblogic\classes\boot
WEBLOGIC_CLASSPATH IS
C:\weblogic\lib\weblogic510sp6.jar;C:\weblogic\lib\WebLogi
c_RDBMS.jar;C:\weblogic\license;C:\weblogic\classes;C:\weblogic\lib\weblogic
aux.
jar;C:\weblogic\lib\weblogic-tags-510.jar;C:\WebLogicCommerceServer3.1\licen
se;C
:\WebLogicCommerceServer3.1\classes;C:\WebLogicCommerceServer3.1\lib\rules.j
ar;C
:\WebLogicCommerceServer3.1\lib\jrulesserviceprovider.jar;C:\WebLogicCommerc
eSer
ver3.1\deploy\bmp\classes;C:\WebLogicCommerceServer3.1\eval\win32\Taxware\cl
asse
s;C:\weblogic\eval\cloudscape\lib\cloudscape.jar;C:\weblogic\eval\cloudscape
\lib
\tools.jar;C:\weblogic\eval\cloudscape\lib\client.jar
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <WebLogicServer> Read global
properties C:\WebLogicCommerceServer3.1\weblogic.propertie
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <WebLogicServer> No per-server
properties files found
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Logging> FileLogger initialized.
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <WebLogicServer> ************
WebLogic Server (5.1.0 04/03/2000 17:13:23 #66825) 'serve
:\WebLogicCommerceServer3.1
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <WebLogicServer> ************ (c)
1995, 1996, 1997, 1998 WebLogic, Inc., (c) 1999 BEA S
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.swapIntervalSecs', current value: '10'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jms.ConnectionConsumer', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.enforceClientCert', current value: 'false'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.login.readTimeoutMillis', current value: '5000'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.propertiesFile', current value: 'C:\WebLogicCo
.properties'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.bindAddr', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.servlet.reloadCheckSecs', current value: '-1'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.authRealmName', current value: 'WebLogic Server
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.SSLHandler.enable', current value: 'true'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.startupFailureIsFatal', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.http.keepAliveSecs', current value: '60'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.servlet.classpath', current value: ''
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.tunneling.clientPingSecs', current value: '45'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.defaultWebApp', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.persistentStoreDir', current value: 'se
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.perServerPropertiesFile', current value: 'null
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jms.queue', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.invalidationIntervalSecs', current valu
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.persistence', current value: 'false'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.realm.cache.user.enable', current value: 'tr
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.rmi.dgc.callSystemGC', current value: 'false'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.enableEvents', current value: 'false'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jms.maxTransactedDurableSubscribers', current value:
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.weight', current value: '100'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jms.connectionPoolArgs', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.disableGuest', current value: 'false'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.persistentStorePool', current value: ''
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.URLAclFile', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.percentSocketReaders', current value: '33'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.zac.enable', current value: 'true'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jdbc.TXDataSource', current value: '[weblogic.jdbc.TX
.jts.commercePool=commercePool ]'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.DNSName', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.ejb.deploy', current value: 'C:/WebLogicCommerceServe
C:/WebLogicCommerceServer3.1/lib/axiom.jar,C:/WebLogicCommerceServer3.1/lib/
ebusiness.jar,C:/WebLogicCommerceServer3.1/lib/adv
erceServer3.1/lib/bridge.jar,C:/WebLogicCommerceServer3.1/lib/document.jar,C
:/WebLogicCommerceServer3.1/lib/p13nadvisor.jar,C:
.1/lib/portal.jar,C:/WebLogicCommerceServer3.1/lib/ruleeditorbeans.jar,C:/We
bLogicCommerceServer3.1/lib/rulesservice.jar,C:/We
lib/servicemgr.jar'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.workspace.showUserKeysOnly', current value: 'false'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jms.enable', current value: 'true'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.allow', current value: '[weblogic.allow.reserve.weblo
commercePool=everyone
weblogic.allow.execute.weblogic.servlet.Certificate=system
weblogic.allow.execute.weblogic.servlet.Admin
low.execute.weblogic.servlet.AdminLicense=system
weblogic.allow.execute.weblogic.servlet.AdminConnections=system
weblogic.allo
et.classes=everyone
weblogic.allow.execute.weblogic.servlet.AdminClients=system
weblogic.allow.execute.weblogic.servlet.AdminV
llow.execute.weblogic.servlet.AdminMain=system
weblogic.allow.execute.weblogic.servlet.AdminThreads=system
weblogic.allow.rese
tionPool.docPool=everyone weblogic.allow.read.weblogic.workspace=everyone
weblogic.allow.execute.weblogic.servlet.AdminEvents=
ite.weblogic.workspace=everyone
weblogic.allow.execute.weblogic.servlet.AdminJDBC=system
weblogic.allow.execute.weblogic.servl
ow.execute.weblogic.servlet.AdminProps=system
weblogic.allow.execute.weblogic.servlet.ConsoleHelp=everyone ]'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.listenPort', current value: '7501'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.allow', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.servlet.reloadOnModify', current value: 'false'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.io.fileSystem', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.startupArgs', current value: '[weblogic.system
p=TraceFlags=E ]'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jdbc.enableLogFile', current value: 'false'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.cookie.domain', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.realm.debug', current value: 'false'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.clustering.enable', current value: 'false'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.enable', current value: 'true'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.shutdownArgs', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.rmi.startupClass', current value: '[weblogic.rmi.star
blogic.rmi.internal.RegistryImpl ]'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.keepAlive.enable', current value: 'true'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.jdbc.connTimeoutSecs', current value: '
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.name', current value: 'server'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.helpPageURL', current value: 'http://www.weblo
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.key.server', current value: 'C:\WebLogicComm
okey.pem'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.rmi.startupArgs', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jms.topicSessionPool', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.logFileBufferKBytes', current value: '8'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.home', current value: 'C:\weblogic'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.documentRoot', current value: 'public_html'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.servlet.reloadOnModifyRecursive', current value
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.errorPage', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.certificate.authority3', current value: 'nul
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.administrativePort', current value: '0'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.certificate.authority2', current value: 'nul
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.startupClass', current value: '[weblogic.syste
tup=com.beasys.commerce.foundation.plugin.weblogic.TraceStartup
weblogic.system.startupClass.KeyBootstrap=com.beasys.commerce.
otstrap
weblogic.system.startupClass.serviceManager=com.beasys.commerce.servicemanag
er.CommerceServiceManagerStartup ]'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.nonPrivGroup', current value: 'nobody'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.cluster.multicastTTL', current value: '1'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.home', current value: 'C:\WebLogicCommerceServ
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.https.keepAliveSecs', current value: '120'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jndi.transportableObjectFactories', current value: ''
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.certificateCacheSize', current value: '3'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.tunneling.clientTimeoutSecs', current value: '4
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jdbc.DataSource', current value: '[weblogic.jdbc.Data
l.docPool=docPool ]'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.nonPrivUser', current value: 'nobody'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.zac.publishRoot', current value: 'exports'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.clientRootCA', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.cluster.defaultLoadAlgorithm', current value: 'round-
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.enable', current value: 'true'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.administrator.phone', current value: '(None)'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jdbc.connectionPool', current value: '[weblogic.jdbc.
rl=jdbc:beasys:docmgmt:com.beasys.commerce.axiom.document.ref.RefDocumentPro
vider,driver=com.beasys.commerce.axiom.document.jd
=0,initialCapacity=10,maxCapacity=20,capacityIncrement=1,allowShrinking=true
,shrinkPeriodMins=15,refreshMinutes=5,props=jdbc.u
mmercePool;jdbc.isPooled=true;weblogic.t3.waitForConnection=true;weblogic.t3
.waitSecondsForConnection=999999999999;weblogic.jt
onSecs=999999999999;docBase=C:/WebLogicCommerceServer3.1/dmsBase;schemaXML=C
:/WebLogicCommerceServer3.1/dmsBase/doc-schema.xml
nPool.commercePool=url=jdbc:cloudscape:Commerce;create=true;upgrade=true,dri
ver=COM.cloudscape.core.JDBCDriver,loginDelaySecs=
Capacity=20,capacityIncrement=1,allowShrinking=true,shrinkPeriodMins=15,test
ConnsOnReserve=true,testTable=WLCS_IS_ALIVE,refres
ne;password=none;server=none;weblogic.t3.waitForConnection=true;weblogic.t3.
waitSecondsForConnection=999999999999,weblogic.jts
nSecs=999999999999,verbose=false ]'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jms.debug', current value: 'false'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jdbc.logFileName', current value: 'C:\WebLogicCommerc
og'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.cluster.dnsName', current value: 'null'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.requireAuthentication', current value: 'true'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.cluster.multicastAddress', current value: ''
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.defaultSecureProtocol', current value: 't3s'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.realm.cache.auth.enable', current value: 'tr
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.executeThreadCount', current value: '15'
Fri Dec 01 11:04:39 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.cookie.comment', current value: 'Weblog
ng Cookie'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jms.tableNamePrefix', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jms.connectionPool', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.shutdownClass', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.defaultServlet', current value: 'file'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.cluster.name', current value: 'mycluster'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.defaultProtocol', current value: 't3'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.postTimeoutSecs', current value: '30'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.group', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.realm.cache.caseSensitive', current value: '
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.certificate.server', current value: 'C:\WebL
rver\democert.pem'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.mimeType', current value: '[weblogic.httpd.mime
.wmlscriptc=wmlsc weblogic.httpd.mimeType.application/x-java-vm=class
weblogic.httpd.mimeType.image/gif=gif weblogic.httpd.mim
stream=exe weblogic.httpd.mimeType.text/html=html,htm
weblogic.httpd.mimeType.application/pdf=pdf weblogic.httpd.mimeType.appl
ar weblogic.httpd.mimeType.image/jpeg=jpeg,jpg
weblogic.httpd.mimeType.image/vnd.wap.wbmp=wbmp
weblogic.httpd.mimeType.applica
tpd.mimeType.text/vnd.wap.wmlscript=wmls
weblogic.httpd.mimeType.text/vnd.wap.wml=wml
weblogic.httpd.mimeType.application/vnd.
ttpd.mimeType.application/x-java-serialized-object=ser ]'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.webApp', current value: '[weblogic.httpd.webApp
rceServer3.1/server/webapps/examples/portal/portal.war
weblogic.httpd.webApp.tools=C:/WebLogicCommerceServer3.1/server/webapps
c.httpd.webApp.wlcs=C:/WebLogicCommerceServer3.1/server/webapps/wlcs/ ]'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.minPasswordLen', current value: '8'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jms.connectionFactoryArgs', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.persistentStoreType', current value: 'f
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.cacheEntries', current value: '1024'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.certificate.authority', current value: 'C:\W
\server\ca.pem'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.resource.MailSession', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.cookie.maxAgeSecs', current value: '-1'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.login.readTimeoutMillisSSL', current value: '25000'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.cluster.enable', current value: 'false'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.SSL.ciphersuites', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.indexFiles', current value: 'index.html,index.h
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.password', current value: '[weblogic.password.system=
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.enableLogFile', current value: 'false'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.enableReverseDNSLookups', current value: 'fals
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.indexDirectories', current value: 'false'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.maxLogFileSize', current value: '1024'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.logFile', current value: 'C:\WebLogicCommerceS
.log'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.timeoutSecs', current value: '3600'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.logFileFormat', current value: 'common'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.perClusterPropertiesFile', current value: 'nul
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.key.export.lifespan', current value: '500'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.CORBA.connectionPool', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'java.system.property', current value: '[java.system.property.c
/WebLogicCommerceServer3.1/db/data ]'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.logFileName', current value: 'C:\WebLogicCommer
s.log'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.defaultMimeType', current value: 'text/plain'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.debug.httpd.servlet', current value: 'false'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jms.connectionFactoryName', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.SSLListenPort', current value: '7502'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.URLResource', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.cookie.name', current value: 'WebLogicS
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jms.quiescent', current value: 'false'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.register', current value: '[weblogic.httpd.regi
sys.commerce.foundation.flow.FlowManager
weblogic.httpd.register.AdminProps=admin.AdminProps
weblogic.httpd.register.classes=w
hServlet weblogic.httpd.register.AdminEvents=admin.AdminEvents
weblogic.httpd.register.AdminMain=admin.AdminMain weblogic.http
gic.servlet.ServerSideIncludeServlet
weblogic.httpd.register.servletimages=weblogic.servlet.internal.InternalImag
eServlet webl
oleHelp=weblogic.servlet.ClasspathServlet
weblogic.httpd.register.AdminJDBC=admin.AdminJDBC
weblogic.httpd.register.ShowDocSer
.content.ShowDocServlet
weblogic.httpd.register.*.jsp=weblogic.servlet.JSPServlet
weblogic.httpd.register.AdminCaptureRootCA=a
weblogic.httpd.register.AdminRealm=admin.AdminRealm
weblogic.httpd.register.AdminLicense=admin.AdminLicense weblogic.httpd.reg
certificate weblogic.httpd.register.AdminConnections=admin.AdminConnections
weblogic.httpd.register.AdminClients=admin.AdminCl
ister.file=weblogic.servlet.FileServlet
weblogic.httpd.register.AdminVersion=admin.AdminVersion
weblogic.httpd.register.authen
.ClientAuthenticationServlet
weblogic.httpd.register.AdminThreads=admin.AdminThreads ]'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.clientRootCA4', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.clientRootCA3', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.clientRootCA2', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.cookies.enable', current value: 'true'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.servlet.extensionCaseSensitive', current value:
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.realm.cache.group.enable', current value: 't
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.nativeIO.enable', current value: 'true'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.rmi.enableServerSideStubs', current value: 'false'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.cookie.path', current value: '/'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.session.URLRewriting.enable', current value: 't
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.enableSetUID', current value: 'false'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.realm.cache.acl.enable', current value: 'tru
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jms.topic', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.administrator.name', current value: 'WebLogic Adminis
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.jms.queueSessionPool', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.ssl.enable', current value: 'true'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.administrator.location', current value: '(None)'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.enableSetGID', current value: 'false'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.initArgs', current value: '[weblogic.httpd.init
Filename=/weblogic/admin/help/NoContent.html
weblogic.httpd.initArgs.*.jsp=pageCheckSeconds=0,packagePrefix=jsp,compileCo
mmand
gDir=C:/WebLogicCommerceServer3.1/server/classfiles,verbose=false,keepgenera
ted=false weblogic.httpd.initArgs.file=defaultFile
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.administrator.email', current value: 'root'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.enableConsole', current value: 'true'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.security.realm.cache.perm.enable', current value: 'tr
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.system.user', current value: 'system'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <Config> Property name:
'weblogic.httpd.charsets', current value: 'null'
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> awt.toolkit =
sun.awt.windows.WToolkit
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> cloudscape.system.home
= C:/WebLogicCommerceServer3.1/db/data
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> commerce.properties =
C:\WebLogicCommerceServer3.1\weblogiccommerce.prop
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> file.encoding = Cp1252
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> file.encoding.pkg =
sun.io
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> file.separator = \
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.awt.fonts =
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.awt.graphicsenv =
sun.awt.Win32GraphicsEnvironment
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.awt.printerjob =
sun.awt.windows.WPrinterJob
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.class.path =
C:\jdk\lib\tools.jar;C:\weblogic\lib\weblogic510sp6boo
s\boot
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.class.version =
46.0
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.compiler =
symcjit
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.ext.dirs =
C:\jdk\jre\lib\ext
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.home = C:\jdk\jre
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.io.tmpdir =
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.library.path =
C:\jdk\bin;.;C:\WINNT\System32;C:\WINNT;C:\WINNT\sys
System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program
Files\Microsoft Visual Studio\Common\MSDev98\Bin;
ft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual
Studio\VC98\bin;C:\jdk\bin;C:\weblogic\bin;C:\weblogic\bin;C:\
1\eval\win32\CyberCash\bin;C:\WebLogicCommerceServer3.1\eval\win32\Taxware\b
in
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props>
java.protocol.handler.pkgs = weblogic.utils|weblogic.utils
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.security.manager
=
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.security.policy =
C:\weblogic\weblogic.policy
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props>
java.specification.name = Java Platform API Specification
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props>
java.specification.vendor = Sun Microsystems Inc.
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props>
java.specification.version = 1.2
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.vendor = Sun
Microsystems Inc.
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.vendor.url =
http://java.sun.com/
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.vendor.url.bug =
http://java.sun.com/cgi-bin/bugreport.cgi
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.version = 1.2.2
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.vm.info = build
JDK-1.2.2-001, native threads, symcjit
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.vm.name = Classic
VM
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props>
java.vm.specification.name = Java Virtual Machine Specification
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props>
java.vm.specification.vendor = Sun Microsystems Inc.
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props>
java.vm.specification.version = 1.0
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.vm.vendor = Sun
Microsystems Inc.
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> java.vm.version =
1.2.2
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> line.separator =
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> os.arch = x86
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> os.name = Windows NT
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> os.version = 5.0
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> path.separator = ;
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> pipeline.properties =
C:\WebLogicCommerceServer3.1\pipeline.properties
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> sun.boot.class.path =
C:\jdk\jre\lib\rt.jar;C:\jdk\jre\lib\i18n.jar;C:\j
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> sun.boot.library.path
= C:\jdk\jre\bin
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props>
sun.io.unicode.encoding = UnicodeLittle
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> user.dir =
C:\WebLogicCommerceServer3.1
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> user.home =
C:\Documents and Settings\Administrator
Fri Dec 01 11:04:40 GMT+05:30 2000:<I> <System Props> user.language = en
Fri Dec 01 11:04:40 GMT+05:30 2Hello Muffy,
It looks like you do not have WLS 5.1 service pack 6 installed correctly. I
say this because I do not see the sp6 message at the top of your log and I saw
this message in your log:
org.xml.sax.SAXParseException: Element "weblogic-enterprise-bean" allows no
further input; "transaction-isolation" is not allowed
Ture Hoefner
BEA Systems, Inc.
2590 Pearl St.
Suite 110
Boulder, CO 80302
www.bea.com -
Hi ,
I want to add the conext information to my server.xml of tomcat for my hibernate configuration.....
the conext information is as follows ....
<Context path="/quickstart" docBase="quickstart">
<Resource name="jdbc/quickstart" scope="Shareable" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/quickstart">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- DBCP database connection settings -->
<parameter>
<name>url</name>
<value>jdbc:postgresql://localhost/quickstart</value>
</parameter>
<parameter>
<name>driverClassName</name><value>org.postgresql.Driver</value>
</parameter>
<parameter>
<name>username</name>
<value>quickstart</value>
</parameter>
<parameter>
<name>password</name>
<value>secret</value>
</parameter>
<!-- DBCP connection pooling options -->
<parameter>
<name>maxWait</name>
<value>3000</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>100</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>10</value>
</parameter>
</ResourceParams>
</Context>
Where in my server.xml should i put
the server.xml looks like this :
<!-- 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">
<!-- Comment these entries out to disable JMX MBeans support used for the
administration web application -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
<!-- 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"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</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="Catalina">
<!-- 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 5 documentation bundle for more detailed
instructions):
* If your JDK version 1.3 or prior, 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 HTTP/1.1 Connector on port 8080 -->
<Connector
port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to 0 -->
<!-- Note : To use gzip compression you could set the following properties :
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml"
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
<!--
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
<!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
<!-- See proxy documentation for more information about using this. -->
<!--
<Connector port="8082"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" acceptCount="100" connectionTimeout="20000"
proxyPort="80" disableUploadTimeout="true" />
-->
<!-- 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). -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
-->
<!-- Define the top level container in our container hierarchy -->
<Engine name="Catalina" defaultHost="localhost">
<!-- 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.4
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"/>
-->
<!-- 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"
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"
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"
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"
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
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<!-- Defines a cluster for this node,
By defining this element, means that every manager will be changed.
So when running a cluster, only make sure that you have webapps in there
that need to be clustered and remove the other ones.
A cluster has the following parameters:
className = the fully qualified name of the cluster class
name = a descriptive name for your cluster, can be anything
mcastAddr = the multicast address, has to be the same for all the nodes
mcastPort = the multicast port, has to be the same for all the nodes
mcastBindAddr = bind the multicast socket to a specific address
mcastTTL = the multicast TTL if you want to limit your broadcast
mcastSoTimeout = the multicast readtimeout
mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
in case of multiple ethernet cards.
auto means that address becomes
InetAddress.getLocalHost().getHostAddress()
tcpListenPort = the tcp listen port
tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
has a wakup bug in java.nio. Set to 0 for no timeout
printToScreen = true means that managers will also print to std.out
expireSessionsOnShutdown = true means that
useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
false means to replicate the session after each request.
false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager)
<%
HashMap map = (HashMap)session.getAttribute("map");
map.put("key","value");
%>
replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
* Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
* Synchronous means that the thread that executes the request, is also the
thread the replicates the data to the other nodes, and will not return until all
nodes have received the information.
* Asynchronous means that there is a specific 'sender' thread for each cluster node,
so the request thread will queue the replication request into a "smart" queue,
and then return to the client.
The "smart" queue is a queue where when a session is added to the queue, and the same session
already exists in the queue from a previous request, that session will be replaced
in the queue instead of replicating two requests. This almost never happens, unless there is a
large network delay.
-->
<!--
When configuring for clustering, you also add in a valve to catch all the requests
coming in, at the end of the request, the session may or may not be replicated.
A session is replicated if and only if all the conditions are met:
1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
2. a session exists (has been created)
3. the request is not trapped by the "filter" attribute
The filter attribute is to filter out requests that could not modify the session,
hence we don't replicate the session after the end of this request.
The filter is negative, ie, anything you put in the filter, you mean to filter out,
ie, no replication will be done on requests that match one of the filters.
The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
ending with .gif and .js are intercepted.
The deployer element can be used to deploy apps cluster wide.
Currently the deployment only deploys/undeploys to working members in the cluster
so no WARs are copied upons startup of a broken node.
The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
When a new war file is added the war gets deployed to the local instance,
and then deployed to the other instances in the cluster.
When a war file is deleted from the watchDir the war is undeployed locally
and cluster wide
-->
<!--
<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
managerClassName="org.apache.catalina.cluster.session.DeltaManager"
expireSessionsOnShutdown="false"
useDirtyFlag="true"
notifyListenersOnReplication="true">
<Membership
className="org.apache.catalina.cluster.mcast.McastService"
mcastAddr="228.0.0.4"
mcastPort="45564"
mcastFrequency="500"
mcastDropTime="3000"/>
<Receiver
className="org.apache.catalina.cluster.tcp.ReplicationListener"
tcpListenAddress="auto"
tcpListenPort="4001"
tcpSelectorTimeout="100"
tcpThreadCount="6"/>
<Sender
className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
replicationMode="pooled"
ackTimeout="15000"/>
<Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
<Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/"
deployDir="/tmp/war-deploy/"
watchDir="/tmp/war-listen/"
watchEnabled="false"/>
</Cluster>
-->
<!-- 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" />
-->
<!-- 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"/>
-->
<!-- 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.
This access log implementation is optimized for maximum performance,
but is hardcoded to support only the "common" and "combined" patterns.
-->
<!--
<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
-->
</Host>
</Engine>
</Service>
</Server>
Can Some one Help me pleaseeeeeePlease don't cross-post in multiple forums. I have answered
this in your other thread. -
Create a new web application, how shall I update the file server.xml
Hi,
I will create a new web application, i.e named newApp. Then I create a file structure as follows:
- <server-root>/newApp
- <server-root>/newApp/WEB-INF
- <server-root>/newApp/WEB-INF/classes
Then I must tell the server that I have created a new web application. Then I must update my file server.xml, How shall I do this and where in the file shall I type in the new information?
I use windows XP Pro, and Tomcat 4.1.27.
My server.xml file looks like below:
<!-- 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">
<!-- Comment these entries out to disable JMX MBeans support -->
<!-- You may also configure custom components (e.g. Valves/Realms) by
including your own mbean-descriptor file(s), and setting the
"descriptors" attribute to point to a ';' seperated list of paths
(in the ClassLoader sense) of files to add to the default list.
e.g. descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"
-->
<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 8080 -->
<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="0"
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"
acceptCount="100" debug="0" connectionTimeout="20000"
proxyPort="80" useURIValidationHack="false"
disableUploadTimeout="true" />
-->
<!-- 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). -->
<!-- You should set jvmRoute to support load-balancing via JK/JK2 ie :
<Engine name="Standalone" defaultHost="localhost" debug="0" jmvRoute="jvm1">
-->
<!-- 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">
<!-- 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. -->
<DefaultContext reloadable="true"/>
<!-- 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_examples_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 or 0 means unlimited sessions are allowed.
If it is not possible to swap sessions new sessions will
be rejected.
This avoids thrashing when the site is highly active.
minIdleSwap: Sessions must be idle for at least this long
(in seconds) before they will be swapped out due to
activity.
0 means sessions will almost always be swapped out after
use - this will be noticeably slow for your users.
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"/>
<ResourceParams name="jdbc/EmployeeAppDb">
<parameter><name>username</name><value>sa</value></parameter>
<parameter><name>password</name><value></value></parameter>
<parameter><name>driverClassName</name>
<value>org.hsql.jdbcDriver</value></parameter>
<parameter><name>url</name>
<value>jdbc:HypersonicSQL:database</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>
</Server>To use servlets u have indeed to update your web.xml...Well I'm not sure this is relevant to your case anyway.
You have to add a <servlet> element to this file.
Something like this:
<servlet>
<servlet-name>blabla</servlet-name>
<servlet-class>blablapackage.Blablaclass</servlet-class>
<init-param>...</init-param>
</servlet>
Now this may not solve your problem. Make sure you refer to your servlets using their full qualified names.btw, just to be sure, what is your definition of "servlet"? (i mean: any java class or only javax.servlet.Servlet) -
Problem with Configuring Tomcat for running jsp web applications..Plz HELP
I am using Tomcat 5.5 and Jdk 1.5.0_12 and Oracle 10g. I am using jdbc-odbc bridge connection
to connect to the database. I have placed my project folder called
tdm under the webapps folder in Tomcat. This 'tdm' folder consists of
a collection of html pages,jsp pages and images of my project. Also I created a
WEB-INF folderand in that I have lib folder which contains catalina-root.jar
, classes12.jar and nls_charset.jar files. And also in the WEB-INF folder I have the web.xml
file which looks like this
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app>
<resource-ref>
<description>Oracle Datasource example</description>
<res-ref-name>jdbc/gdn</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
My Server.xml file in Tomcat\conf folder is as follows
<!-- 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">
<!-- Comment these entries out to disable JMX MBeans support used for the
administration web application -->
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<!-- 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"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
<Resource name="jdbc/gdn" auth="Container"
type="javax.sql.DataSource" driverClassName="sun.jdbc.odbc.JdbcOdbcDriver"
url="jdbc:odbc:gdn"
username="system" password="tiger" maxActive="20" maxIdle="10"
maxWait="-1"/>
</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="Catalina">
<!-- 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 5 documentation bundle for more detailed
instructions):
* If your JDK version 1.3 or prior, 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 HTTP/1.1 Connector on port 8080 -->
<Connector
port="5050" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to 0 -->
<!-- Note : To use gzip compression you could set the following properties :
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml"
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
<!--
<Connector port="8443"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
<!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
<!-- See proxy documentation for more information about using this. -->
<!--
<Connector port="8082"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" acceptCount="100" connectionTimeout="20000"
proxyPort="80" disableUploadTimeout="true" />
-->
<!-- 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). -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
-->
<!-- Define the top level container in our container hierarchy -->
<Engine name="Catalina" defaultHost="localhost">
<!-- 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.4
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"/>
-->
<!-- 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"
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"
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"
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"
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
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<!-- Defines a cluster for this node,
By defining this element, means that every manager will be changed.
So when running a cluster, only make sure that you have webapps in there
that need to be clustered and remove the other ones.
A cluster has the following parameters:
className = the fully qualified name of the cluster class
name = a descriptive name for your cluster, can be anything
mcastAddr = the multicast address, has to be the same for all the nodes
mcastPort = the multicast port, has to be the same for all the nodes
mcastBindAddr = bind the multicast socket to a specific address
mcastTTL = the multicast TTL if you want to limit your broadcast
mcastSoTimeout = the multicast readtimeout
mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
in case of multiple ethernet cards.
auto means that address becomes
InetAddress.getLocalHost().getHostAddress()
tcpListenPort = the tcp listen port
tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
has a wakup bug in java.nio. Set to 0 for no timeout
printToScreen = true means that managers will also print to std.out
expireSessionsOnShutdown = true means that
useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
false means to replicate the session after each request.
false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager)
<%
HashMap map = (HashMap)session.getAttribute("map");
map.put("key","value");
%>
replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
* Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
* Synchronous means that the thread that executes the request, is also the
thread the replicates the data to the other nodes, and will not return until all
nodes have received the information.
* Asynchronous means that there is a specific 'sender' thread for each cluster node,
so the request thread will queue the replication request into a "smart" queue,
and then return to the client.
The "smart" queue is a queue where when a session is added to the queue, and the same session
already exists in the queue from a previous request, that session will be replaced
in the queue instead of replicating two requests. This almost never happens, unless there is a
large network delay.
-->
<!--
When configuring for clustering, you also add in a valve to catch all the requests
coming in, at the end of the request, the session may or may not be replicated.
A session is replicated if and only if all the conditions are met:
1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
2. a session exists (has been created)
3. the request is not trapped by the "filter" attribute
The filter attribute is to filter out requests that could not modify the session,
hence we don't replicate the session after the end of this request.
The filter is negative, ie, anything you put in the filter, you mean to filter out,
ie, no replication will be done on requests that match one of the filters.
The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
ending with .gif and .js are intercepted.
The deployer element can be used to deploy apps cluster wide.
Currently the deployment only deploys/undeploys to working members in the cluster
so no WARs are copied upons startup of a broken node.
The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
When a new war file is added the war gets deployed to the local instance,
and then deployed to the other instances in the cluster.
When a war file is deleted from the watchDir the war is undeployed locally
and cluster wide
-->
<!--
<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
managerClassName="org.apache.catalina.cluster.session.DeltaManager"
expireSessionsOnShutdown="false"
useDirtyFlag="true"
notifyListenersOnReplication="true">
<Membership
className="org.apache.catalina.cluster.mcast.McastService"
mcastAddr="228.0.0.4"
mcastPort="45564"
mcastFrequency="500"
mcastDropTime="3000"/>
<Receiver
className="org.apache.catalina.cluster.tcp.ReplicationListener"
tcpListenAddress="auto"
tcpListenPort="4001"
tcpSelectorTimeout="100"
tcpThreadCount="6"/>
<Sender
className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
replicationMode="pooled"
ackTimeout="15000"/>
<Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
<Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/"
deployDir="/tmp/war-deploy/"
watchDir="/tmp/war-listen/"
watchEnabled="false"/>
</Cluster>
-->
<!-- 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" />
-->
<!-- 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"/>
-->
<!-- 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.
This access log implementation is optimized for maximum performance,
but is hardcoded to support only the "common" and "combined" patterns.
-->
<!--
<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
-->
<Context path="/tdm" docBase="tdm" debug="0" reloadable="true" />
</Host>
</Engine>
</Service>
</Server>
I have set the context path to /tdm in the server.xml file. Should this be placed in context.xml?
My first page in the project is called Homepage.html. To start my project I give http://localhost:5050/tdm/homepage.html
in a browser. Here I accept a username and password from the user and then do the validation in
a valid.jsp file, where I connect to the database and check and use jsp:forward to go to next pages
accordingly. However when I enter the username and password and click Go in the homepage, nothing is
displayed on the next page. The URL in the browser says valid.jsp but a blank screen appears.
WHY DOES IT HAPPEN SO? DOES IT MEAN THAT TOMCAT IS NOT RECOGNIZING JAVA IN MY SYSTEM OR IS IT A PROBLEM
WITH THE DATABASE CONNECTION OR SOMETHING ELSE? I FEEL THAT TOMCAT IS NOT EXECUTING JSP COMMANDS?
IS IT POSSIBLE?WHY WILL THIS HAPPEN?
I set the JAVA_HOME and CATALINA_HOME environment to the jdk and tomcat folders resp.
Is there any other thing that I need to set in classpath? Should I have my project as a
WAR file in the webapps of TOMCAT or just a folder i.e. directory structure will fine?I am using Tomcat 5.5 and Jdk 1.5.0_12 and Oracle 10g. I am using jdbc-odbc bridge connection
to connect to the database. I have placed my project folder called
tdm under the webapps folder in Tomcat. This 'tdm' folder consists of
a collection of html pages,jsp pages and images of my project. Also I created a
WEB-INF folderand in that I have lib folder which contains catalina-root.jar
, classes12.jar and nls_charset.jar files. And also in the WEB-INF folder I have the web.xml
file which looks like this
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app>
<resource-ref>
<description>Oracle Datasource example</description>
<res-ref-name>jdbc/gdn</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
My Server.xml file in Tomcat\conf folder is as follows
<!-- 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">
<!-- Comment these entries out to disable JMX MBeans support used for the
administration web application -->
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<!-- 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"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
<Resource name="jdbc/gdn" auth="Container"
type="javax.sql.DataSource" driverClassName="sun.jdbc.odbc.JdbcOdbcDriver"
url="jdbc:odbc:gdn"
username="system" password="tiger" maxActive="20" maxIdle="10"
maxWait="-1"/>
</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="Catalina">
<!-- 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 5 documentation bundle for more detailed
instructions):
* If your JDK version 1.3 or prior, 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 HTTP/1.1 Connector on port 8080 -->
<Connector
port="5050" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to 0 -->
<!-- Note : To use gzip compression you could set the following properties :
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml"
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
<!--
<Connector port="8443"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
<!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
<!-- See proxy documentation for more information about using this. -->
<!--
<Connector port="8082"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" acceptCount="100" connectionTimeout="20000"
proxyPort="80" disableUploadTimeout="true" />
-->
<!-- 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). -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
-->
<!-- Define the top level container in our container hierarchy -->
<Engine name="Catalina" defaultHost="localhost">
<!-- 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.4
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"/>
-->
<!-- 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"
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"
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"
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"
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
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<!-- Defines a cluster for this node,
By defining this element, means that every manager will be changed.
So when running a cluster, only make sure that you have webapps in there
that need to be clustered and remove the other ones.
A cluster has the following parameters:
className = the fully qualified name of the cluster class
name = a descriptive name for your cluster, can be anything
mcastAddr = the multicast address, has to be the same for all the nodes
mcastPort = the multicast port, has to be the same for all the nodes
mcastBindAddr = bind the multicast socket to a specific address
mcastTTL = the multicast TTL if you want to limit your broadcast
mcastSoTimeout = the multicast readtimeout
mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
in case of multiple ethernet cards.
auto means that address becomes
InetAddress.getLocalHost().getHostAddress()
tcpListenPort = the tcp listen port
tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
has a wakup bug in java.nio. Set to 0 for no timeout
printToScreen = true means that managers will also print to std.out
expireSessionsOnShutdown = true means that
useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
false means to replicate the session after each request.
false means that replication would work for the following piece of code: (only for SimpleTcpReplicationManager)
<%
HashMap map = (HashMap)session.getAttribute("map");
map.put("key","value");
%>
replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
* Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
* Synchronous means that the thread that executes the request, is also the
thread the replicates the data to the other nodes, and will not return until all
nodes have received the information.
* Asynchronous means that there is a specific 'sender' thread for each cluster node,
so the request thread will queue the replication request into a "smart" queue,
and then return to the client.
The "smart" queue is a queue where when a session is added to the queue, and the same session
already exists in the queue from a previous request, that session will be replaced
in the queue instead of replicating two requests. This almost never happens, unless there is a
large network delay.
-->
<!--
When configuring for clustering, you also add in a valve to catch all the requests
coming in, at the end of the request, the session may or may not be replicated.
A session is replicated if and only if all the conditions are met:
1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
2. a session exists (has been created)
3. the request is not trapped by the "filter" attribute
The filter attribute is to filter out requests that could not modify the session,
hence we don't replicate the session after the end of this request.
The filter is negative, ie, anything you put in the filter, you mean to filter out,
ie, no replication will be done on requests that match one of the filters.
The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
ending with .gif and .js are intercepted.
The deployer element can be used to deploy apps cluster wide.
Currently the deployment only deploys/undeploys to working members in the cluster
so no WARs are copied upons startup of a broken node.
The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
When a new war file is added the war gets deployed to the local instance,
and then deployed to the other instances in the cluster.
When a war file is deleted from the watchDir the war is undeployed locally
and cluster wide
-->
<!--
<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
managerClassName="org.apache.catalina.cluster.session.DeltaManager"
expireSessionsOnShutdown="false"
useDirtyFlag="true"
notifyListenersOnReplication="true">
<Membership
className="org.apache.catalina.cluster.mcast.McastService"
mcastAddr="228.0.0.4"
mcastPort="45564"
mcastFrequency="500"
mcastDropTime="3000"/>
<Receiver
className="org.apache.catalina.cluster.tcp.ReplicationListener"
tcpListenAddress="auto"
tcpListenPort="4001"
tcpSelectorTimeout="100"
tcpThreadCount="6"/>
<Sender
className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
replicationMode="pooled"
ackTimeout="15000"/>
<Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
<Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/"
deployDir="/tmp/war-deploy/"
watchDir="/tmp/war-listen/"
watchEnabled="false"/>
</Cluster>
-->
<!-- 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" />
-->
<!-- 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"/>
-->
<!-- 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.
This access log implementation is optimized for maximum performance,
but is hardcoded to support only the "common" and "combined" patterns.
-->
<!--
<Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
-->
<Context path="/tdm" docBase="tdm" debug="0" reloadable="true" />
</Host>
</Engine>
</Service>
</Server>
I have set the context path to /tdm in the server.xml file. Should this be placed in context.xml?
My first page in the project is called Homepage.html. To start my project I give http://localhost:5050/tdm/homepage.html
in a browser. Here I accept a username and password from the user and then do the validation in
a valid.jsp file, where I connect to the database and check and use jsp:forward to go to next pages
accordingly. However when I enter the username and password and click Go in the homepage, nothing is
displayed on the next page. The URL in the browser says valid.jsp but a blank screen appears.
WHY DOES IT HAPPEN SO? DOES IT MEAN THAT TOMCAT IS NOT RECOGNIZING JAVA IN MY SYSTEM OR IS IT A PROBLEM
WITH THE DATABASE CONNECTION OR SOMETHING ELSE? I FEEL THAT TOMCAT IS NOT EXECUTING JSP COMMANDS?
IS IT POSSIBLE?WHY WILL THIS HAPPEN?
I set the JAVA_HOME and CATALINA_HOME environment to the jdk and tomcat folders resp.
Is there any other thing that I need to set in classpath? Should I have my project as a
WAR file in the webapps of TOMCAT or just a folder i.e. directory structure will fine? -
Problem with JavaBeans in JSP.IT'S URGENT!!!
Hi, i have problems with JavaBeans in JSP.
In a jsp file( locating in ROOT directory of tomcat 4.0.6 :jakarta-tomcat-4.0.6\webapps\root ) i have this code:
<jsp:useBean id="paramBean" class="licentza.ParamBean" />
<jsp:setProperty name="paramBean"
property="nume"
value='<%= request.getParameter("numeUser") %>' />
where ParamBean it's a "bean" class locating in jakarta-tomcat-4.0.6\webapps\examples\web-inf\classes\licentza (licentza is the package i'm using).
And i get this error:
Generated servlet error:
D:\jakarta-tomcat-4.0.6\work\Standalone\localhost\_\dora\intrare2$jsp.java:67: Class licentza.ParamBean not found.
ParamBean paramBean = null;
What is the problem?Thank you.Hi,
Put the class file or the package under :jakarta-tomcat-4.0.6\webapps\root\WEB-INF\classes.
Rajesh -
Creating a file in different directory.....
i have program that uses File class from Java IO package for creating a text file. I have written this program in c:\test\proj and i am running the program in that location. So obviously text file is created in the same directory...
But the information from this text file is required for my servlet that runs on web server tomcat 4.1..so i have to manually copy this file and place this on the required directory...i have written program to create the same file on in C:\Program Files\Apache Group\Tomcat 4.1\webapps\examples this directory but this is not happening..I reckon this is because of the spaces in the directory names....
my problem is i am running program on c:\text\proj directory and i want text file to be created in C:\Program Files\Apache Group\Tomcat 4.1\webapps\examples...
the statement i am using to create a file is...
File f = new File("C:/Program Files/Apache Group/Tomcat 4.1/webapps/examples/ping.txt");
do i have to modify the statment????
please provide me with a solution...
thanxYou must be getting an IOException of some description when you open the output stream to the File.
Or else you're looking for your file in the wrong place ... -
Exception report when using tomcat 5 with JDBC
i followed this guide to setup the JDBC with my TOMCAT 5
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations
but i seem to get this error
exception
javax.servlet.ServletException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'"
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.SID.test_jsp._jspService(test_jsp.java:81)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'"
org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:276)
org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:159)
org.apache.jsp.SID.test_jsp._jspx_meth_sql_query_0(test_jsp.java:100)
org.apache.jsp.SID.test_jsp._jspService(test_jsp.java:58)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
i can compile *.java and run them when they need the jdbc drivers to interact with mysql 5 database.
This is my server.xml
<!-- 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">
<!-- Comment these entries out to disable JMX MBeans support -->
<!-- You may also configure custom components (e.g. Valves/Realms) by
including your own mbean-descriptor file(s), and setting the
"descriptors" attribute to point to a ';' seperated list of paths
(in the ClassLoader sense) of files to add to the default list.
e.g. descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"
-->
<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="Catalina">
<!-- 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 5 documentation bundle for more detailed
instructions):
* If your JDK version 1.3 or prior, 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 8080 -->
<Connector port="8080"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to 0 -->
<!-- Note : To use gzip compression you could set the following properties :
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml"
-->
<!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<!--
<Connector port="8443"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
<Connector port="8009"
enableLookups="false" redirectPort="8443" debug="0"
protocol="AJP/1.3" />
<!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
<!-- See proxy documentation for more information about using this. -->
<!--
<Connector port="8082"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false"
acceptCount="100" debug="0" connectionTimeout="20000"
proxyPort="80" disableUploadTimeout="true" />
-->
<!-- 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). -->
<!-- You should set jvmRoute to support load-balancing via JK/JK2 ie :
<Engine name="Standalone" defaultHost="localhost" debug="0" jvmRoute="jvm1">
-->
<!-- Define the top level container in our container hierarchy -->
<Engine name="Catalina" 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.4
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
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<!-- Defines a cluster for this node,
By defining this element, means that every manager will be changed.
So when running a cluster, only make sure that you have webapps in there
that need to be clustered and remove the other ones.
A cluster has the following parameters:
className = the fully qualified name of the cluster class
name = a descriptive name for your cluster, can be anything
debug = the debug level, higher means more output
mcastAddr = the multicast address, has to be the same for all the nodes
mcastPort = the multicast port, has to be the same for all the nodes
mcastBindAddr = bind the multicast socket to a specific address
mcastTTL = the multicast TTL if you want to limit your broadcast
mcastSoTimeout = the multicast readtimeout
mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
in case of multiple ethernet cards.
auto means that address becomes
InetAddress.getLocalHost().getHostAddress()
tcpListenPort = the tcp listen port
tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
has a wakup bug in java.nio. Set to 0 for no timeout
printToScreen = true means that managers will also print to std.out
expireSessionsOnShutdown = true means that
useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
false means to replicate the session after each request.
false means that replication would work for the following piece of code:
<%
HashMap map = (HashMap)session.getAttribute("map");
map.put("key","value");
%>
replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
* Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
* Synchronous means that the thread that executes the request, is also the
thread the replicates the data to the other nodes, and will not return until all
nodes have received the information.
* Asynchronous means that there is a specific 'sender' thread for each cluster node,
so the request thread will queue the replication request into a "smart" queue,
and then return to the client.
The "smart" queue is a queue where when a session is added to the queue, and the same session
already exists in the queue from a previous request, that session will be replaced
in the queue instead of replicating two requests. This almost never happens, unless there is a
large network delay.
-->
<!--
When configuring for clustering, you also add in a valve to catch all the requests
coming in, at the end of the request, the session may or may not be replicated.
A session is replicated if and only if all the conditions are met:
1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
2. a session exists (has been created)
3. the request is not trapped by the "filter" attribute
The filter attribute is to filter out requests that could not modify the session,
hence we don't replicate the session after the end of this request.
The filter is negative, ie, anything you put in the filter, you mean to filter out,
ie, no replication will be done on requests that match one of the filters.
The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
ending with .gif and .js are intercepted.
The deployer element can be used to deploy apps cluster wide.
Currently the deployment only deploys/undeploys to working members in the cluster
so no WARs are copied upons startup of a broken node.
The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
When a new war file is added the war gets deployed to the local instance,
and then deployed to the other instances in the cluster.
When a war file is deleted from the watchDir the war is undeployed locally
and cluster wide
-->
<!--
<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
managerClassName="org.apache.catalina.cluster.session.DeltaManager"
expireSessionsOnShutdown="false"
useDirtyFlag="true">
<Membership
className="org.apache.catalina.cluster.mcast.McastService"
mcastAddr="228.0.0.4"
mcastPort="45564"
mcastFrequency="500"
mcastDropTime="3000"/>
<Receiver
className="org.apache.catalina.cluster.tcp.ReplicationListener"
tcpListenAddress="auto"
tcpListenPort="4001"
tcpSelectorTimeout="100"
tcpThreadCount="6"/>
<Sender
className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
replicationMode="pooled"/>
<Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
<Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/"
deployDir="/tmp/war-deploy/"
watchDir="/tmp/war-listen/"
watchEnabled="false"/>
</Cluster>
-->
<!-- 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"/>
<Context path="/testdb" docBase="APACHE_DIR/htdocs/testdb"
debug="5" reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_DBTest_log." suffix=".txt"
timestamp="true"/>
<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>10</value>
</parameter>
<!-- Maximum number of idle dB connections to retain in pool.
Set to 0 for no limit.
-->
<parameter>
<name>maxIdle</name>
<value>5</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>username</name>
<value>test</value>
</parameter>
<parameter>
<name>password</name>
<value>testpwd</value>
</parameter>
<!-- Class name for mm.mysql JDBC driver -->
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.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/testdb?autoReconnect=true</value>
</parameter>
</ResourceParams>
</Context>
</Host>
</Engine>
</Service>
</Server>You haven't added a resource reference for your web application that gives the application a local name for the global resource "UserDatabase".
-
I am using the core servlets book and Tomcat 3.2.4 to learn JSP. The first example will not work because of the follwing exception:
org.apache.jasper.compiler.CompileException: E:\Tomcat324\jakarta-tomcat-3.2.4\webapps\examples\jsp\SimpleExample.jsp(14,7) Unable to load class E:\Tomcat324\jakarta-tomcat-3.2.4\webapps\examples\WEB-INF\classes\tags.ExampleTag
I have the following files in the following paths:
ExampleTag.java is in the path E:\Tomcat324\jakarta-tomcat-3.2.4\webapps\examples\WEB-INF\classes\tags.ExampleTag and the code is as follows:
package tags;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.io.*;
/** Very simple JSP tag that just inserts a string
* ("Custom tag example...") into the output.
* The actual name of the tag is not defined here;
* that is given by the Tag Library Descriptor (TLD)
* file that is referenced by the taglib directive
* in the JSP file.
* <P>
* Taken from Core Servlets and JavaServer Pages
* from Prentice Hall and Sun Microsystems Press,
* http://www.coreservlets.com/.
* © 2000 Marty Hall; may be freely used or adapted.
public class ExampleTag extends TagSupport {
public int doStartTag() {
try {
JspWriter out = pageContext.getOut();
out.print("Custom tag example " +
"(tags.ExampleTag)");
} catch(IOException ioe) {
System.out.println("Error in ExampleTag: " + ioe);
return(SKIP_BODY);
This is an excert from the Tag Library Descriptor file named csajsp-taglib.tld (the entire file is too long to include). This is in path :E:\Tomcat324\jakarta-tomcat-3.2.4\webapps\examples\jsp
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<!-- a tag library descriptor -->
<taglib>
<!-- after this the default space is
"http://java.sun.com/j2ee/dtds/jsptaglibrary_1_2.dtd"
-->
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>csajsp</shortname>
<!-- ** CHANGED FROM "urn" TO "uri" IN TOMCAT 3.1 ** -->
<uri></uri>
<info>
A tag library from Core Servlets and JavaServer Pages,
http://www.coreservlets.com/.
</info>
<!--
<tag>
The name (after prefix) tag will have in JSP code
<name>example</name>
The actual class implementing tag. In
Tomcat 3.1 beta, it MUST be in a package.
<tagclass>tags.ExampleTag</tagclass>
Descriptive information about tag.
<info>Simplest example: inserts one line of output</info>
One of three values describing what goes between
start and end tag.
empty: no body
JSP: body that is evaluated by container normally,
then possibly processed by tag
tagdependent: body is only processed by tag;
JSP in body is not evaluated.
** NOTE: TOMCAT 3.1 FINAL DOES NOT SUPPORT BODYCONTENT **
** THE BETA SUPPORTED IT, AND IT IS PART OF SPEC, BUT... **
<bodycontent>empty</bodycontent>
</tag>
-->
<tag>
<name>example</name>
<tagclass>E:\Tomcat324\jakarta-tomcat-3.2.4\webapps\examples\WEB-INF\classes\tags.ExampleTag</tagclass>
<info>Simplest example: inserts one line of output</info>
<!-- TOMCAT 3.1 DOES NOT SUPPORT BODYCONTENT
<bodycontent>empty</bodycontent> -->
</tag>
and the .jsp file is SimpleExample.jsp and is located in the path E:\Tomcat324\jakarta-tomcat-3.2.4\webapps\examples\jsp\SimpleExample.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
Illustration of very simple JSP custom tag.
Taken from Core Servlets and JavaServer Pages
from Prentice Hall and Sun Microsystems Press,
http://www.coreservlets.com/.
© 2000 Marty Hall; may be freely used or adapted.
-->
<HTML>
<HEAD>
<%@ taglib uri="csajsp-taglib.tld" prefix="csajsp" %>
<TITLE><csajsp:example /></TITLE>
<LINK REL=STYLESHEET
HREF="JSP-Styles.css"
TYPE="text/css">
</HEAD>
<BODY>
<H1><csajsp:example /></H1>
<csajsp:example />
</BODY>
</HTML>
I have tried putting the ExampleTag.java file and the folder that it is in, 'tags', in about every path I can think of and I get the same error. I also tried removing the entire path from the .tld file and just calling for tags.ExampleTag. Still no luck.
I am using win98.
Any assistance will be greatly appreciated.
Thanks,
ScottI compiled the .java and put the .class file in the following path:
E:\Tomcat324\jakarta-tomcat-3.2.4\webapps\examples\WEB-INF\classes\tags
I am getting the error: org.apache.jasper.compiler.CompileException: E:\Tomcat324\jakarta-tomcat-3.2.4\webapps\examples\jsp\SimpleExample.jsp(14,7)
Unable to load class E:\Tomcat324\jakarta-tomcat-3.2.4\webapps\examples\WEB-INF\classes\tags.ExampleTag
Here is another look at the .java file that I compiled:
package tags;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.io.*;
/** Very simple JSP tag that just inserts a string
* ("Custom tag example...") into the output.
* The actual name of the tag is not defined here;
* that is given by the Tag Library Descriptor (TLD)
* file that is referenced by the taglib directive
* in the JSP file.
* <P>
* Taken from Core Servlets and JavaServer Pages
* from Prentice Hall and Sun Microsystems Press,
* http://www.coreservlets.com/.
* � 2000 Marty Hall; may be freely used or adapted.
public class ExampleTag extends TagSupport {
public int doStartTag() {
try {
JspWriter out = pageContext.getOut();
out.print("Custom tag example " +
"(tags.ExampleTag)");
} catch(IOException ioe) {
System.out.println("Error in ExampleTag: " + ioe);
return(SKIP_BODY);
Any idea why I am still getting an error?
Maybe you are looking for
-
Text search returns results with some keywords, but not others
This pertains to a tours website for Turkey. I've sucessfully set up a search form, and results page which returns results when multiple keywords are entered. Everything is working well, except when certain keywords are used. For example, the table c
-
Fastest way to copy a DVD burned with eMac????
I need to make multiple copies (more than 30) of a DVD I made for a family reunion. The DVD is about 2 hours long. I have made a disc image on my hard drive, but the burning is still taking 30 mins per disc. Is there a faster way? Are there external
-
Besides the fact that that OSX in the meanwhile looks almost like Windoof (each application has got its own interpretation of Aqua... looks absolutely AWFULL in my opinion), the software´s got more and more problems. The videos on my G5 run jerky as
-
Error during MDEX installation
Hello When I try to install MDEX Engine, I get this message: "Runtime error in install: List index out of bounds (0)". It seems like it were uninstalled incorrectly and there are some files that makes reinstallation impossible. If someone knows how t
-
I just bought a 4s and it charges in the wall but not when plugged into my macbook pro
help!? my macbook pro ( up to date ) and my 4S ( up to date ) won't charge when plugged into the computer.. it works with the wall charger but not on the computer... do i need to resintall usb drivers?