Re: Tomcat5 - MySql5.0.0a - apache2.0 - XP - JNDI connection problems

2004-04-01 Thread Aadi Deshpande
Hi,

For your JSTL issue, make sure in your WEB-INF/lib directory you have 
jstl.jar and standard.jar ( for the apache standard implementation ). 
otherwise, you will not be able to use JSTL.

hth,
-a
The Gman wrote:

I am following:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html 

I am running windows XP - have apache 2.0.48 and Tomcat 5.0.19 up and
running with j2sdk1.4.2_04. I am also running MySql5.0.0a
Under $CATALINA_HOME/comon/lib
mysql-connector-java-3.0.11-stable-bin
commons-collections.3.0.jar
commons-dbcp-1.1.jar
commons-pool-1.1.jar
When I run the test code - test.jsp I get the following error:

Exception report:
org.apache.jasper.JasperException: The absolute uri:
http://java.sun.com/jsp/jstl/sql cannot be resolved in either web.xml 
or the
jar files deployed with this application

org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94) 

org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:404) 

org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:154) 

org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:359) 

org.apache.jasper.compiler.TagLibraryInfoImpl.init(TagLibraryInfoImpl.java:190) 

org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:458)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:523)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
org.apache.jasper.compiler.Parser.parse(Parser.java:171)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:258) 

org.apache.jasper.compiler.ParserController.parse(ParserController.java:139) 

org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553) 

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291) 

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
What is wrong with my configuration?

Step 2. server.xml configuration says /Context tag of the examples
context and the /Host
My server.xml doesn't have Context tags should there be one?
Step 3. web.xml configuration - Do I make/add these changes to the 
web.xml
under $CATALINA\ROOT\WEB-INF or under a subdirectory called /DBTest/??

Step 4. test code says deploy your web app into $CATALINA_HOME/webapps
either as a warfile called DBTest.war orinto a subdirectory called 
DBTest.
So, I created a directory called DBTest and just put the test.jsp file 
into
that directory - doesn't that qualify as deploying??

Thanks for any help to fix my configuration.

Tim

_
MSN Toolbar provides one-click access to Hotmail from any Web page  
FREE download! http://toolbar.msn.com/go/onm00200413ave/direct/01/

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


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


Re: Help with Cross context

2004-03-31 Thread Aadi Deshpande
i believe crossContext marks that specific web application as being able 
to initiate a cross-context request, not as the recipient of a 
cross-context request.

so try marking the other web-application that you are calling out from 
as crossContext=true

-a

[EMAIL PROTECTED] wrote:

Hey gang,

I'm trying to access one web appl from another. I added crosscontext in the
server.xml file
 Host
Context docBase=/servlets-examples path=/servlets-examples
crossContext=true reloadable=true/Context
 /Host
And in java,

ServletContext sc = filterConfig.getServletContext().getContext
(/servlets-examples);
System.out.println(sc.getServletContextName());
This is giving null pointer exception. I'm held up on this for few hours. I
would appreciate if anyone could solve this.
Thanks,
Madhan Lakshmanan(Maddy)
Park Seed Inc
864-941-4232


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



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


Re: an question about jk2 lbfactor

2004-03-31 Thread Aadi Deshpande
Hi,

I don't think that is correct. From the mod_jk documentation :

Using the worker's load-balancing factor, perform weighed-round-robin
load balancing where high lbfactor means stronger machine (that is going
to handle more requests)

I would assume that mod_jk2 retains the same semantics as mod_jk.


If all the requests are going to a single machine, i would check to make
sure that your tomcatId in your workers2.properties matches the jvmRoute
of the engine that you're trying to connect to.

hth,
-a

[EMAIL PROTECTED] wrote:

Yes.

Lower LB factor means more requests go to that server.

Greg

  

-Original Message-
From: moch [mailto:[EMAIL PROTECTED]
Sent: 31 March 2004 10:31
To: tomcat-user
Subject: an question about jk2 lbfactor


hi all,

what's the jk2's properties value lbfactor  really mean?

I have set up a cluster by apache + jk2 + tomcat5, it has 
2 node, I want tomcat1 to process all request and tomcat2 
just as an backup. so I
set tomcat1's lbfactor=100 and tomcat2's lbfactor=0, but almost all
request go to tomcat2. 

Had I set lb_factor wrong? 

Thanks for any help. 

  

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




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



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



TC5 Nightly : ClassCastException using Cluster manager

2004-03-23 Thread Aadi Deshpande
( let me know if comments regarding nightly builds should be in the 
tomcat-dev mailing list instead ).

Hi,

I have a nightly build of Tomcat 5 ( mainly because i need some fixes in 
HEAD to resolve cross context issues ) , and I've set up the Cluster 
Manager ( in the updated format ) as specified in the server.xml.

I came across a problem, however, when the ClusterManger is expiring 
sessions :

WARNING: Unable to perform background process on manager
java.lang.ClassCastException
   at 
org.apache.catalina.cluster.session.DeltaManager.processExpires(DeltaManager.java:914)
   at 
org.apache.catalina.cluster.session.DeltaManager.backgroundProcess(DeltaManager.java:904)
   at 
org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:4546)
   at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1619)
   at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628)
   at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628)
   at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1608)
   at java.lang.Thread.run(Thread.java:534)

A couple things of note.. I don't really have any specific contexts, all 
my applications are webapps ( .war files ) and I have only a single 
DefaultContext set up in my server.xml file.

From what I gather looking at the source code, it looks like not all 
the sessions retrieved by the findSessions() method call are 
DeltaSessions.  I'm not sure why this is.  The only reason I could come 
up with was because my web  applications are specifically noted as 
contexts in my server.xml.

Thanks for any input,

-a



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


Re: TC5 Nightly : ClassCastException using Cluster manager

2004-03-23 Thread Aadi Deshpande
As an additional side effect, since this is happening on session expiry
the session count keeps getting higher and higher...
right now I have 8942 sessions on a single instance!  :-)

-a

Aadi Deshpande wrote:

( let me know if comments regarding nightly builds should be in the 
tomcat-dev mailing list instead ).

Hi,

I have a nightly build of Tomcat 5 ( mainly because i need some fixes 
in HEAD to resolve cross context issues ) , and I've set up the 
Cluster Manager ( in the updated format ) as specified in the server.xml.

I came across a problem, however, when the ClusterManger is expiring 
sessions :

WARNING: Unable to perform background process on manager
java.lang.ClassCastException
   at 
org.apache.catalina.cluster.session.DeltaManager.processExpires(DeltaManager.java:914) 

   at 
org.apache.catalina.cluster.session.DeltaManager.backgroundProcess(DeltaManager.java:904) 

   at 
org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:4546) 

   at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1619) 

   at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628) 

   at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628) 

   at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1608) 

   at java.lang.Thread.run(Thread.java:534)

A couple things of note.. I don't really have any specific contexts, 
all my applications are webapps ( .war files ) and I have only a 
single DefaultContext set up in my server.xml file.

From what I gather looking at the source code, it looks like not all 
the sessions retrieved by the findSessions() method call are 
DeltaSessions.  I'm not sure why this is.  The only reason I could 
come up with was because my web  applications are specifically noted 
as contexts in my server.xml.

Thanks for any input,

-a



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


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


Re: clustering question?

2004-03-09 Thread Aadi Deshpande
Hi,

You're changing the wrong port.
You should not change the mcastPort, instead you should change the 
tcpListenPort

The mcastPort and mcastAddr should be the same for every instance 
participating in the cluster.

Also, as a word of advice, it's best to keep the cluster size down to 
2-3 ( and at most 4 ).  we've had a lot of trouble with larger cluster 
sizes, not because of any fault of the cluster manager, just that it's a 
huge (network/memory ) resource hog having all your sessions replicated 
six times over.  Of course, this is only for our case so YMMV.

hth,
-a
[EMAIL PROTECTED] wrote:

I am getting the following info in my log file.

Mar 8, 2004 12:45:10 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster
start
INFO: Cluster is about to start
Mar 8, 2004 12:45:10 PM
org.apache.catalina.cluster.tcp.ReplicationListener run
SEVERE: Unable to start cluster listener.
java.net.SocketException: Address already in use
at sun.nio.ch.Net.bind(Native Method)
at
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:108
)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:52)
at
org.apache.catalina.cluster.tcp.ReplicationListener.listen(ReplicationLi
stener.java:148)
at
org.apache.catalina.cluster.tcp.ReplicationListener.run(ReplicationListe
ner.java:129)
at java.lang.Thread.run(Thread.java:534)
Mar 8, 2004 12:45:10 PM org.apache.catalina.cluster.mcast.McastService
start
INFO: Sleeping for 2000 secs to establish cluster membership
2004-03-08 12:45:13,151 [main] DEBUG (ManagerBase.java:671) -
Registering Tomcat-Standalone:type=Manager,path=/,host=etrak-plus.com
2004-03-08 12:45:13,156 [main] DEBUG (StandardManager.java:697) - Force
random number initialization starting
2004-03-08 12:45:13,157 [main] DEBUG (ManagerBase.java:555) - Opening
/dev/urandom
2004-03-08 12:45:13,158 [main] DEBUG (ManagerBase.java:366) - Getting
message digest component for algorithm MD5
2004-03-08 12:45:13,158 [main] DEBUG (ManagerBase.java:380) - Completed
getting message digest component
2004-03-08 12:45:13,159 [main] DEBUG (ManagerBase.java:383) -
getDigest() 1
2004-03-08 12:45:13,160 [main] DEBUG (StandardManager.java:700) - Force
random number initialization completed
2004-03-08 12:45:13,161 [main] DEBUG (StandardManager.java:406) - Start:
Loading persisted sessions
2004-03-08 12:45:13,161 [main] DEBUG (StandardManager.java:416) -
Loading persisted sessions from SESSIONS.ser
2004-03-08 12:45:13,165 [main] DEBUG (StandardManager.java:430) -
Creating custom object input stream for class loader 
2004-03-08 12:45:13,171 [main] DEBUG (StandardManager.java:460) -
Loading 0 persisted sessions
2004-03-08 12:45:13,172 [main] DEBUG (StandardManager.java:507) -
Finish: Loading persisted sessions

Here is the cluster info that i have in my server.xml.

Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster
name=etrakCluster1
managerClassName=org.apache.catalina.cluster.session.DeltaManager
expireSessionsOnShutdown=false
useDirtyFlag=true
Membership 
className=org.apache.catalina.cluster.mcast.McastService
mcastAddr=228.0.0.106
mcastPort=45100
mcastFrequency=500
mcastDropTime=3000/

Receiver 
className=org.apache.catalina.cluster.tcp.ReplicationListener
tcpListenAddress=auto
tcpListenPort=4001
tcpSelectorTimeout=100
tcpThreadCount=6/

Sender
className=org.apache.catalina.cluster.tcp.ReplicationTransmitter
replicationMode=pooled/
Valve className=org.apache.catalina.cluster.tcp.ReplicationValve
filter=.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;/
/Cluster
my mcastAddr range is from 228.0.0.106 - 228.0.0.115

and the ports run from 45100-45109.

Note each host has its own cluster entry and i have 10 different hosts.

This is on tomcat 5.0.19 running on slackware 9.X

Would i need to reboot the server to clear this up?

Is this a problem with clustering or could it be a setup problem on my
part.
Thanks,

Daniel Schulken

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.598 / Virus Database: 380 - Release Date: 2/28/2004
 



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


Re: load balancing with apache2

2004-03-09 Thread Aadi Deshpande
Hi,
Looks like a permissions issue.
Is Apache running as nobody? Does it have rights to 
/conf/balancing.conf? ( which seems to located from the root directory 
of your server ).



shyam wrote:

Hi All,
Can somebody help me with this. I am struck . thanks a lot 
From: shyam [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 09, 2004 10:28 AM
To: 'Tomcat Users List'
Subject: load balancing with apache2

Hi All,
I have set up the clustering with tomcat 5 and it works awesome. I
followed the steps provided in the documentation for apache load
balancing. I had success the first time but after that I keep getting
this error in my apache logs 
The system cannot find the path specified.  : mod_rewrite: can't access
text RewriteMap file /conf/balancing.conf

I have the balancing.conf in the conf directory. 
Balancing.conf
LB1  tomcat1:8080
LB3  tomcat2:8080
ALL  tomcat1:8080|tomcat2:8080

Can you please tell me whats wrong with the above. 

Thanks I advance
shyam




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


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



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


Re: clustering question?

2004-03-09 Thread Aadi Deshpande
Hi,

The register requests error is independent of the cluster setup  ( like 
Filip said ) and will in no way affect it.
Beyond that, the register requests error is completely harmless ( see 
http://www.mail-archive.com/[EMAIL PROTECTED]/msg119877.html 
)  and does not prevent me from providing stickySessions or clustering.

You should enable logging for the package org.apache.catalina.cluster ( 
i use JDK14 logging so ask me if that's what you're using ) to see if 
replication is occurring.

hth,
-a
Alex wrote:

my box isn't pretty.  i've also had some other weirdness which others
haven't experienced.  some odd jndi errors, rah rah rah.  anyways, it
doesn't work.  between this and not being able to get jk2 to do sticky
sessions, i'm going nuts.  have two different routes to go and neither are
working.  *sigh*
On Tue, 9 Mar 2004, Filip Hanik (lists) wrote:

 

Date: Tue, 9 Mar 2004 13:44:08 -0600
From: Filip Hanik (lists) [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Subject: RE: clustering question?
that is correct, should work out of the box :)

Filip
   



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



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


Re: Cross context c:import not working?

2004-03-03 Thread Aadi Deshpande
For the archives :

this is bug 27309 ( 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27309 ) and has been 
fixed in head.

-a

Aadi Deshpande wrote:

Hi,

I'm not sure if this or the taglibs-user is the right place for 
posting this, but it looks to be a Tomcat error.

When trying to use a c:import in the vein of :

c:import url=/test.jsp context=/profile/
Hi,
Not sure if this is the right place or taglibs-user for this issue ( 
it seems to be a tomcat problem ), but it looks like cross context 
c:imports don't work if a page is session-enabled. This used to work 
in Tomcat 5.0.16 but is broken in 5.0.19

For example :

Both / and /profile contexts have crossContext=true

c:import url=/cross_context_import.jsp context=/profile/

if cross_context_import.jsp has %@ page session=false %, 
everything works well.

if cross_context_import doesn't have that ( or %@ page session=true 
% ), then it gives me a NullPointerException ( stack trace at the end )

The problem it seems is that inside 
ApplicationHttpRequest.getSession(), the call to 
context.getManager().findSession(id) returns null ( this is for the 
first time that the context is accessed ).

However, before checking to see if the session is null, the .access() 
method is called on it ( presumably to update the access time ) . The 
whole thing is wrapped in an IOException, but which gets ignored since 
NullPointerException is a RuntimeException.

What's odd is that the check for the ( localSession == null  ) follows 
immediately after the try block, so it looks like some sort of 
oversight in my eyes.

What I've done is take the source code, and refactor it so that the 
access comes in an else block ( it looks like other session management 
code was put in place after 5.0.16 )

I'd like to make sure I didn't miss anything before erroneously 
reporting a bug.



java.lang.NullPointerException
   at 
org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:546) 

   at 
org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:512) 

   at 
org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:192) 

   at 
org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:167) 

   at 
org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:149) 

   at 
org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:106) 

   at org.apache.jsp.index_jsp._jspService(index_jsp.java:55)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311) 

   at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284) 

   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204) 

   at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:750) 

   at 
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:636) 

   at 
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:546) 

   at 
org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:179) 

   at 
org.apache.jsp.cross_005fcontext_005fimport_jsp._jspx_meth_c_import_0(cross_005fcontext_005fimport_jsp.java:85) 

   at 
org.apache.jsp.cross_005fcontext_005fimport_jsp._jspService(cross_005fcontext_005fimport_jsp.java:59) 

   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311) 

   at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284) 

   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204) 

   at 
clubmom.framework.PersistentHibernateSession.doFilter(PersistentHibernateSession.java:62) 

   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233) 

   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204) 

   at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257) 

   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) 

   at 
org.apache.catalina.core.StandardPipeline.invoke

Re: cross context include

2004-03-03 Thread Aadi Deshpande
I've been struggling with the same problem.  I read the bug report, but 
it only adresses part of the problem, the part that doesn't retrieve the 
session properly.  I actually patched the code independently and have 
discovered another problem, that somehow sessions are either getting 
lost or mixed up when you do cross context imports  in at least one 
advanced scenario :

1) page Z in context 'a' import a page X from context 'b'
2) page X in context 'b' imports a page Y in context 'a'
in this case, the session that was created when you import page X in 
context b is the session that's available in page Y in context a.

here's my test case  ---

test_page1.jsp ( context '/profile' ) :

   %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; %
   Test of cross context imports :
   % request.getSession().setAttribute(test_attrib, 12345); %
   % out.println(test_attrib in ( test_page1.jsp ) is  +
   session.getAttribute(test_attrib) ); %br/
   % out.println(session id (  in test_page1.jsp) is :  +
   request.getSession().getId() ); % br/
   c:import url=/test_other.jsp context=/ /
test_other.jsp ( context '/' ) :

   %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; %
   % request.getSession().setAttribute(test_other_attrib, 54321 ); %
   % out.println(test attrib ( in test_other.jsp ) is :  +
   request.getSession().getAttribute(test_attrib) ); %br/
   % out.println(test other attrib ( in test_other.jsp) is :  +
   request.getSession().getAttribute(test_other_attrib) ); %br/
   % out.println(session id (  in test_other.jsp) is :  +
   request.getSession().getId() ); % br/
   c:import url=/test_page2.jsp context=/profile/
test_page2.jsp ( context '/profile' ) :

   %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; %
   % out.println(test_attrib ( in test_page2.jsp ) is  +
   session.getAttribute(test_attrib) ); % br/
   % out.println(test other attrib ( in test_page2.jsp) is :  +
   request.getSession().getAttribute(test_other_attrib) ); % br/
   % out.println(session id (  in test_page2.jsp) is :  +
   request.getSession().getId() ); % br/


The output i get when I hit test_page1.jsp is :

Test of cross context imports : test_attrib in ( test_page1.jsp ) is 12345
session id ( in test_page1.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
test attrib ( in test_other.jsp ) is : null
test other attrib ( in test_other.jsp) is : 54321
session id ( in test_other.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
test_attrib ( in test_page2.jsp ) is null
test other attrib ( in test_page2.jsp) is : 54321
session id ( in test_page2.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
The output I get when i hit test_other.jsp is :

test attrib ( in test_other.jsp ) is : null
test other attrib ( in test_other.jsp) is : 54321
session id ( in test_other.jsp) is : 55B2068D3011D727DF15068ADAD713E2
test_attrib ( in test_page2.jsp ) is null
test other attrib ( in test_page2.jsp) is : null
session id ( in test_page2.jsp) is : 55B2068D3011D727DF15068ADAD713E2
the output that i get when i hit test_page2.jsp :

test_attrib ( in test_page2.jsp ) is 12345
test other attrib ( in test_page2.jsp) is : null
session id ( in test_page2.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
Any hints on how to resolve it?

Asim Alp wrote:

If indeed we need to put it on all pages, then yes, it's no problem.  
We do have a couple perl geniuses on staff :)  I'm sure we'll find a 
way to get around it.

My main concern right now is to to understand the reason of the 
problem first.  I read the bug report, but still can't understand why 
an extra session prevents our c:imports from working?

Asim

On Mar 2, 2004, at 1:46 PM, Mike Curwen wrote:

If you have a perl genius on staff, he can do ALL pages with a single
command.  Scary stuff, but cool when it works. :)
-Original Message-
From: Asim Alp [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 12:33 PM
To: Tomcat Users List
Subject: Re: cross context include
I guess we'll have to find a way of going over the 10,000+ pages.
Maybe we can write a small program to automate it.  I don't
like dirty
solutions :)  If this is indeed a bug in our software, it
should better
be fixed.
One last question though.  As much as I know, setting page session to
false only means that there is no need to create an
additional session.
  What's this have to do with c:imports?  Why does an
additional session
prevent our c:imports?
Asim

On Mar 2, 2004, at 1:15 PM, Remy Maucherat wrote:

Asim Alp wrote:

Thank you for your prompt replies.  I just read the bug, and
understood what the problem was.
Now, though, I have another question.  Is there a way of

setting page

session to false at a higher level.  For example somewhere

from the

server.xml file?  My problem is that we have over 100

websites with

tens of thousands of jsp pages.  Every single one of these

JSP pages

rely on these c:imports...  It's almost impossible for us to
manually go over each one of these jsp pages and add the %@ page
session=false% 

Re: cross context include

2004-03-03 Thread Aadi Deshpande
More research...once the context gets set in a c:import, it seems like 
that's the way it's stuck for the life of the HttpRequest.  ..

i.e. in my example below..
   if i start at page Z, the context always remains as 'a'
   if I start at page X, the context always remains as 'b'
so it looks like tomcat can't handle more than one context switch, maybe 
because the request that is created for the initial page is the one 
that's passed down ( instead of a separate internal request being 
created for the import )

Any more thoughts?

Aadi Deshpande wrote:

I've been struggling with the same problem.  I read the bug report, 
but it only adresses part of the problem, the part that doesn't 
retrieve the

session properly.  I actually patched the code independently and have 
discovered another problem, that somehow sessions are either getting 
lost or mixed up when you do cross context imports  in at least one 
advanced scenario :

1) page Z in context 'a' import a page X from context 'b'
2) page X in context 'b' imports a page Y in context 'a'
in this case, the session that was created when you import page X in 
context b is the session that's available in page Y in context a.

here's my test case  ---

test_page1.jsp ( context '/profile' ) :

   %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; %
   Test of cross context imports :
   % request.getSession().setAttribute(test_attrib, 12345); %
   % out.println(test_attrib in ( test_page1.jsp ) is  +
   session.getAttribute(test_attrib) ); %br/
   % out.println(session id (  in test_page1.jsp) is :  +
   request.getSession().getId() ); % br/
   c:import url=/test_other.jsp context=/ /
test_other.jsp ( context '/' ) :

   %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; %
   % request.getSession().setAttribute(test_other_attrib, 54321 );
%
   % out.println(test attrib ( in test_other.jsp ) is :  +
   request.getSession().getAttribute(test_attrib) ); %br/
   % out.println(test other attrib ( in test_other.jsp) is :  +
   request.getSession().getAttribute(test_other_attrib) ); %br/
   % out.println(session id (  in test_other.jsp) is :  +
   request.getSession().getId() ); % br/
   c:import url=/test_page2.jsp context=/profile/
test_page2.jsp ( context '/profile' ) :

   %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; %
   % out.println(test_attrib ( in test_page2.jsp ) is  +
   session.getAttribute(test_attrib) ); % br/
   % out.println(test other attrib ( in test_page2.jsp) is :  +
   request.getSession().getAttribute(test_other_attrib) ); % br/
   % out.println(session id (  in test_page2.jsp) is :  +
   request.getSession().getId() ); % br/


The output i get when I hit test_page1.jsp is :

Test of cross context imports : test_attrib in ( test_page1.jsp ) is
12345
session id ( in test_page1.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
test attrib ( in test_other.jsp ) is : null
test other attrib ( in test_other.jsp) is : 54321
session id ( in test_other.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
test_attrib ( in test_page2.jsp ) is null
test other attrib ( in test_page2.jsp) is : 54321
session id ( in test_page2.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
The output I get when i hit test_other.jsp is :

test attrib ( in test_other.jsp ) is : null
test other attrib ( in test_other.jsp) is : 54321
session id ( in test_other.jsp) is : 55B2068D3011D727DF15068ADAD713E2
test_attrib ( in test_page2.jsp ) is null
test other attrib ( in test_page2.jsp) is : null
session id ( in test_page2.jsp) is : 55B2068D3011D727DF15068ADAD713E2
the output that i get when i hit test_page2.jsp :

test_attrib ( in test_page2.jsp ) is 12345
test other attrib ( in test_page2.jsp) is : null
session id ( in test_page2.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
Any hints on how to resolve it?

Asim Alp wrote:

If indeed we need to put it on all pages, then yes, it's no problem.  
We do have a couple perl geniuses on staff :)  I'm sure we'll find a 
way to get around it.

My main concern right now is to to understand the reason of the 
problem first.  I read the bug report, but still can't understand why 
an extra session prevents our c:imports from working?

Asim

On Mar 2, 2004, at 1:46 PM, Mike Curwen wrote:

If you have a perl genius on staff, he can do ALL pages with a single
command.  Scary stuff, but cool when it works. :)
-Original Message-
From: Asim Alp [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 12:33 PM
To: Tomcat Users List
Subject: Re: cross context include
I guess we'll have to find a way of going over the 10,000+ pages.
Maybe we can write a small program to automate it.  I don't
like dirty
solutions :)  If this is indeed a bug in our software, it
should better
be fixed.
One last question though.  As much as I know, setting page session

to

false only means that there is no need to create an
additional session.
  What's this have to do with c:imports?  Why does an
additional session
prevent our c:imports?
Asim

On Mar 2, 2004, at 1:15

Re: JSP whitespace removal

2004-03-03 Thread Aadi Deshpande
consider using the trimSpaces option of the Jasper compiler in your 
$CATALINA_BASE/conf/server.xml .

-a

John Sidney-Woollett wrote:

Hi

We want to achieve a 10-15% data reduction of the HTML being served by our
webserver (generated by JSP pages). This will have an impact on our
bandwidth charges from our ISP...
We can achieve this by by simply removing all the \n\r, \t characters
and replacing repeated occurences of(double space) by   (single
space). But we don't want to do this in our source JSP files as they will
become unmaintainable/unreadable.
eg
table
 tr
   tdColumn 1/td
   tdColumn 2/td
 tr
/table
(69 characters)

becomes

tabletrtdColumn 1/tdtdColumn 2/tdtr/table

(57 characters), that's an 17% saving for that text block...

I know that we could:

i) write/implement a filter to process the outputstream - BUT we use
OSCache (www.opensymphony.com) to cache (included) JSP pages, and we don't
want to reprocess cached data using another filter.
ii) use a script to transform or preprocess our JSP pages before they are
deployed - simple, but may have code breaking (between dev and live
system) or maintenance implications?
iii) create a tag library to process a text block (or another JSP), BUT
we've heard a rumour that taglibs can be inefficient (is that true?)
Question: is it possible to use a directive in a JSP page to force the
compiler to remove these characters to achieve our desired data reduction?
Are there any other techniques or solutions that anyone else is using?

Thanks

John Sidney-Woollett

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



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


Re: JSP whitespace removal

2004-03-03 Thread Aadi Deshpande
[EMAIL PROTECTED] wrote:

On Wednesday 03 March 2004 05:33 pm, you wrote:
 

consider using the trimSpaces option of the Jasper compiler in your
$CATALINA_BASE/conf/server.xml .
   

What, precisly does that do?

I've tried it and seen no difference in the resulting HTML.

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

it trims the spaces during page compilation.
make sure you blow away your work directory or otherwise edit your pages 
so that they get recompiled.
works really well for me.

-a

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


Re: How do I automatically post urls?

2004-03-03 Thread Aadi Deshpande
You could look at commons HttpClient if you don't want to roll your own 
using the java.net libraries.

There are a bunch of them out there on the internet that you could 
google for.

Keep in mind that you're probably looking for something that supports 
https since I'm almost positive PayPal would require secure communications.

-a

Riaan Oberholzer wrote:

Thanks I was trying to get the answers in the
HTTPRequest/Response classes
I want to use it for PayPal verifications. They send
me a url (which a servlet of mine accepts), I send
something similar back.
Do they have libraries to do it? Or has someone done
it before?


--- Shapira, Yoav [EMAIL PROTECTED] wrote:
 

Hi,

   

How do I dymanically create a url, eg:

http://domain.com/servlet.do?name=xxx
 

Umm, like
java.net.URL url = new
URL(http://domain.com/servlet.do?name=xxx;);
?
   

and then, from my Java app, post it. Ie, the
 

receiver
   

will see it as a normal client accessing. Will be
 

used
   

in processing of automatic payments.
 

If you mean open a connection to it, read up on
java.net.URLConnection.
But this will be a GET request.  If you mean
simulate a POST HTTP
operation, that's significantly more complicated so
I won't go into it
unless that's what you really want.
Yoav Shapira



This e-mail, including any attachments, is a
confidential business communication, and may contain
information that is confidential, proprietary and/or
privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may not
be saved, copied, printed, disclosed or used by
anyone else.  If you are not the(an) intended
recipient, please immediately delete this e-mail
from your computer system and notify the sender. 
Thank you.



   

-
 

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



__
Do you Yahoo!?
Yahoo! Search - Find what youre looking for faster
http://search.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



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


Re: cross context include

2004-03-03 Thread Aadi Deshpande
I think I came across a couple of things that should help resolve the 
issue.

1) in ApplicationContext, the getContext(String path) method erroneously 
checks for context != null in the while loop when it should be checking 
for child !=null (since it seems if the context is ever null, it would 
throw an NPE well before that point, so I'm assuming that was an 
oversight ).

2) This, I believe, to be the underlying cause of my issue.  It occurs 
in wrapRequest in ApplicationDispatcher.   What is going on is that ( 
using my example page / context names from  below ), when I start at 
page Z in context a and call page X in context b, the contexts are both 
different, and crossContext = true ( wrapRequest defines crossContext as 
context.getPath != current.getContextPath() ).  Since the 
getSession(boolean create) is wrapped entirely in an  'if crossContext = 
true' block, the code get executed fine..

It's when the included page X in context  includes a page Y in context b 
again that the problem arises.. Now, since context.getPath == 
current.getContextPath(), the whole getSession() block is never 
executed, adn the session creation is delegated to the super.getSession 
and the incorrect session is retrieved.

I don't know enough about Tomcat ( though I am learning ) to understand 
the relationships between contexts, request, and their respective 
facades and wrappers, so I'm hoping someone on the list who's involved 
in the development can shed some light on the proper resolution.

much thanks in advance,
-a
Aadi Deshpande wrote:

More research...once the context gets set in a c:import, it seems like 
that's the way it's stuck for the life of the HttpRequest.  ..

i.e. in my example below..
   if i start at page Z, the context always remains as 'a'
   if I start at page X, the context always remains as 'b'
so it looks like tomcat can't handle more than one context switch, 
maybe because the request that is created for the initial page is the 
one that's passed down ( instead of a separate internal request being 
created for the import )

Any more thoughts?

Aadi Deshpande wrote:

I've been struggling with the same problem.  I read the bug report, 
but it only adresses part of the problem, the part that doesn't 
retrieve the

session properly.  I actually patched the code independently and have 
discovered another problem, that somehow sessions are either getting 
lost or mixed up when you do cross context imports  in at least one 
advanced scenario :

1) page Z in context 'a' import a page X from context 'b'
2) page X in context 'b' imports a page Y in context 'a'
in this case, the session that was created when you import page X in 
context b is the session that's available in page Y in context a.

here's my test case  ---

test_page1.jsp ( context '/profile' ) :

   %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; %
   Test of cross context imports :
   % request.getSession().setAttribute(test_attrib, 12345); %
   % out.println(test_attrib in ( test_page1.jsp ) is  +
   session.getAttribute(test_attrib) ); %br/
   % out.println(session id (  in test_page1.jsp) is :  +
   request.getSession().getId() ); % br/
   c:import url=/test_other.jsp context=/ /
test_other.jsp ( context '/' ) :

   %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; %
   % request.getSession().setAttribute(test_other_attrib, 54321 );
%
   % out.println(test attrib ( in test_other.jsp ) is :  +
   request.getSession().getAttribute(test_attrib) ); %br/
   % out.println(test other attrib ( in test_other.jsp) is :  +
   request.getSession().getAttribute(test_other_attrib) ); %br/
   % out.println(session id (  in test_other.jsp) is :  +
   request.getSession().getId() ); % br/
   c:import url=/test_page2.jsp context=/profile/
test_page2.jsp ( context '/profile' ) :

   %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; %
   % out.println(test_attrib ( in test_page2.jsp ) is  +
   session.getAttribute(test_attrib) ); % br/
   % out.println(test other attrib ( in test_page2.jsp) is :  +
   request.getSession().getAttribute(test_other_attrib) ); % br/
   % out.println(session id (  in test_page2.jsp) is :  +
   request.getSession().getId() ); % br/


The output i get when I hit test_page1.jsp is :

Test of cross context imports : test_attrib in ( test_page1.jsp ) is
12345
session id ( in test_page1.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
test attrib ( in test_other.jsp ) is : null
test other attrib ( in test_other.jsp) is : 54321
session id ( in test_other.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
test_attrib ( in test_page2.jsp ) is null
test other attrib ( in test_page2.jsp) is : 54321
session id ( in test_page2.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
The output I get when i hit test_other.jsp is :

test attrib ( in test_other.jsp ) is : null
test other attrib ( in test_other.jsp) is : 54321
session id ( in test_other.jsp) is : 55B2068D3011D727DF15068ADAD713E2
test_attrib ( in test_page2.jsp ) is null
test

Re: Cluster error when starting up web application

2004-02-27 Thread Aadi Deshpande


http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27296

Thank you for making excellent software.

p.s.  i'd also like to just say thanks to person(s) reponsible for the 
main build.xml file which made getting and building tomcat such a breeze.

Filip Hanik (lists) wrote:

thanks for the very diligent email,
open a bug, and I will address this issue shortly.
thank you for helping us make better software

Filip

-Original Message-
From: Aadi Deshpande [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 10:36 PM
To: Tomcat Users List
Subject: Re: Cluster error when starting up web application
Upon further research, it seems that DeltaSession.setId() fires the
sessionCreated events to registered listeners, but this happens before a
session is declared valid ( i.e. setValid(true) has not been called ).
so when a  registered listener tries to utilize ( what it seems to
believe is ) a newly created session, the setAttribute method throws the
IllegalStateException..
Now I don't know too much about how the actual workings of the
HttpSession should go, but in my opinion, the sessionCreated events
should not be fired unless a valid session has been created.  which
seems to imply that maybe setValid() should doing the firing...
However, that doesn't sit well with me since it doesn't make sense for a
session to be truly valid unless it has a sessionId, which either
forces there to be an implict order between setId() and setValid() which
is no good, requiring that either/or check to see if the other has been
truly satisfied, and setting up some sort of implicit sequence coupling.
the alternative, as I see it, is move the tellNew() invocation to the
DeltaManager ( it's declared public, so it's already exposed ).
I tried that, by patching up the TC5 sources and it seemed to resolve
the issue.
Again, as I know little to nothing of how sessions should work and what
other implications this refactoring may have, what should be my next
course of action?
Should I contact the webwork people? Is this not correct use of sessions
and session listeners?
Should I open up a bug and/or propose my patch?

Thanks in advance for reading and/or responding,

-a





Aadi Deshpande wrote:

 

Hi,

I just got Tomcat 5.0.19 and after setting up the new delta based
cluster manager, i get this during the startup my application :
SEVERE: Session event listener threw exception
java.lang.IllegalStateException: setAttribute: Session already
invalidated
  at
   

org.apache.catalina.cluster.session.DeltaSession.setAttribute(DeltaSession.j
ava:1306)
 

  at

   

org.apache.catalina.cluster.session.DeltaSession.setAttribute(DeltaSession.j
ava:1283)
 

  at

   

org.apache.catalina.cluster.session.DeltaSessionFacade.setAttribute(DeltaSes
sionFacade.java:17
 

7)
  at
   

com.opensymphony.webwork.lifecycle.SessionLifecycleListener.sessionCreated(S
essionLifecycleLis
 

tener.java:50)
  at
   

org.apache.catalina.cluster.session.DeltaSession.tellNew(DeltaSession.java:4
59)
 

  at

   

org.apache.catalina.cluster.session.DeltaSession.setId(DeltaSession.java:431
)
 

  at

   

org.apache.catalina.cluster.session.DeltaManager.createSession(DeltaManager.
java:377)
 

  at

   

org.apache.catalina.cluster.session.DeltaManager.messageReceived(DeltaManage
r.java:895)
 

  at

   

org.apache.catalina.cluster.session.DeltaManager.messageDataReceived(DeltaMa
nager.java:794)
 

  at

   

org.apache.catalina.cluster.tcp.SimpleTcpCluster.messageDataReceived(SimpleT
cpCluster.java:561
 

)
  at
org.apache.catalina.cluster.io.ObjectReader.execute(ObjectReader.java:117)
  at

   

org.apache.catalina.cluster.tcp.TcpReplicationThread.drainChannel(TcpReplica
tionThread.java:17
 

6)
  at
   

org.apache.catalina.cluster.tcp.TcpReplicationThread.run(TcpReplicationThrea
d.java:114)
 



As far as I can tell, it's happening when I request a page that has
the webwork2 RequestLifecycleFilter set for that url pattern.  The
doFilter function creates a HttpSession if none exists, which I assume
calls the SessionLifecycleListener.sessionCreated(), but for some
reason, it seems like the session is being invalidated prematurely..
Here's the relevant piece from my web.xml :
  filter
  filter-namecontainer/filter-name
  filter-class
com.opensymphony.webwork.lifecycle.RequestLifecycleFilter/filter-class
  /filter
  filter-mapping
  filter-namecontainer/filter-name
  url-pattern/*/url-pattern
  !-- modify appropriately --
  /filter-mapping
  listener
  listener-class
   

com.opensymphony.webwork.lifecycle.SessionLifecycleListener/listener-class
 

  /listener
  listener
  listener-class
   

com.opensymphony.webwork.lifecycle.ApplicationLifecycleListener/listener-cl
ass
 

  /listener

and from my server.xml file, taken pretty much verbatim from the
default server.xml:
  Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster

managerClassName

Cross context c:import not working?

2004-02-27 Thread Aadi Deshpande
Hi,

I'm not sure if this or the taglibs-user is the right place for posting 
this, but it looks to be a Tomcat error.

When trying to use a c:import in the vein of :

c:import url=/test.jsp context=/profile/
Hi,
Not sure if this is the right place or taglibs-user for this issue ( it 
seems to be a tomcat problem ), but it looks like cross context 
c:imports don't work if a page is session-enabled. This used to work in 
Tomcat 5.0.16 but is broken in 5.0.19

For example :

Both / and /profile contexts have crossContext=true

c:import url=/cross_context_import.jsp context=/profile/

if cross_context_import.jsp has %@ page session=false %, everything 
works well.

if cross_context_import doesn't have that ( or %@ page session=true 
% ), then it gives me a NullPointerException ( stack trace at the end )

The problem it seems is that inside ApplicationHttpRequest.getSession(), 
the call to context.getManager().findSession(id) returns null ( this 
is for the first time that the context is accessed ).

However, before checking to see if the session is null, the .access() 
method is called on it ( presumably to update the access time ) . The 
whole thing is wrapped in an IOException, but which gets ignored since 
NullPointerException is a RuntimeException.

What's odd is that the check for the ( localSession == null  ) follows 
immediately after the try block, so it looks like some sort of oversight 
in my eyes.

What I've done is take the source code, and refactor it so that the 
access comes in an else block ( it looks like other session management 
code was put in place after 5.0.16 )

I'd like to make sure I didn't miss anything before erroneously 
reporting a bug.



java.lang.NullPointerException
   at 
org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:546)
   at 
org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:512)
   at 
org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:192)
   at 
org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:167)
   at 
org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:149)
   at 
org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:106)
   at org.apache.jsp.index_jsp._jspService(index_jsp.java:55)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
   at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
   at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:750)
   at 
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:636)
   at 
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:546)
   at 
org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:179)
   at 
org.apache.jsp.cross_005fcontext_005fimport_jsp._jspx_meth_c_import_0(cross_005fcontext_005fimport_jsp.java:85)
   at 
org.apache.jsp.cross_005fcontext_005fimport_jsp._jspService(cross_005fcontext_005fimport_jsp.java:59)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
   at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
   at 
clubmom.framework.PersistentHibernateSession.doFilter(PersistentHibernateSession.java:62)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
   at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
   at 

Cluster error when starting up web application

2004-02-25 Thread Aadi Deshpande
Hi,

I just got Tomcat 5.0.19 and after setting up the new delta based 
cluster manager, i get this during the startup my application :

SEVERE: Session event listener threw exception
java.lang.IllegalStateException: setAttribute: Session already invalidated
   at 
org.apache.catalina.cluster.session.DeltaSession.setAttribute(DeltaSession.java:1306)
   at 
org.apache.catalina.cluster.session.DeltaSession.setAttribute(DeltaSession.java:1283)
   at 
org.apache.catalina.cluster.session.DeltaSessionFacade.setAttribute(DeltaSessionFacade.java:17
7)
   at 
com.opensymphony.webwork.lifecycle.SessionLifecycleListener.sessionCreated(SessionLifecycleLis
tener.java:50)
   at 
org.apache.catalina.cluster.session.DeltaSession.tellNew(DeltaSession.java:459)
   at 
org.apache.catalina.cluster.session.DeltaSession.setId(DeltaSession.java:431)
   at 
org.apache.catalina.cluster.session.DeltaManager.createSession(DeltaManager.java:377)
   at 
org.apache.catalina.cluster.session.DeltaManager.messageReceived(DeltaManager.java:895)
   at 
org.apache.catalina.cluster.session.DeltaManager.messageDataReceived(DeltaManager.java:794)
   at 
org.apache.catalina.cluster.tcp.SimpleTcpCluster.messageDataReceived(SimpleTcpCluster.java:561
)
   at 
org.apache.catalina.cluster.io.ObjectReader.execute(ObjectReader.java:117)
   at 
org.apache.catalina.cluster.tcp.TcpReplicationThread.drainChannel(TcpReplicationThread.java:17
6)
   at 
org.apache.catalina.cluster.tcp.TcpReplicationThread.run(TcpReplicationThread.java:114)



As far as I can tell, it's happening when I request a page that has the 
webwork2 RequestLifecycleFilter set for that url pattern.  The doFilter 
function creates a HttpSession if none exists, which I assume calls the 
SessionLifecycleListener.sessionCreated(), but for some reason, it seems 
like the session is being invalidated prematurely..

Here's the relevant piece from my web.xml :
   filter
   filter-namecontainer/filter-name
   filter-class
   
com.opensymphony.webwork.lifecycle.RequestLifecycleFilter/filter-class
   /filter
   filter-mapping
   filter-namecontainer/filter-name
   url-pattern/*/url-pattern
   !-- modify appropriately --
   /filter-mapping
   listener
   listener-class
   
com.opensymphony.webwork.lifecycle.SessionLifecycleListener/listener-class
   /listener
   listener
   listener-class
   
com.opensymphony.webwork.lifecycle.ApplicationLifecycleListener/listener-class
   /listener

and from my server.xml file, taken pretty much verbatim from the default 
server.xml:

   Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster

managerClassName=org.apache.catalina.cluster.session.DeltaManager
expireSessionsOnShutdown=false
useDirtyFlag=true

   Membership
   className=org.apache.catalina.cluster.mcast.McastService
   mcastAddr=224.64.64.128
   mcastPort=45600
   mcastFrequency=500
   mcastDropTime=3000/
Receiver
   
className=org.apache.catalina.cluster.tcp.ReplicationListener
   tcpListenAddress=auto
   tcpListenPort=4060
   tcpSelectorTimeout=100
   tcpThreadCount=3/

   Sender
   
className=org.apache.catalina.cluster.tcp.ReplicationTransmitter
   replicationMode=pooled/

Valve className=org.apache.catalina.cluster.tcp.ReplicationValve
  filter=.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;/
   /Cluster

Anyone know what's going on? Or can provide some insight into what I may 
be missing?

Thanks for any info.

-a

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


Re: Cluster error when starting up web application

2004-02-25 Thread Aadi Deshpande
Upon further research, it seems that DeltaSession.setId() fires the 
sessionCreated events to registered listeners, but this happens before a 
session is declared valid ( i.e. setValid(true) has not been called ).

so when a  registered listener tries to utilize ( what it seems to 
believe is ) a newly created session, the setAttribute method throws the 
IllegalStateException..

Now I don't know too much about how the actual workings of the 
HttpSession should go, but in my opinion, the sessionCreated events 
should not be fired unless a valid session has been created.  which 
seems to imply that maybe setValid() should doing the firing...

However, that doesn't sit well with me since it doesn't make sense for a 
session to be truly valid unless it has a sessionId, which either
forces there to be an implict order between setId() and setValid() which 
is no good, requiring that either/or check to see if the other has been 
truly satisfied, and setting up some sort of implicit sequence coupling.

the alternative, as I see it, is move the tellNew() invocation to the 
DeltaManager ( it's declared public, so it's already exposed ).

I tried that, by patching up the TC5 sources and it seemed to resolve 
the issue.

Again, as I know little to nothing of how sessions should work and what 
other implications this refactoring may have, what should be my next 
course of action?

Should I contact the webwork people? Is this not correct use of sessions 
and session listeners?

Should I open up a bug and/or propose my patch?

Thanks in advance for reading and/or responding,

-a





Aadi Deshpande wrote:

Hi,

I just got Tomcat 5.0.19 and after setting up the new delta based 
cluster manager, i get this during the startup my application :

SEVERE: Session event listener threw exception
java.lang.IllegalStateException: setAttribute: Session already 
invalidated
   at 
org.apache.catalina.cluster.session.DeltaSession.setAttribute(DeltaSession.java:1306) 

   at 
org.apache.catalina.cluster.session.DeltaSession.setAttribute(DeltaSession.java:1283) 

   at 
org.apache.catalina.cluster.session.DeltaSessionFacade.setAttribute(DeltaSessionFacade.java:17 

7)
   at 
com.opensymphony.webwork.lifecycle.SessionLifecycleListener.sessionCreated(SessionLifecycleLis 

tener.java:50)
   at 
org.apache.catalina.cluster.session.DeltaSession.tellNew(DeltaSession.java:459) 

   at 
org.apache.catalina.cluster.session.DeltaSession.setId(DeltaSession.java:431) 

   at 
org.apache.catalina.cluster.session.DeltaManager.createSession(DeltaManager.java:377) 

   at 
org.apache.catalina.cluster.session.DeltaManager.messageReceived(DeltaManager.java:895) 

   at 
org.apache.catalina.cluster.session.DeltaManager.messageDataReceived(DeltaManager.java:794) 

   at 
org.apache.catalina.cluster.tcp.SimpleTcpCluster.messageDataReceived(SimpleTcpCluster.java:561 

)
   at 
org.apache.catalina.cluster.io.ObjectReader.execute(ObjectReader.java:117) 

   at 
org.apache.catalina.cluster.tcp.TcpReplicationThread.drainChannel(TcpReplicationThread.java:17 

6)
   at 
org.apache.catalina.cluster.tcp.TcpReplicationThread.run(TcpReplicationThread.java:114) 



As far as I can tell, it's happening when I request a page that has 
the webwork2 RequestLifecycleFilter set for that url pattern.  The 
doFilter function creates a HttpSession if none exists, which I assume 
calls the SessionLifecycleListener.sessionCreated(), but for some 
reason, it seems like the session is being invalidated prematurely..

Here's the relevant piece from my web.xml :
   filter
   filter-namecontainer/filter-name
   filter-class
   
com.opensymphony.webwork.lifecycle.RequestLifecycleFilter/filter-class
   /filter
   filter-mapping
   filter-namecontainer/filter-name
   url-pattern/*/url-pattern
   !-- modify appropriately --
   /filter-mapping
   listener
   listener-class
   
com.opensymphony.webwork.lifecycle.SessionLifecycleListener/listener-class 

   /listener
   listener
   listener-class
   
com.opensymphony.webwork.lifecycle.ApplicationLifecycleListener/listener-class 

   /listener

and from my server.xml file, taken pretty much verbatim from the 
default server.xml:

   Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster

managerClassName=org.apache.catalina.cluster.session.DeltaManager
expireSessionsOnShutdown=false
useDirtyFlag=true

   Membership
   className=org.apache.catalina.cluster.mcast.McastService
   mcastAddr=224.64.64.128
   mcastPort=45600
   mcastFrequency=500
   mcastDropTime=3000/
Receiver
   
className=org.apache.catalina.cluster.tcp.ReplicationListener
   tcpListenAddress=auto
   tcpListenPort=4060
   tcpSelectorTimeout=100
   tcpThreadCount=3/

   Sender

Re: tomcat and VM settings

2004-02-16 Thread Aadi Deshpande
Hi,

Not sure what you're asking.
Hard numbers I don't have.  I've pretty much run all my server based 
applications with -server since they introduced it, but I think Sun's 
documentation and common knowledge bears it out.  There's also some 
obscure documentation that explains what the -server options sets 
defaults to ( like method compile threshold, stack size, heap size, 
etc.. ) which also shows them to be better for applications that do the 
same thing day in and day out.  I will try to locate this.

I do hope to have numbers soon with the effect of the new Parallel and 
Concurrent garbage collectors in effect.

Let me know if I can be of more assistance,
-a
Shapira, Yoav wrote:

Howdy,

 

In general, -server will make a huge difference for long running
applications
   

Can you back that up with any specific facts?

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged.  This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender.  Thank you.

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



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


Re: tomcat and VM settings

2004-02-11 Thread Aadi Deshpande
Parker, Matt wrote:

I'm wondering if anyone has done any tomcat benchmarking with different Hotspot VM settings. Specifically, I'm wondering if -server or -d64 make noticeable differences on the Solaris 8 sparc platform. I have read Sun's documentation about what these settings are supposed to do, but I haven't really seen anything talked about within the context of Tomcat or J2EE.

Thanks in advance,

Matt

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

In general, -server will make a huge difference for long running 
applications, since a lot of the internal optimizations ( such as how 
often to compile/recompile and how long to cache ) are turned on by the 
-server/-client switch.

On Solaris 8, you can get a little  more juice a lot of times by 
switching to the alternate libthread ( 
http://java.sun.com/docs/hotspot/threads/threads.html ) and using the 
1-1 model. ( This, i believe is the default on Solaris 9 )

There's a lot of options related to garbage collecting, leading one to 
the obvious conclusion that tuning the GC can provide boosts in 
performance.  There's a lot of good reading at 
http://java.sun.com/docs/hotspot/. 

I don't have any hard numbers, but we were able to do some very postive 
things, once we found the right information.

HTH,
-a


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


Re: cookies, Safari, and Tomcat

2004-02-11 Thread Aadi Deshpande
Hollerman Geralyn M wrote:

I'm trying to figure out some behavior I'm seeing only when I use 
Safari (v1.25 - downloaded from the Apple site last week) and Tomcat. 
This involves cookies. I am using Tomcat 5.0.16. I have written a 
servlet that sends a cookie back to the server for use later on; I can 
see this cookie when using Mozilla, Netscape, or IE when I look at a 
list of cookies. I also see the JESSIONID cookie that Tomcat uses in 
this list. However, when I use Safari, I see the JESSIONID cookie, but 
not the cookie I created. I'm not sure what the reason is for this; if 
I didn't do something in my code, I'd like to find out what it is, and 
for this I'd imagine I'd have to look thru the Tomcat source and see 
what's done when the JSESSIONID cookie is created. Unfortunately, I 
can't seem to find this.

Has anyone seen this behavior before? How should I deal with it? Or 
can someone point me to the program where the JESSSIONID cookie for 
Tomcat is created?

Thanks!
What is the cookie version of the cookie that you created?  We've 
noticed some odd behaviour when using cookies and that magically went 
away when we started using version  0 cookies.

-a

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


Re: Administering and monitoring under TC 5

2004-02-06 Thread Aadi Deshpande
Thanks for the info. I'm still a little confused about what is meant by  
replace the MXRI jars with the MX4J jars

i have jmx.jar, jmx-remote.jar, and jmx-remote-tools.jar in my 
$CATALINA_HOME/common/lib.

I'm running TC5.0.16 under J2SDK 1.4.2

Thanks again,
-a
Bill Barker wrote:

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

Hello all,

There's much talk about how TC5 is JMX-enabled, so I'm wondering what
tools are available for monitoring and administering a TC5 server.
I've checked out the manager application and it provides some basic
information ( such as sessions ), but I was wondering what people's
experiences were with more detailed tools ( if any exist ).
Particularly, I'm looking for monitoring software that will let me view
the number of sessions, and how active my JNDI datasource are ( how many
connections in the pool, how many active, etc.. ).
The manager app gives you the ability to get the number of sessions,
but  Datasources must be listed in the globalresources section,  and to
date, I haven't figured out how to describe a Resource/ResourceParams
in the GlobalNamingResources section and still utilize it in my context
( I've had to  list it under the Context that I wish to utilize it for
).  If anyone has any hints in this department, that would be very
   

helpful.
 

Finally, I'd like to know if it's possible to set up TC5 to be a
JMX-enabled server in such a fashion that you can access it remotely
using some tool like MC4J, and if so where  I can find some
documentation wrt. setting this up.
   

If you enable the AJP/1.3 Connector (even if you are not using
Apache/IIS/SunOne), then if you set in jk2.properties:
 mx.jrmpPort=value
and/or
 mx.httpPort=value
(where value is an actual port number :), and replace the MXRI jars with
the MX4J jars, then you can use the MX4J Adaptors to remotely configure
Tomcat.
 

Again, thanks for any input you may have.

-aadi
   





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



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


Tomcat 5 incompatibilities with JSTL 1.1 ?

2004-02-06 Thread Aadi Deshpande
Hi, I'm tryin to use Tomcat 5 and the newly released JSTL 1.1 and I get 
the following error whenever I try to do a x:anything?

I've gotten this same error under the Beta 1 running under Tomcat 5.

I've tried TC 5.0.16, 5.0.18, and the 20040203 nightly build ( each 
under J2SDK 1.4.1 with the new xalan.jar  and J2SDK 1.4.2 plain install )

I've posted to the taglibs board and Kris Schnieder was nice enough to 
point me to the bug : 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26611  

and

http://marc.theaimsgroup.com/?t=10754069598

Does anyone have any insight into why I would be getting this error?
I thought the JSTL was tested under Tomcat 5, so I'm not sure what I am 
doing wrong.

Thanks in advance for any help,

-a



org.apache.taglibs.standard.tag.common.xml.UnresolvableException: 
$prefix:javax.servlet.include.query_string
   org.apache.taglibs.standard.tag.common.xml.XPathUtil$JstlVariableContext.notull(Unknown 
Source)
   org.apache.taglibs.standard.tag.common.xml.XPathUtil$JstlVariableContext.getVariableValue(Unknown 
Source)
   org.apache.taglibs.standard.tag.common.xml.XPathUtil$JstlVariableContext.getVariableOrParam(Unknown 
Source)
   org.apache.taglibs.standard.tag.common.xml.XPathUtil.fillVarStack(Unknown 
Source)
   org.apache.taglibs.standard.tag.common.xml.XPathUtil.selectNodes(Unknown 
Source)
   org.apache.taglibs.standard.tag.common.xml.ForEachTag.prepare(Unknown 
Source)
   javax.servlet.jsp.jstl.core.LoopTagSupport.doStartTag(Unknown Source)
   org.apache.jsp.core.skeleton.mom_005frewards_005fcallout_jsp._jspx_meth_x_forEach_0(mom_005frewards_005fcallout_jsp.java:2138) 

   org.apache.jsp.core.skeleton.mom_005frewards_005fcallout_jsp._jspx_meth_cms_randomSet_0(mom_005frewards_005fcallout_jsp.java:2113) 

   org.apache.jsp.core.skeleton.mom_005frewards_005fcallout_jsp._jspService(mom_005frewards_005fcallout_jsp.java:134) 

   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311) 

   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) 

   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(Unknown 
Source)
   org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(Unknown 
Source)
   org.apache.jsp.account.callouts.index_005fgrocerycardform_005fcallout_jsp._jspx_meth_c_import_0(index_005fgrocerycardform_005fcallout_jsp.java:579) 

   org.apache.jsp.account.callouts.index_005fgrocerycardform_005fcallout_jsp._jspx_meth_c_otherwise_0(index_005fgrocerycardform_005fcallout_jsp.java:555) 

   org.apache.jsp.account.callouts.index_005fgrocerycardform_005fcallout_jsp._jspx_meth_c_choose_0(index_005fgrocerycardform_005fcallout_jsp.java:284) 

   org.apache.jsp.account.callouts.index_005fgrocerycardform_005fcallout_jsp._jspService(index_005fgrocerycardform_005fcallout_jsp.java:128) 

   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311) 

   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) 

   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(Unknown 
Source)
   org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(Unknown 
Source)
   org.apache.jsp.loyalty_005findex_jsp._jspx_meth_c_import_1(loyalty_005findex_jsp.java:419) 

   org.apache.jsp.loyalty_005findex_jsp._jspService(loyalty_005findex_jsp.java:126) 

   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311) 

   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) 

   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(Unknown 
Source)
   org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(Unknown 
Source)
   org.apache.jsp.core.skeleton.layout_005fno_005frightnav_jsp._jspx_meth_c_import_4(layout_005fno_005frightnav_jsp.java:650) 

   org.apache.jsp.core.skeleton.layout_005fno_005frightnav_jsp._jspx_meth_c_if_2(layout_005fno_005frightnav_jsp.java:625) 

   org.apache.jsp.core.skeleton.layout_005fno_005frightnav_jsp._jspx_meth_c_forTokens_1(layout_005fno_005frightnav_jsp.java:592) 

   

Re: problems shutting down server when enabling the SimpleTcpCluster

2004-02-05 Thread Aadi Deshpande
I've definitely noticed this issue on TC 5.0.16 ( though I can't 
remember if we noticed in 5.0.18, but I am testing that version now )

We're running J2SDK 1.4.1_03 on Solaris 8 , if that's any help.

I'm also going to be trying this on J2SDK 1.4.2 with 5.0.18 and I will 
report back.

Again, thanks for any input you can provide,

-a

Filip Hanik (lists) wrote:

which version of tomcat? the latest? this means that a thread is not a
daemon thread, and the stop will not work.
this was a bug a long time ago. has it resurfaced?
Filip

-Original Message-
From: Aadi Deshpande [mailto:[EMAIL PROTECTED]
Sent: Monday, February 02, 2004 2:00 PM
To: [EMAIL PROTECTED]
Subject: problems shutting down server when enabling the
SimpleTcpCluster


Hi,

we have 2 tomcat instances that are clustered via the
SimpleTcpReplication cluster.
When they start up, i see that they are both communicating and they seem
to be working OK.
However, whenever I try to shut down an instance using the
$TOMCAT_HOME/bin/catalina.sh script, the server never fully dies.
It seems like there around 20 threads still hanging around, all doing
something related to persisting these sessions.
This is in a development instance so we have maybe 4 or 5 sessions at
best at any given time,so I'm not sure why replication would take so long.
These servers hang around forever and can only be killed via a  kill
-9 .  Any further attempts to run 'catalina.sh stop'  results in the
connection refused error, presumably because the instance has stopped
listening on that port for requests.
And i know the server is attempting to shut down since i get the
Unregistering... messages in my log files.
Any help is much appreciated,

Thanks in advance,

Aadi Deshpande



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.577 / Virus Database: 366 - Release Date: 2/3/2004
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



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


Administering and monitoring under TC 5

2004-02-05 Thread Aadi Deshpande
Hello all,

There's much talk about how TC5 is JMX-enabled, so I'm wondering what 
tools are available for monitoring and administering a TC5 server.

I've checked out the manager application and it provides some basic 
information ( such as sessions ), but I was wondering what people's 
experiences were with more detailed tools ( if any exist ).

Particularly, I'm looking for monitoring software that will let me view 
the number of sessions, and how active my JNDI datasource are ( how many 
connections in the pool, how many active, etc.. ).

The manager app gives you the ability to get the number of sessions, 
but  Datasources must be listed in the globalresources section,  and to 
date, I haven't figured out how to describe a Resource/ResourceParams  
in the GlobalNamingResources section and still utilize it in my context 
( I've had to  list it under the Context that I wish to utilize it for 
).  If anyone has any hints in this department, that would be very helpful.

Finally, I'd like to know if it's possible to set up TC5 to be a 
JMX-enabled server in such a fashion that you can access it remotely 
using some tool like MC4J, and if so where  I can find some 
documentation wrt. setting this up.

Again, thanks for any input you may have.

-aadi



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


Re: Please help Console Problem in tomcat 5.0.16

2004-02-02 Thread Aadi Deshpande
i've always managed to get this error when i have spaces between the xml 
pi ( ?xml version=... ? ) and the start of the file.
i'd check for that, and that you have no spaces at the '?xml' and a 
space before the '?'

hope this helps,

-a



Avinash Sridhar wrote:

Hi,
 Thanks for the reply.How do I correct the invalid server.xml file.
Kindly let me know.

server.xml file for the same directory structure.

Context path=/sampleapp docBase=sampleapp debug=0
reloadable=true
/Context
Thanks 
AS

On Mon, 02 Feb 2004 Bodycombe, Andrew wrote :
 

This indicates your server.xml is invalid.

-Original Message-
From: Avinash Sridhar [mailto:[EMAIL PROTECTED]
Sent: 02 February 2004 16:07
To: [EMAIL PROTECTED]
Subject: Please help Console Problem in tomcat 5.0.16
have my own directory as sampleapp which has the necessary structure
   

and
 

the .class file is put into the following directory structure.
classes/package1/structure/HelloServlet.class.
All in the %TOMCAT% home directory.

My question is in %TOMCAT%/conf/server.xml file how is the Context
/Context tag written.
I have written it like this
Context path=/sampleapp docBase=sampleapp debug=0
   

reloadable=true
 

/Context

The directory structure of sampleapp is as follows..
%TOMCAT%/webapps/sampleapp/WEB-INF/classes
/lib
/sourcefiles
/web.xml.
The classes directory has the structure like this..
classes/package1/structure/HelloServlet class file.

My Web.xml file looks like this

/ web.xml /

?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
display-nameServlet 2.4 Examples/display-name
description Servlet 2.4 Examples /description
!-- Servlet mapping start --
!-- Define servlets. i.e. bind a servlet name to a class --
servlet
servlet-nameHelloServlet/servlet-name
servlet-classpackage1.structure.HelloServlet/servlet-class
/servlet
!-- bind a servlet name to a URL (pattern) --
servlet-mapping
servlet-nameHelloServlet/servlet-name
url-pattern/sampleapp/url-pattern
/servlet-mapping
!-- Servlet mapping end --

/web-app
/* web.xml **/
/*** Console error */
Feb 2, 2004 8:33:19 AM org.apache.commons.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 3 column 6: The processing
   

instruction
 

target
matching [xX][mM][lL] is not allowed.
/*** Console error */
Let me know if any changes are to be made.

Help greatly apreciated.

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


 



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


trouble load balancing with mod_jk2

2004-02-02 Thread Aadi Deshpande
Greetings,

(Not sure if this is the place for mod_jk2 questions or if there is 
another mailing list)

I'm having trouble figuring out how loadbalancing should work using 
mod_jk2 with Apache2 and Tomcat 5.0.18.

I have 2 tomcat instances on 2 machines ( running with different port 
numbers )

I set them up in a single lb group, using the same lb factor of 80 ( a 
number I picked arbitrarily )

my lb configuration is set to graceful=1, stickySession=1, and timeout=0 
( i've appended my workers2.properties as additional info ).

However, it seems that when i turn on the apache2 and monitor the 
server, all the instances start going to the first instance in the list 
and bog that instance down.  There doesn't seem to be any load balancing 
going on, nor is there any sort of failover when the instance becomes 
unusable ( the thread pool hits the maximum of 200 )

The documentation on mod_jk2 isn't all that clear and a lot of it seems 
to be geared for implementing the jni mechanism as opposed to the 
channel socket ajp mechanism.

I must clearly be doing something wrong, but I can't figure it out.
Additional q's :
the mod_jk2 instance is constantly initing and shutting down.  Is this 
normal operating procedure?
does a higher lb factor or lower lb factor increase that machine's 
chances of being selected?
do  dashes ( - ) in the  server name have any effect?



I've listed my workers2.properties file inline for review.

Thanks in advance for any help.

Aadi Deshpande

##workers2.properties
[logger]
level=DEBUG
 

[config:]
file=${serverRoot}/conf/workers2.properties
debug=0
debugEnv=0
 

[uriMap:]
info=Maps the requests. Options: debug
debug=0
 

# Alternate file logger
#[logger.file:0]
#level=DEBUG
#file=${serverRoot}/logs/jk2.log
 

[shm:]
info=Scoreboard. Required for reconfiguration and status with 
multiprocess servers
file=${serverRoot}/logs/jk2.shm
size=
debug=0
disabled=0
 

[workerEnv:]
info=Global server options
timing=1
debug=0
# Default Native Logger (apache2 or win32 )
# can be overriden to a file logger, useful
# when tracing win32 related issues
#logger=logger.file:0
 

[status:]
info=Status worker, display runtime information
 

[uri:/jkstatus/*]
info=Display status information and check the config file
group=status:
 

[lb:lb]
info=Default load balancer.
debug=0
stickySession=1
timeout=0
[channel.socket:tc-server2:6090]
info=Ajp13 forwarding over socket
graceful=1
debug=0
lb_factor=80
group=lb
tomcatId=tc-server2:6090
[channel.socket:tc-server2:6190]
info=Ajp13 forwarding over socket
graceful=1
debug=0
lb_factor=80
group=lb
tomcatId=tc-server2:6190
[channel.socket:tc-server2:6290]
info=Ajp13 forwarding over socket
graceful=1
debug=0
lb_factor=80
group=lb
tomcatId=tc-server2:6290
[channel.socket:tc-server1:6090]
info=Ajp13 forwarding over socket
graceful=1
debug=0
lb_factor=80
group=lb
tomcatId=tc-server1:6090
[channel.socket:tc-server1:6190]
info=Ajp13 forwarding over socket
graceful=1
debug=0
lb_factor=80
group=lb
tomcatId=tc-server1:6190
  [channel.socket:tc-server1:6290]
info=Ajp13 forwarding over socket
graceful=1
debug=0
lb_factor=80
group=lb
tomcatId=tc-server1:6290
[uri:/*.jsp]
info=Map the whole webapp
[uri:/*.sx]
info=Map the whole webapp


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


problems shutting down server when enabling the SimpleTcpCluster

2004-02-02 Thread Aadi Deshpande
  
Hi,

we have 2 tomcat instances that are clustered via the 
SimpleTcpReplication cluster.

When they start up, i see that they are both communicating and they seem 
to be working OK.

However, whenever I try to shut down an instance using the 
$TOMCAT_HOME/bin/catalina.sh script, the server never fully dies.

It seems like there around 20 threads still hanging around, all doing 
something related to persisting these sessions.

This is in a development instance so we have maybe 4 or 5 sessions at 
best at any given time,so I'm not sure why replication would take so long.
These servers hang around forever and can only be killed via a  kill 
-9 .  Any further attempts to run 'catalina.sh stop'  results in the 
connection refused error, presumably because the instance has stopped 
listening on that port for requests. 

And i know the server is attempting to shut down since i get the 
Unregistering... messages in my log files.

Any help is much appreciated,

Thanks in advance,

Aadi Deshpande



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