00:39.48 | *** join/#tomcat cvasilak (n=cvasilak@ppp6-6.adsl.forthnet.gr) |
00:49.16 | Gurraka | Is there a simple application to test DB? Like connect and read a couple rows? |
00:55.02 | dvayanu | silly you |
01:08.00 | *** join/#tomcat [[thufir]] (n=thufir@S01060016ec23af88.vs.shawcable.net) |
01:12.20 | *** join/#tomcat clajo04_ (n=clajo04_@cpe-67-243-136-111.nyc.res.rr.com) |
01:26.31 | deebo | slow tomcat? |
01:26.37 | deebo | tomcat in itself doesnt really do anything :) |
01:26.42 | deebo | its your app that is slow |
01:37.49 | Gurraka | Yeah, but would be nice if its possible to tweak whatever settings there is to make it as fast as possible |
02:01.48 | *** join/#tomcat MHSL (n=Linux@cm18.eta6.maxonline.com.sg) |
02:19.28 | Gurraka | Could using mysql-connector-java-3.1.6 cause slowdowns compared to latest 5.1? |
02:19.39 | Gurraka | Or is it more feature releases? |
02:38.13 | *** join/#tomcat harpoon (n=harpoon@p5082DED1.dip.t-dialin.net) |
03:06.42 | *** join/#tomcat bijoo_webdev (n=bijoo_we@c-98-204-54-131.hsd1.dc.comcast.net) |
03:45.25 | *** part/#tomcat bender183 (n=OWinNOW@unaffiliated/bender183) |
03:45.42 | *** join/#tomcat bender183 (n=OWinNOW@unaffiliated/bender183) |
03:47.10 | *** part/#tomcat bender183 (n=OWinNOW@unaffiliated/bender183) |
03:47.24 | *** join/#tomcat bender183 (n=OWinNOW@unaffiliated/bender183) |
04:49.26 | *** join/#tomcat acidjnk (i=acid@pD950814E.dip0.t-ipconnect.de) |
05:32.36 | *** join/#tomcat bindaas (n=chatzill@122.160.42.236) |
05:33.31 | *** join/#tomcat bindaas (n=chatzill@122.160.42.236) |
06:17.49 | *** join/#tomcat level3 (n=level3@89.31.88.219) |
08:17.21 | *** join/#tomcat vikumar (n=Vimal@nat/redhat-in/x-987b685c05035ae7) |
09:00.47 | *** join/#tomcat Gurraka (n=ASugg774@90-224-37-73-no61.tbcn.telia.com) |
09:31.38 | *** join/#tomcat keith__ (n=keith@c-98-232-29-19.hsd1.wa.comcast.net) |
09:49.33 | keith__ | Can someone please help me? I am having issues setting my classpath so I can use JDBC with Tomcat. I can get it to set correctly for my profile by editing .bashrc, but I cannot seem to set it system wide. I tried editing /etc/environment but that also didn't work. (Tomcat 6.0.18, Java 1.6.0_10, Ubuntu 8.10) |
10:07.51 | *** join/#tomcat loddafnir (n=mike@chello080108111137.5.11.univie.teleweb.at) |
10:11.07 | *** part/#tomcat level3 (n=level3@89.31.88.219) |
10:25.52 | *** join/#tomcat Aaronluke (n=Aaronluk@unaffiliated/aaronluke) |
10:43.06 | *** join/#tomcat Aaronluke (n=Aaronluk@unaffiliated/aaronluke) |
10:54.27 | *** part/#tomcat bender183 (n=OWinNOW@unaffiliated/bender183) |
11:10.40 | *** join/#tomcat kjkoster5489 (n=kjkoster@kjkoster.org) |
11:23.20 | *** join/#tomcat dvayanu (n=another@ppp-88-217-53-157.dynamic.mnet-online.de) |
11:32.03 | *** join/#tomcat hurra (n=hans@stargazer.st-peter.stw.uni-erlangen.de) |
11:43.26 | Gurraka | Try putting the jars in $CATALINA_HOME/lib |
11:47.53 | *** join/#tomcat bender183 (n=OWinNOW@unaffiliated/bender183) |
11:48.01 | Gurraka | I can now replicate what goes slow in my application, but is there a way I can debug to see what it does on a request? I got two sections, one of them is slow one is fast. |
11:48.21 | Gurraka | Maybe more a Java question. :) |
11:50.06 | kjkoster5489 | Garruka: what have you found so far? |
11:50.15 | bender183 | Gurraka: you want to see heap usage and gc and etc? |
11:50.38 | bender183 | cacti + java snmp + netsnmp |
11:50.51 | bender183 | proxy javasnmp to netsnmp |
11:51.02 | bender183 | or |
11:51.05 | bender183 | enable jmx |
11:51.13 | kjkoster5489 | jconsole, visualvm |
11:51.18 | kjkoster5489 | zabbix + zapcat |
11:51.20 | bender183 | and fire up jconsole |
11:51.39 | Gurraka | I can se heapusage and gc with java-monitor |
11:51.45 | bender183 | herm never heard of any of those |
11:51.58 | Gurraka | Its the same application |
11:52.05 | bender183 | ok |
11:52.19 | Gurraka | Running one same server, just that certain requests are slow and some are slow depending on what page you request. |
11:52.21 | *** part/#tomcat hurra (n=hans@stargazer.st-peter.stw.uni-erlangen.de) |
11:52.40 | Gurraka | Was thinking it would be an easy way to just follow each request |
11:53.00 | Gurraka | As it's server specific and not possible to replicate on localsystem. |
11:53.08 | kjkoster5489 | What can help is split the problem between Java and your (presumed) database. |
11:53.35 | bender183 | wow zabbix looks impressive |
11:53.37 | kjkoster5489 | ... using p6spy. |
11:53.43 | Gurraka | Yes, I integrated p6spy without any results |
11:54.16 | bender183 | thx for the heads up kind sir kjkoster5489 |
11:54.22 | Gurraka | On my localsystem that is, will add it to the live system later tonight. |
11:54.40 | kjkoster5489 | But you can't reproduce the problem locally anyway, you said. |
11:55.37 | kjkoster5489 | bender183: I use Zabbix for the machine-level monitoring of my infrastructure. Java-level stuff I use Java-monitor for, but if you want to use Zabbix for that too, you can use Zapcat to bridge JMX to Zabbix. |
11:55.43 | kjkoster5489 | oh |
11:55.46 | kjkoster5489 | heh |
11:55.59 | Gurraka | True - but as some content loads fine from database I thought it might be more application fault than db |
11:56.02 | *** join/#tomcat bender183 (n=OWinNOW@unaffiliated/bender183) |
11:56.05 | Gurraka | :) |
11:59.21 | Gurraka | Is there a way to integrate p6spy without tomcat restart? On localsystem, I had to add -Dp6.home to tomcat_opts |
12:02.25 | Gurraka | Ruled out DB as placing an empty .jsp also gives over a second when placing in webappdir |
12:08.41 | kjkoster5489 | bender183: I use Zabbix for the machine-level monitoring of my infrastructure. Java-level stuff I use Java-monitor for, but if you want to use Zabbix for that too, you can use Zapcat to bridge JMX to Zabbix. |
12:08.52 | kjkoster5489 | Zabbix is a resource hog, though. |
12:09.52 | kjkoster5489 | Garruka: if the data sources are defined entirely in the webapp and you have the driver in WEB-INF/lib you may get away with just a context redeploy. |
12:10.09 | kjkoster5489 | For that particular webapp it's just as bad as a restart, though. |
12:13.09 | Gurraka | Yeah, that would be fine. |
12:13.32 | Gurraka | But tried on my localsystem, no DB access is made on accessing a test.jsp file. |
12:13.48 | Gurraka | test.jsp only outputs a line of text and takes over a second to load if in webbapp dir |
12:14.02 | Gurraka | On an empty webapp dir, it loads in couple of ms |
12:14.56 | Gurraka | Must be a library thats taking time to process |
12:16.57 | kjkoster5489 | This is not the first hit on the JSP that you're timing, is it? |
12:17.02 | kjkoster5489 | They need to be compiled. |
12:19.53 | Gurraka | No, every reload |
12:20.07 | kjkoster5489 | Just checking. |
12:20.31 | Gurraka | I appreciate it, must have forgotten something really vital. |
12:20.54 | kjkoster5489 | Is that machine the one that runs on its marksweep GC and not the scavenge GC? |
12:21.01 | Gurraka | yes |
12:21.29 | kjkoster5489 | Well, your machine is bogged down in garbage collects, as I explained on Java-monitor. |
12:21.55 | kjkoster5489 | It has no time to deal with your pesky jsp's. |
12:21.57 | kjkoster5489 | ;) |
12:23.30 | Gurraka | But on same machine I can run the jsp in an empty webappdir and get response time of 29 ms |
12:24.16 | kjkoster5489 | So you have two tomcats or one? |
12:24.24 | Gurraka | One tomcat, different vhosts |
12:24.38 | kjkoster5489 | ... |
12:25.44 | kjkoster5489 | Does that 'slow' webapp have servlet filters in the web.xml? |
12:26.57 | Gurraka | Yes, a couple of them |
12:28.11 | kjkoster5489 | Does your test.jsp match with any of them? |
12:28.28 | Gurraka | Yes, they are global /* |
12:29.03 | kjkoster5489 | That explains your difference in speed. |
12:29.51 | Gurraka | Ye, but need to find out which of them is making it slow. |
12:29.53 | kjkoster5489 | Do any these filters cause database queries to be run? |
12:30.04 | Gurraka | Not according to p6spy in thelocal environemnt |
12:30.12 | Gurraka | Nothing is logged when loading the .jsp |
12:30.28 | kjkoster5489 | hmm. |
12:30.44 | Gurraka | Yeah, thats what I've been saying all morning. :) |
12:30.45 | kjkoster5489 | Other extrernal systems (ldap, web services) |
12:31.15 | Gurraka | no ldap, nothing should be external. |
12:31.40 | Gurraka | Can check traffic on load. |
12:31.46 | kjkoster5489 | file access? |
12:33.02 | Gurraka | Most likely some fileaccess, like logwriting |
12:33.54 | Gurraka | Put logging to minimal and still same speeds |
12:35.49 | kjkoster5489 | What is your -Xmx setting? |
12:36.23 | kjkoster5489 | If your system is running on marksweep and not scavenge, all other tuning is pointless: you have too little memory. |
12:41.21 | Gurraka | -server -Xms512M -Xmx4096M -XX:MaxPermSize=1024M -Djava.awt.headless=true |
12:42.24 | kjkoster5489 | When you posted on Java-monitor, was it with these settings? |
12:43.20 | Gurraka | Yes, all I added was -server |
12:43.31 | Gurraka | and headless=true |
12:44.34 | kjkoster5489 | So your tomcat ate all the 4G? |
12:44.45 | kjkoster5489 | That's a lot of memory. |
12:45.44 | Gurraka | But it doesnt show on logging like mrtg that its using alot of memory? |
12:46.18 | kjkoster5489 | What does Java-monitor say about memory use? |
12:46.27 | kjkoster5489 | heap memory |
12:50.02 | Gurraka | Last report said 20% heap, 43% non-heap, 0% fp |
12:50.05 | Gurraka | fds |
12:53.23 | kjkoster5489 | It only uses 20% of that 4G... |
12:53.36 | kjkoster5489 | Strange. Why does it still run on the marksweep gc? |
12:56.47 | Gurraka | Is that heapusage for just the application or overal for tomcat? |
12:58.19 | Gurraka | By the way, is there a donation page on java-monitor? |
12:58.58 | Gurraka | Could atleast buy you a couple beers for your help so far. :) |
13:10.53 | *** join/#tomcat trifon (n=chatzill@79-100-46-249.btc-net.bg) |
13:16.05 | *** join/#tomcat bindaas (n=chatzill@122.160.42.236) |
13:28.52 | dvayanu | hello guys |
13:37.28 | Gurraka | hey |
13:37.49 | Gurraka | Kjkoster: Found a reason to the high GC, its running System.gc() on each request. |
13:38.02 | Gurraka | Could that cause a bit slowness maybe? |
13:39.47 | dvayanu | oh mfg :-) |
13:39.54 | dvayanu | add -XX:disableEplicitGC |
13:40.02 | dvayanu | explicit |
13:40.22 | dvayanu | XX:+DisableExplicitGC |
13:40.44 | Gurraka | I tell you the same, not the author of that code line thou |
13:41.12 | Gurraka | Guess its not as noticable when running lower GC |
13:41.31 | Gurraka | I guess it takes longer to run a GC if XMX value is higher? |
13:41.41 | dvayanu | not necessary |
13:41.46 | dvayanu | it depends on spaces |
13:41.57 | Gurraka | Running multiple applications then? |
13:42.07 | dvayanu | it depends on the size of each space |
13:42.20 | dvayanu | running multiple applications? |
13:42.30 | Gurraka | Multiple sites that is |
13:42.40 | dvayanu | no, same tomcat instance |
13:42.49 | dvayanu | the memory settings are per hvm |
13:42.52 | dvayanu | jvm |
13:43.05 | dvayanu | what you should do is 1) disable explicit gc, its a really stupid idea |
13:43.18 | dvayanu | 2) set ms to the same value as mx |
13:43.36 | Gurraka | Would that disable any system.gc calls? |
13:43.48 | dvayanu | yes, the first option would disable all system.gc calls |
13:45.29 | Gurraka | Exactly what I need |
13:45.32 | Gurraka | Thanks |
13:45.51 | Gurraka | I guess I got some much needed headcutting when I get back to the office on monday. :) |
13:46.01 | dvayanu | but you should reallly really really considering setting same values in mx and ms |
13:46.12 | Gurraka | yeah, xmx and xms is set |
13:46.45 | Gurraka | -server -Xms512M -Xmx4096M -XX:MaxPermSize=1024M -Djava.awt.headless=true |
13:48.43 | dvayanu | nono |
13:48.48 | dvayanu | set them both to the SAME value |
13:48.53 | dvayanu | not two different values |
13:51.55 | *** join/#tomcat yassine (n=yassine@unaffiliated/yassine) |
13:52.16 | dvayanu | hey yassine |
13:52.48 | yassine | hey dvayanu |
14:18.58 | *** join/#tomcat trifon_ (n=chatzill@79-100-33-10.btc-net.bg) |
14:27.16 | *** join/#tomcat trifon__ (n=chatzill@79.100.217.144) |
14:40.15 | *** join/#tomcat lonel (i=r0ny@203.206.208.204) |
14:40.19 | lonel | hi |
14:40.28 | lonel | do i need to get JNDIRealm? |
14:40.39 | lonel | is it available as jar? |
14:47.41 | *** join/#tomcat nixblicker (n=nixblick@dslb-088-074-036-041.pools.arcor-ip.net) |
14:49.33 | *** join/#tomcat trifon (n=chatzill@79-100-36-125.btc-net.bg) |
14:55.18 | *** join/#tomcat trifon (n=chatzill@79.100.223.220) |
14:58.17 | *** join/#tomcat trifon_ (n=chatzill@79-100-47-213.btc-net.bg) |
15:11.33 | *** join/#tomcat trifon__ (n=chatzill@79-100-43-93.btc-net.bg) |
17:15.48 | *** join/#tomcat trifon_ (n=chatzill@79-100-176-231.btc-net.bg) |
17:25.48 | *** join/#tomcat trifon_ (n=chatzill@79-100-39-249.btc-net.bg) |
18:00.24 | *** join/#tomcat karstensrage (n=karstens@c-24-23-190-107.hsd1.ca.comcast.net) |
18:09.36 | *** join/#tomcat trifon (n=chatzill@79-100-178-226.btc-net.bg) |
18:11.48 | *** join/#tomcat tnek (n=chatzill@193.15.169.50) |
18:16.31 | tnek | I added a line in tomcat-users.xml to let me use the admin and manager applications. I kept the file as it was except from that. Should I change the passwords on the users tomcat, both and role1 to something else? What could someone do to my system if I don't? (my tomcat-users.xml http://pastebin.com/de0200ab ) |
18:21.06 | *** join/#tomcat kjkoster5489 (n=kjkoster@kjkoster.org) |
18:21.45 | kjkoster5489 | Garukka: Whaaaat!? |
18:25.53 | *** join/#tomcat trifon_ (n=chatzill@79-100-46-68.btc-net.bg) |
18:26.08 | kjkoster5489 | lonel: what problem do you want to solve? |
18:26.30 | lonel | kjkoster5489: thanks for asking |
18:26.35 | lonel | i resolved it |
18:26.42 | kjkoster5489 | Gurakka: I meant to 'Whaaat!?' at you. |
18:26.46 | kjkoster5489 | lonel: np |
18:26.50 | lonel | i was integrating ldap users with tomcat |
18:27.17 | kjkoster5489 | Good to hear it works. |
18:28.28 | lonel | yeah awesome |
18:37.14 | *** join/#tomcat keith80403 (n=keith804@71-208-237-158.hlrn.qwest.net) |
18:41.38 | *** join/#tomcat trifon_ (n=chatzill@79-100-35-6.btc-net.bg) |
18:53.11 | Gurraka | Kjkoster: Yeah, system.gc() was the badguy. Why we saw so many GCs |
18:53.53 | kjkoster5489 | Great catch. Was that your code? |
18:54.07 | Gurraka | Not mine, but one of our developers. |
18:54.42 | kjkoster5489 | I'd love to hear his reasoning. |
18:54.56 | kjkoster5489 | And see the test cases that demonstrate that this was the better implementation. |
18:55.05 | Gurraka | lol, don't think there is any reasoning behind it. |
18:56.02 | kjkoster5489 | Uhm. About that beer you spoke of. |
18:56.07 | Gurraka | Thanks for all your help thou. |
18:56.14 | kjkoster5489 | np |
18:56.29 | Gurraka | Yeah? you could use it for a new babybottle if you prefer that. :) |
18:56.37 | kjkoster5489 | I'm visiting all Java-monitor users that I can travel to from the Netherlands. |
18:57.04 | kjkoster5489 | I was wondering if you are withing a hundred km's or so from the Dutch border? |
18:57.42 | kjkoster5489 | My kid uses beer bottles to put lego-men into. |
18:57.51 | Gurraka | I think its a bit further than that, Sweden here. |
18:57.52 | Gurraka | lol |
18:58.15 | Gurraka | Aren't you afraid he would cut himself? |
18:58.30 | Gurraka | Not intenionally ofcourse, but by accident |
18:59.47 | kjkoster5489 | Well, Sweden should be doable, if you are in the south somewhere. |
19:00.00 | kjkoster5489 | A little cut won't hurt him. |
19:00.50 | kjkoster5489 | I don't have a donation page for Java-monitor. Thanks for the offer. |
19:01.06 | kjkoster5489 | I donate to PJ from Groklaw every year, if you know who that is. |
19:01.12 | kjkoster5489 | She needs the money more than I do. |
19:01.43 | kjkoster5489 | What would really help me, would be for you to respond to the thread on Java-monitor and tell everyone the solution you found. |
19:04.15 | Gurraka | Yeah, I will. |
19:04.29 | Gurraka | I like the inpuit I got there so far, I'll keep an eye on it. |
19:04.41 | kjkoster5489 | That, and demonstrate Java-monitor to everyone you meet. :-) |
19:04.46 | kjkoster5489 | Thanks for the compliment. |
19:04.48 | Gurraka | PJ from Groklaw? |
19:05.02 | kjkoster5489 | She covers the SCO vs IMB trials. |
19:05.11 | kjkoster5489 | http://www.groklaw.net/ |
19:06.06 | kjkoster5489 | IBM I mean |
19:06.07 | kjkoster5489 | She is building an archive of all the trial documents, plus commenting (read: translating) on them. |
19:07.16 | Gurraka | Nice, not heard of it |
19:07.37 | kjkoster5489 | Don't worry about that, not many people have. |
19:08.17 | kjkoster5489 | She has built a strong community around her and is more or less signlehandedly cementing a legal foundation for GPL and Linux and OSS in general. |
19:09.11 | kjkoster5489 | Just one last question: was System.gc() on the JSP pages, or in the webapp's code itself? |
19:09.15 | kjkoster5489 | How did you find it? |
19:11.56 | Gurraka | It was in the webbapp, in the class handling URLRewrites |
19:13.14 | kjkoster5489 | One of the servlet filter classes? |
19:13.31 | Gurraka | Yes, the main one |
19:14.18 | Gurraka | It called a method to clean a bufferlog, and in the same method it sent System.GC() |
19:14.41 | kjkoster5489 | Is the code using weak references? |
19:15.35 | Gurraka | Not sure what that is, sorry. Just a lowlevel javaprogrammer |
19:17.23 | kjkoster5489 | e.g. http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ref/WeakReference.html |
19:17.49 | kjkoster5489 | Basically it is a way to reference objects without preventing the GC to collect it. Makes for efficient caches if used well. |
19:18.23 | kjkoster5489 | When I see them used, the programmers usually also start using System.gc() to steer the behaviour of the references. |
19:18.39 | Gurraka | No, nothing in the method atleast |
19:18.43 | kjkoster5489 | They are a sign of a junior programmer trying to be clever. |
19:18.49 | kjkoster5489 | Just checking. :) |
19:19.21 | Gurraka | Thanks. :) Better to find more bugs while at it... :D |
19:19.53 | Gurraka | Also did a projectsearch for gc() and its the only reference to it |
19:19.54 | kjkoster5489 | Have you changed the system yet to remove the gc() calls, or do you have to wait until Monday? |
19:20.29 | kjkoster5489 | I am curious how much the performance improved for you. |
19:20.47 | kjkoster5489 | Your case makes nice textbook material. :) |
19:20.56 | kjkoster5489 | brb |
19:21.33 | Gurraka | I did it for a testproject and already seen very good performance |
19:21.42 | Gurraka | From 1.7 seconds to 87 ms. :) |
19:21.54 | Gurraka | Just by commenting one row |
19:23.19 | Gurraka | If I put on a normal load it went up to 7-8s |
19:23.50 | Gurraka | Will do another performance test tomorrow. :) |
19:29.18 | kjkoster5489 | Impressive. |
19:29.38 | kjkoster5489 | Let us know what your next bottleneck is. ;-) |
19:31.13 | Gurraka | lol |
19:31.41 | Gurraka | Can't see how noone of the core programmers not seen it |
19:38.26 | *** join/#tomcat trifon_ (n=chatzill@77-85-191-182.btc-net.bg) |
19:40.04 | *** join/#tomcat bizboo (n=bizboo@meu77-1-82-241-107-111.fbx.proxad.net) |
19:40.49 | *** join/#tomcat keith__ (n=keith@c-98-232-29-19.hsd1.wa.comcast.net) |
19:42.14 | keith__ | Can someone please help me with this error I am receiving: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver. I think all I should need to do is set the CLASSPATH correctly, but I nothing I try seems to fix the problem. (Tomcat 6.0.18, Java 1.6.0_10, Ubuntu 8.10) |
19:43.12 | kjkoster5489 | keith__: where have you entered the JDBC url? In what file? |
19:43.40 | keith__ | kjkoster5489: I have a short scriptlet in index.jsp, is that what you are asking? |
19:44.04 | kjkoster5489 | Ok. So you have not defined in a context xml file? |
19:44.35 | keith__ | kjkoster5489: No... |
19:44.45 | kjkoster5489 | Cool. |
19:45.03 | kjkoster5489 | Where have you placed the mysql JDBC driver JAR file? |
19:46.02 | keith__ | kjkoster5489: I installed it form the ubuntu repository. It is located in /usr/share/java/mysql.jar. |
19:46.26 | kjkoster5489 | You should not use the ubuntu repo for that. |
19:46.37 | keith__ | kjkoster5489: oh? Why is that? |
19:46.48 | kjkoster5489 | Just download it and place it in your WEB-INF/lib filder. |
19:47.23 | kjkoster5489 | Well, in the Java domain, the repackaging that goes on in the various distro's tend to randomly move stuff around and give it new names. |
19:47.43 | kjkoster5489 | That makes it really hard for me (FreeBSD guy) to help you (Ubuntu guy). |
19:48.03 | kjkoster5489 | So, I stick to the files as they are distributed. |
19:48.14 | keith__ | kjkoster5489: Well, if it helps... JDBC works just fine from a .java file when I have the CLASSPATH set correctly. |
19:48.17 | kjkoster5489 | The repackaged ones are for experienced admins. |
19:48.32 | kjkoster5489 | I know, but classpaths are really different for Tomcat serrvers. |
19:49.09 | keith__ | kjkoster5489: OK. I thought about trying what you said, but it annoyed me that I couldn't figure out the classpath way. Guess I like a challenge. :) |
19:49.27 | keith__ | kjkoster5489: Let me copy it over and try it now though |
19:49.51 | kjkoster5489 | Cool. |
19:50.21 | keith__ | kjkoster5489: Is there a recommended link for the JDBC? Or should I just google it? |
19:50.47 | keith__ | kjkoster5489: dumb question, SUN's site, right? |
19:51.23 | kjkoster5489 | JDBC API is in Java, so you already have it. You just need a driver from mysql. |
19:51.23 | keith__ | kjkoster5489: Actually, it isn't sun, is it? *sigh* |
19:51.42 | keith__ | kjkoster5489: so the mysql site? |
19:51.47 | kjkoster5489 | Java is Open Source. |
19:51.54 | kjkoster5489 | Google: download mysql driver. :-) |
19:52.44 | kjkoster5489 | Here is some discussion on repackaging: http://java-monitor.com/forum/showthread.php?t=4 |
19:52.58 | kjkoster5489 | And here http://java-monitor.com/forum/showthread.php?t=33 |
19:54.25 | *** join/#tomcat bindaas (n=chatzill@122.160.42.236) |
19:55.11 | keith__ | kjkoster5489: Do I want to ignore the "myodbc-installer"? |
19:55.21 | kjkoster5489 | Are you using an installer? |
19:55.58 | keith__ | kjkoster5489: I just downloaded the tarball from the mysql site, it has a bin and a lib folder inside |
19:56.27 | kjkoster5489 | Something like mysql-connector-*.jar is what you need. |
19:56.56 | keith__ | kjkoster5489: Nothing like that... (would the installer create that file?) |
19:56.58 | kjkoster5489 | I use mysql-connector-java-5.1.5-bin.jar |
19:58.37 | kjkoster5489 | You didn't download the ODBC driver, did you? |
19:59.04 | kjkoster5489 | You can also copy over your /usr/share/java/mysql.jar over. |
19:59.22 | keith__ | kjkoster5489: That might be easier... |
19:59.35 | keith__ | kjkoster5489: and yes, I did download the ODBC driver... |
20:00.21 | keith__ | kjkoster5489: Didn't notice that, I have the right on now |
20:00.24 | kjkoster5489 | http://dev.mysql.com/downloads/connector/j/5.1.html in case you change your mind. |
20:05.34 | keith__ | kjkoster5489: So I should put it in /var/lib/tomcat6/webapps/ROOT/WEB-INF/lib? or/var/lib/tomcat6/lib? |
20:07.53 | kjkoster5489 | Depends where you configured the databsource. |
20:07.59 | kjkoster5489 | Hence my qustion earlier. |
20:08.25 | kjkoster5489 | Put it into your WEB-INF/lib for now, and move it to tomcat/lib once you start using context xml files. |
20:08.53 | keith__ | kjkoster5489: Ah... there we go... different error this time. com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure. Does this mean it is seeing the driver correctly? |
20:09.03 | kjkoster5489 | Yes. |
20:09.38 | kjkoster5489 | What is the host your configured and can you connect to it from the tomcat machine on port 3306? |
20:10.09 | keith__ | kjkoster5489: I don't understand the question |
20:10.19 | kjkoster5489 | This is a network connection error. |
20:10.31 | kjkoster5489 | You entered a JDBC url that has a host name in it. |
20:10.47 | keith__ | kjkoster5489: I am running it on localhost |
20:10.49 | kjkoster5489 | Or MySQL is not accepting remote connections. |
20:10.59 | kjkoster5489 | 'remote' being networked. |
20:11.03 | kjkoster5489 | Is MYSQL running? |
20:11.21 | keith__ | kjkoster5489: yes |
20:12.02 | *** join/#tomcat wltjr (n=wltjr@unaffiliated/wltjr) |
20:16.16 | *** join/#tomcat trifon (n=chatzill@77-85-190-16.btc-net.bg) |
20:17.56 | keith__ | kjkoster5489: Any thoughts on why a connection isn't being made? |
20:18.04 | kjkoster5489 | Firewall? |
20:18.16 | kjkoster5489 | MySQL not accepting network connections? |
20:18.37 | kjkoster5489 | Please pastebin the full error stacktrace. |
20:18.44 | keith__ | kjkoster5489: On localhost? And as I said, my java file connects to the database fine |
20:18.48 | keith__ | kjkoster5489: ok |
20:18.55 | kjkoster5489 | good point. |
20:20.25 | keith__ | kjkoster5489: This is interesting... :) |
20:20.27 | keith__ | kjkoster5489: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:3306 connect,resolve) |
20:21.21 | kjkoster5489 | Hahaha, I love repackaged tomcats. |
20:21.26 | kjkoster5489 | Hang on... |
20:21.57 | kjkoster5489 | http://java-monitor.com/forum/showthread.php?t=134 |
20:21.59 | kjkoster5489 | To see. |
20:22.12 | kjkoster5489 | Or just download a normal Tomcat from Apache.org |
20:22.32 | keith__ | kjkoster5489: So this is happening because of the repackaging? |
20:22.58 | kjkoster5489 | Someone secured the Tomcat that you downloaded. |
20:23.12 | keith__ | kjkoster5489: Is that good or bad? lol |
20:23.13 | kjkoster5489 | For experts that is useful. For normal people, that is confusing. |
20:23.24 | kjkoster5489 | :-) |
20:23.48 | keith__ | kjkoster5489: I probably should learn how to use the security manager at some point, eh? |
20:24.11 | kjkoster5489 | The thread on Java-monitor will help you onto that route. |
20:24.42 | keith__ | kjkoster5489: Do you know of a good Tomcat tutorial? or are the tomcat docs the best resource? |
20:25.12 | kjkoster5489 | The security manager is a Java thing, so stick with the Sun docs. |
20:25.26 | kjkoster5489 | http://java.sun.com/j2se/1.5.0/docs/guide/security/PolicyFiles.html |
20:26.59 | keith__ | Oh... but Tomcat implements the Java Security Manager where normal java code wouldn't, right? |
20:27.17 | kjkoster5489 | The *ubuntu* repackaged tomcat does. |
20:27.30 | kjkoster5489 | Let's lay blame in the right place. :) |
20:27.35 | keith__ | kjkoster5489: Right. lol |
20:27.47 | keith__ | kjkoster5489: Is it some sort of add on module for tomcat? |
20:27.49 | kjkoster5489 | :-) |
20:28.45 | kjkoster5489 | No, the security manager is a standard part of Java. |
20:29.00 | kjkoster5489 | Your browser uses it to lock down applets. |
20:29.38 | keith__ | Ah... so normal java code running in the terminal would not be affected, but the browser uses it to protect you from malicious scripts? |
20:29.41 | kjkoster5489 | Ubuntu's tomcat just enabled it where most Java apps do not enable it. |
20:29.55 | kjkoster5489 | Right. Same security manager. |
20:30.04 | kjkoster5489 | It is really a cool tool. |
20:30.50 | keith__ | kjkoster5489: I hate trying to learn too many things at once. It is never possible to learn just one thing at a time, is it? lol |
20:31.06 | kjkoster5489 | Especially when you are dealing with Java. |
20:31.33 | keith__ | kjkoster5489: I am getting further and further away from my goal of learning jsp. :-D |
20:31.36 | kjkoster5489 | If you do not want to invest the time, use the tomcat from Apache.org. That is the reference for me too. |
20:34.56 | keith__ | kjkoster5489: Who exactly does the security manager protect? The person visiting the page? |
20:35.21 | keith__ | kjkoster5489: Or the server? |
20:35.42 | kjkoster5489 | It sandboxes the Tomcat so that if someone manages to take control of Tomcat, he can only do what the app could do already. |
20:35.52 | kjkoster5489 | So it protectes the OS and the server. |
20:36.06 | kjkoster5489 | Think of a webapp as a bizarre applet. :) |
20:36.16 | keith__ | kjkoster5489: gotcha, haha. |
20:36.39 | kjkoster5489 | It is used by JSP hostign companies to lock down what you can and cannot do in your JSP. |
20:37.00 | kjkoster5489 | You, as a developer can use it to avoid opening the wrong files and sockets. |
20:37.11 | keith__ | kjkoster5489: Makes sense |
20:38.12 | keith__ | kjkoster5489: What does the admin package for tomcat let you do? |
20:38.21 | *** join/#tomcat Atanasov (i=Atanasov@dslb-088-064-090-196.pools.arcor-ip.net) |
20:38.47 | kjkoster5489 | I'm not sure. I delete all webapps when I unpack a new Tomat. |
20:39.06 | keith__ | kjkoster5489: I installed it from the repo, but I am not sure what it does. :) |
20:39.21 | keith__ | kjkoster5489: or where it even installed for that matter |
20:39.40 | Atanasov | hello tomcat gurus, geetz from Munich :) |
20:39.44 | kjkoster5489 | No idea. I never use repackaged Tomcats. |
20:39.51 | kjkoster5489 | Hello Atanasov |
20:40.06 | keith__ | kjkoster5489: Do you set up your own security? or is that not an issue for you? |
20:40.49 | kjkoster5489 | My Tomcat servers do not use a security manager. I delete unused webapps and connectors and firewall of unused ports that remain (8005). |
20:41.21 | kjkoster5489 | For larger setups, they end up behind Apache anyway, so then there is no way to get at my Tomcats anyway. |
20:41.36 | kjkoster5489 | I still plan to start using the security manager. |
20:41.42 | kjkoster5489 | someday... |
20:42.00 | keith__ | kjkoster5489: Behind apache? |
20:42.13 | kjkoster5489 | Apache httpd. |
20:42.30 | keith__ | kjkoster5489: Oh, is tomcat is not a full web server? |
20:42.37 | kjkoster5489 | Yes, it is. |
20:42.42 | jasonb | keith__: It is. |
20:42.55 | kjkoster5489 | It does not do php out of the box and I need PHP as well as JSP. |
20:43.16 | kjkoster5489 | I could use the PHP servlet, but I am happy with Apache and Tomcat together. |
20:43.43 | keith__ | ah, ok... interesting |
20:43.45 | keith__ | do I want to edit /conf/policy.d/04.webapps.policy? |
20:44.09 | kjkoster5489 | That's nonstandard. |
20:44.13 | kjkoster5489 | You tell me. :-) |
20:44.29 | jasonb | Running Tomcat behind Apache httpd results in a loss of about half or more of your Tomcat's performance. |
20:44.51 | keith__ | kjkoster5489: Let me guess, that structure is a debian thing too? :p |
20:45.10 | jasonb | keith__: Why do you believe you need to use the Java security manager? |
20:45.23 | keith__ | jasonb: Because I am locked down. :-D |
20:45.33 | kjkoster5489 | jasonb: I know, I know. |
20:45.40 | kjkoster5489 | Someday.maybe. |
20:46.07 | keith__ | jasonb: I am running tomcat from the repositories, and I am thinking it would be better for now to just download it from apache |
20:47.07 | jasonb | Your site can perform much better if Tomcat is the first-contact web server, proxying some requests to Apache httpd (for PHP) than if you set up the reverse configuration where Apache httpd is the first contact web server and proxies most requests to Tomcat. |
20:47.11 | keith__ | kjkoster5489: Why do you need jsp and php? Can't jsp do everything php can do? |
20:48.07 | jasonb | keith__: Probably it would be better to download it from Apache. OR, download my RPM package and run that, which is effectively the from-Apache official release binaries integrated with a very well working Linux init script. |
20:48.16 | kjkoster5489 | I run a PHP-based forum (java-monitor.com) that has some custom code in it for the monitoring tool. I am a Java dude, so I have not written the monitoring part in PHP. |
20:48.31 | kjkoster5489 | It sounds messier than it is. |
20:48.50 | keith__ | kjkoster5489: Oh, that forum is yours? |
20:48.55 | kjkoster5489 | Yes, it is. |
20:49.09 | keith__ | kjkoster5489: That explains why you seem partial to it... :D |
20:49.14 | kjkoster5489 | I'm trying to build a community there. |
20:49.37 | keith__ | kjkoster5489: What type of community? |
20:49.48 | kjkoster5489 | *shrug* I know I'm basically spamming this channel, but I believe that I help enough people to offset the bother. |
20:50.09 | kjkoster5489 | People running Java in production. The administrative side of Java. |
20:50.37 | kjkoster5489 | Admins who have to deal with Tomcat or JBoss. Developers who are also doing clean deployments. |
20:51.01 | keith__ | kjkoster5489: Ah, nifty |
20:51.35 | keith__ | kjkoster5489: Thanks for your help, btw |
20:51.42 | kjkoster5489 | Plus, I find it convenient to not have to repeat myself, so I post my help on Java-monitor and past the URLs into my IRC client when a question comes up again. |
20:51.44 | kjkoster5489 | np |
20:52.12 | kjkoster5489 | Helping eachother seems to set the engineers apart from a lot of other types of people. ;) |
20:52.16 | keith__ | It will take me a few mins to install tomcat from apache I am sure, but I think it will work once I do |
20:52.36 | keith__ | I always look forward to the day I know enough to help people... ;-D |
20:53.26 | kjkoster5489 | It's the easiest way to learn new stuff. |
20:54.43 | keith__ | Core vs. Deployer... ? |
20:55.08 | jasonb | keith__: It's fun. But, the sad part is: after you spend literally years finding the not-so-intuitive solutions for things, and then you literally give away the answer to people, then they don't believe you and refuse to take advantage of the solution. :( |
20:55.32 | kjkoster5489 | Core. |
20:55.35 | keith__ | jasonb: Yeah, that would be annoying |
20:55.53 | jasonb | keith__: That's actually the most common outcome, sadly. |
20:55.59 | kjkoster5489 | jasonb: charge more. |
20:56.46 | keith__ | jasonb: Have you used gparted? |
20:56.51 | jasonb | kjkoster5489: In the OSS community, everyone seems to want to painfully figure everything out for themselves, and don't want to pay for the answer, when a moderately priced solution would actually be less costly than all their time they'd spend on finding the same answer. heh! |
20:56.57 | jasonb | keith__: Of course. |
20:57.21 | keith__ | jasonb: Just checking, I recommended it to someone this morning to format a flash drive |
20:57.46 | jasonb | keith__: gparted is one of those almost hidden gems of OSS. |
20:57.47 | keith__ | jasonb: They said, oh... I have never used that, I'll try it in Windows first and use that as a last resort. lol |
20:57.55 | jasonb | heh.. See?! |
20:58.16 | keith__ | It isn't exactly rocket science to figure out. :p |
20:58.16 | jasonb | also uses System Rescue CD. |
20:58.41 | keith__ | They apparently wanted a simple one liner for the terminal |
20:59.02 | keith__ | That just seems more complicated |
20:59.18 | keith__ | especially for someone who doesn't seem to know much about Ubuntu |
20:59.20 | keith__ | :D |
21:00.08 | jasonb | uses Fedora. |
21:00.20 | keith__ | jasonb: same general principle though |
21:00.26 | jasonb | Sure. |
21:01.20 | keith__ | I usually follow advice, though I do like to understand the advice. :-D |
21:02.24 | keith__ | For example, if kjkoster5489 had just told me to download Tomcat from Apache and it would fix my problem, I might have been skeptical without understanding why. :D |
21:03.10 | keith__ | On that note... |
21:03.20 | keith__ | kjkoster5489: Why Core? What is the Deployer? |
21:03.26 | keith__ | :) |
21:05.28 | kjkoster5489 | Dunno, I always use Core. |
21:05.36 | kjkoster5489 | :-) |
21:06.53 | jasonb | Core = the core of Tomcat.. the servlet container + web server itself. |
21:07.10 | jasonb | Deployer = an Ant-based webapp deployer (stand-alone).. you don't really need it. |
21:07.32 | keith__ | Is it more for larger scale production environments? |
21:07.42 | jasonb | "it"? |
21:07.49 | keith__ | the Deployer |
21:08.00 | jasonb | Not necessarily. |
21:08.35 | jasonb | IMHO, it's for people who really want to use Ant to do automated deployments, and need a good code example to either look at or incorporate into their existing Ant build file(s). |
21:09.04 | keith__ | ah, gotcha |
21:11.34 | keith__ | So, is /var/lib/tomcat6 the "standard" path? or is that a Debian/Ubuntu thing too? |
21:15.14 | kjkoster5489 | ubunti |
21:15.38 | kjkoster5489 | The standard layout is what your find in the zip, and you are free to put it where you like. |
21:16.04 | keith__ | I know, but I can never decide where to put things, lol. |
21:16.16 | kjkoster5489 | I use the home dir of the Tomcat user, others use /opt or /usr/local. |
21:16.46 | keith__ | The tomcat user doesn't have a home directory... :D |
21:16.51 | keith__ | not for me, that is |
21:17.48 | keith__ | What is the deal with /opt? Why do some programs install there? Shouldn't most programs be in /usr? |
21:18.02 | keith__ | or /var in the case of web servers? |
21:21.09 | kjkoster5489 | I think solaris uses /opt by default. |
21:21.14 | kjkoster5489 | *shurg* |
21:21.57 | keith__ | I think Ubuntu uses /opt for installing eclipse... I just thought there was supposed to be a convention and I can never understand it. lol |
21:23.13 | kjkoster5489 | I just follow my own conventions on my own machines, and the admin's conventions on other people's boxes. |
21:29.30 | *** join/#tomcat trifon_ (n=chatzill@77-85-191-219.btc-net.bg) |
21:34.19 | kjkoster5489 | 'night all |
21:57.23 | *** join/#tomcat geaaru (n=geaaru@host230-209-dynamic.50-79-r.retail.telecomitalia.it) |
21:57.58 | geaaru | <PROTECTED> |
21:58.11 | geaaru | servlet is instantiated 2 time and so for any HTTP request servlet is called two time |
21:58.13 | geaaru | why? |
22:54.17 | *** join/#tomcat bender183 (i=politico@unaffiliated/bender183) |
22:58.47 | *** join/#tomcat bender183 (i=politico@unaffiliated/bender183) |
23:00.39 | *** part/#tomcat bender183 (i=politico@unaffiliated/bender183) |
23:00.54 | *** join/#tomcat bender183 (n=OWinNOW@unaffiliated/bender183) |
23:44.34 | *** join/#tomcat localt (n=chatzill@c-98-221-250-160.hsd1.nj.comcast.net) |
23:46.54 | localt | Hello, I'm using Tomcat 6.0.18 & Java 1.6.0.7. I'm trying to have the following logic: JSP page with a form, posted and handled by a source servlet (not JSP). I want to response to be a popup message (I.E "completed") and to go back to another JSP (like Home.jsp). The form is posted via AJAX. How can this be done? |