RE: Run Windows' command in Java method

2003-08-15 Thread Cui Xiaojing-a13339
Hello, 

Thanks so much for the help. Now I only want to execute a SQL Server's import/export 
utility in Java method. The utility could be executed using below command line in 
Windows Command prompt window:

C: BCP flex.dbo.CF_load in e:\Flex\file\inbound.txt /f e:\Flex\prog\bcp.fmt /S flex 
/U  /P 

Does the utility could be executed in Java method? If I could use below method to run 
it?

Runtime r=Runtime.getRuntime();
try{

r.exec(BCP  flex.dbo.CF_load in e:\Flex\file\inbound.txt /f 
e:\Flex\prog\bcp.fmt /S flex /U  /P );

}catch(IOException e){}

ThanksRegards,
Xiaojing


-Original Message-
From: engp0510 [mailto:[EMAIL PROTECTED]
Sent: 2003815 13:07
To: Tomcat Users List
Subject: Re: Run Windows' command in Java method


http://java.sun.com/docs/books/tutorial/native1.1/

- Original Message - 
From: Cui Xiaojing-a13339 [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Friday, August 15, 2003 11:41 AM
Subject: Run Windows' command in Java method


 Hello All,

 Do you know if windows' command could be executed in Java method? If yes,
which API class method can be used to do it? Thanks a lot.

 Regards,
 Xiaojing


 -
 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: Run Windows' command in Java method

2003-08-15 Thread Kwok Peng Tuck
Beware of the pitfalls that can come from using Runtime.exec()

Have a look at this article first :
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html



Cui Xiaojing-a13339 wrote:

Hello, 

Thanks so much for the help. Now I only want to execute a SQL Server's import/export 
utility in Java method. The utility could be executed using below command line in 
Windows Command prompt window:

C: BCP flex.dbo.CF_load in e:\Flex\file\inbound.txt /f e:\Flex\prog\bcp.fmt /S flex 
/U  /P 

Does the utility could be executed in Java method? If I could use below method to run 
it?

   Runtime r=Runtime.getRuntime();
   try{
   
   r.exec(BCP  flex.dbo.CF_load in e:\Flex\file\inbound.txt /f 
 e:\Flex\prog\bcp.fmt /S flex /U  /P );
   
   }catch(IOException e){}

ThanksRegards,
Xiaojing


-Original Message-
From: engp0510 [mailto:[EMAIL PROTECTED]
Sent: 2003815 13:07
To: Tomcat Users List
Subject: Re: Run Windows' command in Java method


http://java.sun.com/docs/books/tutorial/native1.1/

- Original Message - 
From: Cui Xiaojing-a13339 [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Friday, August 15, 2003 11:41 AM
Subject: Run Windows' command in Java method


  

Hello All,

Do you know if windows' command could be executed in Java method? If yes,


which API class method can be used to do it? Thanks a lot.
  

Regards,
Xiaojing


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



Attaching File Monitor Thread to Tomcat

2003-08-15 Thread Tyn T. Ong
Hi all,

I'm trying to develop a Thread (I call it Monitor) which monitors a folder 
for FTP uploaded files (arbitrary upload interval) and parse them to DBMS.
I would like to start and stop that Monitor Thread with tomcat so I loaded 
from a (load-on-startup) servlet. It loads OK and works fine but when 
Tomcat shuts down, it doesn't wait for my Thread to cleanup.

I tried in Servlet destroy method...
Monitor.stopNow(); // my thread polite stop method
while(Monitor.isAlive()); // wait until thread's while loop exists
in servlet destroy method but tomcat forcefully unload before 
Monitor thread can clean up.

I also tried overriding  finalize()  method but it was never called :-(

Any ideas??

Thanx,
Tyn
PS: It would be great if tomcat has standard API to attach/control other 
Java Server/Daemon process. If developers reading this, please consider my 
request.



Vedr.: RE: Fetching protected URL in Tomcat

2003-08-15 Thread pste

Hi

Im not involeved with Tomcat as a developer. Cant any of you developers
make the patch. Let me know ;-)

Steff



I believe the j_target_url was a proprietary add-on attribute WebLogic
added, not part of the servlet spec, and that there's no equivalent in
tomcat at this time.  I could be wrong, however ;)  Even if I'm right,
adding this attribute wouldn't be a big deal I imagine: want to
contribute a patch? ;)

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



Vedr.: RE: Fetching protected URL in Tomcat

2003-08-15 Thread pste

Does any know a good workaround.

I was thinking af putting af non-protected JSP in front of my protected
JSP, that just saves the needed info in session scope, before forwarding to
the protected JSP.

It is just not that good an idea, when you have such a complicated
structure of protected JSPs is I have.

Any better workarounds?

Thanx



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



Re: Vedr.: RE: Fetching protected URL in Tomcat

2003-08-15 Thread Bill Barker
Of course I could make a patch for this (it's really easy to do :).  However
I won't, since I consider getting a patch submission to indicate that the
feature is actually important enough to someone that they would take the
time to figure out how to do it.  If it's not that important to them, then
is certainly isn't that important to me ;-).

[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 Hi

 Im not involeved with Tomcat as a developer. Cant any of you developers
 make the patch. Let me know ;-)

 Steff



 I believe the j_target_url was a proprietary add-on attribute WebLogic
 added, not part of the servlet spec, and that there's no equivalent in
 tomcat at this time.  I could be wrong, however ;)  Even if I'm right,
 adding this attribute wouldn't be a big deal I imagine: want to
 contribute a patch? ;)

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



Scoreboard slot (jkstatus)

2003-08-15 Thread Venkata Srinivasa Rao, Yerra
Any one know about scoreboard and slots?

When the tomcatapache is up for long time, number of slots are getting 
increased, when I restart the apache, jk start creating again.
What does a slot mean? why the number is growing?

In fact I am testing my new development server with JMeter (3x25 threads = 
75 threads) since yesterday

Software configuration :
Red Hat Linux release 9 (Kernel 2.4.20-8smp)
J2SDK1.4.2
Tomcat-4.1.24
mod_jk2 (source 2.0.2)
Apache 2.0.47
Openssl-0.9.7a-2
Here is part of my jkstatus:

Status information for child -2

ajp13 runtime info

ajp13 information, using getAttribute()
id name lb_factor lb_value route errorState graceful epCount errorTime
1 192.168.1.211:8021 1 18 tomcat1 N N 1 0
Scoreboard info (ver=0 slots=73)

jkstatus?scoreboard.htmreset
epStat.2 Cnt=1 size=128
Worker Req Err LastReq ConnectionTime TotalTime MaxTime AvgTime ReqStart 
+jk +end
1 8 0 /moto/en/album3/albumlist.osp Thu Aug 14 17:04:14 2003 5975349 
2725698 746918 3522312557 415 2725698
epStat.5 Cnt=1 size=128
Worker Req Err LastReq ConnectionTime TotalTime MaxTime AvgTime ReqStart 
+jk +end
1 23 0 /moto/en/album3/albumlist.osp Thu Aug 14 17:55:26 2003 15181550 
2115484 660067 2299690280 414 1345589
epStat.11 Cnt=1 size=128
Worker Req Err LastReq ConnectionTime TotalTime MaxTime AvgTime ReqStart 
+jk +end
1 100 0 /moto/en/album3/login.osp Fri Aug 15 09:18:49 2003 10798878 517004 
107988 1867616621 358 61706




Re: Run Windows' command in Java method

2003-08-15 Thread Johan Krisar
Xiaojing,

The API you're looking for is java.lang.Runtime. However, my personal 
advice would be to use OS-dependent calls sparingly - it makes your 
application platform dependent and typically makes it a lot less portable...

Cheers,

- Johan

---
  Johan Krisar
  johan.krisar(at)depicta.com
-

At 11:41 2003-08-15 +0800, Cui Xiaojing-a13339 wrote:
Hello All,

Do you know if windows' command could be executed in Java method? If yes, 
which API class method can be used to do it? Thanks a lot.

Regards,
Xiaojing


RE: Run Windows' command in Java method

2003-08-15 Thread Cui Xiaojing-a13339
Got it. Thank you so much!!

Regards,


-Original Message-
From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED]
Sent: 2003815 14:42
To: Tomcat Users List
Subject: Re: Run Windows' command in Java method


Beware of the pitfalls that can come from using Runtime.exec()

Have a look at this article first :
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html



Cui Xiaojing-a13339 wrote:

Hello, 

Thanks so much for the help. Now I only want to execute a SQL Server's import/export 
utility in Java method. The utility could be executed using below command line in 
Windows Command prompt window:

C: BCP flex.dbo.CF_load in e:\Flex\file\inbound.txt /f e:\Flex\prog\bcp.fmt /S flex 
/U  /P 

Does the utility could be executed in Java method? If I could use below method to run 
it?

   Runtime r=Runtime.getRuntime();
   try{
   
   r.exec(BCP  flex.dbo.CF_load in e:\Flex\file\inbound.txt /f 
 e:\Flex\prog\bcp.fmt /S flex /U  /P );
   
   }catch(IOException e){}

ThanksRegards,
Xiaojing


-Original Message-
From: engp0510 [mailto:[EMAIL PROTECTED]
Sent: 2003815 13:07
To: Tomcat Users List
Subject: Re: Run Windows' command in Java method


http://java.sun.com/docs/books/tutorial/native1.1/

- Original Message - 
From: Cui Xiaojing-a13339 [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Friday, August 15, 2003 11:41 AM
Subject: Run Windows' command in Java method


  

Hello All,

Do you know if windows' command could be executed in Java method? If yes,


which API class method can be used to do it? Thanks a lot.
  

Regards,
Xiaojing


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

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



RE: Getting mod_jk2 to run with Tomcat 4.1.27 and Apache 2.0.47

2003-08-15 Thread Stuart Stephen
Hi all,

For your reference, I have now found out what the problem was.

I checked out more information about what the apxs is and found out that its
effectively a compiler of some sort. So I went to my $APACHEHOME/bin/
directory and ran it 'apxs'.

I got the message:

Can't exec /usr/bin/apr-config: No such file or directory at
/usr/sbin/apxs line 87.
Use of uninitialised value in scalar chomp at /usr/sbin/apxs line 92.

.. the rest of the help ..

So, I did a 'find / -name apr-config' and located it in my $APACHEHOME/bin/
directory, copied it from there to /usr/bin/ using 'cp
/usr/local/apache2/bin/apr-config /usr/bin/'

Then I went back to the compile process, ran that. This all went swimmingly
as usual. Then I ran 'libtool --finish /usr/local/apache2/modules/' and the
files appeared in the correct place.

I can only assume that something I installed, did not install properly?

Thanks for the help everyone. I hope this comes of use to someone else too.

Stuart

-Original Message-
From: Stuart Stephen [mailto:[EMAIL PROTECTED]
Sent: 14 August 2003 13:38
To: Tomcat Users List
Subject: RE: Getting mod_jk2 to run with Tomcat 4.1.27 and Apache 2.0.47


I did exactly that, and there's still no .so

-Original Message-
From: Richard Park [mailto:[EMAIL PROTECTED]
Sent: 14 August 2003 13:29
To: Tomcat Users List
Subject: Re: Getting mod_jk2 to run with Tomcat 4.1.27 and Apache 2.0.47


Stuart, just to be sure I downloaded the version of jk2 that you have and
tried building it myself, and everything went smoothly. If your willing,
here's exactly what I did:

# cd /usr/local/src
# wget
http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk2/release/v2.0.
2/src/jakarta-tomcat-connectors-jk2-2.0.2-src.tar.gz

# gunzip -dc jakarta-tomcat-connectors-jk2-2.0.2-src.tar.gz | tar xf -
# cd jakarta-tomcat-connectors-jk2-2.0.2-src/jk/native2

# ./configure --with-apxs2=/usr/local/apache2/bin/apxs
# make

# cd ../build/jk2/apache2
# ls -la

and the mod_jk2.so file was there ... if it continues to fail for you I
email you my mod_jk2.so

-
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: Getting mod_jk2 to run with Tomcat 4.1.27 and Apache 2.0.47

2003-08-15 Thread Stuart Stephen
Infact no it didn't :o(

That was something I tried yesterday. I've still not got a .so file that I
have compiled.

What could I be doing wrong?


-Original Message-
From: Stuart Stephen [mailto:[EMAIL PROTECTED]
Sent: 15 August 2003 10:26
To: Tomcat Users List
Subject: RE: Getting mod_jk2 to run with Tomcat 4.1.27 and Apache 2.0.47


Hi all,

For your reference, I have now found out what the problem was.

I checked out more information about what the apxs is and found out that its
effectively a compiler of some sort. So I went to my $APACHEHOME/bin/
directory and ran it 'apxs'.

I got the message:

Can't exec /usr/bin/apr-config: No such file or directory at
/usr/sbin/apxs line 87.
Use of uninitialised value in scalar chomp at /usr/sbin/apxs line 92.

.. the rest of the help ..

So, I did a 'find / -name apr-config' and located it in my $APACHEHOME/bin/
directory, copied it from there to /usr/bin/ using 'cp
/usr/local/apache2/bin/apr-config /usr/bin/'

Then I went back to the compile process, ran that. This all went swimmingly
as usual. Then I ran 'libtool --finish /usr/local/apache2/modules/' and the
files appeared in the correct place.

I can only assume that something I installed, did not install properly?

Thanks for the help everyone. I hope this comes of use to someone else too.

Stuart

-Original Message-
From: Stuart Stephen [mailto:[EMAIL PROTECTED]
Sent: 14 August 2003 13:38
To: Tomcat Users List
Subject: RE: Getting mod_jk2 to run with Tomcat 4.1.27 and Apache 2.0.47


I did exactly that, and there's still no .so

-Original Message-
From: Richard Park [mailto:[EMAIL PROTECTED]
Sent: 14 August 2003 13:29
To: Tomcat Users List
Subject: Re: Getting mod_jk2 to run with Tomcat 4.1.27 and Apache 2.0.47


Stuart, just to be sure I downloaded the version of jk2 that you have and
tried building it myself, and everything went smoothly. If your willing,
here's exactly what I did:

# cd /usr/local/src
# wget
http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk2/release/v2.0.
2/src/jakarta-tomcat-connectors-jk2-2.0.2-src.tar.gz

# gunzip -dc jakarta-tomcat-connectors-jk2-2.0.2-src.tar.gz | tar xf -
# cd jakarta-tomcat-connectors-jk2-2.0.2-src/jk/native2

# ./configure --with-apxs2=/usr/local/apache2/bin/apxs
# make

# cd ../build/jk2/apache2
# ls -la

and the mod_jk2.so file was there ... if it continues to fail for you I
email you my mod_jk2.so

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



presistent session id

2003-08-15 Thread Billy Ng
Hi folks,

I will lose the session everytime I close the browser.  Is there a way to persist the 
session even I close the browser?

Thanks!

Billy Ng

This mailbox protected from junk email by Matador
from MailFrontier, Inc. http://info.mailfrontier.com


JK2 runtime reconfig and graceful shutdown config example?

2003-08-15 Thread Chi Tong
Hi,

I tried to use the JK2 graceful shutdown feature through runtime 
reconfig but my setup failed to work. Anyone has a working example?

My setup has Apache 2.0.47 and 2 instances of Tomcat 4.1.24 on Solaris 
8. JK2 connector was used to load balance between the 2 Tomcat servers 
through socket channel. This setup worked fine with load balancing and 
sticky session.

Then I tried to set graceful=1 and version=1 in one of the channel 
inside the worker2.properties file. By reloading the jkstatus page, the 
ver attribute on the page was incremented. However at this point, I'm 
not sure whether the runtime reconfiguration is effective or not because 
when I tried to send new request to the Apache 2 server, the new request 
was still sending to the Tomcat server where graceful=1 was set in that 
channel. Also there was no indication of graceful=1 and version=1 being 
picked up other than ver attribute was updated on the status page. The 
runtime reconfig and/or graceful shutdown seemed not working in my setup.

Anybody knows what else I can try or has experience setting up JK2 
runtime reconfig and graceful shutdown successfully?

Thanks,
ct


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


RE: Attaching File Monitor Thread to Tomcat

2003-08-15 Thread Shapira, Yoav

Howdy,

I would like to start and stop that Monitor Thread with tomcat so I
loaded
from a (load-on-startup) servlet. It loads OK and works fine but when

Use a ServletContextListener instead of a load-on-startup servlet.

I tried in Servlet destroy method...
 Monitor.stopNow(); // my thread polite stop method

Does this call interrupt() on the actual thread?  If not, it should.

I also tried overriding  finalize()  method but it was never called :-(

The finalize method in your Monitor or your servlet?

Any ideas??

Yeah, save yourself time and mark that thread a daemon ;)

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: Vedr.: RE: Fetching protected URL in Tomcat

2003-08-15 Thread Shapira, Yoav

Howdy,
I completely agree with Senor Barker ;)  If it's important for you, make
a patch for it yourself ;)  This one particularly is fairly easy.  We're
all busy enough to barely cover bugs that people designate as
showstoppers in bugzilla ;)

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 2:51 AM
To: Tomcat Users List
Subject: Vedr.: RE: Fetching protected URL in Tomcat


Hi

Im not involeved with Tomcat as a developer. Cant any of you developers
make the patch. Let me know ;-)

Steff



I believe the j_target_url was a proprietary add-on attribute WebLogic
added, not part of the servlet spec, and that there's no equivalent in
tomcat at this time.  I could be wrong, however ;)  Even if I'm right,
adding this attribute wouldn't be a big deal I imagine: want to
contribute a patch? ;)

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




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]



PropertyMessageResources

2003-08-15 Thread Barry Mcleer
I recently uninstalled tomcat 4.1.24 and installed 4.1.27(with hotfix) on
w2k professional. Whenever i start tomcat the following lines (aswell as
some other stuff) appear on the console:
 
[INFO] PropertyMessageResources - -Initializing,
config='org.apache.struts.util.LocalStrings', returnNull=true
[INFO] PropertyMessageResources - -Initializing,
config='org.apache.struts.action.ActionResources', returnNull=true
[INFO] PropertyMessageResources - -Initializing,
config='org.apache.webapp.admin.ApplicationResources', returnNull=true
 
I have never seen these in previous versions and was wondering if they were
normal, or what they are? I am not using struts in any of my applications.
 
thanks
 
barry


RE: PropertyMessageResources

2003-08-15 Thread Shapira, Yoav

Howdy,
Actually, you are using struts if you left the admin webapp installed,
which it appears you did ;)  These (as the INFO indicates) are just
harmless informative messages regarding the admin webapp's
initialization.  You can remove the admin webapp if you don't need it,
and these will go away.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Barry Mcleer [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 8:58 AM
To: Tomcat Users ([EMAIL PROTECTED])
Subject: PropertyMessageResources

I recently uninstalled tomcat 4.1.24 and installed 4.1.27(with hotfix)
on
w2k professional. Whenever i start tomcat the following lines (aswell
as
some other stuff) appear on the console:

[INFO] PropertyMessageResources - -Initializing,
config='org.apache.struts.util.LocalStrings', returnNull=true
[INFO] PropertyMessageResources - -Initializing,
config='org.apache.struts.action.ActionResources', returnNull=true
[INFO] PropertyMessageResources - -Initializing,
config='org.apache.webapp.admin.ApplicationResources', returnNull=true

I have never seen these in previous versions and was wondering if they
were
normal, or what they are? I am not using struts in any of my
applications.

thanks

barry



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: PropertyMessageResources

2003-08-15 Thread Barry Mcleer
Cool, thanks for that.

barry



-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
Sent: 15 August 2003 14:01
To: Tomcat Users List
Subject: RE: PropertyMessageResources



Howdy,
Actually, you are using struts if you left the admin webapp installed, which
it appears you did ;)  These (as the INFO indicates) are just harmless
informative messages regarding the admin webapp's initialization.  You can
remove the admin webapp if you don't need it, and these will go away.  

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Barry Mcleer [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 8:58 AM
To: Tomcat Users ([EMAIL PROTECTED])
Subject: PropertyMessageResources

I recently uninstalled tomcat 4.1.24 and installed 4.1.27(with hotfix)
on
w2k professional. Whenever i start tomcat the following lines (aswell
as
some other stuff) appear on the console:

[INFO] PropertyMessageResources - -Initializing, 
config='org.apache.struts.util.LocalStrings', returnNull=true [INFO] 
PropertyMessageResources - -Initializing, 
config='org.apache.struts.action.ActionResources', returnNull=true 
[INFO] PropertyMessageResources - -Initializing, 
config='org.apache.webapp.admin.ApplicationResources', returnNull=true

I have never seen these in previous versions and was wondering if they
were
normal, or what they are? I am not using struts in any of my
applications.

thanks

barry



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]



URLEncoding urls (hrefs) that are coming out of a database...

2003-08-15 Thread Kurt Overberg
Gang,

I store text in my database that contains:

Hello there, user, please click a href=linkthis link/a.

I output this text to the user with the bean:write/ tag (I'm using 
struts 1.0  tomcat 4.1.27).  Is there some way to make sure that my 
JSESSIONID will get appended to these links (for people w/out cookies), 
or do I need to make that happen myself with some regex magic?  I've 
poked around all the struts libs and all that but it seems that by the 
time the text gets substituted on the output .jsp, its already been 
compiled and everything, which is too late.  Thoughts, ideas, 
workarounds?  Anyone?  Anyone?  Help!

/kurt

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


RE: URLEncoding urls (hrefs) that are coming out of a database...

2003-08-15 Thread Shapira, Yoav

Howdy,
Don't worry about it, the servlet container is required to do this for
your automagically (if the client doesn't support cookies).

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Kurt Overberg [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 9:29 AM
To: Tomcat Users List
Subject: URLEncoding urls (hrefs) that are coming out of a database...

Gang,

I store text in my database that contains:

Hello there, user, please click a href=linkthis link/a.

I output this text to the user with the bean:write/ tag (I'm
using
struts 1.0  tomcat 4.1.27).  Is there some way to make sure that my
JSESSIONID will get appended to these links (for people w/out cookies),
or do I need to make that happen myself with some regex magic?  I've
poked around all the struts libs and all that but it seems that by the
time the text gets substituted on the output .jsp, its already been
compiled and everything, which is too late.  Thoughts, ideas,
workarounds?  Anyone?  Anyone?  Help!

/kurt


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




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: URLEncoding urls (hrefs) that are coming out of a database...

2003-08-15 Thread Ralph Einfeldt
Only if you call encodeUrl on the link.

If you just write out some text it stays as it is
no matter if it contains links.


 -Original Message-
 From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 15, 2003 3:35 PM
 To: Tomcat Users List
 Subject: RE: URLEncoding urls (hrefs) that are coming out of a
 database...

 Hello there, user, please click a href=linkthis link/a.
 I output this text to the user with the bean:write/ tag (I'm

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



RE: From which apache virtual host did a request come from?

2003-08-15 Thread Mike Curwen
Thanks Bill, that would work great. 

 -Original Message-
 From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Barker
 Sent: Friday, August 15, 2003 12:50 AM
 To: [EMAIL PROTECTED]
 Subject: Re: From which apache virtual host did a request come from?
 
 
 It seems that I had a momentary lapse here.  A better 
 suggestion is to use request.getServerName();.  The 'host' 
 header will also include the port number (if it's a 
 non-standard port).
 
 Bill Barker [EMAIL PROTECTED] wrote in message 
 news:[EMAIL PROTECTED]
  Have you tried request.getHeader(host); ?
 
  Mike Curwen [EMAIL PROTECTED] wrote in message 
  news:[EMAIL PROTECTED]
   Our Tomcat has one host.  There is also only one webapp 
 to which 
   any request to the foo.com domain should go.
  
   Apache vhost blah.foo.com   - TC default host, default webapp
   Apache vhost abc.foo.com- TC default host, default webapp
   Apache vhost xyz.foo.com- TC default host, default webapp
  
   The webapp parses  blah, abc and xyz.
  
  
  
-Original Message-
From: Angus Mezick [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2003 9:37 AM
To: Tomcat Users List
Subject: RE: From which apache virtual host did a request come 
from?
   
   
Same deal.  Apache doesn't know anything about webapps. 
  You just 
send requests for certain hosts to tomcat using 
workers2.properties.  Tomcat then uses its host entries to 
decide which webapp get what.
   
 -Original Message-
 From: Mike Curwen [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 14, 2003 10:27 AM
 To: 'Tomcat Users List'
 Subject: RE: From which apache virtual host did a 
 request come 
 from?


 Actually, I was speaking about virtual hosts in Apache Web
Server.  ;)

 A few more details:

 I have an application that parses the URI for some 
 parameters. 
 Basically the sponsors hate URLs that look like:
 http://www.foo.com/?foo=abar=bbaz=c

 So my fix was to parse the URI for the parameters in a known 
 order. http://www.foo.com/a/b/c

 They don't like this either. less typing, cleaner, 
 but *still* 
 not 'friendly'.  I might tell them that people using the web
are used to
 this sort of thing by now, but hey, they're the sponsors
and they want
 it different.

 So my last option is to flatten the parameters and use a 
 subdomain.

 http://abc.foo.com/
 http://xyz.foo.com/

 So that's two virtual hosts in Apache, jk mounted to a single
 (default)
 application on Tomcat.  That's possible, right?



  -Original Message-
  From: John Turner [mailto:[EMAIL PROTECTED]
  Sent: Thursday, August 14, 2003 8:59 AM
  To: Tomcat Users List
  Subject: Re: From which apache virtual host did a request
come from?
 
 
 
  It's within Host.
 
  John
 
  Angus Mezick wrote:
 
   Isn't there an Alias tag within Context?
  
  
  -Original Message-
  From: John Turner [mailto:[EMAIL PROTECTED]
  Sent: Thursday, August 14, 2003 9:32 AM
  To: Tomcat Users List
  Subject: Re: From which apache virtual host did a request
 come from?
  
  
  Mike Curwen wrote:
  
  
  1) Is it possible to mount several virtual hosts to
the same web
  application (the default one, as it happens)
  
  I think this is possible, though maybe not desired.
  
  You can see this with the manager app.  Setup a bunch
of virtual
  hosts that have the same appBase, with Contexts that have 
  the
  same docBase,
  and you will be able to reach the same application on any
  of the host
  names.  I determined that it was better to give a separate
  appBase to
  each virtual host.
  
  If you mean setting separate appBase's for each virtual
host, and
  still being able to access the same webapp (Context
with the same
  docBase not
  a copy of the webapp in another docBase), I would 
 say no.
   It's at
  least a security risk.  Someone please correct me if I'm 
  wrong.
 
 
 
 
 -
 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: URLEncoding urls (hrefs) that are coming out of a database...

2003-08-15 Thread Kurt Overberg
Well, yeah it should, but I get the impression (from testing and seeing 
it not do it) that if the URL is coming from a database and the URL (a 
href) is embedded in other text, that it won't automagically work. 
Since the URL isn't in the JSP file at compile-time, it seems that it 
just gets passed over.  Can anyone confirm/deny this?  Maybe I've got 
things configured improperly?  All my other links come out with 
jsessionid appended properly.   Thanks again!

/kurt

Shapira, Yoav wrote:
Howdy,
Don't worry about it, the servlet container is required to do this for
your automagically (if the client doesn't support cookies).
Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Kurt Overberg [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 9:29 AM
To: Tomcat Users List
Subject: URLEncoding urls (hrefs) that are coming out of a database...
Gang,

I store text in my database that contains:

Hello there, user, please click a href=linkthis link/a.

I output this text to the user with the bean:write/ tag (I'm
using

struts 1.0  tomcat 4.1.27).  Is there some way to make sure that my
JSESSIONID will get appended to these links (for people w/out cookies),
or do I need to make that happen myself with some regex magic?  I've
poked around all the struts libs and all that but it seems that by the
time the text gets substituted on the output .jsp, its already been
compiled and everything, which is too late.  Thoughts, ideas,
workarounds?  Anyone?  Anyone?  Help!
/kurt

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




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: URLEncoding urls (hrefs) that are coming out of a database...

2003-08-15 Thread Kurt Overberg
Oh yes, I forgot, because the URL lives within a big block of normal 
text, I can't just call encodeURL on the whole thing.  Seems like I need 
a method that will search out an a href in a string and do the 
jsessionid substitution on it.  Ugh.

/kurt

Kurt Overberg wrote:
Well, yeah it should, but I get the impression (from testing and seeing 
it not do it) that if the URL is coming from a database and the URL (a 
href) is embedded in other text, that it won't automagically work. Since 
the URL isn't in the JSP file at compile-time, it seems that it just 
gets passed over.  Can anyone confirm/deny this?  Maybe I've got things 
configured improperly?  All my other links come out with jsessionid 
appended properly.   Thanks again!

/kurt

Shapira, Yoav wrote:

Howdy,
Don't worry about it, the servlet container is required to do this for
your automagically (if the client doesn't support cookies).
Yoav Shapira
Millennium ChemInformatics




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


RE: URLEncoding urls (hrefs) that are coming out of a database...

2003-08-15 Thread Ralph Einfeldt
That is how it works. AFAIK there is nothing you can 
configure to change this.

This is a thing that requires some logic to implement a 
generic solution. It would require a complete html parser 
that parses each response (Quite challanging and time 
consuming). And what should this solution do with 
javascript ? Another solution would be a taglib that
replaces bean:write/ with a tag that parses the output 
before it is given to the response.

 -Original Message-
 From: Kurt Overberg [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 15, 2003 3:45 PM
 To: Tomcat Users List
 Subject: Re: URLEncoding urls (hrefs) that are coming out of a
 database...
 
 Well, yeah it should, but I get the impression (from testing 
 and seeing it not do it) that if the URL is coming from a 
 database and the URL (a href) is embedded in other text, that 
 it won't automagically work. 

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



RE: Running servlet via SSL???

2003-08-15 Thread Carlos Oliva
Thank you very much for your reponse.  Probably we will want to take
advantage of Apache SSL and configure it to relay requests to Tomcat
instead of using Tomcat as stand-alone.  To do this, do I just need to
configure Apache and add the appropriate mappings or must I also install
the mod_jk (Apache 1.3 and Tomcat 4.0.x)?

-Original Message-
From: John Turner [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 14, 2003 1:24 PM
To: Tomcat Users List
Subject: Re: Running servlet via SSL???


Carlos Oliva wrote:

 However, I see the welcome screen of Tomcat if I use http://:8080 
 but not if I use https::8080 or any other combination of ports and

 http or https.  Furthermore, servlets run via http://:8080/ , 
 but not https://... Or http://:8443/...

If anything, it would be https://...:8443

From this, I am concluding that Apache is set to run with http or 
https,
 that Tomcat is configured as stand alone -- not via ssl.

Right, but Tomcat's SSL status is irrelevant if you're using Apache and
a connector.  Apache and Tomcat do not speak SSL when communicating
with each other.  If you're using SSL with Apache + Tomcat, the only SSL
configuration is done on the Apache side.  You have to remember to add
the appropriate URI mappings for your connector to the SSL virtual host
in httpd.conf.

 So, since I have JDK1.4.x installed,  I am assuming that I just need 
 to create the right certificates and configure the server.xml file for

 tomcat to enable Tomcat to work with ssl in stand alone mode.  Right?

Right, but again, this is not needed if you have Apache set to do SSL,
unless you want to do testing using Tomcat alone.

Tomcat SSL HOWTO:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/ssl-howto.html

John






-
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: URLEncoding urls (hrefs) that are coming out of a database...

2003-08-15 Thread Hans Wichman
A complete html parser seems a bit over the top if you can ensure the html 
is validated before it goes into the database.
If the html is validated you can perform a search and replace on known 
cases, however I had the same problem and encodeURL only worked on url's 
that could be resolved within your own context (?!).

A javascript call for example which ends by calling document.location.href 
= args[0] (which you might call through javascript:myFunction('myurl')) is 
a nasty problem to get right I think. I solved my problem by including a 
cookie check ;-)). Not the solution you are looking for I think, but it is 
a solution.

greetz
Hans
At 15:57 15/08/2003 +0200, Ralph Einfeldt wrote:
That is how it works. AFAIK there is nothing you can
configure to change this.
This is a thing that requires some logic to implement a
generic solution. It would require a complete html parser
that parses each response (Quite challanging and time
consuming). And what should this solution do with
javascript ? Another solution would be a taglib that
replaces bean:write/ with a tag that parses the output
before it is given to the response.
 -Original Message-
 From: Kurt Overberg [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 15, 2003 3:45 PM
 To: Tomcat Users List
 Subject: Re: URLEncoding urls (hrefs) that are coming out of a
 database...

 Well, yeah it should, but I get the impression (from testing
 and seeing it not do it) that if the URL is coming from a
 database and the URL (a href) is embedded in other text, that
 it won't automagically work.
-
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]


Tomcat MultiHosting problems

2003-08-15 Thread Robert Zhrer @ pronet.at
Hi all,

I've great problems with Tomcat and setting up a context in a 2nd
(virtual) host:

my environmemt:

OS: Redhat Linux
Platform: Intel x86

TC version: 4.1

tomcat4.conf:
--- cut -
CATALINA_HOME=/var/tomcat4
JASPER_HOME=/var/tomcat4
CATALINA_TMPDIR=/var/tomcat4/temp
 cut -

1) There is a dir called /home/www/vhostxx/html/webapps for the
vhost-files. There User uploaded her Apps via FTP. There are just a
few jsp-files and a WEB-INF-subdir with a standard web.xml.

Permissions:

drwxrwxrwx2 vhostxx_user   ftponly  4096 Aug 12 14:03 webapps

2) Host and Context are defined in server.xml (see below)

But when i define the Context (shown below) with den Admin Panel, I
get this error from the Logger:

2003-08-15 14:27:21 StandardContext[/webapps]: Resources start failed:
java.lang.IllegalArgumentException: Document base
/home/www/vhostxx/html/webapps does not exist or is not a
readable directory

and

2003-08-15 14:27:21 StandardContext[/webapps]: Context startup failed
due to previous errors
2003-08-15 14:27:21 StandardContext[/webapps]: Exception during
cleanup after start failed

:(

3) When I try http://www.www.domain_vhostxx.at:8080/webapps/file.jsp

I also get

HTTP Status 404 - /webapps/file.jsp
type Status report
message /webapps/file.jsp
description The requested resource (/webapps/file.jsp) is not available.

Of course, this is, because Context startup failed .. but why is
this so? TC has also add a work-dir for this host and context but the
context-working-dir is empty :(

There are no basicly problems, because the Admin Panel (localhost,
context: /admin) works fine.

Is it a problem, when appBase, docBase are outside $CATALINA_HOME?

Are there spezial permission needs for the appBase, docBase dirs? But
now there are permissions to ALL with

drwxrwxrwx2 vhostxx_user   ftponly  4096 Aug 12 14:03 webapps

Is there anything that I don't know?

I'ld be very very glad if anybody has an idea, because I've studied
the docs for days and can't see a mistake in my config?

Thanks a lot Robert


From server.xml:

# Standard Localhost with Admin  Manager Context ###

Host className=org.apache.catalina.core.StandardHost
appBase=webapps autoDeploy=true
configClass=org.apache.catalina.startup.ContextConfig
contextClass=org.apache.catalina.core.StandardContext debug=0
deployXML=true
errorReportValveClass=org.apache.catalina.valves.ErrorReportValve
liveDeploy=true
mapperClass=org.apache.catalina.core.StandardHostMapper
name=localhost unpackWARs=true
Context className=org.apache.catalina.core.StandardContext
cachingAllowed=true
charsetMapperClass=org.apache.catalina.util.CharsetMapper
cookies=true crossContext=false debug=0 displayName=Tomcat
Administration Application docBase=../server/webapps/admin
mapperClass=org.apache.catalina.core.StandardContextMapper
path=/admin privileged=true reloadable=false
swallowOutput=false useNaming=true
wrapperClass=org.apache.catalina.core.StandardWrapper
  Logger className=org.apache.catalina.logger.FileLogger
debug=0 directory=logs prefix=localhost_admin_log. suffix=.txt
timestamp=true verbosity=1/
/Context

Context className=org.apache.catalina.core.StandardContext
cachingAllowed=true
charsetMapperClass=org.apache.catalina.util.CharsetMapper
cookies=true crossContext=false debug=0 displayName=Tomcat
Manager Application docBase=../server/webapps/manager
mapperClass=org.apache.catalina.core.StandardContextMapper
path=/manager privileged=true reloadable=false
swallowOutput=false useNaming=true
wrapperClass=org.apache.catalina.core.StandardWrapper
  ResourceLink global=UserDatabase name=users
type=org.apache.catalina.UserDatabase/
/Context
/Host

# my new Host ###

Host className=org.apache.catalina.core.StandardHost
appBase=/home/www/vhostxx/html/webapps autoDeploy=true
configClass=org.apache.catalina.startup.ContextConfig
contextClass=org.apache.catalina.core.StandardContext debug=0
deployXML=true
errorReportValveClass=org.apache.catalina.valves.ErrorReportValve
liveDeploy=true
mapperClass=org.apache.catalina.core.StandardHostMapper
name=www.domain_vhostxx.at unpackWARs=true
  Aliasdomain_vhostxx.at/Alias

Context className=org.apache.catalina.core.StandardContext
cachingAllowed=true
charsetMapperClass=org.apache.catalina.util.CharsetMapper
cookies=true crossContext=true debug=0
docBase=/home/www/vhostxx/html/webapps
mapperClass=org.apache.catalina.core.StandardContextMapper
path=/webapps privileged=false reloadable=true
swallowOutput=true useNaming=true
wrapperClass=org.apache.catalina.core.StandardWrapper
/Context
  /Host




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



RE: Starting tomcat from init scripts (HP/UX)

2003-08-15 Thread Lott, Carey
Ok, I finally got the script to execute correctly and I got the familiar
output:

Using CATALINA_BASE:   /bto/appl/apache/jakarta-tomcat-4.0.4
Using CATALINA_HOME:   /bto/appl/apache/jakarta-tomcat-4.0.4
Using CATALINA_TMPDIR: /bto/appl/apache/jakarta-tomcat-4.0.4/temp
Using JAVA_HOME:   /opt/java1.4

But tomcat still isn't starting, and I am not receiving any other errors.
Also the script executes fine when I do it from command line.
I have placed the start/stop script in /sbin/init.d/.  I have made the
script be last to start and first to stop.  I couldn't get the script to
recognize the env variables when they were in the rc.config.d directory, so
I placed them directly in the script which seems to have worked, but the
process still isn't starting.  
Can anybody give me any other ideas as to what could be wrong or what I
could try?  Any ideas how I can get a better error information?

Below is the start/stop script - /sbin/init.d/tomcat.  Can you see anything
missing?

Thanks in advance for everybody's input and help.

#!/sbin/sh
# Start/Stop for Tomcat Java Servlet Container
#
PATH=/sbin:/usr/sbin:/usr/bin
export PATH

## Source global configuration file
##. /etc/rc.config

# Needed variables

CATALINA_HOME=/bto/appl/apache/jakarta-tomcat-4.0.4
export CATALINA_HOME
JAVA_HOME=/opt/java1.4
export JAVA_HOME
CLASSPATH=/bto/appl/apache/jakarta-tomcat-4.0.4/common/lib/servlet.jar:/opt/
java1.4/jre/lib/rt.jar:/opt/java1.4/lib/tools.jar:/opt/java1.4/lib/dt.jar:/o
pt/java1.4/lib/htmlconverter.jar:/opt/java1.4/jre/lib/charsets.jar:/opt/java
1.4/jre/lib/javaplugin.jar:/opt/java1.4/jre/lib/ext/dnsns.jar:/opt/java1.4/j
re/lib/ext/localedata.jar:/opt/java1.4/jre/lib/ext/ldapsec.jar:/opt/java1.4/
jre/lib/jce.jar:/opt/java1.4/jre/lib/jsse.jar:.:/bto/appl/apache/jakarta-tom
cat-4.0.4/webapps/esd/WEB-INF/classes:/bto/appl/apache/jakarta-tomcat-4.0.4/
webapps/esd/WEB-INF/lib:/bto/appl/apache/htdocs/esd/java:/bto/sys/oracle/pro
duct/8.0.6/jdbc/lib/classes111.zip
export CLASSPATH

case $1 in
start_msg)
echo Starting Tomcat
;;

'start')
/bto/appl/apache/jakarta-tomcat-4.0.4/bin/catalina.sh start
 /bto/appl/apache/jakarta-tomcat-4.0.4/logs/bootlogstart.txt 21 
;;

stop_msg)
echo Stopping Tomcat
;;

'stop')
/bto/appl/apache/jakarta-tomcat-4.0.4/bin/catalina.sh stop
 /bto/appl/apache/jakarta-tomcat-4.0.4/logs/bootlogstop.txt 21 
;;
esac

exit 0;

signature
nameCarey Lott/name
posWeb Tools Support/pos
orgInfrastructure Storage  Tools Support/org
companyEDS/company
accountBellSouth/account
phone404-529-6676/phone
email[EMAIL PROTECTED]/email
ipager[EMAIL PROTECTED]/ipager
/signature


disclaimer
*
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential, proprietary, and/or
privileged material.  Any review, retransmission, dissemination or other use
of, or taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.  If you received
this in error, please contact the sender and delete the material from all
computers.
/disclaimer


-Original Message-
From: Morgan Pyne [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 08, 2003 3:54 AM
To: Tomcat Users List
Subject: RE: Starting tomcat from init scripts (HP/UX) 


Have a look at /usr/share/doc/start_up.txt or /usr/share/doc/start_up.ps on
a HP-UX 11.00 machine 
for details of how to write a startup script conforming to HP-UX's standards
(for issuing messages 
at startup and shutdown via the 'start_msg' and 'stop_msg' parameters,
honouring the settings in 
/etc/rc.config.d etc...). 

You can use any of the scripts in /sbin/init.d as a basis - modify one as
appropriate and 
get it to simply call catalina.sh. 

We also modified our catalina.sh to check which userid was calling the
script. If it was root it would sudo to the non-privileged user that Tomcat
ran under ('tomcat'). If it was userid 'tomcat' calling it it would simply
continue. If it was anyone else, it would exit with an error message. This
way we get Tomcat started as a non-privileged user 
starting automatically on boot.

Regards,
Morgan



 -Original Message-
 From: Eric J. Pinnell [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 08, 2003 02:11
 To: Tomcat Users List
 Subject: RE: Starting tomcat from init scripts (HP/UX) 
 
 
 Tim is right.  In HP/UX there is a default start script (I
 forget what it's called).  You plug in the name of your 
 service and add any other stuff it might need.  You define 
 you service as being active somewhere else.  (I know I'm not 
 much help but it's been a while).
 
 That way when it starts you get the [OK] message.
 
 -e
 
 On Thu, 7 Aug 2003, Lott, Carey wrote:
 
  I tried calling the startup.sh instead of catalina.sh, but
 I had the
  same outcome.  It executes the 

Request parameter value containing = is not parsed well

2003-08-15 Thread Vijay Kandy
Hello All,

I have a servlet whose expected parameter is ZAZBZ and its value is
CZlYnXtAIBDC=D9W7V
So calling http://host/context/name?ZAZBZ=CZlYnXtAIBDC=D9W7V would cause

System.out.println(request.getParameter(ZAZBZ)); 

to print CZlYnXtAIBDC=D9W7V in Tomcat 3.2.3. But in tomcat 4.0.4 the
printout is CZlYnXtAIBDC
The results are the same when the URL is encoded because = remains the same.
Looks like parameter value cannot contain = 
Please let me know if I am missing something.

Sincerely,
Vijay


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



default path - simple question

2003-08-15 Thread Perkins, John
I am new at using Tomcat and have a basic question. I have gone through the
config files but haven't been able to find out where to set the default
catalina_home directory. I have a web application that is set to c:\webapp.
I would like to set Tomcat to see that directory and use it as default for
serving this webapp.

The main problem is that the application has its own directory structure and
makes calls to it accordingly. Sometimes including the entire c:\webapp path
(I didn't develop the app). So I think that changing the Tomcat default
directory would be easier than reworking all the links throughout the app.

I am new to java/jsp development, so right now I am kinda winging it and
learning as I go. Any information on where to look in the documentation to
solve this problem would be great because I haven't found it yet. Or, if
there is a simple solution, the answer would be great as well.

Thanks
John

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



Re: Does load balancing with sticky sessions work with mod_jk? - SOLVED

2003-08-15 Thread G. Wade Johnson
I've been digging around in the source for Tomcat 4.1.27, and this is
what I've found.

The problem I've had with not being able to get load balancing to work
in my application is a problem with Basic Authentication. Since Basic
authentication never sends a JSESSIONID cookie, the jvmRoute is never
available to mod_jk.

This issue was obscured by the fact that I was using the SingleSignOn
valve. This facility creates its own cookie JSESSIONIDSSO. This
cookie also doesn't have the jvrRoute attached and that sent me on a
wild goose chase through the wrong code.

I've reworked my app to support FORM authentication even thought this
requires a form for each servlet context and extra JkMount points.

Thanks to Chris Daniluk for setting me on the right track.

G. Wade

G. Wade Johnson wrote:
 
 Chris,
 
 I've been investigating something that you said that triggered an
 a weird train of thought.
 
 My application is using the SingleSignOn Valve to allow a set of
 Servlets to work together. This means that I don't get the JSESSIONID
 cookie, I get the JSESSIONIDSSO cookie. Once you pointed it out, I
 realized that the jvmRoute was not on the end of the cookie.
 
 Looking in the mod_jk source, I can't find anywhere the '*SSO' cookie
 is used. It would not have been read, even if it had been sent.
 
 I'm doing further research. I'll post what I find.
 
 Thanks for all of your help so far.
 G. Wade
 
 Cristopher Daniluk wrote:
 
  Turn on the mod_jk logging. We had all sorts of problems with it at
  first. Turned out to be an incompatibility between the binary and apache
  with ours, but there's lots of possibilities.
 
  Check the mod_jk log and see if its having communication errors with
  Tomcat.
  Check the Tomcat logs (your app logs AND catalina.out) and see if
  anything shows up such as an exception.
  Use Mozilla and get LiveHTTPHeaders. This will show you the raw URL
  requests. Watch the JSESSIONID. Make sure the jvmRoute is appeneded to
  the end of the session.. i.e. JSESSIONID=abcdef12345.myTomcat1. Make
  sure the domain is being set right and that its not getting ignored. If
  you're sending a cookie and then the response is giving you a new
  cookie, its probably because of communication problems between Apache
  and Tomcat.
 
  Paste relevant parts of your httpd.conf, workers.properties, and
  server.xml if you still have trouble. Any helpful logs too...
 
  Cris
 
  -Original Message-
  From: G. Wade Johnson [mailto:[EMAIL PROTECTED]
  Sent: Thursday, August 14, 2003 3:08 PM
  To: Tomcat Users List
  Subject: Re: Does load balancing with sticky sessions work with mod_jk?
 
  I've now compiled mod_jk 1.2.4 from source for Apache 1.3.28 under
  Win32.
 
  My jvmRoute attributes exist and match the entries in workers.properties
  for the appropriate hosts.
 
  I'm still showing my requests ping-ponging between the two servers.
 
  Can you think of anything else that I could be doing wrong?
 
  G. Wade
 
  Cristopher Daniluk wrote:
  
   Still advisable to compile the connector from source.
  
   Also maek sure your worker names in worker.properties match the names
   of the jvmRoute.
  
   -Original Message-
   From: G. Wade Johnson [mailto:[EMAIL PROTECTED]
   Sent: Thursday, August 14, 2003 11:29 AM
   To: Tomcat Users List
   Subject: Re: Does load balancing with sticky sessions work with
   mod_jk?
  
   Thanks for the response.
  
   I have the jvmRoute attribute set on both of my Tomcats.
  
   I am (unfortunately) running under Windows at the moment. From your
   response, I guess you are not. I'll see if I can compile the source.
  
   Thanks,
   G. Wade
  
   Cristopher Daniluk wrote:
   
Make sure you set a jvmRoute and if you have trouble, compile the
mod_jk.so from src rather than using a binary.
   
It works just fine...
   
-Original Message-
From: G. Wade Johnson [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2003 10:56 AM
To: Tomcat Users List
Subject: Does load balancing with sticky sessions work with mod_jk?
   
Has anyone gotten load balancing with stick sessions working with
Apache
1.3.* and mod_jk?
   
G. Wade
   

-
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]
 
  -
  To unsubscribe, 

RE: Request parameter value containing = is not parsed well

2003-08-15 Thread Shapira, Yoav

Howdy,
I don't know (and don't really care much about at this point) 4.0.4, but
I can't reproduce what you claim on 4.1.27.  The behavior is correct
with equal signs in param value, they are retained.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Vijay Kandy [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 11:41 AM
To: 'Tomcat Users List'
Subject: Request parameter value containing = is not parsed well

Hello All,

I have a servlet whose expected parameter is ZAZBZ and its value is
CZlYnXtAIBDC=D9W7V
So calling http://host/context/name?ZAZBZ=CZlYnXtAIBDC=D9W7V would
cause

System.out.println(request.getParameter(ZAZBZ));

to print CZlYnXtAIBDC=D9W7V in Tomcat 3.2.3. But in tomcat 4.0.4 the
printout is CZlYnXtAIBDC
The results are the same when the URL is encoded because = remains the
same.
Looks like parameter value cannot contain =
Please let me know if I am missing something.

Sincerely,
Vijay


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




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: Request parameter value containing = is not parsed well

2003-08-15 Thread Hans Wichman
Hi
= encoded is %3D, so that's where you are missing something I think.
greetz
Hans
At 10:41 15/08/2003 -0500, Vijay Kandy wrote:
Hello All,

I have a servlet whose expected parameter is ZAZBZ and its value is
CZlYnXtAIBDC=D9W7V
So calling http://host/context/name?ZAZBZ=CZlYnXtAIBDC=D9W7V would cause
System.out.println(request.getParameter(ZAZBZ));

to print CZlYnXtAIBDC=D9W7V in Tomcat 3.2.3. But in tomcat 4.0.4 the
printout is CZlYnXtAIBDC
The results are the same when the URL is encoded because = remains the same.
Looks like parameter value cannot contain =
Please let me know if I am missing something.
Sincerely,
Vijay
-
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]


JNDI References To Tomcat 4.1

2003-08-15 Thread Jason Mowat
Greetings,

I am trying to create a standalone application that references a DBCP on Tomcat.  I'm 
not sure if I can do this; I've seem some articles that seem to suggest that it can be 
done, but again, I'm not sure.  I've read http://www.mail-archive.com/[EMAIL 
PROTECTED]/msg08353.html. 

I have set up in tomcat/conf/server.xml the following context info:

  DefaultContext
Resource name=jdbc/test_db auth=Container type=javax.sql.DataSource/

ResourceParams name=jdbc/test_db
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter

  parameter
namedriverClassName/name
valueoracle.jdbc.driver.OracleDriver/value
  /parameter
  
  parameter
nameurl/name
valuejdbc:oracle:thin:@internal.sbgh.mb.ca:1521:test/value
  /parameter
  
  parameter
nameusername/name
valuetest/value
  /parameter
  
  parameter
namepassword/name
valuetest/value
  /parameter
  
  parameter
namemaxActive/name
value20/value
  /parameter   
  
  parameter
namemaxIdle/name
value3/value
  /parameter
  
  parameter
namemaxWait/name
value100/value
  /parameter
/ResourceParams
 
  /DefaultContext

Note that I have not created any references in a web.xml, since I will not be running 
an application, per se, from Tomcat.  PERHAPS THIS IS WHERE MY PROBLEM IS?

The client code I am using is not a servlet or a JSP; it's a simple piece of code to 
see if I can communicate with the database pool on Tomcat as configured above.

Hashtable env = new Hashtable();
env.put(
Context.INITIAL_CONTEXT_FACTORY, 
org.apache.commons.dbcp.BasicDataSourceFactory
);

//  ***  THIS IS ANOTHER AREA WHERE I MAY BE WRONG! ***
env.put(
Context.PROVIDER_URL, 
http://localhost:8080; 
);

try {   
InitialContext initCtx = new InitialContext(env);
DataSource ds = (DataSource)initCtx.lookup(java:comp/env/jdbc/test_db);
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery(SELECT * FROM tbl_test);
conn.close();
initCtx.close();
}
catch(NamingException e) {
fail(Naming exception thrown);
}
catch (SQLException e) {
fail(SQL Exception thrown);
}

I start Tomcat, assuming that the pool is set up.  Then I use the client to try to get 
an initial context from it.  This throws a naming exception, because it doesn't know 
how to get an initial context for org.apache.commons.dbcp.BasicDataSourceFactory at 
http://localhost:8080. 

My first question: can I do this?
My second question: If I can't do it like this, do I need to set up a JNDI provider 
(like on JBoss) and set up the pooling there?
My final question:  It feels as if my problem is simply setting up the PROVIDER_URL 
properly so that it can get the context from Tomcat.  I've done LDAP PROVIDER_URLs 
before, but never one that gets a data source factory from a servlet container.  Can I 
use http over port 8080 to get the data source factory?  Is there a different 
mechanism for getting the factory from code that is not residing within the servlet 
container?  Can this even be done on Tomcat?

I appreciate any help that anyone can provide.

Cheers,
Jason


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



RE: default path - simple question

2003-08-15 Thread Shapira, Yoav

Howdy,
I'm assuming you're using tomcat 4.x.  Hopefully 4.1.27.

I am new at using Tomcat and have a basic question. I have gone through
the
config files but haven't been able to find out where to set the default
catalina_home directory. I have a web application that is set to
c:\webapp.

CATALINA_HOME is set as an environment variable.  If not set, it is
autodetected to be the directory above the one containing the
startup/shutdown scripts.


I would like to set Tomcat to see that directory and use it as default
for
serving this webapp.

You can set the webapp's docBase using that attribute in the Context
element for your webapp in $CATALINA_HOME/conf/server.xml.
Alternatively, you can set the Host's appBase from which all docBases
for the host are derived in the Host element in server.xml.  Read the
configuration reference in the tomcat docs for more details.

The main problem is that the application has its own directory
structure
and
makes calls to it accordingly. Sometimes including the entire c:\webapp
path
(I didn't develop the app). So I think that changing the Tomcat default
directory would be easier than reworking all the links throughout the
app.

You might be right about the relative ease of changing.  It depends on
how exactly the webapp is coded.  If it's consistent in its code, you
might be able to change things quickly using Perl or a similar tool.

I am new to java/jsp development, so right now I am kinda winging it
and
learning as I go. Any information on where to look in the documentation
to
solve this problem would be great because I haven't found it yet. Or,
if
there is a simple solution, the answer would be great as well.

One lesson is not to code webapps like your current one, but instead use
the directory structure outlined in the tomcat app developer's guide:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/index.html

Specifically, try to use relative links wherever possible, don't include
the webapp's name, host name, or port in a hard-coded way in any links.

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]



Simplified Chinese to UTF-8

2003-08-15 Thread Nathan Christiansen
I have an annoying problem that I am trying to figure out.

I need to support Simplified Chinese in a webapp that also supports ISO-8859-1.

I figure the best way is to make my web pages encoded in UTF-8.

The database access and display works, but I am having trouble with getting post data 
to come out correctly.

I am running Tomcat 4.1.24 on a RedHat Linux 7.1 box with JDK 1.4.1_01.

I have tried using the following JSP file to test the post input from a Windows 2000 
Server box that allows me to input Simplified Chinese. But every encoding in the JSP 
file gives me garbage back.

Any ideas?

Thanks.

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com

 Included JSP File 


[EMAIL PROTECTED] contentType=text/html; charset=UTF-8
%[EMAIL PROTECTED] import=java.io.*
%% String strRawData = request.getParameter(data);
String strGBK = null;
String strEUC_CN = null;
String strGB18030 = null;
String strMS936 = null;
String strCp935 = null;
String strGB2312 = null;

String strMS950 = null;
String strBig5 = null;
String strBig5_HKSCS = null;
String strCp937 = null;
String strCp950 = null;
String strCp964 = null;
String strEUC_TW = null;


if (strRawData != null)
{
  strGBK = new String(strRawData.getBytes(GBK));
  strEUC_CN = new String(strRawData.getBytes(EUC_CN));
  strGB18030 = new String(strRawData.getBytes(GB18030));
  strMS936 = new String(strRawData.getBytes(MS936));
  strCp935 = new String(strRawData.getBytes(Cp935));
  strGB2312 = new String(strRawData.getBytes(GB2312));

  strMS950 = new String(strRawData.getBytes(MS950));
  strBig5 = new String(strRawData.getBytes(Big5));
  strBig5_HKSCS = new String(strRawData.getBytes(Big5_HKSCS));
  strCp937 = new String(strRawData.getBytes(Cp937));
  strCp950 = new String(strRawData.getBytes(Cp950));
  strCp964 = new String(strRawData.getBytes(Cp964));
  strEUC_TW = new String(strRawData.getBytes(EUC_TW));
}

%html
headtitleCharset Test Page/title/head
body
%
if (strRawData != null)
{
%pre
strRawData = %= new String(strRawData.getBytes(UTF8)) %
strGBK = %= new String(strGBK.getBytes(UTF8)) %
strEUC_CN = %= new String(strEUC_CN.getBytes(UTF8)) %
strGB18030 = %= new String(strGB18030.getBytes(UTF8)) %
strMS936 = %= new String(strMS936.getBytes(UTF8)) %
strCp935 = %= new String(strCp935.getBytes(UTF8)) %
strGB2312 = %= new String(strCp935.getBytes(UTF8)) %

strMS950 = %= new String(strMS950.getBytes(UTF8)) %
strBig5 = %= new String(strBig5.getBytes(UTF8)) %
strBig5_HKSCS = %= new String(strBig5_HKSCS.getBytes(UTF8)) %
strCp937 = %= new String(strCp937.getBytes(UTF8)) %
strCp950 = %= new String(strCp950.getBytes(UTF8)) %
strCp964 = %= new String(strCp964.getBytes(UTF8)) %
strEUC_TW = %= new String(strEUC_TW.getBytes(UTF8)) %
/pre%
}
%form action=test.jsp method=POST
input type=text name=data
input type=submit
/form
/body
/html

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



RE: Request parameter value containing = is not parsed well

2003-08-15 Thread Vijay Kandy
Thank you for your testing. So did you URLEncode the param value? Is there a
trick not to URLEncode and still retain the value. Because was alright on
3.2.3.
Sincerely,
vijay

Howdy,
I don't know (and don't really care much about at this point) 4.0.4, but
I can't reproduce what you claim on 4.1.27.  The behavior is correct
with equal signs in param value, they are retained.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Vijay Kandy [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 11:41 AM
To: 'Tomcat Users List'
Subject: Request parameter value containing = is not parsed well

Hello All,

I have a servlet whose expected parameter is ZAZBZ and its value is
CZlYnXtAIBDC=D9W7V
So calling http://host/context/name?ZAZBZ=CZlYnXtAIBDC=D9W7V would
cause

System.out.println(request.getParameter(ZAZBZ));

to print CZlYnXtAIBDC=D9W7V in Tomcat 3.2.3. But in tomcat 4.0.4 the
printout is CZlYnXtAIBDC
The results are the same when the URL is encoded because = remains the
same.
Looks like parameter value cannot contain =
Please let me know if I am missing something.

Sincerely,
Vijay


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




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: Request parameter value containing = is not parsed well

2003-08-15 Thread Vijay Kandy
You are right. That's where I have an issue. Thank you.

Vijay

-Original Message-
From: Hans Wichman [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 11:10 AM
To: Tomcat Users List; 'Tomcat Users List'
Subject: Re: Request parameter value containing = is not parsed well

Hi
= encoded is %3D, so that's where you are missing something I think.

greetz
Hans

At 10:41 15/08/2003 -0500, Vijay Kandy wrote:
Hello All,

I have a servlet whose expected parameter is ZAZBZ and its value is
CZlYnXtAIBDC=D9W7V
So calling http://host/context/name?ZAZBZ=CZlYnXtAIBDC=D9W7V would cause

System.out.println(request.getParameter(ZAZBZ));

to print CZlYnXtAIBDC=D9W7V in Tomcat 3.2.3. But in tomcat 4.0.4 the
printout is CZlYnXtAIBDC
The results are the same when the URL is encoded because = remains the
same.
Looks like parameter value cannot contain =
Please let me know if I am missing something.

Sincerely,
Vijay


-
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: Request parameter value containing = is not parsed well

2003-08-15 Thread Shapira, Yoav

Howdy,
I didn't even URLEncode the param value, I simply entered it into the
browser's address bar, and the servlet just does
request.getParameter(paramName).  No encoding or decoding.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Vijay Kandy [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 12:37 PM
To: 'Tomcat Users List'
Subject: RE: Request parameter value containing = is not parsed well

Thank you for your testing. So did you URLEncode the param value? Is
there
a
trick not to URLEncode and still retain the value. Because was alright
on
3.2.3.
Sincerely,
vijay

Howdy,
I don't know (and don't really care much about at this point) 4.0.4,
but
I can't reproduce what you claim on 4.1.27.  The behavior is correct
with equal signs in param value, they are retained.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Vijay Kandy [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 11:41 AM
To: 'Tomcat Users List'
Subject: Request parameter value containing = is not parsed well

Hello All,

I have a servlet whose expected parameter is ZAZBZ and its value is
CZlYnXtAIBDC=D9W7V
So calling http://host/context/name?ZAZBZ=CZlYnXtAIBDC=D9W7V would
cause

System.out.println(request.getParameter(ZAZBZ));

to print CZlYnXtAIBDC=D9W7V in Tomcat 3.2.3. But in tomcat 4.0.4 the
printout is CZlYnXtAIBDC
The results are the same when the URL is encoded because = remains the
same.
Looks like parameter value cannot contain =
Please let me know if I am missing something.

Sincerely,
Vijay


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




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]




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]



Setting error page for servlets

2003-08-15 Thread James Michelich
Is there a way to set the error page for a servlet (i.e. something 
comparable to using the page directive with 'errorPage=error.jsp' in 
jsp's)?

Thanks,

James

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



RE: Setting error page for servlets

2003-08-15 Thread Shapira, Yoav

Howdy,
Seeing how a JSP is a servlet, I'd be very surprised if there was
something you could do with JSPs and not with a servlet ;)

Use the error-page directive in web.xml ;)  The Servlet Spec section
on the deployment descriptor has details and examples.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: James Michelich [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 1:00 PM
To: [EMAIL PROTECTED]
Subject: Setting error page for servlets

Is there a way to set the error page for a servlet (i.e. something
comparable to using the page directive with 'errorPage=error.jsp' in
jsp's)?

Thanks,

James

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




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: can a taglib include a .jsp file ?

2003-08-15 Thread Mufaddal Khumri
thanks a zillion, that worked :)

On Friday, August 15, 2003, at 09:17  AM, Bill Barker wrote:

Assuming that your Tag extends TagSupport try:
   pageContext.include(mySomething.jsp);
Mufaddal Khumri [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I know what the problem is and I know what I am trying to do wont get
translated... thats why i have asked for a better solution ! I asked 
if
there was a way ... the answer to that is a yes or no (since I might
have missed something) .

On Friday, August 15, 2003, at 03:03  AM, RANDAD,KAILASH
(HP-PaloAlto,ex1) wrote:
Basics, not clear!!!
JSP file gets translated to java file. During translation, tags 
include
related code gets converted to java code. Now, comes java compiler in
picture which does not know anything about jsp. So, how can you 
expect
or
design such wrong thing.

Solution to your problem - Better define the code in 
mySomething.jsp
as
java function and call that function in include file as well custom
tag, and
use one at a time.

Regards
KP
-Original Message-
From: Mufaddal Khumri [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2003 1:45 AM
To: Tomcat List
Subject: can a taglib include a .jsp file ?
Hi,

I have a taglib that needs to include a .jsp file .. .how can i do 
so ?

if i try doing a out.println( %@ include file=\ +
mySomething.jsp
+ \ %) in my taglibrary called myTag it just spits out the exact
same line in the output. The same happens when i use a
out.println(jsp:include ).
I can have if else blocks instead my taglibrary and avoid including 
the
mySomething.jsp. Is there a better solution than this ?

Thanks.

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




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


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


RE: Simplified Chinese to UTF-8

2003-08-15 Thread Nathan Christiansen
Thanks Dan.

I did download the filter code and tried all of the Simplified Chinese encodings 
without luck.

I am unsure which encoding that the IME is sending (since I do not read Chinese myself 
and can't read the help manual).

Looking through the filter code, it would be exactly similar if I added the 
request.setCharacterEncoding() call to the top of the JSP page since I am calling the 
JSP page directly.

Any other suggestions?

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Dan Tran [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 10:54 AM
To: Nathan Christiansen
Subject: Re: Simplified Chinese to UTF-8


You need to implement a filter according the folowing
link

http://www.anassina.com/struts/i18n/i18n.html

-Dan

- Original Message - 
From: Nathan Christiansen [EMAIL PROTECTED]
Newsgroups: Tomcat
Sent: Friday, August 15, 2003 9:33 AM
Subject: Simplified Chinese to UTF-8


 I have an annoying problem that I am trying to figure out.

 I need to support Simplified Chinese in a webapp that also supports
ISO-8859-1.

 I figure the best way is to make my web pages encoded in UTF-8.

 The database access and display works, but I am having trouble with
getting post data to come out correctly.

 I am running Tomcat 4.1.24 on a RedHat Linux 7.1 box with JDK 1.4.1_01.

 I have tried using the following JSP file to test the post input from a
Windows 2000 Server box that allows me to input Simplified Chinese. But
every encoding in the JSP file gives me garbage back.

 Any ideas?

 Thanks.


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



RE: Setting error page for servlets

2003-08-15 Thread James Michelich
Thanks for the info.

The problem with that solution is this - I have written my own 
exception, and cannot override the list of exceptions associated with 
the doPost() method.

Am I just misinterpreting your previous post, or is there another 
solution for this?

Thanks for the help,

James


-- Original message --
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 15, 2003 1:14:07 PM
Subject: RE: Setting error page for servlets


Howdy,
Seeing how a JSP is a servlet, I'd be very surprised if there was
something you could do with JSPs and not with a servlet ;)

Use the error-page directive in web.xml ;)  The Servlet Spec section
on the deployment descriptor has details and examples.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: James Michelich [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 1:00 PM
To: [EMAIL PROTECTED]
Subject: Setting error page for servlets

Is there a way to set the error page for a servlet (i.e. something
comparable to using the page directive with 'errorPage=error.jsp' in
jsp's)?

Thanks,

James

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




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: Setting error page for servlets

2003-08-15 Thread Shapira, Yoav

Howdy,

The problem with that solution is this - I have written my own
exception, and cannot override the list of exceptions associated with
the doPost() method.

Hmmm... I think the error page might still be able to work.  Try making
your exception a runtime one, so that you don't have to declare it.  The
container will still map it according to the definition in web.xml
(which will have the class of your custom exception).

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]



tracking the download of a file

2003-08-15 Thread Mark W. Webb
I am working on a program that checks the file download progress and 
audits the results.  I have noticed with netscape browsers, that if a 
user starts downloading a file, and the Save As window comes up, there 
is a small amount ~200K worth of data that gets written to the browser. 

Is there a way to prevent this?  Because if the file is small, less than 
100K, I do not know if the user actually downloaded the entire file, or 
if they just cancelled the download.

thanks in advance


smime.p7s
Description: S/MIME Cryptographic Signature


RE: Simplified Chinese to UTF-8 (SOLVED)

2003-08-15 Thread Nathan Christiansen
Sorry Dan,

I used the Filter as is (using UTF-8) and removed the code to try to convert it again 
and it works beautiflly for both Chinese and any type of Japanese I can throw at it.

Thanks again. 

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Nathan Christiansen 
Sent: Friday, August 15, 2003 12:25 PM
To: [EMAIL PROTECTED]
Subject: RE: Simplified Chinese to UTF-8


Thanks Dan.

I did download the filter code and tried all of the Simplified Chinese encodings 
without luck.

I am unsure which encoding that the IME is sending (since I do not read Chinese myself 
and can't read the help manual).

Looking through the filter code, it would be exactly similar if I added the 
request.setCharacterEncoding() call to the top of the JSP page since I am calling the 
JSP page directly.

Any other suggestions?

-- Nathan Christiansen
   Tahitian Noni International
   http://www.tahitiannoni.com


-Original Message-
From: Dan Tran [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 10:54 AM
To: Nathan Christiansen
Subject: Re: Simplified Chinese to UTF-8


You need to implement a filter according the folowing
link

http://www.anassina.com/struts/i18n/i18n.html

-Dan

- Original Message - 
From: Nathan Christiansen [EMAIL PROTECTED]
Newsgroups: Tomcat
Sent: Friday, August 15, 2003 9:33 AM
Subject: Simplified Chinese to UTF-8


 I have an annoying problem that I am trying to figure out.

 I need to support Simplified Chinese in a webapp that also supports
ISO-8859-1.

 I figure the best way is to make my web pages encoded in UTF-8.

 The database access and display works, but I am having trouble with
getting post data to come out correctly.

 I am running Tomcat 4.1.24 on a RedHat Linux 7.1 box with JDK 1.4.1_01.

 I have tried using the following JSP file to test the post input from a
Windows 2000 Server box that allows me to input Simplified Chinese. But
every encoding in the JSP file gives me garbage back.

 Any ideas?

 Thanks.


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


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



WebApp and database not working

2003-08-15 Thread Vid Bijelic
Hi,

When I open web page with database connection directly
(not via Apache and WebApp) it works fine (displays
records from database), but when I open the same page
through Apache using WebApp I got Null Pointer
Exception. 

I hope some one has a suggestion for this.

I am using Tomcat4.1, Apache2.0.4, RedHat
9.0,j2sdk1.4.2, WebApp, InterClient and InterBase 6.0
database.

Here is the Exception I am getting:
--
exception 

org.apache.jasper.JasperException
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.connector.warp.WarpRequestHandler.handle(Unknown
Source)
at
org.apache.catalina.connector.warp.WarpConnection.run(Unknown
Source)
at java.lang.Thread.run(Thread.java:534)


root cause 

java.lang.NullPointerException
at
org.apache.jsp.index1_jsp._jspService(index1_jsp.java:61)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at

RE: WebApp and database not working

2003-08-15 Thread Shapira, Yoav

Howdy,
Post the relevant code that throws the NPE.  ;)

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Vid Bijelic [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 3:13 PM
To: [EMAIL PROTECTED]
Subject: WebApp and database not working

Hi,

When I open web page with database connection directly
(not via Apache and WebApp) it works fine (displays
records from database), but when I open the same page
through Apache using WebApp I got Null Pointer
Exception.

I hope some one has a suggestion for this.

I am using Tomcat4.1, Apache2.0.4, RedHat
9.0,j2sdk1.4.2, WebApp, InterClient and InterBase 6.0
database.

Here is the Exception I am getting:
--
exception

org.apache.jasper.JasperException
   at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j
ava:
248)
   at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295
)
   at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
   at
javax.servlet.http.HttpServlet.service(HttpServlet.java)
   at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
atio
nFilterChain.java:247)
   at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
terC
hain.java:193)
   at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
ve.j
ava:260)
   at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
keNext(StandardPipeline.java:643)
   at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
480)
   at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
   at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal
ve.j
ava:191)
   at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
keNext(StandardPipeline.java:643)
   at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
480)
   at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
   at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:24
15)
   at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav
a:18
0)
   at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
keNext(StandardPipeline.java:643)
   at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherV
alve
.java:170)
   at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
keNext(StandardPipeline.java:641)
   at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav
a:17
2)
   at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
keNext(StandardPipeline.java:641)
   at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
480)
   at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
   at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve
.jav
a:174)
   at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
keNext(StandardPipeline.java:643)
   at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
480)
   at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
   at
org.apache.catalina.connector.warp.WarpRequestHandler.handle(Unknown
Source)
   at
org.apache.catalina.connector.warp.WarpConnection.run(Unknown
Source)
   at java.lang.Thread.run(Thread.java:534)


root cause

java.lang.NullPointerException
   at
org.apache.jsp.index1_jsp._jspService(index1_jsp.java:61)
   at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
   at
javax.servlet.http.HttpServlet.service(HttpServlet.java)
   at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j
ava:
204)
   at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295
)
   at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
   at
javax.servlet.http.HttpServlet.service(HttpServlet.java)
   at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
atio
nFilterChain.java:247)
   at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
terC
hain.java:193)
   at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
ve.j
ava:260)
   at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
keNext(StandardPipeline.java:643)
   at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
480)
   at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
   at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal
ve.j
ava:191)
   at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
invo
keNext(StandardPipeline.java:643)
   at

RE: JNDI DataSource Realm

2003-08-15 Thread Madere, Colin
Ok, so changing the dataSourceName attribute in the Realm config (as you
suggest which contradicts the HOWTO) to the short name I've given my
resource makes the Realm auth work with the globally defined datasource.
Yay!

However, when trying to connect to the datasource (moved the jdbc/Auth
resource from DefaultContext tag to GlobalNamingResources tag), my
servlet application still gives the same Name jdbc is not bound in this
Context error.

You mention not having to put a resource-ref in the context specific
web.xml file, and I assume your suggestion to put ResourceLink tag in the
Context (in my case putting it in the DefaultContext tag so it works, or
should, for all autodeployed contexts) is what you mean removes the need for
the those aforementioned entries.  However, it doesn't appear to work (as it
_does_ work when I move the whole Resource/ResourceParams tags into the
DefaultContext tag.  Don't want to do this as I will have multiple virtual
hosts using the same resource...)

Doubt it's of importance, but adding the resource-ref you suggest is not
necessary produces the elusive Cannot load JDBC driver class 'null' error,
which I believe is unrelated.

Any more ideas why my app would not see the global resource as defined below
as a global resource and then resource-linked in the default context?

-Original Message-
From: Scott Stewart [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 13, 2003 5:27 PM
To: 'Tomcat Users List'
Subject: RE: JNDI DataSource Realm


I posted this awhile back (for MySQL), but here it is again.  Also, when you
define your DataSource in this manner, you do not need the resource-ref
node in your context-specific web.xml files.


The global DataSource definition


!-- Global JNDI resources --
GlobalNamingResources

!-- Editable user database that can also be used by JNDI
DatabaseRealm to authenticate users --
Resource name=jdbc/MySQLConnectPool 
  auth=Container 
  type=javax.sql.DataSource /

ResourceParams name=jdbc/MySQLConnectPool 

parameter
nameusername/name
value/value
/parameter

parameter
namepassword/name
value/value
/parameter

parameter
namedriverClassName/name
valuecom.mysql.jdbc.Driver/value
/parameter

parameter
nameurl/name
valuejdbc:mysql://your IP here:3306/your DB name
here?autoReconnect=true/value
/parameter

parameter
nameremoveAbandoned/name
valuetrue/value
/parameter

parameter
nameremoveAbandonedTimeout/name
value60/value
/parameter

parameter
namelogAbandoned/name
valuetrue/value
/parameter

parameter
namemaxActive/name
value200/value
/parameter

parameter
namemaxIdle/name
value3/value
/parameter

parameter
namemaxWait/name
value100/value
/parameter

/ResourceParams

/GlobalNamingResources


Realm definition using global DataSource


Realm  
className=org.apache.catalina.realm.DataSourceRealm 
dataSourceName=jdbc/MySQLConnectPool
userTable=customers 
userNameCol=customer_username 
userCredCol=customer_password
userRoleTable=roles 
roleNameCol=role 
debug=0
/


Context reference to global DataSource
--

ResourceLink name=jdbc/MySQLConnectPool
  global=jdbc/MySQLConnectPool
  type=javax.sql.DataSource /
  

Hope this helps!!

Thanks,

Scott Stewart
[Manager, Software Development]
[EMAIL PROTECTED]

ClearSky Mobile Media, Inc.
56 E. Pine St. Suite 200
Orlando, FL 32801
USA



-Original Message-
From: Madere, Colin [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 13, 2003 5:17 PM
To: 'Tomcat Users List'
Subject: JNDI DataSource Realm


Tomcat 4.1.27
PostgreSQL 7.3.4
pg73jdbc3.jar

Trying to use JNDI as a Realm source for 

RE: JNDI References To Tomcat 4.1

2003-08-15 Thread Madere, Colin
I think your inclinations that Tomcat is not a naming service are correct.
I have not seen reference to anything that suggests you can set up resources
in Tomcat that are available via JNDI.  JBoss, certainly, as it does provide
a JNDI server (whatever the appropriate name for that is), as I've used that
with JMS/JBossMQ.  AFAIK, the Tomcat JNDI setup stuff is just for processes
internal to Tomcat, but that is an educated guess, not a known fact :)

-Original Message-
From: Jason Mowat [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 15, 2003 12:14 PM
To: [EMAIL PROTECTED]
Subject: JNDI References To Tomcat 4.1


Greetings,

I am trying to create a standalone application that references a DBCP on
Tomcat.  I'm not sure if I can do this; I've seem some articles that seem to
suggest that it can be done, but again, I'm not sure.  I've read
http://www.mail-archive.com/[EMAIL PROTECTED]/msg08353.html. 

I have set up in tomcat/conf/server.xml the following context info:

  DefaultContext
Resource name=jdbc/test_db auth=Container
type=javax.sql.DataSource/

ResourceParams name=jdbc/test_db
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter

  parameter
namedriverClassName/name
valueoracle.jdbc.driver.OracleDriver/value
  /parameter
  
  parameter
nameurl/name
valuejdbc:oracle:thin:@internal.sbgh.mb.ca:1521:test/value

  /parameter
  
  parameter
nameusername/name
valuetest/value
  /parameter
  
  parameter
namepassword/name
valuetest/value
  /parameter
  
  parameter
namemaxActive/name
value20/value
  /parameter   
  
  parameter
namemaxIdle/name
value3/value
  /parameter
  
  parameter
namemaxWait/name
value100/value
  /parameter
/ResourceParams
 
  /DefaultContext

Note that I have not created any references in a web.xml, since I will not
be running an application, per se, from Tomcat.  PERHAPS THIS IS WHERE MY
PROBLEM IS?

The client code I am using is not a servlet or a JSP; it's a simple piece of
code to see if I can communicate with the database pool on Tomcat as
configured above.

Hashtable env = new Hashtable();
env.put(
Context.INITIAL_CONTEXT_FACTORY, 
org.apache.commons.dbcp.BasicDataSourceFactory
);

//  ***  THIS IS ANOTHER AREA WHERE I MAY BE WRONG! *** env.put(
Context.PROVIDER_URL, 
http://localhost:8080; 
);

try {   
InitialContext initCtx = new InitialContext(env);
DataSource ds =
(DataSource)initCtx.lookup(java:comp/env/jdbc/test_db);
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery(SELECT * FROM tbl_test);
conn.close();
initCtx.close();
}
catch(NamingException e) {
fail(Naming exception thrown);
}
catch (SQLException e) {
fail(SQL Exception thrown);
}

I start Tomcat, assuming that the pool is set up.  Then I use the client to
try to get an initial context from it.  This throws a naming exception,
because it doesn't know how to get an initial context for
org.apache.commons.dbcp.BasicDataSourceFactory at http://localhost:8080. 

My first question: can I do this?
My second question: If I can't do it like this, do I need to set up a JNDI
provider (like on JBoss) and set up the pooling there? My final question:
It feels as if my problem is simply setting up the PROVIDER_URL properly
so that it can get the context from Tomcat.  I've done LDAP PROVIDER_URLs
before, but never one that gets a data source factory from a servlet
container.  Can I use http over port 8080 to get the data source factory?
Is there a different mechanism for getting the factory from code that is not
residing within the servlet container?  Can this even be done on Tomcat?

I appreciate any help that anyone can provide.

Cheers,
Jason


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



Trouble with Apache 1.3.28/Tomcat 4.124/mod_jk 1.24

2003-08-15 Thread Henry Kwan
Hi, I'm trying to setup a Apache/Tomcat test server and am having some 
problems.  Apache works fine on port 80 and Tomcat works fine on 8080 but I 
can't get mod_jk to connect them.  I'm running Solaris 8 SPARC and I 
compiled Apache from source, grabbed the Tomcat binary, and compiled mod_jk 
from source.

Here's what I have in my httpd.conf:

LoadModule jk_module libexec/mod_jk.so
...
VirtualHost xx.xx.xx.xx 
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /opt/tomcat/jakarta-tomcat/webapps
ServerName tomcat.xxx.com
DirectoryIndex index.htm index.html
Directory /opt/tomcat/jakarta-tomcat/webapps
Options Indexes FollowSymLinks
AllowOverride All
/Directory
ErrorLog /export/home/httpd/logs/tomcat_error
CustomLog /export/home/httpd/logs/tomcat_access common
/VirtualHost
IfModule mod_jk.c
   JkWorkersFile /opt/tomcat/jakarta-tomcat/conf/workers.properties
   JkLogFile /opt/tomcat/jakarta-tomcat/logs/mod_jk.log

   JkLogLevel debug

   JkAutoAlias /opt/tomcat/jakarta-tomcat/webapps
   JkMount /*.jsp ajp13
   JkMount /*/servlet/ ajp13
   JkMount /examples ajp13
   JkMount /examples/* ajp13
/IfModule

I have this workers.properties setup:

worker.list=testWorker
worker.testWorker.port=8009
worker.testWorker.host=localhost
worker.testWorker.type=ajp13

And I didn't touch the Connector Classname entry in server.xml:

!-- Define an AJP 1.3 Connector on port 8009 --
!--
Connector className=org.apache.ajp.tomcat4.Ajp13Connector
   port=8009 minProcessors=5 maxProcessors=75
   acceptCount=10 debug=0/

But whenever I try to access any JSP pages via Apache, I get a 500 Internal 
Server Error with these entries in the mod_jk.log:

[Fri Aug 15 12:51:57 2003]  [jk_uri_worker_map.c (460)]: Into 
jk_uri_worker_map_t::map_uri_to_worker
[Fri Aug 15 12:51:57 2003]  [jk_uri_worker_map.c (477)]: Attempting to map 
URI '/examples/jsp/index.html'
[Fri Aug 15 12:51:57 2003]  [jk_uri_worker_map.c (502)]: 
jk_uri_worker_map_t::map_uri_to_worker, Found a context match ajp13 - 
/examples/
[Fri Aug 15 12:51:57 2003]  [jk_worker.c (132)]: Into wc_get_worker_for_name 
ajp13
[Fri Aug 15 12:51:57 2003]  [jk_worker.c (136)]: wc_get_worker_for_name, 
done did not found a worker

Any ideas or tips would be greatly appreciated.

Thanks.


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



RE: Setting error page for servlets

2003-08-15 Thread James Michelich
Thanks! That solution worked out very well for me.

One other quick question, if you don't mind - 

I've checked the servlet specs and found that the request.getRemoteAddr
() method does not throw any exceptions, but I'd like to know if this 
method is always guaranteed to return a non-null, valid IP address.

Thanks,

James



-- Original message --
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 15, 2003 2:36:33 PM
Subject: RE: Setting error page for servlets


Howdy,

The problem with that solution is this - I have written my own
exception, and cannot override the list of exceptions associated with
the doPost() method.

Hmmm... I think the error page might still be able to work.  Try making
your exception a runtime one, so that you don't have to declare it.  
The
container will still map it according to the definition in web.xml
(which will have the class of your custom exception).

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]



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



RE: Setting error page for servlets

2003-08-15 Thread Shapira, Yoav

Howdy,

I've checked the servlet specs and found that the request.getRemoteAddr
() method does not throw any exceptions, but I'd like to know if this
method is always guaranteed to return a non-null, valid IP address.

You should start a different thread for a different question ;) ;)

No, it's not guaranteed to return a non-null, valid IP address.

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: url-pattern and realms security

2003-08-15 Thread Madere, Colin
That is a concrete path and you must be joking if you are suggesting to
explicitly define each and every URL as a web-resource.  The idea of
hierarchical authorization of resources is a very sound idea and other auth
schemes follow this trickle-down idea that you secure the whole tree with
a general user auth (everyone can see it) and then directories beneath that
have content specific to groups and are secured as needed.  Any new
directory added that does not need special treatment is automatically
secured under the general rule.  Otherwise you'll likely have a heavy
management burden of your deployment descriptor with 100s of web-resource
tags.  The spec is shallow here, I hope it will improve in the next version.

From another angle, I don't want the root to be insecure and only subdirs be
secured.  No other option there that I know of...

And yet another angle, if you use explicit url-patterns and a content
developer drops in something that happens not to match it, it is not a
secure item.  Unless you are in complete control and have script parameters
of content, it's not an option.

-Original Message-
From: Alexander Vavilin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 14, 2003 11:08 PM
To: Tomcat Users List
Subject: Re[2]: url-pattern and realms security


Hello Colin,

Of course, your /* directive will overwrite all. You should use more
concrete names and paths.

-- 
Best regards,
Alexander
mailto:[EMAIL PROTECTED]

Friday, August 15, 2003, 4:53:36 AM, you wrote:

MC Sorry sorry, web-resource-name elements are unique, just a copying 
MC error.

MC -Original Message-
MC From: Alexander Vavilin [mailto:[EMAIL PROTECTED]
MC Sent: Thursday, August 14, 2003 10:33 PM
MC To: Tomcat Users List
MC Subject: Re: url-pattern and realms security


MC Hello Colin,

MC I am not sure, but I think you cannot do this, first an
web-resource-name
MC element means an UNIQUE name. Can you understand ? You must give it
MC different names. Second thing, I never heard about http-method
element.

MC Hope it will help.


-
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: WebApp and database not working

2003-08-15 Thread Vid Bijelic
Hi Yoav,

Here it the jsp and servlet code I am using, again it
works when accessed directly but via Apache and WebApp
no.

Thanks,

Vid

Here is JSP Page---

% //@ page errorPage=errPage.jsp %

%
WebSql.GetRec nhdbRec = new WebSql.GetRec();
nhdbRec.init(select field1,field2,field3 from
table);
%

html
head
titleDB Test/title

/head
body
h2Results/h2
select name=Test
%
while(nhdbRec.getResultSet1().next())
{
%

option%=nhdbRec.getResultSet().getString(2)%br/option
%
}
%

/select

/body
/html


--Here is the Servlet-

package WebSql;

import javax.naming.*;
import javax.sql.*;
import java.sql.*;

public class GetRec 
{
  //create global variables that can be returned via
public get functions
  ResultSet rst;

  public void init(String sqlStr) {
try{
  Context ctx = new InitialContext();  
  if(ctx == null ) 
  throw new Exception(Boom - No Context);
  
  DataSource ds = 
(DataSource)ctx.lookup(
   java:comp/env/jdbc/dbWeb);

  if (ds != null) {
//open connection
Connection conn = ds.getConnection();
   
//if connecction open create and execute
record sets
if(conn != null)  {
Statement stmt = conn.createStatement();

rst = stmt.executeQuery(sqlStr);
connJsp = conn;
}
  }
}catch(Exception e) {
  e.printStackTrace();
}
 }

 public ResultSet getResultSet() { return rst; }

--


--- Shapira, Yoav [EMAIL PROTECTED] wrote:
 
 Howdy,
 Post the relevant code that throws the NPE.  ;)
 
 Yoav Shapira
 Millennium ChemInformatics
 
 
 -Original Message-
 From: Vid Bijelic [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 15, 2003 3:13 PM
 To: [EMAIL PROTECTED]
 Subject: WebApp and database not working
 
 Hi,
 
 When I open web page with database connection
 directly
 (not via Apache and WebApp) it works fine (displays
 records from database), but when I open the same
 page
 through Apache using WebApp I got Null Pointer
 Exception.
 
 I hope some one has a suggestion for this.
 
 I am using Tomcat4.1, Apache2.0.4, RedHat
 9.0,j2sdk1.4.2, WebApp, InterClient and InterBase
 6.0
 database.
 
 Here is the Exception I am getting:
 --
 exception
 
 org.apache.jasper.JasperException
  at

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j
 ava:
 248)
  at

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295
 )
  at

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
  at

javax.servlet.http.HttpServlet.service(HttpServlet.java)
  at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
 atio
 nFilterChain.java:247)
  at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
 terC
 hain.java:193)
  at

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
 ve.j
 ava:260)
  at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
 invo
 keNext(StandardPipeline.java:643)
  at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
 480)
  at

org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at

org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal
 ve.j
 ava:191)
  at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
 invo
 keNext(StandardPipeline.java:643)
  at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
 480)
  at

org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at

org.apache.catalina.core.StandardContext.invoke(StandardContext.java:24
 15)
  at

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav
 a:18
 0)
  at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
 invo
 keNext(StandardPipeline.java:643)
  at

org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherV
 alve
 .java:170)
  at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
 invo
 keNext(StandardPipeline.java:641)
  at

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav
 a:17
 2)
  at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
 invo
 keNext(StandardPipeline.java:641)
  at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
 480)
  at

org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve
 .jav
 a:174)
  at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.
 invo
 keNext(StandardPipeline.java:643)
  at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
 

Re: Trouble with Apache 1.3.28/Tomcat 4.124/mod_jk 1.24

2003-08-15 Thread G. Wade Johnson
I'm no expert, but one thing you have different from my configuration
is the connector. Mine looks like

Connector className=org.apache.coyote.tomcat4.CoyoteConnector
   port=8009 minProcessors=5 maxProcessors=75
   enableLookups=true redirectPort=8443
   acceptCount=100 debug=0 connectionTimeout=2
   useURIValidationHack=false disableUploadTimeout=true
  
protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler/

I have this vague recollection of someone saying to use CoyoteConnector
instead of Ajp13Connector. But, that could just be a random synapse
misfire.

G. Wade

Henry Kwan wrote:
 
 Hi, I'm trying to setup a Apache/Tomcat test server and am having some
 problems.  Apache works fine on port 80 and Tomcat works fine on 8080 but I
 can't get mod_jk to connect them.  I'm running Solaris 8 SPARC and I
 compiled Apache from source, grabbed the Tomcat binary, and compiled mod_jk
 from source.
 
 Here's what I have in my httpd.conf:
 
 LoadModule jk_module libexec/mod_jk.so
 ...
 VirtualHost xx.xx.xx.xx
 ServerAdmin [EMAIL PROTECTED]
 DocumentRoot /opt/tomcat/jakarta-tomcat/webapps
 ServerName tomcat.xxx.com
 DirectoryIndex index.htm index.html
 Directory /opt/tomcat/jakarta-tomcat/webapps
 Options Indexes FollowSymLinks
 AllowOverride All
 /Directory
 ErrorLog /export/home/httpd/logs/tomcat_error
 CustomLog /export/home/httpd/logs/tomcat_access common
 /VirtualHost
 IfModule mod_jk.c
JkWorkersFile /opt/tomcat/jakarta-tomcat/conf/workers.properties
JkLogFile /opt/tomcat/jakarta-tomcat/logs/mod_jk.log
 
JkLogLevel debug
 
JkAutoAlias /opt/tomcat/jakarta-tomcat/webapps
JkMount /*.jsp ajp13
JkMount /*/servlet/ ajp13
JkMount /examples ajp13
JkMount /examples/* ajp13
 /IfModule
 
 I have this workers.properties setup:
 
 worker.list=testWorker
 worker.testWorker.port=8009
 worker.testWorker.host=localhost
 worker.testWorker.type=ajp13
 
 And I didn't touch the Connector Classname entry in server.xml:
 
 !-- Define an AJP 1.3 Connector on port 8009 --
 !--
 Connector className=org.apache.ajp.tomcat4.Ajp13Connector
port=8009 minProcessors=5 maxProcessors=75
acceptCount=10 debug=0/
 
 But whenever I try to access any JSP pages via Apache, I get a 500 Internal
 Server Error with these entries in the mod_jk.log:
 
 [Fri Aug 15 12:51:57 2003]  [jk_uri_worker_map.c (460)]: Into
 jk_uri_worker_map_t::map_uri_to_worker
 [Fri Aug 15 12:51:57 2003]  [jk_uri_worker_map.c (477)]: Attempting to map
 URI '/examples/jsp/index.html'
 [Fri Aug 15 12:51:57 2003]  [jk_uri_worker_map.c (502)]:
 jk_uri_worker_map_t::map_uri_to_worker, Found a context match ajp13 -
 /examples/
 [Fri Aug 15 12:51:57 2003]  [jk_worker.c (132)]: Into wc_get_worker_for_name
 ajp13
 [Fri Aug 15 12:51:57 2003]  [jk_worker.c (136)]: wc_get_worker_for_name,
 done did not found a worker
 
 Any ideas or tips would be greatly appreciated.
 
 Thanks.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

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



RE: Trouble with Apache 1.3.28/Tomcat 4.124/mod_jk 1.24

2003-08-15 Thread Cristopher Daniluk
Uhm...

snip

And I didn't touch the Connector Classname entry in server.xml:

!-- Define an AJP 1.3 Connector on port 8009 --
!--
Connector className=org.apache.ajp.tomcat4.Ajp13Connector
   port=8009 minProcessors=5 maxProcessors=75
   acceptCount=10 debug=0/

snip


Notice the !-- before the connector, and the -- shortly thereafter.

That's a comment, so you have that Ajp13Connector commented out at the
moment :)

Try removing the !-- and -- from around the Connector tag and restart
Jakarta.


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



RE: JNDI References To Tomcat 4.1

2003-08-15 Thread Micael
This is mistaken, if you mean what you say.  There is a JDBC resource 
available via JNDI in Tomcat.  You have to code it, of course, but it 
definitely is available.

At 02:53 PM 8/15/2003 -0500, Madere, Colin wrote:
I think your inclinations that Tomcat is not a naming service are correct.
I have not seen reference to anything that suggests you can set up resources
in Tomcat that are available via JNDI.  JBoss, certainly, as it does provide
a JNDI server (whatever the appropriate name for that is), as I've used that
with JMS/JBossMQ.  AFAIK, the Tomcat JNDI setup stuff is just for processes
internal to Tomcat, but that is an educated guess, not a known fact :)
-Original Message-
From: Jason Mowat [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 12:14 PM
To: [EMAIL PROTECTED]
Subject: JNDI References To Tomcat 4.1
Greetings,

I am trying to create a standalone application that references a DBCP on
Tomcat.  I'm not sure if I can do this; I've seem some articles that seem to
suggest that it can be done, but again, I'm not sure.  I've read
http://www.mail-archive.com/[EMAIL PROTECTED]/msg08353.html.
I have set up in tomcat/conf/server.xml the following context info:

  DefaultContext
Resource name=jdbc/test_db auth=Container
type=javax.sql.DataSource/
ResourceParams name=jdbc/test_db
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  parameter
namedriverClassName/name
valueoracle.jdbc.driver.OracleDriver/value
  /parameter
  parameter
nameurl/name
valuejdbc:oracle:thin:@internal.sbgh.mb.ca:1521:test/value
  /parameter

  parameter
nameusername/name
valuetest/value
  /parameter
  parameter
namepassword/name
valuetest/value
  /parameter
  parameter
namemaxActive/name
value20/value
  /parameter
  parameter
namemaxIdle/name
value3/value
  /parameter
  parameter
namemaxWait/name
value100/value
  /parameter
/ResourceParams
  /DefaultContext

Note that I have not created any references in a web.xml, since I will not
be running an application, per se, from Tomcat.  PERHAPS THIS IS WHERE MY
PROBLEM IS?
The client code I am using is not a servlet or a JSP; it's a simple piece of
code to see if I can communicate with the database pool on Tomcat as
configured above.
Hashtable env = new Hashtable();
env.put(
Context.INITIAL_CONTEXT_FACTORY,
org.apache.commons.dbcp.BasicDataSourceFactory
);
//  ***  THIS IS ANOTHER AREA WHERE I MAY BE WRONG! *** env.put(
Context.PROVIDER_URL,
http://localhost:8080;
);
try {
InitialContext initCtx = new InitialContext(env);
DataSource ds =
(DataSource)initCtx.lookup(java:comp/env/jdbc/test_db);
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery(SELECT * FROM tbl_test);
conn.close();
initCtx.close();
}
catch(NamingException e) {
fail(Naming exception thrown);
}
catch (SQLException e) {
fail(SQL Exception thrown);
}
I start Tomcat, assuming that the pool is set up.  Then I use the client to
try to get an initial context from it.  This throws a naming exception,
because it doesn't know how to get an initial context for
org.apache.commons.dbcp.BasicDataSourceFactory at http://localhost:8080.
My first question: can I do this?
My second question: If I can't do it like this, do I need to set up a JNDI
provider (like on JBoss) and set up the pooling there? My final question:
It feels as if my problem is simply setting up the PROVIDER_URL properly
so that it can get the context from Tomcat.  I've done LDAP PROVIDER_URLs
before, but never one that gets a data source factory from a servlet
container.  Can I use http over port 8080 to get the data source factory?
Is there a different mechanism for getting the factory from code that is not
residing within the servlet container?  Can this even be done on Tomcat?
I appreciate any help that anyone can provide.

Cheers,
Jason
-
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]


LEGAL NOTICE

This electronic mail  transmission and any accompanying documents contain 
information belonging to the sender which may be confidential and legally 
privileged.  This information is intended only for the use of the 
individual or entity to whom this electronic mail transmission was sent as 
indicated above. If you are not the intended recipient, any disclosure, 
copying, distribution, or action taken in reliance on the contents of the 
information contained in this 

Re: Trouble with Apache 1.3.28/Tomcat 4.124/mod_jk 1.24

2003-08-15 Thread Henry Kwan
 
 Notice the !-- before the connector, and the -- shortly thereafter.
 
 That's a comment, so you have that Ajp13Connector commented out at the
 moment :)
 
 Try removing the !-- and -- from around the Connector tag and restart
 Jakarta.
 

Hi.  Thanks for pointing that out.  I didn't notice that before.  I removed 
that comment and commented out the CoyoteConnector entry.

Unfortunately, the error message seems to be the same:

[Fri Aug 15 14:57:45 2003]  [jk_uri_worker_map.c (477)]: Attempting to map 
URI '/examples/jsp/index.html'
[Fri Aug 15 14:57:45 2003]  [jk_uri_worker_map.c (502)]: 
jk_uri_worker_map_t::map_uri_to_worker, Found a context match ajp13 - 
/examples/
[Fri Aug 15 14:57:45 2003]  [jk_worker.c (132)]: Into wc_get_worker_for_name 
ajp13
[Fri Aug 15 14:57:45 2003]  [jk_worker.c (136)]: wc_get_worker_for_name, 
done did not found a worker

There is something listening at 8009 (since I can telnet to it) and I 
noticed this entry earlier in the log:

[Fri Aug 15 14:57:35 2003]  [jk_worker.c (88)]: Into wc_open
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (222)]: Into build_worker_map, 
creating 1 workers
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (228)]: build_worker_map, creating 
worker testWorker
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (148)]: Into wc_create_worker
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (162)]: wc_create_worker, about to 
create instance testWorker of ajp13
[Fri Aug 15 14:57:35 2003]  [jk_ajp13_worker.c (108)]: Into 
ajp13_worker_factory
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (171)]: wc_create_worker, about to 
validate and init testWorker
[Fri Aug 15 14:57:35 2003]  [jk_ajp_common.c (1343)]: Into 
jk_worker_t::validate
[Fri Aug 15 14:57:35 2003]  [jk_ajp_common.c (1364)]: In 
jk_worker_t::validate for worker testWorker contact is localhost:8009
[Fri Aug 15 14:57:35 2003]  [jk_ajp_common.c (1397)]: Into jk_worker_t::init
[Fri Aug 15 14:57:35 2003]  [jk_ajp_common.c (1421)]: In jk_worker_t::init, 
setting socket timeout to 0
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (187)]: wc_create_worker, done
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (238)]: build_worker_map, removing 
old testWorker worker 
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (250)]: build_worker_map, done
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (111)]: wc_open, done 1


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



RE: Trouble with Apache 1.3.28/Tomcat 4.124/mod_jk 1.24

2003-08-15 Thread Cristopher Daniluk
Sorry, I forgot to mention in my first post:

   JkMount /*.jsp ajp13
   JkMount /*/servlet/ ajp13
   JkMount /examples ajp13
   JkMount /examples/* ajp13

Where you have ajp13, mod_jk is expecting the name of the worker - in
this case testWorker. Try:

   JkMount /*.jsp testWorker
   JkMount /*/servlet/ testWorker
   JkMount /examples testWorker
   JkMount /examples/* testWorker

Cris

-Original Message-
From: Henry Kwan [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 15, 2003 6:07 PM
To: [EMAIL PROTECTED]
Subject: Re: Trouble with Apache 1.3.28/Tomcat 4.124/mod_jk 1.24


 
 Notice the !-- before the connector, and the -- shortly thereafter.
 
 That's a comment, so you have that Ajp13Connector commented out at the

 moment :)
 
 Try removing the !-- and -- from around the Connector tag and 
 restart Jakarta.
 

Hi.  Thanks for pointing that out.  I didn't notice that before.  I
removed 
that comment and commented out the CoyoteConnector entry.

Unfortunately, the error message seems to be the same:

[Fri Aug 15 14:57:45 2003]  [jk_uri_worker_map.c (477)]: Attempting to
map 
URI '/examples/jsp/index.html'
[Fri Aug 15 14:57:45 2003]  [jk_uri_worker_map.c (502)]: 
jk_uri_worker_map_t::map_uri_to_worker, Found a context match ajp13 - 
/examples/
[Fri Aug 15 14:57:45 2003]  [jk_worker.c (132)]: Into
wc_get_worker_for_name 
ajp13
[Fri Aug 15 14:57:45 2003]  [jk_worker.c (136)]: wc_get_worker_for_name,

done did not found a worker

There is something listening at 8009 (since I can telnet to it) and I 
noticed this entry earlier in the log:

[Fri Aug 15 14:57:35 2003]  [jk_worker.c (88)]: Into wc_open [Fri Aug 15
14:57:35 2003]  [jk_worker.c (222)]: Into build_worker_map, 
creating 1 workers
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (228)]: build_worker_map,
creating 
worker testWorker
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (148)]: Into wc_create_worker
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (162)]: wc_create_worker, about
to 
create instance testWorker of ajp13
[Fri Aug 15 14:57:35 2003]  [jk_ajp13_worker.c (108)]: Into 
ajp13_worker_factory
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (171)]: wc_create_worker, about
to 
validate and init testWorker
[Fri Aug 15 14:57:35 2003]  [jk_ajp_common.c (1343)]: Into 
jk_worker_t::validate
[Fri Aug 15 14:57:35 2003]  [jk_ajp_common.c (1364)]: In 
jk_worker_t::validate for worker testWorker contact is localhost:8009
[Fri Aug 15 14:57:35 2003]  [jk_ajp_common.c (1397)]: Into
jk_worker_t::init [Fri Aug 15 14:57:35 2003]  [jk_ajp_common.c (1421)]:
In jk_worker_t::init, 
setting socket timeout to 0
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (187)]: wc_create_worker, done
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (238)]: build_worker_map,
removing 
old testWorker worker 
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (250)]: build_worker_map, done
[Fri Aug 15 14:57:35 2003]  [jk_worker.c (111)]: wc_open, done 1


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



NPE with getContext() in a jsp

2003-08-15 Thread Chris Cheshire
Hi,

Using tomcat 4.0.24, I have some context-params defined in my web.xml.

In my servlets, I am able to access these values with

getServletContext().getInitParameter(some name)

However, if I try and do the same from a jsp page in this web 
application I get the following NPE

java.lang.NullPointerException
   at 
javax.servlet.GenericServlet.getServletContext(GenericServlet.java:204)
   at org.apache.jsp.main_jsp.getIntContextParam(main_jsp.java:45)
   at org.apache.jsp.main_jsp.init(main_jsp.java:73)
...

It appears getServletContext() is the culprit. How do I retrieve the 
context-params from my jsp?

Thanks

Chris



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


RE: JNDI References To Tomcat 4.1

2003-08-15 Thread Yoav Shapira
Howdy,
I believe he was referring to external access to tomcat's JNDI provider,
which is tricky.  In-memory is easy and you're right a JDBC resource can
be configured (just like any other JNDI resource).

Of course, if tomcat's JNDI provider moves into its own jakarta-commons
component as we've been discussing, I bet you'd have standalone JNDI very
soon ;)

Yoav Shapira

On Fri, 15 Aug 2003, Micael wrote:

 This is mistaken, if you mean what you say.  There is a JDBC resource
 available via JNDI in Tomcat.  You have to code it, of course, but it
 definitely is available.

 At 02:53 PM 8/15/2003 -0500, Madere, Colin wrote:
 I think your inclinations that Tomcat is not a naming service are correct.
 I have not seen reference to anything that suggests you can set up resources
 in Tomcat that are available via JNDI.  JBoss, certainly, as it does provide
 a JNDI server (whatever the appropriate name for that is), as I've used that
 with JMS/JBossMQ.  AFAIK, the Tomcat JNDI setup stuff is just for processes
 internal to Tomcat, but that is an educated guess, not a known fact :)
 
 -Original Message-
 From: Jason Mowat [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 15, 2003 12:14 PM
 To: [EMAIL PROTECTED]
 Subject: JNDI References To Tomcat 4.1
 
 
 Greetings,
 
 I am trying to create a standalone application that references a DBCP on
 Tomcat.  I'm not sure if I can do this; I've seem some articles that seem to
 suggest that it can be done, but again, I'm not sure.  I've read
 http://www.mail-archive.com/[EMAIL PROTECTED]/msg08353.html.
 
 I have set up in tomcat/conf/server.xml the following context info:
 
DefaultContext
  Resource name=jdbc/test_db auth=Container
 type=javax.sql.DataSource/
 
  ResourceParams name=jdbc/test_db
parameter
  namefactory/name
  valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
/parameter
 
parameter
  namedriverClassName/name
  valueoracle.jdbc.driver.OracleDriver/value
/parameter
 
parameter
  nameurl/name
  valuejdbc:oracle:thin:@internal.sbgh.mb.ca:1521:test/value
 
/parameter
 
parameter
  nameusername/name
  valuetest/value
/parameter
 
parameter
  namepassword/name
  valuetest/value
/parameter
 
parameter
  namemaxActive/name
  value20/value
/parameter
 
parameter
  namemaxIdle/name
  value3/value
/parameter
 
parameter
  namemaxWait/name
  value100/value
/parameter
  /ResourceParams
 
/DefaultContext
 
 Note that I have not created any references in a web.xml, since I will not
 be running an application, per se, from Tomcat.  PERHAPS THIS IS WHERE MY
 PROBLEM IS?
 
 The client code I am using is not a servlet or a JSP; it's a simple piece of
 code to see if I can communicate with the database pool on Tomcat as
 configured above.
 
 Hashtable env = new Hashtable();
 env.put(
  Context.INITIAL_CONTEXT_FACTORY,
  org.apache.commons.dbcp.BasicDataSourceFactory
 );
 
 //  ***  THIS IS ANOTHER AREA WHERE I MAY BE WRONG! *** env.put(
  Context.PROVIDER_URL,
  http://localhost:8080;
 );
 
 try {
  InitialContext initCtx = new InitialContext(env);
  DataSource ds =
 (DataSource)initCtx.lookup(java:comp/env/jdbc/test_db);
  Connection conn = ds.getConnection();
  Statement stmt = conn.createStatement();
  ResultSet rset = stmt.executeQuery(SELECT * FROM tbl_test);
  conn.close();
  initCtx.close();
 }
 catch(NamingException e) {
  fail(Naming exception thrown);
 }
 catch (SQLException e) {
  fail(SQL Exception thrown);
 }
 
 I start Tomcat, assuming that the pool is set up.  Then I use the client to
 try to get an initial context from it.  This throws a naming exception,
 because it doesn't know how to get an initial context for
 org.apache.commons.dbcp.BasicDataSourceFactory at http://localhost:8080.
 
 My first question: can I do this?
 My second question: If I can't do it like this, do I need to set up a JNDI
 provider (like on JBoss) and set up the pooling there? My final question:
 It feels as if my problem is simply setting up the PROVIDER_URL properly
 so that it can get the context from Tomcat.  I've done LDAP PROVIDER_URLs
 before, but never one that gets a data source factory from a servlet
 container.  Can I use http over port 8080 to get the data source factory?
 Is there a different mechanism for getting the factory from code that is not
 residing within the servlet container?  Can this even be done on Tomcat?
 
 I appreciate any help that anyone can provide.
 
 Cheers,
 Jason
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

MultipartRequest: unexpected end of part

2003-08-15 Thread Hua Hou
I'm using the latest oreilly class MultipartRequest to upload files into my
server. However, whenever I try to upload a big file (say,  100k), I got
the following exception. With smaller file ( 50k), it works fine. I browse
through the tomcat archive list, as well as google site, both indicate that
this bug should've fixed in Tomcat 4.1.24 version. Could somebody help me
out?

Here is the setting of my system:
Tomcat: 4.1.24
JDK: 1.4.1
IIS: 5.x
I am using JK2 connector.

Thanks and really appreciate!

Hua

java.io.IOException: unexpected end of part
at
com.oreilly.servlet.multipart.PartInputStream.fill(PartInputStream.java:100)
at
com.oreilly.servlet.multipart.PartInputStream.read(PartInputStream.java:183)
at
com.oreilly.servlet.multipart.PartInputStream.read(PartInputStream.java:156)
at com.oreilly.servlet.multipart.ParamPart.(ParamPart.java:49)
at
com.oreilly.servlet.multipart.MultipartParser.readNextPart(MultipartParser.j
ava:319)
at com.oreilly.servlet.MultipartRequest.(MultipartRequest.java:246)
at com.oreilly.servlet.MultipartRequest.(MultipartRequest.java:109)
at com.hhc.ProductAdminFileInfo.doPost(ProductAdminFileInfo.java:90)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261)
at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:562)
at
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:620)
at java.lang.Thread.run(Thread.java:534)


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



Re: NPE with getContext() in a jsp

2003-08-15 Thread Chris Cheshire
I fixed my own problem. The call was moved from the %! % scope to the 
% % scope, so that it made it inside the jsp service() method and it 
was able to resolve the context.

Chris

Chris Cheshire wrote:

Hi,

Using tomcat 4.0.24, I have some context-params defined in my web.xml.

In my servlets, I am able to access these values with

getServletContext().getInitParameter(some name)

However, if I try and do the same from a jsp page in this web 
application I get the following NPE

java.lang.NullPointerException
   at 
javax.servlet.GenericServlet.getServletContext(GenericServlet.java:204)
   at org.apache.jsp.main_jsp.getIntContextParam(main_jsp.java:45)
   at org.apache.jsp.main_jsp.init(main_jsp.java:73)
...

It appears getServletContext() is the culprit. How do I retrieve the 
context-params from my jsp?

Thanks

Chris



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




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


where is JSESSIONID?

2003-08-15 Thread Billy Ng
Hi folks;

Anybody knows where is the JSESSIONID cookie is?  I search the whole Cookies folder, I 
can't find it.

Billy Ng



This mailbox protected from junk email by Matador
from MailFrontier, Inc. http://info.mailfrontier.com


exception.getMessage()

2003-08-15 Thread James Michelich
Hello,

I'm having a problem with 'exception.getMessage()' - whenever I throw 
an IOException with a message (i.e. throw new IOException(error) ), 
my error jsp page displays nothing.

I have the java.io.IOException mapped in web.xml to a jsp error page.

Thanks,

James

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



two way trust

2003-08-15 Thread Steve Kwong
Does Tomcat support two way trust (HTTPS) between the client and itself,
where the server requests for a X509 certificate from the client connecting
to it?  I read somewhere that this feature isn't complete in the 4.1.x
version of Tomcat.

I've tried setting the config file as follows (I'm running Jboss
3.0.4/Tomcat 4.1.12 on Win2K server):

   Connector className=org.apache.coyote.tomcat4.CoyoteConnector
port=443 minProcessors=5 maxProcessors=75
enableLookups=false
  acceptCount=100 debug=0 scheme=https secure=true
useURIValidationHack=false disableUploadTimeout=true
 Factory
className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory
  keystoreFile=E:\\jboss-3.0.4_tomcat-4.1.12\\bin\\TOMCAT.KS
keystorePass=TOMCAT
 clientAuth=true protocol=TLS /
  /Connector


I am able to connect to Tomcat using a simple java-based ssl program when
clientAuth=false, but it fails when I set it to true.  I've specified a
trust store (and trust store password) containing all the valid CA certs ,
in an environment variable: CATALINA_OPTS.

The trace of the execution is as follows:

Client write key:
: 82 17 82 46 A4 94 00 54   A8 13 D7 88 B0 92 17 C1  ...F...T
Server write key:
: E0 C4 6E A4 D8 0F 78 23   B7 B0 6A 97 98 46 AD 40  ..n...x#..j..F.@
... no IV for cipher
JsseJCE: Using JSSE internal implementation for cipher RSA/ECB/PKCS1Padding
*** CertificateVerify
main, WRITE: TLSv1 Handshake, length = 134
main, WRITE: TLSv1 Change Cipher Spec, length = 1
JsseJCE: Using JSSE internal implementation for cipher RC4
*** Finished
verify_data:  { 195, 128, 75, 187, 144, 183, 187, 156, 108, 255, 102, 85 }
***
main, WRITE: TLSv1 Handshake, length = 32
main, READ: TLSv1 Alert, length = 2
main, RECV TLSv1 ALERT:  fatal, bad_certificate
main, called closeSocket()
main, handling exception: javax.net.ssl.SSLHandshakeException: Received
fatal al
ert: bad_certificate
javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.b(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275)


Any ideas?

Steve




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



Re: two way trust

2003-08-15 Thread Bill Barker
There have been very many client-cert changes since 4.1.12.  For using Sun's
JVM (which you seem to be using), you probably need to upgrade to at least
4.1.24.  For other vendors, you need to upgrade to 4.1.27.  In particular,
4.1.12 uses JSSE 1.0.x, so you need to upgrade to take advantage of JSSE
1.1.x.

As of 4.1.27, client-cert works fine by itself.  It isn't feature-complete
in the sense that most of the Realms that ship with Tomcat can't handle
client-cert authorization.


Steve Kwong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Does Tomcat support two way trust (HTTPS) between the client and itself,
 where the server requests for a X509 certificate from the client
connecting
 to it?  I read somewhere that this feature isn't complete in the 4.1.x
 version of Tomcat.

 I've tried setting the config file as follows (I'm running Jboss
 3.0.4/Tomcat 4.1.12 on Win2K server):

Connector className=org.apache.coyote.tomcat4.CoyoteConnector
 port=443 minProcessors=5 maxProcessors=75
 enableLookups=false
   acceptCount=100 debug=0 scheme=https secure=true
 useURIValidationHack=false disableUploadTimeout=true
  Factory
 className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory
   keystoreFile=E:\\jboss-3.0.4_tomcat-4.1.12\\bin\\TOMCAT.KS
 keystorePass=TOMCAT
  clientAuth=true protocol=TLS /
   /Connector


 I am able to connect to Tomcat using a simple java-based ssl program when
 clientAuth=false, but it fails when I set it to true.  I've specified a
 trust store (and trust store password) containing all the valid CA certs ,
 in an environment variable: CATALINA_OPTS.

 The trace of the execution is as follows:

 Client write key:
 : 82 17 82 46 A4 94 00 54   A8 13 D7 88 B0 92 17 C1  ...F...T
 Server write key:
 : E0 C4 6E A4 D8 0F 78 23   B7 B0 6A 97 98 46 AD 40  ..n...x#..j..F.@
 ... no IV for cipher
 JsseJCE: Using JSSE internal implementation for cipher
RSA/ECB/PKCS1Padding
 *** CertificateVerify
 main, WRITE: TLSv1 Handshake, length = 134
 main, WRITE: TLSv1 Change Cipher Spec, length = 1
 JsseJCE: Using JSSE internal implementation for cipher RC4
 *** Finished
 verify_data:  { 195, 128, 75, 187, 144, 183, 187, 156, 108, 255, 102, 85 }
 ***
 main, WRITE: TLSv1 Handshake, length = 32
 main, READ: TLSv1 Alert, length = 2
 main, RECV TLSv1 ALERT:  fatal, bad_certificate
 main, called closeSocket()
 main, handling exception: javax.net.ssl.SSLHandshakeException: Received
 fatal al
 ert: bad_certificate
 javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
 at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
 at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.b(DashoA6275)
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA6275)
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
 at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275)


 Any ideas?

 Steve




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



Re: url-pattern and realms security

2003-08-15 Thread Bill Barker

Madere, Colin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 That is a concrete path and you must be joking if you are suggesting to
 explicitly define each and every URL as a web-resource.  The idea of
 hierarchical authorization of resources is a very sound idea and other
auth
 schemes follow this trickle-down idea that you secure the whole tree
with
 a general user auth (everyone can see it) and then directories beneath
that
 have content specific to groups and are secured as needed.  Any new
 directory added that does not need special treatment is automatically
 secured under the general rule.  Otherwise you'll likely have a heavy
 management burden of your deployment descriptor with 100s of
web-resource
 tags.  The spec is shallow here, I hope it will improve in the next
version.

The Servlet 2.4 spec is *very* specific here.  Basically, the
Servlet-Container (aka Tomcat) is required to merge security-constraints.
I've heard rumors on other lists that what exactly the specifics are may
change before the spec goes final, so it may not be what is currently
available as pfd3.  I'm not (personally) on the JCP, so you should treat
this as rumor and innuendo ;-).


 From another angle, I don't want the root to be insecure and only subdirs
be
 secured.  No other option there that I know of...

 And yet another angle, if you use explicit url-patterns and a content
 developer drops in something that happens not to match it, it is not a
 secure item.  Unless you are in complete control and have script
parameters
 of content, it's not an option.

 -Original Message-
 From: Alexander Vavilin [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 14, 2003 11:08 PM
 To: Tomcat Users List
 Subject: Re[2]: url-pattern and realms security


 Hello Colin,

 Of course, your /* directive will overwrite all. You should use more
 concrete names and paths.

 -- 
 Best regards,
 Alexander
 mailto:[EMAIL PROTECTED]

 Friday, August 15, 2003, 4:53:36 AM, you wrote:

 MC Sorry sorry, web-resource-name elements are unique, just a copying
 MC error.

 MC -Original Message-
 MC From: Alexander Vavilin [mailto:[EMAIL PROTECTED]
 MC Sent: Thursday, August 14, 2003 10:33 PM
 MC To: Tomcat Users List
 MC Subject: Re: url-pattern and realms security


 MC Hello Colin,

 MC I am not sure, but I think you cannot do this, first an
 web-resource-name
 MC element means an UNIQUE name. Can you understand ? You must give it
 MC different names. Second thing, I never heard about http-method
 element.

 MC Hope it will help.


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