Re: tomcat won't download large files -- out of memory error
DIGLLOYD INC wrote: I came across the following: -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true at this page: http://hillert.blogspot.com/2008/05/if-tomcat-is-running-out-of-memory.html I haven't tried it yet, and I don't know what it does (limits something apparently). Anyone know? Jasper is Tomcat's JSP component, so it's unlikely to have any bearing on your problem if your files are static and are not generated by JSP processing/files. What are your java memory settings and how are you setting them? p Lloyd On Sep 25, 2008, at 10:01 PM, DIGLLOYD INC wrote: I have some large zip files I want to make available for download. When I try to download a 70MB file, tomcat is trying to cache these huge files (it seems). The result is that downloading them always fails. I *want* caching for most everything eg jpegs, html, etc and I've set tomcat to use up to 1.5GB of memory. Is there a way to limit the size of the file that will be cached? It's regrettable that failure to cache a file can't gracefully degrade into just not caching it. Sep 25, 2008 9:50:17 PM org.apache.catalina.connector.CoyoteAdapter service SEVERE: An exception or error occurred in the container during the request processing java.lang.OutOfMemoryError: Java heap space at org.apache.naming.resources.ProxyDirContext.cacheLoad(ProxyDirContext.java:1571) at org.apache.naming.resources.ProxyDirContext.cacheLookup(ProxyDirContext.java:1449) at org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:283) at org.apache.tomcat.util.http.mapper.Mapper.internalMapWrapper(Mapper.java:782) at org.apache.tomcat.util.http.mapper.Mapper.internalMap(Mapper.java:626) at org.apache.tomcat.util.http.mapper.Mapper.map(Mapper.java:516) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:444) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:284) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:613) Lloyd Chambers http://diglloyd.com [Mac OS X 10.5.2 Intel, Tomcat 6.0.16] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat with LDAP - admin part authentication
yann bizouerne wrote: Hi, I have installed tomcat 6 on our Lunix server. I have configure it in order to use LDAP authentication for our application and it is working fine. My concern is about the admin part of the tomcat server. Now the tomcat-users.xml seems not used anymore for the admin,manager part. I have tried my LDAP login,password but it doesn't work for that part of the server. Does somebody have a clue how I can now go in the admin part of the tomcat server ? Thanks in advance Yann server.xlm Realm className=org.apache.catalina.realm.JNDIRealm connectionURL=ldaps://myLap.kernel.net:636 userPattern=uid={0},ou=People,dc=project roleBase=ou=tomcatgroups,dc=project roleName=cn roleSearch=(uniqueMember={0}) / #cat tomcat.ldif dn: uid=tomcat,ou=People,dc=project objectClass: inetOrgPerson uid: tomcat sn: app cn: Tomcat manager userPassword: test # cat roles.ldif dn: cn=tomcat,ou=tomcatgroups,dc=project objectClass: groupOfUniqueNames cn: tomcat uniqueMember: uid=tomcat,ou=People,dc=project dn: cn=manager,ou=tomcatgroups,dc=project objectClass: groupOfUniqueNames cn: manager uniqueMember: uid=tomcat,ou=People,dc=project uniqueMember: uid=tommy,ou=People,dc=project #cat tomcatgroups.ldif dn: ou=tomcatgroups,dc=project objectClass: organizationalUnit ou: tomcatgroups something like this http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#JNDIRealm Alex - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat manager 'list' command - why does it return html markup
sk1ds wrote: Hi all probably a silly question from a newbie but... According to the doco http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Introduction HERE I says I should be able to use the Manager web application using A minimal version using HTTP requests only which is suitable for use by scripts setup by system administrators. Commands are given as part of the request URI, and responses are in the form of simple text that can be easily parsed and processed. However, when using wget or curl from a command line shell under redhat it returns it with HTML markup. Any ideas what I am doing wrong ? What's the URL you are accessing with wget / curl, and what's the result? Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT obviously] Re: Some Prilim questions
Martin Gainty wrote: no no no.. he was NOT talking about LDAP but a DB connection the statement stands even with a 'local TC reference' you STILL have to contact the server ! there exists a company which sells server services for this very reason (if the op desires to know i will pass this on) dont you have something/anything thats more constructive with your time Dumbkopf! (May I Chris? Thank you in advance.) So, Martin, (can I call you Al? I prefer Al - like the song), I'm interested to know how you'll respond to this query. I've carefully re-read this thread from the beginning to the point where you responded with the following: the referenced jndi lookup in the webapp context is located in India and the DB is in Ithaca NY the Indian JNDI lookup is considerably slower than 'ordinary JDBC connection' from NY ... and I'm wondering whether you had some off list conversation with karthikn (the OP). Because I can't really see any way you could deduce that the DB is in Ithaca. Or in fact that the JNDI context is in India. (Well, apart from the distinct possibility that the OP is in the Indian subcontinent.) Al, your answer is utterly irrelevant - the correct answers being: 1. A JNDI connection pool is measurably faster 2. Return the connection to the pool in most cases, subject to the implementation of the driver. - so I am puzzling over the word Ithaca. I suspect that it's a riddle, but I'm not making a great deal of progress, Al. Can you help? Ithaca, I know - as I studied the classics for a while, is the home of Odysseus. Is this a Homerian reference I wondered? And yet, Al, you mention NY. And India! So I searched Google... Of course! The only result that mentions Ithaca NY and India in its title is: Bikram's Yoga College of India - Ithaca, NY, 14850 - Citysearch And there we have it, Al - you're a genius! 14850! But what is the meaning of 14850?! Is it www.14850.com? Public Communications, Inc's website! We're on a public mailing list, this must be it! But no... wait... There's another possibility, ISO:14850! What's this? ISO 14850:2004 describes a procedure for measurements of gamma-emitting radionuclide activity in homogeneous objects such as unconditioned waste (including process waste, dismantling waste, etc.), waste conditioned in various matrices (bitumen, hydraulic binder, thermosetting resins, etc.), notably in the form of 100 L, 200 L, 400 L or 800 L drums, and test specimens or samples, (vitrified waste), and waste packaged in a container, notably technological waste. It also specifies the calibration of the gamma spectrometry chain. The gamma energies used generally range from 0,05 MeV to 3 MeV. Al, I'm disturbed by this. India *is* a nuclear power, and this *is* a public standard, but I think we're moving into dangerous territory here. What are you getting at I wondered? Is there a deeper message regarding nuclear power for OP to take back to his people? A little more googling led me to Tarapur, where there's a nuclear waste disposal and storage facility that, yes!, uses *vitrification*. (I paused here, as I was thirsty and the second bottle was now empty.) Tarapur, Al, Tarapur. What are you trying to tell us, I mused. Wikipedia has 5 references for places called Tarapur, in these states Maharashtra - the nuke plant, Gujarat Bihar - otherwise unremarkable. Madhya Pradesh - is one of the best known centres for very unusual and attractive bandanas! Could this be it!? Karthik, Chris, David, I nearly shouted out loud! *BANDANAS* It was so obvious to me now, I was amazed that I hadn't seen it straight away! But then Al, I idly flicked the back button, to check the last link... Tarapur, Orissa. Three stupas (edicts), put up by Emperor Asoka, have been discovered at Tarapur recently. I was stunned Al. * Ashoka the Great * It crystallised in my mind quickly as the breadth of your vision appeared. ** Ashoka the Great ** He who regards everyone amiably I knew Al, from my classical studies, that Ashoka The Great was a Hindu by birth but later converted to Buddhism after the battle of Kalinga. He subsequently declared in his edicts: “There is no country, except among the Greeks, where these two groups, Brahmans and ascetics, are not found, and there is no country where people are not devoted to one or another religion. The GREEKS! ITHACA! This reference confirmed I had arrived in the right place! Your message is revealed Al, as a message of peace and understanding, for Ashoka is famous for his message of freedom, tolerance, and equality. I was worn out from my exertions, but gloriously sated as I collapsed into a drunken stupor. Peace, Al, Peace. pid * or Alice, I don't mind, Al. Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and
Re: tomcat won't download large files -- out of memory error
- Original Message - From: DIGLLOYD INC [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Friday, September 26, 2008 7:01 AM Subject: tomcat won't download large files -- out of memory error I have some large zip files I want to make available for download. When I try to download a 70MB file, tomcat is trying to cache these huge files (it seems). The result is that downloading them always fails. I *want* caching for most everything eg jpegs, html, etc and I've set tomcat to use up to 1.5GB of memory. Is there a way to limit the size of the file that will be cached? It's regrettable that failure to cache a file can't gracefully degrade into just not caching it. Sep 25, 2008 9:50:17 PM org.apache.catalina.connector.CoyoteAdapter service SEVERE: An exception or error occurred in the container during the request processing java.lang.OutOfMemoryError: Java heap space at org .apache .naming.resources.ProxyDirContext.cacheLoad(ProxyDirContext.java:1571) at org .apache .naming.resources.ProxyDirContext.cacheLookup(ProxyDirContext.java:1449) at org .apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java: 283) at org .apache.tomcat.util.http.mapper.Mapper.internalMapWrapper(Mapper.java: 782) at org.apache.tomcat.util.http.mapper.Mapper.internalMap(Mapper.java: 626) at org.apache.tomcat.util.http.mapper.Mapper.map(Mapper.java:516) at org .apache .catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java: 444) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: 284) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 844) at org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java: 447) at java.lang.Thread.run(Thread.java:613) Lloyd Chambers http://diglloyd.com [Mac OS X 10.5.2 Intel, Tomcat 6.0.16] Lloyd... dont know, its definitely running out of mem, but I'm not sure its because of a 70 meg file... The default static cache size is 10 megs, so its doubtful that TC is caching that file... We run video content on the Lan and some of that stuff is 700 megs on standard settings... out of the box settings. We are still running TC 5.5.25 in production... I dont know the MAC, but its possible that its just not setting enough memory... I guess the MAC has its own TC and its own JRE... so I have no idea how you monitor stuff, or what the defaults are. If it does have the later Sun JRE VisualVM tool... thats a nice way to watch what your TC is doing. Is it been served by tomcats default servlet or from a custom servlet... if the later the coder may infact be sticking it all on the heap, very likely it will break then. The default servlet in TC is smarter than that... I dont think a 70 meg file should pose any problems served as a static file... I would try another TC version just to make sure... and I would ask [EMAIL PROTECTED] as well if you dont come right here. I think you may be seeing a symptom of another problem... ie something else is consumed all the memory, and the file down load is the straw that broke the camels back. Maybe another test case is in order where you make a little webapp with nothing else but the static file in it... if that works, then something else in that webapp ate your memory... Good Luck... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to have multiple domains/contexts with Tomcat ? they all go to same context ..
Hi. This is a simple question (i think) After playing with server,xml (and various other .xml files) I am unable to work out how to host multiple domains on a Tomcat 6 (standalone) server (running on port 80) .. I have read - http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html I.e - I have uploaded 2 contexts /mrpink /mrblue - mrpink was uploaded first (as root context). - I have 2 domains www.mrpink.com www.mrblue.com - both domains point to the same ip (tomcat server) - however when visiting both sites they go to the ROOT context. - I want www.mrpink.com to go to www.mrpink.com/mrpink and www.mrblue.comto go to www.mrblue.com/mrblue - how is this possible ? Please note : that both contexts are fine when you put the URL in (i.e www.mrpink.com/mrpink) - I just want Tomcat to understand when you visit www.mrpink.com to automatically goes to www.mrpink.com/mrpink I have tried editing server.xml (as shown in above link) also tried using the tomcat host-manager - every time I try to use this I get file/folder not found when visiting the page - i.e the host-manager seems to work fine but visiting the page after adding a virtual host i get a blank page (in firefox) - file/folder not found in konqueror Here is an example I tried - to get www.mrblue.com to point to www.mrblue.com/mrblue using the host-manager - First I uploaded the mrblue tomcat application using the tomcat manager.. Using host-manager ... www.mrpink.com/host-manager/html name : mrblue.com alias : www.mrblue.com app base : /opt/tomcat/webapps/mrblue/ The webapp is located in - /opt/tomcat/webapps/mrblue/ I understand I can do what I want using mod_jk - however it seems crazy using apache when I do not really need to ... Can anyone help - its slowly driving me mad.. Cheers
Re: Tomcat manager 'list' command - why does it return html markup
- Original Message - From: sk1ds [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Friday, September 26, 2008 4:31 AM Subject: Tomcat manager 'list' command - why does it return html markup Hi all probably a silly question from a newbie but... According to the doco http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Introduction HERE I says I should be able to use the Manager web application using A minimal version using HTTP requests only which is suitable for use by scripts setup by system administrators. Commands are given as part of the request URI, and responses are in the form of simple text that can be easily parsed and processed. However, when using wget or curl from a command line shell under redhat it returns it with HTML markup. Any ideas what I am doing wrong ? Many thanks - Nothing... it is HTML, but the context is text so easy to copy in a browser I think is what they saying Heres the headers that are actually passed around First the login... then the text content http://localhost:8080/manager/list GET /manager/list HTTP/1.1 Host: localhost:8080 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive HTTP/1.x 401 Unauthorized Server: Apache-Coyote/1.1 Pragma: No-cache Cache-Control: no-cache Expires: Thu, 01 Jan 1970 02:00:00 CAT WWW-Authenticate: Basic realm=Tomcat Manager Application Content-Type: text/html;charset=utf-8 Content-Length: 954 Date: Fri, 26 Sep 2008 10:01:00 GMT -- http://localhost:8080/manager/list GET /manager/list HTTP/1.1 Host: localhost:8080 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Authorization: Basic HTTP/1.x 200 OK Server: Apache-Coyote/1.1 Pragma: No-cache Cache-Control: no-cache Expires: Thu, 01 Jan 1970 02:00:00 CAT **SEE its TEXT*** Content-Type: text/plain;charset=utf-8 Transfer-Encoding: chunked Date: Fri, 26 Sep 2008 10:01:11 GMT - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to have multiple domains/contexts with Tomcat ? they all go to same context ..
Can you tell us on what kind of host system you are running this ? It would help guessing where the files are. Thanks. P.S. I am not the expert, but it should indeed be relatively simple, so I'll try. In a nutshell : - start again from the original server.xml file. - in it, locate the Host name=localhost ./Host section, copy it, and re-insert it after the original section. - then replace the name=localhost attribute by name=www.mrpink.com - then redo the same one more time, this time with www.mrblue.com The above takes care of letting Tomcat known that there are 3 Virtual Hosts : - www.mrpink.com - www.mrblue.com - and localhost, which will also be (remain) the Host by default, if the name given in the request does not match either of the other ones (for example, if someone calls up http://xxx.xxx.xxx.xxx:8180 (with the IP address of your server). (I suggest to keep that one as it is, to access the documentation etc..) Now what is left is to tell Tomcat where, for each of the virtual hosts, he finds the corresponding documents and webapps. I would recommend to create 2 additional directories, at the same level as your current webapps, say webapps-pink and webapps-blue. Then move the respective documents/applications in these directories, checking ownership and permissions etc.. They must at least be readable by the user-id running Tomcat. Now go back to your individual Hosts sections, and change appBase=webapps by appBase=webapps-pink and appBase=webapps-blue Now restart Tomcat. You should now be able to access blue by calling up http://www.mrblue.com/mrblue;. To make this trailing /mrblue go away, you should make this webapp into the ROOT webapp for that virtual server, but for that I'll let an expert give you the instructions. Have I got it right ? Morgan Cox wrote: Hi. This is a simple question (i think) After playing with server,xml (and various other .xml files) I am unable to work out how to host multiple domains on a Tomcat 6 (standalone) server (running on port 80) .. I have read - http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html I.e - I have uploaded 2 contexts /mrpink /mrblue - mrpink was uploaded first (as root context). - I have 2 domains www.mrpink.com www.mrblue.com - both domains point to the same ip (tomcat server) - however when visiting both sites they go to the ROOT context. - I want www.mrpink.com to go to www.mrpink.com/mrpink and www.mrblue.comto go to www.mrblue.com/mrblue - how is this possible ? Please note : that both contexts are fine when you put the URL in (i.e www.mrpink.com/mrpink) - I just want Tomcat to understand when you visit www.mrpink.com to automatically goes to www.mrpink.com/mrpink I have tried editing server.xml (as shown in above link) also tried using the tomcat host-manager - every time I try to use this I get file/folder not found when visiting the page - i.e the host-manager seems to work fine but visiting the page after adding a virtual host i get a blank page (in firefox) - file/folder not found in konqueror Here is an example I tried - to get www.mrblue.com to point to www.mrblue.com/mrblue using the host-manager - First I uploaded the mrblue tomcat application using the tomcat manager.. Using host-manager ... www.mrpink.com/host-manager/html name : mrblue.com alias : www.mrblue.com app base : /opt/tomcat/webapps/mrblue/ The webapp is located in - /opt/tomcat/webapps/mrblue/ I understand I can do what I want using mod_jk - however it seems crazy using apache when I do not really need to ... Can anyone help - its slowly driving me mad.. Cheers - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to have multiple domains/contexts with Tomcat ? they all go to same context ..
Hi. It is on an Ubuntu Gutsy server.. As mentioned the tomcat applications are working I can just figure out to point domains at the contexts.. cheers 2008/9/26 André Warnier [EMAIL PROTECTED] Can you tell us on what kind of host system you are running this ? It would help guessing where the files are. Thanks. P.S. I am not the expert, but it should indeed be relatively simple, so I'll try. In a nutshell : - start again from the original server.xml file. - in it, locate the Host name=localhost ./Host section, copy it, and re-insert it after the original section. - then replace the name=localhost attribute by name=www.mrpink.com - then redo the same one more time, this time with www.mrblue.com The above takes care of letting Tomcat known that there are 3 Virtual Hosts : - www.mrpink.com - www.mrblue.com - and localhost, which will also be (remain) the Host by default, if the name given in the request does not match either of the other ones (for example, if someone calls up http://xxx.xxx.xxx.xxx:8180 (with the IP address of your server). (I suggest to keep that one as it is, to access the documentation etc..) Now what is left is to tell Tomcat where, for each of the virtual hosts, he finds the corresponding documents and webapps. I would recommend to create 2 additional directories, at the same level as your current webapps, say webapps-pink and webapps-blue. Then move the respective documents/applications in these directories, checking ownership and permissions etc.. They must at least be readable by the user-id running Tomcat. Now go back to your individual Hosts sections, and change appBase=webapps by appBase=webapps-pink and appBase=webapps-blue Now restart Tomcat. You should now be able to access blue by calling up http://www.mrblue.com/mrblue;. To make this trailing /mrblue go away, you should make this webapp into the ROOT webapp for that virtual server, but for that I'll let an expert give you the instructions. Have I got it right ? Morgan Cox wrote: Hi. This is a simple question (i think) After playing with server,xml (and various other .xml files) I am unable to work out how to host multiple domains on a Tomcat 6 (standalone) server (running on port 80) .. I have read - http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html I.e - I have uploaded 2 contexts /mrpink /mrblue - mrpink was uploaded first (as root context). - I have 2 domains www.mrpink.com www.mrblue.com - both domains point to the same ip (tomcat server) - however when visiting both sites they go to the ROOT context. - I want www.mrpink.com to go to www.mrpink.com/mrpink and www.mrblue.comto go to www.mrblue.com/mrblue - how is this possible ? Please note : that both contexts are fine when you put the URL in (i.e www.mrpink.com/mrpink) - I just want Tomcat to understand when you visit www.mrpink.com to automatically goes to www.mrpink.com/mrpink I have tried editing server.xml (as shown in above link) also tried using the tomcat host-manager - every time I try to use this I get file/folder not found when visiting the page - i.e the host-manager seems to work fine but visiting the page after adding a virtual host i get a blank page (in firefox) - file/folder not found in konqueror Here is an example I tried - to get www.mrblue.com to point to www.mrblue.com/mrblue using the host-manager - First I uploaded the mrblue tomcat application using the tomcat manager.. Using host-manager ... www.mrpink.com/host-manager/html name : mrblue.com alias : www.mrblue.com app base : /opt/tomcat/webapps/mrblue/ The webapp is located in - /opt/tomcat/webapps/mrblue/ I understand I can do what I want using mod_jk - however it seems crazy using apache when I do not really need to ... Can anyone help - its slowly driving me mad.. Cheers - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to have multiple domains/contexts with Tomcat ? they all go to same context ..
Sorry - didn't see your complete response... http://www.mrblue.com/mrblu http://www.mrblue.com/mrbluee - already goes to the mrblue context - i want http://www.mrblue.comhttp://www.mrblue.com/mrblueto go the mrblue context. Thanks for the advise - it seems that I do need to set the ROOT webapp for each virtual server - anyone got any ideas of how to do this. Thanks for your response André Cheers 2008/9/26 Morgan Cox [EMAIL PROTECTED] Hi. It is on an Ubuntu Gutsy server.. As mentioned the tomcat applications are working I can just figure out to point domains at the contexts.. cheers 2008/9/26 André Warnier [EMAIL PROTECTED] Can you tell us on what kind of host system you are running this ? It would help guessing where the files are. Thanks. P.S. I am not the expert, but it should indeed be relatively simple, so I'll try. In a nutshell : - start again from the original server.xml file. - in it, locate the Host name=localhost ./Host section, copy it, and re-insert it after the original section. - then replace the name=localhost attribute by name=www.mrpink.com - then redo the same one more time, this time with www.mrblue.com The above takes care of letting Tomcat known that there are 3 Virtual Hosts : - www.mrpink.com - www.mrblue.com - and localhost, which will also be (remain) the Host by default, if the name given in the request does not match either of the other ones (for example, if someone calls up http://xxx.xxx.xxx.xxx:8180 (with the IP address of your server). (I suggest to keep that one as it is, to access the documentation etc..) Now what is left is to tell Tomcat where, for each of the virtual hosts, he finds the corresponding documents and webapps. I would recommend to create 2 additional directories, at the same level as your current webapps, say webapps-pink and webapps-blue. Then move the respective documents/applications in these directories, checking ownership and permissions etc.. They must at least be readable by the user-id running Tomcat. Now go back to your individual Hosts sections, and change appBase=webapps by appBase=webapps-pink and appBase=webapps-blue Now restart Tomcat. You should now be able to access blue by calling up http://www.mrblue.com/mrblue;. To make this trailing /mrblue go away, you should make this webapp into the ROOT webapp for that virtual server, but for that I'll let an expert give you the instructions. Have I got it right ? Morgan Cox wrote: Hi. This is a simple question (i think) After playing with server,xml (and various other .xml files) I am unable to work out how to host multiple domains on a Tomcat 6 (standalone) server (running on port 80) .. I have read - http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html I.e - I have uploaded 2 contexts /mrpink /mrblue - mrpink was uploaded first (as root context). - I have 2 domains www.mrpink.com www.mrblue.com - both domains point to the same ip (tomcat server) - however when visiting both sites they go to the ROOT context. - I want www.mrpink.com to go to www.mrpink.com/mrpink and www.mrblue.comto go to www.mrblue.com/mrblue - how is this possible ? Please note : that both contexts are fine when you put the URL in (i.e www.mrpink.com/mrpink) - I just want Tomcat to understand when you visit www.mrpink.com to automatically goes to www.mrpink.com/mrpink I have tried editing server.xml (as shown in above link) also tried using the tomcat host-manager - every time I try to use this I get file/folder not found when visiting the page - i.e the host-manager seems to work fine but visiting the page after adding a virtual host i get a blank page (in firefox) - file/folder not found in konqueror Here is an example I tried - to get www.mrblue.com to point to www.mrblue.com/mrblue using the host-manager - First I uploaded the mrblue tomcat application using the tomcat manager.. Using host-manager ... www.mrpink.com/host-manager/html name : mrblue.com alias : www.mrblue.com app base : /opt/tomcat/webapps/mrblue/ The webapp is located in - /opt/tomcat/webapps/mrblue/ I understand I can do what I want using mod_jk - however it seems crazy using apache when I do not really need to ... Can anyone help - its slowly driving me mad.. Cheers - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat won't download large files -- out of memory error
DIGLLOYD INC wrote: I have some large zip files I want to make available for download. When I try to download a 70MB file, tomcat is trying to cache these huge files (it seems). The result is that downloading them always fails. I *want* caching for most everything eg jpegs, html, etc and I've set tomcat to use up to 1.5GB of memory. Do you mean you have set cacheMaxSize=150 on the context? Which JVM are you using? Particularly, are you using a 32bit or 64bit JVM? Is there a way to limit the size of the file that will be cached? Not at present. The maximum (cacheObjectMaxSize) is set to (cacheMaxSize/20). I can see a case for making cacheObjectMaxSize configurable. The cache should probably use the smaller of (cacheMaxSize/20) and cacheObjectMaxSize. It's regrettable that failure to cache a file can't gracefully degrade into just not caching it. It isn't possible to handle OOMs gracefully. Once they occur you have to assume the JVM is toast and restart it. Providing you have enough memory configured for the JVM to support the cache size you have asked for plus the other memory you need to run Tomcat, the cache will be fine and you won't see an OOM. It appears in this case that the failure is that your JVM doesn't have enough memory configured. With sufficient memory head room you should be fine. The current cache implementation requires more headroom than is the ideal. Limiting cacheObjectMaxSize should reduce the headroom required. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to have multiple domains/contexts with Tomcat ? they all go to same context ..
Morgan Cox wrote: Sorry - didn't see your complete response... http://www.mrblue.com/mrblu http://www.mrblue.com/mrbluee - already goes to the mrblue context - i want http://www.mrblue.comhttp://www.mrblue.com/mrblueto go the mrblue context. Thanks for the advise - it seems that I do need to set the ROOT webapp for each virtual server - anyone got any ideas of how to do this. Rename $CATALINA_BASE\webapps-blue\mrblue ro $CATALINA_BASE\webapps-blue\ROOT Note that each virtual host must have its own appBase. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT obviously] Re: Some Prilim questions
Stab in the dark guess on Ithaca -- I'm one of the people that first responded to the OP and my email domain is cornell.edu, whose main campus is in Ithaca, NY --David Pid wrote: Martin Gainty wrote: no no no.. he was NOT talking about LDAP but a DB connection the statement stands even with a 'local TC reference' you STILL have to contact the server ! there exists a company which sells server services for this very reason (if the op desires to know i will pass this on) dont you have something/anything thats more constructive with your time Dumbkopf! (May I Chris? Thank you in advance.) So, Martin, (can I call you Al? I prefer Al - like the song), I'm interested to know how you'll respond to this query. I've carefully re-read this thread from the beginning to the point where you responded with the following: the referenced jndi lookup in the webapp context is located in India and the DB is in Ithaca NY the Indian JNDI lookup is considerably slower than 'ordinary JDBC connection' from NY ... and I'm wondering whether you had some off list conversation with karthikn (the OP). Because I can't really see any way you could deduce that the DB is in Ithaca. Or in fact that the JNDI context is in India. (Well, apart from the distinct possibility that the OP is in the Indian subcontinent.) Al, your answer is utterly irrelevant - the correct answers being: 1. A JNDI connection pool is measurably faster 2. Return the connection to the pool in most cases, subject to the implementation of the driver. - so I am puzzling over the word Ithaca. I suspect that it's a riddle, but I'm not making a great deal of progress, Al. Can you help? Ithaca, I know - as I studied the classics for a while, is the home of Odysseus. Is this a Homerian reference I wondered? And yet, Al, you mention NY. And India! So I searched Google... Of course! The only result that mentions Ithaca NY and India in its title is: Bikram's Yoga College of India - Ithaca, NY, 14850 - Citysearch And there we have it, Al - you're a genius! 14850! But what is the meaning of 14850?! Is it www.14850.com? Public Communications, Inc's website! We're on a public mailing list, this must be it! But no... wait... There's another possibility, ISO:14850! What's this? ISO 14850:2004 describes a procedure for measurements of gamma-emitting radionuclide activity in homogeneous objects such as unconditioned waste (including process waste, dismantling waste, etc.), waste conditioned in various matrices (bitumen, hydraulic binder, thermosetting resins, etc.), notably in the form of 100 L, 200 L, 400 L or 800 L drums, and test specimens or samples, (vitrified waste), and waste packaged in a container, notably technological waste. It also specifies the calibration of the gamma spectrometry chain. The gamma energies used generally range from 0,05 MeV to 3 MeV. Al, I'm disturbed by this. India *is* a nuclear power, and this *is* a public standard, but I think we're moving into dangerous territory here. What are you getting at I wondered? Is there a deeper message regarding nuclear power for OP to take back to his people? A little more googling led me to Tarapur, where there's a nuclear waste disposal and storage facility that, yes!, uses *vitrification*. (I paused here, as I was thirsty and the second bottle was now empty.) Tarapur, Al, Tarapur. What are you trying to tell us, I mused. Wikipedia has 5 references for places called Tarapur, in these states Maharashtra - the nuke plant, Gujarat Bihar - otherwise unremarkable. Madhya Pradesh - is one of the best known centres for very unusual and attractive bandanas! Could this be it!? Karthik, Chris, David, I nearly shouted out loud! *BANDANAS* It was so obvious to me now, I was amazed that I hadn't seen it straight away! But then Al, I idly flicked the back button, to check the last link... Tarapur, Orissa. Three stupas (edicts), put up by Emperor Asoka, have been discovered at Tarapur recently. I was stunned Al. * Ashoka the Great * It crystallised in my mind quickly as the breadth of your vision appeared. ** Ashoka the Great ** He who regards everyone amiably I knew Al, from my classical studies, that Ashoka The Great was a Hindu by birth but later converted to Buddhism after the battle of Kalinga. He subsequently declared in his edicts: “There is no country, except among the Greeks, where these two groups, Brahmans and ascetics, are not found, and there is no country where people are not devoted to one or another religion. The GREEKS! ITHACA! This reference confirmed I had arrived in the right place! Your message is revealed Al, as a message of peace and understanding, for Ashoka is famous for his message of freedom, tolerance, and equality. I was worn out from my exertions, but gloriously sated as I collapsed into a drunken stupor. Peace, Al, Peace. pid * or Alice, I don't mind, Al. Martin
Re: tomcat won't download large files -- out of memory error
Mark Thomas wrote: DIGLLOYD INC wrote: Is there a way to limit the size of the file that will be cached? Not at present. I have added a configuration option for this to trunk and proposed it for 6.0.x Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT obviously] Re: Some Prilim questions
David Smith wrote: Stab in the dark guess on Ithaca -- I'm one of the people that first responded to the OP and my email domain is cornell.edu, whose main campus is in Ithaca, NY Interesting... is that new? I don't remember seeing that occur before. p --David Pid wrote: Martin Gainty wrote: no no no.. he was NOT talking about LDAP but a DB connection the statement stands even with a 'local TC reference' you STILL have to contact the server ! there exists a company which sells server services for this very reason (if the op desires to know i will pass this on) dont you have something/anything thats more constructive with your time Dumbkopf! (May I Chris? Thank you in advance.) So, Martin, (can I call you Al? I prefer Al - like the song), I'm interested to know how you'll respond to this query. I've carefully re-read this thread from the beginning to the point where you responded with the following: the referenced jndi lookup in the webapp context is located in India and the DB is in Ithaca NY the Indian JNDI lookup is considerably slower than 'ordinary JDBC connection' from NY ... and I'm wondering whether you had some off list conversation with karthikn (the OP). Because I can't really see any way you could deduce that the DB is in Ithaca. Or in fact that the JNDI context is in India. (Well, apart from the distinct possibility that the OP is in the Indian subcontinent.) Al, your answer is utterly irrelevant - the correct answers being: 1. A JNDI connection pool is measurably faster 2. Return the connection to the pool in most cases, subject to the implementation of the driver. - so I am puzzling over the word Ithaca. I suspect that it's a riddle, but I'm not making a great deal of progress, Al. Can you help? Ithaca, I know - as I studied the classics for a while, is the home of Odysseus. Is this a Homerian reference I wondered? And yet, Al, you mention NY. And India! So I searched Google... Of course! The only result that mentions Ithaca NY and India in its title is: Bikram's Yoga College of India - Ithaca, NY, 14850 - Citysearch And there we have it, Al - you're a genius! 14850! But what is the meaning of 14850?! Is it www.14850.com? Public Communications, Inc's website! We're on a public mailing list, this must be it! But no... wait... There's another possibility, ISO:14850! What's this? ISO 14850:2004 describes a procedure for measurements of gamma-emitting radionuclide activity in homogeneous objects such as unconditioned waste (including process waste, dismantling waste, etc.), waste conditioned in various matrices (bitumen, hydraulic binder, thermosetting resins, etc.), notably in the form of 100 L, 200 L, 400 L or 800 L drums, and test specimens or samples, (vitrified waste), and waste packaged in a container, notably technological waste. It also specifies the calibration of the gamma spectrometry chain. The gamma energies used generally range from 0,05 MeV to 3 MeV. Al, I'm disturbed by this. India *is* a nuclear power, and this *is* a public standard, but I think we're moving into dangerous territory here. What are you getting at I wondered? Is there a deeper message regarding nuclear power for OP to take back to his people? A little more googling led me to Tarapur, where there's a nuclear waste disposal and storage facility that, yes!, uses *vitrification*. (I paused here, as I was thirsty and the second bottle was now empty.) Tarapur, Al, Tarapur. What are you trying to tell us, I mused. Wikipedia has 5 references for places called Tarapur, in these states Maharashtra - the nuke plant, Gujarat Bihar - otherwise unremarkable. Madhya Pradesh - is one of the best known centres for very unusual and attractive bandanas! Could this be it!? Karthik, Chris, David, I nearly shouted out loud! *BANDANAS* It was so obvious to me now, I was amazed that I hadn't seen it straight away! But then Al, I idly flicked the back button, to check the last link... Tarapur, Orissa. Three stupas (edicts), put up by Emperor Asoka, have been discovered at Tarapur recently. I was stunned Al. * Ashoka the Great * It crystallised in my mind quickly as the breadth of your vision appeared. ** Ashoka the Great ** He who regards everyone amiably I knew Al, from my classical studies, that Ashoka The Great was a Hindu by birth but later converted to Buddhism after the battle of Kalinga. He subsequently declared in his edicts: “There is no country, except among the Greeks, where these two groups, Brahmans and ascetics, are not found, and there is no country where people are not devoted to one or another religion. The GREEKS! ITHACA! This reference confirmed I had arrived in the right place! Your message is revealed Al, as a message of peace and understanding, for Ashoka is famous for his message of freedom, tolerance, and equality. I was worn out from my exertions, but
RE: [OT obviously] Re: Some Prilim questions
In other words if you have an opportunity to attack someone instead of providing an intelligent solution then yes by all means CHANGE the question (so you'll look good and the other guy looks like an idiot..) from a JDBC DataSource lookup to LDAP question.. if the question is a comparison of a local lookup vs remote lookups you will need a J2EE server and understand Remote architectures (which TC is not) and you will need to know how to setup and reference the remote object so I disgress back to the question which is if I have a DB server in NY and I have a TC container running in India how do I acquire the fastest response for a DB Connection for my client ? I can think of 2 options which I will discuss offline with the client allowing chris and his/her political attack machine to continue .. in the meanwhile Microsoft continues to convert TC installations to .NET.. Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Fri, 26 Sep 2008 09:18:28 +0100 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: [OT obviously] Re: Some Prilim questions Martin Gainty wrote: no no no.. he was NOT talking about LDAP but a DB connection the statement stands even with a 'local TC reference' you STILL have to contact the server ! there exists a company which sells server services for this very reason (if the op desires to know i will pass this on) dont you have something/anything thats more constructive with your time Dumbkopf! (May I Chris? Thank you in advance.) So, Martin, (can I call you Al? I prefer Al - like the song), I'm interested to know how you'll respond to this query. I've carefully re-read this thread from the beginning to the point where you responded with the following: the referenced jndi lookup in the webapp context is located in India and the DB is in Ithaca NY the Indian JNDI lookup is considerably slower than 'ordinary JDBC connection' from NY ... and I'm wondering whether you had some off list conversation with karthikn (the OP). Because I can't really see any way you could deduce that the DB is in Ithaca. Or in fact that the JNDI context is in India. (Well, apart from the distinct possibility that the OP is in the Indian subcontinent.) Al, your answer is utterly irrelevant - the correct answers being: 1. A JNDI connection pool is measurably faster 2. Return the connection to the pool in most cases, subject to the implementation of the driver. - so I am puzzling over the word Ithaca. I suspect that it's a riddle, but I'm not making a great deal of progress, Al. Can you help? Ithaca, I know - as I studied the classics for a while, is the home of Odysseus. Is this a Homerian reference I wondered? And yet, Al, you mention NY. And India! So I searched Google... Of course! The only result that mentions Ithaca NY and India in its title is: Bikram's Yoga College of India - Ithaca, NY, 14850 - Citysearch And there we have it, Al - you're a genius! 14850! But what is the meaning of 14850?! Is it www.14850.com? Public Communications, Inc's website! We're on a public mailing list, this must be it! But no... wait... There's another possibility, ISO:14850! What's this? ISO 14850:2004 describes a procedure for measurements of gamma-emitting radionuclide activity in homogeneous objects such as unconditioned waste (including process waste, dismantling waste, etc.), waste conditioned in various matrices (bitumen, hydraulic binder, thermosetting resins, etc.), notably in the form of 100 L, 200 L, 400 L or 800 L drums, and test specimens or samples, (vitrified waste), and waste packaged in a container, notably technological waste. It also specifies the calibration of the gamma spectrometry chain. The gamma energies used generally range from 0,05 MeV to 3 MeV. Al, I'm disturbed by this. India *is* a nuclear power, and this *is* a public standard, but I think we're moving into dangerous territory here. What are you getting at I wondered? Is there a deeper message regarding nuclear power for OP to take back to his people? A little more googling led me to Tarapur, where there's a nuclear waste disposal and storage facility that, yes!, uses *vitrification*. (I paused here, as I was thirsty and the second bottle was now empty.) Tarapur, Al, Tarapur. What are you trying to tell us, I mused. Wikipedia has 5 references for places called Tarapur, in these states Maharashtra - the nuke plant, Gujarat Bihar - otherwise unremarkable. Madhya Pradesh - is one of the best known centres for very unusual and attractive
RE: How to have multiple domains/contexts with Tomcat ? they all go to same context ..
From: Morgan Cox [mailto:[EMAIL PROTECTED] Subject: Re: How to have multiple domains/contexts with Tomcat ? they all go to same context .. Thanks for the advise - it seems that I do need to set the ROOT webapp for each virtual server - anyone got any ideas of how to do this. Read *all* of Andre's post - he already told you, in great detail, exactly how to do it. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to have multiple domains/contexts with Tomcat ? they all go to same context ..
Thanks to everybody whos responded. I shall try these suggestions and let you know how it goes.. 2008/9/26 Caldarale, Charles R [EMAIL PROTECTED] From: Morgan Cox [mailto:[EMAIL PROTECTED] Subject: Re: How to have multiple domains/contexts with Tomcat ? they all go to same context .. Thanks for the advise - it seems that I do need to set the ROOT webapp for each virtual server - anyone got any ideas of how to do this. Read *all* of Andre's post - he already told you, in great detail, exactly how to do it. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to have multiple domains/contexts with Tomcat ? they all go to same context ..
Caldarale, Charles R wrote: From: Morgan Cox [mailto:[EMAIL PROTECTED] Subject: Re: How to have multiple domains/contexts with Tomcat ? they all go to same context .. Thanks for the advise - it seems that I do need to set the ROOT webapp for each virtual server - anyone got any ideas of how to do this. Read *all* of Andre's post - he already told you, in great detail, exactly how to do it. Well, not really about making them the ROOT application. So I'll try that one too, but someone should probably come after me to clean up. Morgan, if you followed the previous instructions, you now have this directory structure : (CATALINA_HOME being the top of your Tomcat installation) CATALINA_HOME/webapps (with the standard webapps and documents from the original Tomcat installation) CATALINA_HOME/webapps-pink/mrpink/ with your pink webapp CATALINA_HOME/webapps-blue/mrblue/ with your blue webapp Turn off Tomcat. Under /webapps-pink/, rename the directory /mrpink to /ROOT (uppercase). Under /webapps-blue/, rename the directory /mrblue to /ROOT (uppercase). And restart Tomcat. And unless someone contradicts the above within the next 15 minutes, you should now be able to access your applications directly via http://www.mrpink.com[:port] and http://www.mrblue.com[:port] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT obviously] Re: Some Prilim questions
. The gamma energies used generally range from 0,05 MeV to 3 MeV. Yes!! That is exactly I need to able to read this list. 3 Megawatti minimum, forget about electronVolts. Even better 5 GigaWatt. Where is the LHC when I need it ?? to generate some black holes ?? János - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to have multiple domains/contexts with Tomcat ? they all go to same context ..
Hi André - between yours and Mark's advice I have managed to do what i needed to. Thank you all - i'm amazed at the level of response... (half expected to look in a month and see no responses.) One last thing - If you upload the .war files with the tomcat manager / host-manager is there a way to do this - or will it always involve hand editing the server.xml file (and renaming directories). ? Thanks again everybody - you've possible just saved my monitor from being throw out the window. Cheers ! 2008/9/26 André Warnier [EMAIL PROTECTED] Caldarale, Charles R wrote: From: Morgan Cox [mailto:[EMAIL PROTECTED] Subject: Re: How to have multiple domains/contexts with Tomcat ? they all go to same context .. Thanks for the advise - it seems that I do need to set the ROOT webapp for each virtual server - anyone got any ideas of how to do this. Read *all* of Andre's post - he already told you, in great detail, exactly how to do it. Well, not really about making them the ROOT application. So I'll try that one too, but someone should probably come after me to clean up. Morgan, if you followed the previous instructions, you now have this directory structure : (CATALINA_HOME being the top of your Tomcat installation) CATALINA_HOME/webapps (with the standard webapps and documents from the original Tomcat installation) CATALINA_HOME/webapps-pink/mrpink/ with your pink webapp CATALINA_HOME/webapps-blue/mrblue/ with your blue webapp Turn off Tomcat. Under /webapps-pink/, rename the directory /mrpink to /ROOT (uppercase). Under /webapps-blue/, rename the directory /mrblue to /ROOT (uppercase). And restart Tomcat. And unless someone contradicts the above within the next 15 minutes, you should now be able to access your applications directly via http://www.mrpink.com[:port] and http://www.mrblue.com[:port] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT obviously] Re: Some Prilim questions
Martin Gainty wrote: In other words if you have an opportunity to attack someone instead of providing an intelligent solution then yes by all means CHANGE the question (so you'll look good and the other guy looks like an idiot..) from a JDBC DataSource lookup to LDAP question.. I did provide the correct answers, or rather, repeat them. if the question is a comparison of a local lookup vs remote lookups you will need a J2EE server and understand Remote architectures (which TC is not) and you will need to know how to setup and reference the remote object This may be true, but it *wasn't* the question. Local/Remote isn't mentioned in the question anywhere. so I disgress back to the question which is if I have a DB server in NY and I have a TC container running in India how do I acquire the fastest response for a DB Connection for my client ? Just for my own amusement, here is the original question in full: starts here 1) Which is faster JNDI Based Connection pool / ordinary JDBC based connection / close ? 2) In JNDI / context based Connection pool for the code given below InitialContext ic = new InitialContext(); DataSource ODS =(javax.sql.DataSource)ic.lookup(java:comp/env/jdbc/MYSCEMA); Connection conn = ODS.getConnection() // Insert /Update /Delete/... conn.close() -- What does this code do ? (return connection to pool or close the connection ) Googled /yahooed but non correct answers ends here Prizes for anyone who can spot the references to India or Ithaca within. I think the real question is this: what is the result of this calculation: ( any large prime number ) divided by zero? The point I was so laboriously making, is that it's easy to post irrelevant nonsense scraped from the depths of the internet. But it's not helpful, so please stop it. p I can think of 2 options which I will discuss offline with the client allowing chris and his/her political attack machine to continue .. P.S. Ummm, didn't you write Dumbkopf! ? in the meanwhile Microsoft continues to convert TC installations to .NET.. WTF are you on about now? No, don't answer. /Please/. Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Fri, 26 Sep 2008 09:18:28 +0100 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: [OT obviously] Re: Some Prilim questions Martin Gainty wrote: no no no.. he was NOT talking about LDAP but a DB connection the statement stands even with a 'local TC reference' you STILL have to contact the server ! there exists a company which sells server services for this very reason (if the op desires to know i will pass this on) dont you have something/anything thats more constructive with your time Dumbkopf! (May I Chris? Thank you in advance.) So, Martin, (can I call you Al? I prefer Al - like the song), I'm interested to know how you'll respond to this query. I've carefully re-read this thread from the beginning to the point where you responded with the following: the referenced jndi lookup in the webapp context is located in India and the DB is in Ithaca NY the Indian JNDI lookup is considerably slower than 'ordinary JDBC connection' from NY ... and I'm wondering whether you had some off list conversation with karthikn (the OP). Because I can't really see any way you could deduce that the DB is in Ithaca. Or in fact that the JNDI context is in India. (Well, apart from the distinct possibility that the OP is in the Indian subcontinent.) Al, your answer is utterly irrelevant - the correct answers being: 1. A JNDI connection pool is measurably faster 2. Return the connection to the pool in most cases, subject to the implementation of the driver. - so I am puzzling over the word Ithaca. I suspect that it's a riddle, but I'm not making a great deal of progress, Al. Can you help? Ithaca, I know - as I studied the classics for a while, is the home of Odysseus. Is this a Homerian reference I wondered? And yet, Al, you mention NY. And India! So I searched Google... Of course! The only result that mentions Ithaca NY and India in its title is: Bikram's Yoga College of India - Ithaca, NY, 14850 - Citysearch And there we have it, Al - you're a genius! 14850! But what is the meaning of 14850?! Is it www.14850.com? Public Communications, Inc's website! We're on a public mailing list, this must be it! But no... wait... There's another possibility, ISO:14850! What's this? ISO 14850:2004 describes a procedure for measurements of gamma-emitting radionuclide activity in homogeneous objects such as unconditioned waste
Re: How to have multiple domains/contexts with Tomcat ? they all go to same context ..
Morgan Cox wrote: Hi André - between yours and Mark's advice I have managed to do what i needed to. Thank you all - i'm amazed at the level of response... (half expected to look in a month and see no responses.) One last thing - If you upload the .war files with the tomcat manager / host-manager is there a way to do this - or will it always involve hand editing the server.xml file (and renaming directories). ? You'll need to configure the manager webapp for each virtual host. See the end of http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html Once you have done that, if you upload a file called ROOT.war it will be treated as the ROOT application. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to have multiple domains/contexts with Tomcat ? they all go to same context ..
From: Morgan Cox [mailto:[EMAIL PROTECTED] Subject: Re: How to have multiple domains/contexts with Tomcat ? they all go to same context .. One last thing - If you upload the .war files with the tomcat manager / host-manager is there a way to do this Once the Host elements are set up, you shouldn't have to do any more editing of server.xml - just deploy the default webapp as ROOT under each Host. However, you will have to deploy the manager app for each Host, since each instance is tied to a given Host (at least it was last time I tried). The easiest way to do that is just copy the manager directory to each of your Host's appBase directories. You can also do it by putting a Context element for each manager in conf/Catalina/[host]/manager.xml, but all that does is save a minimal amount of disk space. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to access JNDI resources on Tomcat level
Mikolaj Rydzewski wrote: Now, I want to setup Josso single sign on system (www.josso.org) and force it to use JNDI DataSources as well. With no luck. Here's the solution for anyone interested (addition to typical josso setup): * define DataSource within GlobalNamingResources (e.g. jdbc/users) * add JNDI support to josso webapp (e.g. and ResourceLink to META-INF/context.xml and resource-ref to WEB-INF/web.xml) * reference DataSource from josso-gateway-config.xml using java:comp/env/jdbc/users as its JNDI name Enjoy ;-) -- Mikolaj Rydzewski [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to have multiple domains/contexts with Tomcat ? they all go to same context ..
Thanks everybody for your input. I'll try to deploy the manager for each host as suggested. Cheers everybody. 2008/9/26 Caldarale, Charles R [EMAIL PROTECTED] From: Morgan Cox [mailto:[EMAIL PROTECTED] Subject: Re: How to have multiple domains/contexts with Tomcat ? they all go to same context .. One last thing - If you upload the .war files with the tomcat manager / host-manager is there a way to do this Once the Host elements are set up, you shouldn't have to do any more editing of server.xml - just deploy the default webapp as ROOT under each Host. However, you will have to deploy the manager app for each Host, since each instance is tied to a given Host (at least it was last time I tried). The easiest way to do that is just copy the manager directory to each of your Host's appBase directories. You can also do it by putting a Context element for each manager in conf/Catalina/[host]/manager.xml, but all that does is save a minimal amount of disk space. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RemoteAddrValve for a specific URL pattern
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 All, I'm looking for something like the RemoteAddrValve but that can be used on a particular URL pattern. Basically, I have an administrative health check URL that I'd like to hit, but only from approved clients. The rest of the application should be open to everyone. The RemoteAddrValve appears to be valid at its narrowest scope in the Context, which is still too wide for me. I see that tuckey's urlrewrite library can probably do this for me (redirect somewhere else if the address doesn't match), but it seems a bit overkill. I also have Apache httpd out front would could be used, but I think I'd like to have this configuration inside my webapp instead of relying on the fronting web server configuration to be correct. Does anyone have any other ideas? I could certainly write my own filter, but I figure that someone has either another idea, or an existing filter that I might be able to borrow. Thanks, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjdDaMACgkQ9CaO5/Lv0PBeBACfbTWegwE/cnRpJdCgh4oWsLiY 88EAnigH3/t9WYk0bjc/7tY6vtv04dTk =Te6w -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
jdbc driver fails with tomcat
I am trying to send an array to a pl/sql module but for some reason i am unable to get the connection object. Here is the line of code that fails [code] Connection conn = null; ArrayDescriptor rectabDescriptor = ArrayDescriptor.createDescriptor(CCS21_CONSIGNMENTLIST_TYPE,conn); FAILS HERE ARRAY awbNoHwbs = new ARRAY(rectabDescriptor,conn,childLessAwbs); ARRAY hwbs = new ARRAY(rectabDescriptor,conn,hwbList); OracleCallableStatement cst = (OracleCallableStatement)conn.prepareCall(stp.SUBMIT_CONSIGNMENT_STORED_PROC); [/code] Here is the stack trace [code] java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.DelegatingCallableStatement at com.acbt.ccstt.data.accessors.ConsignmentDAO.submitDeclaration(ConsignmentDAO.java:301) at com.acbt.ccstt.presentation.events.consignments.select.SubmitDeclaration.midAction(SubmitDeclaration.java:68) at com.acbt.ccstt.presentation.events.CCS21EventAction.execute(CCS21EventAction.java:36) at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58) at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67) at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:595) [/code] And here is my connection config Struts Web.xml file [code] resource-ref descriptionOracle Datasource/description res-ref-namejdbc/ccs21db/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref [/code] Metainf/context.xml [code] Resource name=jdbc/thedb auth=Container type=javax.sql.DataSource driverClassName=oracle.jdbc.OracleDriver url=jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:dbsid username=xxx password=xxx maxActive=20 maxIdle=10 maxWait=-1/ [/code]
Re: [OT obviously] Re: Some Prilim questions
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin, Martin Gainty wrote: In other words if you have an opportunity to attack someone instead of providing an intelligent solution then yes by all means CHANGE the question (so you'll look good and the other guy looks like an idiot..) from a JDBC DataSource lookup to LDAP question.. Go back to the original question: it clearly says JNDI DataSource (i.e. a connection pool) versus straight-JDBC connections without pooling. if the question is a comparison of a local lookup vs remote lookups you will need a J2EE server and understand Remote architectures (which TC is not) and you will need to know how to setup and reference the remote object Since TC is not whatever you are talking about, why bring it up? so I disgress back to the question Technically, this nonsense is the digression. One does not generally digress back to anything, but rather end the digression. But I digress... which is if I have a DB server in NY and I have a TC container running in India how do I acquire the fastest response for a DB Connection for my client ? In this case, the answer is still the same: the connection pool is faster than using unpooled connections. I can think of 2 options which I will discuss offline with the client allowing chris and his/her political attack machine to continue .. Christopher is generally a name chosen for male humans, and my parents chose to follow in that tradition. Look, Martin. I'm not trying to attack you politically. I'm trying to ask you to carefully read questions before you respond. Your answers are often ... confusing, to say the least. I have seen you answer some questions brilliantly, which is maybe why I get so bent out of shape when you give such an outlandish response. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjdD+UACgkQ9CaO5/Lv0PDCQwCdFiwZH8mV6hudkRemmIzZAnif zowAn32fXVrHMm8rYkx2B23eXbQBRMEr =k3tD -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jdbc driver fails with tomcat
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dini, Dini Omar wrote: I am trying to send an array to a pl/sql module but for some reason i am unable to get the connection object. Here is the line of code that fails [code] Connection conn = null; ArrayDescriptor rectabDescriptor = ArrayDescriptor.createDescriptor(CCS21_CONSIGNMENTLIST_TYPE,conn); It's odd that your exception says DelegatingCallableStatement (which is the actual type of the object being casted) when the line indicated neither performs a cast, nor does anything with a statement. Are you sure this is the right line number? FAILS HERE ARRAY awbNoHwbs = new ARRAY(rectabDescriptor,conn,childLessAwbs); ARRAY hwbs = new ARRAY(rectabDescriptor,conn,hwbList); OracleCallableStatement cst = (OracleCallableStatement)conn.prepareCall(stp.SUBMIT_CONSIGNMENT_STORED_PROC); I'm guessing that the above line is the one where the problem is really occurring. conn.prepareCall returns a DelegatingCallableStatement instead of the Oracle-specific one you are expecting. Do you /need/ to use OracleCallableStatement, here? If not, you should simply use java.sql.CallableStatement and you should be good to go. If you need to access the underlying OracleCallableStatement, then you'll need to go through some hoops to get that actual object. Perhaps something like this: DelegatingCallableStatement dcs = conn.prepareCall(stp.SUBMIT_CONSIGNMENT_STORED_PROC); OracleCallableStatement = (OracleCallableStatement)dcs.getInnermostDelegate(); This is a big dangerous, though, because Tomcat doesn't make too many guarantees about the structure of the objects in the dbcp.dbcp package. Also, the innermost delegate might not actually be your Oracle statement. My advise would be to try to stick to using only objects and interfaces in the JDBC API unless you absolutely need to (for instance, to create Oracle-specific arrays from templates or whatever this stuff is). The Oracle driver ought to allow you to interact a bit more naturally with the JDBC API and not require you to use OracleCallableStatement objects and stuff like that. Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjdFH4ACgkQ9CaO5/Lv0PARMgCgphBlDrwQWBWW73/a2cAG82Ju RaUAmwSmGtca3RVQc91kORrMuXiy2DXs =kZ3E -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to access JNDI resources on Tomcat level
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mikolaj, A few notes: see below. Mikolaj Rydzewski wrote: Mikolaj Rydzewski wrote: Now, I want to setup Josso single sign on system (www.josso.org) and force it to use JNDI DataSources as well. With no luck. Here's the solution for anyone interested (addition to typical josso setup): * define DataSource within GlobalNamingResources (e.g. jdbc/users) This sets up a global DataSource that can be used by any Context (webapp) deployed on the server. * add JNDI support to josso webapp (e.g. and ResourceLink to META-INF/context.xml and resource-ref to WEB-INF/web.xml) Note that this is not required for Realms. See http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Context+versus+GlobalNamingResources * reference DataSource from josso-gateway-config.xml using java:comp/env/jdbc/users as its JNDI name This is always true, whether you are using a global DataSource, or a local one. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjdFb0ACgkQ9CaO5/Lv0PAV/gCfYstrMVZzFfTyC44gs1l2D9Kb gTMAn03cwmZY3apqZGvj0nOlPZig2dJu =b4Lb -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jdbc driver fails with tomcat
Hi, When i debug the code, it doesnt get to the point where i am initialising the OracleCallableStatement object. It failed just after the initialisation of the ArrayDescriptor object. I have tried to change it to use CallableStatement and im now getting another error. Here is how i've changed it to. CallableStatement cst = conn.prepareCall(stp.SUBMIT_CONSIGNMENT_STORED_PROC); ArrayDescriptor rectabDescriptor = ArrayDescriptor.createDescriptor(CCS21_CONSIGNMENTLIST_TYPE,conn); ARRAY awbNoHwbs = new ARRAY(rectabDescriptor,conn,childLessAwbs); ARRAY hwbs = new ARRAY(rectabDescriptor,conn,hwbList); context.xml Resource name=jdbc/ccs21db auth=Container type=javax.sql.DataSource driverClassName=oracle.jdbc.driver.OracleDriver url=jdbc:oracle:thin:@xxx.xxx.xxx:1525:dbsid username=xxx password=xxx maxActive=20 maxIdle=10 maxWait=-1/ web.xml resource-ref descriptionOracle Datasource/description res-ref-namejdbc/ccs21db/res-ref-name res-typeoracle.jdbc.pool.OracleDataSource/res-type res-authContainer/res-auth /resource-ref And here is the stack trace java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:149) at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:115) at com.abbt.ccs21.data.accessors.ConsignmentDAO.submitDeclaration(ConsignmentDAO.java:301) at com.bt.abccs21.presentation.events.consignments.select.SubmitDeclaration.midAction(SubmitDeclaration.java:68) at com.bt.abccs21.presentation.events.CCS21EventAction.execute(CCS21EventAction.java:36) at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58) at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67) at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:595) On Fri, Sep 26, 2008 at 5:57 PM, Christopher Schultz [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dini, Dini Omar wrote: I am trying to send an array to a pl/sql module but for some reason i am unable to get the connection object. Here is the line of code that fails [code] Connection conn = null; ArrayDescriptor rectabDescriptor = ArrayDescriptor.createDescriptor(CCS21_CONSIGNMENTLIST_TYPE,conn); It's odd that your exception says DelegatingCallableStatement (which is the actual type of the object being casted) when the line indicated neither performs a cast, nor does anything with a statement. Are you sure this is the right line number? FAILS HERE ARRAY awbNoHwbs = new ARRAY(rectabDescriptor,conn,childLessAwbs); ARRAY hwbs = new ARRAY(rectabDescriptor,conn,hwbList); OracleCallableStatement cst = (OracleCallableStatement)conn.prepareCall(stp.SUBMIT_CONSIGNMENT_STORED_PROC); I'm guessing that the above line is the one where the problem is really
Re: tomcat won't download large files -- out of memory error
Thanks to multiple people responding to this! My site diglloyd.com serves almost entirely static content, with many large JPEG files. I have set: CATALINA_OPTS=-Xmx1024M That's limiting the JVM to 1GB of memory. And in tomcat/conf/ context.xml, I set: Context cacheMaxSize=150 cacheTTL=6 cachingAllowed=true Therein presumably lies the problem. I'll change CATALINA_OPTS to be 2GB or so and retry. Mark, it would be helpful to be able to say don't cache anything larger the N kilobytes/megabytes. I'd probably use a setting of 2MB or so for that. Lloyd Lloyd Chambers http://diglloyd.com [Mac OS X 10.5.2 Intel, Tomcat 6.0.16] On Sep 26, 2008, at 4:07 AM, Mark Thomas wrote: DIGLLOYD INC wrote: I have some large zip files I want to make available for download. When I try to download a 70MB file, tomcat is trying to cache these huge files (it seems). The result is that downloading them always fails. I *want* caching for most everything eg jpegs, html, etc and I've set tomcat to use up to 1.5GB of memory. Do you mean you have set cacheMaxSize=150 on the context? Which JVM are you using? Particularly, are you using a 32bit or 64bit JVM? Is there a way to limit the size of the file that will be cached? Not at present. The maximum (cacheObjectMaxSize) is set to (cacheMaxSize/20). I can see a case for making cacheObjectMaxSize configurable. The cache should probably use the smaller of (cacheMaxSize/20) and cacheObjectMaxSize. It's regrettable that failure to cache a file can't gracefully degrade into just not caching it. It isn't possible to handle OOMs gracefully. Once they occur you have to assume the JVM is toast and restart it. Providing you have enough memory configured for the JVM to support the cache size you have asked for plus the other memory you need to run Tomcat, the cache will be fine and you won't see an OOM. It appears in this case that the failure is that your JVM doesn't have enough memory configured. With sufficient memory head room you should be fine. The current cache implementation requires more headroom than is the ideal. Limiting cacheObjectMaxSize should reduce the headroom required. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: j_security_check requires session
... or simply switch to BASIC auth-method. Rossen - Original Message - From: Christopher Schultz [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, September 25, 2008 6:42:40 PM GMT -05:00 US/Canada Eastern Subject: Re: j_security_check requires session -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul, [EMAIL PROTECTED] wrote: It seems that tomcat expects that I already have a session established before posting the username and password. If I don't already have a JSESSIONID cookie, j_security_check returns a 408. This behavior adheres to the Servlet Specification. See section 12.5.3. There is no provision for drive-by logins. Unfortunately, I have another application attempting to talk to this one that requires that the first thing it does is post credentials to the j_security_check, so I have no mechanism of hitting another page first to establish a session. This is non-portable (as you have seen from moving between servlet containers). I think you have a couple of options: 1. Change your remote client to first request the desired secure resource from the server, then submit the credentials with a second request (and you'll be sent to the originally-requested resource, as per the spec) 2. Switch to using securityfilter (which allows drive-bys, and which Mark already plugged) 3. Remove the security constraint from your target service and implement an alternate authentication and authorization strategy (such as checking the credentials yourself in the service) manually This mechanism worked fine with BEA Weblogic, but it seems that tomcat's handling of j_security_check is different. Does anyone know of any options to modify the behavior of j_security_check so that it would just do the authentication and establish the session in one shot at the time of the POST request? There are no spec-compliant options. BEA's behavior is an extension to the servlet specification so whatever you do will be container-specific, unless you go outside the container-managed security provider (say, by using something like securityfilter). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjcE+AACgkQ9CaO5/Lv0PCrUgCgrHAzHozD9/JjmHRlZE/Jpl2X aucAn2mBQ/dIqkYQo2Nn9bYt8dBPUKM/ =g6J7 -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat won't download large files -- out of memory error
DIGLLOYD INC wrote: Thanks to multiple people responding to this! My site diglloyd.com serves almost entirely static content, with many large JPEG files. I have set: CATALINA_OPTS=-Xmx1024M That's limiting the JVM to 1GB of memory. And in tomcat/conf/context.xml, I set: Context cacheMaxSize=150 cacheTTL=6 cachingAllowed=true Therein presumably lies the problem. I'll change CATALINA_OPTS to be 2GB or so and retry. You'll probably need to be using a 64-bit JVM to set that to 2GB. Mark, it would be helpful to be able to say don't cache anything larger the N kilobytes/megabytes. I'd probably use a setting of 2MB or so for that. cacheObjectMaxSize is now configurable (at least in trunk). The only limitation is that it can't be greater than cacheMaxSize/20. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat won't download large files -- out of memory error
Thanks Mark. How to force the 64-bit JVM to run? For now I'm using -Xmx2047M, which solves the immediate problem. Lloyd Chambers http://diglloyd.com [Mac OS X 10.5.5 Intel, Tomcat 6.0.16] On Sep 26, 2008, at 11:19 AM, Mark Thomas wrote: DIGLLOYD INC wrote: Thanks to multiple people responding to this! My site diglloyd.com serves almost entirely static content, with many large JPEG files. I have set: CATALINA_OPTS=-Xmx1024M That's limiting the JVM to 1GB of memory. And in tomcat/conf/context.xml, I set: Context cacheMaxSize=150 cacheTTL=6 cachingAllowed=true Therein presumably lies the problem. I'll change CATALINA_OPTS to be 2GB or so and retry. You'll probably need to be using a 64-bit JVM to set that to 2GB. Mark, it would be helpful to be able to say don't cache anything larger the N kilobytes/megabytes. I'd probably use a setting of 2MB or so for that. cacheObjectMaxSize is now configurable (at least in trunk). The only limitation is that it can't be greater than cacheMaxSize/20. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat won't download large files -- out of memory error
DIGLLOYD INC wrote: Thanks Mark. How to force the 64-bit JVM to run? For now I'm using -Xmx2047M, which solves the immediate problem. The latest Java updates for Mac include 32 and 64 bit 1.6.0_07. You need to use the Java Preferences (Applications Util Java - or something close to that) to change the default JVM. Mark Lloyd Chambers http://diglloyd.com [Mac OS X 10.5.5 Intel, Tomcat 6.0.16] On Sep 26, 2008, at 11:19 AM, Mark Thomas wrote: DIGLLOYD INC wrote: Thanks to multiple people responding to this! My site diglloyd.com serves almost entirely static content, with many large JPEG files. I have set: CATALINA_OPTS=-Xmx1024M That's limiting the JVM to 1GB of memory. And in tomcat/conf/context.xml, I set: Context cacheMaxSize=150 cacheTTL=6 cachingAllowed=true Therein presumably lies the problem. I'll change CATALINA_OPTS to be 2GB or so and retry. You'll probably need to be using a 64-bit JVM to set that to 2GB. Mark, it would be helpful to be able to say don't cache anything larger the N kilobytes/megabytes. I'd probably use a setting of 2MB or so for that. cacheObjectMaxSize is now configurable (at least in trunk). The only limitation is that it can't be greater than cacheMaxSize/20. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to have multiple domains/contexts with Tomcat ? they all go to same context ..
- Original Message - From: André Warnier [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Friday, September 26, 2008 12:10 PM Subject: Re: How to have multiple domains/contexts with Tomcat ? they all go to same context .. Can you tell us on what kind of host system you are running this ? It would help guessing where the files are. Thanks. P.S. I am not the expert, but it should indeed be relatively simple, so I'll try. In a nutshell : - start again from the original server.xml file. - in it, locate the Host name=localhost ./Host section, copy it, and re-insert it after the original section. - then replace the name=localhost attribute by name=www.mrpink.com - then redo the same one more time, this time with www.mrblue.com The above takes care of letting Tomcat known that there are 3 Virtual Hosts : - www.mrpink.com - www.mrblue.com - and localhost, which will also be (remain) the Host by default, if the name given in the request does not match either of the other ones (for example, if someone calls up http://xxx.xxx.xxx.xxx:8180 (with the IP address of your server). (I suggest to keep that one as it is, to access the documentation etc..) Now what is left is to tell Tomcat where, for each of the virtual hosts, he finds the corresponding documents and webapps. I would recommend to create 2 additional directories, at the same level as your current webapps, say webapps-pink and webapps-blue. Then move the respective documents/applications in these directories, checking ownership and permissions etc.. They must at least be readable by the user-id running Tomcat. Now go back to your individual Hosts sections, and change appBase=webapps by appBase=webapps-pink and appBase=webapps-blue Now restart Tomcat. You should now be able to access blue by calling up http://www.mrblue.com/mrblue;. To make this trailing /mrblue go away, you should make this webapp into the ROOT webapp for that virtual server, but for that I'll let an expert give you the instructions. Have I got it right ? Any better... and we'll have to pay you a consulting fee ;) --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RemoteAddrValve for a specific URL pattern
Christopher Schultz wrote: [...] I see that tuckey's urlrewrite library can probably do this for me (redirect somewhere else if the address doesn't match), but it seems a bit overkill. I recommend though. The setup is very easy and flexible, and the author claims it is very light-weight. I have used only a tiny portion of it, but it worked right away to do what I wanted, in 10 minutes all told including reading the doc. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Accessing server directory from applet
I have an applet that I'm hosting on Tomcat. When I try to access the file system, I end up on the users file system, not the servers. Is there a way to connect to the servers file system? Bai Shen
Re: Accessing server directory from applet
Bai Shen wrote: I have an applet that I'm hosting on Tomcat. When I try to access the file system, I end up on the users file system, not the servers. Is there a way to connect to the servers file system? Applets run on the client so the only option you have for accessing remote (ie server) content is if the server makes it available, eg via HTTP. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
clustering on different machines
Hi, I posted it earlier, but received no answers, so I try again. I have apache2 2.2.9, mod_jk 1.2.26, and Tomcat 6.0.18 running on my Mac with OSX 10.5.6. Its domain name is bml0087.yalepath.org. On my Windows 2000 machines I have tomcat 6.0.16 and its domain name is bml0039.yalepath.org. On the mac I have 3 nodes, on the Windows machine I have one. In the mac I start the three up with 10 seconds pause in between. I can see from the logs, that all 4 found each other and participate in the cluster. I use the SessionsExample. On the Mac the three nodes replicating the session to each other, but nothing goes to the Windows machine. On the Mac the failover is working, but again the one on the Mac that should fail over to the tomcat instance on the Windows machine does not fail over. Here is the workers.properties file from /usr/local/apache2/conf on the Mac: snip worker.list = lb,jkstatus worker.lb.type=lb worker.lb.balance_workers=node1,node2,node3,node4 worker.jkstatus.type=status worker.node1.type = ajp13 worker.node1.host = localhost worker.node1.port = 8009 worker.node1.lbfactor = 1 worker.node1.redirect=node2 worker.node2.type = ajp13 worker.node2.host = localhost worker.node2.port = 8109 worker.node2.lbfactor = 1 worker.node2.redirect=node3 worker.node3.type = ajp13 worker.node3.host = localhost worker.node3.port = 8209 worker.node3.lbfactor = 1 worker.node3.redirect=node4 worker.node4.type = ajp13 worker.node4.host = bml0039.yalepath.org worker.node4.port = 8309 worker.node4.lbfactor = 1 worker.node4.redirect=node1 worker.node1.sticky_session = True worker.node2.sticky_session = True worker.node3.sticky_session = True worker.node4.sticky_session = True worker.node1.sticky_session_force = False worker.node2.sticky_session_force = False worker.node3.sticky_session_force = False worker.node4.sticky_session_force = False /snip here is the relevant portion of of the server.xml from one of the Mac nodes: snip Engine name=Catalina defaultHost=localhost jvmRoute=node1 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ Context path= docBase=ROOT className=org.apache.catalina.ha.context.ReplicatedContext/ !-- This Realm uses the UserDatabase configured in the global JNDI resources under the key UserDatabase. Any edits that are performed against this UserDatabase are immediately available for use by the Realm. -- Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host /Engine /snip Here is the similar server.xml portion from the Windows machine: snip Engine name=Catalina defaultHost=localhost jvmRoute=node4 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Context path= docbase=ROOT classname=org.apache.catalina.ha.context.ReplicatedContext/ Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false/ Host name=bml0087.yalepath.org appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false/ /Engine /snip What am I doing wrong ? Thanks ahead, János - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accessing server directory from applet
- Original Message - From: Bai Shen [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Friday, September 26, 2008 10:30 PM Subject: Accessing server directory from applet I have an applet that I'm hosting on Tomcat. When I try to access the file system, I end up on the users file system, not the servers. Is there a way to connect to the servers file system? Bai Shen Bai I'm actually surprized you didnt get a security exception... as Mark said applets run in the browser... client side. The last time I looked at Applets (long long time ago), they dont need any special security if you talk to the delivery server... Remember that... if you want to talk to any other server... you into security issues. Things like the script coming from one machine and the applet from another, will also catch you... I think they horrible things... if this is a new project, have a look at GWT... or think about a normal web page... if you can. Will save you some pain --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jdbc driver fails with tomcat
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ziggy, Ziggy O wrote: When i debug the code, it doesnt get to the point where i am initialising the OracleCallableStatement object. It failed just after the initialisation of the ArrayDescriptor object. Strange. Are you sure you are working with matching binary and source versions? I have tried to change it to use CallableStatement and im now getting another error. Here is how i've changed it to. CallableStatement cst = conn.prepareCall(stp.SUBMIT_CONSIGNMENT_STORED_PROC); ArrayDescriptor rectabDescriptor = ArrayDescriptor.createDescriptor(CCS21_CONSIGNMENTLIST_TYPE,conn); [snip] java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:149) at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:115) at com.abbt.ccs21.data.accessors.ConsignmentDAO.submitDeclaration(ConsignmentDAO.java:301) Now, this stack trace makes more sense to me. It looks like Oracle's driver expects the Connection object passed into the createDescriptor method to be an Oracle-specific connection. Try doing this instead: ArrayDescriptor rectabDescriptor = ArrayDescriptor.createDescriptor(CCS21_CONSIGNMENTLIST_TYPE, (((DelegatingConnection)conn).getInnermostDelegate()); Hopefully, that will get the Oracle-specific Connection object passed-into that method and then the driver will work properly. On a side note, could you use the java.sql.Array interface instead of the Oracle-specific ones? I've never done this, and it isn't entirely clear how to so it, but this might work: Array myArray = conn.createArrayOf(dataType, elements); Then you should be able to use the PreparedStatement.setArray method to assign it to a parameter. Connection.createArrayOf is part of JDBC 4.0 (Java 6), which you might not be using at this point. Just a thought. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjdUlIACgkQ9CaO5/Lv0PBZegCeIuHcpXn6x/eP3ZvFooy4twf0 XOEAoMCf0ZxTBTtxcB86hq8ax1qYM0Fm =6yjk -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to access JNDI resources on Tomcat level
Christopher Schultz wrote: * add JNDI support to josso webapp (e.g. and ResourceLink to META-INF/context.xml and resource-ref to WEB-INF/web.xml) Note that this is not required for Realms. See http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Context+versus+GlobalNamingResources I'm exposing DataSource to josso webapp, not the Realm. So I need this. Lack of such configuration was causing my initial problems. -- Mikolaj Rydzewski [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Accessing server directory from applet
If your client does'nt mind objects loaded into your browser embed src=TheAnschluss.swf id=TestForFlex3 quality=high bgcolor=#869ca7 name=TheAnschluss allowscriptaccess=sameDomain pluginspage=http://www.adobe.com/go/getflashplayer; type=application/x-shockwave-flash align=middle height=100% width=100% noscript object classid=clsid:PingMeOffline id=TheAnschluss width=100% height=100% codebase=http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab; param name=movie value=TheAnschluss.swf / param name=quality value=high / param name=bgcolor value=#869ca7 / param name=allowScriptAccess value=sameDomain / then I would start thinking about flex plugin ping me offline as this is O/T for this forum Waiting for Gegenwirkung Politische Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: Accessing server directory from applet Date: Fri, 26 Sep 2008 23:17:40 +0200 - Original Message - From: Bai Shen [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Friday, September 26, 2008 10:30 PM Subject: Accessing server directory from applet I have an applet that I'm hosting on Tomcat. When I try to access the file system, I end up on the users file system, not the servers. Is there a way to connect to the servers file system? Bai Shen Bai I'm actually surprized you didnt get a security exception... as Mark said applets run in the browser... client side. The last time I looked at Applets (long long time ago), they dont need any special security if you talk to the delivery server... Remember that... if you want to talk to any other server... you into security issues. Things like the script coming from one machine and the applet from another, will also catch you... I think they horrible things... if this is a new project, have a look at GWT... or think about a normal web page... if you can. Will save you some pain --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get more out of the Web. Learn 10 hidden secrets of Windows Live. http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008
Re: Accessing server directory from applet
This is an existing applet, so I'm stuck with it until I rewrite the whole thing. No security problems. Not sure why. And unfortunately there's not automatic pull for anything other than images or music. After I posted, I figured out about the pulling it from the server. I was jus' wondering if there was a better way. On Fri, Sep 26, 2008 at 5:17 PM, Johnny Kewl [EMAIL PROTECTED] wrote: - Original Message - From: Bai Shen [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Friday, September 26, 2008 10:30 PM Subject: Accessing server directory from applet I have an applet that I'm hosting on Tomcat. When I try to access the file system, I end up on the users file system, not the servers. Is there a way to connect to the servers file system? Bai Shen Bai I'm actually surprized you didnt get a security exception... as Mark said applets run in the browser... client side. The last time I looked at Applets (long long time ago), they dont need any special security if you talk to the delivery server... Remember that... if you want to talk to any other server... you into security issues. Things like the script coming from one machine and the applet from another, will also catch you... I think they horrible things... if this is a new project, have a look at GWT... or think about a normal web page... if you can. Will save you some pain --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5.5 war takes 4 to 7 minutes to deploy
I'm wondering why I'm seeing such a long deployment time with my project. 4 to 7 minutes is way longer than I am used to seeing with projects of similar or larger size. My war file is about 15M - and it lives on a red hat server. I'm at a loss about what I could be doing wrong. I'm even at a loss to figure out what I could be doing different than normal. I'm just putting a war into the webapps folder and restarting tomcat. The output looks pretty harmless - it just takes forever. Any ideas how I can get my deployment to take less time? STATUS | wrapper | 2008/09/26 00:06:02 | -- Wrapper Started as Daemon STATUS | wrapper | 2008/09/26 00:06:03 | Launching a JVM... INFO | jvm 1| 2008/09/26 00:06:05 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org INFO | jvm 1| 2008/09/26 00:06:05 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved. INFO | jvm 1| 2008/09/26 00:06:05 | INFO | jvm 1| 2008/09/26 00:06:08 | Sep 26, 2008 4:06:08 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO | jvm 1| 2008/09/26 00:06:08 | INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /opt/tomcat5/common/lib INFO | jvm 1| 2008/09/26 00:06:08 | Sep 26, 2008 4:06:08 AM org.apache.coyote.http11.Http11BaseProtocol init INFO | jvm 1| 2008/09/26 00:06:08 | INFO: Initializing Coyote HTTP/1.1 on http-8080 INFO | jvm 1| 2008/09/26 00:06:08 | Sep 26, 2008 4:06:08 AM org.apache.catalina.startup.Catalina load INFO | jvm 1| 2008/09/26 00:06:08 | INFO: Initialization processed in 2120 ms INFO | jvm 1| 2008/09/26 00:06:09 | Sep 26, 2008 4:06:09 AM org.apache.catalina.core.StandardService start INFO | jvm 1| 2008/09/26 00:06:09 | INFO: Starting service Catalina INFO | jvm 1| 2008/09/26 00:06:09 | Sep 26, 2008 4:06:09 AM org.apache.catalina.core.StandardEngine start INFO | jvm 1| 2008/09/26 00:06:09 | INFO: Starting Servlet Engine: Apache Tomcat/5.5.26 INFO | jvm 1| 2008/09/26 00:06:09 | Sep 26, 2008 4:06:09 AM org.apache.catalina.core.StandardHost start INFO | jvm 1| 2008/09/26 00:06:09 | INFO: XML validation disabled INFO | jvm 1| 2008/09/26 00:06:18 | Sep 26, 2008 4:06:18 AM org.apache.catalina.startup.HostConfig deployWAR INFO | jvm 1| 2008/09/26 00:06:18 | INFO: Deploying web application archive a1.war INFO | jvm 1| 2008/09/26 00:13:33 | Initialize-init()-start::Nine INFO | jvm 1| 2008/09/26 00:13:37 | Sep 26, 2008 4:13:37 AM org.apache.catalina.core.ApplicationContext log INFO | jvm 1| 2008/09/26 00:13:37 | INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]] INFO | jvm 1| 2008/09/26 00:13:37 | Sep 26, 2008 4:13:37 AM org.apache.catalina.core.ApplicationContext log INFO | jvm 1| 2008/09/26 00:13:37 | INFO: ContextListener: contextInitialized() INFO | jvm 1| 2008/09/26 00:13:37 | Sep 26, 2008 4:13:37 AM org.apache.catalina.core.ApplicationContext log INFO | jvm 1| 2008/09/26 00:13:37 | INFO: SessionListener: contextInitialized() INFO | jvm 1| 2008/09/26 00:13:38 | Sep 26, 2008 4:13:38 AM org.apache.catalina.core.ApplicationContext log INFO | jvm 1| 2008/09/26 00:13:38 | INFO: ContextListener: contextInitialized() INFO | jvm 1| 2008/09/26 00:13:38 | Sep 26, 2008 4:13:38 AM org.apache.catalina.core.ApplicationContext log INFO | jvm 1| 2008/09/26 00:13:38 | INFO: SessionListener: contextInitialized() INFO | jvm 1| 2008/09/26 00:13:41 | Sep 26, 2008 4:13:41 AM org.apache.coyote.http11.Http11BaseProtocol start INFO | jvm 1| 2008/09/26 00:13:41 | INFO: Starting Coyote HTTP/1.1 on http-8080 INFO | jvm 1| 2008/09/26 00:13:42 | Sep 26, 2008 4:13:42 AM org.apache.jk.common.ChannelSocket init INFO | jvm 1| 2008/09/26 00:13:42 | INFO: JK: ajp13 listening on / 0.0.0.0:8009 INFO | jvm 1| 2008/09/26 00:13:42 | Sep 26, 2008 4:13:42 AM org.apache.jk.server.JkMain start INFO | jvm 1| 2008/09/26 00:13:42 | INFO: Jk running ID=0 time=0/244 config=null INFO | jvm 1| 2008/09/26 00:13:42 | Sep 26, 2008 4:13:42 AM org.apache.catalina.storeconfig.StoreLoader load INFO | jvm 1| 2008/09/26 00:13:42 | INFO: Find registry server-registry.xml at classpath resource INFO | jvm 1| 2008/09/26 00:13:42 | Sep 26, 2008 4:13:42 AM org.apache.catalina.startup.Catalina start INFO | jvm 1| 2008/09/26 00:13:42 | INFO: Server startup in 453702 ms Thanks for your help.
image download
For img src=http://domain.com/servlet/pictures/image.jpg/ in servlet get method, InputStream is = new FileInputStream(/apphome/pictures/image.jpg); OutputStream os = response.getOutputStream(); byte[] buffer = new byte[256*1024]; //256k while (true) { int n = is.read(buffer); if (n 0) return; os.write(buffer, 0, n); } is.close(); os.close(); Is this the right way? Sometimes only the half image is shown on web page. Is there a more efficient and robust way? How about for audio/video files? I want to take at how Tomcat does it. Could anyone tell me which class? thanks Dave
Re: image download
InputStream is = new FileInputStream(/apphome/pictures/image.jpg); OutputStream os = response.getOutputStream(); byte[] buffer = new byte[256*1024]; //256k while (true) { int n = is.read(buffer); if (n 0) break; os.write(buffer, 0, n); } is.close(); os.close(); --- On Fri, 9/26/08, Dave [EMAIL PROTECTED] wrote: From: Dave [EMAIL PROTECTED] Subject: image download To: Tomcat Users List users@tomcat.apache.org Date: Friday, September 26, 2008, 6:33 PM For img src=http://domain.com/servlet/pictures/image.jpg/ in servlet get method, InputStream is = new FileInputStream(/apphome/pictures/image.jpg); OutputStream os = response.getOutputStream(); byte[] buffer = new byte[256*1024]; //256k while (true) { int n = is.read(buffer); if (n 0) return; os.write(buffer, 0, n); } is.close(); os.close(); Is this the right way? Sometimes only the half image is shown on web page. Is there a more efficient and robust way? How about for audio/video files? I want to take at how Tomcat does it. Could anyone tell me which class? thanks Dave
Re: image download
2008/9/27 Dave [EMAIL PROTECTED]: For img src=http://domain.com/servlet/pictures/image.jpg/ in servlet get method, InputStream is = new FileInputStream(/apphome/pictures/image.jpg); OutputStream os = response.getOutputStream(); byte[] buffer = new byte[256*1024]; //256k while (true) { int n = is.read(buffer); if (n 0) return; os.write(buffer, 0, n); } is.close(); os.close(); Is this the right way? Sometimes only the half image is shown on web page. You do not close the streams properly, thus they disappear without being flushed. Read at least the Java Tutorial at java.sun.com [1]. Pay attention to the finally keyword. [1] http://java.sun.com/docs/books/tutorial/essential/index.html - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: image download
My code given below works fine. U can try if u want public void sendImageFile(HttpServletResponse response) { FileInputStream in=null; File f = null; try { f = new File(webapps/Plasma/graphs, image.gif); in = new FileInputStream(f); response.setContentType(image/gif); int size = (int)f.length(); response.setContentLength(size); byte buffer[] = new byte[size]; in.read(buffer); response.getOutputStream().write(buffer); } catch(NullPointerException e) { System.out.println( NP xpn in sendImageFile + e.getMessage()); } catch(FileNotFoundException e) { System.out.println( FNF Xpn in SendImageFile + e.getMessage()); } catch(IOException ee2){ log(Trouble: +ee2);} finally { try { response.getOutputStream().close(); } catch(IOException ee2){ log(Trouble: +ee2);} } } On Sat, Sep 27, 2008 at 7:03 AM, Dave [EMAIL PROTECTED] wrote: For img src=http://domain.com/servlet/pictures/image.jpg/ in servlet get method, InputStream is = new FileInputStream(/apphome/pictures/image.jpg); OutputStream os = response.getOutputStream(); byte[] buffer = new byte[256*1024]; //256k while (true) { int n = is.read(buffer); if (n 0) return; os.write(buffer, 0, n); } is.close(); os.close(); Is this the right way? Sometimes only the half image is shown on web page. Is there a more efficient and robust way? How about for audio/video files? I want to take at how Tomcat does it. Could anyone tell me which class? thanks Dave -- With Regards T.K.Thiyagarajan - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5 war takes 4 to 7 minutes to deploy
Hi G, First what is the available memory (RAM) and CPU on your system? Are you on a VPS or Private JVM in a Hosted environment. Quite possible it is simply a matter or resources or lack of. If on VPS, certain ones have a tendency to be slow on disk IO. G Kontos wrote: I'm wondering why I'm seeing such a long deployment time with my project. 4 to 7 minutes is way longer than I am used to seeing with projects of similar or larger size. My war file is about 15M - and it lives on a red hat server. I'm at a loss about what I could be doing wrong. I'm even at a loss to figure out what I could be doing different than normal. I'm just putting a war into the webapps folder and restarting tomcat. The output looks pretty harmless - it just takes forever. Any ideas how I can get my deployment to take less time? STATUS | wrapper | 2008/09/26 00:06:02 | -- Wrapper Started as Daemon STATUS | wrapper | 2008/09/26 00:06:03 | Launching a JVM... INFO | jvm 1| 2008/09/26 00:06:05 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org INFO | jvm 1| 2008/09/26 00:06:05 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved. INFO | jvm 1| 2008/09/26 00:06:05 | INFO | jvm 1| 2008/09/26 00:06:08 | Sep 26, 2008 4:06:08 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO | jvm 1| 2008/09/26 00:06:08 | INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /opt/tomcat5/common/lib INFO | jvm 1| 2008/09/26 00:06:08 | Sep 26, 2008 4:06:08 AM org.apache.coyote.http11.Http11BaseProtocol init INFO | jvm 1| 2008/09/26 00:06:08 | INFO: Initializing Coyote HTTP/1.1 on http-8080 INFO | jvm 1| 2008/09/26 00:06:08 | Sep 26, 2008 4:06:08 AM org.apache.catalina.startup.Catalina load INFO | jvm 1| 2008/09/26 00:06:08 | INFO: Initialization processed in 2120 ms INFO | jvm 1| 2008/09/26 00:06:09 | Sep 26, 2008 4:06:09 AM org.apache.catalina.core.StandardService start INFO | jvm 1| 2008/09/26 00:06:09 | INFO: Starting service Catalina INFO | jvm 1| 2008/09/26 00:06:09 | Sep 26, 2008 4:06:09 AM org.apache.catalina.core.StandardEngine start INFO | jvm 1| 2008/09/26 00:06:09 | INFO: Starting Servlet Engine: Apache Tomcat/5.5.26 INFO | jvm 1| 2008/09/26 00:06:09 | Sep 26, 2008 4:06:09 AM org.apache.catalina.core.StandardHost start INFO | jvm 1| 2008/09/26 00:06:09 | INFO: XML validation disabled INFO | jvm 1| 2008/09/26 00:06:18 | Sep 26, 2008 4:06:18 AM org.apache.catalina.startup.HostConfig deployWAR INFO | jvm 1| 2008/09/26 00:06:18 | INFO: Deploying web application archive a1.war INFO | jvm 1| 2008/09/26 00:13:33 | Initialize-init()-start::Nine INFO | jvm 1| 2008/09/26 00:13:37 | Sep 26, 2008 4:13:37 AM org.apache.catalina.core.ApplicationContext log INFO | jvm 1| 2008/09/26 00:13:37 | INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]] INFO | jvm 1| 2008/09/26 00:13:37 | Sep 26, 2008 4:13:37 AM org.apache.catalina.core.ApplicationContext log INFO | jvm 1| 2008/09/26 00:13:37 | INFO: ContextListener: contextInitialized() INFO | jvm 1| 2008/09/26 00:13:37 | Sep 26, 2008 4:13:37 AM org.apache.catalina.core.ApplicationContext log INFO | jvm 1| 2008/09/26 00:13:37 | INFO: SessionListener: contextInitialized() INFO | jvm 1| 2008/09/26 00:13:38 | Sep 26, 2008 4:13:38 AM org.apache.catalina.core.ApplicationContext log INFO | jvm 1| 2008/09/26 00:13:38 | INFO: ContextListener: contextInitialized() INFO | jvm 1| 2008/09/26 00:13:38 | Sep 26, 2008 4:13:38 AM org.apache.catalina.core.ApplicationContext log INFO | jvm 1| 2008/09/26 00:13:38 | INFO: SessionListener: contextInitialized() INFO | jvm 1| 2008/09/26 00:13:41 | Sep 26, 2008 4:13:41 AM org.apache.coyote.http11.Http11BaseProtocol start INFO | jvm 1| 2008/09/26 00:13:41 | INFO: Starting Coyote HTTP/1.1 on http-8080 INFO | jvm 1| 2008/09/26 00:13:42 | Sep 26, 2008 4:13:42 AM org.apache.jk.common.ChannelSocket init INFO | jvm 1| 2008/09/26 00:13:42 | INFO: JK: ajp13 listening on / 0.0.0.0:8009 INFO | jvm 1| 2008/09/26 00:13:42 | Sep 26, 2008 4:13:42 AM org.apache.jk.server.JkMain start INFO | jvm 1| 2008/09/26 00:13:42 | INFO: Jk running ID=0 time=0/244 config=null INFO | jvm 1| 2008/09/26 00:13:42 | Sep 26, 2008 4:13:42 AM org.apache.catalina.storeconfig.StoreLoader load INFO | jvm 1| 2008/09/26 00:13:42 | INFO: Find registry server-registry.xml at