java.io.UTFDataFormatException

2004-09-04 Thread Eugene
I am posting this twice again:) I found my own message about this case
in mail archive where Jacob Kjome wrote:

 Is the error happening on the loading of the XML and/or XSLT documents you are 
 loading? I used
 to use Ultraedit as my text editor, but found it sporadically added invalid 
 characters in the
 first few characters of the doc which would cause weird exceptions upon loading the 
 document.
 And I couldn't see the invalid character under Ultraedit, but could under JEdit. As 
 such,
 I now use JEdit as it always saves my files properly. Might a similar issue be 
 happening
 in your case?

 Jake

I know about these characters and that what I hope to find, but no, I know this 
document
from start to the end, I've used UltraEdit, then I've tryed EmEditor
Pro, PerlWiz etc. I didnt find nothing, it returns error just in case
if I'm trying generate big data table (result HTML about 16 Kb of
text). In other cases all works fine. Besides this XSLT worked in JBoss
3.2.3 and Tomcat 4.1.27 - since then I didnt change anything now I
want to restore this configuration, but I dont have installers. I've
tryed with Tomcat 4.1.29, 5.0.27, 5.0.28 and with different versions
of Xerces - from 2.5.2 to 2.6.0 - same result. I will try to make
completely new template - then we will see... Still hope thats my
mistake.

Sorry for a delay - I had a problems with my mail.

Thanks for reply!

-- 
Best regards,
 Eugenemailto:[EMAIL PROTECTED]


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



RE: Tomcat 5.5 In-Memory Session Replication

2004-09-04 Thread Tomcat Newbie
Thanks again, Filip. I am sending this response to document my
experience for others.

 set up machines to only access mcast and tcp traffic from certain IPs and
 certain ports.

Well, my primary concern was that I don't want _other_ hosts to join my
cluster not the other way around, so I am guessing I have to limit my
mcast invitations and tcp traffic to relevant parties only? :-)

 ok, I haven't tested replication on 5.5 yet myself, I've been to busy with
 corporate world.
 but from what I am reading, is that the replication valve is not issuing the
 transfer or session deltas. Maybe something broke...we'll have to check

Sounds about right. Logs show original and replicate session creation.
Most of the time, SessionListener will log correct original session
attribute name, but null value. However, even when it does log both name
and value, still there is no replication done.

 you do have the replication valve set up in server.xml right?

I believe so. Default setup and I saw no instructions for additional
setup anywhere for replication valve, other than the filter options.


I figured I ventured into something too bleeding edge for me (I did so
mainly because Jakarta site said that 5.5 was branched off from 5.0.27).
So I went back to 5.0.28. Then, after spending a few hours pointlessly
watching the logs for any activity other than mcast membership
registrations, to my surprise, I discovered that the session attributes
were replicating beautifully on 5.0.28, but without any logging. Yup,
with all debug= cranked up all the way to 9 or 10. Go figure! Glad it
works, though.

I also found a link for JDBC persistence manager (http://www.ingrid.org/
jajakarta/tomcat/tomcat-4.0b5/src/catalina/docs/JDBCStore-howto.html),
so I might go in that direction, since such setup would certainly
address my security concerns. Similar, but less complete documentation
is available for 5.x (http://jakarta.apache.org/tomcat/tomcat-5.0-doc/
config/manager.html). I have played with built-in MySQL replication and
so far I have no complaints about its performance for low-load servers.
I just need to make sure that it stores sessions in MySQL all the time,
not just swapped. MySQL will take care of the rest.


Regards,

Ed


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



Re: [tomcat] Removing a service from XP

2004-09-04 Thread Big Chiz
use the service.bat from the tomcat/bin dir


On Fri, 3 Sep 2004 14:11:48 -0600, Ernesto Echeverría
[EMAIL PROTECTED] wrote:
 This might not be the answer to your question, but then you can keep the
 service and just configure it not to start automatically (like, if you want
 to start tomcat from the batch files provided).
 
 José Ernesto Echeverría
 
 
 
 
 -Original Message-
 From: John Najarian [mailto:[EMAIL PROTECTED]
 Sent: Viernes, 03 de Septiembre de 2004 01:27 p.m.
 To: 'Tomcat Users List'
 Subject: [tomcat] Removing a service from XP
 
 I have a service for tomcat on XP.  Does anyone know how to remove the
 service?
 
 Thanks
 
 
 -
 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: service tomcat does not support chkconfig

2004-09-04 Thread Big Chiz
it seems that ur using jsvc and copied the tomcat5.sh from the native
folder of jsvc. anyway for chkconfig of rh, i guess it needs some
parameters in the begining of the init script in order to set it up
properly something like the ff

#!/bin/sh
#
# Startup script for the Jakarta Tomcat Java Servlets and JSP server
#
# chkconfig: - 85 15
# description: Jakarta Tomcat Java Servlets and JSP server
# processname: tomcat
# pidfile: /var/run/tomcat.pid
# config:
.. continuation of the script


not like debian where in you can just update-rc.d servicename start x
x x x x stop x x x x, something like that,

On Fri, 3 Sep 2004 09:28:02 -0400, Qi, Xlaoyan [EMAIL PROTECTED] wrote:
 I have trouble to add tomcat(tomcat-5.0.27) as a service in my RHE3.
 Script is like this:
 
 #!/bin/sh
 
 ##
 #
 #   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.
 
 ##
 #
 # Small shell script to show how to start/stop Tomcat using jsvc
 # If you want to have Tomcat running on port 80 please modify the
 server.xml
 # file:
 #
 #!-- Define a non-SSL HTTP/1.1 Connector on port 80 --
 #Connector
 className=org.apache.catalina.connector.http.HttpConnector
 #   port=80 minProcessors=5 maxProcessors=75
 #   enableLookups=true redirectPort=8443
 #   acceptCount=10 debug=0 connectionTimeout=6/
 #
 # That is for Tomcat-5.0.x (Apache Tomcat/5.0)
 #
 # Adapt the following lines to your configuration
 JAVA_HOME=/usr/java/j2sdk1.4.2_05
 CATALINA_HOME=/usr/local/jakarta-tomcat-5.0.27/build
 DAEMON_HOME=/usr/local/jakarta-tomcat-5.0.27/bin
 TOMCAT_USER=jakarta
 TMP_DIR=/var/tmp
 CATALINA_OPTS=
 CLASSPATH=\
 $JAVA_HOME/lib/tools.jar:\
 $CATALINA_HOME/bin/commons-daemon.jar:\
 $CATALINA_HOME/bin/bootstrap.jar
 
 case $1 in
   start)
 #
 # Start Tomcat
 #
 $DAEMON_HOME/jsvc-src/native/unix/jsvc \
 -user $TOMCAT_USER \
 -home $JAVA_HOME \
 -Dcatalina.home=$CATALINA_HOME \
 -Djava.io.tmpdir=$TMP_DIR \
 -outfile $CATALINA_HOME/logs/catalina.out \
 -errfile '1' \
 $CATALINA_OPTS \
 -cp $CLASSPATH \
 org.apache.catalina.startup.Bootstrap
 #
 # To get a verbose JVM
 #-verbose \
 # To get a debug of jsvc.
 #-debug \
 ;;
 
   stop)
 #
 # Stop Tomcat
 #
 PID=`cat /var/run/jsvc.pid`
 kill $PID
 ;;
 
   *)
 echo Usage tomcat.sh start/stop
 exit 1;;
 esac
 
 -Original Message-
 From: Didier McGillis [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 03, 2004 9:09 AM
 To: [EMAIL PROTECTED]
 Subject: RE: service tomcat does not support chkconfig
 
 I'm using RHE2, and Tomcat 4, so not totally your situation but I was
 able
 to create and add the startup script to chkconfig without issue.  Could
 it
 be your script?
 
 From: Qi, Xlaoyan [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: service tomcat does not support chkconfig
 Date: Fri, 3 Sep 2004 09:02:21 -0400
 
 I downloaded the tomcat-5.0.27 and it can start fine with startup.sh.
 When I tried to put tomcat.sh to /etc/init.d to add it as a service to
 start up at boot time in my RHE3, It tells me service tomcat does not
 support chkconfig. What could be the problem? Thank you very much for
 your help.
 
 
 
 Cynthia
 
 
 
 
 _
 Designer Mail isn't just fun to send, it's fun to receive. Use special
 stationery, fonts and colors.
 http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU
 =http://hotmail.com/encaHL=Market_MSNIS_Taglines 
   Start enjoying all the benefits of MSN(r) Premium right now and get
 
 
 the
 first two months FREE*.
 
 -
 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]
 


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



getting hold of the response

2004-09-04 Thread y u
Hi,
I am new to the Tomcat. Is there any way to get hold of the XHTML response Tomcat 
sends back to the client and modify it on the server ?
 
I wish to change every response and to make the change permanent in Tomcat source.
any help will be greatly appreciated.


-
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!

URLClassLoader problems

2004-09-04 Thread Chris Picton
Hi

I am trying to use the following code to load a class from a jar file
which is outside of my webapp directory.  The classes are loaded on
demand and dynamically.

...
public class JarClassLoader extends URLClassLoader {

   public JarClassLoader(File jar) throws MalformedURLException {
  super(new URL[] { jar.toURL() });
   }

   public Object instantiate(String className) throws
ClassNotFoundException, InstantiationException, IllegalAccessException {
  System.out.println(Looking for class:  + className);
  Class c = findClass(className);
  return c.newInstance();
   }
}
...
JarClassLoader loader = new JarClassLoader(new File(jarPath));
Object o = loader.instantiate(myClassName);
...


If I run the code from an app, it loads without any problems.  If I use
it within a tomcat Servlet, the 'instantiate' call throws a
java.lang.NoClassDefFoundError.

I have checked that the tomcat user can access the jar file, so it does
not seem to be a permission problem.

Does the tomcat container limit access to classes outside of its
classpath?  Is there something simple I am missing?

Regards
Chris


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



Re: getting hold of the response

2004-09-04 Thread Tim Funk
See Servlet Filters. (and HttpServletResponseWrapper)
-Tim
y u wrote:
Hi,
I am new to the Tomcat. Is there any way to get hold of the XHTML response Tomcat sends back to the client and modify it on the server ?
 
I wish to change every response and to make the change permanent in Tomcat source.
any help will be greatly appreciated.
 
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: [tomcat] Removing a service from XP

2004-09-04 Thread John Najarian
Thanks

-Original Message-
From: Big Chiz [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 04, 2004 2:37 AM
To: Tomcat Users List
Subject: Re: [tomcat] Removing a service from XP

use the service.bat from the tomcat/bin dir


On Fri, 3 Sep 2004 14:11:48 -0600, Ernesto Echeverría
[EMAIL PROTECTED] wrote:
 This might not be the answer to your question, but then you can keep the
 service and just configure it not to start automatically (like, if you
want
 to start tomcat from the batch files provided).
 
 José Ernesto Echeverría
 
 
 
 
 -Original Message-
 From: John Najarian [mailto:[EMAIL PROTECTED]
 Sent: Viernes, 03 de Septiembre de 2004 01:27 p.m.
 To: 'Tomcat Users List'
 Subject: [tomcat] Removing a service from XP
 
 I have a service for tomcat on XP.  Does anyone know how to remove the
 service?
 
 Thanks
 
 
 -
 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]




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



Re: URLClassLoader problems

2004-09-04 Thread John Gentilin
I use the URLClassloader with out problem, unless Tomcat was started 
with the -security option, then I get
security failures. I have been using 4.1.30 and earlier. Could it be a 
relative directory thing, have you tried to
open the jar in your constructor to make sure you have access to the file ??

HTH
John  G
Chris Picton wrote:
Hi
I am trying to use the following code to load a class from a jar file
which is outside of my webapp directory.  The classes are loaded on
demand and dynamically.
...
public class JarClassLoader extends URLClassLoader {
  public JarClassLoader(File jar) throws MalformedURLException {
 super(new URL[] { jar.toURL() });
  }

  public Object instantiate(String className) throws
ClassNotFoundException, InstantiationException, IllegalAccessException {
 System.out.println(Looking for class:  + className);
 Class c = findClass(className);
 return c.newInstance();
  }
}
...
JarClassLoader loader = new JarClassLoader(new File(jarPath));
Object o = loader.instantiate(myClassName);
...
If I run the code from an app, it loads without any problems.  If I use
it within a tomcat Servlet, the 'instantiate' call throws a
java.lang.NoClassDefFoundError.
I have checked that the tomcat user can access the jar file, so it does
not seem to be a permission problem.
Does the tomcat container limit access to classes outside of its
classpath?  Is there something simple I am missing?
Regards
Chris
-
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]


Where can I get JK2 binary for Redhat Enterprise Linux?

2004-09-04 Thread nyhgan
Hi, 
 
Where can I get JK2 binary for Redhat Enterprise Linux? If anyone happens to have one, 
pleas email that to me. Thanks!
 
nyhgan


-
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

RE: Tomcat 5 service on windows

2004-09-04 Thread John Najarian
But Tomcat isn't listed as an installed program
on 2K or XP and I imagine on any other winbloze
platform.

I had a similar problem and running:
Tomcat/bin/service.bat remove did the trick.

Check if Tomcat5.28 runs with your jdk.  I read
you're using jdk1.4.1_05.  Check that you might
need a newer version of the jdk.

-Original Message-
From: Big Chiz [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 03, 2004 8:59 PM
To: Tomcat Users List
Subject: Re: Tomcat 5 service on windows

anyway, try uninstalling all tomcat on the ad/remove programs. then
clean all registries of any tomcat, by searching them in find in
regedit. then checkout your j2sdk path if its correct, then try
reinstalling.


On Fri, 3 Sep 2004 17:39:19 +0100, Nelson, Jerry W, Contractor 146CF,
SCB [EMAIL PROTECTED] wrote:
 Yes...
 
 //SIGNED//
 
 Jerry Nelson
 
 
 
 
 -Original Message-
 From: Allistair Crossley [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 03, 2004 9:20 AM
 To: Tomcat Users List
 Subject: RE: Tomcat 5 service on windows
 
 did you try my suggestion re: service remove and then service install?
 
 ADC
 
  -Original Message-
  From: Nelson, Jerry W, Contractor 146CF, SCB
  [mailto:[EMAIL PROTECTED]
  Sent: 03 September 2004 17:12
  To: 'Tomcat Users List'
  Subject: RE: Tomcat 5 service on windows
 
 
  Yes, ran service.bat completely unmodified.  I still have to
  run startup.bat
  to get tomcat to work.
 
  //SIGNED//
 
  Jerry Nelson
 
 
  -Original Message-
  From: Allistair Crossley [mailto:[EMAIL PROTECTED]
  Sent: Friday, September 03, 2004 8:31 AM
  To: Tomcat Users List
  Subject: RE: Tomcat 5 service on windows
 
 
  also, you may try removal anyway and reinstall ...
 
  service.bat remove
 
  and then
 
  service.bat install
 
  if you checked the box on the install then maybe it _did_ do
  something that
  needs to be removed first (wild stab in the dark!)
 
  :p
 
  ADC
 
   -Original Message-
   From: Allistair Crossley
   Sent: 03 September 2004 16:28
   To: Tomcat Users List
   Subject: RE: Tomcat 5 service on windows
  
  
   did you run the service.bat unmodified? this can also happen
   when you have spaces in some of the properties for the service name.
  
   ADC
  
-Original Message-
From: Nelson, Jerry W, Contractor 146CF, SCB
[mailto:[EMAIL PROTECTED]
Sent: 03 September 2004 16:25
To: 'Tomcat Users List'
Subject: RE: Tomcat 5 service on windows
   
   
I HAVE THE SAME PROBLEM...In my case, I am the computer
administrator and
Tomcat has NEVER been installed previous to this. I have not
seen ANY good
solutions to this, so I learned to live with the DOS
  based service.
   
//SIGNED//
   
Jerry Nelson
   
-Original Message-
From: John Villar [mailto:[EMAIL PROTECTED]
Sent: Friday, September 03, 2004 6:27 AM
To: Tomcat Users List
Subject: Re: Tomcat 5 service on windows
   
   
Do you have permission to write on the registry? you need to
have write
access to some key (don't remember specifically what is the
   key right
now) in the registry to install tomcat as a service.
   
Allistair Crossley escribió:
   
did you have a tomcat service installed already? did you
have the services
window open when you ran this? try checking there are no
tomcat services and
closing the services window and trying again.

ADC



-Original Message-
From: Andras Balogh [mailto:[EMAIL PROTECTED]
Sent: 03 September 2004 11:28
To: [EMAIL PROTECTED]
Subject: Tomcat 5 service on windows


Hello all,

I have downloaded the Tomcat 5.0.28. distibution
  for windows
(jakarta-tomcat-5.0.28.exe) and tried
to install tomcat as service and checked the service
   option in the
install wizard.
Tomcat wasn't installed as service and i tried manual with the
service.bat script:
Here is the output i get:
D:\Tomcat 5.0\binservice install
Installing the service 'Tomcat5' ...
Using CATALINA_HOME:D:\Tomcat 5.0
Using JAVA_HOME:D:\j2sdk1.4.1_05
[2004-09-03 12:09:45] [349  prunsrv.c] [error]
The system cannot find the file specified.
[2004-09-03 12:09:45] [1037 prunsrv.c] [error]
Load configuration failed
[2004-09-03 12:09:45] [349  prunsrv.c] [error]
The system cannot find the file specified.
[2004-09-03 12:09:45] [1037 prunsrv.c] [error]
Load configuration failed
The service 'Tomcat5' has been installed.

The service is still  not added, i think because of the
error i have.
As a note i have on the server an older Tomcat 4.1.27
but is not
running and i modified CATALINA_HOME to point
to the new tomcat (D:\Tomcat 5.0).

What could be wrong?

Thank you,
Andras.



-
To unsubscribe, e-mail:
 

Error building jk2: Do not use --with-apxs2 but --with-apxs

2004-09-04 Thread nyhgan
 
I am trying to build the jk2 by myself, and I keep getting the error Do not use 
--with-apxs2 but --with-apxs.  Does it means that it couldn't recognized that I am 
using Apache2?  
 
I am using Apache2 and tomcat5.0.28.
 
 
The command I ran:

 
./configure --with-apxs2=/usr/sbin/apxs   --with-apr-lib=/usr/lib
--with-tomcat-41=/usr/local/tomcat--with-java-home=/usr/java/j2sdk1.4.2_04
--with-jni --with-pcre --with-apr --with-apr-util

 
 
---
checking for mkdir... /bin/mkdir
no apxs given
need to check for Perl first, apxs depends on it...
checking for perl... /usr/bin/perl
configure: error: Do not use --with-apxs2 but --with-apxs
-
 
 
 
 


-
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!

RE: [tomcat] Newbie question about getting first servlet working in tomcat on iseries v5r2

2004-09-04 Thread Ernesto Echeverría
To me this sounds like a directory misplacement.

Can you elaborate on:

What directories have you placed your files into?
Are you using the ROOT webapp?
Have you tried the tomcat sample applications? 
If you type the html file name into the url does your app work?

Other tip I could give you now has to do with working the simple
configurations first and then climbing on the complexity ladder.
For example why don't you try your webapp in the tomcat instance directly
and later worrying about configuring mod_jk passthru.

Regards.

José Ernesto Echeverría
[EMAIL PROTECTED]

 

-Original Message-
From: Ralph A. Borriello [mailto:[EMAIL PROTECTED] 
Sent: Viernes, 03 de Septiembre de 2004 11:50 p.m.
To: [EMAIL PROTECTED]
Subject: [tomcat] Newbie question about getting first servlet working in
tomcat on iseries v5r2

Hello all,  

I work on an as/400 (iseries) version v5r2. I have setup a apache/tomcat
server instance under the ibm http server and am trying to get a simple
helloservlet servlet to work properly. The server instance is referencing
version 1.3 of the jdk. I have compiled the java using jedit and jcompile
plugin on windows and copied and pasted the html and class files to the
iseries via a mapped drive  

The sample is a html file and a class file. It is a simple form where the
servlet just mirrors back the name that was typed on the form. When I enter
the name, I get a page cannot be found error. The url is modified to look
like this: http://10.126.2.2:8082/HelloServlet?user_name=asdasdf (as I typed
asdasdf).

I have included the source for the html, the java program, and the server
logs. In them it does say that it cant find the servlet called HelloServlet,
but it is there. Do I have to package the files in a .war file ?? I have
scoured the documenation that I could find on the iseries and the tomcat
sites and have tried many things but cant get it working. Any help would be
greatly appreciated. 
Thanks for taking the time to read this :) 

If this is the wrong forum for this type of question or if there is a better
one, please let me know. 

All the object authorites give full access to *public and the user that the
server is running under. 

The httpd.conf file: 


# Apache Default server configuration
LoadModule jk_module /QSYS.LIB/QHTTPSVR.LIB/QZTCJK.SRVPGM

# General setup directives
HotBackup Off
CgiConvMode %%MIXED/MIXED%%
TimeOut 3
KeepAlive Off
DocumentRoot /www/apachedft/htdocs
AddLanguage en .en

# Deny most requests for any file
JkWorkersFile /www/apachedft/conf/workers.properties
JkLogFile /www/apachedft/logs/jk.log
JkLogLevel Error
JkMount /calc mytomcat
ServerUserID QTMHHTTP
DirectoryIndex index.html
Directory /
  order allow,deny
  deny from all
  Options -Indexes -ExecCGI -includes
  AllowOverride Limit Options
/Directory

# Allow requests for files in document root Directory
/www/apachedft/htdocs
  order allow,deny
  allow from all
/Directory
Listen *:8082
LogLength 10485760
LogLevel Debug
AccessFileName .htaccess






The html file:


htmlbody
form method=GET action=HelloServlet 
Please enter your name: 
input type=text name=user_name 
input type=submit value=OK
/form
/body/html






the java program: 

/**
 * This program is an example from the book Internet
 * programming with Java by Svetlin Nakov. It is freeware. 
 * For more information: http://www.nakov.com/books/inetjava/
 */
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*; 
 
public class HelloServlet extends HttpServlet { 
public void doGet (HttpServletRequest aRequest, 
HttpServletResponse aResponse) 
throws ServletException, IOException { 
aResponse.setContentType(text/html); 
ServletOutputStream out = aResponse.getOutputStream(); 
String userName = aRequest.getParameter(user_name); 
out.println(html); 
out.println(head); 
out.println(\ttitleHello Servlet/title); 
out.println(/head); 
out.println(body); 
out.println(\th1Hello,  + userName + /h1); 
out.println(/body/html); 
}
}





Portion of the web.xml file: 


servlet  
   servlet-name  
  servlet1 
   /servlet-name 
   servlet-class 
  HelloServlet 
   /servlet-class
   load-on-startup   
  3
   /load-on-startup  
   /servlet-name
   servlet-class
  HelloServlet
   /servlet-class   
   load-on-startup  
  3   
   /load-on-startup 
/servlet
servlet-mapping 
   servlet-name 
  servlet1
   /servlet-name
   url-pattern  
  /*  
   /url-pattern 
servlet-mapping  
   servlet-name  
  servlet1 
   /servlet-name 
   url-pattern   
  /*   
   /url-pattern  
/servlet-mapping 
 /web-app





the error_log 

Re: Error building jk2: Do not use --with-apxs2 but --with-apxs

2004-09-04 Thread Olivier Jolly
nyhgan wrote:
I am trying to build the jk2 by myself, and I keep getting the error Do not use --with-apxs2 but --with-apxs.  Does it means that it couldn't recognized that I am using Apache2?  

 

From memory, the version of apxs isn't related to the one of apache. It 
should be fine configuring with --with-apxs and using apache2

I am using Apache2 and tomcat5.0.28.
The command I ran:

./configure --with-apxs2=/usr/sbin/apxs   --with-apr-lib=/usr/lib--with-tomcat-41=/usr/local/tomcat--with-java-home=/usr/java/j2sdk1.4.2_04--with-jni --with-pcre --with-apr --with-apr-util
 


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


RE: Tomcat 5.5 In-Memory Session Replication

2004-09-04 Thread Filip Hanik \(lists\)
did you try replication with 5.0.27?
if that works for you, then for sure something broke.
5.5 is still in dev mode, so you can't bank on everything working quit yet
:)

Filip

-Original Message-
From: Tomcat Newbie [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 04, 2004 4:51 AM
To: Tomcat Users List
Subject: RE: Tomcat 5.5 In-Memory Session Replication


Thanks again, Filip. I am sending this response to document my
experience for others.

 set up machines to only access mcast and tcp traffic from certain IPs and
 certain ports.

Well, my primary concern was that I don't want _other_ hosts to join my
cluster not the other way around, so I am guessing I have to limit my
mcast invitations and tcp traffic to relevant parties only? :-)

 ok, I haven't tested replication on 5.5 yet myself, I've been to busy with
 corporate world.
 but from what I am reading, is that the replication valve is not issuing
the
 transfer or session deltas. Maybe something broke...we'll have to check

Sounds about right. Logs show original and replicate session creation.
Most of the time, SessionListener will log correct original session
attribute name, but null value. However, even when it does log both name
and value, still there is no replication done.

 you do have the replication valve set up in server.xml right?

I believe so. Default setup and I saw no instructions for additional
setup anywhere for replication valve, other than the filter options.


I figured I ventured into something too bleeding edge for me (I did so
mainly because Jakarta site said that 5.5 was branched off from 5.0.27).
So I went back to 5.0.28. Then, after spending a few hours pointlessly
watching the logs for any activity other than mcast membership
registrations, to my surprise, I discovered that the session attributes
were replicating beautifully on 5.0.28, but without any logging. Yup,
with all debug= cranked up all the way to 9 or 10. Go figure! Glad it
works, though.

I also found a link for JDBC persistence manager (http://www.ingrid.org/
jajakarta/tomcat/tomcat-4.0b5/src/catalina/docs/JDBCStore-howto.html),
so I might go in that direction, since such setup would certainly
address my security concerns. Similar, but less complete documentation
is available for 5.x (http://jakarta.apache.org/tomcat/tomcat-5.0-doc/
config/manager.html). I have played with built-in MySQL replication and
so far I have no complaints about its performance for low-load servers.
I just need to make sure that it stores sessions in MySQL all the time,
not just swapped. MySQL will take care of the rest.


Regards,

Ed


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.740 / Virus Database: 494 - Release Date: 8/16/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.740 / Virus Database: 494 - Release Date: 8/16/2004


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



Re: Error building jk2: Do not use --with-apxs2 but --with-apxs (solved)

2004-09-04 Thread nyhgan
 
I fixed the problem now. The problem was because the path to the apxs I used was from 
apache13.  
 
ie, it works after I changed
 
 --with-apxs2=/usr/sbin/apxs 
 
to 
 --with-apxs2=/usr/local/apache2/bin/apxs 
 


Olivier Jolly [EMAIL PROTECTED] wrote:nyhgan wrote:

 
I am trying to build the jk2 by myself, and I keep getting the error Do not use 
--with-apxs2 but --with-apxs. Does it means that it couldn't recognized that I am 
using Apache2? 
 
 

From memory, the version of apxs isn't related to the one of apache. It 
should be fine configuring with --with-apxs and using apache2

I am using Apache2 and tomcat5.0.28.
 
 
The command I ran:

 
./configure --with-apxs2=/usr/sbin/apxs --with-apr-lib=/usr/lib 
--with-tomcat-41=/usr/local/tomcat --with-java-home=/usr/java/j2sdk1.4.2_04 
--with-jni --with-pcre --with-apr --with-apr-util
 



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




-
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

RE: Tomcat 5.5 In-Memory Session Replication

2004-09-04 Thread Filip Hanik \(lists\)
Well, my primary concern was that I don't want _other_ hosts to join my
cluster not the other way around, so I am guessing I have to limit my
mcast invitations and tcp traffic to relevant parties only?

that is exactly the point I was trying to make. Setup your security in the
OS that way you get more performance out of tomcat.
If you allow mcast traffic from other hosts into your machine, you are
already taking up resources.

Filip


-Original Message-
From: Filip Hanik (lists) [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 04, 2004 2:22 PM
To: Tomcat Users List
Subject: RE: Tomcat 5.5 In-Memory Session Replication


did you try replication with 5.0.27?
if that works for you, then for sure something broke.
5.5 is still in dev mode, so you can't bank on everything working quit yet
:)

Filip

-Original Message-
From: Tomcat Newbie [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 04, 2004 4:51 AM
To: Tomcat Users List
Subject: RE: Tomcat 5.5 In-Memory Session Replication


Thanks again, Filip. I am sending this response to document my
experience for others.

 set up machines to only access mcast and tcp traffic from certain IPs and
 certain ports.

Well, my primary concern was that I don't want _other_ hosts to join my
cluster not the other way around, so I am guessing I have to limit my
mcast invitations and tcp traffic to relevant parties only? :-)

 ok, I haven't tested replication on 5.5 yet myself, I've been to busy with
 corporate world.
 but from what I am reading, is that the replication valve is not issuing
the
 transfer or session deltas. Maybe something broke...we'll have to check

Sounds about right. Logs show original and replicate session creation.
Most of the time, SessionListener will log correct original session
attribute name, but null value. However, even when it does log both name
and value, still there is no replication done.

 you do have the replication valve set up in server.xml right?

I believe so. Default setup and I saw no instructions for additional
setup anywhere for replication valve, other than the filter options.


I figured I ventured into something too bleeding edge for me (I did so
mainly because Jakarta site said that 5.5 was branched off from 5.0.27).
So I went back to 5.0.28. Then, after spending a few hours pointlessly
watching the logs for any activity other than mcast membership
registrations, to my surprise, I discovered that the session attributes
were replicating beautifully on 5.0.28, but without any logging. Yup,
with all debug= cranked up all the way to 9 or 10. Go figure! Glad it
works, though.

I also found a link for JDBC persistence manager (http://www.ingrid.org/
jajakarta/tomcat/tomcat-4.0b5/src/catalina/docs/JDBCStore-howto.html),
so I might go in that direction, since such setup would certainly
address my security concerns. Similar, but less complete documentation
is available for 5.x (http://jakarta.apache.org/tomcat/tomcat-5.0-doc/
config/manager.html). I have played with built-in MySQL replication and
so far I have no complaints about its performance for low-load servers.
I just need to make sure that it stores sessions in MySQL all the time,
not just swapped. MySQL will take care of the rest.


Regards,

Ed


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.740 / Virus Database: 494 - Release Date: 8/16/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.740 / Virus Database: 494 - Release Date: 8/16/2004


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.740 / Virus Database: 494 - Release Date: 8/16/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.740 / Virus Database: 494 - Release Date: 8/16/2004


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



jk2.socket errors! channelUn.connect() connect failed 2

2004-09-04 Thread nyhgan
Hi,
 
Why do I get these errors?   I look at the 'work' directory under tomcat and I didn't 
see the jk2.socket file.  Which process is responsible for generating that file?  I am 
running tomcat as root user, and there is no reaso it couldn't write to that folder.
 
Below you will find the error messages and also the jk2.properties and 
workers2.properties in my enviroment. 
 
 
My system:

 
Tomcat5.0.28 
Apache2.0.50  (build from source)
Mod_jk2  (JK2 2.0.4 Source Release tar.gz,  built from source)
Redhat Linux 7.2 
 
 
 
 
 
 
Apache2's error log

 
 
[Fri Sep 03 19:31:48 2004] [notice] Digest: generating secret for digest 
authentication ...
[Fri Sep 03 19:31:48 2004] [notice] Digest: done
[Fri Sep 03 19:31:49 2004] [notice] Apache/2.0.50 (Unix) DAV/2 mod_jk2/2.0.4 
configured -- resuming normal operations
[Fri Sep 03 19:32:21 2004] [error] channelUn.connect() connect failed 2 No such file 
or directory
[Fri Sep 03 19:32:21 2004] [error] ajp13.connect() failed 
ajp13:/usr/local/tomcat/work/jk2.socket
[Fri Sep 03 19:32:21 2004] [error] ajp13.service() failed to connect endpoint errno=2 
No such file or directory
[Fri Sep 03 19:32:21 2004] [error] ajp13.service() Error  forwarding 
ajp13:/usr/local/tomcat/work/jk2.socket 1 1
[Fri Sep 03 19:32:21 2004] [error] lb.service() worker failed 12 for 
ajp13:/usr/local/tomcat/work/jk2.socket
[Fri Sep 03 19:32:21 2004] [error] lb_worker.service() all workers in error or 
disabled state
[Fri Sep 03 19:32:21 2004] [error] mod_jk2.handler() Error connecting to tomcat 
12, status 503
[Fri Sep 03 19:32:25 2004] [error] channelUn.connect() connect failed 2 No such file 
or directory
[Fri Sep 03 19:32:25 2004] [error] ajp13.connect() failed 
ajp13:/usr/local/tomcat/work/jk2.socket
[Fri Sep 03 19:32:25 2004] [error] ajp13.service() failed to connect endpoint errno=2 
No such file or directory
[Fri Sep 03 19:32:25 2004] [error] ajp13.service() Error  forwarding 
ajp13:/usr/local/tomcat/work/jk2.socket 1 1
[Fri Sep 03 19:32:25 2004] [error] lb.service() worker failed 12 for 
ajp13:/usr/local/tomcat/work/jk2.socket
[Fri Sep 03 19:32:25 2004] [error] lb_worker.service() all workers in error or 
disabled state
[Fri Sep 03 19:32:25 2004] [error] mod_jk2.handler() Error connecting to tomcat 
12, status 503
 
 
 
 
 
Jk2.properties
--
 
# jk2.properties
# Configured for channel UNIX
# Set the desired handler list
handler.list=apr,request,channelUnix
# UNIX Domain socket location
channelUnix.file=/usr/local/tomcat/work/jk2.socket
# Dynamic Library
serverRoot=/etc/httpd
apr.NativeSo=/etc/httpd/modules/jkjni.so

 
 
workers2.properties
---
 
 
# workers2.properties
# Shared memory handling. Needs to be set.
[shm]
info=Scoreboard. Required for reconfiguration and status with multiprocess servers
file=/usr/local/tomcat/logs/jk2.shm
size=1048576
debug=0
disabled=0
# UNIX domain socket
[channel.un:/usr/local/tomcat/work/jk2.socket]
tomcatId=localhost:8009
debug=0
# define the worker
[ajp13:/usr/local/tomcat/work/jk2.socket]
channel=channel.un:/usr/local/tomcat/work/jk2.socket
#[channel.socket:localhost:8009]
#info=Ajp13 forwarding over socket
#tomcatId=localhost:8009
# Announce a status worker
[status:status]
info=Status worker. Displays runtime information.
[uri:/jkstatus/*]
group=status:status
# Uri mapping
[uri:/jsp-examples/*]
 
 
 
and in my httpd.conf, I have
-
 
LoadModule jk2_module modules/mod_jk2.so
JkSet config.file /etc/httpd/conf/workers2.properties

 
 
 
 
 
 

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Configuration Assistance Request - Apache 2.0.5 - Tomcat 4.1.3 - Tomcat 4.1.3 Connector - JK2

2004-09-04 Thread Cary Conover
Hello Folks,
 
It has been a long week.  I finally got the Apache 2.0.50 to compile on AIX 5.2.  I 
had to use gcc to get it done.  Too many issues with C for AIX 6.
 
Have moved on.  Got Jakarta 4.1.3 installed from fresh copy that I got from the 
jakarta site.  I also used the Jakarta 4.1.3 connectors to compile the mod_jk.so.
 
I have gotten Tomcat to start on 8080 and 49080 and change control for ajp13 from 8009 
to 49009.  No problems getting the Tomcat working as long as I worked in the 
CATALINA_HOME.  Ever since I started making the CATALINA_BASE the configuration has 
been amiss.
 
Have found some notes on the internet yet it is very vague.
 
Have 
http://starbase:49080 working.
http://starbase:49080/examples works and all subdirectories
http://starbase:49080/tomcat-docs works as well.
 
http://starbase/jkstatus is working as well.
 
Here is the out from it.
 
ajp13 runtime info
ajp13 information, using getAttribute() 
id name lb_factor lb_value debug channel level route routeRedirect errorState graceful 
groups disabled epCount errorTime connectTimeout replyTimeout prepostTimeout 
0 localhost:49009 1 1 0 channel.socket:localhost:49009 0 localhost:49009 null 0 0  0 0 
0 0 0 0 
channel.socket runtime info
channel.socket information, using getAttribute() 
id name host port keepalive timeout nodelay graceful debug disabled 
0 localhost:49009 127.0.0.1 8009 0 0 0 0 0 0 
uri runtime info
uri information, using getAttribute() 
id name host uri group context inheritGlobals match_type servlet timing aliases path 
0   null null null 1 host null 0 null null 
0 /jkstatus/* * /jkstatus/* status:status / 1 prefix null 0 null /jkstatus/* 
0 /examples/* * /examples/* ajp13:localhost:49009 / 1 prefix null 0 null /examples/* 
0 /tomcat-docs/* * /tomcat-docs/* ajp13:localhost:49009 / 1 prefix null 0 null 
/tomcat-docs/* 
0 /servlet/* * /servlet/* ajp13:localhost:49009 / 1 prefix null 0 null /servlet/* 
0 * * null null null 1 host null 0 null null 
0 */ * / lb:lb / 1 context null 0 null / 
 
Here is the workers2.properties:
 
# only at beginnin. In production uncomment it out
[logger.apache2]
level=DEBUG
[shm]
info=Scoreboard.  Required for reconfiguration and status with multiprocess servers
file=/usr/local/apache2/logs/jk2.shm
size=1048576
debug=0
disabled=0
#UNIX domain socket
#[channel.un:/usr/local/tomcat413/803/work/jk2.socket]
#tomcatId=localhost:49009
#debug=0
# Example socket channel, override port and host.
[channel.socket:localhost:49009]
port=49009
host=127.0.0.1
# define the worker
[ajp13:localhost:49009]
channel=channel.socket:localhost:49009
# Announce a status worker
[status:status]
info=Status worker.  Displays runtime information.
[uri:/jkstatus/*]
info=Display status information and checks the config file for changes.
group=status:status
# Uri mapping
[uri:/examples/*]
Info=map the entire examples webapp
group=ajp13:localhost:49009
[uri:/tomcat-docs/*]
group=ajp13:localhost:49009
[uri:/servlet/*]
group=ajp13:localhost:49009
Here is the jk2.properties:
 
## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT IS STOPED
## WHEN YOU EDIT THE FILE.
## COMMENTS WILL BE _LOST_
## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.
# Set the desired handler list
# handler.list=apr,request,channelJni
#
# Override the default port for the socketChannel
# channelSocket.port=8019
# Default: 
# channelUnix.file=${jkHome}/work/jk2.socket
# Just to check if the the config  is working
# shm.file=${jkHome}/work/jk2.shm
# In order to enable jni use any channelJni directive
# channelJni.disabled = 0
# And one of the following directives:
# apr.jniModeSo=/opt/apache2/modules/mod_jk2.so
# If set to inprocess the mod_jk2 will Register natives itself
# This will enable the starting of the Tomcat from mod_jk2
# apr.jniModeSo=inprocess
handler.list=channelSocket,request
channelSocket.port=49009
channelSocket.address=127.0.0.1
request.tomcatAuthentication=false
# jk2.properties
# Configured for channel UNIX
# Set the desired handler list
#handler.list=apr,request,channelUnix
# UNIX Domain socket location
#channelUnix.file=/usr/local/tomcat413/803/work/jk2.socket
# Dynamic library
#serverRoot=/law/web
#apr.NativeSo=/usr/local/apache2/modules/jkjni.so
 
Looking for ideas and suggestions.  Will send log selections if it would help.
 
Cary


-
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!

how to write an output filter for tomcat

2004-09-04 Thread y u
Hello,
I wish to write an output filter for Tomcat and make the changes permanent in tomcat 
source. How can I get hold of the text output Tomcat sends back to the client?


-
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.

Re: Where can I get JK2 binary for Redhat Enterprise Linux?

2004-09-04 Thread Cott Lang
Why not just use Redhat's? 

http://ftp.redhat.com/pub/redhat/linux/enterprise/3/en/RHAPS/i386/RPMS/mod_jk2-2.0.4-4jpp_4rh.i386.rpm


On Sat, 2004-09-04 at 11:04, nyhgan wrote:
 Hi, 
  
 Where can I get JK2 binary for Redhat Enterprise Linux? If anyone happens to have 
 one, pleas email that to me. Thanks!
  
 nyhgan
 
   
 -
 Do you Yahoo!?
 Yahoo! Mail Address AutoComplete - You start. We finish.


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



RE: Tomcat 5.5 In-Memory Session Replication

2004-09-04 Thread Tomcat Newbie
 that is exactly the point I was trying to make. Setup your security in the
 OS that way you get more performance out of tomcat.
 If you allow mcast traffic from other hosts into your machine, you are
 already taking up resources.

Oh, I get it now. :-)


Ed


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