tomcat + sysdeo plugin + eclipse 3.1

2005-09-28 Thread Jilles van Gurp
I'm not sure this is the right place for this question but I assume more 
tomcat users use the sysdeo plugin to launch tomcat.


The issue is that my WEB-INF/classes directory of my web application is 
not on the classpath if I launch tomcat using the sysdeo plugin. This 
used to work fine but for some reason it is broken now. I use this 
directory to load some configuration files. I have multiple web 
applications in one tomcat installation so I can't just add the 
directories to the global classpath. Of course the application works 
fine outside eclipse.


I've tried to use other plugins (e.g. the webtools tomcat launcher) but 
these all insist on copying and moving files instead of just accepting 
my working  highly tweaked tomcat configuration (without manager). 
Sysdeo is nice because you can just point it to the server.xml and it 
will launch tomcat in the debugger, which is all I want.


Any suggestions for replacing sysdeo or fixing the problem would be much 
appreciated.


Regards,

Jilles

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat + sysdeo plugin + eclipse 3.1

2005-09-28 Thread Jilles van Gurp

Jilles van Gurp wrote:
I'm not sure this is the right place for this question but I assume more 
tomcat users use the sysdeo plugin to launch tomcat.


The issue is that my WEB-INF/classes directory of my web application is 
not on the classpath if I launch tomcat using the sysdeo plugin. This 
used to work fine but for some reason it is broken now. I use this 
directory to load some configuration files. I have multiple web 
applications in one tomcat installation so I can't just add the 
directories to the global classpath. Of course the application works 
fine outside eclipse.


I've tried to use other plugins (e.g. the webtools tomcat launcher) but 
these all insist on copying and moving files instead of just accepting 
my working  highly tweaked tomcat configuration (without manager). 
Sysdeo is nice because you can just point it to the server.xml and it 
will launch tomcat in the debugger, which is all I want.


Any suggestions for replacing sysdeo or fixing the problem would be much 
appreciated.


Regards,

Jilles

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Ah figured it out! For the interested: do not add any projects to the 
tomcat classpath. Apparently this confuses things. After all if you 
properly configured tomcat already, this shouldn't be necessary anyway.


Jilles

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: What to put into JAVA_HOME on Windows xp

2005-09-28 Thread Jilles van Gurp
Could you check if relative to your jdk directory there is a 
lib\tools.jar? This is where the class files for the javac compiler are 
located and this file is not found by tomcat at the expected location.


Anyway, I recommend reinstalling the java development kit and using the 
default settings.


Jilles

Markus Hapke wrote:

HI Ramnish,

Remove bin from the JAVA_HOME. 


JAVA_HOME=C:\JDK1.4\AppServer\jdk


 I dit it, but that doesn't make it work too!
 
 I can reach the javac command from a MS-Command line, so the
 compiler is available. 
 Why Tomcat can't see it?


 Thanx , Markus


--- Ursprüngliche Nachricht ---
Von: Ramnish Kalsi [EMAIL PROTECTED]
An: Markus Hapke [EMAIL PROTECTED], tomcat-user@jakarta.apache.org
Betreff: RE: What to put into JAVA_HOME on Windows xp
Datum: Mon, 26 Sep 2005 18:19:24 +0100

Remove bin from the JAVA_HOME. 


JAVA_HOME=C:\JDK1.4\AppServer\jdk

-ramnish.
-Original Message-
From: Markus Hapke [mailto:[EMAIL PROTECTED] 
Sent: 25 September 2005 21:27

To: tomcat-user@jakarta.apache.org
Subject: What to put into JAVA_HOME on Windows xp

Hello,

I just installed tomcat 5.0.28 successfully.

Then tested the samples in
C:\TOMCAT\webapps\jsp-examples\jsp2 - they worked.

Thed tried to test a .jsp of my own- getting the error msg in the MS
Internet-Explorer:
=== BEGIN of error Msg  HTTP
Status 500 - 


type Exception report

message 


description The server encountered an internal error () that prevented it
from fulfilling this request.

exception 


org.apache.jasper.JasperException: Unable to compile class for JSP



org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandle

r.java:97)



org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:3

46)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)



org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:5

11)



org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2

95)

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 


Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the
JDK



org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(C

ompilerAdapterFactory.java:106)
org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)
org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)



org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:5

11)



org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2

95)

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)


note The full stack trace of the root cause is available in the Apache
Tomcat/5.0.28 logs.
=== END of error Msg= ==

I set the environment entry of JAVA_HOME to C:\JDK1.4\AppServer\jdk\bin

Is that correct?

OK, nobody of you could know where I have my J2EE (1.4) :
it is 'mounted' under:
C:\JDK1.4\AppServer
and i can find the javac.exe under: C:\JDK1.4\AppServer\jdk\bin

Is my entry of the JAVA_HOME correct? 


Is there another error?

Thanx in advance, Markus

--
,,

5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse für Mail, Message, More +++


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







Re: Running Perl script from tomcat ( no apache ) on windows

2005-09-28 Thread Jilles van Gurp

alebu wrote:

Hi!
How to run Perl script from tomcat ( no apache ) on windows?
It is required for AW Stats, which uses perl for generating response.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Simply use something like this in a jsp/servlet:

Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(cmd);
proc.getInputStream() // std out
proc.getErrorStream() // std err

Where cmd is a String[] with at index 0 the path to the command, the 
path to perl in your case and the rest of the array the commandline 
options param=value, --someoption, 


There's also a variant of the exec method where you can set env 
variables, I think.


This is all documented in the Java API of course. It might be that the 
default security manager settings in your appserver have a rule against 
executing native commands in which case you will need to tweak these 
settings.


Good luck,

Jilles

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: byte serving PDF with Tomcat 5.0.27

2005-09-28 Thread Jilles van Gurp
Sure, just set the content-type and stream some bytes. As far as I know 
this applies to all versions of tomcat too.


Jilles

Maceno, Shawn wrote:

Hello all,
 
I'm running Tomcat 5.0.27 on Linux, and need to know if this version of

Tomcat supports byte serving and how to determine if it's working.  If
anyone can provide any help, I'd greatly appreciate it!
 
 
Thank you,

Shawn Maceno

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Flexible way of defining application variables in text format?

2005-09-27 Thread Jilles van Gurp

NoKideen wrote:

On Tuesday 27 September 2005 15:36, Seak, Teng-Fong wrote:

My webapp needs some application string variables for
configuration.  For the moment, I hard-code them as class static
properties and compiled.  But I'd like to know if there's any method to
define such variables in a text file, something like the global.asa in
ASP where we could simply write something like this withing the
application_onstart subroutine:
application(myvar) = my value


any better idea than this one ? without modification web.xml :-D


this is example to to read
-
import lib.ConfLineSeparator;
...
...
ConfLineSeparator c = new ConfLineSeparator(/whereis/thefile/file.conf);
out.println(c.getConf(dbPwd,VALUEifMissing)); 
...

...


this is example data file /whereis/thefile/file.conf
--
#CONFig Text Mode, 
#Place many Configuration here

#Format is : property=value or property = value
#there is no SPACE, space is WASTE of String :-p
#value is value not value or 'value'
#all Chars are case sensitive
#Add # char to comment

# Db Conf
dbPwd=secret


Try this API Class file
-
package lib;
import java.io.*;
import java.util.Vector;

public class ConfLineSeparator {
String[] all;
int i=0;
String currentProp, currentVal;
Vector p;
Vector v;

public ConfLineSeparator(String file) {
all = new String[2000]; //maximum
p = new Vector();
v = new Vector();

		readFile(file);

processNow();
}
public void readFile(String file) {
debug( Reading +file);
try {
i=0;
FileInputStream fstream = new FileInputStream(file);
DataInputStream in = new DataInputStream(fstream);

while (in.available() !=0){
i++;
in.readLine();
}
in.close();

		
		all = new String[i];
		
		i=0;

fstream = new FileInputStream(file);
in = new DataInputStream(fstream);
while (in.available() !=0){
all[i++] = in.readLine();
debug( Reading Got this data +all[i-1]);
}
in.close();
		
		} catch (Exception e) {

debug( Reading Exception +e.getMessage());
}
}

public void processNow() {
// trim it
for (int z=0;z  all.length; z++) {
all[z] = all[z].trim();
}

i=0;
for (int z=0;z  all.length; z++) {
if (all[z].startsWith(#)) {

} else if (all[z].startsWith(#end)) {
return;
} else if (all[z].indexOf('=')==-1) {

} else if (all[z]==null || all[z]==) {

} else {
try {
p.add(i,new 
String(all[z].substring(0,all[z].indexOf('=')).trim()));
	v.add(i,new 
String(all[z].substring(all[z].indexOf('=')+1,all[z].length()).trim()));

} catch (Exception e) {
}
debug((i) +  = +p.get(i)+ value_is 
+v.get(i));
i++;
}

}

}

public String getConf(String prop, String IfValueNotFound) {
try {
int tmp = p.indexOf(prop);
if (tmp =0  tmpv.size())
return (String) v.get(tmp);
else
return IfValueNotFound;
} catch (Exception e) {
//e.printStackTrace();
return IfValueNotFound;
}
}

public void debug(String x) {
//System.out.println(x);
}
}

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Use commons.configuration. Works beautifully and has the advantage that 
you don't need to change your deployment descriptor or server.xml if you 
want to change the configuration. With commons-configuration you can 
also reload and write the properties, store them in xml, a database or a 
simple 

Re: Question about tomcat startup ConcurrentModificationException

2005-09-27 Thread Jilles van Gurp
The fix is to replace the mx4j jar file in the release (bin/jmx.jar) 
with the fixed version (latest 2.1.x) which has been available for a 
long time now from the mx4j project site.


You might also search this mailinglist. This must be one of the more 
frequently raised topics. I know I found the right answer here half a 
year ago or so.


I'd really appreciate a stable 5.0.x release with the fix. I've known 
about this bug for more than half a year now and I still encounter it at 
least once a week at customers. I then need to explain that it is not 
our product that is broken but tomcat and that it's a well known issue 
and it is easy to fix. Basically all our customers run into this issue.


Lets face it, 5.0.28 is basically broken because of this easy to fix 
bug. People claim it rarely occurs (and consequently that it is 
perfectly acceptable to occasionally fail to launch with an obscure 
exception). Yet, I can't launch my webapp on an unpatched tomcat 5.0.28 
unless I fix this first. Sometimes I forget on a clean install and then 
seconds later slap my forward. Just do a 5.0.28_01 with the fixed jar or 
finally move 5.0.30 to a stable release (I can't convince customers to 
install beta software) but please fix it one way or the other.


Jilles

Tim Funk wrote:
Search bugzilla.  There is a bug report about 
ConcurrentModificationException - it has to do with mx4j having a race 
condition. The bug describes a fix.


-Tim

Maurice Yarrow wrote:


Hello Tomcat people

When tomcat is restarted, it occasionally (1 in 25 times)
gets the below exception.  (tomcat 5.0.28, on Fedora Core 1)

What is the significance of this?

Thanks
Maurice


INFO: Starting Coyote HTTP/1.1 on http-8080
Sep 26, 2005 9:29:19 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8443
Sep 26, 2005 9:29:19 AM org.apache.coyote.tomcat5.MapperListener init
WARNING: Error registering contexts
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782)
at java.util.HashMap$EntryIterator.next(HashMap.java:824)
at java.util.HashMap.putAllForCreate(HashMap.java:424)
at java.util.HashMap.clone(HashMap.java:656)
at 
mx4j.server.DefaultMBeanRepository.clone(DefaultMBeanRepository.java:56)
at 
mx4j.server.MBeanServerImpl.findMBeansByPattern(MBeanServerImpl.java:160 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



tld processing performance at startup

2005-09-23 Thread Jilles van Gurp

Hi,

I have a large site running on tomcat with some tag libs. Restarting 
tomcat can take up to 30-40 seconds which is not that bad except that 
we'd prefer to minimize this time because apache can queue a lot of 
incoming requests in this 30 seconds. We need to restart often because 
we are still tinkering with the site even though it already went live. 
In general, shorter startup times would be really nice anyhow.


Some analysis of what is taking up most of this time has shown that 
tomcat is spending a lot of time (40-50%) processing all the files in 
the web application looking for tld descriptors. In this particular web 
application there a few thousand small files (e.g. xml descriptors, 
jsps, some static stuff, lots of scripts, etc). Only a small subset is 
jar files (about 20) and only about ten of the files are actually tlds, 
all conveniently located in a subdirectory of WEB-INF. The whole thing 
is deployed as an unzipped directory rather than a war file so we can 
update stuff faster (copy some jar files, stop/start). Auto reload is 
not compatible with our web app so we don't have that enabled.


This web log post: 
http://www.webweavertech.com/costin/archives/000164.html suggests that 
the reason for the poor performance may be a design flaw in the jsp spec 
which makes it necessary to do a lot of work. The ideal way would be for 
the tld descriptors to always be in the META-INF directory. However, the 
spec doesn't require this and tlds may be located anywhere in the 
webapplication. Is this analysis of the problem still correct for tomcat 
5.0.28?


On the other hand the web.xml does specify explicitly where the tlds are 
so I don't fully understand the need to look through the whole web 
application directory.


Is there a way to optimize this problem away (even partially) by e.g. 
telling tomcat explicitly what tlds to process?


Regards,

Jilles van Gurp

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Default Charset in Content-Type Header

2005-09-22 Thread Jilles van Gurp

Alpay Ozturk wrote:

Hi,

I am using Tomcat 4.1.29 in a production environment and I want   tomcat
not to add default charset in Content-Type response header.
Is it possible?

Thanks in advance.

Alpay 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  
No, it's not possible for text/* types. Tomcat will set a default 
charset if you don't set it yourself. For jsps you can change the 
default encoding by overriding it in your web.xml (see conf/web.xml for 
the defaults).


BTW I suspect you might be wanting this because you are trying to set 
the content type twice: first to text/html (tomcat will set a charset 
automatically because the servlet spec says text/html should be 
accompanied by a charset) and then to application/pdf (you end up with 
content-type: application-pdf; charset=utf-8). We ran into this issue 
before: you can't get rid of the charset once it is set and you need to 
set a content-type before you start streaming content.


The only thing you might be able to do is to filter the http header with 
apache or something. Trying to correct this from a servlet filter is 
tricky because the headers are streamed to the client before the 
content. The only way to work around this is to wrap the response and 
buffer the output, set the header in the real response and the stream 
the buffered content (tomcat will still set a default charset if the 
type is text/*).


The best solution is to simply accept that the charset needs to be set 
correctly for text/* and to do that yourself.


Jilles

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Configure multiple number of aliases / sub-domains

2005-09-22 Thread Jilles van Gurp

Assaf wrote:

Hi Tom,

Thanks again for the answer. BUT my problem is not the
hosts file. That works fine. My issue is as follows:

I have multiple hosts (as in TOMCAT HOSTS) running on
the server. Each is mapped to a different context/
application. I need to be able to map ALL subdomains
to the same application as the www. subdomain.
Currently I have in the server.xml file:

host name=domain.com
   aliaswww.domain.com/alias
   aliasxx1.domain.com/alias
   aliasxx2.domain.com/alias
/host

It is not practical to have a list of all subdomains
(which in this case are aliases) in the server.xml
file as they are dynamically created and deleted.

Looking forward,

Assaf
  
You might let apache take care of virtual hosts and simply set the host 
tag to localhost and let apache forward requests via the jkconnector. 
All requests will be handled by the default host of your application 
(localhost) and you can examine the request in a servlet to distinguish 
between the different domains.


If you need multiple applications, each with multiple hosts, simply add 
service tags with their own host tag and connector tag(s) and use a 
different jk port for each connector (or a different http port for http 
connectors).


Regards,

Jilles

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Install Tomcat 5.5 quietly?

2005-09-22 Thread Jilles van Gurp

Richard Burman wrote:

Hi all,

Just a quick question for you; how can I launch the Tomcat installer
without the installation screens popping up? Can I specify the
installation directory and settings from the command line? I tried
feeding the installer some parameters but it seems to completely ignore
the command line.

Thanks for the help!

Cheers,
Richard.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Just use the zip file instead of the installer. Unzip it wherever you 
want. You can do all the stuff the installer does (setting environment 
variables, installing a windows service and adding icons) manually or 
from a script.


At the very least you'll need to set the JAVA_HOME variable. You can use 
service.bat to install a windows service or simply use startup.bat.


Jilles

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: someone familar with this error?

2005-09-22 Thread Jilles van Gurp

Leon Rosenberg wrote:

starting tomcat:

22.09.2005 12:41:27 org.apache.coyote.tomcat5.MapperListener init
WARNUNG: Error registering contexts
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782)
at java.util.HashMap$EntryIterator.next(HashMap.java:824)
at java.util.HashMap.putAllForCreate(HashMap.java:424)
at java.util.HashMap.clone(HashMap.java:656)
at 
mx4j.server.DefaultMBeanRepository.clone(DefaultMBeanRepository.java:56)
at 
mx4j.server.MBeanServerImpl.findMBeansByPattern(MBeanServerImpl.java:1603)
at 
mx4j.server.MBeanServerImpl.queryObjectNames(MBeanServerImpl.java:1568)
at mx4j.server.MBeanServerImpl.queryMBeans(MBeanServerImpl.java:1512)
at 
org.apache.coyote.tomcat5.MapperListener.init(MapperListener.java:115)
at 
org.apache.coyote.tomcat5.CoyoteConnector.start(CoyoteConnector.java:1510)

tomcat 5.0.25, jdk1.4, winxp

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Yes, the jmx.jar shipped with tomcat 5.0.2x has a bug that has been 
fixed by the mx4j people. Later tomcat releases (5.0.31? and 5.5.9) 
include a newer version. The jar file is located in the tomcat bin 
directory and the solution is to download an updated version from


http://mx4j.sourceforge.net/

I think you need the latest 2.x version, not the 3.x version.

BTW. I'd really appreciate a stable 5.0.x release with this fix. This 
little issue has been driving me nuts since I need to fix this manually 
on all deployments of our product on tomcat 5.0.28.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat exception handling

2005-09-22 Thread Jilles van Gurp

swallowoutput=true in your context should help

Jilles

James Cowan wrote:

Hi

How do I suppress the stack trace from exception handling globally (i.e. not
using an errorPage directive)?

I have tried setting the Verbosity of the Logger elements in the server.xml
(for Tomcat 5.0.28) to 0 but this does not seem to stop stack trace.

A simple jsp like this:

%
if (true)
throw new Exception(Some exception);
%

produces this output:
exception

javax.servlet.ServletException: Some exception

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI
mpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:758)
org.apache.jsp.e_jsp._jspService(e_jsp.java:53)
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:3
24)
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 just want the HTTP 500 error displayed and no more information.

James Cowan


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problems with utf-8 encoding - continue

2005-09-19 Thread Jilles van Gurp

Why aren't you using setContentType(text/html, utf-8) on the response?

What content-type is the server actually returning (use the live http 
headers extension for firefox or something similar to find out).


What database and jdbc driver are you using? What method are you using 
to store the string in the database?


I've had utf-8 trouble with several databases. For example mysql 4.1 + 
the latest jdbc driver + setCharacterStream had some strange effects. 
First of all you need to tell mysql to use utf-8 (it defaults to 
something else) and even if you do that setCharacterStream has some 
issues that go away if you use setString. Oracle on the other hand 
cannot insert strings larger than 4KB with setString so you need to use 
setCharacterStream. Incidently, the mysql driver implementation of 
setCharacterString is implemented using setString!


Regards,

Jilles

Yair Zohar wrote:


sorry for the double mail,
I forgot to add my server.xml encoding definitions:

Connector className=org.apache.coyote.tomcat4.CoyoteConnector
  port=8080 URIEncoding=UTF-8 
useBodyEncodingForURI=true

  minProcessors=5 maxProcessors=75
  enableLookups=true redirectPort=8443
  acceptCount=100 debug=0 connectionTimeout=2
  useURIValidationHack=false 
disableUploadTimeout=true  /


I tried it with and without the useBodyEncodingForURI=truedirective.
Yair.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Help figuring out Virtual Hosts

2005-09-17 Thread Jilles van Gurp
You can use multiple hosttags in the server.xml, each with their own 
context. As described here

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/host.html

One or more Host elements are nested inside an Engine element. Inside 
the Host element, you can nest Context elements for the web applications 
associated with this virtual host. Exactly one of the Hosts associated 
with each Engine MUST have a name matching the defaultHost attribute of 
that Engine.


You give each application its own host and it should work fine. You can 
also use alias tags inside a host tag if you want an application to be 
available for multiple hosts.


Jilles



Dola Woolfe wrote:

Hi,

I've certainly RTFM'd and had thoroughly read

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/host.html#Host%20Name%20Aliases

but I just can't figure out how to get virtual servers
to work.

Basically, assume that DNS is set up properly and that
ServerA.com ServerB.com and Server.com resolve to the
same IP. Now, I want ServerA.com to go to
Server.com/MyAppA/index.jsp and ServerB.com to go to
Server.com/MyAppB/index.jsp. This, in my mind is sort
of like how Apache lets you do it, where of course it
takes advantage of the convention of index.html being
the default destination.

OK, how do I achieve this with Tomcat? Could anyone
please provide a specific example?

Many thanks,

Dola



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Order of WebApp Loading

2005-09-15 Thread Jilles van Gurp
If you define the contexts in the server.xml, they are started in the 
order that you define them, I think.


Regards,

Jilles

Peter Menzel wrote:

Hi there,

I have a question concerning Tomcats webapp loading:
What is the order in which tomcats loads its webapps ?
I have two webapps configured by /conf/Catalina/localhost/XXX.xml and 
I need one webapp to be loaded before the other, because it starts the 
database.

How does Tomcat choose the first, second, ...
And what is the loading sequence, if both are deployed as a .war ?

Kind regards, Peter Menzel


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



basic authentication problem 5.5.9

2005-09-14 Thread Jilles van Gurp
Hi I suspect I am running into this bug in tomcat 5.5.9 which has been 
solved in tomcat 5.5.11 and I was wondering if there is a workaround:


http://issues.apache.org/bugzilla/show_bug.cgi?id=22617

Let me first explain my situation. I have a webapplication which we use 
in production on multiple sites on tomcat 5.0.28. We have a major 
version upcoming in a few months and want to take the opportunity to 
move to tomcat 5.5.x (several technical reasons and not much going on on 
the 5.0 branch). We need a stable version of course (our customers don't 
like alpha stuff) and 5.5.9 appears to be it for the moment.


Yesterday when I tried our web application in 5.5.9 it mostly worked as 
far as I could see. The only thing that didn't work was that our admin 
context was no longer password protected. I spent quite some time 
rechecking the configuration (which works fine on 5.0.28). Quite 
annoyingly the server.xml has a different, semantically equivalent 
notation for defining user databases but that was easy to fix. Still no 
luck. Then I searched google and eventually came up with the bug above 
which might explain things. The simple workaround there of defining a 
null user or a  user didn't work though. To confirm I was running into 
a (solved) bug I tested on 5.5.11 and indeed authentication works fine 
there with identical configuration.


So my question is threefold:
- Is the bug above the problem I am running into or is it something else
- Is there a workaround for it in 5.5.9.  We can't support alpha 
versions on production sites so we need this fixed in the stable release.
- If the answer is no, we'll have to put off support for 5.5.x until 
there is a stable version with the fix (and hopefully no new issues): is 
there a rough time schedule when that might happen?


Regards,

Jilles

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]