You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Julian Templeman <ju...@gmail.com> on 2004/12/02 09:56:26 UTC

Problem with JAAS

I'm evaluating an ISP that uses Tomcat to host webapps, and am running
into a security problem.

Any webapp that uses FORM authentication triggers an error from JAAS,
saying that it can't find a login configuration. I'm certainly not
using JAAS, and have just been adding users to the tomcat-users.xml
file. I've been able to confirm that this happens with even the
simplest apps.

Can anyone give me any idea of what's going on here? My guess is that
somehow Tomcat is configured to use JAAS by default, but since I've
not used JAAS before now, I'm not sure where to look...

Thanks,

julian
in london

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Problem with JAAS

Posted by QM <qm...@brandxdev.net>.
On Thu, Dec 02, 2004 at 08:56:26AM +0000, Julian Templeman wrote:
: I'm evaluating an ISP that uses Tomcat to host webapps, and am running
: into a security problem.
: 
: Any webapp that uses FORM authentication triggers an error from JAAS,
: saying that it can't find a login configuration. I'm certainly not
: using JAAS, and have just been adding users to the tomcat-users.xml
: file. I've been able to confirm that this happens with even the
: simplest apps.

What does the ISP support team say?  If they can't answer, it's time to
find a new host. =)

: Can anyone give me any idea of what's going on here? My guess is that
: somehow Tomcat is configured to use JAAS by default, but since I've
: not used JAAS before now, I'm not sure where to look...

Are you in your own container?  If not, you could be tripped up by an
errant global setting.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Best place to store files ?

Posted by Parsons Technical Services <pa...@earthlink.net>.
Not to my knowledge. But it has been known to be lacking at times.

Doug

----- Original Message ----- 
From: "Eric VERGNAUD" <er...@jlynx.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, December 07, 2004 5:55 PM
Subject: Re: Best place to store files ?


le 7/12/04 23:33, Parsons Technical Services à
parsonstechnical@earthlink.net a écrit :

> I use a directory that belongs to the owner of Tomcat and is located 
> outside
> of the Tomcat directory. It really is a matter of preference. As for not
> overwriting the files, I have yet to read anything on this. How would you
> determine which file to keep and which to overwrite? If you never deleted
> any files then the directory would fill with abandoned file that belonged 
> to
> prior versions of your app. That means you would have to manage the files
> manually and with that is the chance to delete a file belonging to your 
> app.
>
> Simple terms, pick a place just for them use it.
>
> Doug

Yes it's simple. I was just wondering whether there was a preferred method
for this, and maybe a folder in the Tomcat directory for that purpose.

-------------------------------
Eric VERGNAUD - JLynx Software
Cutting-edge technologies and
services for software companies
web: http://www.jlynx.com
-------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Best place to store files ?

Posted by Eric VERGNAUD <er...@jlynx.com>.
le 8/12/04 0:15, Wendy Smoak à java@wendysmoak.com a écrit :

> From: "Eric VERGNAUD" <er...@jlynx.com>
>> Yes it's simple. I was just wondering whether there was a preferred method
>> for this, and maybe a folder in the Tomcat directory for that purpose.
> 
> Nothing in the Servlet Specification requires Tomcat to provide you with a
> permanent place to put uploaded files.
> 
> My advice would be to put them outside of Tomcat, and write a thin layer to
> insulate the Servlet from whatever decisions you're making today.  That way,
> if you decide at some point in the future to put the files in a database, or
> do something else with them, you don't have to mess with the Servlet code.
> Your Servlet shouldn't know or care where the files are, it should just call
> 'read' or 'write' and let the data access layer deal with the details.

Which is what I already do. As a matter of fact, the layer I'm using makes
it look like a database.

The only thing I was looking for is the preferred place for storing files.
If there is none, that's ok.

-------------------------------
Eric VERGNAUD - JLynx Software
Cutting-edge technologies and
services for software companies
web: http://www.jlynx.com
-------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Best place to store files ?

Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "Eric VERGNAUD" <er...@jlynx.com>
> Yes it's simple. I was just wondering whether there was a preferred method
> for this, and maybe a folder in the Tomcat directory for that purpose.

Nothing in the Servlet Specification requires Tomcat to provide you with a
permanent place to put uploaded files.

My advice would be to put them outside of Tomcat, and write a thin layer to
insulate the Servlet from whatever decisions you're making today.  That way,
if you decide at some point in the future to put the files in a database, or
do something else with them, you don't have to mess with the Servlet code.
Your Servlet shouldn't know or care where the files are, it should just call
'read' or 'write' and let the data access layer deal with the details.

-- 
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Best place to store files ?

Posted by Eric VERGNAUD <er...@jlynx.com>.
le 7/12/04 23:33, Parsons Technical Services à
parsonstechnical@earthlink.net a écrit :

> I use a directory that belongs to the owner of Tomcat and is located outside
> of the Tomcat directory. It really is a matter of preference. As for not
> overwriting the files, I have yet to read anything on this. How would you
> determine which file to keep and which to overwrite? If you never deleted
> any files then the directory would fill with abandoned file that belonged to
> prior versions of your app. That means you would have to manage the files
> manually and with that is the chance to delete a file belonging to your app.
> 
> Simple terms, pick a place just for them use it.
> 
> Doug

Yes it's simple. I was just wondering whether there was a preferred method
for this, and maybe a folder in the Tomcat directory for that purpose.

-------------------------------
Eric VERGNAUD - JLynx Software
Cutting-edge technologies and
services for software companies
web: http://www.jlynx.com
-------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Best place to store files ?

Posted by Parsons Technical Services <pa...@earthlink.net>.
I use a directory that belongs to the owner of Tomcat and is located outside 
of the Tomcat directory. It really is a matter of preference. As for not 
overwriting the files, I have yet to read anything on this. How would you 
determine which file to keep and which to overwrite? If you never deleted 
any files then the directory would fill with abandoned file that belonged to 
prior versions of your app. That means you would have to manage the files 
manually and with that is the chance to delete a file belonging to your app.

Simple terms, pick a place just for them use it.

Doug

----- Original Message ----- 
From: "Eric VERGNAUD" <er...@jlynx.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, December 07, 2004 5:11 PM
Subject: Best place to store files ?


> Hi,
>
> I'm developing a servlet which needs to handle file uploads and downloads. 
> I
> manage to store the files in a directory inside my servlet, but each time 
> I
> upload a new version of my servlet, the files are destroyed.
>
> Is there a preferred place to store such files in Tomcat, or is this
> entirely up to the developer and the catalina.policy file ?
>
> Is there a way to tell Tomcat NOT to erase existing files in a servlet, 
> but
> only overwrite them with files from the war file ?
>
> -------------------------------
> Eric VERGNAUD - JLynx Software
> Cutting-edge technologies and
> services for software companies
> web: http://www.jlynx.com
> -------------------------------
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Best place to store files ?

Posted by Eric VERGNAUD <er...@jlynx.com>.
Hi,

I'm developing a servlet which needs to handle file uploads and downloads. I
manage to store the files in a directory inside my servlet, but each time I
upload a new version of my servlet, the files are destroyed.

Is there a preferred place to store such files in Tomcat, or is this
entirely up to the developer and the catalina.policy file ?

Is there a way to tell Tomcat NOT to erase existing files in a servlet, but
only overwrite them with files from the war file ?

-------------------------------
Eric VERGNAUD - JLynx Software
Cutting-edge technologies and
services for software companies
web: http://www.jlynx.com
-------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Errors in Log file

Posted by David Stevenson <ds...@rochester.rr.com>.
I believe the java.lang.IllegalStateException occurs when the response
is committed. sendRedirect requires changing the HTTP headers (Location:
perhaps). You cannot write HTML to the web page and then issue a
redirect unless the HTML is buffered via a JSP directive:
<%@ page buffer="32kb" %>, and the response can be cleared before it is
flushed (HTTP Headers go before the HTTP body).

Either don't attempt to write HTML to the web page, or make sure your
buffer size is big enough so that the HTML can be buffered and cleared
before you issue the re-direct. The HTML will be ignored when the
sendRedirect is used.

http://java.sun.com/products/jsp/tags/11/syntaxref11.fm7.html
http://www.esus.com/javaindex/j2ee/javajsp/jspbufferautoflush.html

David Stevenson

On Thu, 2004-12-02 at 05:15, Pradeep Chauhan wrote:

> 2. java.lang.IllegalStateException
> 	at
> org.apache.coyote.tomcat4.CoyoteResponseFacade.sendRedirect(CoyoteResponseFa
> cade.java:340)
> 	at org.apache.jsp.DreamScreen_jsp._jspService(DreamScreen_jsp.java:564)
> 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
> 04)
> 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
> 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
> 	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:260)..............
> 
> 
> Thanks and Regards,
> Pradeep Chauhan
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Errors in Log file

Posted by Pradeep Chauhan <Pr...@Indussoft.com>.
Hi All,

We have  Tomcat 4.1.12 in production. Sometime users get "INTER SERVER ERROR
500".
In log files we have only two errors without any clues.

Can any body explian the possible reasons of these errors.

1. java.net.SocketException: Connection reset by peer: socket write error
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
................


2. java.lang.IllegalStateException
	at
org.apache.coyote.tomcat4.CoyoteResponseFacade.sendRedirect(CoyoteResponseFa
cade.java:340)
	at org.apache.jsp.DreamScreen_jsp._jspService(DreamScreen_jsp.java:564)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
04)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
	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:260)..............


Thanks and Regards,
Pradeep Chauhan



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org