irclog2html for #tomcat on 20060802

00:00.35jbalinti'm selling the apress book i have for a few bucks if you want it :)
00:01.37mersjbalint: postage will cost more ;)
00:01.45jbalintwhere do you live?
00:01.53mersmalta
00:02.12jbalintWow, yeah, probably like 20 bucks.
00:02.15mersand i don't mean malta, NY :p
00:02.22jbalintNever heard of that.
00:02.48mersi'll wake up early and go get jasonb's book tomorrow
00:03.03jbalintCool. You have good book stores there?
00:03.06mersand then promptly read it on the beach
00:03.24jbalinthehe, nice. what's the temperature like there?
00:04.07mersit's actually not too bad. we're at about 90F in the shade on a daily basis. the humidity kills you though, you'll do nothing but sweat cause nothing evaporates.
00:04.19mersthe rest of europe is in a heat wave. can't wait til it hits here...not
00:04.45jbalintYeah, it's been hot in US on and off for maybe 3 or 4 weeks.
00:05.06mersjbalint: i've heard. i get the abc news podcast
00:05.52mersi used to live in the US, so i try to keep up with what's going on in your neck of the woods
00:06.14jbalintcool, where at?
00:06.17mersdc
00:06.24jasonbmers: Our book's introduction chapter has a good overview of what Tomcat is, and what Tomcat does.
00:07.03jasonbmers: And, you're absolutely right, there's almost no pages on the public internet that describe what Tomcat is, which I always found very, very strange.
00:08.34*** join/#tomcat Fracture (n=Fracture@dsl-202-173-191-84.qld.westnet.com.au)
00:10.03mersjasonb: it's just a shame i can't wait for the second edition. i'm working on a 3 tier app and I'm at the point where I have to design the logic and interface. i used tomcat at work but never had to do the real configuration, just mucked about with a web.xml file. got a rude awakening when i started looking for docs and tutorials
00:11.40jasonbmers: Well, even as old as our first edition is, it will help you there because web.xml hasn't changed much, and neither has server.xml.  Deployment has changed a lot recently, but you can ask questions in here and figure it out.
00:12.12jasonbmers: The overall structure of Tomcat, and the overall set of features hasn't changed much, it's mainly just been improved.
00:12.58mersjasonb: web application deployment or tomcat deployment?
00:13.10jasonbwebapp deployment into Tomcat.
00:13.44mersjasonb: i had tried to look at the changelogs to see what the updates are but they're too verbose
00:14.22jasonbmers: Yeah.  Also the official changelogs are not clear about what changed, nor what the real impact is.
00:15.48jasonbmers: I maintain my own changelog.. I started because I had to have a readable one.  :)  So far, it's not published, but I'm considering what the best way to do that is.  One consideration is: it takes a huge amount of time to maintain it.  Another consideration is: it changes all the time, so if it was in a book it would get out of date really fast.
00:16.36mersi suspect most people only want a high level view of what's changed
00:17.55mersi don't have experience with tomcat, but i use other projects and i can tell you that if something changes in postgres, for instance, i will only care if it (1) changes the way my code will perform, or (2) breaks something, or (3) supersedes standard operating procedure for doing something in a better way
00:19.02mersthe rest is fluff. if i look at the tomcat changelog, i see things like "Fix coding error which could cause a rare crash when a poller error occurred and sockets where pending being added to the keepalive poller (remm)"
00:19.24jasonbmers: A *very* high level "changelog" is in our introduction chapter in our book.. and the second edition one includes what was added/modified in more recent versions of Tomcat.. all very high level, not giving much detail.
00:19.44mersyou don't need a proofreader do you? :D
00:20.23jasonbmers: Developers actually need extremely fine-grained changelogs that discuss what commits did what in each minor version release of Tomcat, which is the kind that I'm maintaining for myself.
00:21.47jasonbmers: We will need some tech reviewers, yes, but it's actually work.  I have never been an O'Reilly tech reviewer so I don't know it all goes, but it sounds like some tedious work.
00:22.34merssounds like joyous work :)
00:22.45mersat least they'll know the innards of tomcat when they're done reading though
00:23.10mersi'll get the 4.1 version tomorrow, but it would help to know what changed in broad terms
00:23.38mershopefully this (http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html) will incorporate the deployer changes
00:23.51jasonbmers: I can tell you some of it if you want.. plus you could search the tomcat-dev mailing list archives for "tomcat.next".
00:24.48jasonbibot: newintc5
00:24.53ibot[newintc5] http://www.onjava.com/pub/a/onjava/2004/01/28/tomcat5.html
00:24.53*** join/#tomcat rivad (n=rvd@adsl-065-013-016-010.sip.asm.bellsouth.net)
00:25.20jasonbmers: you can read our article about what was new in Tomcat 5.0 when that came out.. then there were more new changes from TC 5.0 to TC 5.5..
00:26.23mersit's a start :) if i read all this stuff on the beach i'm going to turn into a lobster
00:27.04rhizmoeis there a such thing as a graceful shutdown in tomcat?
00:30.23rhizmoehmm. much seems to depend here on handling it via apache
00:31.29jasonbrhizmoe: Describe the behavior you're after.
00:32.27rhizmoesame as in apache. put tomcat into a state in which it accepts no new connections
00:32.51jasonbrhizmoe: Just not accepting new TCP connections?
00:32.53rhizmoeafter that it can automatically terminate itself or be manually terminated
00:33.15jasonbHow is this different than a regular shutdown of Tomcat?
00:33.49jasonbThat the port doesn't accept new connections, but the server's JVM process stays running?
00:34.02rhizmoeyeah, but now I'm thinking our app isn't amenable to that
00:34.30rhizmoebut yeah, that it finishes whatever threads it has going
00:34.32jasonbYou can tell the connector to stop accepting connections via JMX.. (an easy way to do that would be through jconsole)
00:34.47rhizmoeah right. well i should really install that stuff :)
00:35.04jasonbWell jconsole is part of the JDK, so you should already have it.
00:35.24jasonbYou just need to start Tomcat's JVM in a way where the JVM opens a JMX Remote connector port.
00:36.34jasonbset JAVA_OPTS="-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
00:36.51jasonb(in the Tomcat JVM process's environment)
00:41.11rhizmoei'll make a note of that for when i have time. thanks :)
00:41.20*** join/#tomcat mers (n=mers@217.22.177.194)
00:41.29merslaptop went to sleep
00:41.31mersand so should i
00:41.36mersthanks jasonb
00:43.47jasonbrhizmoe: You're welcome.
01:13.02*** join/#tomcat gorpon (n=gorpon@64.165.63.137)
02:00.44*** join/#tomcat dec_ (n=tom@ppp156-158.lns3.adl2.internode.on.net)
02:09.37dec_Hi all, in a webapp's META-INF/context.xml I have an AccessLogValve to do custom logging for each webapp, but each access log appears to be blank - any ideas why this could be?
02:09.38*** join/#tomcat longbeach (n=bobby@AFontenayssB-152-1-20-233.w83-114.abo.wanadoo.fr)
02:14.04yassinegood night everyone
02:16.13jasonbgood night yassine
02:16.50jasonbdec_: How are you deploying your webapp?  
02:17.07dec_its auto deploying
02:17.11jasonbdec_: Are you making it into a WAR file and using the manager webapp to deploy it?
02:17.46jasonbdec: Also, which exact version of Tomcat are you using?
02:20.33decjasonb: 5.5.15 - the webapp is a war but we have a script which is run to deploy a new webapp, which unzips the war into a new directory and then adds a <Host appBase='/new/dir/' unpackWARs='true' autodeploy='true'></Host> block to tomcat's server.xml
02:23.29dec(I don't know why it is set up like that, that's just how it is.)
02:27.53jasonbdec: well, if I remember right, in TC 5.5.x, I think the only time that META-INF/context.xml is used is when you deploy your webapp through the manager webapp.
02:28.48jasonbdec: You're not saying you keep adding additional <Host> lines to your server.xml each time you redeploy, are you?
02:30.22decNo not every time the app is redeployed, each time an additional app is added.
02:30.28jasonbok.
02:30.42dec(this is not my setup and I am a tomcat newbie. :))
02:30.43jasonbWell, I think you shouldn't be using META-INF/context.xml when you deploy it that way.
02:31.07jasonbInstead, you should be adding a file like conf/Catalina/localhost/yourwebappname.xml
02:31.12decOk so basically our AccessLogValve is in the wrong spot, it's not going to be read in the context.xml?
02:31.18decAh okay.
02:31.26jasonbThe contents of the META-INF/context.xml file you have now should go into conf/Catalina/localhost/yourwebappname.xml instead.
02:31.38jasonbTry that.. it'll likely work.
02:31.43jasonbI have to run.
02:31.48decThanks for the advice.
02:32.18jasonbYou could also put the <Context> config straight into server.xml, nested within the <Host> you're already adding.. that might be even better.
02:32.25jasonbYou're welcome.
02:32.57decYeah that was my other thought, just add the AccessLogValve to the <Host></Host> block.
02:33.04jasonbYup.
02:33.19jasonbOkay.. have fun.  :)
02:34.05decThanks.
02:34.06dec:)
02:34.45jasonbYou're welcome.
03:04.46*** join/#tomcat enno__ (n=enno@p508D363B.dip0.t-ipconnect.de)
03:09.32*** join/#tomcat lamech (n=dan@cheshirecat.manxome.org)
03:20.04*** join/#tomcat vinse (n=vinse@208.253.223.146)
03:37.15*** join/#tomcat valmont (n=chrishol@dsl092-043-004.lax1.dsl.speakeasy.net)
04:02.52*** join/#tomcat longbeach (n=bobby@AFontenayssB-152-1-17-181.w82-121.abo.wanadoo.fr)
04:02.56*** join/#tomcat enno_ (n=enno@p508D2A04.dip0.t-ipconnect.de)
04:14.40*** join/#tomcat retodd (n=opera@adsl-69-224-37-93.dsl.irvnca.pacbell.net)
04:32.19*** join/#tomcat Fracture (n=Fracture@dsl-202-173-191-84.qld.westnet.com.au)
05:09.57*** join/#tomcat jasonb (i=noneoyer@adsl-66-124-73-250.dsl.sntc01.pacbell.net)
05:20.08*** join/#tomcat fix- (n=Bjorn@86.39.154.74)
05:39.58*** join/#tomcat remnant (n=lenhan@user-0c9hcu2.cable.mindspring.com)
06:53.46*** join/#tomcat jochus (n=jochus@mailhost.newtec.be)
06:53.57*** join/#tomcat columbo (n=chatzill@pool-71-104-25-42.lsanca.dsl-w.verizon.net)
06:54.08jochushello
06:54.21jochusI'm wondering if someone's here to help my out with a stupid problem
06:54.26jochusI'm using Tomcat 5.5
06:54.34jochusand when I start up Tomcat ( startup.sh )
06:54.37jochusI get this error
06:55.13jochus2-aug-2006 8:37:46 org.apache.catalina.startup.HostConfig deployDirectory
06:55.14jochusSEVERE: Error deploying web application directory webapp9
06:55.14jochusjava.lang.NullPointerException
06:55.23jochusnullpointerexception? :-/
06:57.00columbomaybe its a problem with your servlet
06:57.21jochusyes, I guess ... but I don't know where to start looking ...
06:57.45jochus2-aug-2006 8:37:46 org.apache.catalina.startup.HostConfig deployDirectory
06:57.45jochusSEVERE: Error deploying web application directory webapp9
06:57.45jochusjava.lang.NullPointerException
06:57.45jochus<PROTECTED>
06:57.45jochus<PROTECTED>
06:57.56jochusit has something to do with my JDBC Driver, I think
06:58.01jochusI made a context.xml
06:58.14jochus<?xml version="1.0" encoding="UTF-8"?>
06:58.14jochus<Context path="/alumni">
06:58.14jochus<PROTECTED>
06:58.14jochus</Context>
06:58.30jochusand since then, everything went wrong ...
06:59.32columboya man i don't know; i don't use JDBCRealm
06:59.44jochusno problem :-)
07:00.24columboi'm trying to figure out how to keep tomcat from serving my servlet on http; only on https
07:01.56columbooh duh.. simple redirect
07:45.08*** join/#tomcat BigChris (n=BigChris@212.130.183.18)
07:57.56*** part/#tomcat dec (n=tom@ppp156-158.lns3.adl2.internode.on.net)
08:07.38*** join/#tomcat yango (n=yango@unaffiliated/yango)
09:33.48*** join/#tomcat wam (n=wam@proxy1.msh.de)
09:35.01*** join/#tomcat yel (n=yassine@xdsl-87-78-32-23.netcologne.de)
09:40.54*** join/#tomcat kanhaiya_kk (n=ignu@61.17.11.122)
09:40.59kanhaiya_kkhi all
09:41.07kanhaiya_kkcan anybody help me?
09:41.25kanhaiya_kki want to change default system error message
09:41.42kanhaiya_kkHTTP Status 404 - this error message
09:43.56*** join/#tomcat cypo (n=opera@dslb-082-083-045-010.pools.arcor-ip.net)
10:05.57*** join/#tomcat horst__ (n=horst@217.116.178.162)
10:06.45*** join/#tomcat jsisson (n=sissonj@ppp3-90.lns1.syd7.internode.on.net)
10:30.56*** join/#tomcat kanhaiya_kk (n=ignu@61.17.11.122)
10:39.42*** join/#tomcat Alconquian (n=g@adsl-69-152-219-186.dsl.fyvlar.swbell.net)
11:00.14*** join/#tomcat smgLeader (n=a@213.249.153.4)
11:04.42smgLeaderhey guys. I am using j_security_check on tomcat 5.0.28. I'm using a JDBC realm looking at an Oracle database and have a Logger in place to debug. Once tomcat has been up for a while (usually a couple of hours) the authentication stops working and there is no debugging output. The login form hangs. Anyone got any ideas? Thanks in advance.
11:13.01*** join/#tomcat fly_80 (n=fly@217.201.66.198)
11:13.12fly_80hello
11:15.25smgLeaderhello
11:25.12*** join/#tomcat fix- (n=Bjorn@86.39.154.74)
11:36.43*** join/#tomcat yassinework (n=yel@h-213.61.164.152.host.de.colt.net)
11:38.10yassineworkhi everyone
11:50.17*** join/#tomcat sail_ (n=sail@mdsnwikwbas08-pool28-a244.mdsnwikw.tds.net)
11:59.13kenneohey
11:59.18kenneo<-- Former Langly
11:59.35yassinework<---- wonders what that means :)
11:59.46kenneopointer to me :)
13:43.41*** join/#tomcat rolphin (n=rolphin@cpy94-2-82-224-234-131.fbx.proxad.net)
13:44.03rolphinHI, how can I configure apache/tomcat to correctly see the % caracter ?
13:44.50yassineworkrolphin,  explain please what you mean by seeing the charchter "%" ?
13:44.52rolphinI must rencode it this way to make it pass thru : %2525
13:45.06rolphinthe % used in urlencoding
13:45.56rolphinmod_jk sees %25 (from apache from my browser) but it sends to tomcat %
13:46.05rolphin% alone isn't valid ...
13:46.13rolphinso returns 400
13:47.02rolphinmay be this is not a tomcat problem or misconfiguration, I m ready to hear anything...
13:47.02*** join/#tomcat remnant (n=lenhan@user-0c9hcu2.cable.mindspring.com)
13:52.37*** join/#tomcat fly_80 (n=fly@217.201.65.255)
13:52.43fly_80hello all
13:56.21fly_80i'm running tomcat5 on debian and I wrote a servlet . I don't know why , the servlet should output some html lines ...but it does not... It prints out lines like : " <a href="index.jsp"> link </a><br> " without translating them...!!! what's wrong ??
13:57.00kanhaiya_kkhi all
13:57.19yassineworkfly_80,  add response.setContentType(text/html);
13:57.21kanhaiya_kkcan anybody tell me how to define alias in tomcat ?
13:57.55fly_80yassinework: ah , so is it necessary?
13:58.15yassineworkfly_80,  other wise everything is interpreted like default content = text
13:58.24fly_80ahhh
13:58.28fly_80thanks
14:00.16yassineworknp ;)
14:01.09yassineworkrolphin,  im afraid i have no idea what it can be sorry
14:03.04*** join/#tomcat randrew (n=raj@dolmen.cc.columbia.edu)
14:04.11*** join/#tomcat kenneo (i=langly@langly.org)
14:11.46smgLeaderhi yassine
14:15.02*** part/#tomcat kanhaiya_kk (n=ignu@61.17.11.122)
14:17.26smgLeaderyassine, I installed 5.0.28 with the logger like you said. It still happened when using the remote Oracle database. I've recondigured it to use a database on our LAN and it seems better. Someone told me that the firewall to the remote network drops connections that are inactive for a while. When tomcat starts up does it open a connection that it uses for j_security_check from then on, or does j_security_check open a connction as needed?
14:23.59awelynantsmgLeader: you want to try using a DataSource realm, I believe you can configure it to check for a DB connection and reconnect
14:25.30smgLeaderah, ok
14:25.40smgLeaderI've always used a JDBCRealm for dbase authentication
14:25.51smgLeaderI guess if the problem re-occurs then I will investigate that Realm type
14:26.03awelynantthe DataSource realm lets you use a configured DataSource
14:26.46*** join/#tomcat gawaine (n=gawaine@DHCP154.fis.unical.it)
14:26.54gawaineHi
14:27.07awelynantI believe (not sure) that a JDBC realm uses only 1 connection, so it may be worth using a pooled DataSource realm it you expect lots of concurrent auths
14:27.55gawaineI have a problem with tomcat. I've installed it on my LinuxBox and it starts but it doesn't allow me to access the "Tomcat Manager" and I don't know why
14:28.17smgLeaderaha, OK
14:28.59smgLeaderwe use connection pooling for our own code, but wasn't sure how the JDBCRealm operated
14:29.02smgLeaderthanks
14:35.01yassineworkhi smgLeader
14:35.13yassineworksorry was working did not notify that your here
14:36.26yassineworksmgLeader,  jdbc:url//blahblah/db&autoReconnect=true
14:37.18yassineworkhope this helps now i have to go my train moves in a couple of hours and need to doo a lot of stuff :s
14:37.23yassineworkany one here from austria ?
14:39.07yassineworkokay guys see you later
14:41.01smgLeaderthanks a lot yassine, that's seems perfect, let me try it out
14:41.40yassineworkgood luck
14:45.10gawaineHow can I access a .war application ? I've placed it in webapps/ dir but with http://localhost:8180/application it doesn't work
14:50.16*** part/#tomcat gawaine (n=gawaine@DHCP154.fis.unical.it)
14:58.13awelynantgawaine: are you running tomcat on 8180? the default port for tomcat is 8080
15:01.53smgLeaderdoes anyone know how to use the autoReconnect=true parameter for use with an Oracle connector? I tried "jdbc:oracle:thin:@IP:1521:sid?autoReconnect=true" but that didn't work.
15:09.16jbalinthaha
15:09.23jbalintit's specific to the mysql jdbc url
15:09.30smgLeadergrrrrrrrr
15:09.54smgLeaderits annoying me, because the oracle database is behind a firewall that drops our connection if it's inactive for an hour
15:10.17smgLeaderso if someone doens't log into the system for an hour (i.e. overnight) then tomcat needs to be restarted
15:10.39jbalintWhat connection pool are you using?
15:10.43smgLeaderI'm not
15:10.49smgLeaderusing JDBC security Realm
15:10.58smgLeaderfor j_security_check authentication
15:12.39smgLeaderyassine, you're back?
15:12.48yassinesmgLeader,  sorry was thinking its okay for oracle too
15:13.12smgLeaderno problem
15:13.21smgLeaderI'm not entirely sure how to fix this really
15:14.17smgLeaderthis is why we like to use MySQL if we are given the choice. This client uses Oracle as corporate polic
15:14.17smgLeadery
15:14.52yassinesmgLeader,  how anput making a kind of triger
15:15.10yassinecoding a small application that calls the db each 30 min
15:15.16smgLeaderI thought about that
15:15.33yassinethat could be for now a solution/workaround
15:15.33smgLeaderbut it would need to stimulate the actual connection that Tomcat opened
15:16.16smgLeaderso I couldn't just "echo desc table | sqlplus user/pass@dbase"  every 30 minutes
15:16.22smgLeaderbecause that would open a new connection
15:16.23yassineyou can use the httpclient for doing an authentication each 30 min
15:16.45smgLeaderahhh, I see what you're saying, get a process to log into the system every 30 minutes
15:16.58yassineyes
15:17.10smgLeaderok, that could be it
15:17.17smgLeaderI will investigate
15:17.20yassinegood luck mate
15:17.27smgLeaderfeels a bit dirty though!  :-p
15:17.28yassinemaybe i can connect from austria
15:17.39yassineand youll tell how it works
15:17.40smgLeaderhow is austria this time of year?
15:17.55smgLeadernah, the system isn't available on the puiblic internet
15:17.57yassinedunno im going there in 2 hours
15:18.03smgLeaderwhere are you now?
15:18.07yassinegermany
15:18.12smgLeadercool
15:18.17yassineyou ?
15:19.04smgLeadernot bad
15:19.09smgLeaderthe heatwave has finally broken here
15:19.44yassinewhere are you from ?
15:22.00Marv|LGheatwave?
15:22.05Marv|LG100 here today
15:22.30smgLeaderUK
15:22.44smgLeaderits been 90-95 for the last month or so
15:23.31*** part/#tomcat rolphin (n=rolphin@cpy94-2-82-224-234-131.fbx.proxad.net)
15:25.32*** join/#tomcat sail_ (n=sail@wireless299.cs.wisc.edu)
15:25.37*** join/#tomcat remnant (n=lenhan@ncle-vpn.ucsd.edu)
15:31.10*** join/#tomcat jbalint (n=jbalint@unaffiliated/jbalint)
15:32.14awelynantsmgLeader: not to be pushy :), but consider using the DataSource Realm, and configure DBCP (the datasource pool tomcat uses) to check for connections.  That should fix your problem
15:32.30smgLeaderok then, will research that tomorrow
15:32.31smgLeadercheers!
15:52.07*** join/#tomcat dfr (n=dfr@soss1.fnal.gov)
15:54.19dfrHello, is there a way to gain name of the servlet, as defined in web.xml, from a derivative of httpServlet class?
15:54.29dfror, rather, it's url pattern?
16:13.00*** join/#tomcat mers (n=mers@217.22.177.194)
16:15.29*** join/#tomcat mcupples (n=cupplesm@rrcs-24-73-129-8.se.biz.rr.com)
16:15.35mcupplesHi guys.
16:15.37mershi folks. i'd like to perform some tasks when my context starts up. like setting properties, establishing database connections, etc. where do i do this from?
16:15.40mcupplesWhat's a .war file?
16:16.00mcupplesWell mers, you need to find the manual that came with Tomcat and turn to page 37.
16:16.13mcupplesIt's the big one, not the skinny one.
16:17.08mersthe manual that came with tomcat?
16:17.18*** join/#tomcat jsisson (n=sissonj@ppp17-205.lns2.syd7.internode.on.net)
16:17.31mcupplesYes.
16:17.41mcupplesIt should have been in the box where you bought it.
16:18.34mcupplesI think you can get replacement ones by calling, but you need the serial that came with your copy.
16:19.36mersumm, i asked a legitimate question. if you don't know the answer or don't feel like answer, that's your prerogative, but don't waste my time with facetious answers
16:20.05dfrmers: isn't there like init method?
16:20.30mersdfr: that's per servlet, i was wondering if i could do it for the context as a whole
16:22.02dfrmers: I'd imagine what ya could do is have a default servlet start up and initialize all you want for it
16:23.55mersdfr: checking how to do that
16:24.42dfrmers: if you add <load-on-startup/> to the servlet clause, it'll start the servlet on start-up...
16:24.54dfrmers: not sure how much it helps =/
16:25.12mersdfr: thta might do the trick
16:26.22dfrmers: besides, maybe you should just consider lazy intialization =/
16:26.30mersdfr: i'm confused by one thing though. is there a way to share objects across servlets? for example, if i wanted to load properties for the whole context, and then have each servlet pick and choose which properties apply to it
16:26.50dfrmers: you cant always just make a static manager and ask for it =/
16:26.54dfremr*can
16:27.01dfr*mers: *can
16:27.10mersdfr: yup, that's what things are starting to look like
16:27.24mersdfr: singletons, managers, etc
16:27.27dfrmers: but I think the servlet context is shared between the servlets....
16:27.59dfrmers: http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html
16:28.01mersdfr: it is. resources defined in there are accessible by all of them
16:28.57merssetAttribute and getAttribute look promising
16:29.10dfrmers: but yea... whenever I needed to share anything, I used managers, mostly =/
16:30.12mersdfr: that makes sense for certain things
16:30.28merse.g. i'm writing a DatabaseManager that takes care of initialising the Tomcat DataSource and stuff
16:30.54mersbut it doesn't really make sense to have a manager that controls a Property hash table
16:31.49dfryea, if you want simple properties, the context sounds like an easy way to go =/ it's just I tend to need to share more complicated objects between the servlets, hehe
16:31.51mersof course, the other problem with loading servlets on startup is that you probably can't control their order
16:32.32mersso if i have a servlet which needs a DBManager object in its init, and a startup servlet that initialises that DBManager, i'm going to swear
16:32.49mersi think lazy initialization is the way to go
16:33.19*** join/#tomcat Moises (n=mlejter@host-216-165-185-114.dedicated.tds.net)
16:33.23dfrmers: hehe... I like lazy intialization just because it's lazy... but, I think I've read that there's some roder to start up.. lemme check
16:33.48Moiseshi,all!
16:34.35dfrmers: "load-on-startup can specify an (optional) integer value. If the value is 0 or greater, it indicates an order for servlets to be loaded, servlets with higher numbers get loaded after servlets with lower numbers."
16:35.47mersdfr: hrmm
16:36.13mersso in theory, you'd have an initialisation servlet with the lowest number do the initialisation work
16:36.30mersthen have the next servlet be your main webapp page
16:36.42merswonder what happens if the initialisation chokes on something
16:37.09dfrmers: well, the intiialization script is called when you start tomcat.... the other ones are called only once a user invokes them via web app...
16:37.29dfrmers: I'd imagine that if something is not initialized by the time web user invokes it, it'd just stay not initialized, hehe
16:38.24Moisesi have a question re: best practices - imagine i wanted to write a web app that allow the client to upload HTML files to be incorporated into the web app.  I could write a servlet that accepted the upload, then wrote into the user's directory inside the web app.  But I was going to deploy/redeploy my web app onto tomcat via a WAR file.  The problem is that when I re-deploy, tomcat will delete the old expanded WAR folder, in order
16:38.24Moisesto redeploy - and in the process it will also delete all the files my users uploaded into the web app.  I am wondering whether there is a best practice - and what it is :-) - for a case like this ?
16:38.51mersdfr: nevermind, that was just my brain not thinking straight. your main page would be loaded on startup
16:38.56mersso that it's init would be executed
16:39.36mersby the time a doGet/Post comes in, it checks the state of initialisation and if something died, it would display the error instead of the main page
16:39.57Moisesor it could try to reinitialize, right?
16:39.57dfrmers: yep, ya could do that.. :)
16:40.20Moises(i am thinking of a db setup that might have failed initially, but due to transient failures...)
16:41.05dfrMoises: not sure.... might be a better way to have the initial guy threaded and just keep trying time to time
16:41.21Moisesit also occurrs to me that a filter might be the way to go here - so that the filter could check whether init occurred, and if not, try again, w/out having the servlets behind it need to worry...
16:42.29Moisesi guess it would depend ... a thread that keeps trying could try a lot of times, w/out any clients actually trying to use the app... but otoh, by the time a client comes, the app would be ready ...
16:43.24dfrMoises: well, you can take care of by different sleep settings.. and it kinda makes sense to do that too, since if you're not using lazy intialization, you'd like to have your thingie initted asap
16:43.32dfrMoises: independent of whether user access it or not
16:44.06dfrMoises: if you wanted to be lazy and init it only once user accessed it, then might be a better idea to only try to init it once user asks for it :)
16:44.56dfrBTW guys, any of you know how I could get the url-pattern that is tied with a servlet?
16:45.25dfrso that I dont have to hardcode that url-pattern when I want to transition from one servlet to another?
16:45.51Moisesi don't remember any standard APIs to do that... reading the web.xml file yourself comes to mind :-)
16:46.15dfrMoises: that's ugly:P
16:46.52Moisesam not sure what you mean - you could steal the name from one servlet to give the other, and since url-pattern is mapped to servlet-name, you would not need to know what the pattern was, just the name assigned to the servlet you are replacing ...
16:46.53dfrMoises: I'm prolly better off hardcoding it then :)
16:47.13dfrMoises: so just link it all by servlet class names?
16:47.32Moisesdfr: that was what i was thinking of, yes ...
16:47.44mersdfr: you mean for href targets?
16:47.52dfrMoises: hmm.. lemme try that.. sounds pretty fair.. especially since then I could get it just by .class method =/
16:48.01dfrmers: yes, think so :P
16:48.10dfrmers: when I'm makign a form to be handled by a different servlet....
16:48.16mersdfr: right
16:48.37mersdfr: umm, hrmmm, good question
16:48.38mers:)
16:49.10Moisesbut if you are doing this inside the code of servlet 1 - how would you have servlet 2 by the same name?  I was thinking you would do this in updating your web app from one to another...
16:50.29mersdfr: i think you have to query the container
16:50.52mersdfr: since it's the only thing that knows where your servlet is, i think
16:51.27dfrMoises: not sure what ya mean... here's the deal:
16:52.22dfrServlet1: doGet(...) { ...; printResponse("<form method=get action="+getServlet2Name()+">"); ...;}
16:52.26*** join/#tomcat Darwin (n=unixnerd@darwinircd/developer/Darwin)
16:52.42dfrand I want Servlet2 to be executed once the user hits the "submit" button
16:53.12dfrso far, whatI was doing is go to web.xml, where I have <url-pattern>/servlet2</url-pattern>
16:53.25dfrand hardcoded getServlet2Name() to return "/servlet2" =/
16:53.46Moisesi would address the form to servlet1 again, and have it notice that when the form is submitted, it would need to do a forward() to a NamedDispatcher for getServlet2Name().
16:55.03Moises(and getServlet2Name() would be really the name, not a URL :-) )
16:55.05dfrMoises: how standard is that practice? 'cause.... that's not the way the web forms usually work =/
16:55.22dfrMoises: it is the name, since it's all relative to the root folder
16:56.38Moisesdfr: well - i guess one question is how many levels of indirection you want ...  another is whether you want the servlets to be visible to a browser...
16:57.42Moisesdfr: in your scheme, both servlets have url mappings, and so a browser can invoke either one directly.  in my scheme, only servlet1 needs a URL mapping, since servlet2 would only be called by name by servlet 1, via a NamedDispatcher...
16:58.55dfrMoises: basically you have one main dispathing servlet that, based on action, calls different objects =/
16:59.15Moisesdfr: i guess that, bottom line, your servlet1 need to know what the name of servlet2 is, whether a URL or a servlet-name ... but the question is whether you also want the client to see...  If yes, then I would stick to what you had - both servlets with well-known URls...
16:59.39dfrMoises: my point is that a servlet should generally know what url-pattern it has....
16:59.46Moisesdfr: yes - and the idea of a dispatching servlet is not new :-) - though that was not what I was thinking...
16:59.59dfrMoises: and tomcat sure as heck should know that... so I'd like to have my other servlet ask for it ;)
17:00.54Moisesdfr: a servlet would know its own URL, but not someone else's...    but you do have to end up hardcoding either a servlet-name, or a servlet URL into your code.  
17:01.09*** join/#tomcat Pir8 (i=pir8@de.crypted.ca)
17:01.41dfrMoises: well, I know what class I'd like to call....
17:01.56Moisesdfr: (actually - a servlet does not really even know its own URL - but a form with an empty action is address to the same URL that produced the form... so if your servlet does not know its own url, it can still write a form that will be posted back to itself ...
17:02.34dfrMoises: doGet knows the request and hence knows the url ;)
17:02.51Moisesdfr: true :-)
17:03.21dfrMoises: but yea..... kinda weird that a servlet can't know its url pattern without it being invoked =/
17:03.53dfrhmm... what happens if I dont specify url-pattern tag? will it get some default value?
17:04.12Moisesdfr: no url-pattern tag means servlet cannot be called, unless via a NamedDispatcher
17:04.29Moisesdfr: or via /servlet/fully.qualified.name if  you have that servlet enabled :-)
17:06.19dfrMoises: fully.qualified.name <- class name?
17:06.36yassine<PROTECTED>
17:08.27mersdfr: can i suggest the obvious?
17:08.54mersdfr: if there is no built in way to ask the container what the servlet url to name mappings are, why not write it?
17:09.09mersall you have to do is parse some xml, create a hashtable, and set it as an attribute in your context
17:09.21merseasier said than done, fine, but might not be that horrific
17:09.39dfrmers: I'm afraid the answer is laziness :(
17:09.45merscan web.xml change during the lifetime of a servlet?
17:09.49*** join/#tomcat wltjr (n=wltjr@c-66-177-190-192.hsd1.fl.comcast.net)
17:09.51dfrmers: dont think so
17:10.01merseven better
17:10.01dfrmers: it wont take effect unless tomcat is restarted anyway
17:10.08wltjranyone know if tomcat bundles or uses xalan at all?
17:11.24dfrmers: it's just... I'm pretty sure that tomcat has the className -> url-pattern mapping somewhere..... so if I were to code that mapping yet again, I'd be doing work that has been already done
17:11.36wltjrwell I should so I know tomcat does not bundle xalan, just trying to figure out if it includes any of it's classes or etc in tomcat
17:11.37mersagreed
17:12.03merswltjr: not familiar with xalan sorry
17:12.23wltjrwell basically someone is having a problem with the tomcat compiled from source on Gentoo
17:12.52wltjrxalan problem atm, if they use binary tomcat, it works, compiled from source it does not, but xalan is in jre? and it's the same jre, so rather odd
17:24.02*** part/#tomcat mcupples (n=cupplesm@rrcs-24-73-129-8.se.biz.rr.com)
17:24.19Moisesdfr: fully-qualified-name is indeed class-name - including package...
17:24.34wltjr!seen jasonb
17:24.41Moisesbut /servlet/* mapping is usually disabled for security reasons ...
17:24.46wltjrno bot here?
17:25.06Moiseswltjr: sorry - i just joined, myself :-)
17:43.25dfrMoises: hrmph... thanks :)
17:43.39dfrMoises: makes sense, so that the cracking user cant access all the servlets =/
17:43.51Moises:-)
17:51.14*** join/#tomcat oxblood (n=vee@user-11217nu.dsl.mindspring.com)
18:11.16jbalintis there a logic in the order that apps are started?
18:11.55jbalintwltjr: what kind of error do you get?
18:14.18wltjrok, I have narrowed it down more
18:15.00wltjrthis exception  javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
18:15.17wltjrit thrown with the Gentoo compiled from source tomcat and not the binary tomcat
18:15.36wltjrnow that class is part of xalan, but not part of 1.5 jdks
18:15.58wltjrwe currently are compiling tomcat via a 1.4 jdk, 1.5 will happen shortly, another story
18:17.08wltjrjbalint: so now I am trying to find out why that class would be part of the binary tomcat, and not our tomcat?
18:19.02awelynanttomcat binaries often include  xercesImpl.jar and xml-apis.jar in the $TOMCAT_HOME/common/endorsed folder
18:22.26wltjryeah, I have the binary, and it has no xalan, unless it's in compat package, which the particular user I do not believe is using
18:25.28*** join/#tomcat valmont (n=chrishol@germany.pspdev.pas.earthlink.net)
18:26.13*** join/#tomcat remnant (n=lenhan@80362923.dynamic.ucsd.edu)
18:26.53jbalintIs it on a 1.5 runtime? but ocmpiled with 1.4?
18:27.56*** join/#tomcat jeromatron (n=jeromatr@71-219-27-168.slkc.qwest.net)
18:28.40wltjrjbalint: yes, 1.5 runtime, compiled with 1.4, long story, compiling with 1.5 is available, but not in stable Gentoo tree, and tomcat in stable tree is like 2 years old
18:29.03jeromatronHas anyone tried to use jsp:useBean with a java 5 generics based list, so for example <jsp:useBean id="myStringList" type="java.util.List<String>" scope="request"/> ?
18:29.09jbalintWho is setting javax.xml.transform.TransformerFactoryConfigurationError ?
18:29.21jbalintThe JRE version is valled com.sun.org.apache.....
18:29.32jbalints/va/ca/
18:29.53jbalintjeromatron: why does it matter?
18:30.26wltjr<PROTECTED>
18:30.32Moisesjeromatron: i am pretty sure you need to specify the type as "java.util.List" ...you can always specify the type of the elements in the iterate tag...
18:30.36wltjr<PROTECTED>
18:30.53wltjr<PROTECTED>
18:30.58jeromatronif you try to use <c:out value= on one of the members of the list, you have to specify its type...oh, I guess in the foreach you can do that....
18:31.41Moisesjeromatron: (well - i was thinking of the struts logic:iterate - but perhaps jstl's c:for has the same feature...)
18:33.02jeromatronOh wait...yeah, I'm trying to get only one of the list out, and if I use the <%= ... %> syntax, I have to cast the member so <%=((Category) categoryTree.get(categoryTree.size()-1)).getName()%> which seems redundant since it's already a typed list.
18:33.08jbalintwltjr: is it possible that sysprop is getting changed/overridden somewhere?
18:33.33wltjrjbalint: that's over my head, no idea?
18:33.45wltjrjbalint: what do you mean by sysprop?
18:33.54jbalintSystem.getProperty()
18:34.02wltjrjbalint: any chance you want to join discussion on #gentoo-java about this?
18:34.10wltjrjbalint: oh no clue I doubt they are doing that
18:34.37jeromatronI guess I was just wondering if the jsp taglib had an update to handle generics, because the type="java.util.List<Category>" doesn't compile.
18:35.58Moisesjeromatron: i had not tried this myself... and you do  have an import for Category?  did you try type="java.util.List<my.package.Category>" ?
18:36.28Moisesjeromatron: it occurred to me that there's little reason why the code generator would care either way, and as long as the compiler accepted it ...
18:39.53jeromatronwow, I can't believe it was that simple :-)  you're right, it didn't care.  I just thought since it didn't compile that the jsp taglib didn't handle generic typed lists.  Thanks.  It works with the full package name - silly me.
18:46.39*** join/#tomcat chrismon (n=chrismon@unaffiliated/chrismon)
18:56.31*** join/#tomcat Mortuis (n=jmort@bi-02pt1.bluebird.ibm.com)
19:19.58*** join/#tomcat a4akb (n=Akbara@ask13-152.qualitynet.net)
19:47.50*** join/#tomcat eidoLaptop (n=eido@pdpc/supporter/monthlybronze/eidolon)
19:56.10*** part/#tomcat Mortuis (n=jmort@bi-02pt1.bluebird.ibm.com)
20:00.42*** part/#tomcat jeromatron (n=jeromatr@71-219-27-168.slkc.qwest.net)
20:11.06eidoLaptophey folks, is there a simple example of making a property entry in server.xml, and referring to it in a running servlet?
20:11.30*** join/#tomcat jasonb (i=noneoyer@adsl-66-124-73-250.dsl.sntc01.pacbell.net)
20:21.06MoiseseidoLaptop: i am pretty sure there are some in the tomcat docs online... do you mean a web-app specific property?
20:21.44eidoLaptopwell, i could make it web-app specific i suppose... but since i'm using WTP to enerate my entire webapp, i want to be able to set the parameter outside the actual final webapp.
20:22.10eidoLaptopweb.xml, server.xml, and tomcat-user.xml are 'external' to the webapp.
20:23.12a4akbjasonb: hi
20:24.06*** join/#tomcat wam (n=wam@p549DE641.dip.t-dialin.net)
20:26.48MoiseseidoLaptop: there is a web.xml inside each web app - then there is a web.xml in the tomcat config, which I think holds defaults for each web app deployed....  server.xml and tomcat-users.xml are only server-wide, I think...
20:27.29eidoLaptopokay, web.xml is what i want though.
20:29.16eidoLaptopif i put something like <param-name>something</> <param-value>blah</> in web.xml, could i refer to 'System.getProperty("something")' to get that value?
20:29.24eidoLaptopand would that be in 'context-param'?
20:29.39*** join/#tomcat mers (n=mers@217.22.177.194)
20:30.14eidoLaptopoddly, web.xml has no web-app block at all :(
20:30.56eidoLaptopthough my 'auto-generated' web.xml for my app does.
20:31.13MoiseseidoLaptop: yes - you need a context-param entry in web.xml, inside web-app.  inside context-param there are two entries, param-name and param-value.  But you don't look them up with System.getProperty - instead you use ServletContext and its getInitParameter.
20:32.11eidoLaptopah, i see.  
20:32.23MoiseseidoLaptop: hmm - maybe the default web.xml sort of assumes it is part of every web.xml 's web-app?  I don't know - I never put stuff there ... :-)
20:32.48eidoLaptopno, sorry, i was looking at server.xml :)
20:32.54eidoLaptopone moment :)
20:35.51eidoLaptopis ServletContext a static class?  *digging in docs* - i can't just go String foo = ServletContext.getInitParameter("myparamname") ; - can i?
20:35.56eidoLaptopeclipse doesn't think so :)
20:36.57MoiseseidoLaptop: no, not static.. you need to to call getServletContext() in your servlet, then call getInitParameter() on the context you get ...
20:37.26eidoLaptopwhere does getServletContext live?
20:43.49eidoLaptophmm.  i see, it's part of hte HttpSession.  btu tihs is an axis service... so i wonder if  i have to ask Axis for it.
20:47.47*** join/#tomcat vin (n=vin@88x102.filemaker.com)
20:48.15sairam71Hey. anyone got a minute for a question.
20:58.46*** join/#tomcat remnant (n=lenhan@128.54.48.11)
21:01.02eidoLaptophah, Moises thank you very much for your help, the final 'tricky' code was:
21:01.16eidoLaptopHttpServlet srv = (HttpServlet) MessageContext.getCurrentContext().getProperty(HTTPConstants.MC_HTTP_SERVLET);
21:01.16eidoLaptopServletContext context = srv.getServletContext();
21:01.16eidoLaptopString myValue = context.getInitParameter("whatever");
21:02.01eidoLaptopnext trick will be - is there a method called on a deployed axis webservice as it's started....  
21:02.41MoiseseidoLaptop: sorry - don't know axis... but you can set up a ContextListener on a web app, which is notified when the web app starts... maybe that is good enough ?
21:03.17Moisessairam: you can always ask ... :-)
21:03.27sairam71heh thank you.
21:03.39Moisesmaybe someone will answer *my* question :-)
21:04.27*** join/#tomcat coryb (i=cory@trinidad.altec.org)
21:04.46sairam71I am working with mod_jk and trying to get sticky sessions working when cookies are turned off.
21:04.49eidoLaptoper... moises, i don't know about that.  mostly this servlet needs to be 'poked' on startup to instantiate itself, and do a little setup
21:04.58sairam71if i understand properly mod_jk looks for ";jsessionid" in the url
21:05.20sairam71i guess my question is does it matter where in the url ";jsessionid" appears
21:05.34sairam71i have see it apear in different places while searching for help.
21:06.18sairam71sometimes it looks like localhost/test.hml;jsessionid=abc?foo=bar and other times localhost/test.html?;jsessionid=abc&foo=bar
21:06.25sairam71might be an obscoure question :P
21:07.23eidoLaptopwell, duh a constructor on the axis servlet gets run when the servlet gets started.  duhduh :)
21:07.37Moisessairam71: it ought to matter... and the proper way would be the second, without the ; ... but i don't know what any one server does it for real ... :-)
21:08.57sairam71hmm intersting. cuz i looked in the mod_jk code and it searches for JK_PATH_SESSION_IDENTIFIER which is set to ";jsessionid"
21:10.07Moisessairam71: well - there you go :-)  - there  may be some subtlety that does not jump to (my :-) ) mind ...
21:10.30sairam71yea so u think the 2nd url is correct then?
21:10.52sairam71yea maybe i am doing something werid
21:16.27Moisessairam71: well - I hesitate to say, since I did not expect the ; there at all...
21:17.06*** join/#tomcat Rizenine (n=RizeNine@159.218.3.30)
21:33.27sairam71ok moises. np :)
21:35.14*** part/#tomcat randrew (n=raj@dolmen.cc.columbia.edu)
21:37.00dfrdo i understand correctly that a HttpSession is created any time a new user makes a request?
21:38.45jasonbAny request that doesn't already have a corresponding session cookie will cause a session to be created.
21:40.09pucko_... unless specified "session=false" in the jspheader :)
21:40.42dfrand I assume that means that once the HttpSession is generated, HttpSessionEvent "created" happens, correct?
21:40.45swenteor a jsessionid-get|post-param?
21:41.32dfrbasically, I'm trying to listen to Session created events, wrote a listener... and dont seem to get anything in logs when I access the webpage after tomcat restart
21:41.41dfrand am curious where to look for the error
21:43.25dfrI know for sure that the listener object is created. Do I need to do anything specific to enable it to receive events?
21:47.57*** join/#tomcat Alconquian (n=g@adsl-69-152-199-18.dsl.fyvlar.swbell.net)
21:54.49corybanyone know how to tell, from within (or from outside) the jvm, if it is doing garbage collection?  we've got a jsp inside our tomcats that tells us memory usage, and that shoots way up while it's doing GC, apparently
21:55.13corybbut I'd like it to warn if memory usage is high and it's not doing GC
21:59.52dfryou can implement the finalize to output when it collected something?
22:02.03jasonbpucko_: Do you have a handy example I could see of the session=false JSP header?
22:06.48corybdfr: I don't think our apps are explicitly calling gc()
22:09.19dfrcoryb: hmm.. i thought finalize call doesnt depent on whether gc is called implicitely or explicitely
22:09.39dfrcoryb: either way, sounds more like a generic java question... might get more help in ##java =/
22:09.54corybsorry.  I thought I'd chance asking it here :>
22:10.10dfrcoryb: it's a good idea to ask everywhere ;) chances are greater to get what you want back :P
22:26.55pucko_<%@ page contentType="text/html" pageEncoding="utf-8" session="false" %>
22:27.11pucko_should do the trick I think
22:27.45pucko_that's what I usually put in the top of my jsp's which don't meddle with sessions
22:31.17*** join/#tomcat oxblood (n=vee@user-11219p2.dsl.mindspring.com)
22:41.22jasonbpucko_: Cool!  Thanks!
22:45.43*** join/#tomcat jsisson (n=sissonj@218.185.73.243)
23:22.24*** join/#tomcat mers (n=mers@217.22.177.194)
23:26.30oxbloodToo hot.
23:42.10*** join/#tomcat mers_ (n=mers@217.22.177.194)
23:54.28*** join/#tomcat sail_ (n=sail@66-188-131-145.dhcp.mdsn.wi.charter.com)

Generated by irclog2html.pl by Jeff Waugh - find it at freshmeat.net! Modified by Tim Riker to work with blootbot logs, split per channel, etc.