You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by T <rl...@bonbon.net> on 2001/06/20 00:26:03 UTC

flushing

How can I flush Tomcat? Nothing from the PrintWriter reaches the
browser until the servlet completes. flush() does nothing. Has anybody
altered the facade classes to enable flushing?

Why is Tomcat set up that way?

Thanks.




Re: Encryption with javax.crypto.*

Posted by Pae Choi <pa...@earthlink.net>.
Leon,

Take this to comp.lang.java.security or Sun/Security Forum. We will take from
there.


Pae



> Hello All,
> 
> I have some code which uses the javax.crypto.* package.  When I run the code
> in a test outside of tomcat everything works fine.  When I try to run the
> code through Tomcat on the same machine, I get the following error:
> 
> java.lang.SecurityException:  Cannot set up certs for trusted CAs
>     at javax.crypto.b<clinit>([Dasho-Pro-V1.2-120198])
>     at javax.crypto.SecretKeyFactory.getInstance([Dasho-Pro-V1.2-120198])
>     ...
> 
> Has anyone ever used these classes with tomcat?  Does anyone have an idea
> what might be happening here?  Has anyone used a different way to encrypt in
> code run in tomcat?
> 
> Thanks in advance!
> 
> Leon Palermo
> 

Encryption with javax.crypto.*

Posted by Leon Palermo <le...@zedak.com>.
Hello All,

I have some code which uses the javax.crypto.* package.  When I run the code
in a test outside of tomcat everything works fine.  When I try to run the
code through Tomcat on the same machine, I get the following error:

java.lang.SecurityException:  Cannot set up certs for trusted CAs
    at javax.crypto.b<clinit>([Dasho-Pro-V1.2-120198])
    at javax.crypto.SecretKeyFactory.getInstance([Dasho-Pro-V1.2-120198])
    ...

Has anyone ever used these classes with tomcat?  Does anyone have an idea
what might be happening here?  Has anyone used a different way to encrypt in
code run in tomcat?

Thanks in advance!

Leon Palermo


JSP class compilation error

Posted by Sam Newman <sa...@stamplets.com>.
I have a JSP page which has suddenly stopped working. I've found a single
tag which, when included gives the stack trace found at the bottom of the
email. With the tag removed, everything works fine - even when I leave the
other tags in. I have tried this file on Linux & win98. The tag in question
doesn't do anything - the tag handler doAfterBody method simply returns
SKIP_BODY. I'm assuming I must of caused a problem with the XML files
somewhere, but can't for the life of me see where. Anyone get any ideas? I'm
currently using 3.2.1 and so am going to download 3.2.2 and try this version
to see if I can get a better error. I can compile the JSP page under
netbeans using the same libraries with or without the tag being in.

sam

Stack Trace when JSP access (with tag):

Internal Servlet Error:

org.apache.jasper.JasperException: Unable to compile class for JSP
 at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:476)
 at org.apache.jasper.servlet.JasperLoader12$1.run(JasperLoader12.java:160)
 at java.security.AccessController.doPrivileged(Native Method)
 at
org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:156)
 at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
 at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:152)
 at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:164)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
 at org.apache.tomcat.core.Handler.service(Handler.java:286)
 at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
 at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
 at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
 at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:484)

Root cause:
java.lang.NullPointerException
 at java.util.Hashtable.get(Hashtable.java:320)
 at java.beans.Introspector.getBeanInfo(Introspector.java:79)
 at
org.apache.jasper.compiler.TagCache.setTagHandlerClass(TagCache.java:104)
 at
org.apache.jasper.compiler.TagBeginGenerator.init(TagBeginGenerator.java:136
)
 at
org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.init(JspPa
rseEventListener.java:761)
 at
org.apache.jasper.compiler.JspParseEventListener.addGenerator(JspParseEventL
istener.java:138)
 at
org.apache.jasper.compiler.JspParseEventListener.handleTagBegin(JspParseEven
tListener.java:911)
 at
org.apache.jasper.compiler.DelegatingListener.handleTagBegin(DelegatingListe
ner.java:194)
 at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:813)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:1077)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:1042)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:182)
 at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
 at org.apache.jasper.servlet.JasperLoader12$1.run(JasperLoader12.java:160)
 at java.security.AccessController.doPrivileged(Native Method)
 at
org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:156)
 at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
 at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:152)
 at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:164)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
 at org.apache.tomcat.core.Handler.service(Handler.java:286)
 at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
 at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
 at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
 at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:484)




Re: flushing

Posted by Bo Xu <bo...@cybershop.ca>.
> [...]
> How can I flush Tomcat? Nothing from the PrintWriter reaches the
> browser until the servlet completes. flush() does nothing. Has anybody
> altered the facade classes to enable flushing?
> Why is Tomcat set up that way?
> Thanks.
> [...]

Hi :-)   you can use ServletResponse.flushBuffer(),
ServletResponse.flushBuffer() is in Servlet APIspec2.2+.


Bo
June 20, 2001




Re: flushing

Posted by Bo Xu <bo...@cybershop.ca>.
T wrote:

> Wednesday, June 20, 2001, 8:16:23 AM, "Brett M. Bergquist" <bb...@snet.net> wrote:
> BMB> Which version of Tomcat are you refering to?  If Tomcat 3.2.X, try the
> BMB> HttpServletResponse.flushBuffer() method. This works for me in Tomcat 3.2.2.
>
> Perfect! Thanks. It looks like this also gives the ability to know
> when the browser breaks the connection, because an IO exception is
> thrown.
> [...]

Hi :-)  because I have found some emails about "how to find the client-browser"
is still there or already leave?",  so:
-is "catching IOException with ServletResponse.flushBuffer()" a good solution to
all such problems?

- can it work both in the following:
   % TC standalone
   % another WEB-server + TC


thanks in advance!

Bo
June 20, 2001




Re[2]: flushing

Posted by T <rl...@bonbon.net>.
Wednesday, June 20, 2001, 8:16:23 AM, "Brett M. Bergquist" <bb...@snet.net> wrote:

BMB> Which version of Tomcat are you refering to?  If Tomcat 3.2.X, try the
BMB> HttpServletResponse.flushBuffer() method. This works for me in Tomcat 3.2.2.

Perfect! Thanks. It looks like this also gives the ability to know
when the browser breaks the connection, because an IO exception is
thrown.

>> How can I flush Tomcat? Nothing from the PrintWriter reaches the
>> browser until the servlet completes. flush() does nothing. Has anybody
>> altered the facade classes to enable flushing?
>>
>> Why is Tomcat set up that way?
>>
>> Thanks.
>>
>>
>>




Re: flushing

Posted by "Brett M. Bergquist" <bb...@snet.net>.
Which version of Tomcat are you refering to?  If Tomcat 3.2.X, try the
HttpServletResponse.flushBuffer() method. This works for me in Tomcat 3.2.2.



----- Original Message -----
From: T <rl...@bonbon.net>
To: <to...@jakarta.apache.org>
Sent: Tuesday, June 19, 2001 6:26 PM
Subject: flushing


> How can I flush Tomcat? Nothing from the PrintWriter reaches the
> browser until the servlet completes. flush() does nothing. Has anybody
> altered the facade classes to enable flushing?
>
> Why is Tomcat set up that way?
>
> Thanks.
>
>
>


Re: flushing

Posted by Dmitri Colebatch <di...@nuix.com.au>.
Doesn't tomcat need to set the Content-length HTTP header in the response 
before sending anything?  That would explain (to me at least) why flush 
doesn't send it to the client.  I'm guessing all it does is tick over the 
content-length counter.

cheers
dim

On Wed, 20 Jun 2001 08:26, you wrote:
> How can I flush Tomcat? Nothing from the PrintWriter reaches the
> browser until the servlet completes. flush() does nothing. Has anybody
> altered the facade classes to enable flushing?
>
> Why is Tomcat set up that way?
>
> Thanks.