Re: Web App consuming Passive Secure Token Service

2009-03-23 Thread Lucas Galfaso
Hi,
  The first place I would look for is https://opensso.dev.java.net/
  If it is not there, then close-to-for-sure that it cannot be done ;-)

Regards,
  Lucas



On Mon, Mar 23, 2009 at 7:09 PM, Angel Java Lopez ajlopez2...@gmail.com wrote:
 Hi people!



 I'm searching for a simple example of a Web Application, hosted in Tomcat,
 acting as the Service Provider, that consumes a non-java based Identity
 Provider using Passive Secure Token Service, producing a SAML 2.0/1.x token.



 I have a Passive STS Identity Provider, running with Microsoft Geneva
 Framework, and it's run OK with ASP.NET web apps. I want to configure a one
 page JSP application, so if the user navigates to that page, his browser
 will be redirected to my .NET STS Passive web app, and then, back to the JSP
 web app, take the STS token, using the include name claim as the principal.



 But I can't figure out what technology to explore if the Service Provider
 Web Application is a Tomcat/Java-based one. All examples I found, refer to
 Identity Provider and Service Provider built on the same technology.



 Any custom authenticator that consumes an STS token?



 If there is no example in Tomcat, any other option? JBoss? JBoss Identity on
 Tomcat?



 Angel Java Lopez

 http://www.ajlopez.com

 http://twitter.com/ajlopez


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: single instance of background job?

2009-01-10 Thread Lucas Galfaso
Hi,
  This should be strait forward if you use terracotta. If you have a
NFS that all Tomcat instances share, using FileChannel::lock is way
cheaper than any other solution.

-lg

On Sun, Jan 11, 2009 at 2:30 AM, Rusty Wright rusty.wri...@gmail.com wrote:
 This isn't really a Tomcat question I'm guessing but I don't know where else
 to ask.

 In our setup we have multiple Tomcats behind a load balancer.  I have a
 background task that will run once a day, via Quartz.  All Tomcats will be
 using the same war so they will all run the job, but I need it so only one
 of them runs the job.

 I'm looking for ideas for how to implement this.  At the moment all I can
 think of is to use a table in a database with a unique constraint on a
 column, and each background process tries to insert today's date
 (-mm-dd) and the one that succeeds runs the job, and the ones that
 don't, do nothing.

 Thanks


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: I WANT Tomcat to die when a given servlet fails to initialize

2008-08-22 Thread Lucas Galfaso
try {
 [...]
} catch (Exception e) {
  System.exit(0);
}

??

:-)


-lg


On Fri, Aug 22, 2008 at 3:42 PM, COHEN, STEVEN M (ATTSI) [EMAIL PROTECTED] 
wrote:
 This may seem like an odd request and I'm sure it is nonstandard, but it
 nonetheless something I'd like to be able to do.  We have an instance of
 Tomcat running.  It runs one application.  This application is NOT an
 application serving content over the www.  It is basically a straight java
 application running inside of a web server.  The reason it runs in a Web
 server is because there is one subsidiary use case that uses HTTP Gets to
 fire actions in the application via a servlet.  No other applications are
 served off this web server.

 The non-web application's main() is the servlet's init().  If this servlet
 cannot initialize there is no point to keeping Tomcat running and it would
 in fact make monitoring easier if it were not running.

 Is there any easy way to achieve this in Tomcat?


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



Re: trim-directive-whitespaces and .tag files

2008-05-09 Thread Lucas Galfaso
Have you try converting your .tag files to .tagx files?

On Fri, May 9, 2008 at 11:45 AM, Milanez, Marcus
[EMAIL PROTECTED] wrote:

 OK Hassan, thanks a lot! If I could get this directive working with .tag
 files I would appreciate a lot more, but if I couldn't find a way, I'll
 try your suggestion!

 Just a final questions: should it be working or not? I mean, ths
 specification for trim-directive-whitespaces says that it could not work
 in these cases?

 Thanks a lot for your time!

 Marcus Milanez

 -Mensagem original-
 De: Hassan Schroeder [mailto:[EMAIL PROTECTED]
 Enviada em: sexta-feira, 9 de maio de 2008 11:38
 Para: Tomcat Users List
 Assunto: Re: trim-directive-whitespaces and .tag files

 On Fri, May 9, 2008 at 7:28 AM, Milanez, Marcus
 [EMAIL PROTECTED] wrote:

 I think it won't be possible to trim white spaces from .tag files
 uwing this directive then...

 If minimizing white space is critical for you, you might try something
 with the String taglib  -- maybe wrap a string:squeeze around the whole
 tag body. Just a first-cup-of-coffee thought...  :-)

 HTH,
 --
 Hassan Schroeder  [EMAIL PROTECTED]

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


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



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



Re: Bending Jasper to My Will

2008-04-21 Thread Lucas Galfaso
Hi All,
  To answer the original question, there is a mechanism that Tomcat
provides to handle the specific thing you want to achieve. The
solution is very Tomcat specific, so I do not really recommend it,
anyhow, if you really _need_to_have_this_ then the way to achieve it
is the following:

  - Extend the class FileDirContext to take a second parameter, this
second parameter is the path that will override the standard path.
Code everything into that class so that it works as you expect.
Compile and add the .jar to Tomcat library.
  - Add your own context.xml to the application you want to have this
special behavior, just copy the standard one from the conf directory
from Tomcat. In this context.xml add a new resource that points to
your new class with the new path.
  - Done.

This is simpler to explain it that to do it, but it is something that
should be easy to build and test within a day if you know what you
have to change and what you want to achieve.

Regards,
  Lucas Galfaso

PS: This will make yous web app not 100% standard, and if you have to
migrate this behavior to other web containers, it might get trickier,
so be sure that you really need this.



On Tue, Apr 22, 2008 at 12:04 AM, Hassan Schroeder
[EMAIL PROTECTED] wrote:
 On Mon, Apr 21, 2008 at 7:16 PM, Andy Clark [EMAIL PROTECTED] wrote:

Many people suggested that I try various frameworks
for the application because they contain template
engines that may work for my purpose. Unfortunately,
I think that this is a non-starter because the app
is already written (quite nicely, I might add) in
straight JSPs.

  If it's already quite nicely written, why doesn't it do what you want? :-)

  Just askin' ...

  --
  Hassan Schroeder  [EMAIL PROTECTED]



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



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



Re: Bending Jasper to My Will

2008-04-21 Thread Lucas Galfaso
Ahh, just one more thing, do not even try to modify Jasper itself
unless you know what you are doing; Most people experimenting with
Jasper end up in nothing.

- lg




On Tue, Apr 22, 2008 at 1:40 AM, Lucas Galfaso [EMAIL PROTECTED] wrote:
 Hi All,
   To answer the original question, there is a mechanism that Tomcat
  provides to handle the specific thing you want to achieve. The
  solution is very Tomcat specific, so I do not really recommend it,
  anyhow, if you really _need_to_have_this_ then the way to achieve it
  is the following:

   - Extend the class FileDirContext to take a second parameter, this
  second parameter is the path that will override the standard path.
  Code everything into that class so that it works as you expect.
  Compile and add the .jar to Tomcat library.
   - Add your own context.xml to the application you want to have this
  special behavior, just copy the standard one from the conf directory
  from Tomcat. In this context.xml add a new resource that points to
  your new class with the new path.
   - Done.

  This is simpler to explain it that to do it, but it is something that
  should be easy to build and test within a day if you know what you
  have to change and what you want to achieve.

  Regards,
   Lucas Galfaso

  PS: This will make yous web app not 100% standard, and if you have to
  migrate this behavior to other web containers, it might get trickier,
  so be sure that you really need this.





  On Tue, Apr 22, 2008 at 12:04 AM, Hassan Schroeder
  [EMAIL PROTECTED] wrote:
   On Mon, Apr 21, 2008 at 7:16 PM, Andy Clark [EMAIL PROTECTED] wrote:
  
  Many people suggested that I try various frameworks
  for the application because they contain template
  engines that may work for my purpose. Unfortunately,
  I think that this is a non-starter because the app
  is already written (quite nicely, I might add) in
  straight JSPs.
  
If it's already quite nicely written, why doesn't it do what you want? 
 :-)
  
Just askin' ...
  
--
Hassan Schroeder  [EMAIL PROTECTED]
  
  
  
-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
  


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



Re: tag file recursivity problem

2008-01-08 Thread Lucas Galfaso
Hi,
  It should be available in the next Tomcat release (in fact it was
included in a not-released Tomcat 6.0.15)
  No idea when the next GA release be available.

Regards,
  Lucas

On Jan 8, 2008 12:18 PM, Jair da Silva Ferreira Jr [EMAIL PROTECTED] wrote:
 Hi,
 Thank you very much for your reply.
 Is this fix going to be available in the next Tomcat version? Do you
 know when the next version will be released?
 Thank you very much.

 Sincerely,
 Jair Jr

 Lucas Galfaso escreveu:

  Hi,
This is a known issue is Tomcat 6.0.14, it was reported using
  http://issues.apache.org/bugzilla/show_bug.cgi?id=42693 and it is
  fixed in the trunk.
 
  Regards,
lg
 
  On Jan 6, 2008 1:50 PM, Jair da Silva Ferreira Jr [EMAIL PROTECTED] wrote:
 
  Hi,
  I am experiencing a problem with recursivity in tag files in tomcat
  6.0.14. I developed a simple tag file to show you the problem.
  Here is my tag file:
 
  %@ tag body-content=empty %
  %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c%
  %@ taglib prefix=t tagdir=/WEB-INF/tags %
 
  %@ attribute name=number required=true type=java.lang.Integer %
  c:choose
  c:when test=${number==0 || number==1}1/c:when
  c:otherwise${number}*t:factorial 
  number=${number-1}//c:otherwise
  /c:choose
 
  The tag file is pretty simple. When called from a jsp file, the tag
  outputs how the factorial of any given number is calculated, but it
  doen't actually calculate the factorial result. For example: if the
  number paramenter is 5, the tag will output 5*4*3*2*1.
  Here is the portion of the jsp file that calls the tag:
  c:if test=${! empty param.number}
  Result: t:factorial number=${param.number}/
   /c:if
 
  The problem is that nothing is displayed when the tag is called form
  a jsp file. It happens as if the tag is not being called at all or as if
  it is an empty tag file.
  After some work I found out the problem. Jasper is not correctly
  converting my recursive tag file to java code. The resulting java file
  found in tomcat's work directory has an empty doTag method. Here is the
  doTag method:
  public void doTag() throws JspException, java.io.IOException {
  }
 
  I've checked all tomcat logs and couldn't find any jasper error 
  message.
  I've run the same web application in two different systems and the
  problem only happens in system 2. Here is the configuration:
 
  System 1 (development machine) (problem does not happen):
  - OS: Windows XP sp2
  - Hardware: AMD Athlon XP 2400+ (2.03 GHz) (1,5 GB RAM)
  - Java (as stated by java -version command):
   java version 1.6.0_03
  Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
  Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode,
  sharing)
  - Tomcat version: 6.0.14 (.zip download package)
  System 2 (production machine) (problem happens):
   - OS: Ubuntu linux 7.10 (codename gutsy)
   - Hardware: HP Tower Computer ProLiant ML350 G5, Intel(R)
  Xeon(R) CPU 5120 @ 1.86GHz, 4 GB RAM
   - Java (as stated by java -version command):
java version 1.6.0_03
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode)
   - Tomcat version: 6.0.14 (.tar.gz download package)
 
  I am sending you my factorial example web application. The file is
  recursive-tag.war. The application only has 2 files: index.jsp and
  factorial.tag.
  I am also sending you 2 jasper generated .java files extracted from
  the tomcat work directory. system1_factorial_tag.java is generated in
  the system 1 configuration and system2_factorial_tag.java is generated
  in the system 2 configuration. Please, notice that the doTag method is
  empty in system2_factorial_tag.java.
  Please, can anyone help me with this problem? Am I doing something
  wrong?
  Thank you very much.
 
  Sincerely,
  Jair Jr
 
  package org.apache.jsp.tag.web;
 
  import javax.servlet.*;
  import javax.servlet.http.*;
  import javax.servlet.jsp.*;
 
  public final class factorial_tag
  extends javax.servlet.jsp.tagext.SimpleTagSupport
  implements org.apache.jasper.runtime.JspSourceDependent {
 
 
private static final JspFactory _jspxFactory = 
  JspFactory.getDefaultFactory();
 
private static java.util.List _jspx_dependants;
 
private JspContext jspContext;
private java.io.Writer _jspx_sout;
private org.apache.jasper.runtime.TagHandlerPool 
  _005fjspx_005ftagPool_005fc_005fchoose;
private org.apache.jasper.runtime.TagHandlerPool 
  _005fjspx_005ftagPool_005fc_005fwhen_005ftest;
private org.apache.jasper.runtime.TagHandlerPool 
  _005fjspx_005ftagPool_005fc_005fotherwise;
 
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor

Re: tag file recursivity problem

2008-01-06 Thread Lucas Galfaso
Hi,
  This is a known issue is Tomcat 6.0.14, it was reported using
http://issues.apache.org/bugzilla/show_bug.cgi?id=42693 and it is
fixed in the trunk.

Regards,
  lg

On Jan 6, 2008 1:50 PM, Jair da Silva Ferreira Jr [EMAIL PROTECTED] wrote:
 Hi,
 I am experiencing a problem with recursivity in tag files in tomcat
 6.0.14. I developed a simple tag file to show you the problem.
 Here is my tag file:

 %@ tag body-content=empty %
 %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c%
 %@ taglib prefix=t tagdir=/WEB-INF/tags %

 %@ attribute name=number required=true type=java.lang.Integer %
 c:choose
 c:when test=${number==0 || number==1}1/c:when
 c:otherwise${number}*t:factorial number=${number-1}//c:otherwise
 /c:choose

 The tag file is pretty simple. When called from a jsp file, the tag
 outputs how the factorial of any given number is calculated, but it
 doen't actually calculate the factorial result. For example: if the
 number paramenter is 5, the tag will output 5*4*3*2*1.
 Here is the portion of the jsp file that calls the tag:
 c:if test=${! empty param.number}
 Result: t:factorial number=${param.number}/
  /c:if

 The problem is that nothing is displayed when the tag is called form
 a jsp file. It happens as if the tag is not being called at all or as if
 it is an empty tag file.
 After some work I found out the problem. Jasper is not correctly
 converting my recursive tag file to java code. The resulting java file
 found in tomcat's work directory has an empty doTag method. Here is the
 doTag method:
 public void doTag() throws JspException, java.io.IOException {
 }

 I've checked all tomcat logs and couldn't find any jasper error message.
 I've run the same web application in two different systems and the
 problem only happens in system 2. Here is the configuration:

 System 1 (development machine) (problem does not happen):
 - OS: Windows XP sp2
 - Hardware: AMD Athlon XP 2400+ (2.03 GHz) (1,5 GB RAM)
 - Java (as stated by java -version command):
  java version 1.6.0_03
 Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
 Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode,
 sharing)
 - Tomcat version: 6.0.14 (.zip download package)
 System 2 (production machine) (problem happens):
  - OS: Ubuntu linux 7.10 (codename gutsy)
  - Hardware: HP Tower Computer ProLiant ML350 G5, Intel(R)
 Xeon(R) CPU 5120 @ 1.86GHz, 4 GB RAM
  - Java (as stated by java -version command):
   java version 1.6.0_03
   Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
   Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode)
  - Tomcat version: 6.0.14 (.tar.gz download package)

 I am sending you my factorial example web application. The file is
 recursive-tag.war. The application only has 2 files: index.jsp and
 factorial.tag.
 I am also sending you 2 jasper generated .java files extracted from
 the tomcat work directory. system1_factorial_tag.java is generated in
 the system 1 configuration and system2_factorial_tag.java is generated
 in the system 2 configuration. Please, notice that the doTag method is
 empty in system2_factorial_tag.java.
 Please, can anyone help me with this problem? Am I doing something
 wrong?
 Thank you very much.

 Sincerely,
 Jair Jr

 package org.apache.jsp.tag.web;

 import javax.servlet.*;
 import javax.servlet.http.*;
 import javax.servlet.jsp.*;

 public final class factorial_tag
 extends javax.servlet.jsp.tagext.SimpleTagSupport
 implements org.apache.jasper.runtime.JspSourceDependent {


   private static final JspFactory _jspxFactory = 
 JspFactory.getDefaultFactory();

   private static java.util.List _jspx_dependants;

   private JspContext jspContext;
   private java.io.Writer _jspx_sout;
   private org.apache.jasper.runtime.TagHandlerPool 
 _005fjspx_005ftagPool_005fc_005fchoose;
   private org.apache.jasper.runtime.TagHandlerPool 
 _005fjspx_005ftagPool_005fc_005fwhen_005ftest;
   private org.apache.jasper.runtime.TagHandlerPool 
 _005fjspx_005ftagPool_005fc_005fotherwise;

   private javax.el.ExpressionFactory _el_expressionfactory;
   private org.apache.AnnotationProcessor _jsp_annotationprocessor;

   public void setJspContext(JspContext ctx) {
 super.setJspContext(ctx);
 java.util.ArrayList _jspx_nested = null;
 java.util.ArrayList _jspx_at_begin = null;
 java.util.ArrayList _jspx_at_end = null;
 this.jspContext = new org.apache.jasper.runtime.JspContextWrapper(ctx, 
 _jspx_nested, _jspx_at_begin, _jspx_at_end, null);
   }

   public JspContext getJspContext() {
 return this.jspContext;
   }
   private java.lang.Integer number;

   public java.lang.Integer getNumber() {
 return this.number;
   }

   public void setNumber(java.lang.Integer number) {
 this.number = 

Re: jsp done processing!

2007-11-09 Thread Lucas Galfaso
Hi,
  Never do a
response.getWriter().close();
  A good design would not ask you to close something that you did not
open, and this is one of those cases.
  The full response is sent when your page releases the thread that
is working on this request. This is, if you want to do some processing
and you want to send the response to the browser at the same time, you
have to create a new thread.

Regards,
 -lg


On Nov 9, 2007 12:09 PM, renen [EMAIL PROTECTED] wrote:
 Hi Folks,

 I want to tell the browser / Tomcat that I'm done processing my JSP page
 (ie, the little spinning icon in Firefox should stop spinning!).

 However, I still want to log a couple of things (duration, browser info
 etc). But, the users' browser doesn't need to be tied up while this happens.

 One way to do that would seem to be to call response.flush(). However,
 Tomcat seems to have issues with this (google: response.flush tomcat).
 Indeed, it doesn't seem to do anything at all.

 The one way I did manage to communicate that I was done was to call:

 response.getWriter().flush();
 response.getWriter().close();

 But, on certain (tiny) pages, it seems to kill all the content. Which is a
 bit unfortunate!

 Is there a way that I can signal to Tomcat / the browser / the servlet
 filters, that my JSP page is done?


 The page that doesn't render when those two lines of code are included is as
 follows:

 %@ page language=java import=za.co.oneTwoOne.web.*
 pageEncoding=ISO-8859-1%
 %
 Session myPage = new Session(request, response);
 pageContext.setAttribute(myPage, myPage);
 %
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
 html
   body
 ProcessID %=myPage.getParameter(ProcessID) % took
 %=myPage.getInt(exec ProcessGetExecutionTime ?, ProcessID*) % ms to
 serve.
   /body
 /html

 %
 myPage.terminate();
 %


 I really appreciate your input!

 Renen.





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



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



Re: [tomcat]How to decrypt the DIGEST authentication?

2007-10-30 Thread Lucas Galfaso
Hi,

  Digest authentication involves multiple MD5s including the username,
password, url, realm, random data... Believe me when I tell you that
there is no way that you will get the password from the digest (in
fact, it was designed this way so this is not feasible.)

  For your original question, you may want to check this
http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html

Regards,
  lg

On Oct 30, 2007 1:50 AM, zhongliang zhang [EMAIL PROTECTED] wrote:
 Hi,everyone,
 I got a problem with the DIGEST authentication.
 I configured my web.xml as followed:
 security-constraint
 web-resource-collection
   web-resource-nameapp/web-resource-name
   url-pattern/*/url-pattern
 /web-resource-collection
 auth-constraint
   role-namepoweruser/role-name
 /auth-constraint
  /security-constraint
  login-config
 auth-methodDIGEST/auth-method
 realm-nameapp/realm-name
  /login-config
 So,if anybody try to access my app,he needs to input his username and 
 password,while the username and password are stored in the Oracle 
 database,not configured in the tomcat-users.xml file which located at 
 $tomcat_home/conf/ directory. I can not configure it in the tomcat-users.xml 
 for the app has an function of make a new user.

 Is there anyway to solve this problem?

 P.S. I tried to solve it by coding in my program,like adding the following 
 code to set the response's status to ask for DIGEST authentication.
 ((HttpServletResponse) 
 response).setStatus(HttpServletResponse.SC_UNAUTHORIZED);
 But I do not get a way to decryt the DIGEST information.

 Any advice will be appreciated!
 thanks.
 _
 News, entertainment and everything you care about at Live.com. Get it now!
 http://www.live.com/getstarted.aspx

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



Re: PKCS#12 type SSL certificate support in Tomcat

2007-10-30 Thread Lucas Galfaso
HI Hitesh,
  I think you are suppose to add your pkcs12 key to a keystore
repository (to the default alias name tomcat, of course, this can be
also changed) and then reference this keystore repository from within
Tomcat.

Regards,
  lg


On Oct 30, 2007 3:39 AM, Hitesh Raghav [EMAIL PROTECTED] wrote:
 Hi Lucas,

 I'm using following connector/ configuration:

 Connector port=8443 maxHttpHeaderSize=8192

maxThreads=150 minSpareThreads=25
 maxSpareThreads=75

enableLookups=false disableUploadTimeout=true

acceptCount=100 scheme=https secure=true

clientAuth=false sslProtocol=TLS /

 Factory
 className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory

 clientAuth=false protocol=TLS

 keystoreFile=keystore/.keystore

 keystorePass=changeit

 keystoreType=pkcs12 /


 Please let me know in case any other details are needed.


 Thanks,
 -Hitesh




 -Original Message-
 From: Lucas Galfaso [mailto:[EMAIL PROTECTED]
 Sent: Friday, October 26, 2007 7:39 PM
 To: Tomcat Users List
 Subject: Re: PKCS#12 type SSL certificate support in Tomcat

 Can you post the Connector / configuration that you are using?
 - lg

 On 10/26/07, Hitesh Raghav [EMAIL PROTECTED] wrote:
  Dear All,
 
  Is there any limitation to support PKCS#12 type SSL certificate in
  Tomcat.
 
  As per Tomcat User Guide, Tomcat currently operates with JKS, PKCS11
  or
  PKCS12 format keystores.
  http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html
 
  But, I'm unable to use PKCS#12 certificate in my Tomcat.
 
  It throws:
 
  java.io.IOException: Invalid keystore format
  at
  sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:633)
  at
 
 sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38)
  at java.security.KeyStore.load(KeyStore.java:1185)
  at
  org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketF
  ac
  tory.java:287)
  at
  org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESock
  et
  Factory.java:227)
  at
  org.apache.tomcat.util.net.jsse.JSSE14SocketFactory.getKeyManagers(JSS
  E1
  4SocketFactory.java:142)
  at
  org.apache.tomcat.util.net.jsse.JSSE14SocketFactory.init(JSSE14SocketF
  ac
  tory.java:110)
  at
  org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESoc
  ke
  tFactory.java:89)
  at
 
 org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.
  java:293)
  at
  org.apache.coyote.http11.Http11BaseProtocol.init(Http11BaseProtocol.ja
  va
  :139)
  at
 
 org.apache.catalina.connector.Connector.initialize(Connector.java:1017)
  at
  org.apache.catalina.core.StandardService.initialize(StandardService.ja
  va
  :578)
  at
  org.apache.catalina.core.StandardServer.initialize(StandardServer.java
  :7
  82)
  at
  org.apache.catalina.startup.Catalina.load(Catalina.java:504)
  at
  org.apache.catalina.startup.Catalina.load(Catalina.java:524)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
  Method)
  at
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
  av
  a:39)
  at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
  or
  Impl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at
  org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:267)
  at
  org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
 
  Could you please throw some light on PKCS#12 type certificate support.
 
  Please let me know in case any details are needed.
 
 
  Thanks,
  -Hitesh
 
 

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


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



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



Re: PKCS#12 type SSL certificate support in Tomcat

2007-10-26 Thread Lucas Galfaso
Can you post the Connector / configuration that you are using?
- lg

On 10/26/07, Hitesh Raghav [EMAIL PROTECTED] wrote:
 Dear All,

 Is there any limitation to support PKCS#12 type SSL certificate in
 Tomcat.

 As per Tomcat User Guide, Tomcat currently operates with JKS, PKCS11 or
 PKCS12 format keystores.
 http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html

 But, I'm unable to use PKCS#12 certificate in my Tomcat.

 It throws:

 java.io.IOException: Invalid keystore format
 at
 sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:633)
 at
 sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38)
 at java.security.KeyStore.load(KeyStore.java:1185)
 at
 org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFac
 tory.java:287)
 at
 org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocket
 Factory.java:227)
 at
 org.apache.tomcat.util.net.jsse.JSSE14SocketFactory.getKeyManagers(JSSE1
 4SocketFactory.java:142)
 at
 org.apache.tomcat.util.net.jsse.JSSE14SocketFactory.init(JSSE14SocketFac
 tory.java:110)
 at
 org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocke
 tFactory.java:89)
 at
 org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.
 java:293)
 at
 org.apache.coyote.http11.Http11BaseProtocol.init(Http11BaseProtocol.java
 :139)
 at
 org.apache.catalina.connector.Connector.initialize(Connector.java:1017)
 at
 org.apache.catalina.core.StandardService.initialize(StandardService.java
 :578)
 at
 org.apache.catalina.core.StandardServer.initialize(StandardServer.java:7
 82)
 at
 org.apache.catalina.startup.Catalina.load(Catalina.java:504)
 at
 org.apache.catalina.startup.Catalina.load(Catalina.java:524)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
 Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
 a:39)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
 Impl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at
 org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:267)
 at
 org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)

 Could you please throw some light on PKCS#12 type certificate support.

 Please let me know in case any details are needed.


 Thanks,
 -Hitesh



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



Re: UTF8

2007-09-23 Thread Lucas Galfaso
hi,
  What happens if you escape every char in the XML file? This is you
replace character number nnn to #nnn; (quotes for clarity.) The
number has to be the ISO-10646 of the character and, lucky for you,
this is the case of Javas internal encoding.

Regards,
  lg

On 9/22/07, Amnon Lahav [EMAIL PROTECTED] wrote:
 hi ,
 i'm using tomcat 5.5 and jdk5 allso using commons.fileupload , when
 uploading a XML that contains hebrew fonts i can't seem to get it in utf8 in
 the servlet tough JSP is configured to utf8 with :
 %@ page language=java contentType=text/html; charset=UTF-8
 pageEncoding=UTF-8 %

 !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
 http://www.w3.org/TR/html4/loose.dtd;

 meta http-equiv=content-type content=text/html; charset=UTF-8



 i suspect that i might be getting in utf 8 but maybe it differs from java's
 UTF8 (that's impossible isn't it ?) because when i try to convert using new
 String(stringByte,UTF-8) it returns the same while with other encodings in
 can see in debug content changes ... i'm realy at a jam here people i have a
 deadline adn i can't seem to fix this silly bug any ideas ?

 when i open the xml with firefox and check properties it says windows-1255
 but when i try using the getbytes method to init stringByte it doesn't
 matter , i had this problem once with tomcat but it was with a simple
 textarea input and then i just converted to utf8 like i described above from
 iso-8859-1 but now i can't seem to do that ..




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



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



Re: Subdomains/ Virtual Hosts+ Tomcat 5.5/6.0

2007-07-28 Thread Lucas Galfaso
.) I think the original question is not for this newsgroup.
.) You can use domain identifiers with wildcards, like *.foo.com
.) Tomcat load balancing should have no issues with this if the web
app does not have an issue with it.


On 7/28/07, Łukasz Łapiński [EMAIL PROTECTED] wrote:
 Hello,

 I am not really sure where to start. Whether it should be a dns
 modification or virtual hosts in tomcat?

 I am doing a web portal that a user after registration would have its own
 domain, such as:

 max.foo.com
 jarek.foo.com

 at my server foo.com.

 How to add programmatically, without restarting the server such domains.

 I have been reading around but no good solution have I found. Could you
 recommend me some libraries, tools or techniques?

 Would it be more difficult when I start to use load balancing
 functionality of Tomcat?


 --
 Kind regards,
 Łukasz Łapiński

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




Re: Encoding issue: + versus %20

2007-06-07 Thread Lucas Galfaso

Mmmm..
It should read:
To use + as a space is correct within the query, but is not correct
within the path.

- LG

On 6/7/07, Christopher Schultz [EMAIL PROTECTED] wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lucas,

 To use + as a space is correct within the query, but is correct
 within the path.

Huh?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGaBz59CaO5/Lv0PARAsAyAKCuBTmf55ChCLReV9E9tFgiw73Q4ACfRvaw
Crj7D4JkxYKtbs1XbJuj9Js=
=sBah
-END PGP SIGNATURE-

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




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



Re: Encoding issue: + versus %20

2007-06-06 Thread Lucas Galfaso

Short answer:
 An URL has many part, one part that is called path (in this case
upload/a b.jpg) and another part is called query (that is usually
what is after the ? in a URL) These two parts use slightly different
reserved characters that may, should, or must be escaped under
different rules. To use + as a space is correct within the query,
but is correct within the path.

Long answer:
http://www.ietf.org/rfc/rfc2396.txt
2.2. Reserved Characters
2.3. Unreserved Characters
2.4. Escape Sequences
3.3. Path Component
3.4. Query Component

Regards,
 LG

On 6/6/07, hstang [EMAIL PROTECTED] wrote:


I am currently having problems loading an image in Tomcat 6.13.  I have a
file a b.jpg in upload folder and I want to have a link to go to it.

(1)  upload/a+b.jpg Here
(2)  upload/a%20b.jpg Here

Why does (2) work and not (1)?  Both '+' and %20 represents spaces so
there's no reason why they can't work. The Java URLEncoder.encode() will
output (1), and my current framework of choice also output (1) but I can't
seem to come out with (1).  What libraries can you use to force (2) out?
What's the problem?

--
View this message in context: 
http://www.nabble.com/Encoding-issue%3A-%2B-versus--20-tf3879033.html#a10992518
Sent from the Tomcat - User mailing list archive at Nabble.com.


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




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



Re: Prevent unwanted requests

2007-05-18 Thread Lucas Galfaso

I think that a new servlet to filter these files is not the proper
approach, and you should use a filter :)

- LG

On 5/18/07, Milanez, Marcus [EMAIL PROTECTED] wrote:

Is it possible to prevent the request os unwatned extensions, like
*.bak, *.java and so on, through web.xml file? My solution was creating
a servlet that gets mapped to this extensions, but I could realize that
it doesn't work along with DWR for example...  The problem is that when
I invoke something like myapp/dwr/file.java, this URL is mapped to dwr
servlet instead of ForbiddenFilesController. Does anybody know how to
solve that?


My web.xml contains the following lines:

...
servlet-mapping
servlet-nameForbiddenFilesController/servlet-name
url-pattern*.java/url-pattern
/servlet-mapping

servlet-mapping
servlet-namedwr-invoker/servlet-name
url-pattern/dwr/*/url-pattern
/servlet-mapping
...

And my controller has the following lines of code:

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse
resp)
throws ServletException, IOException {

//proibido
resp.setStatus(HttpServletResponse.SC_FORBIDDEN);
//resp.getWriter().close();
return;

}

@Override
protected void doPost(HttpServletRequest req,
HttpServletResponse resp)
throws ServletException, IOException {

//proibido
resp.setStatus(HttpServletResponse.SC_FORBIDDEN);
//resp.getWriter().close();
super.doPost(req, resp);
}

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




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



Re: Demonstration of Chroot when tomcat running in jail

2007-04-11 Thread Lucas Galfaso

Just create a jsp page with a text input that whatever you submit
there is executed at a shell and returns the result.

On 4/11/07, Jasbinder Singh Bali [EMAIL PROTECTED] wrote:

To clarify it further, I need demonstrate someone entering the chroot jail
where tomcat is running
and then he can issue all his commands there but won't be able to see the
actual root being in chroot jail

On 4/11/07, Jasbinder Singh Bali [EMAIL PROTECTED] wrote:

 I didn't get that. Can you please explain what are you trying to say here.
 Thanks

 On 4/11/07, Tim Lucia [EMAIL PROTECTED]  wrote:
 
  You could create a file, write to it, and observe where it appears.
 
 
   -Original Message-
   From: Jasbinder Singh Bali [mailto:[EMAIL PROTECTED]
   Sent: Wednesday, April 11, 2007 6:50 PM
   To: users@tomcat.apache.org
   Subject: Demonstration of Chroot when tomcat running in jail
  
   Hi,
   How can the Chroot be demostrated in a very simple way without
   actually hacking the tomcat.
   I just need to show that someone has taken control of tomcat and now
   he's in the directory (chroot jail) where tomcat is running but won't
   be able to access the actual root of the webserver.
   What would a good way to demostrate this.
  
   Any kind of help would be highly appreciated.
  
   Thanks
   ~Jas
  
   -
   To start a new topic, e-mail: users@tomcat.apache.org
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 




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



Re: Restarting Webapplication From Command Line

2007-02-22 Thread Lucas Galfaso

Hi,
 If you set the host autoDeploy property to true. You can redeploy doing a
touch /WEB-INF/web.xml
 if not, you need the client deployed.

Regards,
 LG

On 2/22/07, Bio Jazz [EMAIL PROTECTED] wrote:

I understand how to restart the entire Tomcat service from the command line.
However, I have a need to restart a single application from the command line
without restarting the entire Tomcat service (ie without affecting the other
deployed applications).

Is there a way to restart a single web application from the command line?

_
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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




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



Re: Tomcat and OSGi

2007-02-22 Thread Lucas Galfaso

Hi,
 Was anybody able to embed Tomcat, and a WebApp as an OSGi plugin? I
was able to embed Tomcat, but I am unable to make Tomcat find my web
app using the classloader (or any form of VFS.)

Regards,
 LG

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