How to compile from source

2007-07-07 Thread Marcello Pucci

I've just completed the steps required to build apache-tomcat-5.5 from source,
next step should be going to install all required binary files in the
final distribution directory, e.g /opt/apache-tomcat-5.5/

How can i achieve this goal ? I won't copy all uncessary source (.java) files.

I can't find any dist target in build.xml file coming from svn source
repository.

Can u help me? Thank in advice.

Ciao

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Context.xml error

2007-07-07 Thread Artur Rataj

Hello. I added a second context to Context.xml:

Context reloadable=true privileged=true
WatchedResourceWEB-INF/web.xml/WatchedResource
/Context

Context path=/informacja_ekspresowa
docBase=/home/library/islib/Informacja_Ekspresowa/
   reloadable=true
/Context


and tomcat stopped to work:


2007-07-07 11:23:06 org.apache.tomcat.util.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 20 column 2: The markup in the
document following the root element must be well-formed.
org.xml.sax.SAXParseException: The markup in the document following
the root element must be well-formed.
   at 
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
   at 
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
   at 
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
   at 
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
   at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$TrailingMiscDriver.next(XMLDocumentScannerImpl.java:1394)
   at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645)
   at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
   at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
   at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
   at 
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
   at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
   at 
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
   at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1562)
   at 
org.apache.catalina.startup.ContextConfig.processContextConfig(ContextConfig.java:800)
   at 
org.apache.catalina.startup.ContextConfig.contextConfig(ContextConfig.java:736)
   at 
org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:1005)
   at 
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279)
   at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
   at 
org.apache.catalina.core.StandardContext.init(StandardContext.java:5297)
   at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4070)
   at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
   at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
   at 
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
   at 
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
   at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at 
org.apache.catalina.core.StandardService.start(StandardService.java:516)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
   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:597)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2007-07-07 11:23:06 org.apache.catalina.startup.ContextConfig
processContextConfig
SEVERE: Parse error in context.xml for /docs
org.xml.sax.SAXParseException: The markup in the document following
the root element must be well-formed.
   at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231)
   at 
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
   at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1562)
   at 

Re: Context.xml error

2007-07-07 Thread Juha Laiho
Artur Rataj wrote:
 Hello. I added a second context to Context.xml:
 
 Context reloadable=true privileged=true
 WatchedResourceWEB-INF/web.xml/WatchedResource
 /Context
 
 Context path=/informacja_ekspresowa
 docBase=/home/library/islib/Informacja_Ekspresowa/
reloadable=true
 /Context
 
 
 and tomcat stopped to work:
 
 
 2007-07-07 11:23:06 org.apache.tomcat.util.digester.Digester fatalError
 SEVERE: Parse Fatal Error at line 20 column 2: The markup in the
 document following the root element must be well-formed.
 org.xml.sax.SAXParseException: The markup in the document following
 the root element must be well-formed.

...

 2007-07-07 11:23:06 org.apache.catalina.startup.ContextConfig
 processContextConfig
 SEVERE: Parse error in context.xml for /docs
 org.xml.sax.SAXParseException: The markup in the document following
 the root element must be well-formed.
...


 2007-07-07 11:23:06 org.apache.catalina.startup.ContextConfig
 processContextConfig
 SEVERE: Occurred at line 20 column 2
 
 
 Could you tell me why?

Hmm.. could you tell which of the lines is line 20 in context.xml for /docs?

Looking at that the context data you posted, at least the first one is
missing the path=/... attribute (which is required to be unique for all
context within a given host -- and I think this requirement makes the
path attribute mandatory as well).
-- 
..Juha

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: iPlanet / SunONE web server tomcat connector connection re-use disabled

2007-07-07 Thread Rainer Jung

Hi Dale,

thanks for digging into this. In fact the Netscape/Sun connector is not 
in very good shape at the moment. The amount of work that will go into 
it, to bring it into a better shape depends on people like you, that are 
going to help us. The Netscape/Sun community seemed to almost 
non-existant for many months and only recently a few people showed up 
and asked questions about the connector.


Would you please open a bugzilla for your observation and add your 
changes as a patch to it? This way it is more likely, that we will 
remember this as an open point.


You might also like to check out jk from subversion and build the 
Netscape connector from this version. I added some enhancements/bug 
fixes which will be released with version 1.2.24.


What is your general impression about the Netscape connector? Is it 
working stable for you? Do you think it is worthwhile supporting it in 
the future?


Concerning your question: I think the missing connection reuse is just a 
historic oversight. Enabling it needs some testing though in order to 
ensure it runs well.


Regards,

Rainer

[EMAIL PROTECTED] wrote:

Hi,

BACKGROUND:

I have been using the tomcat connector for Netscape / SunONE web server 
from the tomcat-connectors-1.2.23-src bundle available from the main 
tomcat site. I have found that connections are not being re-used by the 
connector. i.e. the connector opens a separate connection to tomcat for 
each and every request it's configured to pass to tomcat and then closes 
that connection after receiving it's response.


When I enable debug logging for the connector I see messages telling me 
that connection re-use is disabled. I found reference to an option for 
apache to disable re-use but nothing for Netscape. Looking at the source 
code I find that all but the Netscape connector appear to have a 
s-disable_reuse = JK_FALSE; statement in the init_ws_service function 
in the connector source code file (jk_nsapi_plugin.c for Netscape). 

As a test I have added this to the Netscape connector and re-compiled and 
it now re-uses connections which is an obvious performance gain (I'm 
assuming here as I haven't benchmarked anything). The implication is that 
someone either explicitly set re-use to be disabled for Netscape, 
presumably due to problems not immediately obvious if re-use is enabled,, 
or someone changed the common code to make re-use optional but forgot to 
enable it by default in the Netscape connector. I only suggest the latter 
as there is no immediately obvious indication that it is intentionally 
disable in Netscape and the plug-in seems to work with it enabled after 
some very brief testing.


QUESTION:

Can anyone confirm or deny whether the Netscape connector should not have 
connection re-use enabled as the other connectors do. Some overview of any 
reason would also be much appreciated.


Many Thanks in advance.

Dale Roberts


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to compile from source

2007-07-07 Thread Johnny Kewl


Marcello I've never built 5.5... have only built 6.013, and they 
completely different, so I just had a look at the SVN repositories and 
I'm going to guess


It looks to me like there are 2 build scripts...
So if you point ant at the build.xml in the src base folder it will use 
a SVN client and go get all the source, why I dont know maybe coz there 
were no good SVN clients at the time.


Then if you look at what this brings back in all the source there is a 
ANOTHER build folder and in there is the another build.xml that seems to 
have everything one could want.


It looks to me that if u cd to srcroot/build
and then just
   ant download
   ant

it will create all the dependencies and compile

then try
ant dist

 if in doubt just have a look at the targets in build.xml (there are 
2) the on ein build even looks like it will make service packages...


Sorry... never built 5.5... good luck



- Original Message - 
From: Marcello Pucci [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Saturday, July 07, 2007 11:17 AM
Subject: How to compile from source


I've just completed the steps required to build apache-tomcat-5.5 from 
source,

next step should be going to install all required binary files in the
final distribution directory, e.g /opt/apache-tomcat-5.5/

How can i achieve this goal ? I won't copy all uncessary source (.java) 
files.


I can't find any dist target in build.xml file coming from svn source
repository.

Can u help me? Thank in advice.

Ciao

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to use connection pool with tomcat 1.2.9

2007-07-07 Thread Nhut Thai Le
Hi guys,
  I 'm developing a simple web app with netbeans with bundle tomcat 1.2.9. I 
want to use connection pooling fir my web app. Thus, i config as follow:
   
  Here is my server.xml:
Server port=8005 shutdown=SHUTDOWN
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/
GlobalNamingResources
Environment name=simpleValue type=java.lang.Integer value=30/
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
Service name=Catalina
Connector port=8080 maxHttpHeaderSize=8192
   maxThreads=150 minSpareThreads=25 maxSpareThreads=75
   enableLookups=false redirectPort=8443 acceptCount=100
   connectionTimeout=2 disableUploadTimeout=true /
Connector port=8009 
   enableLookups=false redirectPort=8443 protocol=AJP/1.3 
/
Engine name=Catalina defaultHost=localhost
Realm className=org.apache.catalina.realm.UserDatabaseRealm
   resourceName=UserDatabase/
Host name=localhost appBase=webapps
  unpackWARs=true autoDeploy=true
  xmlValidation=false xmlNamespaceAware=false
Context path=/Core1 docBase=Core1 debug=5 
reloadable=true crossContext=true
Resource name=jdbc/TestDB auth=Container 
type=javax.sql.DataSource
  maxActive=100 maxIdle=30 maxWait=1
  username=me password=iam 
driverClassName=com.mysql.jdbc.Driver
  
url=jdbc:mysql://localhost/mydb?autoReconnect=true/
/Context
/Host
/Engine
/Service
/Server
  
And here is my WEB-INF/web.xml

  ?xml version=1.0 encoding=UTF-8?
web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
filter
filter-nameAccessControl/filter-name
filter-classcom.core1.filter.AccessControl/filter-class
init-param
   param-nameloginPage/param-name
   param-value/WEB-INF/authentication/login.jsp/param-value
/init-param
/filter
filter-mapping
filter-nameAccessControl/filter-name
url-pattern/protected/*/url-pattern
/filter-mapping
listener
   
listener-classcom.core1.listener.ResourceManagerListener/listener-class
/listener
servlet
servlet-nameaction/servlet-name
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
param-nameconfig/param-name
param-value/WEB-INF/struts-config.xml/param-value
/init-param
init-param
param-namedebug/param-name
param-value2/param-value
/init-param
init-param
param-namedetail/param-name
param-value2/param-value
/init-param
load-on-startup2/load-on-startup
/servlet
servlet-mapping
servlet-nameaction/servlet-name
url-pattern*.do/url-pattern
/servlet-mapping
session-config
session-timeout
30
/session-timeout
/session-config
welcome-file-list
welcome-file
index.jsp
/welcome-file
/welcome-file-list
error-page
exception-typeException/exception-type
location/WEB-INF/error/error.jsp/location
/error-page
resource-ref
descriptionDB connection/description
res-ref-namejdbc/TestDB/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref
/web-app
  
I assume that by referencing the DataSource in WEB-INF/web.xml to the 
DataSource initialized in server.xml, I can access the Datasource from 
anywhere. However, in one of my Action Class(i'm using Struts framework) I have 
the following code
   
  DataSource ds = this.getDataSource(request,jdbc/TestDB);
if(ds == null)
throw new InternalException(datasource is null);
  
Supprisingly, the exception is thrown! The DataSource is null after all.Is 
there anything else i have to do? It's been 2 weeks i have stuck with this 
problem. Hope anyone can give a suggestion
   
  Thai


-
Where there's will, there's a way
 
-
We won't tell. Get more on shows you hate to love

Re: How to use connection pool with tomcat 1.2.9

2007-07-07 Thread David Smith
Tomcat 1.2.9???  I doubt that's the real version number.  Typical 
version numbers are 4.x, 5.0.x, 5.5.x, or 6.0.x.  I think Netbeans 
bundles started with 5.0.x later upgraded to 5.5.x with Netbeans 5.5.  
Could you take another look?


--David

Nhut Thai Le wrote:

Hi guys,
  I 'm developing a simple web app with netbeans with bundle tomcat 1.2.9. I 
want to use connection pooling fir my web app. Thus, i config as follow:
   
  Here is my server.xml:

Server port=8005 shutdown=SHUTDOWN
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/
GlobalNamingResources
Environment name=simpleValue type=java.lang.Integer value=30/
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

Service name=Catalina
Connector port=8080 maxHttpHeaderSize=8192
   maxThreads=150 minSpareThreads=25 maxSpareThreads=75
   enableLookups=false redirectPort=8443 acceptCount=100
   connectionTimeout=2 disableUploadTimeout=true /
Connector port=8009 
   enableLookups=false redirectPort=8443 protocol=AJP/1.3 /

Engine name=Catalina defaultHost=localhost
Realm className=org.apache.catalina.realm.UserDatabaseRealm
   resourceName=UserDatabase/
Host name=localhost appBase=webapps
  unpackWARs=true autoDeploy=true
  xmlValidation=false xmlNamespaceAware=false
Context path=/Core1 docBase=Core1 debug=5 reloadable=true 
crossContext=true
Resource name=jdbc/TestDB auth=Container 
type=javax.sql.DataSource
  maxActive=100 maxIdle=30 maxWait=1
  username=me password=iam 
driverClassName=com.mysql.jdbc.Driver
  url=jdbc:mysql://localhost/mydb?autoReconnect=true/
/Context
/Host
/Engine
/Service
/Server
  
And here is my WEB-INF/web.xml


  ?xml version=1.0 encoding=UTF-8?
web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
filter
filter-nameAccessControl/filter-name
filter-classcom.core1.filter.AccessControl/filter-class
init-param
   param-nameloginPage/param-name
   param-value/WEB-INF/authentication/login.jsp/param-value
/init-param
/filter
filter-mapping
filter-nameAccessControl/filter-name
url-pattern/protected/*/url-pattern
/filter-mapping
listener
   
listener-classcom.core1.listener.ResourceManagerListener/listener-class
/listener
servlet
servlet-nameaction/servlet-name
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
param-nameconfig/param-name
param-value/WEB-INF/struts-config.xml/param-value
/init-param
init-param
param-namedebug/param-name
param-value2/param-value
/init-param
init-param
param-namedetail/param-name
param-value2/param-value
/init-param
load-on-startup2/load-on-startup
/servlet
servlet-mapping
servlet-nameaction/servlet-name
url-pattern*.do/url-pattern
/servlet-mapping
session-config
session-timeout
30
/session-timeout
/session-config
welcome-file-list
welcome-file
index.jsp
/welcome-file
/welcome-file-list
error-page
exception-typeException/exception-type
location/WEB-INF/error/error.jsp/location
/error-page
resource-ref
descriptionDB connection/description
res-ref-namejdbc/TestDB/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref
/web-app
  
I assume that by referencing the DataSource in WEB-INF/web.xml to the DataSource initialized in server.xml, I can access the Datasource from anywhere. However, in one of my Action Class(i'm using Struts framework) I have the following code
   
  DataSource ds = this.getDataSource(request,jdbc/TestDB);

if(ds == null)
throw new InternalException(datasource is null);
  
Supprisingly, the exception is thrown! The DataSource is null after all.Is there 

Re: How to use connection pool with tomcat 1.2.9

2007-07-07 Thread Johnny Kewl


Nhut listen I think you mixing two different methods.
You using a framework that works on Tomcat, and both Struts and Tomcat have 
a way of making a dB pool

You need to choose one or the other.
TC uses JNDI... most people I think do it this way, and it will work with or 
without struts

http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html

or do it the Struts way I dont use it, so no expert, but heres an 
article

http://forum.java.sun.com/thread.jspa?threadID=5146552tstart=180

theres actually lots of other ways as well but these should work

good luck


- Original Message - 
From: Nhut Thai Le [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Saturday, July 07, 2007 4:20 PM
Subject: How to use connection pool with tomcat 1.2.9



Hi guys,
 I 'm developing a simple web app with netbeans with bundle tomcat 1.2.9. 
I want to use connection pooling fir my web app. Thus, i config as follow:


 Here is my server.xml:
Server port=8005 shutdown=SHUTDOWN
   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/

   GlobalNamingResources
   Environment name=simpleValue type=java.lang.Integer 
value=30/

   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
   Service name=Catalina
   Connector port=8080 maxHttpHeaderSize=8192
  maxThreads=150 minSpareThreads=25 
maxSpareThreads=75
  enableLookups=false redirectPort=8443 
acceptCount=100

  connectionTimeout=2 disableUploadTimeout=true /
   Connector port=8009
  enableLookups=false redirectPort=8443 
protocol=AJP/1.3 /

   Engine name=Catalina defaultHost=localhost
   Realm className=org.apache.catalina.realm.UserDatabaseRealm
  resourceName=UserDatabase/
   Host name=localhost appBase=webapps
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false
   Context path=/Core1 docBase=Core1 debug=5 
reloadable=true crossContext=true
   Resource name=jdbc/TestDB auth=Container 
type=javax.sql.DataSource

 maxActive=100 maxIdle=30 maxWait=1
 username=me password=iam 
driverClassName=com.mysql.jdbc.Driver


url=jdbc:mysql://localhost/mydb?autoReconnect=true/
   /Context
   /Host
   /Engine
   /Service
/Server

And here is my WEB-INF/web.xml

 ?xml version=1.0 encoding=UTF-8?
web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;

   filter
   filter-nameAccessControl/filter-name
   filter-classcom.core1.filter.AccessControl/filter-class
init-param
  param-nameloginPage/param-name
  param-value/WEB-INF/authentication/login.jsp/param-value
/init-param
   /filter
   filter-mapping
   filter-nameAccessControl/filter-name
   url-pattern/protected/*/url-pattern
   /filter-mapping
   listener

listener-classcom.core1.listener.ResourceManagerListener/listener-class
   /listener
   servlet
   servlet-nameaction/servlet-name

servlet-classorg.apache.struts.action.ActionServlet/servlet-class
   init-param
   param-nameconfig/param-name
   param-value/WEB-INF/struts-config.xml/param-value
   /init-param
   init-param
   param-namedebug/param-name
   param-value2/param-value
   /init-param
   init-param
   param-namedetail/param-name
   param-value2/param-value
   /init-param
   load-on-startup2/load-on-startup
   /servlet
   servlet-mapping
   servlet-nameaction/servlet-name
   url-pattern*.do/url-pattern
   /servlet-mapping
   session-config
   session-timeout
   30
   /session-timeout
   /session-config
   welcome-file-list
welcome-file
   index.jsp
   /welcome-file
   /welcome-file-list
   error-page
   exception-typeException/exception-type
   location/WEB-INF/error/error.jsp/location
   /error-page
   resource-ref
   descriptionDB connection/description
   res-ref-namejdbc/TestDB/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authContainer/res-auth
   /resource-ref
/web-app

I assume that by referencing the DataSource in WEB-INF/web.xml to the 
DataSource initialized in server.xml, I can access the 

Re: jk or jk2

2007-07-07 Thread Juha Laiho
Rasmus - Next Stay A/S wrote:
 Can anyone tell me which type of connector I should use? What exactly is
 the difference between jk and jk2?
 
 I am running IIS 6.0 and tomcat 4.12

In short, you should use JK. JK2 was intended to replace JK, but became
too complex to use, and lost developer interest as well. JK2 development
was discontinued near the end of 2004. See the last entry on this page:

http://tomcat.apache.org/connectors-doc/news/20041100.html

-- 
..Juha

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Session Tracking(URL rewriting) how to avoid session Id in URL

2007-07-07 Thread Dave
Hi, I am using JSF on JBOSS.
   
  I disabled cookies and use URL rewriting for session tracking. 
  All h:outputLink URLs have session id that are added automatically.  I like 
to the link to open in a new session. How to prevent session id on the URL?
   
  Thanks,
dave

 
-
The fish are biting.
 Get more visitors on your site using Yahoo! Search Marketing.

Re: Character encoding

2007-07-07 Thread Christopher Schultz
Lightbulb,

lightbulb432 wrote:
 Why is the URIEncoding attribute specified on the connector rather than on a
 host, for example?

Because the host doesn't handle connections... the connectors do.

 Does this mean that the number of virtual hosts that can
 listen on the same port on the same box are limited by whether they all use
 the same encodings in their URIs?

Yes, all virtual hosts listening on the same port will have to have the
same encoding. Fortunately, UTF-8 works for all languages that I know of.

 Now that I think about it, wouldn't it be
 at the context level, not even at the host level?

If you had a connector-per-context, yes, but that's no the case.

 In Tomcat 6, should the useBodyEncodingForURI be used if not needing
 compatibility with 4.1, as the documentation mentions? 

I would highly recommend following that recommendation.

 To see if I have things straight, is HttpServletRequest's
 get/setCharacterEncoding used for both the request parameters from a GET
 request AND the contents of the POST?

No. GET requests have request parameters encoded as part of the URL,
which is affected by the Connector's URIEncoding parameter. POST
requests always use the request's body encoding, which is specified in
the HTTP header (and can be overridden by using
request.setCharacterEncoding). Some broken clients don't provide the
character encoding of the request, which makes things difficult sometimes.

 How are multipart POST requests dealt with?

Typically, each part of a multipart request contains its own character
encoding, so a multipart POST would follow the encoding for the part
you're reading at the time.

 And HttpServletResponse's get/setCharacterEncoding is used for the contents
 of the response header and the meta tags?

Only for the header field, not META tags. If you want to emit META tags,
you'll have to do them yourself.

 Does it also encode the page content itself? 

Nope. If you change the character encoding for a response after the
response has already had some data written to it, I think you'll send an
incorrect header. For instance:

response.setCharacterEncoding(ISO-8859-1);
PrintWriter out = response.getOutputWriter();

response.setCharacterEncoding(Big5);

out.print(abcdef);
out.flush();

Your client will not receive a sane response. Setting the character
encoding only sets the HTTP response header and configures the
response's Writer, if used, but only /before/ calling getWriter the
first time.

 What about the encoding of cookies for both incoming requests and outgoing
 responses?

See the HTTP spec, section 4.2 (Message Headers). It references RFC
822 (ARPA Internet text messages) which does not actually specify a
character encoding. From what I can see, low ASCII is the encoding used.
You shouldn't have to worry about cookie encoding, since you can always
call request.getCookies() and get them correctly interpreted for you.

-chris



signature.asc
Description: OpenPGP digital signature


Re: Tomcat Version problem

2007-07-07 Thread Christopher Schultz
Hanasaki,

hanasaki wrote:
 When you get things working... Please post the solution to the problem
 so we can all learn.

I believe the solution was already posted by Jon Wingfield on 2007-07-05
at 06:09:

 You are using jdk1.5 features (autoboxing, for example ) in your JSP
 pages. Early versions of the 5.5 tree bundled a jsp compiler (JDT)
 which didn't support these new language features. Later versions
 bundled an updated version of the compiler...

So, the solution is to either remove your use of autoboxing, or upgrade
to a later version of Tomcat.

-chris




signature.asc
Description: OpenPGP digital signature


Problem Loading Page Connection was Reset

2007-07-07 Thread Nathan Bahr
Hi
I have a small problem with accessing a webapp hosted by my tomcat
5.5.20 server. I have in webapps/ROOT a basic
helloWorld.html file. The server starts and stops fine when running the
shell scripts (using j2se 5.0 btw) however I cannot
access helloWorld.html through the web browser. The log files offer no
indication that anything is breaking and I used
to be able to access webapps through the server. This change occured
about the time I tried to delete a directory and war file
in the webapps directory manually nstead of through the manager webapp
(which is also inaccessable now). Does anyone 
have advice on how to find where the problem might be occuring? 
Thanks
-Nathan


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to use connection pool with tomcat 1.2.9

2007-07-07 Thread Nhut Thai Le
You are definitely right, i was sleepy while posting the question. The 1.2.9 is 
the struts version. The bundles tomcat is 5.5.17. But is it the cause of my 
problem? 

David Smith [EMAIL PROTECTED] wrote: Tomcat 1.2.9???  I doubt that's the real 
version number.  Typical 
version numbers are 4.x, 5.0.x, 5.5.x, or 6.0.x.  I think Netbeans 
bundles started with 5.0.x later upgraded to 5.5.x with Netbeans 5.5.  
Could you take another look?

--David

Nhut Thai Le wrote:
 Hi guys,
   I 'm developing a simple web app with netbeans with bundle tomcat 1.2.9. I 
 want to use connection pooling fir my web app. Thus, i config as follow:

   Here is my server.xml:
 
   
 And here is my WEB-INF/web.xml

   
 
 
 AccessControl
 com.core1.filter.AccessControl
 

loginPage


/WEB-INF/authentication/login.jsp

 
 
 
 AccessControl
 /protected/*
 
 


com.core1.listener.ResourceManagerListener
 
 
 action
 org.apache.struts.action.ActionServlet
 
 
config

 
/WEB-INF/struts-config.xml

 
 
 
debug

 
2

 
 
 
detail

 
2

 
 2
 
 
 action
 *.do
 
 
 
 30
 
 
 
 
 index.jsp
 
 
 
 Exception
 /WEB-INF/error/error.jsp
 
 
 DB connection
 jdbc/TestDB
 javax.sql.DataSource
 Container
 
 
   
 I assume that by referencing the DataSource in WEB-INF/web.xml to the 
 DataSource initialized in server.xml, I can access the Datasource from 
 anywhere. However, in one of my Action Class(i'm using Struts framework) I 
 have the following code

   DataSource ds = this.getDataSource(request,jdbc/TestDB);
 if(ds == null)
 throw new InternalException(datasource is null);
   
 Supprisingly, the exception is thrown! The DataSource is null after all.Is 
 there anything else i have to do? It's been 2 weeks i have stuck with this 
 problem. Hope anyone can give a suggestion

   Thai


 -
 Where there's will, there's a way
  
 -
 We won't tell. Get more on shows you hate to love
 (and love to hate): Yahoo! TV's Guilty Pleasures list.
   


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
Where there's will, there's a way
   
-
Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase.

Re: How to use connection pool with tomcat 1.2.9

2007-07-07 Thread Nhut Thai Le
Hi Johnny,
  The method i used is exactly what instuctructed in the 
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
Except that i dont use JSTL. However, the Datasource should be available when 
application started. Is there any other suggestion?
  Thai
Johnny Kewl [EMAIL PROTECTED] wrote:
  
Nhut listen I think you mixing two different methods.
You using a framework that works on Tomcat, and both Struts and Tomcat have 
a way of making a dB pool
You need to choose one or the other.
TC uses JNDI... most people I think do it this way, and it will work with or 
without struts
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html

or do it the Struts way I dont use it, so no expert, but heres an 
article
http://forum.java.sun.com/thread.jspa?threadID=5146552tstart=180

theres actually lots of other ways as well but these should work

good luck


- Original Message - 
From: Nhut Thai Le 
To: 
Sent: Saturday, July 07, 2007 4:20 PM
Subject: How to use connection pool with tomcat 1.2.9


 Hi guys,
 I 'm developing a simple web app with netbeans with bundle tomcat 1.2.9. 
 I want to use connection pooling fir my web app. Thus, i config as follow:

 Here is my server.xml:
 
 

 
 className=org.apache.catalina.mbeans.ServerLifecycleListener /
 
 className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener /
 
 className=org.apache.catalina.storeconfig.StoreConfigLifecycleListener/
 
  value=30/
  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 /
 
 
  maxThreads=150 minSpareThreads=25 
 maxSpareThreads=75
 enableLookups=false redirectPort=8443 
 acceptCount=100
 connectionTimeout=2 disableUploadTimeout=true /
  enableLookups=false redirectPort=8443 
 protocol=AJP/1.3 /
 
  resourceName=UserDatabase/
  unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false
  reloadable=true crossContext=true
  type=javax.sql.DataSource
 maxActive=100 maxIdle=30 maxWait=1
 username=me password=iam 
 driverClassName=com.mysql.jdbc.Driver
 
 url=jdbc:mysql://localhost/mydb?autoReconnect=true/
 
 
 
 
 

 And here is my WEB-INF/web.xml

 
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
 
 AccessControl
 com.core1.filter.AccessControl
 
 
loginPage

 
/WEB-INF/authentication/login.jsp

 
 
 
 AccessControl
 /protected/*
 
 

 
 
com.core1.listener.ResourceManagerListener
 
 
 action
 
 org.apache.struts.action.ActionServlet
 
 
config

 
/WEB-INF/struts-config.xml

 
 
 
debug

 
2

 
 
 
detail

 
2

 
 2
 
 
 action
 *.do
 
 
 
 30
 
 
 
 
 index.jsp
 
 
 
 Exception
 /WEB-INF/error/error.jsp
 
 
 DB connection
 jdbc/TestDB
 javax.sql.DataSource
 Container
 
 

 I assume that by referencing the DataSource in WEB-INF/web.xml to the 
 DataSource initialized in server.xml, I can access the Datasource from 
 anywhere. However, in one of my Action Class(i'm using Struts framework) I 
 have the following code

 DataSource ds = this.getDataSource(request,jdbc/TestDB);
 if(ds == null)
 throw new InternalException(datasource is null);

 Supprisingly, the exception is thrown! The DataSource is null after all.Is 
 there anything else i have to do? It's been 2 weeks i have stuck with this 
 problem. Hope anyone can give a suggestion

 Thai


 -
 Where there's will, there's a way

 -
 We won't tell. Get more on shows you hate to love
 (and love to hate): Yahoo! TV's Guilty Pleasures list. 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
Where there's will, there's a way
 
-
We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.

Configure customized deny page for tomcat JDBCRealm authorization

2007-07-07 Thread EricKnight

Hi,

Tow users, user1 and user2, are setup for tomcat. User1 can visit page1 and
page2, but user2 can see only page2. Using the form based authentication and
authorization, how to configure the denied page? It is not the error page.
If the user types in wrong username/password, tomcat will display the error
page. But if the user types in a valid username/password but without the
permission to visit a page, tomcat will display a not-nice page for the
denied page. Does anyone know how to configure a customized denied page?

Thanks, 

Eric.


-- 
View this message in context: 
http://www.nabble.com/Configure-customized-deny-page-for-tomcat-JDBCRealm-authorization-tf4042164.html#a11483101
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Context.xml error

2007-07-07 Thread Mark Thomas
Artur Rataj wrote:
 Hello. I added a second context to Context.xml:
snip/
 and tomcat stopped to work:

Because each context.xml file can oly define a single context.

Mark

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]