RE: servlet help

2005-01-14 Thread Cox, Charlie
You need to tell Apache about your user directories.

Try this location to send anything starting with ~ to tomcat.


JkUriSet worker ajp13:localhost:8009


Charlie

> -Original Message-
> From: Casas, Claudia [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 13, 2005 11:42 AM
> To: Tomcat Users List
> Subject: RE: servlet help
> 
> I am using jk2, apache2, and tomcat5.5
> 
> -Original Message-
> From: Edmon Begoli [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 12, 2005 6:42 PM
> To: Tomcat Users List
> Subject: Re: servlet help
> 
> Claudia,
> 
> Are you using mod_jk with Apache and Tomcat?
> You should be able to configure in Apache's httpd.conf
> to forward particular url patterns to your Tomcat(s') worker(s).
> 
> Something like:
> 
> JkMount /yourapp/* yourworker
> 
> More details are in mod_jk documentation. I do not think that there is
a
> way
> to forward only servlet calls, as you can not be sure from the URL.
> Usually,
> your URL/URI will have some servlet app. specific context which will
> help
> you.
> 
> Regards,
> Edmon
> Software Architecture to the Rescue
> 
> - Original Message -
> From: "Casas, Claudia" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" 
> Sent: Wednesday, January 12, 2005 3:16 PM
> Subject: RE: servlet help
> 
> 
> Oki doki,
> I got my servlets to work from tomcat using port 8080
> (http://myserver:8080/~myacct/servlet/myservlet), but I still do not
> know how to make apache recognize my servlets and send them to tomcat.
I
> want to access (http://myserver/~myacct/servlet/myservlet)
> 
> I tried to add these lines to httpd.conf
> 
> JkUriSet worker ajp13:localhost:8009
> 
> 
> and also added these lines to workers2.properties
> 
> [uri:spark.iss.utep.edu/servlet/*]
> group=ajp13:localhost:8009
> 
> but still no luck! :( please help.
> 
> For reference I used the following taken from the web site:
> http://www.jolash.com/tomcat/
> 
> Configure the tomcat "web.xml" file in your tomcat's "conf" directory.
> You only need to do this if you are going to write servlets. After
doing
> this, you can put all your servlets into the subdirectory
> "WEB-INF/classes" of your webapp directory. And you can access those
> servlets with a URL like:
>  Uncomment the servlet element tags with the servlet-name of invoker
> (just search for invoker).
> 
> invoker
> 
>   org.apache.catalina.servlets.InvokerServlet
> 
> 
> debug
> 0
> 
> 2
> 
> 
> Uncomment the servlet-mapping element tags with the servlet-name of
> invoker.
> 
> 
> invoker
> /servlet/*
> 
> 
> 
> -Original Message-
> From: Casas, Claudia [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 12, 2005 11:56 AM
> To: tomcat-user@jakarta.apache.org
> Subject: servlet help
> 
> 
> I am running tomcat5.5.4, apache2.0.52 and jk2.
> 1)I an run my jsp's and servlets from root. I have configured tomcat
to
> run my jsp's from the homedirs, but I do not know how to configure
> tomcat to run servlets from the homedirs.
> 
> I can run my jsp's like this: http://myserver/~myhomedir/myfile.jsp or
> http://myserver:8080/~myhomedir/myfile.jsp
> Either way it works fine.
> What do I need to add so that my servlets run from my homedirs as
well??
> 
> These are my configuration files:
> 
> /usr/local/apache/workers2.properties
> 
> info=Ajp13 forwarding over socket
> tomcatId=localhost:8009
> 
> 
> #define the worker
> [ajp13:localhost:8009]
> channel=channel.socket:localhost:8009
> `
> # Map the Tomcat examples webapp to the Web server uri space
> #[uri:/jkstatus/*]
> #group=status:status
> 
> 
> 
> 
> # Uri mapping
> [uri:/jsp-examples/*]
> 
> 
> [uri:spark.iss.utep.edu/*.jsp]
> group=ajp13:localhost:8009
> 
> 
> 
> I added the following in my httpd.conf also:
> 
> 
> JkUriSet worker ajp13:localhost:8009
> 
> 
> 
> (Before I would just add the lines below in my httpd.conf, and jsp's
and
> servlets would work!
> JkMount /*.jsp ajp13
> JkMount /*/servlet/ ajp13)
> 
> 
> Also, I have the following in my server.xml file to run my jsp's from
my
> homedirs:
>   directoryName="wwwdocs"
> userClass="org.apache.catalina.startup.PasswdUserDatabase"/>
> 
> What am I missing???
> 
> 
> 
> -
> 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]


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



RE: servlet help

2005-01-13 Thread Casas, Claudia
I am using jk2, apache2, and tomcat5.5

-Original Message-
From: Edmon Begoli [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 12, 2005 6:42 PM
To: Tomcat Users List
Subject: Re: servlet help

Claudia,

Are you using mod_jk with Apache and Tomcat?
You should be able to configure in Apache's httpd.conf
to forward particular url patterns to your Tomcat(s') worker(s).

Something like:

JkMount /yourapp/* yourworker

More details are in mod_jk documentation. I do not think that there is a
way 
to forward only servlet calls, as you can not be sure from the URL.
Usually, 
your URL/URI will have some servlet app. specific context which will
help 
you.

Regards,
Edmon
Software Architecture to the Rescue

- Original Message - 
From: "Casas, Claudia" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Wednesday, January 12, 2005 3:16 PM
Subject: RE: servlet help


Oki doki,
I got my servlets to work from tomcat using port 8080
(http://myserver:8080/~myacct/servlet/myservlet), but I still do not
know how to make apache recognize my servlets and send them to tomcat. I
want to access (http://myserver/~myacct/servlet/myservlet)

I tried to add these lines to httpd.conf

JkUriSet worker ajp13:localhost:8009


and also added these lines to workers2.properties

[uri:spark.iss.utep.edu/servlet/*]
group=ajp13:localhost:8009

but still no luck! :( please help.

For reference I used the following taken from the web site:
http://www.jolash.com/tomcat/

Configure the tomcat "web.xml" file in your tomcat's "conf" directory.
You only need to do this if you are going to write servlets. After doing
this, you can put all your servlets into the subdirectory
"WEB-INF/classes" of your webapp directory. And you can access those
servlets with a URL like:
 Uncomment the servlet element tags with the servlet-name of invoker
(just search for invoker).

invoker

  org.apache.catalina.servlets.InvokerServlet


debug
0

2


Uncomment the servlet-mapping element tags with the servlet-name of
invoker.


invoker
/servlet/*



-Original Message-
From: Casas, Claudia [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 12, 2005 11:56 AM
To: tomcat-user@jakarta.apache.org
Subject: servlet help


I am running tomcat5.5.4, apache2.0.52 and jk2.
1)I an run my jsp's and servlets from root. I have configured tomcat to
run my jsp's from the homedirs, but I do not know how to configure
tomcat to run servlets from the homedirs.

I can run my jsp's like this: http://myserver/~myhomedir/myfile.jsp or
http://myserver:8080/~myhomedir/myfile.jsp
Either way it works fine.
What do I need to add so that my servlets run from my homedirs as well??

These are my configuration files:

/usr/local/apache/workers2.properties

info=Ajp13 forwarding over socket
tomcatId=localhost:8009


#define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
`
# Map the Tomcat examples webapp to the Web server uri space
#[uri:/jkstatus/*]
#group=status:status




# Uri mapping
[uri:/jsp-examples/*]


[uri:spark.iss.utep.edu/*.jsp]
group=ajp13:localhost:8009



I added the following in my httpd.conf also:


JkUriSet worker ajp13:localhost:8009



(Before I would just add the lines below in my httpd.conf, and jsp's and
servlets would work!
JkMount /*.jsp ajp13
JkMount /*/servlet/ ajp13)


Also, I have the following in my server.xml file to run my jsp's from my
homedirs:
 

What am I missing???



-
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: servlet help

2005-01-12 Thread Edmon Begoli
Claudia,
Are you using mod_jk with Apache and Tomcat?
You should be able to configure in Apache's httpd.conf
to forward particular url patterns to your Tomcat(s') worker(s).
Something like:
JkMount /yourapp/* yourworker
More details are in mod_jk documentation. I do not think that there is a way 
to forward only servlet calls, as you can not be sure from the URL. Usually, 
your URL/URI will have some servlet app. specific context which will help 
you.

Regards,
Edmon
Software Architecture to the Rescue
- Original Message - 
From: "Casas, Claudia" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Wednesday, January 12, 2005 3:16 PM
Subject: RE: servlet help

Oki doki,
I got my servlets to work from tomcat using port 8080
(http://myserver:8080/~myacct/servlet/myservlet), but I still do not
know how to make apache recognize my servlets and send them to tomcat. I
want to access (http://myserver/~myacct/servlet/myservlet)
I tried to add these lines to httpd.conf

   JkUriSet worker ajp13:localhost:8009

and also added these lines to workers2.properties
[uri:spark.iss.utep.edu/servlet/*]
group=ajp13:localhost:8009
but still no luck! :( please help.
For reference I used the following taken from the web site:
http://www.jolash.com/tomcat/
Configure the tomcat "web.xml" file in your tomcat's "conf" directory.
You only need to do this if you are going to write servlets. After doing
this, you can put all your servlets into the subdirectory
"WEB-INF/classes" of your webapp directory. And you can access those
servlets with a URL like:
Uncomment the servlet element tags with the servlet-name of invoker
(just search for invoker).
   
   invoker
   
 org.apache.catalina.servlets.InvokerServlet
   
   
   debug
   0
   
   2
   
Uncomment the servlet-mapping element tags with the servlet-name of
invoker.
   
   
   invoker
   /servlet/*
   
-Original Message-
From: Casas, Claudia [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 12, 2005 11:56 AM
To: tomcat-user@jakarta.apache.org
Subject: servlet help
I am running tomcat5.5.4, apache2.0.52 and jk2.
1)I an run my jsp's and servlets from root. I have configured tomcat to
run my jsp's from the homedirs, but I do not know how to configure
tomcat to run servlets from the homedirs.
I can run my jsp's like this: http://myserver/~myhomedir/myfile.jsp or
http://myserver:8080/~myhomedir/myfile.jsp
Either way it works fine.
What do I need to add so that my servlets run from my homedirs as well??
These are my configuration files:
/usr/local/apache/workers2.properties
info=Ajp13 forwarding over socket
tomcatId=localhost:8009
#define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
`
# Map the Tomcat examples webapp to the Web server uri space
#[uri:/jkstatus/*]
#group=status:status

# Uri mapping
[uri:/jsp-examples/*]
[uri:spark.iss.utep.edu/*.jsp]
group=ajp13:localhost:8009

I added the following in my httpd.conf also:

   JkUriSet worker ajp13:localhost:8009

(Before I would just add the lines below in my httpd.conf, and jsp's and
servlets would work!
JkMount /*.jsp ajp13
JkMount /*/servlet/ ajp13)
Also, I have the following in my server.xml file to run my jsp's from my
homedirs:

What am I missing???

-
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: servlet help

2005-01-12 Thread Casas, Claudia
Thanks for your support David. Unfortunately, the configuration for jk2 is a 
bit different, but I really appreciate it.

-Original Message-
From: David da Guia Carvalho [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 12, 2005 1:52 PM
To: Tomcat Users List
Subject: RE: servlet help

Configurando Apache + Jakarta-TOMCAT + Connector MOD_JKConfigurando
Apache + Jakarta-TOMCAT + Connector MOD_JKHi... follow down the
"mini-howto" (Unfortunely I write in portuguese so I have to make a
translation...) I will work on it to translante and correct some
issues... perhaps even in portuguese he can help you

When I finish the translation I post to you again... (if you need any
help to especific parts mail me!)


Configurando Apache + Jakarta-TOMCAT + Connector MOD_JK
Por: David da Guia Carvalho
Data: 09-09-2004


Consideramos que o leitor possua o seguinte ambiente:
Apache 1.3 ou 2.0; (+DEVEL) + APXS;
J2SDK 1.4;
Jakarta-Tomcat 5.0;
GCC, G++ e DEVEL (LIBS e HEADERS);


Conveção do tutorial:
Letras em Itálico são utilizadas para comandos de Shell;
Letras em courier são utilizadas em conteúdo de arquivos;


Este método foi utilizado repetidamente em DEBIAN 3.0 e Conectiva 10
(Redhat like).
(ambos atualizados na data (09-09-2004)).


APACHE:


A instalação do Apache padrão da distribuição:


Debian: Server version Apache/1.3.26 (Unix) Debian GNU/Linux
nenhuma modificação.


Conectiva: Server Apache/2.0.49
(A única modificação feito foi no arquivo /etc/apache/conf/httpd.conf em
DocummentRoot por motivos de padronização.)
De:
DocumentRoot=/srv/www/default/html
Para:
DocumentRoot=/var/www


( ESTA MODIFICAÇÃO NÃO INFLUENCIA NO FUNCIONAMENTO DO APACHE + TOMCAT )


O JSDK e JAKARTA-TOMCAT:


Em ambas as distribuições instalamos JSDK e TOMCAT em "/opt".
No arquivo "/etc/profile" foram colocadas as seguintes variáveis que
indicam onde estas aplicações foram instaladas segue abaixo um exemplo:


JAVA_HOME=/opt/j2sdk1.4.2_05
JRE_HOME=/opt/j2sdk1.4.2_05/jre
TOMCAT_HOME=/opt/jakarta-tomcat-5.0.27
export JAVA_HOME
export JRE_HOME
export TOMCAT


Os COMPILADORES:


GCC, G++, LIBS e DEVELS foram instalados segundo o padrão da
distribuição (instalação via apt-get)


Introdução:


Onde obter o arquivo?
Baixe o arquivo: jakarta-tomcat-connectors-jk-1.2.6.src.tar.gz

(http://archieve.apache.org/dist/jakarta/tomcat-connectors/jk/source/jakarta-tomcat-connectors-jk-1.2.6-src.tar.gv)


Instalação:


Descompacte-o em uma pasta de sua escolha (no nosso exemplo utilizaremos
"/usr/src")


#>tar -zxvf jakarta-tomcat-connectors-jk-1.2.6-src.tar.gz


Entre na pasta que foi criada.


#>cd /usr/src/jakarta-tomcat-connectors-jk-1.2.6-src/jk/native


dentrodo diretorio inicie os preparos para a compilação:


#>./configure -with-apxs=/usr/sbin/apxs


(
Caso necessario o diretorio do apxs pode ser localizado com o comando:
#>locate apxs


Caso nunca tenha utilizado o comando "locate" atualize suas bases de
dadods com o comando:
#>updatedb
)


Após conseguir executar o configure com sucesso execute o comando
"make":


#>make 


após o comando make copie o arquivo gerado para o diretorio de módulos
do apache (isso varia de distribuição).




PARA DEBIAN 3.0:


#cp
/usr/src/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.so.0.0.0
/usr/lib/apache/1.3/mod_jk.so


PARA CONECTIVA 10:
#cp /usr/src/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.so
/usr/lib/apache/modules


Configurando o Apache:


No diretorio "conf" (para Debian: /etc/apache para Conectiva:
/etc/apache/conf/) do apache, edite o arquivo httpd.conf


Na seção "LoadModule" adicione as seguintes linhas:


PARA DEBIAN:


##
### Java ###
### TOMCAT ###
##
LoadFile /usr/lib/libpthread.so
LoadModule jk_module /usr/lib/apache/1.3/mod_jk.so
#AddModule mod_jk.c
JkWorkersFile /opt/jakarta-tomcat-5.0.28/conf/workers.properties
JkLogFile /var/log/apache/mod_jk.log
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkRequestLogFormat "%w %V %T"
#
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
# send all requests ending in .jsp to
# JkMount /*.jsp worker1
# send all requests ending /servlet to worker1
# JkMount /*/servlet/ worker1
# send all requests jsp requests to files located in /otherworker will
go worker2
# JkMount /otherworker/*.jsp worker2


#






Para CONECTIVA:


##
### JAVA ###
### TOMCAT ###
##
#LoadFile /usr/lib/libpthread.so
LoadModule jk_module /usr/lib/apache/modules/mod_jk.so
# AddModule mod_jk.c
JkWorkersFile /opt/jakarta-tomcat-5.0.27/conf/workers.properties
JkLogFile /var/log/apache/mod_jk.log
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkRequestLogFormat "%w %V %T"
#
JkMount /*.jsp ajp13
# send all requests ending in .jsp to
# JkMount /*.jsp worker1
# send all requests ending /servlet to work

RE: servlet help

2005-01-12 Thread David da Guia Carvalho
s


Configurando o TOMCAT:


Edite (criar caso nÃo exista) o arquivo:
/opt/jakarta-tomcat-5.0.27/conf/worker.properties inserir o seguinte
conteudo:


workers.tomcat_home=/opt/jakarta-tomcat-5.0.27
workers.java_home=/opt/j2sdk1.4.2_05
ps=/
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1




Finalizando:


Reinicie o TOMCAT:


#>/opt/jakarta-tomcat-5.0.27/bin/shutdown.sh
#>/opt/jakarta-tomcat-5.0.27/bin/startup.sh


Reinicie o Apache:


#>/etc/init.d/apache stop
#>/etc/init.d/apache start


Extra:
(arquivo de inicializaÃÃo âinit.dâ do TOMCAT)
Edite (ou crie) o arquivo /etc/init.d/tomcat


#!/bin/sh
#
# Startup script for the Jakarta Tomcat Java Servlets and JSP server
#
# chkconfig: - 85 15
# update-rc
#
# description: Jakarta Tomcat Java Servlets and JSP server
# processname: tomcat
# pidfile: /var/run/tomcat.pid
# config:
# Source function library.
# /etc/rc.d/init.d/functions
# Source networking configuration.
#/etc/sysconfig/network
# Check that networking is up.
# [ ${NETWORKING} = "no" ] && exit 0
# Set Tomcat environment.
# export JAVA_HOME=/usr/local/j2sdk
# export
CLASSPATH=.:/usr/local/j2sdk/lib/tools.jar:/usr/local/j2re/lib/rt.jar
# export CATALINA_HOME=/usr/local/tomcat
# export CATALINA_OPTS="-Dbuild.compiler.emacs=true"
# export PATH=/usr/local/j2sdk/bin:/usr/local/j2re/bin:$PATH
#Var
TOM_DIR="/opt/jakarta-tomcat-5.0.27/";
#JBOSS_DIR="/opt/jboss-3.2.4/";
START_JBOSS="bin/run.sh &"
HALT_JBOSS="bin/shutdown.sh";
START_TOM="bin/startup.sh";
HALT_TOM="bin/shutdown.sh";
#[ -f /usr/local/tomcat/bin/startup.sh ] || exit 0
#[ -f /usr/local/tomcat/bin/shutdown.sh ] || exit 0
# export PATH=$PATH:/usr/bin:/usr/local/bin
# See how we were called.
case "$1" in
start)
# Start daemon.
echo -n "Starting Tomcat: "
$TOM_DIR/$START_TOM;
# $JBOSS_DIR/$START_JBOSS;
# /usr/local/tomcat/bin/startup.sh
RETVAL=$?
echo [ $RETVAL = 0 ] && touch /var/lock/subsys/tomcat
;;
stop)


# Stop daemons.
echo -n "Shutting down Tomcat: "
$TOM_DIR/$HALT_TOM;
# $JBOSS_DIR/$HALT_JBOSS;
# /usr/local/tomcat/bin/shutdown.sh
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/tomcat
;;
restart)
$0 stop
$0 start
;;
condrestart)
[ -e /var/lock/subsys/tomcat ] && $0 restart
;;
status)
status tomcat
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0


--

David da Guia Carvalho
Animus Tecnologia da InformaÃÃo
Tel.: (21) 3525-8800
Fax: (21) 3525-8801
http://www.animus-ti.com.br


On Jan 12, 2005 06:16 PM, "Casas, Claudia" <[EMAIL PROTECTED]> wrote:

>Oki doki,
>I got my servlets to work from tomcat using port 8080
>(http://myserver:8080/~myacct/servlet/myservlet), but I still do not
>know how to make apache recognize my servlets and send them to tomcat.
>I
>want to access (http://myserver/~myacct/servlet/myservlet)
>
>I tried to add these lines to httpd.conf
>
>JkUriSet worker ajp13:localhost:8009
>
>
>and also added these lines to workers2.properties
>
>[uri:spark.iss.utep.edu/servlet/*]
>group=ajp13:localhost:8009
>
>but still no luck! :( please help.
>
>For reference I used the following taken from the web site:
>http://www.jolash.com/tomcat/
>
>Configure the tomcat "web.xml" file in your tomcat's "conf" directory.
>You only need to do this if you are going to write servlets. After
>doing
>this, you can put all your servlets into the subdirectory
>"WEB-INF/classes" of your webapp directory. And you can access those
>servlets with a URL like:
>Uncomment the servlet element tags with the servlet-name of invoker
>(just search for invoker).
>
>invoker
>
>org.apache.catalina.servlets.InvokerServlet
>
>
>debug
>0
>
>2
>
>
>Uncomment the servlet-mapping element tags with the servlet-name of
>invoker.
>
>
>invoker
>/servlet/*
>
>
>
>-Original Message-
>From: Casas, Claudia [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, January 12, 2005 11:56 AM
>To: tomcat-user@jakarta.apache.org
>Subject: servlet help
>
>
>I am running tomcat5.5.4, apache2.0.52 and jk2.
>1)I an run my jsp's and servlets from root. I have configured tomcat to
>run my jsp's from the homedirs, but I do not know how to configure
>tomcat to run servlets from the homedirs.
>
>I can run my jsp's like this: http://myserver/~myhomedir/myfile.jsp or
>http://myserver:8080/~myhomedir/myfile.jsp
>Either way it works fine.
>What do I need to add so that my servlets run from my homedirs as
>well??
>
>These are my configuration files:
>
>/usr/local/apache/workers2.pro

RE: servlet help

2005-01-12 Thread Casas, Claudia
Oki doki,
I got my servlets to work from tomcat using port 8080
(http://myserver:8080/~myacct/servlet/myservlet), but I still do not
know how to make apache recognize my servlets and send them to tomcat. I
want to access (http://myserver/~myacct/servlet/myservlet)

I tried to add these lines to httpd.conf

JkUriSet worker ajp13:localhost:8009


and also added these lines to workers2.properties

[uri:spark.iss.utep.edu/servlet/*]
group=ajp13:localhost:8009

but still no luck! :( please help.

For reference I used the following taken from the web site:
http://www.jolash.com/tomcat/

Configure the tomcat "web.xml" file in your tomcat's "conf" directory.
You only need to do this if you are going to write servlets. After doing
this, you can put all your servlets into the subdirectory
"WEB-INF/classes" of your webapp directory. And you can access those
servlets with a URL like:
 Uncomment the servlet element tags with the servlet-name of invoker
(just search for invoker). 

invoker

  org.apache.catalina.servlets.InvokerServlet


debug
0

2


Uncomment the servlet-mapping element tags with the servlet-name of
invoker. 


invoker
/servlet/*



-Original Message-
From: Casas, Claudia [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 12, 2005 11:56 AM
To: tomcat-user@jakarta.apache.org
Subject: servlet help


I am running tomcat5.5.4, apache2.0.52 and jk2.
1)I an run my jsp's and servlets from root. I have configured tomcat to
run my jsp's from the homedirs, but I do not know how to configure
tomcat to run servlets from the homedirs.

I can run my jsp's like this: http://myserver/~myhomedir/myfile.jsp or
http://myserver:8080/~myhomedir/myfile.jsp
Either way it works fine.
What do I need to add so that my servlets run from my homedirs as well??

These are my configuration files:

/usr/local/apache/workers2.properties

info=Ajp13 forwarding over socket
tomcatId=localhost:8009
 

#define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
`
# Map the Tomcat examples webapp to the Web server uri space
#[uri:/jkstatus/*]
#group=status:status
 

 

# Uri mapping
[uri:/jsp-examples/*]
 

[uri:spark.iss.utep.edu/*.jsp]
group=ajp13:localhost:8009
 


I added the following in my httpd.conf also:


JkUriSet worker ajp13:localhost:8009



(Before I would just add the lines below in my httpd.conf, and jsp's and
servlets would work!
JkMount /*.jsp ajp13
JkMount /*/servlet/ ajp13)


Also, I have the following in my server.xml file to run my jsp's from my
homedirs:
 

What am I missing???



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



servlet help

2005-01-12 Thread Casas, Claudia

I am running tomcat5.5.4, apache2.0.52 and jk2.
1)I an run my jsp's and servlets from root. I have configured tomcat to run my 
jsp's from the homedirs, but I do not know how to configure tomcat to run 
servlets from the homedirs.

I can run my jsp's like this: http://myserver/~myhomedir/myfile.jsp or 
http://myserver:8080/~myhomedir/myfile.jsp
Either way it works fine.
What do I need to add so that my servlets run from my homedirs as well??

These are my configuration files:

/usr/local/apache/workers2.properties

info=Ajp13 forwarding over socket
tomcatId=localhost:8009

#define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
`
# Map the Tomcat examples webapp to the Web server uri space
#[uri:/jkstatus/*]
#group=status:status


# Uri mapping
[uri:/jsp-examples/*]

[uri:spark.iss.utep.edu/*.jsp]
group=ajp13:localhost:8009


I added the following in my httpd.conf also:


JkUriSet worker ajp13:localhost:8009



(Before I would just add the lines below in my httpd.conf, and jsp's and 
servlets would work!
JkMount /*.jsp ajp13
JkMount /*/servlet/ ajp13)


Also, I have the following in my server.xml file to run my jsp's from my 
homedirs:
 

What am I missing???




Re: servlet help please

2004-02-17 Thread jugal
hi
tell me one thing...that u added the servlet tag in ur web.xml file or 
not...
if not then add it to web.xml file

MessageServlet1
MessageServlet1


try with this...
programme runs???...or not runlet me know
by by
jugal
Jason Tesser wrote:

OK I am new to Tomcat and I am going through one of Sun's courses
regarding Web apps.  I am working on the below example; I have complied
the code ok 
And put it in the servlets-examples/classes.  I also went into the
web.xml File under the servlets-examples directory and added the
following
	
		MessageServlet1
		/servlet/MessageServlet1
	

The problem is when I add the above code to the xml file nothing Under
servlets-examples will run.  What am I doing wrong?
Here is the java code for MessageServlet1 

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
// Support classes
import java.io.IOException;
import java.io.PrintWriter;
public class MessageServlet1 extends HttpServlet {

 private static final String[] MESSAGES = {
   "How are you today?",
   "What's in a name? That which we call a rose by any other name would
smell as sweet.",
   "My hovercraft is full of eels."
 };
 public void doGet(HttpServletRequest request,
HttpServletResponse response)
 throws IOException {
   // Pick a random message
   int msg_index = (int) (Math.random() * MESSAGES.length);
   String message = MESSAGES[msg_index];
   response.setContentType("text/html");
   PrintWriter out = response.getWriter();
   out.println("");
   out.println("");
   out.println("Message Servlet");
   out.println("");
   out.println("");
   out.println("The message is: ");
   out.println("" + message + "");
   out.println("");
   out.println("");
   out.close();
 }
}
-
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: servlet help please

2004-02-17 Thread Jason Tesser
Hi,

Yes I got it working.  Thank you all for the help.  
 
> Paste your  and  code here.
> 
> Kind Regards
> Schalk Neethling
> Web Developer.Designer.Programmer.CEO
> Volume4.Development.Multimedia.Branding
> emotionalize.conceptualize.visualize.realize
> Tel: +27125468436
> Fax: +27125468436
> email:[EMAIL PROTECTED]
> web: www.volume4.com
> 
> This message contains information that is considered to be sensitive
or
> confidential and may not be forwarded or disclosed to any other party
> without the permission of the sender. If you received this message in
> error,
> please notify me immediately so that I can correct and delete the
original
> email. Thank you.
> 
> :: -Original Message-
> :: From: Jason Tesser [mailto:[EMAIL PROTECTED]
> :: Sent: Tuesday, February 17, 2004 9:22 PM
> :: To: Tomcat Users List
> :: Subject: RE: servlet help please
> ::
> :: Hi
> ::
> :: > Howdy,
> :: >
> :: > >
> :: > >MessageServlet1
> :: > >
/servlet/MessageServlet1
> :: > >
> :: > >
> :: > >The problem is when I add the above code to the xml file nothing
> :: Under
> :: > >servlets-examples will run.  What am I doing wrong?
> :: >
> :: > You need to have a  element in your web.xml file
defining
> :: what
> :: > class MessageServlet1 is, e.g.
> :: > 
> :: >   MessageServlet1
> :: >   com.mycompany.SomeServlet
> :: > 
> :: >
> :: > It's preferable to put this servlet element before the servlet-
> mapping
> :: > one ;)
> :: >
> :: > Yoav Shapira
> :: >
> :: ok got it :-)  Thanks now I am getting the following error
> ::
> :: HTTP Status 500 -
> ::
> ::
---
> -
> :: 
> ::
> :: type Exception report
> ::
> :: message
> ::
> :: description The server encountered an internal error () that
prevented
> :: it from fulfilling this request.
> ::
> :: exception
> ::
> :: javax.servlet.ServletException: No servlet class has been specified
for
> :: servlet MessageServlet1
> ::
> ::
>
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
> :: Base.java:509)
> ::
> ::
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :: :164)
> ::
> ::
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
> ::
> ::
>
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:82
> :: 8)
> ::
> ::
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
> :: onnection(Http11Protocol.java:700)
> ::
> ::
>
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:58
> :: 4)
> ::
> ::
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
> :: .java:683)
> ::java.lang.Thread.run(Thread.java:534)
> ::
> ::
> :: note The full stack trace of the root cause is available in the
Tomcat
> :: logs.
> ::
> ::
-
> :: 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: servlet help please

2004-02-17 Thread Schalk
Paste your  and  code here.

Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.CEO
Volume4.Development.Multimedia.Branding
emotionalize.conceptualize.visualize.realize
Tel: +27125468436
Fax: +27125468436
email:[EMAIL PROTECTED]
web: www.volume4.com
 
This message contains information that is considered to be sensitive or
confidential and may not be forwarded or disclosed to any other party
without the permission of the sender. If you received this message in error,
please notify me immediately so that I can correct and delete the original
email. Thank you. 

:: -Original Message-
:: From: Jason Tesser [mailto:[EMAIL PROTECTED]
:: Sent: Tuesday, February 17, 2004 9:22 PM
:: To: Tomcat Users List
:: Subject: RE: servlet help please
:: 
:: Hi
:: 
:: > Howdy,
:: >
:: > >  
:: > >  MessageServlet1
:: > >  /servlet/MessageServlet1
:: > >  
:: > >
:: > >The problem is when I add the above code to the xml file nothing
:: Under
:: > >servlets-examples will run.  What am I doing wrong?
:: >
:: > You need to have a  element in your web.xml file defining
:: what
:: > class MessageServlet1 is, e.g.
:: > 
:: >   MessageServlet1
:: >   com.mycompany.SomeServlet
:: > 
:: >
:: > It's preferable to put this servlet element before the servlet-mapping
:: > one ;)
:: >
:: > Yoav Shapira
:: >
:: ok got it :-)  Thanks now I am getting the following error
:: 
:: HTTP Status 500 -
:: 
:: 
:: 
:: 
:: type Exception report
:: 
:: message
:: 
:: description The server encountered an internal error () that prevented
:: it from fulfilling this request.
:: 
:: exception
:: 
:: javax.servlet.ServletException: No servlet class has been specified for
:: servlet MessageServlet1
:: 
:: org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
:: Base.java:509)
:: 
:: org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:: :164)
:: 
:: org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
:: 
:: org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:82
:: 8)
:: 
:: org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
:: onnection(Http11Protocol.java:700)
:: 
:: org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:58
:: 4)
:: 
:: org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
:: .java:683)
::  java.lang.Thread.run(Thread.java:534)
:: 
:: 
:: note The full stack trace of the root cause is available in the Tomcat
:: logs.
:: 
:: -
:: 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: servlet help please

2004-02-17 Thread Shapira, Yoav

Howdy,

>javax.servlet.ServletException: No servlet class has been specified for
>servlet MessageServlet1

Post the  and  elements from your amended
web.xml.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: servlet help please

2004-02-17 Thread Jason Tesser
Hi

> Howdy,
> 
> > 
> > MessageServlet1
> > /servlet/MessageServlet1
> > 
> >
> >The problem is when I add the above code to the xml file nothing
Under
> >servlets-examples will run.  What am I doing wrong?
> 
> You need to have a  element in your web.xml file defining
what
> class MessageServlet1 is, e.g.
> 
>   MessageServlet1
>   com.mycompany.SomeServlet
> 
> 
> It's preferable to put this servlet element before the servlet-mapping
> one ;)
> 
> Yoav Shapira
> 
ok got it :-)  Thanks now I am getting the following error

HTTP Status 500 - 




type Exception report

message 

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

exception 

javax.servlet.ServletException: No servlet class has been specified for
servlet MessageServlet1

org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java:509)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:164)

org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:82
8)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Protocol.java:700)

org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:58
4)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:683)
java.lang.Thread.run(Thread.java:534)


note The full stack trace of the root cause is available in the Tomcat
logs.

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



RE: servlet help please

2004-02-17 Thread Shapira, Yoav

Howdy,

>   
>   MessageServlet1
>   /servlet/MessageServlet1
>   
>
>The problem is when I add the above code to the xml file nothing Under
>servlets-examples will run.  What am I doing wrong?

You need to have a  element in your web.xml file defining what
class MessageServlet1 is, e.g.

  MessageServlet1
  com.mycompany.SomeServlet


It's preferable to put this servlet element before the servlet-mapping
one ;)

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



servlet help please

2004-02-17 Thread Jason Tesser
OK I am new to Tomcat and I am going through one of Sun's courses
regarding Web apps.  I am working on the below example; I have complied
the code ok 
And put it in the servlets-examples/classes.  I also went into the
web.xml File under the servlets-examples directory and added the
following

MessageServlet1
/servlet/MessageServlet1


The problem is when I add the above code to the xml file nothing Under
servlets-examples will run.  What am I doing wrong?

Here is the java code for MessageServlet1 

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
// Support classes
import java.io.IOException;
import java.io.PrintWriter;


public class MessageServlet1 extends HttpServlet {

  private static final String[] MESSAGES = {
"How are you today?",
"What's in a name? That which we call a rose by any other name would
smell as sweet.",
"My hovercraft is full of eels."
  };

  public void doGet(HttpServletRequest request,
HttpServletResponse response)
 throws IOException {

// Pick a random message
int msg_index = (int) (Math.random() * MESSAGES.length);
String message = MESSAGES[msg_index];

response.setContentType("text/html");
PrintWriter out = response.getWriter();

out.println("");
out.println("");
out.println("Message Servlet");
out.println("");
out.println("");
out.println("The message is: ");
out.println("" + message + "");
out.println("");
out.println("");

out.close();
  }
}

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



Re: Servlet help needed!

2003-07-12 Thread Jason Coleman
For me when you close the browser the session is invalidated...

also, tomcat also has a 30min default expiry for inactive sessions
(elimating the need for below)

- Original Message -
From: "Rick Roberts" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Saturday, July 12, 2003 11:30 PM
Subject: Re: Servlet help needed!


> //Invalidate session if inactive for more than 1 hour
> if(!session.isNew()){ // skip new sessions
>Date hourAgo = new Date(System.currentTimeMillis() - 60*60*1000);
>Date accessed = new Date(session.getLastAccessedTime());
>
>if(accessed.before(hourAgo)) session.invalidate();
> }
>
> FIkayo Otun wrote:
> > Good day(Sir/ma), I am a java programmer just starting to explore the
J2ee platform. I use jdk1.4.2... and tomcat to develop and deploy my
servlet. I however need a way to end my session when ever I close my
browser.  I noticed when I close my browser my session will still be on. I
am currently ussing servlet to develop an online apllication. I this I realy
need to find A solution to my problem.
> >
> > Fikayo, from Nigeria
>
> --
> ***
> * Rick Roberts*
> * Advanced Information Technologies, Inc. *
> ***
>
>
> -
> 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: Servlet help needed!

2003-07-12 Thread Rick Roberts
//Invalidate session if inactive for more than 1 hour
if(!session.isNew()){ // skip new sessions
  Date hourAgo = new Date(System.currentTimeMillis() - 60*60*1000);
  Date accessed = new Date(session.getLastAccessedTime());
  if(accessed.before(hourAgo)) session.invalidate();
}
FIkayo Otun wrote:
Good day(Sir/ma), I am a java programmer just starting to explore the J2ee platform. I use jdk1.4.2... and tomcat to develop and deploy my servlet. I however need a way to end my session when ever I close my browser.  I noticed when I close my browser my session will still be on. I am currently ussing servlet to develop an online apllication. I this I realy need to find A solution to my problem.

Fikayo, from Nigeria
--
***
* Rick Roberts*
* Advanced Information Technologies, Inc. *
***
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Servlet help needed!

2003-07-12 Thread FIkayo Otun
Good day(Sir/ma), I am a java programmer just starting to explore the J2ee platform. I 
use jdk1.4.2... and tomcat to develop and deploy my servlet. I however need a way to 
end my session when ever I close my browser.  I noticed when I close my browser my 
session will still be on. I am currently ussing servlet to develop an online 
apllication. I this I realy need to find A solution to my problem.

Fikayo, from Nigeria
-- 
__
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers


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



RE: Servlet help

2003-03-27 Thread Sandra Patricia Hunter
Okay. Thanks, John.

Any idea why nothing else will run after I run a servlet? Tomcat continues
to refer to the servlet files, which are not part of the JSP. I can't even
run a simple html page. It is like the servlet takes over, but where and
how?
The work folder remains empty.
See earlier in this thread for logs and error messages. 

Sandra Patricia Hunter
Systems Development and Web Design 
 


-Original Message-
From: John Turner [mailto:[EMAIL PROTECTED] 
Sent: March 27, 2003 7:13 AM
To: Tomcat Users List
Subject: Re: Servlet help



The work folder is where Tomcat keeps its cache.  For example, when a JSP 
is compiled into a servlet, Tomcat stores the .java file for that servlet 
in it's work folder.

John

On Thu, 27 Mar 2003 06:38:37 -0800, Sandra Patricia Hunter 
<[EMAIL PROTECTED]> wrote:

> Thanks Paul.
> I have checked that reloading is set to true and there is an entry for 
> my servlet (it wouldn't run otherwise would it?) in my web.xml file. 
> Just as an aside: what is the purpose of the work folder?
>
> Sandra Patricia Hunter
> Systems Development and Web Design
>
>
>
> -Original Message-
> From: Paul Gregoire [mailto:[EMAIL PROTECTED] Sent: March 26, 
> 2003
> 3:14 PM
> To: Tomcat Users List
> Subject: RE: Servlet help
>
>
> Once you have compiled the new servlet either jar it up or copy it
> directly
> to your WEB-INF/classes, if you jar'd it then copy the jar to WEB- 
> INF/lib.
> Now within moments your servlet should be available unless you have:
>   -turned servlet reloading off
>   -have not made an entry for the servlet in your web.xml
> If you have not then delete the subdirectories within your "work" 
> directory,
> as this will cause tomcat to regenerate all the webapp files thus 
> providing
> your users with the most current version.
>
> hope that helps...
>
> -Original Message-
> From: Sandra Patricia Hunter [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 26, 2003 3:01 PM
> To: 'Tomcat Users List'
> Subject: Servlet help
>
>
> This seems like a silly question: when I make changes in my servlet 
> what
> do I have to do to load the new file?
>
> I have tried just saving it. I have tried restarting Tomcat. I have 
> tried recompiling the file. I have tried recompiling while Tomcat was 
> shutdown and while Tomcat was running. I have tried restarting the 
> machine. Only restarting the machine seems to work. Comments? 
> Suggestions? Ridicule?
>
> Sandra Patricia Hunter
> Systems Development and Web Design
>
>
>
> -
> 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]
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

-
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: Servlet help

2003-03-27 Thread John Turner
The work folder is where Tomcat keeps its cache.  For example, when a JSP 
is compiled into a servlet, Tomcat stores the .java file for that servlet 
in it's work folder.

John

On Thu, 27 Mar 2003 06:38:37 -0800, Sandra Patricia Hunter 
<[EMAIL PROTECTED]> wrote:

Thanks Paul.
I have checked that reloading is set to true and there is an entry for my
servlet (it wouldn't run otherwise would it?) in my web.xml file.
Just as an aside: what is the purpose of the work folder?
Sandra Patricia Hunter
Systems Development and Web Design


-Original Message-
From: Paul Gregoire [mailto:[EMAIL PROTECTED] Sent: March 26, 2003 
3:14 PM
To: Tomcat Users List
Subject: RE: Servlet help

Once you have compiled the new servlet either jar it up or copy it 
directly
to your WEB-INF/classes, if you jar'd it then copy the jar to WEB- 
INF/lib.
Now within moments your servlet should be available unless you have:
	-turned servlet reloading off
	-have not made an entry for the servlet in your web.xml
If you have not then delete the subdirectories within your "work" 
directory,
as this will cause tomcat to regenerate all the webapp files thus 
providing
your users with the most current version.

hope that helps...

-Original Message-
From: Sandra Patricia Hunter [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 3:01 PM
To: 'Tomcat Users List'
Subject: Servlet help
This seems like a silly question: when I make changes in my servlet what 
do I have to do to load the new file?

I have tried just saving it. I have tried restarting Tomcat. I have tried
recompiling the file. I have tried recompiling while Tomcat was shutdown 
and
while Tomcat was running. I have tried restarting the machine. Only
restarting the machine seems to work. Comments? Suggestions? Ridicule?

Sandra Patricia Hunter
Systems Development and Web Design


-
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]



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Servlet help

2003-03-27 Thread Sandra Patricia Hunter
Thanks Yoav.

Now I know what it is for. 

Any ideas why I am having problems starting up a JSP after I have run a
servlet? Tomcat seems to continue referring to the servlet information even
when it has been stopped and started and I have even rebooted. It's like the
servlet takes over and the JSP is lost. 

I have included log files and so on in another message with this same title.

Sandra Patricia Hunter
Systems Development and Web Design 
 


-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
Sent: March 27, 2003 6:56 AM
To: Tomcat Users List
Subject: RE: Servlet help



Howdy,

>Just as an aside: what is the purpose of the work folder?

To hold temporary tomcat work products, e.g. the compiled JSP servlets.
Tomcat uses this space as it sees fit, and tomcat is responsible for the

freshness / dirtiness (in cache terms) of the contents of the work
directories, as long as you follow standard deployment / reloading 
procedures for your web applications.

If you have cause to belive tomcat is serving old contents, e.g. an old
version of a JSP, one thing to try is stop tomcat and clean out the work
directory.

Yoav Shapira
Millennium ChemInformatics



This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


-
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: Servlet help

2003-03-27 Thread Shapira, Yoav

Howdy,

>Just as an aside: what is the purpose of the work folder?

To hold temporary tomcat work products, e.g. the compiled JSP servlets.
Tomcat uses this space as it sees fit, and tomcat is responsible for the

freshness / dirtiness (in cache terms) of the contents of the work
directories, as long as you follow standard deployment / reloading
procedures for your web applications.

If you have cause to belive tomcat is serving old contents, e.g.
an old version of a JSP, one thing to try is stop tomcat and clean out
the work directory.

Yoav Shapira
Millennium ChemInformatics



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Servlet help

2003-03-27 Thread Sandra Patricia Hunter
John:
Here is the error message when I attempt to run a JSP after running a
servlet:
javax.servlet.ServletException: Error allocating a servlet instance
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:659)

When I run my JSP this is the root cause of error:
java.lang.NoClassDefFoundError: idcard/PasswordBuilder (wrong name:
PasswordBuilder)
This refers to a file that I use with my SERVLET not JSP.

I have checked that reload is set to true and that everything is included in
the appropriate xml files (context path in server.xml, servlet info in
web.xml).

Currently the work folder is empty.

Local_host_access_log:
127.0.0.1 - - [27/Mar/2003:06:14:15 -0800] "GET
/idcard/servlet/ProtectedPage HTTP/1.1" 500 3854
127.0.0.1 - - [27/Mar/2003:06:31:24 -0800] "GET /idcard/indexIDLogin.jsp
HTTP/1.1" 500 6281
127.0.0.1 - - [27/Mar/2003:06:33:08 -0800] "GET /idcard/orgIndexID.jsp
HTTP/1.1" 500 6281
127.0.0.1 - - [27/Mar/2003:06:33:41 -0800] "GET /idcard/orgIndexID.jsp
HTTP/1.1" 500 6281

Apache_log:
003-03-27 06:32:36 [org.apache.catalina.connector.warp.WarpConnector] Error
accepting requests
java.net.SocketException: socket closed
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:343)
at java.net.ServerSocket.implAccept(ServerSocket.java:438)
at java.net.ServerSocket.accept(ServerSocket.java:409)
at
org.apache.catalina.connector.warp.WarpConnector.run(WarpConnector.java:590)
at java.lang.Thread.run(Thread.java:536)

2003-03-27 06:33:34 [org.apache.catalina.connector.warp.WarpConnector] Error
accepting requests
java.net.SocketException: socket closed
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:343)
at java.net.ServerSocket.implAccept(ServerSocket.java:438)
at java.net.ServerSocket.accept(ServerSocket.java:409)
at
org.apache.catalina.connector.warp.WarpConnector.run(WarpConnector.java:590)
at java.lang.Thread.run(Thread.java:536)

Catalina_log:
2003-03-27 05:59:45 HttpConnector Opening server socket on all host IP
addresses
2003-03-27 05:59:49 HttpConnector[8080] Starting background thread
2003-03-27 05:59:49 HttpProcessor[8080][0] Starting background thread
2003-03-27 05:59:49 HttpProcessor[8080][1] Starting background thread
2003-03-27 05:59:49 HttpProcessor[8080][2] Starting background thread
2003-03-27 05:59:49 HttpProcessor[8080][3] Starting background thread
2003-03-27 05:59:49 HttpProcessor[8080][4] Starting background thread
2003-03-27 05:59:49 Ajp13Connector[8009] Opening server socket on all host
IP addresses
2003-03-27 05:59:49 Ajp13Connector[8009] Starting background thread
2003-03-27 05:59:49 Ajp13Processor[8009][0] Starting background thread
2003-03-27 05:59:49 Ajp13Processor[8009][1] Starting background thread
2003-03-27 05:59:49 Ajp13Processor[8009][2] Starting background thread
2003-03-27 05:59:49 Ajp13Processor[8009][3] Starting background thread
2003-03-27 05:59:49 Ajp13Processor[8009][4] Starting background thread
2003-03-27 06:32:30 HttpProcessor[8080][4] Stopping background thread
2003-03-27 06:32:30 HttpProcessor[8080][3] Stopping background thread
2003-03-27 06:32:30 HttpProcessor[8080][2] Stopping background thread
2003-03-27 06:32:30 HttpProcessor[8080][1] Stopping background thread
2003-03-27 06:32:30 HttpProcessor[8080][0] Stopping background thread
2003-03-27 06:32:30 HttpConnector[8080] Stopping background thread
2003-03-27 06:32:30 Ajp13Processor[8009][4] Stopping background thread
2003-03-27 06:32:30 Ajp13Processor[8009][3] Stopping background thread
2003-03-27 06:32:30 Ajp13Processor[8009][2] Stopping background thread
2003-03-27 06:32:30 Ajp13Processor[8009][1] Stopping background thread
2003-03-27 06:32:30 Ajp13Processor[8009][0] Stopping background thread
2003-03-27 06:32:30 Ajp13Connector[8009] Stopping background thread
2003-03-27 06:32:37 HttpConnector Opening server socket on all host IP
addresses
2003-03-27 06:32:40 HttpConnector[8080] Starting background thread
2003-03-27 06:32:40 HttpProcessor[8080][0] Starting background thread
2003-03-27 06:32:40 HttpProcessor[8080][1] Starting background thread
2003-03-27 06:32:40 HttpProcessor[8080][2] Starting background thread
2003-03-27 06:32:40 HttpProcessor[8080][3] Starting background thread
2003-03-27 06:32:40 HttpProcessor[8080][4] Starting background thread
2003-03-27 06:32:40 Ajp13Connector[8009] Opening server socket on all host
IP addresses
2003-03-27 06:32:40 Ajp13Connector[8009] Starting background thread
2003-03-27 06:32:40 Ajp13Processor[8009][0] Starting background thread
2003-03-27 06:32:40 Ajp13Processor[8009][1] Starting background thread
2003-03-27 06:32:40 Ajp13Processor[8009][2] Starting background thread
2003-03-27 06:32:40 Ajp13Processor[8009][3] Starting background thread
2003-03-27 06:32:40 Ajp13Processor[8009][4] Starting background thread
2003-03-27 06:33:

RE: Servlet help

2003-03-27 Thread Sandra Patricia Hunter
Thanks Paul.
I have checked that reloading is set to true and there is an entry for my
servlet (it wouldn't run otherwise would it?) in my web.xml file.
Just as an aside: what is the purpose of the work folder? 

Sandra Patricia Hunter
Systems Development and Web Design 
 


-Original Message-
From: Paul Gregoire [mailto:[EMAIL PROTECTED] 
Sent: March 26, 2003 3:14 PM
To: Tomcat Users List
Subject: RE: Servlet help


Once you have compiled the new servlet either jar it up or copy it directly
to your WEB-INF/classes, if you jar'd it then copy the jar to WEB-INF/lib.
Now within moments your servlet should be available unless you have:
- turned servlet reloading off
- have not made an entry for the servlet in your web.xml
If you have not then delete the subdirectories within your "work" directory,
as this will cause tomcat to regenerate all the webapp files thus providing
your users with the most current version.

hope that helps...

-Original Message-
From: Sandra Patricia Hunter [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 3:01 PM
To: 'Tomcat Users List'
Subject: Servlet help


This seems like a silly question: 
when I make changes in my servlet what do I have to do to load the new file?

I have tried just saving it. I have tried restarting Tomcat. I have tried
recompiling the file. I have tried recompiling while Tomcat was shutdown and
while Tomcat was running. I have tried restarting the machine. Only
restarting the machine seems to work. Comments? Suggestions? Ridicule?

Sandra Patricia Hunter
Systems Development and Web Design 
 


-
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: Servlet help

2003-03-27 Thread John Turner
Error message?  Log file contents?

John

On Wed, 26 Mar 2003 18:47:01 -0800, Sandra Patricia Hunter 
<[EMAIL PROTECTED]> wrote:

Thanks.
I got my servlet up and running but now I can't run my jsp. After 
rebooting I can see my jsp but I can't load another one.
Something is stuck somewhere according to some configuration I have made,
but I don't even know where to begin to look or what more information to
give you.
Any ideas?

Sandra Patricia Hunter
Systems Development and Web Design


-Original Message-
From: Vladimer Shioshvili [mailto:[EMAIL PROTECTED] Sent: March 26, 
2003 3:13 PM
To: Tomcat Users List
Subject: Re: Servlet help

Sandra,

if you are planning to do the changes often you are probably better off 
if you set reloadable parameter to true in server.xml file, 
(http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/context.html) 
however, setting it to reloadable means that you should accept that it 
will eat up some of your CPU time as well (not a significant one, but 
it's there).. otherwise, compiling your file, and restarting tomcat 
should suffice...

vlad

At 06:00 PM 3/26/2003, you wrote:
This seems like a silly question:
when I make changes in my servlet what do I have to do to load the new 
file?

I have tried just saving it. I have tried restarting Tomcat. I have 
tried recompiling the file. I have tried recompiling while Tomcat was 
shutdown and while Tomcat was running. I have tried restarting the 
machine. Only restarting the machine seems to work. Comments? 
Suggestions? Ridicule?

Sandra Patricia Hunter
Systems Development and Web Design


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

Vladimer Shioshvili
QRC Division of Macro International Inc.
7315 Wisconsin Avenue, Suite 400W
Bethesda, MD 20814
Phone: (301) 657 3077 ext. 155

-
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]



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Servlet help

2003-03-27 Thread Paul Gregoire
Once you have compiled the new servlet either jar it up or copy it
directly to your WEB-INF/classes, if you jar'd it then copy the jar to
WEB-INF/lib.
Now within moments your servlet should be available unless you have:
- turned servlet reloading off
- have not made an entry for the servlet in your web.xml
If you have not then delete the subdirectories within your "work"
directory, as this will cause tomcat to regenerate all the webapp files
thus providing your users with the most current version.

hope that helps...

-Original Message-
From: Sandra Patricia Hunter [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 3:01 PM
To: 'Tomcat Users List'
Subject: Servlet help


This seems like a silly question: 
when I make changes in my servlet what do I have to do to load the new
file?

I have tried just saving it. I have tried restarting Tomcat. I have
tried
recompiling the file. I have tried recompiling while Tomcat was shutdown
and
while Tomcat was running. I have tried restarting the machine. Only
restarting the machine seems to work.
Comments? Suggestions? Ridicule?

Sandra Patricia Hunter
Systems Development and Web Design 
 


-
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: Servlet help

2003-03-26 Thread Sandra Patricia Hunter
Thanks.
I got my servlet up and running but now I can't run my jsp. 
After rebooting I can see my jsp but I can't load another one.
Something is stuck somewhere according to some configuration I have made,
but I don't even know where to begin to look or what more information to
give you.
Any ideas?

Sandra Patricia Hunter
Systems Development and Web Design 
 


-Original Message-
From: Vladimer Shioshvili [mailto:[EMAIL PROTECTED] 
Sent: March 26, 2003 3:13 PM
To: Tomcat Users List
Subject: Re: Servlet help


Sandra,

if you are planning to do the changes often you are probably better off if 
you set reloadable parameter to true in server.xml file, 
(http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/context.html) 
however, setting it to reloadable means that you should accept that it will 
eat up some of your CPU time as well (not a significant one, but it's 
there).. otherwise, compiling your file, and restarting tomcat should 
suffice...

vlad

At 06:00 PM 3/26/2003, you wrote:
>This seems like a silly question:
>when I make changes in my servlet what do I have to do to load the new 
>file?
>
>I have tried just saving it. I have tried restarting Tomcat. I have 
>tried recompiling the file. I have tried recompiling while Tomcat was 
>shutdown and while Tomcat was running. I have tried restarting the 
>machine. Only restarting the machine seems to work. Comments? 
>Suggestions? Ridicule?
>
>Sandra Patricia Hunter
>Systems Development and Web Design
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


Vladimer Shioshvili

QRC Division of Macro International Inc.
7315 Wisconsin Avenue, Suite 400W
Bethesda, MD 20814

Phone: (301) 657 3077 ext. 155 


-
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: Servlet help

2003-03-26 Thread Vladimer Shioshvili
Sandra,

if you are planning to do the changes often you are probably better off if 
you set reloadable parameter to true in server.xml file, 
(http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/context.html) 
however, setting it to reloadable means that you should accept that it will 
eat up some of your CPU time as well (not a significant one, but it's 
there).. otherwise, compiling your file, and restarting tomcat should 
suffice...

vlad

At 06:00 PM 3/26/2003, you wrote:
This seems like a silly question:
when I make changes in my servlet what do I have to do to load the new file?
I have tried just saving it. I have tried restarting Tomcat. I have tried
recompiling the file. I have tried recompiling while Tomcat was shutdown and
while Tomcat was running. I have tried restarting the machine. Only
restarting the machine seems to work.
Comments? Suggestions? Ridicule?
Sandra Patricia Hunter
Systems Development and Web Design


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

Vladimer Shioshvili
QRC Division of Macro International Inc.
7315 Wisconsin Avenue, Suite 400W
Bethesda, MD 20814
Phone: (301) 657 3077 ext. 155 

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


RE: Servlet help

2003-03-26 Thread jsp
Is tomcat being run as a service? If so you have to restart it there and
sometimes I also have to go to the command line c:\tomcat\bin\shutdown
... c:\tomcat\bin\startup for it to take. If your using the newer
versions of tomcat it doesn't seem to work any other way.

-wiley


-Original Message-
From: Sandra Patricia Hunter [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 26, 2003 3:01 PM
To: 'Tomcat Users List'
Subject: Servlet help

This seems like a silly question: 
when I make changes in my servlet what do I have to do to load the new
file?

I have tried just saving it. I have tried restarting Tomcat. I have
tried
recompiling the file. I have tried recompiling while Tomcat was shutdown
and
while Tomcat was running. I have tried restarting the machine. Only
restarting the machine seems to work.
Comments? Suggestions? Ridicule?

Sandra Patricia Hunter
Systems Development and Web Design 
 


-
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]



Servlet help

2003-03-26 Thread Sandra Patricia Hunter
This seems like a silly question: 
when I make changes in my servlet what do I have to do to load the new file?

I have tried just saving it. I have tried restarting Tomcat. I have tried
recompiling the file. I have tried recompiling while Tomcat was shutdown and
while Tomcat was running. I have tried restarting the machine. Only
restarting the machine seems to work.
Comments? Suggestions? Ridicule?

Sandra Patricia Hunter
Systems Development and Web Design 
 


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



Re: DB2 and servlet ??? Help !!!

2002-08-01 Thread Nishant_Awasthi


Hello
I think I found where the problem is
When I try to print e4.getmessage() while opening my conenction as given
below:
   try{
  con = DriverManager.getConnection
("jdbc:db2://10.3.13.34/SAMPLE","db2admin","db2pwd");
}
catch( Exception e4)
{
   out.println(" connection "+e4.getMessage
());
e4.printStackTrace();
}

I got something different in the web browser output:
It now says
WEB BROWSER OUTPUT -
[paramater passed is 10


Count is0
Found the JDBC driver

Driver is properly loaded and registered connection [IBM][JDBC Driver]
CLI0621E Unsupported JDBC Server configuration.
Connection URL is good
Retrieve some data from the database... stmt and rs null
Received results:

Count is0
God Please help


Now at least I know that there is some problem with JDBC Driver...
But I don't know why this is hapenning though while compiling  simple java
file it
never gave this error...



Nishant Awasthi
Corporate Systems Development
Progressive Insurance







   

Nishant_Awasthi@progr  

essive.com   To: "Tomcat Users List"   

 <[EMAIL PROTECTED]>  

08/01/2002 02:25 PM  cc: (bcc: Nishant Awasthi)

    Please respond toSubject: Re: DB2 and servlet ??? 
Help !!! 
"Tomcat Users List"

   

   







Please don't look at the parameters
As I am not using parameter in my query...
Right now I am just trying to run a very simple query...
Parameter has been output just for testing if servlet is taking wirte
parameter vvalues or not...

Parameters are not being used anywhere in the whole servlet  code..
Thanks



Nishant Awasthi
Corporate Systems Development
Progressive Insurance








"Michael
Locasto"   To: "Tomcat Users List"
<[EMAIL PROTECTED]<[EMAIL PROTECTED]>
umbia.edu>     cc: (bcc: Nishant Awasthi)
   Subject: Re: DB2 and servlet
??? Help !!!
08/01/2002
02:16 PM
Please respond
to "Tomcat
Users List"







Hi,

Your parameter is '012', while it appears that the employeenumbers in your
database are more like:

empno= 000150



 BROWSER OUTPUT
---
paramater passed is 012

Count is0
Found the JDBC driver

Driver is properly loaded and registered
Connection URL is good
Retrieve some data from the database...
Received results:

Count is0
God Please help




Regards,
Michael



- Original Message -
From: <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Thursday, August 01, 2002 2:10 PM
Subject: RE: DB2 and servlet ??? Help !!!


>
> I tried both ways
> while(rs.next())
> and
> if(!rs.next())
> both gives the same web browser output
> 
> 

>
> Nishant Awasthi
> Corporate Systems Development
> Progressive Insurance
>
>
>
>
>
>
>
>
> "Turner,
>     John"To: 'Tomcat Users List'
> 
> com> cc: (bcc: Nishant Awasthi)
>  Subject: RE: DB2 and
servlet ??? Help !!!
> 08/01/2002
> 02:07 PM
> Please
> respond to
> "Tomcat Users
> List"
>
>
>
>
>
>
>
>
> Nice catch!  You are right.  It should be
>
> if(rs.next())
>
> Or better yet...
>
> while(rs.next())
>
> John Turner
> [EMAIL PROTECTED]
>
> -Original Message

Re: DB2 and servlet ??? Help !!!

2002-08-01 Thread Nishant_Awasthi


Please don't look at the parameters
As I am not using parameter in my query...
Right now I am just trying to run a very simple query...
Parameter has been output just for testing if servlet is taking wirte
parameter vvalues or not...

Parameters are not being used anywhere in the whole servlet  code..
Thanks


Nishant Awasthi
Corporate Systems Development
Progressive Insurance







   
  
"Michael   
  
Locasto"   To: "Tomcat Users List" 
  
<[EMAIL PROTECTED]<[EMAIL PROTECTED]>
  
umbia.edu> cc: (bcc: Nishant Awasthi)  
  
       Subject: Re: DB2 and servlet ??? Help 
!!! 
08/01/2002 
  
02:16 PM   
  
Please respond 
  
to "Tomcat 
  
Users List"
  
   
  
   
  





Hi,

Your parameter is '012', while it appears that the employeenumbers in your
database are more like:

empno= 000150



 BROWSER OUTPUT
---
paramater passed is 012

Count is0
Found the JDBC driver

Driver is properly loaded and registered
Connection URL is good
Retrieve some data from the database...
Received results:

Count is0
God Please help




Regards,
Michael



- Original Message -
From: <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Thursday, August 01, 2002 2:10 PM
Subject: RE: DB2 and servlet ??? Help !!!


>
> I tried both ways
> while(rs.next())
> and
> if(!rs.next())
> both gives the same web browser output
> 
> 

>
> Nishant Awasthi
> Corporate Systems Development
> Progressive Insurance
>
>
>
>
>
>
>
>
> "Turner,
> John"To: 'Tomcat Users List'
>     
> com> cc: (bcc: Nishant Awasthi)
>  Subject: RE: DB2 and
servlet ??? Help !!!
> 08/01/2002
> 02:07 PM
> Please
> respond to
> "Tomcat Users
> List"
>
>
>
>
>
>
>
>
> Nice catch!  You are right.  It should be
>
> if(rs.next())
>
> Or better yet...
>
> while(rs.next())
>
> John Turner
> [EMAIL PROTECTED]
>
> -Original Message-
> From: Wagoner, Mark [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 01, 2002 2:02 PM
> To: 'Tomcat Users List'
> Subject: RE: DB2 and servlet ??? Help !!!
>
>
> I think you are attempting to output the value if there is nothing in
the
> result set.
>
> > if(!rs.next())
>
> The .next() method will return true if it was able to fetch a row.  You
are
> saying, "if there is no row then..."
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 01, 2002 1:57 PM
> To: Tomcat Users List
> Subject: RE: DB2 and servlet ??? Help !!!
>
>
>
> Hello John
>
> "firstnme" is the correct column name...
> What bugs me is if you see my servlet code which I am again attaching...
> I try to put try and ctach every where possible so that
> I can at least printStackTrace() .
> But to my surprise...I am not getting any exception...or stack trace...
> instead I am getting simple HTML output ...
> I am attaching what
> 1. I see in browser
> 2. servlet code
>
>  BROWSER OUTPUT
> ---
> paramater passed is 012
>
>
> Count is0
> Found the JDBC driver
>
> Driver is properly loaded and registered
> Connection URL is good
> Retrieve some data from the database...
> Received results:
>
> Count is0
> God Please help

Re: DB2 and servlet ??? Help !!!

2002-08-01 Thread Michael Locasto

...and I'm an idiot, because the SQL statement doesn't filter by them, so
it's quite inconsequential, really. :)

rs = stmt.executeQuery("SELECT empno from db2admin.employee");

Michael


- Original Message -
From: "Michael Locasto" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Thursday, August 01, 2002 2:16 PM
Subject: Re: DB2 and servlet ??? Help !!!


> Hi,
>
> Your parameter is '012', while it appears that the employeenumbers in
your
> database are more like:
>
> empno= 000150
>
>
> 
>  BROWSER OUTPUT
> ---
> paramater passed is 012
>
> Count is0
> Found the JDBC driver
>
> Driver is properly loaded and registered
> Connection URL is good
> Retrieve some data from the database...
> Received results:
>
> Count is0
> God Please help
>
> 
>
>
> Regards,
> Michael
>
>
>
> ----- Original Message -
> From: <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>
> Sent: Thursday, August 01, 2002 2:10 PM
> Subject: RE: DB2 and servlet ??? Help !!!
>
>
> >
> > I tried both ways
> > while(rs.next())
> > and
> > if(!rs.next())
> > both gives the same web browser output
> > 
>
> 
> 
> >
> > Nishant Awasthi
> > Corporate Systems Development
> > Progressive Insurance
> >
> >
> >
> >
> >
> >
> >
> >
> > "Turner,
> > John"To: 'Tomcat Users List'
> >  <[EMAIL PROTECTED]>
> > com> cc: (bcc: Nishant
Awasthi)
> >  Subject: RE: DB2 and
> servlet ??? Help !!!
> > 08/01/2002
> > 02:07 PM
> > Please
> > respond to
> >     "Tomcat Users
> > List"
> >
> >
> >
> >
> >
> >
> >
> >
> > Nice catch!  You are right.  It should be
> >
> > if(rs.next())
> >
> > Or better yet...
> >
> > while(rs.next())
> >
> > John Turner
> > [EMAIL PROTECTED]
> >
> > -Original Message-
> > From: Wagoner, Mark [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, August 01, 2002 2:02 PM
> > To: 'Tomcat Users List'
> > Subject: RE: DB2 and servlet ??? Help !!!
> >
> >
> > I think you are attempting to output the value if there is nothing in
> the
> > result set.
> >
> > > if(!rs.next())
> >
> > The .next() method will return true if it was able to fetch a row.
You
> are
> > saying, "if there is no row then..."
> >
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, August 01, 2002 1:57 PM
> > To: Tomcat Users List
> > Subject: RE: DB2 and servlet ??? Help !!!
> >
> >
> >
> > Hello John
> >
> > "firstnme" is the correct column name...
> > What bugs me is if you see my servlet code which I am again
attaching...
> > I try to put try and ctach every where possible so that
> > I can at least printStackTrace() .
> > But to my surprise...I am not getting any exception...or stack
trace...
> > instead I am getting simple HTML output ...
> > I am attaching what
> > 1. I see in browser
> > 2. servlet code
> >
> >  BROWSER OUTPUT
> > ---
> > paramater passed is 012
> >
> >
> > Count is0
> > Found the JDBC driver
> >
> > Driver is properly loaded and registered
> > Connection URL is good
> > Retrieve some data from the database...
> > Received results:
> >
> > Count is0
> > God Please help
> >
> > --SERVLET CODE-
> > import java.sql.*;
> > import java.lang.*;
> > import java.io.*;
> > import java.io.*;
> > import javax.servlet.*;
> > import javax.servlet.http.*;
> >
> >
> > public class Ndb2Websphere extends HttpServlet {
> >
> >   Statement stmt;
> > ResultSet rs;
> >int count =0;
> >
> > public void doGet (HttpServletRequest req, HttpServletResponse
res)
> &g

RE: DB2 and servlet ??? Help !!!

2002-08-01 Thread Durham David Cntr 805CSS/SCBE

brings nothing??  There is no SQLException, or nullpointer or something like that??  

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 01, 2002 1:08 PM
> To: Tomcat Users List
> Subject: RE: DB2 and servlet ??? Help !!!
> 
> 
> 
> Hello Mark,
> 
> Believe me there are rows in the table when I run the simple JAVA-DB2
> file it retrieve
> Received results:
>  empno= 000150 firstname= BRUCE
>  empno= 10 firstname= CHRISTINE
>  empno= 000250 firstname= DANIEL
>  empno= 000200 firstname= DAVID
>  empno= 000130 firstname= DOLORES
>  empno= 90 firstname= EILEEN
>  empno= 000160 firstname= ELIZABETH
>  empno= 000280 firstname= ETHEL
>  empno= 70 firstname= EVA
>  empno= 000140 firstname= HEATHER
>  empno= 60 firstname= IRVING
>  empno= 000190 firstname= JAMES
>  empno= 000230 firstname= JAMES
>  empno= 000340 firstname= JASON
>  empno= 000220 firstname= JENNIFER
>  empno= 50 firstname= JOHN
>  empno= 000290 firstname= JOHN
>  empno= 000270 firstname= MARIA
>  empno= 000180 firstname= MARILYN
>  empno= 000170 firstname= MASATOSHI
>  empno= 000310 firstname= MAUDE
>  empno= 20 firstname= MICHAEL
>  empno= 000300 firstname= PHILIP
>  empno= 000320 firstname= RAMLAL
>  empno= 30 firstname= SALLY
>  empno= 000240 firstname= SALVATORE
>  empno= 000120 firstname= SEAN
>  empno= 000260 firstname= SYBIL
>  empno= 000100 firstname= THEODORE
>  empno= 000110 firstname= VINCENZO
>  empno= 000210 firstname= WILLIAM
>  empno= 000330 firstname= WING
> 
> But When I write the same thing in a servlet it brings nothing...
> Is there a problem with Connection URL or Connection String...
> well I am using the same things in my simple java file
> 
> Thanks
> --
> --
> 
> Nishant Awasthi
> 
> 
> 
> 
> 
> 
>   
> 
> "Wagoner, Mark"   
> 
>  Users List'   
> avors.com>      
> <[EMAIL PROTECTED]>  
> cc: (bcc: 
> Nishant Awasthi)
> 08/01/2002 02:02Subject: RE: 
> DB2 and servlet ??? Help !!! 
> PM
> 
> Please respond
> 
> to "Tomcat Users  
> 
> List" 
> 
>   
> 
>   
> 
> 
> 
> 
> 
> 
> I think you are attempting to output the value if there is 
> nothing in the
> result set.
> 
> > if(!rs.next())
> 
> The .next() method will return true if it was able to fetch a 
> row.  You are
> saying, "if there is no row then..."
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 01, 2002 1:57 PM
> To: Tomcat Users List
> Subject: RE: DB2 and servlet ??? Help !!!
> 
> 
> 
> Hello John
> 
> "firstnme" is the correct column name...
> What bugs me is if you see my servlet code which I am again 
> attaching...
> I try to put try and ctach every where possible so that
> I can at least printStackTrace() .
> But to my surprise...I am not getting any exception...or 
> stack trace...
> instead I am getting simple HTML output ...
> I am attaching what
> 1. I see in browser
> 2. servlet code
> 
>  BROWSER OUTPUT
> ---
> paramater passed is 012
> 
> 
> Count is0
> Found the JDBC driver
> 
> Driver is properly loaded and registered
> Connection URL is good
> Retrieve some data from the database...
> Received results:
> 
> Count is0
> God Please help
> 
> --SERVLET CODE-
> import java.sql.*;
> import java.lang.*;
> import java.io.*;
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> 
> 
> public class Ndb2Websphere extends HttpServlet {
> 
>   Statement stmt;
> Re

Re: DB2 and servlet ??? Help !!!

2002-08-01 Thread Michael Locasto

Hi,

Your parameter is '012', while it appears that the employeenumbers in your
database are more like:

empno= 000150



 BROWSER OUTPUT
---
paramater passed is 012

Count is0
Found the JDBC driver

Driver is properly loaded and registered
Connection URL is good
Retrieve some data from the database...
Received results:

Count is0
God Please help




Regards,
Michael



- Original Message -
From: <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Thursday, August 01, 2002 2:10 PM
Subject: RE: DB2 and servlet ??? Help !!!


>
> I tried both ways
> while(rs.next())
> and
> if(!rs.next())
> both gives the same web browser output
> 
> 

>
> Nishant Awasthi
> Corporate Systems Development
> Progressive Insurance
>
>
>
>
>
>
>
>
> "Turner,
> John"To: 'Tomcat Users List'
> 
> com> cc: (bcc: Nishant Awasthi)
>  Subject: RE: DB2 and
servlet ??? Help !!!
> 08/01/2002
> 02:07 PM
> Please
> respond to
> "Tomcat Users
> List"
>
>
>
>
>
>
>
>
> Nice catch!  You are right.  It should be
>
> if(rs.next())
>
> Or better yet...
>
> while(rs.next())
>
> John Turner
> [EMAIL PROTECTED]
>
> -Original Message-
> From: Wagoner, Mark [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 01, 2002 2:02 PM
> To: 'Tomcat Users List'
> Subject: RE: DB2 and servlet ??? Help !!!
>
>
> I think you are attempting to output the value if there is nothing in
the
> result set.
>
> > if(!rs.next())
>
> The .next() method will return true if it was able to fetch a row.  You
are
> saying, "if there is no row then..."
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 01, 2002 1:57 PM
> To: Tomcat Users List
> Subject: RE: DB2 and servlet ??? Help !!!
>
>
>
> Hello John
>
> "firstnme" is the correct column name...
> What bugs me is if you see my servlet code which I am again attaching...
> I try to put try and ctach every where possible so that
> I can at least printStackTrace() .
> But to my surprise...I am not getting any exception...or stack trace...
> instead I am getting simple HTML output ...
> I am attaching what
> 1. I see in browser
> 2. servlet code
>
>  BROWSER OUTPUT
> ---
> paramater passed is 012
>
>
> Count is0
> Found the JDBC driver
>
> Driver is properly loaded and registered
> Connection URL is good
> Retrieve some data from the database...
> Received results:
>
> Count is0
> God Please help
>
> --SERVLET CODE-
> import java.sql.*;
> import java.lang.*;
> import java.io.*;
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
>
>
> public class Ndb2Websphere extends HttpServlet {
>
>   Statement stmt;
> ResultSet rs;
>int count =0;
>
> public void doGet (HttpServletRequest req, HttpServletResponse res)
>  throws ServletException, IOException
> {
>
>
>   res.setContentType("text/html");
>
>  ServletOutputStream out = res.getOutputStream();
>
>  String emp = req.getParameter("empnumber");
>  out.println("paramater passed is "+emp +" ");
>   out.println("Count is"+ count);
>  try{
>   Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");
>out.println("Found the JDBC driver ");
>  }
>  catch( Exception e)
>  {
>   //e.printStackTrace();
> out.println("\nDriver class not found
> exception");
>  }
>  finally
>   {
>out.println("Driver is properly loaded
and
> registered ");
>   }
>
>try{
> Connection con = null;
>
>
>String url;
>
>out.println("Connection URL is  good");
>
>
>   

Re: DB2 and servlet ??? Help !!!

2002-08-01 Thread Michael Locasto

Hi,

Assuming this is the SQL you want to submit:

>
> try{
> stmt = con.createStatement();
> rs = stmt.executeQuery("SELECT empno
from
> db2admin.employee");

shouldn't it be

if( rs.next() ){

do{
  count++;
  out.println( " empno is "+rs.getString( 1 ) );

}while( rs.next() );

}

or something along those lines? (rather than the !rs.next() )

>
>  try{
>  if(!rs.next())
>{
>count = count +1;
>  String a = rs.getString(1);
>
>out.println(" empno is " + a );
> out.println("While Count is"+ count);
>}




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: DB2 and servlet ??? Help !!!

2002-08-01 Thread Nishant_Awasthi


I tried both ways
while(rs.next())
and
if(!rs.next())
both gives the same web browser output



Nishant Awasthi
Corporate Systems Development
Progressive Insurance







   

"Turner,   

John"To: 'Tomcat Users List'   

  

com> cc: (bcc: Nishant Awasthi)

 Subject: RE: DB2 and servlet ??? Help !!! 

08/01/2002 

02:07 PM   

Please 

respond to 

"Tomcat Users  

List"  

   

   







Nice catch!  You are right.  It should be

if(rs.next())

Or better yet...

while(rs.next())

John Turner
[EMAIL PROTECTED]

-Original Message-
From: Wagoner, Mark [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 2:02 PM
To: 'Tomcat Users List'
Subject: RE: DB2 and servlet ??? Help !!!


I think you are attempting to output the value if there is nothing in the
result set.

> if(!rs.next())

The .next() method will return true if it was able to fetch a row.  You are
saying, "if there is no row then..."

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 1:57 PM
To: Tomcat Users List
Subject: RE: DB2 and servlet ??? Help !!!



Hello John

"firstnme" is the correct column name...
What bugs me is if you see my servlet code which I am again attaching...
I try to put try and ctach every where possible so that
I can at least printStackTrace() .
But to my surprise...I am not getting any exception...or stack trace...
instead I am getting simple HTML output ...
I am attaching what
1. I see in browser
2. servlet code

 BROWSER OUTPUT
---
paramater passed is 012


Count is0
Found the JDBC driver

Driver is properly loaded and registered
Connection URL is good
Retrieve some data from the database...
Received results:

Count is0
God Please help

--SERVLET CODE-
import java.sql.*;
import java.lang.*;
import java.io.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;


public class Ndb2Websphere extends HttpServlet {

  Statement stmt;
ResultSet rs;
   int count =0;

public void doGet (HttpServletRequest req, HttpServletResponse res)
 throws ServletException, IOException
{


  res.setContentType("text/html");

 ServletOutputStream out = res.getOutputStream();

 String emp = req.getParameter("empnumber");
 out.println("paramater passed is "+emp +" ");
  out.println("Count is"+ count);
 try{
  Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");
   out.println("Found the JDBC driver ");
 }
 catch( Exception e)
 {
  //e.printStackTrace();
out.println("\nDriver class not found
exception");
 }
 finally
  {
   out.println("Driver is properly loaded and
registered ");
  }

   try{
Connection con = null;


   String url;

   out.println("Connection URL is  good");


try{
   con = DriverManager.getConnection
("jdbc:db2://10.3.13.34/SAMPLE","db2admin","db2pwd");
}
catch( Exception e4)
{
   e4.getMessage();
e4.printStackTrace();
}


  // retrieve data from the database

   out.println("Retrieve some data from the
database...");


RE: DB2 and servlet ??? Help !!!

2002-08-01 Thread Nishant_Awasthi


Hello Mark,

Believe me there are rows in the table when I run the simple JAVA-DB2
file it retrieve
Received results:
 empno= 000150 firstname= BRUCE
 empno= 10 firstname= CHRISTINE
 empno= 000250 firstname= DANIEL
 empno= 000200 firstname= DAVID
 empno= 000130 firstname= DOLORES
 empno= 90 firstname= EILEEN
 empno= 000160 firstname= ELIZABETH
 empno= 000280 firstname= ETHEL
 empno= 70 firstname= EVA
 empno= 000140 firstname= HEATHER
 empno= 60 firstname= IRVING
 empno= 000190 firstname= JAMES
 empno= 000230 firstname= JAMES
 empno= 000340 firstname= JASON
 empno= 000220 firstname= JENNIFER
 empno= 50 firstname= JOHN
 empno= 000290 firstname= JOHN
 empno= 000270 firstname= MARIA
 empno= 000180 firstname= MARILYN
 empno= 000170 firstname= MASATOSHI
 empno= 000310 firstname= MAUDE
 empno= 20 firstname= MICHAEL
 empno= 000300 firstname= PHILIP
 empno= 000320 firstname= RAMLAL
 empno= 30 firstname= SALLY
 empno= 000240 firstname= SALVATORE
 empno= 000120 firstname= SEAN
 empno= 000260 firstname= SYBIL
 empno= 000100 firstname= THEODORE
 empno= 000110 firstname= VINCENZO
 empno= 000210 firstname= WILLIAM
 empno= 000330 firstname= WING

But When I write the same thing in a servlet it brings nothing...
Is there a problem with Connection URL or Connection String...
well I am using the same things in my simple java file

Thanks


Nishant Awasthi






   
   
"Wagoner, Mark"
   
  <[EMAIL PROTECTED]>   
   
cc: (bcc: Nishant Awasthi) 
   
08/01/2002 02:02Subject: RE: DB2 and servlet ??? Help 
!!! 
PM 
   
Please respond 
   
to "Tomcat Users   
   
List"  
   
   
   
   
   





I think you are attempting to output the value if there is nothing in the
result set.

> if(!rs.next())

The .next() method will return true if it was able to fetch a row.  You are
saying, "if there is no row then..."

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 1:57 PM
To: Tomcat Users List
Subject: RE: DB2 and servlet ??? Help !!!



Hello John

"firstnme" is the correct column name...
What bugs me is if you see my servlet code which I am again attaching...
I try to put try and ctach every where possible so that
I can at least printStackTrace() .
But to my surprise...I am not getting any exception...or stack trace...
instead I am getting simple HTML output ...
I am attaching what
1. I see in browser
2. servlet code

 BROWSER OUTPUT
---
paramater passed is 012


Count is0
Found the JDBC driver

Driver is properly loaded and registered
Connection URL is good
Retrieve some data from the database...
Received results:

Count is0
God Please help

--SERVLET CODE-
import java.sql.*;
import java.lang.*;
import java.io.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;


public class Ndb2Websphere extends HttpServlet {

  Statement stmt;
ResultSet rs;
   int count =0;

public void doGet (HttpServletRequest req, HttpServletResponse res)
 throws ServletException, IOException
{


  res.setContentType("text/html");

 ServletOutputStream out = res.getOutputStream();

 String emp = req.getParameter("empnumber");
 out.println("paramater passed is "+emp +" ");
  out.println("Count is"+ count);
 try{
  Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");
   out.println("Found the JDBC driver ");
 }
 catch( Exception e)
 {
  //e.printStackTrace();
out.println("\nDriver class not found
exception");
 }
 finally
  {
   out.println("Driver is properly loaded and
registered ");
  }

   try{
Connection con = null;


 

RE: DB2 and servlet ??? Help !!!

2002-08-01 Thread Turner, John


Nice catch!  You are right.  It should be

if(rs.next())

Or better yet...

while(rs.next())

John Turner
[EMAIL PROTECTED]

-Original Message-
From: Wagoner, Mark [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 2:02 PM
To: 'Tomcat Users List'
Subject: RE: DB2 and servlet ??? Help !!!


I think you are attempting to output the value if there is nothing in the
result set.

> if(!rs.next())

The .next() method will return true if it was able to fetch a row.  You are
saying, "if there is no row then..."

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 1:57 PM
To: Tomcat Users List
Subject: RE: DB2 and servlet ??? Help !!!



Hello John

"firstnme" is the correct column name...
What bugs me is if you see my servlet code which I am again attaching...
I try to put try and ctach every where possible so that
I can at least printStackTrace() .
But to my surprise...I am not getting any exception...or stack trace...
instead I am getting simple HTML output ...
I am attaching what
1. I see in browser
2. servlet code

 BROWSER OUTPUT
---
paramater passed is 012


Count is0
Found the JDBC driver

Driver is properly loaded and registered
Connection URL is good
Retrieve some data from the database...
Received results:

Count is0
God Please help

--SERVLET CODE-
import java.sql.*;
import java.lang.*;
import java.io.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;


public class Ndb2Websphere extends HttpServlet {

  Statement stmt;
ResultSet rs;
   int count =0;

public void doGet (HttpServletRequest req, HttpServletResponse res)
 throws ServletException, IOException
{


  res.setContentType("text/html");

 ServletOutputStream out = res.getOutputStream();

 String emp = req.getParameter("empnumber");
 out.println("paramater passed is "+emp +" ");
  out.println("Count is"+ count);
 try{
  Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");
   out.println("Found the JDBC driver ");
 }
 catch( Exception e)
 {
  //e.printStackTrace();
out.println("\nDriver class not found
exception");
 }
 finally
  {
   out.println("Driver is properly loaded and
registered ");
  }

   try{
Connection con = null;


   String url;

   out.println("Connection URL is  good");


try{
   con = DriverManager.getConnection
("jdbc:db2://10.3.13.34/SAMPLE","db2admin","db2pwd");
}
catch( Exception e4)
{
   e4.getMessage();
e4.printStackTrace();
}


  // retrieve data from the database

   out.println("Retrieve some data from the
database...");

try{
stmt = con.createStatement();
rs = stmt.executeQuery("SELECT empno from
db2admin.employee");
  }
 catch( Exception e5)
 {
   e5.getMessage();
e5.printStackTrace();
 }

   out.println("Received results:");

 try{
 if(!rs.next())
   {
   count = count +1;
 String a = rs.getString(1);

   out.println(" empno is " + a );
out.println("While Count is"+ count);
   }
   }
   catch( Exception e6)
   {
   e6.printStackTrace();
   }
   out.println("Count is"+ count);

   rs.close();
   stmt.close();
con.close();

}
catch (SQLException e1)
{
   e1.getMessage();
   e1.printStackTrace();
}
catch( Exception e)
{
   e.getMessage();
   e.printStackTrace();
}
finally
{

RE: DB2 and servlet ??? Help !!!

2002-08-01 Thread Wagoner, Mark

I think you are attempting to output the value if there is nothing in the
result set.

> if(!rs.next())

The .next() method will return true if it was able to fetch a row.  You are
saying, "if there is no row then..."

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 1:57 PM
To: Tomcat Users List
Subject: RE: DB2 and servlet ??? Help !!!



Hello John

"firstnme" is the correct column name...
What bugs me is if you see my servlet code which I am again attaching...
I try to put try and ctach every where possible so that
I can at least printStackTrace() .
But to my surprise...I am not getting any exception...or stack trace...
instead I am getting simple HTML output ...
I am attaching what
1. I see in browser
2. servlet code

 BROWSER OUTPUT
---
paramater passed is 012


Count is0
Found the JDBC driver

Driver is properly loaded and registered
Connection URL is good
Retrieve some data from the database...
Received results:

Count is0
God Please help

--SERVLET CODE-
import java.sql.*;
import java.lang.*;
import java.io.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;


public class Ndb2Websphere extends HttpServlet {

  Statement stmt;
ResultSet rs;
   int count =0;

public void doGet (HttpServletRequest req, HttpServletResponse res)
 throws ServletException, IOException
{


  res.setContentType("text/html");

 ServletOutputStream out = res.getOutputStream();

 String emp = req.getParameter("empnumber");
 out.println("paramater passed is "+emp +" ");
  out.println("Count is"+ count);
 try{
  Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");
   out.println("Found the JDBC driver ");
 }
 catch( Exception e)
 {
  //e.printStackTrace();
out.println("\nDriver class not found
exception");
 }
 finally
  {
   out.println("Driver is properly loaded and
registered ");
  }

   try{
Connection con = null;


   String url;

   out.println("Connection URL is  good");


try{
   con = DriverManager.getConnection
("jdbc:db2://10.3.13.34/SAMPLE","db2admin","db2pwd");
}
catch( Exception e4)
{
   e4.getMessage();
e4.printStackTrace();
}


  // retrieve data from the database

   out.println("Retrieve some data from the
database...");

try{
stmt = con.createStatement();
rs = stmt.executeQuery("SELECT empno from
db2admin.employee");
  }
 catch( Exception e5)
 {
   e5.getMessage();
e5.printStackTrace();
 }

   out.println("Received results:");

 try{
 if(!rs.next())
   {
   count = count +1;
 String a = rs.getString(1);

   out.println(" empno is " + a );
out.println("While Count is"+ count);
   }
   }
   catch( Exception e6)
   {
   e6.printStackTrace();
   }
   out.println("Count is"+ count);

   rs.close();
   stmt.close();
con.close();

}
catch (SQLException e1)
{
   e1.getMessage();
   e1.printStackTrace();
}
catch( Exception e)
{
   e.getMessage();
   e.printStackTrace();
}
finally
{
out.println("God Please help");
}
  }
public void doPost (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
doGet(req,res);
}


}


RE: DB2 and servlet ??? Help !!!

2002-08-01 Thread Nishant_Awasthi


Hello John

"firstnme" is the correct column name...
What bugs me is if you see my servlet code which I am again attaching...
I try to put try and ctach every where possible so that
I can at least printStackTrace() .
But to my surprise...I am not getting any exception...or stack trace...
instead I am getting simple HTML output ...
I am attaching what
1. I see in browser
2. servlet code

 BROWSER OUTPUT
---
paramater passed is 012


Count is0
Found the JDBC driver

Driver is properly loaded and registered
Connection URL is good
Retrieve some data from the database...
Received results:

Count is0
God Please help

--SERVLET CODE-
import java.sql.*;
import java.lang.*;
import java.io.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;


public class Ndb2Websphere extends HttpServlet {

  Statement stmt;
ResultSet rs;
   int count =0;

public void doGet (HttpServletRequest req, HttpServletResponse res)
 throws ServletException, IOException
{


  res.setContentType("text/html");

 ServletOutputStream out = res.getOutputStream();

 String emp = req.getParameter("empnumber");
 out.println("paramater passed is "+emp +" ");
  out.println("Count is"+ count);
 try{
  Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");
   out.println("Found the JDBC driver ");
 }
 catch( Exception e)
 {
  //e.printStackTrace();
out.println("\nDriver class not found
exception");
 }
 finally
  {
   out.println("Driver is properly loaded and
registered ");
  }

   try{
Connection con = null;


   String url;

   out.println("Connection URL is  good");


try{
   con = DriverManager.getConnection
("jdbc:db2://10.3.13.34/SAMPLE","db2admin","db2pwd");
}
catch( Exception e4)
{
   e4.getMessage();
e4.printStackTrace();
}


  // retrieve data from the database

   out.println("Retrieve some data from the
database...");

try{
stmt = con.createStatement();
rs = stmt.executeQuery("SELECT empno from
db2admin.employee");
  }
 catch( Exception e5)
 {
   e5.getMessage();
e5.printStackTrace();
 }

   out.println("Received results:");

 try{
 if(!rs.next())
   {
   count = count +1;
 String a = rs.getString(1);

   out.println(" empno is " + a );
out.println("While Count is"+ count);
   }
   }
   catch( Exception e6)
   {
   e6.printStackTrace();
   }
   out.println("Count is"+ count);

   rs.close();
   stmt.close();
con.close();

}
catch (SQLException e1)
{
   e1.getMessage();
   e1.printStackTrace();
}
catch( Exception e)
{
   e.getMessage();
   e.printStackTrace();
}
finally
{
out.println("God Please help");
}
  }
public void doPost (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
doGet(req,res);
}


}


Nishant Awasthi






   

"Turner,   

John"To: 'Tomcat Users List'   

  

RE: DB2 and servlet ??? Help !!!

2002-08-01 Thread Turner, John


Is "firstnme" the name of your column?  Or should it be "firstname"?  If
that's an error, there should be a SQLException thrown, but I don't know the
behavior fo DB2...it may just be that you get null back.  In any case,
besides printing a stack trace, I would output something to the browser on a
SQLException just so you can see what's going on.

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 1:47 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: DB2 and servlet ??? Help !!!


Hello everyone...

I am trying to connect the run a simple servlet to retrieve the
query results from DB2 database.

1. Before writing a servlet, I wrote a simple java file and was successful
in retrieving the
contents from DB2 UDB.

2. Then I just converted the same JAVA file into servlet by adding Servlet
API and syntax in it.
3. It compiles fine.
4. Then from a web page I try to pass one parameter to my servlet.
5. The servlet doesnot retrieve any records from the database which
initially it was bringing
when I wrote simple java file.

Code of my servlet is as:
--
import java.sql.*;
import java.lang.*;
import java.io.*;

public class Ndb2Tomcat{

   public static void main(String args[]) {


  try{
 Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");
 }
 catch( ClassNotFoundException e2)
 {
  System.out.println("\nJDBC Driver class not found exception");
 }
 catch( Exception e)
 {
   System.out.println("\nDriver class not found exception");

}
try{
   Connection con = null;
  String url = "jdbc:db2://100.3.13.34/SAMPLE";
   con = DriverManager.getConnection(url,"db2admin", "db2pwd");

// retrieve data from the database
   System.out.println("Retrieve some data from the database...");

   Statement stmt = con.createStatement();
   ResultSet rs = stmt.executeQuery("SELECT * from db2admin.employee
order by firstnme");

   System.out.println("Received results:");

   while (rs.next())
   {
  String a = rs.getString(1);
  String str = rs.getString(2);
  System.out.print(" empno= " + a);
  System.out.print(" firstname= " + str);
  System.out.print("\n");
   }
   rs.close();
  stmt.close();
   con.close();
 }
 catch (SQLException e1)
 {
  e1.printStackTrace();
 }

   }




Nishant Awasthi





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

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




DB2 and servlet ??? Help !!!

2002-08-01 Thread Nishant_Awasthi

Hello everyone...

I am trying to connect the run a simple servlet to retrieve the
query results from DB2 database.

1. Before writing a servlet, I wrote a simple java file and was successful
in retrieving the
contents from DB2 UDB.

2. Then I just converted the same JAVA file into servlet by adding Servlet
API and syntax in it.
3. It compiles fine.
4. Then from a web page I try to pass one parameter to my servlet.
5. The servlet doesnot retrieve any records from the database which
initially it was bringing
when I wrote simple java file.

Code of my servlet is as:
--
import java.sql.*;
import java.lang.*;
import java.io.*;

public class Ndb2Tomcat{

   public static void main(String args[]) {


  try{
 Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");
 }
 catch( ClassNotFoundException e2)
 {
  System.out.println("\nJDBC Driver class not found exception");
 }
 catch( Exception e)
 {
   System.out.println("\nDriver class not found exception");

}
try{
   Connection con = null;
  String url = "jdbc:db2://100.3.13.34/SAMPLE";
   con = DriverManager.getConnection(url,"db2admin", "db2pwd");

// retrieve data from the database
   System.out.println("Retrieve some data from the database...");

   Statement stmt = con.createStatement();
   ResultSet rs = stmt.executeQuery("SELECT * from db2admin.employee
order by firstnme");

   System.out.println("Received results:");

   while (rs.next())
   {
  String a = rs.getString(1);
  String str = rs.getString(2);
  System.out.print(" empno= " + a);
  System.out.print(" firstname= " + str);
  System.out.print("\n");
   }
   rs.close();
  stmt.close();
   con.close();
 }
 catch (SQLException e1)
 {
  e1.printStackTrace();
 }

   }



Nishant Awasthi





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Servlet help...

2002-02-06 Thread Janek Bogucki

 --- Clay Mitchell <[EMAIL PROTECTED]> wrote: > How do I define where Tomcat looks for 
servlets? Where
does it look for
> it by default?
> 
> Thanks
> -Clay
> 

Have a look at this document

http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html

It should answer your question.

-Janek  

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe:   
For additional commands: 
Troubles with the list: 




Servlet help...

2002-02-05 Thread Clay Mitchell

How do I define where Tomcat looks for servlets? Where does it look for
it by default?

Thanks
-Clay


--
To unsubscribe:   
For additional commands: 
Troubles with the list: 




Re: Servlet help needed

2001-05-04 Thread Noel E. Lecaros

Hi, Ante

You actually don't need to edit anything in server.xml if your app uses
default settings.  Just drop your app's directory tree into the webapp
subdir and start Tomcat.  Which web.xml file did you make changes in
anyway?  You're not supposed to edit the web.xml in the conf subdir!

Hope this helps.

Regards,
Noel Lecaros

BTW, just a friendly reminder.  Please don't post in HTML.  Not everyone
on this list uses an HTML-enabled mail reader.



Ante Sabo wrote:

>  I cannot deploy my servlet application to run by Tomcat. I editet
> server.xml and web.xml files as described in documentation to set up
> my contextes, but all I got on my screen is Tomcat error
> message: Mapping context with unregisterred servlet   What this
> message is meaning to me. I beleive I made everything in script files
> needed to register my sevlet, and also registering context, and it
> won't work. Can you give me the link to a place where I can find some
> explanation what is needed to register servlet application.  Only way
> I can register it is to put it under /webapps/examples directory. That
> way I don't have even to register it - it works, but is that a real
> solution?  With many thanks, regards,Ante Sabo Zagreb
> UniversityFaculty of organization & informaticsVaraždin,
> Croatia http://www.foi.hr http://www.foi.hr/~asabo




Servlet help needed

2001-04-24 Thread Ante Sabo



 
I cannot deploy my servlet application to run by 
Tomcat. I editet server.xml and web.xml files as described in documentation to 
set up my contextes, but all I got on my screen is Tomcat error message:
 
Mapping context with unregisterred servlet 

 
 
What this message is meaning to me. I beleive I 
made everything in script files needed to register my sevlet, and also 
registering context, and it won't work. Can you give me the link to a place 
where I can find some explanation what is needed to register servlet 
application. 
 
 
Only way I can register it is to put it under 
/webapps/examples directory. That way I don't have even to register it - it 
works, but is that a real solution? 
 
 
With many thanks,
 
regards,
Ante Sabo
 
Zagreb University
Faculty of organization & 
informatics
Vara¾din, Croatia
 
http://www.foi.hr
 
http://www.foi.hr/~asabo


Compile problem with servlet - HELP

2001-03-30 Thread tomcat user

I'm trying to get Tomcat3.2.1 to successfully compile my JSP.

I have a base class called TrainingForm and I have a class called
TrainingFormDetail that extends TrainingForm. It's like it is complaining
about the base class. I read in the JSP1.1 spec that the type field is used
for . Note: I was able to successfully compile all
my java classes. Here is my JSP code (which is just a test for now):



<%@ page language="java" contentType="text/html" %>


<% trainingDetail.insertTrainingFormDetail(); %>



Test Bean


Name: 
Job Title: 
Date Of Employment: 
Staff Mgr: 
Location: 
Region: 



Here is the error stack track:

org.apache.jasper.JasperException: Unable to compile class for
JSPC:\OpenSource\tomcat321\work\localhost_8080%2FTrainingPlansRepository\_0002fjsp_0002fTrainingForm_0002ejspTrainingForm_jsp_0.java:66:
Class jsp.TrainingForm not found.
TrainingForm trainingDetail = null;

<>


__
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup