How to setup and lookup an EJB under JBoss 3.0 with tomcat4.03 embedded

2002-08-17 Thread kam leung

Hi,

I had searched for how to set the web.xml and server.xml for looking up a 
session bean in the Tomcat 4.1 document page, but did not find something to 
close to we I needed. Can someone point me to a how-to document or example 
that shows how to looking up a session bean with JNDI (how-to setup the 
web.xml, server.xml and code that lookups the session bean).
The session bean is running under JBoss 3.0. I installed the Jboss version 
3.0 with Tomcat4.03 embedded.

Thank you in advance, your help is greatly appreciated.

Kam




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




Re: Apache won't start with LoadModule included

2002-08-17 Thread Robert L Sowders

mod_jk2 was built against the apache 2.0.38 sources and will not work for 
2.0.40, you will have to compile it yourself for 2.0.40.  As for TC 4.1.9, 
it failed to start for 2.0.39 and I'm left with the impression it's still 
being worked on as the default install has no workers2.properties file and 
the jk2.properties file is totally commented out.

http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg31791.html







"Kenny G. Dubuisson, Jr." <[EMAIL PROTECTED]>
08/16/2002 07:33 AM
Please respond to "Tomcat Users List"

 
To: <[EMAIL PROTECTED]>
cc: 
Subject:Apache won't start with LoadModule included

I've now rebuilt my server again this time trying JSDK 1.4.0, Apache 
2.0.40,
Tomcat 4.1.9 LE, and mod_jk2 (the latest version of each).  Everything 
works
individually but when I add the LoadModule directive for mod_jk2 in 
Apache's
config file, Apache won't start.  I get a error dialog box stating "The
requested operation has failed" and Apache doesn't start.  If I remove the
LoadModule line, Apache starts fine.  I've re-downloaded mod_jk2.dll and 
put
it in Apache's modules directory to no avail.

This is like the 10th time I've reloaded this server trying to get
Apache/Tomcat to work together.  It just seems that it has to be easier 
than
this.  Any advice that anyone can give would be very welcome.  Thanks,
Kenny


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





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




Re: Fw: Still can't get Apache to forward to Tomcat

2002-08-17 Thread Robert L Sowders

There's no reason that it shouldn't.  I don't use Oracle here, but others 
on this list have suggested putting the oracle jar file in the common 
directory.  Search the list for mention of this, I hazy on this.  Here's 
one I found that looks like it's ok.  Try a search for JDBC.

http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg61825.html




"Kenny G. Dubuisson, Jr." <[EMAIL PROTECTED]>
08/16/2002 06:03 AM
Please respond to "Tomcat Users List"

 
To: <[EMAIL PROTECTED]>
cc: 
Subject:Fw: Still can't get Apache to forward to Tomcat

Do you know if this configuration works with Oracle 9i?  I've tried
everything 'cept standing on my head to get my other config to work so now
I'm gonna try this one that you suggest.  Thanks for all the feedback,
Kenny

- Original Message -
From: "Robert L Sowders" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, August 15, 2002 8:46 PM
Subject: Re: Still can't get Apache to forward to Tomcat


> Try this one, it works for me.
>
> ftp://pokey.wr.usgs.gov/pub/rsowders/Apache2_Win2k_TC4.1.8_JSDK1.4.doc
>
> rls
>
>
>
>
>
> "Kenny G. Dubuisson, Jr." <[EMAIL PROTECTED]>
> 08/15/2002 01:27 PM
> Please respond to "Tomcat Users List"
>
>
> To: <[EMAIL PROTECTED]>
> cc:
> Subject:Still can't get Apache to forward to Tomcat
>
> I've been trying all day (installed from blank hard drive twice) and I
> can't
> get Apache to forward requests to Tomcat.  I'm testing this by trying to
> access http://localhost/examples.  It should be forwarding to
> http://localhost:8080/examples (Tomcat's examples).
>
> I've found the following two entries in my Apache error.log file:
> [Thu Aug 15 15:23:51 2002] [error] lb_worker.service() all workers in
> error
> or disabled state
> [Thu Aug 15 15:23:51 2002] [error] mod_jk.handler() Error connecting to
> tomcat 21000
>
> Does anyone have any ideas?  I used the workers2.properties and
> jk2.properties files from Dave on this list (I only changed the paths).
> Everything else is default Apache 2.0.39, Tomcat 4.1.8, and JSDK 1.3.1.
> Thanks,
> Kenny
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>
>
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:



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





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




RE: Post 4.1.8 install

2002-08-17 Thread Robert L Sowders

Change JDK_HOME to JAVA_HOME and try it again.






"Robert Dunn" <[EMAIL PROTECTED]>
08/15/2002 11:48 PM
Please respond to "Tomcat Users List"

 
To: "Tomcat Users List" <[EMAIL PROTECTED]>
cc: 
Subject:RE: Post 4.1.8 install

Hi Jake,

I installed version 1.3.1, JDK (J2EE). I added the JDK_HOME environment
variable and added the path to the "PATH" environment variable. Still same
problem - did a reboot - to make sure all changes were applied.

Any other ideas. Thanks for your help.

-Original Message-
From: Jacob Kjome [mailto:[EMAIL PROTECTED]]
Sent: Friday, 16 August 2002 3:42 PM
To: Tomcat Users List
Subject: Re: Post 4.1.8 install


ah, did you install the JDK (if so, which version?) and provide the
%JDK_HOME% system variable?  Also, if you did this, did you add
JDK_HOME/bin to the beginning of your system PATH variable?

Jake




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





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




Re: dynamic webapp deployment and mod_jk

2002-08-17 Thread Glenn Nielsen

For mod_jk 1.2 you can use JkAutoAlias to automatically server static
pages for any web application context, even new ones which get added.

Here is an example for the apache httpd.conf:

JkAutoAlias /usr/local/tomcat/webapps

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

Regards,

Glenn

David S. Soleno wrote:
> Looking through the Apache + Tomcat configuration examples we see how to
> configure Apache to serve static files from its root directory and
> forward to Tomcat if the request matches one of the registered context
> paths.
> 
> Our problem occurs from the fact that our system allows for webapps to
> be deployed and undeployed dynamically, which means the list of context
> paths that require forwarding changes.  While we don't mind restarting
> Tomcat when this happens but we don't want to restart Apache.
> 
> The list of directories that contains static files for Apache to serve
> is constant so it seems what we need is a way to configure Apache to
> redirect all requests to Tomcat EXCEPT those that match the list of
> context paths.
> 
> Does anyone know how to achieve this?
> 
> 
> -- 
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 




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




Re: Tomcat 4.0.4: Unnecessary $TOMCAT/temp/ directory?

2002-08-17 Thread Glenn Nielsen

Do not remove this temp directory.  This is the temporary
directory configured in the Tomcat startup with
-Djava.io.tmpdir.  This temp directory is used by the JVM
for internal things like jar files, etc.

Regards,

Glenn

Eddie Ruvinsky wrote:
> I don't believe this is the case.  According to the
> source, if the "workDir" attribute of StandardHost is
> null (default case), the temp dir will be generated
> inside $CATALINA_BASE/work/.  Otherwise, it will be
> generated in the StandardHost's "workDir."
> 
> I believe that it's unused and doesn't belong in the
> Tomcat distribution.  Can someone confirm?
> 
> -Eddie
> 
> --- Mona Wong-Barnum <[EMAIL PROTECTED]> wrote:
> 
>>Hi Eddie:
>>
>>
>>>When I unpacked the distribution of Tomcat 4.0.4,
>>
>>I
>>
>>>noticed an empty temp/ directory in the Tomcat
>>
>>root
>>
>>>directory.  I don't believe it gets used anywhere
>>
>>in
>>
>>>the code.  Should it be cleaned up?
>>
>>  No leave it.  It will be used a temp directory in
>>your servlet code 
>>(javax.servlet.context.tempdir)
>>  
>>Cheers,
>>
>>Mona
>>
>>
> 
> ==
> 
>>Mona Wong-Barnum
>>National Center for Microscopy and Imaging Research
>>University of California, San Diego
>>http://ncmir.ucsd.edu/
>>
>>"The truth shall set you free, but first it will
>>piss you off"
>>  A Landmark instructor
>>
> 
> ==
> 
>>
>>
>>--
>>To unsubscribe, e-mail:  
>>
>>For additional commands, e-mail:
>>
>>
> 
> 
> __
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 




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




Re: BasicDataSourceFactory and TC 4.1.9

2002-08-17 Thread Paul McGovern


Upon further investigation, I found that the config I use below does work if, 
and only if, I access the servlet from localhost:8080. I'm using mod_webapp 
with Apache 1.3.24 and have the following entry, which seems to work fine, in 
httpd.conf:


 WebAppConnection conn  warp  localhost:8008
 WebAppDeploy examplesconn  /examples
 WebAppDeploy formprocconn  /formproc
 WebAppInfo /webapp-info


sertver.xml:


web.xml:

   DBTestServlet
   /dbTest


So, "http://localhost/formproc/dbTest"; fails to instantiate the Connection 
properly, but "http://localhost:8080/formproc/dbTest"; works properly. 

Can anyone explain what is going on here?

(Sorry for the long post, but this is starting to drive me nuts.)

> I am having probelms getting a Connection from the DataSource I get out of
> JNDI. I set up the Resource section of my server.xml as described in the
> HOW-TO for 4.1.9 and am using mm.mysql 2.0.14 with MySQL 3.23.51. The DB
> and dirver seem to work fine together.
>
> It seems I can get the DataSource from the JNDI context as expected, but
> calling getConnection() yeilds an SQLException that says, "Cannot load JDBC
> driver class 'null'". The driver is sitting in common/lib and can be seen
> and used by servlets in my context if I do it 'by hand'. A quick look
> through DBCP's BasicDataSourceFactory confirms 'driverClassName' is the
> correct parameter name for the driver class, and the exception is being
> generated in BasicDataSource:
>
> // Load the JDBC driver class
> Class driverClass = null;
> try {
> driverClass = Class.forName(driverClassName);
> } catch (Throwable t) {
> String message = "Cannot load JDBC driver class '" +
> driverClassName + "'";
> logWriter.println(message);
> t.printStackTrace(logWriter);
> throw new SQLException(message);
> }
>
> Any help would be greatly appreciated.
>
>
> From my server.xml:
>  type="javax.sql.DataSource"/>
>  
>  
>   factory
>   org.apache.commons.dbcp.BasicDataSourceFactory
> 
>maxActive100
>maxIdle3
>maxWait100
>usernametcuser
>passwordX
>
>  driverClassName
>  org.gjt.mm.mysql.Driver
>
>   
> url
> jdbc:mysql://localhost:3306/form_rev
>   
> 
>
> From my web.xml:
>   
>   DB Connection
>   jdbc/form_rev_DB
>   javax.sql.DataSource
>   Container
>   

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




DBCP borrowObject failed

2002-08-17 Thread Short, Dave

I am having a problem getting a connection from JNDI.  I set up my
server.xml and web.xml files per the instructions in the JNDI Resources
HOW-TO and JNDI DataSource Examples on the Tomcat 4.1 Documentation Page.

Configuration:

W2K
Tomcat 4.1.9 (Stand Alone)
Oracle 8.1.7

Here's my Tomcat console output, server.xml and web.xml snippets.

Any help would be much appreciated.

Dave

Console Output

*

[INFO] Registry - -Loading registry information
[INFO] Registry - -Creating new Registry instance
[INFO] Registry - -Creating MBeanServer
[INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.9
[INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080
[INFO] ChannelSocket - -JK2: ajp13 listening on tcp port 8009
[INFO] JkMain - -APR not loaded, disabling jni components:
java.io.IOException:
no jkjni in java.library.path
[INFO] JkMain - -Jk running ID=0 time=60/60
config=C:\Tomcat\conf\jk2.properties
DBCP borrowObject failed: null
java.lang.NullPointerException
at
org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnect
ion.java:237)
at
org.apache.commons.dbcp.PoolableConnectionFactory.activateObject(PoolableCon
nectionFactory.java:273)
at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown Source)
at
org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool
.java:117)
at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja
va:110)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3
12)
at foo.DBTest.init(Unknown Source)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:52)
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
02)
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)
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:2350)
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:170)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171
)
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.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:380)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at
org.apache.tom

RE: How iss Tomcat's performance?

2002-08-17 Thread Sexton, George

Every application has it's own performance bottlenecks and parameters.

You might want to download JMeter and test your specific application.

http://jakarta.apache.org/jmeter/index.html

Personally, I got more than enough throughput to swamp a T1 on a pretty
database intensive application. The server was only a Dual 500 PIII.

George Sexton
MH Software, Inc.
Voice: 303 438 9585
http://www.mhsoftware.com




-Original Message-
From: Serdar BOZDAG [mailto:[EMAIL PROTECTED]]
Sent: 17 August, 2002 4:14 PM
To: Tomcat Users List
Subject: How iss Tomcat's performance?


Hi,
I have two web site running on Apache Tomcat 4.0.4
I am quite suspicious of the performance of Tomcat. (I use
Tomcat-standalone)

At this time the visit count of these sites are not so much (100-200 people
each day)

I want to know how powerful Tomcat is?
Bye the way what would be your choice for a web server for a NT machine. (I
need JSP and  Servlet support)

Thanks in advance,
Serdar



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




How iss Tomcat's performance?

2002-08-17 Thread Serdar BOZDAG

Hi,
I have two web site running on Apache Tomcat 4.0.4
I am quite suspicious of the performance of Tomcat. (I use Tomcat-standalone)

At this time the visit count of these sites are not so much (100-200 people each day)

I want to know how powerful Tomcat is?
Bye the way what would be your choice for a web server for a NT machine. (I need JSP 
and  Servlet support)

Thanks in advance,
Serdar




Re: Way to specify realms for dynamically installed apps?

2002-08-17 Thread Craig R. McClanahan



On Sat, 17 Aug 2002, Chris Nokleberg wrote:

> Date: Sat, 17 Aug 2002 11:39:34 -0700
> From: Chris Nokleberg <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: Way to specify realms for dynamically installed apps?
>
> On Wed, 14 Aug 2002, Craig R. McClanahan wrote:
> > On Wed, 14 Aug 2002, Chris Nokleberg wrote:
> > > I'm using the new ant tasks to install and deploy web apps from
> > > ant. One of my applications needs a JDBCRealm, but there doesn't seem
> > > to be a way to supply the manager with additional bits it might need
> > > to stick into server.xml, is that right? I can add the realm at the
> > > engine level, but I'd rather not.
> >
> > In Tomcat 4.1, you can dynamically deploy a "context configuration file"
> > instead of, or along with your webapp.  Such a file can contain the
> >  element, and all nested subelements, from what you would
> > normally put in server.xml, so you can indeed dynamically deploy an app
> > with a custom realm.
>
> Thanks for the tip, I am using 4.1.9.
>
> This page:
>   http://jakarta.apache.org/tomcat/tomcat-4.1-doc/manager-howto.html
> doesn't list the "config" install option.
>

Probably hasn't been updated -- check the copy of this page in the 4.1.9
release bundle .

> Also, it's not clear to me why there isn't a "config" option for the
> deploy task as well as install. At least, that's what the code for the
> ant tasks would imply...deploy is not documented in the javadoc for
> ManagerServlet. I can enter these things into the bug db if they're
> new issues.
>

For the deploy command, simply include your context confgiuration file in
the WAR at "META-INF/context.xml".

> -Chris

Craig


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


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




java.lang.NullPointerException tc4.0.4

2002-08-17 Thread Luminous Heart

I get this error the first time I try to access the
jsp page, if I reload it works fine. What is wrong?

Apache Tomcat/4.0.4 - HTTP Status 500 - Internal
Server Error



type Exception report

message Internal Server Error

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

exception 

java.lang.NullPointerException
at
org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:61)
at
org.postgresql.Connection.ExecSQL(Connection.java:398)
at
org.postgresql.jdbc2.Statement.execute(Statement.java:130)
at
org.postgresql.jdbc2.Statement.executeQuery(Statement.java:54)
at
org.postgresql.jdbc2.PreparedStatement.executeQuery(PreparedStatement.java:99)
at
com.codestudio.sql.PoolManPreparedStatement.executeQuery(Unknown
Source)
at
org.apache.jsp.AccountAccess$jsp._jspService(AccountAccess$jsp.java:207)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
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:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:531)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:392)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458)
at
org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
at java.lang.Thread.run(Thread.java:536)






__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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




BasicDataSourceFactory and TC 4.1.9

2002-08-17 Thread Paul McGovern


I am having probelms getting a Connection from the DataSource I get out of 
JNDI. I set up the Resource section of my server.xml as described in the 
HOW-TO for 4.1.9 and am using mm.mysql 2.0.14 with MySQL 3.23.51. The DB and 
dirver seem to work fine together.

It seems I can get the DataSource from the JNDI context as expected, but 
calling getConnection() yeilds an SQLException that says, "Cannot load JDBC 
driver class 'null'". The driver is sitting in common/lib and can be seen and 
used by servlets in my context if I do it 'by hand'. A quick look through 
DBCP's BasicDataSourceFactory confirms 'driverClassName' is the correct 
parameter name for the driver class, and the exception is being generated in 
BasicDataSource:

// Load the JDBC driver class
Class driverClass = null;
try {
driverClass = Class.forName(driverClassName);
} catch (Throwable t) {
String message = "Cannot load JDBC driver class '" +
driverClassName + "'";
logWriter.println(message);
t.printStackTrace(logWriter);
throw new SQLException(message);
}

Any help would be greatly appreciated.


>From my server.xml:

 
 
  factory
  org.apache.commons.dbcp.BasicDataSourceFactory

   maxActive100
   maxIdle3
   maxWait100
   usernametcuser
   passwordX
   
 driverClassName
 org.gjt.mm.mysql.Driver
   
  
url
jdbc:mysql://localhost:3306/form_rev
  


>From my web.xml:
  
  DB Connection
  jdbc/form_rev_DB
  javax.sql.DataSource
  Container
  

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




Re: Way to specify realms for dynamically installed apps?

2002-08-17 Thread Chris Nokleberg

On Wed, 14 Aug 2002, Craig R. McClanahan wrote:
> On Wed, 14 Aug 2002, Chris Nokleberg wrote:
> > I'm using the new ant tasks to install and deploy web apps from
> > ant. One of my applications needs a JDBCRealm, but there doesn't seem
> > to be a way to supply the manager with additional bits it might need
> > to stick into server.xml, is that right? I can add the realm at the
> > engine level, but I'd rather not.
> 
> In Tomcat 4.1, you can dynamically deploy a "context configuration file"
> instead of, or along with your webapp.  Such a file can contain the
>  element, and all nested subelements, from what you would
> normally put in server.xml, so you can indeed dynamically deploy an app
> with a custom realm.

Thanks for the tip, I am using 4.1.9.

This page:
  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/manager-howto.html
doesn't list the "config" install option.

Also, it's not clear to me why there isn't a "config" option for the
deploy task as well as install. At least, that's what the code for the
ant tasks would imply...deploy is not documented in the javadoc for
ManagerServlet. I can enter these things into the bug db if they're
new issues.

-Chris

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




Error Page Configuration

2002-08-17 Thread Kurtz, Todd

Has anyone configured tomcat error pages through $CATALINA_HOME/conf/web.xml
and been able to access the implicit exception object from within the error
page?

Regards,
Todd Kurtz 

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




RE: mod_jk2.so needed

2002-08-17 Thread Andrew Conrad

The mod_jk2.dll file can be found here

http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk2/nightly/w
in32/


- Andrew



> -Original Message-
> From: Niket Anand [mailto:[EMAIL PROTECTED]] 
> Sent: Saturday, August 17, 2002 3:30 AM
> To: [EMAIL PROTECTED]
> Subject: mod_jk2.so needed
> 
> 
> Hi all,
> Can anybody send me a link from where I can download 
> mod_jk2.so? I am unable to build this file. I am using 
> Apache2.0.4, Tomcat4.0.3 in windows2000 Or please send it 
> with attachment.
> 
> I am following the instructions given in this link to run 
> apache with Tomcat http://www.pubbitch.org/jboss/mod_jk2.html
> but unable to build .so file
> 
> Thanks in advance
> Niket
> 
> 
> 
> --
> To unsubscribe, e-mail:   
>  [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: 
> 


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




RE: Persistent Connection

2002-08-17 Thread Andrew Conrad

It's a operating system issue. 


NOTE: It is normal to have a socket in the TIME_WAIT state for a long
period of time. The time is specified in RFC793 as twice the Maximum
Segment Lifetime (MSL). MSL is specified to be 2 minutes. So, a socket
could be in a TIME_WAIT state for as long as 4 minutes. Some systems
implement different values (less than 2 minutes) for the MSL.

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q137984


But if you really want to change the TIME_WAIT, look here
http://support.microsoft.com/default.aspx?scid=kb;en-us;q314053


To test your MSL (maximum segment lifetime), you can use this tool
http://polygraph.ircache.net/doc/msl_test.html

- Andrew

> -Original Message-
> From: Taral Shah [mailto:[EMAIL PROTECTED]] 
> Sent: Saturday, August 17, 2002 2:16 AM
> To: Tomcat Users List
> Subject: Re: Persistent Connection
> 
> 
> Hi,
> Thanks for reply,
> 
> But I am only using tomcat. I dont want to use apache just 
> for this reason.Can any one guide me what should i do to 
> close this connection in tomcat or to ask tcp/ip stack to 
> close connection. Its not at all affecting the performance of 
> application but when i see at netstat statstics it sometimes 
> shows me thousands of connections open.
> 
> Any idea?
> Thanks
> Taral Shah
> 
> Experience is what you get when you were expecting something else.
> 
> - Original Message -
> From: "Mike Jackson" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" <[EMAIL PROTECTED]>; 
> "Taral Shah" <[EMAIL PROTECTED]>
> Sent: Friday, August 16, 2002 10:53 PM
> Subject: RE: Persistent Connection
> 
> 
> "TIME_WAIT" is something the tcp/ip stack does; it doesn't 
> have anything to do with Tomcat per say.  What happens (as I 
> understand it) is that once your app has closed the 
> connection (page is done or whatever), the stack will hold 
> the connection in a "TIME_WAIT" state to prevent the other 
> end, the client, from reconnecting to the same port.
> 
> So the problem isn't really tomcat, its the TCP/IP stack.  
> However I've also found that under unix if you're using 
> apache+tomcat you don't have a ton of TIME_WAIT sockets on 
> the webserver.  Apache apparently sets a parameter to 
> eliminate the TIME_WAIT sockets, either on close or on open 
> of the socket (I don't know which).  So what you might want 
> to do is run IIS or Apache in front of tomcat.  I don't know 
> that IIS does the same thing as Apache in regards to the 
> sockets, but if it does then it'll work nearly as well in 
> front of tomcat.  But there is a slight problem here as well, 
> you need to be sure that you're using APJ13 not APJ12 as 
> APJ12 will open a new connection for each web access that 
> tomcat handles.  And in that casey you'd get more TIME_WAIT 
> sockets.  APJ13 multiplexes the requests over one persistent 
> socket, so you don't have the extra overhead of opening the 
> socket on each request, or the TIME_WAIT socket lingering 
> there for some time period.
> 
> Also, just as a FYI, under unix you can change the TIME_WAIT 
> time period but it's not recommended that you do so.  The 
> default time period is about 4 minutes as I recall.  You can 
> probably also change it under windows, but I wouldn't have a 
> clue how to do that.
> 
> --mikej
> -=-
> mike jackson
> [EMAIL PROTECTED]
> 
> > -Original Message-
> > From: Taral Shah [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, August 16, 2002 2:40 AM
> > To: Tomcat Users List
> > Subject: Persistent Connection
> >
> >
> > I am using tomcat 3.3
> >
> > Now I am calling one jsp which loads an applet, internally 
> that applet 
> > uses url connection to fetch data.
> > Now problem is that when i check with netstat application(its
> > inbuilt in win
> > nt, run through netstat -n)
> > I came to know tomcat opens no of connections and keep them 
> in TIME_WAIT
> > mode.
> >
> > This is happening with simple jsps as well as with servlet. 
> For each 
> > request it opens around 2/3(depending on the no of jsps included) 
> > connection with :8080 port. These all are of tcp type 
> > connections. I read in some of materials that in Http 1.1, as 
> > persistent connection is used so it keeps the connection 
> open unless I 
> > specify them to close.
> >
> > I wrote in my code as response.setHeader("Connection", 
> "close"); but 
> > still the no of open connection increases. In my 
> application if hits 
> > are many then it reaches to thousands.
> >
> > Has any one seen this before(I think this is for all tomcat-You can 
> > check with netstat). Has any one explicitly closed the connection 
> > through header or is there any
> > way to specify in tocat configuration so it does not keep 
> the connection
> > open.
> >
> > Thanks
> >
> > Taral Shah
> > Experience is what you get when you were expecting something else.
> >
> >
> > --
> > To unsubscribe, e-mail: 
> > 
> > For additional commands, e-mail: 
> > 
> >
> >
> 
> 

Re: retrieving HttpSession in Filter?

2002-08-17 Thread Craig R. McClanahan



On Sat, 17 Aug 2002, Nikola Milutinovic wrote:

> Date: Sat, 17 Aug 2002 16:23:31 +0200
> From: Nikola Milutinovic <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: retrieving HttpSession in Filter?
>
> Craig R. McClanahan wrote:
>
> >
> > This is not the right test for a newly created session, because there
> > *was* no requested session.  Try something like this instead:
> >
> >   HttpSession session = request.getSession(false);
> >   if (session == null) {
> > ... no session exists ...
> >   } else if (session.isNew()) {
> > ... this is a newly created session ...
> >   } else {
> > ... this is an existing session ...
> >   }
>
> Hi Craig.
>

THe answers to all of these questions are in the servlet API javadocs --
among other places, you can get them in the servlet spec:

  http://java.sun.com/products/servlet/download.html

> One quick question. What are the semantics of "session.isNew()"?
>

This returns true if the client has not acknowledged that they want to
participate in this session yet -- in other words, from the moment the
session is created until the client returns a subsequent request with the
session id, that session is considered "new".

> If I call request.getSession(false), can it fail (return "null")? What would
> that mean?
>

Returning null is not a failure -- it means that there was no session
already in existence.

request.getSession(true)  - Create (if necessary) and return a session
request.getSession(false) - Return a session if there is one, but don't
create a new one
request.getSession()  - Same as request.getSession(true)

> I realize it should return "null" inside a JSP page that had page session
> setting turnet to "false", but in general, is there any other occasion?
>

Reading the API javadocs, and the servlet spec, will tell you a lot about
the environment you are trying to program for :-).

> Nix.
>

Craig


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




Re: retrieving HttpSession in Filter?

2002-08-17 Thread Craig R. McClanahan



On Sat, 17 Aug 2002, tek1 wrote:

> Date: Sat, 17 Aug 2002 17:47:32 +0900
> From: tek1 <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: retrieving HttpSession in Filter?
>
> eddie and craig, thanks for your replies.
>
> i was calling the HttpServletRequest.getSession() before the response was
> committed.  in the below code on line 4, i didn't mention that was using a
> responseWrapper, so the servlet used the responseWrapper, and when control
> returned to the filter, the filter called HttpServletRequest.getSession()
> before committing the response.
>
> HttpServletRequest.getSession(false) works, but
> HttpServletRequest.getSession() *before* committing the response, resulted
> in a hang...
>
> is that behavior correct?
>

There shouldn't ever be a hang, obviously.  Are you sure you don't have
any infinite loop in your wrappers somewhere (it's pretty easy to get that
messed up)?

There aren't any hangs in the standard Tomcat code for getSession().

Craig


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




Re: retrieving HttpSession in Filter?

2002-08-17 Thread Nikola Milutinovic

Craig R. McClanahan wrote:

> 
> This is not the right test for a newly created session, because there
> *was* no requested session.  Try something like this instead:
> 
>   HttpSession session = request.getSession(false);
>   if (session == null) {
> ... no session exists ...
>   } else if (session.isNew()) {
> ... this is a newly created session ...
>   } else {
> ... this is an existing session ...
>   }

Hi Craig.

One quick question. What are the semantics of "session.isNew()"?

If I call request.getSession(false), can it fail (return "null")? What would 
that mean?

I realize it should return "null" inside a JSP page that had page session 
setting turnet to "false", but in general, is there any other occasion?

Nix.


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




Too many threads

2002-08-17 Thread Ronaldo

Hi,
  I'm developing a web aplication with jsp and servlets, and I'm beging to
use tomcat.
  The only problem I'm having is, when I make a stress test on my tomcat
(4.0.4 on RH Linux) the server create as many threads as the number of
requests. Is this normal? shuldn't be some kind of inteligent thread pool?
Because, I get over 800 threads and my test machine isn't that much so it
crashs all the time, because tomcat is eating more than 200 M of memory.
Can anyone help me on this?

Even not, thanks a lot,

Ronaldo Florence


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




Re: Using Tomcat as a proxy?

2002-08-17 Thread Nikola Milutinovic

ope wrote:

> I am looking for a way to use Tomcat as a proxy
> similar to the way that Apache can be setup to proxy
> to Tomcat.  What I want to do is have Tomcat setup so
> that any URLs that have the path
> http://myserver/someapp are forwarded to
> http://otherserver/someapp.


Apache can do this with mod_rewrite ONLY IF mod_cache is loaded. Iæm not aware 
of any proxy capability in Tomcat.


> I have seen a few vague references to Tomcat doing
> this but have not been able to find any real
> documentation.  Does anyone know of some way that I
> can this?  Any links or hints?

Why would you want to use a Java Servlet Container to do proxying? It's like 
using a Space Shuttle to do door-to-door delivery. If you need proxying, use 
Squid or Apache.

If you want to have pieces of other sites inside your webapp, the it is a whole 
new ball game.

Nix.


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




RE: How can i set tomcat to auto reload the servlet?

2002-08-17 Thread Reynir Hübner

just set reloadable="true" on the context (in server.xml)

hope it helps
-reynir


> -Original Message-
> From: Aaron Chan [mailto:[EMAIL PROTECTED]]
> Sent: 17. ágúst 2002 10:12
> To: [EMAIL PROTECTED]
> Subject: How can i set tomcat to auto reload the servlet?
> 
> 
> Hi,
>  
> May I know how can I make tomcat to auto reload every time I make a
> changes to the classes I placed in ROOT/WEB-INF/classes ?
> I am running on Tomcat 4.0. Thank you.
>  
> [EMAIL PROTECTED]
>  
>  
> 

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




Re: Tomcat 4.0.4: Which HTTP/1.1 Connector? Coyote??

2002-08-17 Thread Remy Maucherat

Eddie Ruvinsky wrote:
> Hello,
> 
> The release notes for Tomcat 4.0.4 say that the new
> Coyote HTTP/1.1 connector now ships with Tomcat.  The
> notes mention that it is more optimizied and robust
> than the [soon to be deprecated] HttpConnector for
> HTTP/1.1.   However, the Tomcat 4.0.4 docs haven't
> been updated to include a section on Coyote, the
> Coyote connector is commented out by default in the
> server.xml file that ships with Tomcat, and nowhere in
> the distribution does it say that the Coyote package
> should be used instead of HttpConnector.
>  
> Besides being faster/robust, I'm wondering if Coyote
> is *the* recommended HTTP/1.1 connector to use in
> Tomcat 4.0.4 (i.e., in a production environment).  I'm
> not looking for a "beta"-quality connector.  Could
> someone please confirm?

For 4.0.4, the default HTTP/1.1 connector is the supported one (although 
for a few select problems, the answer is "won't fix").

Remy


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




Re: Tomcat Current Working Directory

2002-08-17 Thread Larry Meadors

>>> Is there a way to configure Tomcat 4.0.4's 
>>> current working directory to point to 
>>> sub-directory of the webapps folder, 
>>> rather than /bin?

I hate to answer a question with a question, but here goes: Why would
you want to do that?

Larry


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




How can i set tomcat to auto reload the servlet?

2002-08-17 Thread Aaron Chan

Hi,
 
May I know how can I make tomcat to auto reload every time I make a
changes to the classes I placed in ROOT/WEB-INF/classes ?
I am running on Tomcat 4.0. Thank you.
 
[EMAIL PROTECTED]
 
 



Re: ?? JSP and request.getPathInfo() in Tomcat ??

2002-08-17 Thread Bill Barker

This one really belongs in an FAQ.

Section 11.1 bullet 3 of the servlet-2.3 spec states that:

If the last segment in the URL path contains an extension (e.g. .jsp), the
servlet
container will try to match a servlet that handles requests for the
extension.
An extension is defined as the part of the last segment after the last '.'
character.


In particular, it is not possible to have "extra path" information on a JSP
page (unless you declare it to be prefixed-mapped in your web.xml).

"Tony LaPaso" <[EMAIL PROTECTED]> wrote in message
009301c244dc$6b688120$74c1f80c@abner">news:009301c244dc$6b688120$74c1f80c@abner...
> Hi all,
>
> I was hoping someone could explain something. I'm not sure if
> this is a Tomcat issue or a JSP issue.
>
> I'm using Tomcat v4.1.8 on Win 2k.
>
> It seems I cannot obtain the "extra path" information at the end
> of a URL from within a JSP. But, if I run the servlet that was
> generated from the JSP, I *can* get the extra path information
> with no problem.
>
> For example, below is a simple JSP (named Test.jsp) which I
> invoke using the URL below. Notice "/extra/path/info" is the
> extra path information at the end of the URL:
>http://localhost/t/Test.jsp/extra/path/info:
>
>
> Test
> 
> 
> This is a test...
> <%= "Path Info: " + request.getPathInfo() %>
> 
> 
>
>
> When I run this JSP it produces the output:
>
> "This is a test... Path Info: null"
>
> Notice the request.getPathInfo() is returning null.
>
> Now, if I take the generated servlet class file and place it in
> my WEB-INF/classes directory, and I run the servlet with this
> URL:
>
> http://localhost/t/servlet/org.apache.jsp.Test_jsp/extra/path/inf
> o
>
> I get this output:
>
> "This is a test... Path Info: /extra/path/info"
>
> So, why can a JSP not have access to the extra path information?
> Is this a Tomcat configuration issue or something else?
>
> Thanks...
>
> Tony





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




Re: getRemoteUser() reset to null after authenticated user hits an unauthorized page

2002-08-17 Thread Bill Barker


"Craig R. McClanahan" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> On Fri, 16 Aug 2002, Scott Dayberry wrote:
>
> > Date: Fri, 16 Aug 2002 11:11:53 -0600
> > From: Scott Dayberry <[EMAIL PROTECTED]>
> > Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> > To: 'Tomcat Users List' <[EMAIL PROTECTED]>
> > Subject: RE: getRemoteUser() reset to null after authenticated user hits
> > an unauthorized page
> >
> > Thanks for your response.  I was hoping it wasn't a bug in 3.2.3, but
rather
> > a configuration problem, or that a workaround existed.  :*)  Does this
bug
> > exist in 3.3.1?
> >
>
> I haven't got a clue ... I've never used 3.3 for anything.  I'm sure
> others here can speak to that.

You've never wanted to run Tomcat under J2ME on you toaster? ;-)

getRemoteUser() works as expected under 3.3.1.

>
> > I've been reluctant to upgrade to Tomcat 4 due to potential installation
and
> > compatibility issues with Apache 1.3.X, mod_jk.so, on both Solaris 2.6
and
> > 2.8.  Is this combination a clean upgrade on both OS's?
> >
>
> Likewise, you're better off asking some of the other folks who use the web
> connectors, but my impression is that it should work well for you.

As much as I hate to admit it, Craig is probably right.  The Java side of
the 4.x connectors are compatible with the 3.x binary Apache modules.  In
theory you can install your favorite version of 4.0.x without changing
anything on the Apache side, and install 4.1.x with only slight changes on
the Tomcat side.

>
> Craig
>
> >
> > > -Original Message-
> > > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, August 16, 2002 10:30 AM
> > > To: Tomcat Users List
> > > Subject: Re: getRemoteUser() reset to null after
> > > authenticated user hits
> > > an unauthorized page
> > >
> > >
> > >
> > >
> > > On Fri, 16 Aug 2002, Scott Dayberry wrote:
> > >
> > > > Date: Fri, 16 Aug 2002 09:31:38 -0600
> > > > From: Scott Dayberry <[EMAIL PROTECTED]>
> > > > Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> > > > To: [EMAIL PROTECTED]
> > > > Subject: getRemoteUser() reset to null after authenticated
> > > user hits an
> > > > unauthorized page
> > > >
> > > > I am using form-based authentication under Tomcat 3.2.3.
> > > >
> > > > I have 3 security-constraint sections in web.xml for 3
> > > different user roles.
> > > > If an already authenticated user selects a page to which he is not
> > > > authorized, he is redirected to the form-error-page (I
> > > thought this should
> > > > be a 403-Forbidden error instead), and his authentication
> > > is invalidated.
> > > > (A getRemoteUser() call returning null at this point verifies this).
> > > >
> > > > The implication of this, is that he can no longer select
> > > any pages that he
> > > > IS authorized for, and must re-login. Is this a known bug
> > > with Tomcat 3.2.3,
> > > > expected behavior, or is there a configuration setting I am missing?
> > > >
> > >
> > > Sounds like a bug in 3.2.3 (which is pretty ancient, by the
> > > way).  I think
> > > 3.2.3 also failed to return getRemoteUser() correctly when you
> > > successfully log on, and then navigate to a URL not protected by a
> > > security constraint.  Tomcat 4.0 and 4.1 handle that
> > > situation correctly.
> > >
> > > > Thanks in advance,
> > > > Scott
> > > >
> > >
> > > Craig
> > >
> > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > 
> > > > For additional commands, e-mail:
> > > 
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > 
> > > For additional commands, e-mail:
> > > 
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:

> > For additional commands, e-mail:

> >
> >





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




Re: retrieving HttpSession in Filter?

2002-08-17 Thread tek1

eddie and craig, thanks for your replies.

i was calling the HttpServletRequest.getSession() before the response was 
committed.  in the below code on line 4, i didn't mention that was using a 
responseWrapper, so the servlet used the responseWrapper, and when control 
returned to the filter, the filter called HttpServletRequest.getSession() 
before committing the response.

HttpServletRequest.getSession(false) works, but 
HttpServletRequest.getSession() *before* committing the response, resulted 
in a hang...

is that behavior correct?

thanks for the getSession(false) suggestion.  it's working with that.



At 23:37 02/08/16 -0700, you wrote:

>  and retrieve the HttpSession object, *if* the session
> > has never been created before?
>
>The rules for a filter are the same as the rules for a servlet -- you have
>to create a session if you want one, before the response is submitted.
>
> >
> > i tried the following:
> >
> > 1  public void doFilter(ServletRequest req, ServletResponse res,
> > FilterChain chain) throws IOException, ServletException {
> > 2
> > 3 HttpServletRequest hreq = (HttpServletRequest)req;
> > 4 chain.doFilter(hreq,res);
> > 5
> > 6 // if it's the client's first access, the below returns false
> > 7 if( hreq.isRequestedSessionIdValid() ) {
>
>This is not the right test for a newly created session, because there
>*was* no requested session.  Try something like this instead:
>
>   HttpSession session = request.getSession(false);
>   if (session == null) {
> ... no session exists ...
>   } else if (session.isNew()) {
> ... this is a newly created session ...
>   } else {
> ... this is an existing session ...
>   }
>
> > 8 // ...not processed; go to else clause below...
> > 9 } else {
> > 10String sid = hreq.getSession().getId();
> > 11}
> > 12 }
> >
> > the request hangs on line 10 (which is when a client is accessing for the
> > *first time*).
> >
> > however, if the servlet (that receives the request in "doFilter()") calls
> > request.getSession(), then the above filter is able to retrieve the
> > HttpSession without a problem.
> >
> > is a filter prevented from creating a *new* HttpSession object?
> >
>
>No, you can create one the same way a servlet can - by calling
>request.getSession() or request.getSession(true).  However, you must call
>this before the response is committed, so calling it after
>chain.doFilter() returns is not going to work.
>
> > most likely, i'll be calling the request.getSession() in my servlet, so it
> > shouldn't be a problem, but i discovered this before placing the
> > request.getSession() code in my servlet.
> >
> > thank you.
> >
>
>Craig


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




mod_jk2.so needed

2002-08-17 Thread Niket Anand

Hi all,
Can anybody send me a link from where I can download mod_jk2.so? I am unable
to
build this file.
I am using Apache2.0.4, Tomcat4.0.3 in windows2000
Or please send it with attachment.

I am following the instructions given in this link to run apache with Tomcat
http://www.pubbitch.org/jboss/mod_jk2.html
but unable to build .so file

Thanks in advance
Niket



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