Re: Disabled use of AcceptEx() WinSock2 API” error on Windows 7
Richard Cooke wrote: When starting Tomcat 6 on a newly installed Windows 7 Enterprise machine with JRE 6 using C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin\tomcat6.exe the application does not open and my event viewer has the message: Disabled use of AcceptEx() WinSock2 API. The same installer of Tomcat worked on Windows Vista before I upgraded my operating system. Can anyone please suggest a way to fix this? The only site I can find mentioning this is http://www.apachelounge.com/viewtopic.php?p=4418 which suggests using this config setting Win32DisableAcceptEx - but it's for Apache, not Tomcat, and I have no idea where in what config file it might need to go in Tomcat. Thanks. In the (temporary I hope) absence of the gurus, I would venture a guess. This sounds like a relatively low-level call, and thus unlikely to be in the Java code of Tomcat per se. If you are using the native connector code (tcnative.dll ?), try removing (renaming) it and restarting Tomcat. Otherwise, maybe it is the Java JVM itself which needs updating ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: mod_jk codepage in header values
On Thu, 2010-01-21 at 15:21 +0100, André Warnier wrote: Mirko Solic wrote: On Thu, 2010-01-21 at 11:30 +0100, André Warnier wrote: Mirko, just for info : there is a related other thread taking place at the same time, entitled Basic Authentication Failed with multibyte username. I have read it. Basically, I am interested in those topics because I encounter them myself often in our own web applications. I don't know all the answers, but I know that it is confusing. As far as I can interpret : According to the HTTP 1.1 RFC 2616, HTTP header fields MAY contain *TEXT portions representing character sets other than US-ASCII. But then, such header field values MUST be encoded according to the rules of RFC 2047. RFC 2047 in turn, in 2. Syntax of encoded-words , indicates that this should be done using the form : encoded-word = =? charset ? encoding ? encoded-text ?= for example : Header-name: =?iso-8859-1?B?some iso-8859-1 text, base-64 encoded?= or Header-name: =?utf-8?B?some unicode/utf-8 text, base-64 encoded?= (I am not quite sure here of the utf-8 part as the correct name for the charset.) Now, I am not sure that if you pass a HTTP header, encoded as above, from Apache to Tomcat, the Tomcat getHeader() call will properly decode it, using the indicated charset. If not, you will have to do the decoding yourself, if you want to pass non-ascii (or non-iso-8859-1) characters in those headers. Admittedly, it is a pain; but there are still quite a few grey areas like that in the WWW-related RFCs in what concerns character sets. If you have to do this kind of encoding/decoding, I suggest to have a look in MIME (email) libraries. Such kind of encoding/decoding is regularly used in email headers. Save the original text (.eml) format of an email, with a non-ascii subject line, for an example. How i understand i don't have control when environment variables on apache side are putted in http header and sent to tomcat side. This is done by mode_jk automatically. I would hate to put encoded values already in environment variables on apache side so mod_jk would transfer them corectly on tomcat side but then other web pages that uses this variables wouldn't work no more. Right way would be (for my understanding) that mod_jk would encode environment varibales according to the rules of RFC 2047. lp mirko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Disabled use of AcceptEx() WinSock2 API” error on Windows 7
Thanks for your response. Unfortunately this did not help. I did not install Tomcat with the 'native' checkbox ticked and do not have tcnative.dll in my Tomcat directory. I also have the latest version of the JVM installed. On Mon, Jan 25, 2010 at 10:55 AM, André Warnier a...@ice-sa.com wrote: Richard Cooke wrote: When starting Tomcat 6 on a newly installed Windows 7 Enterprise machine with JRE 6 using C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin\tomcat6.exe the application does not open and my event viewer has the message: Disabled use of AcceptEx() WinSock2 API. The same installer of Tomcat worked on Windows Vista before I upgraded my operating system. Can anyone please suggest a way to fix this? The only site I can find mentioning this is http://www.apachelounge.com/viewtopic.php?p=4418 which suggests using this config setting Win32DisableAcceptEx - but it's for Apache, not Tomcat, and I have no idea where in what config file it might need to go in Tomcat. Thanks. In the (temporary I hope) absence of the gurus, I would venture a guess. This sounds like a relatively low-level call, and thus unlikely to be in the Java code of Tomcat per se. If you are using the native connector code (tcnative.dll ?), try removing (renaming) it and restarting Tomcat. Otherwise, maybe it is the Java JVM itself which needs updating ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Sincerely, Richard Cooke. Saratoga Software. 021 658 4109.
CSV File Save as dialogue defaults to HTM file
Hello, I'm using Jetspeed 1.6, running on Tomcat. In a portlet I developed, I create a .csv file and print a link to it. The user then needs to right-click on the file and select save file as. The dialogue that pops up defaults to file type HTML file, and replaces the .csv extension of the file I link to with .htm. Is there anyway to resolve this? I really need to give access to the csv file as-is, and not bother my clients more than neccessary. -- View this message in context: http://old.nabble.com/CSV-File-%22Save-as%22-dialogue-defaults-to-HTM-file-tp27303866p27303866.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Performance issue with tags in Tomcat 6
When upgrading from Tomcat 5.5.x to Tomcat 6.0.x I am facing performance issues. I am using the same exact application in both versions. The application uses JSP custom tags. Here is a quick list of the average loading time recorded (in ms) using Jmeter : Tomcat 5.5.23 : 32 Tomcat 6.0.18 / 6.0.20 : 143 When positioning the metadata-complete=true in the web.xml file the loading are much better : Tomcat 6.0.18 / 6.0.20 : 34 Has anyone experienced the same problems with tags Tomcat 6 ? I have also noticed that starting with Tomcat 6.0.3, no tldCache.ser is created inside the work directory. This file was created in Tomcat 5.5.x and 6.0.2. Could this be the reason why Tomcat 6.0.20 is much slower than Tomcat 5.5.23 ? The metadata-complete=true parameter is not a real solution for me because I'd like to use annotations in the future and from what I have understood metadata-complete=true stops Tomcat from scanning and injecting annotations. Thanks, Adrien
Re: mod_jk codepage in header values
On Thu, 2010-01-21 at 10:34 -0500, Christopher Schultz wrote: On 1/21/2010 6:43 AM, Mirko Solic wrote: That what i'm afraid of. This code: new String(request.getHeader(headerName).getBytes(ISO-8859-1)) works for now but it really shouldn't work. That way i'm searching for more legitimate way. What would be better is to do something like this: java.net.URLEncoder.encode(request.getHeader(headerName), UTF-8) Of course, this will only work if your client knows that's how the encoding will be done. Yes but what if mod_jk chooses not to send non ISO-8859-1 header values over to tomcat side. According to André Warnier: But, because the HTTP RFC specifies that HTTP headers should contain only US-ASCII character data, mod_jk would be allowed, if it finds non-US-ASCII data in a HTTP header, to strip this data or ignore the header or something like that. I don't know if mod_jk actually does this, but if it did, it would be justified, because according to the HTTP RFC this would be an invalid header. Than i have no values to decode to. AAI needs to support whatever encoding you intend to use. You can't simply transcode things in an arbitrary way and expect AAI to work properly. What does their documentation say about what format these values should take? The problem is when i want to get data from AAI. AAI is sending data in utf-8 but this is broken when data is send from apache side to tomcat side. A better strategy would be for AAI to provide a numeric token (easily passable in HTTP headers without any encoding issues) and then provide an HTTP-based and/or XML-based API that uses proper document encoding to send textual data across the wire. Using HTTP headers for text data sucks! I agree with you here: Using HTTP headers for text data sucks!. But AAI is not supported on tomcat yet. However it is supported on apache and the only way for me if i want to use AAI and tomcat is to use mod_jk connector. But mod_jk is transporting environment variables from apache to tomcat in HTTP header. And yes AAI sends data to apache in xml document not over http headers. On apache side when data is received is is put in environment variables. mirko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: CSV File Save as dialogue defaults to HTM file
On 25/01/2010 09:17, Ran Harpaz wrote: Hello, I'm using Jetspeed 1.6, running on Tomcat. In a portlet I developed, I create a .csv file and print a link to it. The user then needs to right-click on the file and select save file as. The dialogue that pops up defaults to file type HTML file, and replaces the .csv extension of the file I link to with .htm. Is there anyway to resolve this? I really need to give access to the csv file as-is, and not bother my clients more than neccessary. Are you setting the Content-type header to text/csv, or are you just generating it with a JSP? The latter will automatically set text/html as the content type. p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: CSV File Save as dialogue defaults to HTM file
On Mon, Jan 25, 2010 at 11:02 AM, Pid p...@pidster.com wrote: On 25/01/2010 09:17, Ran Harpaz wrote: Hello, I'm using Jetspeed 1.6, running on Tomcat. In a portlet I developed, I create a .csv file and print a link to it. The user then needs to right-click on the file and select save file as. The dialogue that pops up defaults to file type HTML file, and replaces the .csv extension of the file I link to with .htm. Is there anyway to resolve this? I really need to give access to the csv file as-is, and not bother my clients more than neccessary. Are you setting the Content-type header to text/csv, or are you just generating it with a JSP? The latter will automatically set text/html as the content type. You may also want to change the content-disposition header in order to make your server prompt the user with the save as dialog: For example, response.setHeader(Content-disposition, attachment; filename= + defaultCsvFilename ); Regards, Alessandro - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: log the time between each request being read and the first byte of the response served.
Chris, thanks for the valve wrapper! I played around now for some time, wrapped the response, attached some Action hook. But still not sure where i can grab the time for the first byte leaving tomcat to the client. I call now the response.getContentCount() method in every ActionHook action method. every buffer write i get an ACTION_COMMIT code: 3 event if the response is larger than 8184 bytes i get more ACTION_COMMIT code: 3 events (size of response/8184 = quantity of ACTION_COMMIT code: 3 events). Is the first ACTION_COMMIT code: 3 event sent after the client response to the first write ? LE. On 13.01.2010, at 16:43, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 LE, On 1/13/2010 9:23 AM, LE wrote: I am able to write my own AccessLogValve Class but i have no idea how to get the first byte of the response. You have to wrap the response in an object which can record the time of the first byte being written to the output stream (or writer). If you want to implement this as a Filter, the HttpServletResponseWrapper object is a good starting place. If you must use a Valve, Tomcat provides no such wrapped class for you: you'll have to use your own. Fortunately, some kind soul has written such a class and posted it into Tomcat's bug tracker: https://issues.apache.org/bugzilla/show_bug.cgi?id=45014 - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktN6ikACgkQ9CaO5/Lv0PBoOwCgwKDk2KK1KtvUJXNUoHjNowy0 KlUAn2rR14AN0N1b0hgRUtDxbUv7NVQ4 =Jexl -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 100% CPU usage after moving from Java 5 to 6
On 25/01/2010 11:08, Jesse Klaasse wrote: I am running a production environment for a website (over half a million hits per day), using Tomcat 5.5.20 (I'm stuck to that version due to support restrictions) behind IIS 6 using JK connector 1.2.28, tcnative-1.dll (1.1.19) on Windows Server 2003 R2 Enterprise x64 SP2 (with 16 GB RAM). Until last week, I have been using Sun Java 5. Last week I have upgraded the JDK to Sun Java 6. The system uses a MS SQL Server 2005 database, which resides on another server. That's when things went wrong. At first, all seemed fine (average CPU usage seems lower than when using Java 5), but after an hour or so (30 minutes - 1,5 hour max) after a Tomcat restart, Tomcat's CPU usage jumps to 100% (average CPU usage using Java 5 is around 30-40%, peaks around 60%). I can't really figure out what is causing this. I have retried about 6 restarts (including a complete system reboot), but without any success. When I move back to Java 5, the problems are gone. My Tomcat Java arguments: -Dcatalina.base=D:\tomcat -Dcatalina.home=D:\tomcat -Djava.endorsed.dirs=D:\tomcat\common\endorsed -Djava.io.tmpdir=D:\tomcat\temp -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory -Dcom.sun.management.jmxremote -XX:MaxPermSize=512m -Xloggc:D:\logs\gc\tomcat-gc.log -XX:+PrintGCDetails -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseTLAB -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -Xms4096m -Xmx10240m Some further information which could be important: - I have tried to reproduce the problems on my development environment (using jMeter for generating server load), but without success; - I have created some thread dumps during the 100% CPU periods (attached as a zip file); I would really like to make the move to Java 6, since Java 5's is EOL. Any ideas, anyone? Have you tested those memory and garbage collection settings with this version of Java? What does the garbage collection log indicate, normal or abnormal activity? Java 6 has some pretty good tools for examining a running JVM, have a nose around in the java/bin directory. p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 100% CPU usage after moving from Java 5 to 6
take a look on threads ajp-8009-2 ajp-8009-18 ajp-8009-30 ajp-8009-38 they are all seem to be either in an infinite loop: at java.util.AbstractList$Itr.hasNext(AbstractList.java:339) at nl.indicia.vip.framework.util.Workflow.performWorkflowAction(Workflow.java:166) at nl.indicia.vip.framework.util.DQWorkflow.performWorkflowAction(DQWorkflow.java:56) at org.apache.jsp.bamplaza.componenten.workflow.xmlworkflow_jsp._jspService(xmlworkflow_jsp.java:382) or iterating over a very huge list. This way or other they are consuming your cpu: ajp-8009-18 Id=187 in RUNNABLE cpu=236296 ms usr=236265 ms blocked 315 for -1 ms waited 256 for -1 ms ajp-8009-2 Id=171 in RUNNABLE cpu=221968 ms usr=218734 ms blocked 12822 for -1 ms waited 10071 for -1 ms ajp-8009-30 Id=199 in RUNNABLE cpu=371562 ms usr=368234 ms blocked 9527 for -1 ms waited 7543 for -1 ms ajp-8009-38 Id=210 in RUNNABLE cpu=518890 ms usr=515593 ms blocked 10352 for -1 ms waited 9035 for -1 ms So either its a bug (maybe a concurrency issue, since java 1.6. has improved a lot in terms of lock contention reduction) or, its a side effect of an out of memory problem, can you make a heap dump with jmap and check whether your Old Gen is 99.% full? Otherwise you should look into at nl.indicia.vip.framework.util.Workflow.performWorkflowAction(Workflow.java:166) which I never heard of, and don't have sources to check, what's happening there exactly. Good luck Leon On Mon, Jan 25, 2010 at 12:14 PM, Pid p...@pidster.com wrote: On 25/01/2010 11:08, Jesse Klaasse wrote: I am running a production environment for a website (over half a million hits per day), using Tomcat 5.5.20 (I'm stuck to that version due to support restrictions) behind IIS 6 using JK connector 1.2.28, tcnative-1.dll (1.1.19) on Windows Server 2003 R2 Enterprise x64 SP2 (with 16 GB RAM). Until last week, I have been using Sun Java 5. Last week I have upgraded the JDK to Sun Java 6. The system uses a MS SQL Server 2005 database, which resides on another server. That's when things went wrong. At first, all seemed fine (average CPU usage seems lower than when using Java 5), but after an hour or so (30 minutes - 1,5 hour max) after a Tomcat restart, Tomcat's CPU usage jumps to 100% (average CPU usage using Java 5 is around 30-40%, peaks around 60%). I can't really figure out what is causing this. I have retried about 6 restarts (including a complete system reboot), but without any success. When I move back to Java 5, the problems are gone. My Tomcat Java arguments: -Dcatalina.base=D:\tomcat -Dcatalina.home=D:\tomcat -Djava.endorsed.dirs=D:\tomcat\common\endorsed -Djava.io.tmpdir=D:\tomcat\temp -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory -Dcom.sun.management.jmxremote -XX:MaxPermSize=512m -Xloggc:D:\logs\gc\tomcat-gc.log -XX:+PrintGCDetails -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseTLAB -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -Xms4096m -Xmx10240m Some further information which could be important: - I have tried to reproduce the problems on my development environment (using jMeter for generating server load), but without success; - I have created some thread dumps during the 100% CPU periods (attached as a zip file); I would really like to make the move to Java 6, since Java 5's is EOL. Any ideas, anyone? Have you tested those memory and garbage collection settings with this version of Java? What does the garbage collection log indicate, normal or abnormal activity? Java 6 has some pretty good tools for examining a running JVM, have a nose around in the java/bin directory. p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 100% CPU usage after moving from Java 5 to 6
P.S. Your tomcat is writing gc logs, please attach them next time. On Mon, Jan 25, 2010 at 12:31 PM, Leon Rosenberg rosenberg.l...@googlemail.com wrote: take a look on threads ajp-8009-2 ajp-8009-18 ajp-8009-30 ajp-8009-38 they are all seem to be either in an infinite loop: at java.util.AbstractList$Itr.hasNext(AbstractList.java:339) at nl.indicia.vip.framework.util.Workflow.performWorkflowAction(Workflow.java:166) at nl.indicia.vip.framework.util.DQWorkflow.performWorkflowAction(DQWorkflow.java:56) at org.apache.jsp.bamplaza.componenten.workflow.xmlworkflow_jsp._jspService(xmlworkflow_jsp.java:382) or iterating over a very huge list. This way or other they are consuming your cpu: ajp-8009-18 Id=187 in RUNNABLE cpu=236296 ms usr=236265 ms blocked 315 for -1 ms waited 256 for -1 ms ajp-8009-2 Id=171 in RUNNABLE cpu=221968 ms usr=218734 ms blocked 12822 for -1 ms waited 10071 for -1 ms ajp-8009-30 Id=199 in RUNNABLE cpu=371562 ms usr=368234 ms blocked 9527 for -1 ms waited 7543 for -1 ms ajp-8009-38 Id=210 in RUNNABLE cpu=518890 ms usr=515593 ms blocked 10352 for -1 ms waited 9035 for -1 ms So either its a bug (maybe a concurrency issue, since java 1.6. has improved a lot in terms of lock contention reduction) or, its a side effect of an out of memory problem, can you make a heap dump with jmap and check whether your Old Gen is 99.% full? Otherwise you should look into at nl.indicia.vip.framework.util.Workflow.performWorkflowAction(Workflow.java:166) which I never heard of, and don't have sources to check, what's happening there exactly. Good luck Leon On Mon, Jan 25, 2010 at 12:14 PM, Pid p...@pidster.com wrote: On 25/01/2010 11:08, Jesse Klaasse wrote: I am running a production environment for a website (over half a million hits per day), using Tomcat 5.5.20 (I'm stuck to that version due to support restrictions) behind IIS 6 using JK connector 1.2.28, tcnative-1.dll (1.1.19) on Windows Server 2003 R2 Enterprise x64 SP2 (with 16 GB RAM). Until last week, I have been using Sun Java 5. Last week I have upgraded the JDK to Sun Java 6. The system uses a MS SQL Server 2005 database, which resides on another server. That's when things went wrong. At first, all seemed fine (average CPU usage seems lower than when using Java 5), but after an hour or so (30 minutes - 1,5 hour max) after a Tomcat restart, Tomcat's CPU usage jumps to 100% (average CPU usage using Java 5 is around 30-40%, peaks around 60%). I can't really figure out what is causing this. I have retried about 6 restarts (including a complete system reboot), but without any success. When I move back to Java 5, the problems are gone. My Tomcat Java arguments: -Dcatalina.base=D:\tomcat -Dcatalina.home=D:\tomcat -Djava.endorsed.dirs=D:\tomcat\common\endorsed -Djava.io.tmpdir=D:\tomcat\temp -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory -Dcom.sun.management.jmxremote -XX:MaxPermSize=512m -Xloggc:D:\logs\gc\tomcat-gc.log -XX:+PrintGCDetails -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseTLAB -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -Xms4096m -Xmx10240m Some further information which could be important: - I have tried to reproduce the problems on my development environment (using jMeter for generating server load), but without success; - I have created some thread dumps during the 100% CPU periods (attached as a zip file); I would really like to make the move to Java 6, since Java 5's is EOL. Any ideas, anyone? Have you tested those memory and garbage collection settings with this version of Java? What does the garbage collection log indicate, normal or abnormal activity? Java 6 has some pretty good tools for examining a running JVM, have a nose around in the java/bin directory. p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 100% CPU usage after moving from Java 5 to 6
Pid Ster wrote: Have you tested those memory and garbage collection settings with this version of Java? Well, actually I haven't touched the settings which I used using Java 5. But, I have tested the settings to some extent. My development environment worked perfectly fine using the same memory and garbage collection settings, also under heavy load (with jMeter). Are there any obvious mistakes? Pid Ster wrote: What does the garbage collection log indicate, normal or abnormal activity? Unfortunately I forgot to look at the gc.log (also I'm not sure how to interpret it correctly), and it's overwritten when Tomcat is restarted, so there's really nothing I can say about that. Do you suspect any problems there? -- View this message in context: http://old.nabble.com/Tomcat-100--CPU-usage-after-moving-from-Java-5-to-6-tp27305110p27305900.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 100% CPU usage after moving from Java 5 to 6
Leon Rosenberg-3 wrote: they are all seem to be either in an infinite loop: at java.util.AbstractList$Itr.hasNext(AbstractList.java:339) at nl.indicia.vip.framework.util.Workflow.performWorkflowAction(Workflow.java:166) at nl.indicia.vip.framework.util.DQWorkflow.performWorkflowAction(DQWorkflow.java:56) at org.apache.jsp.bamplaza.componenten.workflow.xmlworkflow_jsp._jspService(xmlworkflow_jsp.java:382) or iterating over a very huge list. This way or other they are consuming your cpu: ajp-8009-18 Id=187 in RUNNABLE cpu=236296 ms usr=236265 ms blocked 315 for -1 ms waited 256 for -1 ms ajp-8009-2 Id=171 in RUNNABLE cpu=221968 ms usr=218734 ms blocked 12822 for -1 ms waited 10071 for -1 ms ajp-8009-30 Id=199 in RUNNABLE cpu=371562 ms usr=368234 ms blocked 9527 for -1 ms waited 7543 for -1 ms ajp-8009-38 Id=210 in RUNNABLE cpu=518890 ms usr=515593 ms blocked 10352 for -1 ms waited 9035 for -1 ms http://old.nabble.com/file/p27305988/DQWorkflow.java DQWorkflow.java http://old.nabble.com/file/p27305988/Workflow.java Workflow.java So either its a bug (maybe a concurrency issue, since java 1.6. has improved a lot in terms of lock contention reduction) or, its a side effect of an out of memory problem, can you make a heap dump with jmap and check whether your Old Gen is 99.% full? Otherwise you should look into at nl.indicia.vip.framework.util.Workflow.performWorkflowAction(Workflow.java:166) which I never heard of, and don't have sources to check, what's happening there exactly. Those Workflow and DQWorkflow classes are from our company, written by the programmer who worked on this project before me. I have attached the two files for further examination. I have noticed the performWorkflowAction method in DQWorkflow is not synchronized and uses Vectors and Iterators. Could this be a possible problem? Even though this all has been working perfectly fine in Java 4 and 5? -- View this message in context: http://old.nabble.com/Tomcat-100--CPU-usage-after-moving-from-Java-5-to-6-tp27305110p27305988.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 100% CPU usage after moving from Java 5 to 6
Jesse Klaasse wrote: Those Workflow and DQWorkflow classes are from our company, written by the programmer who worked on this project before me. I have attached the two files for further examination. I have noticed the performWorkflowAction method in DQWorkflow is not synchronized and uses Vectors and Iterators. Could this be a possible problem? Even though this all has been working perfectly fine in Java 4 and 5? I forgot the attachments, sorry! http://old.nabble.com/file/p27306041/DQWorkflow.java DQWorkflow.java http://old.nabble.com/file/p27306041/Workflow.java Workflow.java -- View this message in context: http://old.nabble.com/Tomcat-100--CPU-usage-after-moving-from-Java-5-to-6-tp27305110p27306041.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Disabled use of AcceptEx() WinSock2 API” error on Windows 7
Richard Cooke wrote: Thanks for your response. Unfortunately this did not help. I did not install Tomcat with the 'native' checkbox ticked and do not have tcnative.dll in my Tomcat directory. I also have the latest version of the JVM installed. Unfortunately then I am out of my depth, and we will have to wait for someone who really knows what he is talking about. But the information above is helpful. To insure that you get the quickest response from now on, it would be a good idea to specify exactly which version of Tomcat and which version of JVM you are using. In the Tomcat bin directory, there should normally be a version.bat file, which when executed diplays useful information. (But it is only available in the zip version of the Tomcat download). - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Disabled use of AcceptEx() WinSock2 API” error on Windows 7
My Tomcat installer file says version 6.0.20. I do not have a version.bat file. My java version is 1.6.0.18. On Mon, Jan 25, 2010 at 2:47 PM, André Warnier a...@ice-sa.com wrote: Richard Cooke wrote: Thanks for your response. Unfortunately this did not help. I did not install Tomcat with the 'native' checkbox ticked and do not have tcnative.dll in my Tomcat directory. I also have the latest version of the JVM installed. Unfortunately then I am out of my depth, and we will have to wait for someone who really knows what he is talking about. But the information above is helpful. To insure that you get the quickest response from now on, it would be a good idea to specify exactly which version of Tomcat and which version of JVM you are using. In the Tomcat bin directory, there should normally be a version.bat file, which when executed diplays useful information. (But it is only available in the zip version of the Tomcat download). - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Sincerely, Richard Cooke. Saratoga Software. 021 658 4109.
Re: Tomcat 100% CPU usage after moving from Java 5 to 6
Hello Jesse, is the Workflow re-intrant? If yes: this is odd: you are iterating in a re-intrant action (i assume the action is re-intrant) over a shared variable? Vector vecOids = new Vector(); in the method: Iterator oidIterator = vecOids.iterator(); while (oidIterator.hasNext()) { //System.out.println(Workflow/doAction: oid= + ((ObjectId)oidIterator.next()).getKey()); } and you are modifying this vector at multiple places in the same class. You should probably unit-test this code for concurrency. regards Leon On Mon, Jan 25, 2010 at 1:41 PM, Jesse Klaasse jesse.klaa...@indicia.nl wrote: Jesse Klaasse wrote: Those Workflow and DQWorkflow classes are from our company, written by the programmer who worked on this project before me. I have attached the two files for further examination. I have noticed the performWorkflowAction method in DQWorkflow is not synchronized and uses Vectors and Iterators. Could this be a possible problem? Even though this all has been working perfectly fine in Java 4 and 5? I forgot the attachments, sorry! http://old.nabble.com/file/p27306041/DQWorkflow.java DQWorkflow.java http://old.nabble.com/file/p27306041/Workflow.java Workflow.java -- View this message in context: http://old.nabble.com/Tomcat-100--CPU-usage-after-moving-from-Java-5-to-6-tp27305110p27306041.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Files in Subdirectories not being served.
Hi, I am running Tomcat 5.5. I have a deployed application and in addition I have a directory and subdirectory structure that stores and serves supporting files such as .js and images. For the latter, I have just created an application by typing in the virtual path and physical path of the files. My application works fine, however only supporting files from the root directory of the supporting app are served e.g. http://localhost:8080/img/foldericon.gif in c:\Progra~1\Opentext\support\foldericon.gif but if a file is in a subdirectory, it's not served e.g. http://localhost:8080/img/brava/LogoBall_DK.gif in c:\Progra~1\Opentext\support\brava\LogoBall_DK.gif There is no difference in security on the folders, so I presume it is a config setting for either Tomcat or the app that is causing the problem. The error log contains: 127.0.0.1 - - [22/Jan/2010:15:50:50 +] GET /img/brava/LogoBall_DK.gif HTTP/1.1 404 1030 This is a standard not found error. My inf file is: ?xml version=\q1.0\q encoding=\qutf-8\q?\ Context docBase=C:/Progra~1/Opentext/support path=/img useNaming=false workDir=work/Catalina/localhost/img\ /Context\ I've tried wildcards on the end of the docBase and path, neither of which made any difference. Any ideas? I've tried Google and the docs and can't find anything :-( Cheers, Matt. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: TLS+SSLv3 but no SSLv2
Chris, thanks for all your help, everyting is up and running. I settled for 'ALL:!EXP:!LOW:!SSLv2' which is exaclty what I need. You should take a look at this guy's tool, here: http://www.unspecific.com/2009/02/16/ssl-cipher-check this looks helpful, unfortunately the script (not the page) seems to be 404 :( regards from Berlin Jens Health Services Network Administration Phone: +49 (0) 30 68905-2412 Mail: jens@biotronik.de Christopher Schultz ch...@christopherschultz.net 01/22/2010 07:47 PM Please respond to Tomcat Users List users@tomcat.apache.org To Tomcat Users List users@tomcat.apache.org cc Subject Re: TLS+SSLv3 but no SSLv2 -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jens, On 1/22/2010 12:51 PM, Jens Neu wrote: Christopher, maybe that was a bit premature, running with SSLCipher=-ALL:+HIGH:+MEDIUM:!SSLv2: openssl s_client -ssl2 -connect server:8443 CONNECTED(0003) --- SSL handshake has read 1135 bytes and written 236 bytes --- New, SSLv2, Cipher is DES-CBC3-MD5 Server public key is 1024 bit Compression: NONE Expansion: NONE SSL-Session: Protocol : SSLv2 Cipher: DES-CBC3-MD5 Session-ID: 21D7302FAF313F61DF24661249FCF7FD Session-ID-ctx: Master-Key: 3CAC5F9B8889222FFF7E1106232BFE34FC7A2CBD078833E0 Key-Arg : 448CA2E3F880EF06 Start Time: 1264182312 Timeout : 300 (sec) Verify return code: 18 (self signed certificate) --- :( --- Ciphers common between both SSL endpoints: RC4-MD5 EXP-RC4-MD5 RC2-CBC-MD5 EXP-RC2-CBC-MD5 DES-CBC-MD5 DES-CBC3-MD5 In my environment, openssl reports: $ openssl ciphers 'SSLv2'| sed -e 's/:/\n/g' DES-CBC3-MD5 - you got this one DES-CBC-MD5 EXP-RC2-CBC-MD5 RC2-CBC-MD5 EXP-RC4-MD5 RC4-MD5 Looks like all those are the same ones, meaning that 100% of the openssl SSLv2 ciphers are available from Tomcat. Stupid question: did you re-start Tomcat after making the SSLCipher change? Again, here's what I get for the cipher string we've been trying: $ openssl ciphers 'ALL:!SSLv2:+HIGH:+MEDIUM'| sed -e 's/:/\n/g' ADH-DES-CBC-SHA EXP-ADH-DES-CBC-SHA EXP-ADH-RC4-MD5 EDH-RSA-DES-CBC-SHA EXP-EDH-RSA-DES-CBC-SHA EDH-DSS-DES-CBC-SHA EXP-EDH-DSS-DES-CBC-SHA DES-CBC-SHA EXP-DES-CBC-SHA EXP-RC2-CBC-MD5 EXP-RC4-MD5 ADH-AES256-SHA DHE-RSA-AES256-SHA DHE-DSS-AES256-SHA AES256-SHA ADH-AES128-SHA DHE-RSA-AES128-SHA DHE-DSS-AES128-SHA AES128-SHA ADH-DES-CBC3-SHA EDH-RSA-DES-CBC3-SHA EDH-DSS-DES-CBC3-SHA DES-CBC3-SHA ADH-RC4-MD5 RC4-SHA RC4-MD5 I don't see any of the SSLv2 ciphers in there except for RC4-MD5, which I suppose would still allow you to connect. One thing I noticed is that your cipher string is not valid: $ openssl ciphers '-ALL:+HIGH:+MEDIUM:!SSLv2'| sed -e 's/:/\n/g' Error in cipher list 16374:error:1410D0B9:SSL routines:SSL_CTX_set_cipher_list:no cipher match:ssl_lib.c:1185: You have to have something without - or + prefixing it. Apparently, you have to start with a list before you start modifying it :) Try the string I have above and see if that works. RC4-MD5 might still work, though. You should take a look at this guy's tool, here: http://www.unspecific.com/2009/02/16/ssl-cipher-check Our production server's httpd is configured to use HIGH:MEDIUM:-SSLv2 and the results of the above script confirm that only decent ciphers are available: $ ./ssl-cipher-check.pl [mysite] Testing [mysite]:443 SSLv3:RC4-MD5 - ENABLED - STRONG 128 bits SSLv3:EDH-RSA-DES-CBC3-SHA - ENABLED - STRONG 168 bits SSLv3:DHE-RSA-AES128-SHA - ENABLED - STRONG 128 bits SSLv3:DES-CBC3-SHA - ENABLED - STRONG 168 bits SSLv3:RC4-SHA - ENABLED - STRONG 128 bits SSLv3:DHE-RSA-AES256-SHA - ENABLED - STRONG 256 bits SSLv3:AES128-SHA - ENABLED - STRONG 128 bits SSLv3:AES256-SHA - ENABLED - STRONG 256 bits TLSv1:RC4-MD5 - ENABLED - STRONG 128 bits TLSv1:EDH-RSA-DES-CBC3-SHA - ENABLED - STRONG 168 bits TLSv1:DHE-RSA-AES128-SHA - ENABLED - STRONG 128 bits TLSv1:DES-CBC3-SHA - ENABLED - STRONG 168 bits TLSv1:RC4-SHA - ENABLED - STRONG 128 bits TLSv1:DHE-RSA-AES256-SHA - ENABLED - STRONG 256 bits TLSv1:AES128-SHA - ENABLED - STRONG 128 bits TLSv1:AES256-SHA - ENABLED - STRONG 256 bits *WARNING* 6 WEAK Ciphers Enabled. Total Ciphers Enabled: 22 I was unable to verify that any WEAK ciphers were enabled, and I cound 16 enabled ciphers, not 22. So, maybe this script isn't the greatest thing around :) With HIGH:MEDIUM:-SSLv2, I cannot connect using openssl s_client - -ssl2, which is a good thing. Try a different/better cipher string. Always check against openssl cipher to make sure that it's kosher before enabling it in your server. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktZ8nkACgkQ9CaO5/Lv0PBLDwCfa3ESeJCygI42yQ2jGQ0YUoZO IPsAnju+4lL4lNWuF6TnG6B5cW8EzPNe =9+YO -END PGP SIGNATURE-
Re: Tomcat 100% CPU usage after moving from Java 5 to 6
Hi Leon, I don't know what you mean exactly by re-intrant, but your comment points out I have created an endless while-loop! Apart from moving to Java 6, I had commented out some lines to reduce logging, not noticing I had created an endless loop by doing so. I only did this in a jar compiled for Java 6, so everytime I tried rolling back to Java 5, I also used the old jar (which didn't have the lines commented out), and the old jar didn't have the infinite loop. Stupid! I was completely sure the change from Java 5 to Java 6 was a far bigger one than the commented-out-lines, but this turns out to be not true at all in this case! Best regards, and thanks again! Jesse. Leon Rosenberg-3 wrote: Hello Jesse, is the Workflow re-intrant? If yes: this is odd: you are iterating in a re-intrant action (i assume the action is re-intrant) over a shared variable? Vector vecOids = new Vector(); in the method: Iterator oidIterator = vecOids.iterator(); while (oidIterator.hasNext()) { //System.out.println(Workflow/doAction: oid= + ((ObjectId)oidIterator.next()).getKey()); } and you are modifying this vector at multiple places in the same class. You should probably unit-test this code for concurrency. regards Leon -- View this message in context: http://old.nabble.com/Tomcat-100--CPU-usage-after-moving-from-Java-5-to-6-tp27305110p27306543.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 100% CPU usage after moving from Java 5 to 6
Jesse Klaasse wrote: ... ctory -Dcom.sun.management.jmxremote -XX:MaxPermSize=512m -Xloggc:D:\logs\gc\tomcat-gc.log -XX:+PrintGCDetails -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+UseTLAB -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -Xms4096m -Xmx10240m Apart from your basic issue (now solved) : If I remember correctly, one area that has had some changes between Java 1.5 and 1.6, is memory management and GC, generally. It might not be a bad idea to review the settings above, to see if they are still appropriate for 1.6. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 100% CPU usage after moving from Java 5 to 6
Jesse Klaasse wrote: Hi Leon, I don't know what you mean exactly by re-intrant, but your comment points out I have created an endless while-loop! Apart from moving to Java 6, I had commented out some lines to reduce logging, not noticing I had created an endless loop by doing so. I only did this in a jar compiled for Java 6, so everytime I tried rolling back to Java 5, I also used the old jar (which didn't have the lines commented out), and the old jar didn't have the infinite loop. Stupid! I was completely sure the change from Java 5 to Java 6 was a far bigger one than the commented-out-lines, but this turns out to be not true at all in this case! IME, the change from java 5 to java 6 is entirely transparent to the application, and the only difference I've seen is a bit better performance under 6. That probably won't be everybody's experience, but it is mine. D - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Data Binding in JSP
Keep in mind the overall architecture. The user is actually using an HTML page containing HTML fields. The browser (nor the HTML) has no actual knowledge of the DB or any binding or ORM you have on your server. So, on the server side, you have 2 primary components; servlets for validating and processing the incoming page data and jsps for dynamically generating the HTML form for the user's consumption and use. This is a standard development pattern, and many ORMs exist (read up on Hibernate) for helping with the data, and many frameworks exist for helping with the control architecture (see Struts and Spring). In the middle of it all, you should have a nice set of POJOs for holding this data. The servlets can send populate these POJOs to the JSPs for inclusion in the HTML output. So, the question really becomes, what are you missing? -Original Message- From: jithu mada [mailto:jithu.m...@gmail.com] Sent: Sunday, January 24, 2010 6:28 PM To: Tomcat Users List Subject: Data Binding in JSP Hi, I need suggestion on how to do Data binding in JSP's? I have a requirement, which is to display the table data and the user can add,update or delete the data to it. I am using and JSP's and Servlets. I was searching online to find if there are any data binding frameworks available which I can use, so that when the user modifies the table data, I can bind it directly to the java beans. But only thing I found was displaying data, pagination and sorting. I couldn't find much info on binding the modified data. If you have done something similar before of have any suggestions, please send it to me. thanks, Jithu - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
New project to Apache Software Foundation
Hi, Can anyone guide me about the steps to start a new project at Apache Software Foundation. I want to upload the project into its repository and start creating the group, user lists..etc so that the project team would grow and there by it would be enhanced if anyone intersted about my project. Best Regards, Kranti K K Parisa
RE: Files in Subdirectories not being served.
From: Matt Eustace [mailto:meust...@attevo.com] Subject: Files in Subdirectories not being served. I have just created an application by typing in the virtual path and physical path of the files. Typing in where? My inf file is: Where is your so-called inf file located? ?xml version=\q1.0\q encoding=\qutf-8\q?\ Context docBase=C:/Progra~1/Opentext/support path=/img useNaming=false workDir=work/Catalina/localhost/img\ /Context\ Depending on where the above is located, the path attribute is likely not allowed; docBase might also be illegal, but it's most likely just wrong. What's under the Opentext/support directory? I've tried wildcards on the end of the docBase and path, neither of which made any difference. Good, because they're not allowed. Any ideas? I've tried Google and the docs and can't find anything :-( Have your tried looking in your Tomcat logs for deployment errors rather than Google? - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: New project to Apache Software Foundation
From: Kranti(tm) K K Parisa [mailto:kranti.par...@gmail.com] Subject: New project to Apache Software Foundation Can anyone guide me about the steps to start a new project at Apache Software Foundation. Start here: http://www.apache.org/foundation/how-it-works.html - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: New project to Apache Software Foundation
2010/1/25 Kranti™ K K Parisa kranti.par...@gmail.com: Hi, Can anyone guide me about the steps to start a new project at Apache Software Foundation. You may want to read up on the Incubator[1]... --tim [1] - http://incubator.apache.org/incubation/Incubation_Policy.html - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Data Binding in JSP
On Sun, Jan 24, 2010 at 4:28 PM, jithu mada jithu.m...@gmail.com wrote: I have a requirement, which is to display the table data and the user can add,update or delete the data to it. I am using and JSP's and Servlets. I was searching online to find if there are any data binding frameworks available which I can use, so that when the user modifies the table data, I can bind it directly to the java beans. I normally use home-brewed AJAX for this, but in the absence of any other references, check out DWR http://directwebremoting.org/ or possibly GWT http://code.google.com/webtoolkit/. HTH, -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Disabled use of AcceptEx() WinSock2 API error on Windows 7
From: Richard Cooke [mailto:richa...@saratoga.co.za] Subject: Re: Disabled use of AcceptEx() WinSock2 API error on Windows 7 My Tomcat installer file says version 6.0.20. I do not have a version.bat file. My java version is 1.6.0.18. Post your Connector configuration so we can take a look at it. You might also want to try Tomcat 6.0.24; my guess is that won't help, but it doesn't hurt to try. Also, the .zip download gives you a bit more flexibility in how you start Tomcat, so I always prefer that one over the .exe download. See if Tomcat will come up with the startup.bat script, and only after that try to install it as a service. - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: New project to Apache Software Foundation
thanks Chuck, i shall check that in detail. Best Regards, Kranti K K Parisa On Mon, Jan 25, 2010 at 8:00 PM, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: Kranti(tm) K K Parisa [mailto:kranti.par...@gmail.com] Subject: New project to Apache Software Foundation Can anyone guide me about the steps to start a new project at Apache Software Foundation. Start here: http://www.apache.org/foundation/how-it-works.html - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
From: Steve Ryder [mailto:sry...@jsrsys.com] Subject: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource Resource name=jdbc/MySql auth=Container type=javax.sql.Datasource factory=org.apache.commons.dbcp.BasicDataSourceFactory The specified factory is for the standard Apache commons DBCP, not the one bundled with Tomcat. You might try removing it and let the Tomcat DBCP factory do its thing. My jdbc driver jar is: mysql-connector-java-5.0.8-bin.jar Where is the JDBC jar located? Since you're upgrading, why not upgrade to 6.0.x? (5.5 is not getting much in the way of active development these days.) - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Data Binding in JSP
I've had good success with DWR and GWT. For GWT, there are a number of available useful extensions, and in particular, SmartGWT (http://code.google.com/p/smartgwt/ ) has some sophisticated Grids available with automated management of bound data. On Jan 25, 2010, at 9:32 AM, Hassan Schroeder wrote: On Sun, Jan 24, 2010 at 4:28 PM, jithu mada jithu.m...@gmail.com wrote: I have a requirement, which is to display the table data and the user can add,update or delete the data to it. I am using and JSP's and Servlets. I was searching online to find if there are any data binding frameworks available which I can use, so that when the user modifies the table data, I can bind it directly to the java beans. I normally use home-brewed AJAX for this, but in the absence of any other references, check out DWR http://directwebremoting.org/ or possibly GWT http://code.google.com/webtoolkit/. HTH, -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: New project to Apache Software Foundation
Just a note, it will probably be easier for you to start a project on java.net or sourceforge. regards Leon 2010/1/25 Kranti™ K K Parisa kranti.par...@gmail.com: thanks Chuck, i shall check that in detail. Best Regards, Kranti K K Parisa On Mon, Jan 25, 2010 at 8:00 PM, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: Kranti(tm) K K Parisa [mailto:kranti.par...@gmail.com] Subject: New project to Apache Software Foundation Can anyone guide me about the steps to start a new project at Apache Software Foundation. Start here: http://www.apache.org/foundation/how-it-works.html - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Files in Subdirectories not being served.
2010/1/25 Matt Eustace meust...@attevo.com: 127.0.0.1 - - [22/Jan/2010:15:50:50 +] GET /img/brava/LogoBall_DK.gif HTTP/1.1 404 1030 Note, that HTTP is case-sensitive. If you request does not match casing of the actual folders and file, Tomcat won't serve them. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: mod_jk errors with tomcat 6.0.20 and Apache 2.0.52
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matt, On 1/22/2010 5:09 PM, Matt Turner wrote: In between times I tried the ProxyPass which seems to work fine, but I'd much rather use plain AJP so I'll try that next. AJP is the protocol used by both mod_jk and mod_proxy_ajp (which is what you get if you use ProxyPass with an ajp:// URL). Which one depends on your requirements: mod_proxy_ajp is bundled with Aapche httpd and therefore has (usually) no additional compilation and/or configuration to perform. Also, all configuration for URL mapping, etc. occurs within httpd.conf. mod_jk is separate and should be compiled on the target system, which is inconvenient for some users. mod_jk is much older and had therefore undergone much more in the way of testing in the wild. While configuration can be done in httpd.conf, historically it's always been done in an external file with a proprietary format, which increases complexity. In my experience, mod_jk is better with complex configurations than mod_proxy_ajp, but mod_proxy_ajp is much more convenient for simple configurations. I've had problems previously getting CAS working where the SSL is handled by the webserver - however from what everyone has said and having read around the issue a bit more, it does sound like using AJP ought to work, so long as Apache is configured to pass through all the relevant SSL and cert. info to tomcat (presumably so that isSecure() can work, plus I think CAS validates certificates too). This will work: I've recently been playing around with client certificates passed-through Apache httpd and it worked quite well once the stars aligned for me (and I upgraded certain components that had known issues with SSL cert chains). I had Apache httpd validate the certs and then pass them through to Tomcat, where I performed a manual certification-checking process as a double-check as well as to pull some information from the cert for identification purposes. Good luck, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktdxAUACgkQ9CaO5/Lv0PA80wCeIPVTty+amdv3Nuj2pdI1n6Vh wloAnjU7hz7RkhYH/24YfdW7ARdH3lxL =J/l8 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
When I remove the factory line I now get: Cannot create resource instance 2010-01-25 15:56:06:*WARNING*Connection to jdbc/MySql:: connect Other exception: Cannot create resource instance 2010-01-25 15:56:06:Driver=com.mysql.jdbc.Driver The libraries are all in common\lib. The ones I have added since the 5.5 install are: jsrweb (my Java code), mysql-connector-java-5.0.8-bin.jar, naming-common.jar, naming-java.jar, mail.jar, and activation.jar. I picked 5.5 because it is not getting active develpment, yet supports Java 1.5, and has all the features I need hoping to minimize incompatabilities. My Java connect code reads: (indentation was lost when I copied) private void connect(String dbName) { lastException = OK; try { // Class.forName(org.gjt.mm.mysql.Driver); ---I changed this last night hoping to fix problem. sysout.display(Driver=com.mysql.jdbc.Driver); Class.forName(com.mysql.jdbc.Driver); } catch (Exception E) {lastException= Unable to load driver; E.printStackTrace(); sysout.display(lastException);} try { sql = Connection to jdbc/MySql:; Context myContext = new InitialContext(); Context envContext = (Context)myContext.lookup(java:comp/env); javax.sql.DataSource ds = (javax.sql.DataSource)envContext.lookup(jdbc/MySql); conn = ds.getConnection(); stmt = conn.createStatement(); sql = USE + dbName; // attempt to mymic jdbcConnect set for dbName! stmt.execute(sql); sysout.display(**+sql + : connection to jdbc/MySql established.); } catch (SQLException E) { lastException=*WARNING*+sql+ : connect SQL exception: + E.getMessage(); sysout.display(lastException); //System.exit(4); } catch(Exception eOther) { lastException=*WARNING*+sql+ : connect Other exception: + eOther.getMessage(); sysout.display(lastException); //System.exit(4); } } - Original Message - From: Caldarale, Charles R chuck.caldar...@unisys.com To: Tomcat Users List users@tomcat.apache.org Sent: Monday, January 25, 2010 8:52 AM Subject: RE: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource From: Steve Ryder [mailto:sry...@jsrsys.com] Subject: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource Resource name=jdbc/MySql auth=Container type=javax.sql.Datasource factory=org.apache.commons.dbcp.BasicDataSourceFactory The specified factory is for the standard Apache commons DBCP, not the one bundled with Tomcat. You might try removing it and let the Tomcat DBCP factory do its thing. My jdbc driver jar is: mysql-connector-java-5.0.8-bin.jar Where is the JDBC jar located? Since you're upgrading, why not upgrade to 6.0.x? (5.5 is not getting much in the way of active development these days.) - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
Some more testing... I added displays before each of the connect statements. I get (still with no factory): 2010-01-25 16:27:07:*WARNING*Connection to jdbc/MySql:: connect Other exception: Cannot create resource instance 2010-01-25 16:27:07:JsrSQL: Context cast successfull 2010-01-25 16:27:07:Driver=com.mysql.jdbc.Driver which tells me the failure is on the DataSource cast statement. I then added factory back in and got: 2010-01-25 16:35:01:*WARNING*Connection to jdbc/MySql:: connect Other exception: org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource 2010-01-25 16:35:01:JsrSQL: Context cast successfull 2010-01-25 16:35:01:Driver=com.mysql.jdbc.Driver So, failure is in same place with factory, but a different error. I appreciate your suggestions, and look forward to other things I might need to change. - Original Message - From: Caldarale, Charles R chuck.caldar...@unisys.com To: Tomcat Users List users@tomcat.apache.org Sent: Monday, January 25, 2010 8:52 AM Subject: RE: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource From: Steve Ryder [mailto:sry...@jsrsys.com] Subject: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource Resource name=jdbc/MySql auth=Container type=javax.sql.Datasource factory=org.apache.commons.dbcp.BasicDataSourceFactory The specified factory is for the standard Apache commons DBCP, not the one bundled with Tomcat. You might try removing it and let the Tomcat DBCP factory do its thing. My jdbc driver jar is: mysql-connector-java-5.0.8-bin.jar Where is the JDBC jar located? Since you're upgrading, why not upgrade to 6.0.x? (5.5 is not getting much in the way of active development these days.) - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
JMX Client UnmarshalException with JmxRemoteLifecycleListener and useLocalPorts=true
Dear all, I faced a problem enabling JmxRemoteLifecycleListener with useLocalPorts=true : my hyperic agent fails to connect with an UnmarshalException caused by a ClassNotFoundException on JmxRemoteLifecycleListener$RmiClientLocalhostSocketFactory (details below). The workaround I found is to copy catalina-jmx-remote.jar under $HYPERIC_AGENT_HOME/bundles/agent-4.1.2-1053/lib/ . However, for a long term fix, I would find interesting to have useLocalPorts=true working out-of-the-box with tools like Hyperic HQ. Surprisingly, this problem occurs with hyperic agent but not with VisualVM ; I didn't have the time to investigate? I don't know yet if the long term fix is on hyperic-agent or tomcat side. I just wanted to share the issue and the workaround with the community as I didn't find anything on Google. If someone has insights on this problem, I am very interested. Cyrille -- Cyrille Le Clerc clecl...@xebia.fr Environment : apache-tomcat-6.0.24, Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode), hyperic-agent-4.1.2-1053, Linux 2.6.9-78.ELlargesmp HYPERIC AGENT ERROR MESSAGE 2010-01-25 16:48:49,592 ERROR [Thread-0] [MeasurementCommandsService] Error getting real time measurement: Error contacting resource: Can't connect to MBeanServer [{jmx.username=system, jmx.url=service:jmx:rmi:///jndi/rmi://localhost:14008/jmxrmi}]: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: org.apache.catalina.mbeans.JmxRemoteLifecycleListener$RmiClientLocalhostSocketFactory (no security manager: RMI class loader disabled)]
Re: Data Binding in JSP
/* obviously starting the week seriously under-caffeinated */ And I totally forgot to mention Adobe Flex, which is built for exactly this kind of bi-directional data connection, if with a bit of a learning curve. -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: CSV File Save as dialogue defaults to HTM file
Pid - Would adding the following mime-mapping to the web.xml file help? mime-mapping extension.csv/extension mime-typetext/csv/mime-type /mime-mapping There is no mapping for .csv in the Tomcat default web.xml file in the conf directory. I seem to remember addressing a similar problem many, many moons ago for our app by adding those lines. Jeff -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Monday, January 25, 2010 4:03 AM To: users@tomcat.apache.org Subject: Re: CSV File Save as dialogue defaults to HTM file On 25/01/2010 09:17, Ran Harpaz wrote: Hello, I'm using Jetspeed 1.6, running on Tomcat. In a portlet I developed, I create a .csv file and print a link to it. The user then needs to right-click on the file and select save file as. The dialogue that pops up defaults to file type HTML file, and replaces the .csv extension of the file I link to with .htm. Is there anyway to resolve this? I really need to give access to the csv file as-is, and not bother my clients more than neccessary. Are you setting the Content-type header to text/csv, or are you just generating it with a JSP? The latter will automatically set text/html as the content type. p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org *** NOTICE * This message is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply or by telephone (call us collect at 512-343-9100) and immediately delete this message and all its attachments. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: CSV File Save as dialogue defaults to HTM file
Alessandro Bahgat wrote: On Mon, Jan 25, 2010 at 11:02 AM, Pid p...@pidster.com wrote: On 25/01/2010 09:17, Ran Harpaz wrote: Hello, I'm using Jetspeed 1.6, running on Tomcat. In a portlet I developed, I create a .csv file and print a link to it. The user then needs to right-click on the file and select save file as. The dialogue that pops up defaults to file type HTML file, and replaces the .csv extension of the file I link to with .htm. Is there anyway to resolve this? I really need to give access to the csv file as-is, and not bother my clients more than neccessary. Are you setting the Content-type header to text/csv, or are you just generating it with a JSP? The latter will automatically set text/html as the content type. You may also want to change the content-disposition header in order to make your server prompt the user with the save as dialog: For example, response.setHeader(Content-disposition, attachment; filename= + defaultCsvFilename ); Regards, Alessandro - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Thank you, but this solution doesn't seem to work on Jetspeed, due to the fact that I'm running JSR-168 Portlets on it. I don't believe they support changing the response's ContentType. I wanted to know if there was anything about the Tomcat platform that could result in a CSV file defaulting to an HTM file, and if there was anything to do about it. -- View this message in context: http://old.nabble.com/CSV-File-%22Save-as%22-dialogue-defaults-to-HTM-file-tp27303866p27308426.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
SSL error reported from windows socket
Hi All, I am getting intermittant windows ssl error regarding connections. Something like socket error code 12157 ERROR_INTERNET_SECURITY_CHANNEL_ERROR. It is intermittant and I am load testing against Apache web server using loadrunner 9.0. We are using SSLV3 for Apache 2.2. There is some strange message in the error about retrys(0). Is there some control on the Apache side for setting the retries to more than 0? Thanks, -Tony - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Steve, On 1/25/2010 11:16 AM, Steve Ryder wrote: When I remove the factory line I now get: Cannot create resource instance 2010-01-25 15:56:06:*WARNING*Connection to jdbc/MySql:: connect Other exception: Cannot create resource instance Ok. The libraries are all in common\lib. The ones I have added since the 5.5 install are: jsrweb (my Java code), mysql-connector-java-5.0.8-bin.jar, naming-common.jar, naming-java.jar, mail.jar, and activation.jar. I picked 5.5 because it is not getting active develpment, yet supports Java 1.5, and has all the features I need hoping to minimize incompatabilities. Fair enough. My Java connect code reads: (indentation was lost when I copied) private void connect(String dbName) { lastException = OK; try { // Class.forName(org.gjt.mm.mysql.Driver); ---I changed this last night hoping to fix problem. sysout.display(Driver=com.mysql.jdbc.Driver); Class.forName(com.mysql.jdbc.Driver); } catch (Exception E) {lastException= Unable to load driver; E.printStackTrace(); You don't need any of the above if you are using a connection pool: the pool will register the driver for you. sysout.display(lastException);} What does this print, including the stack trace from the catch block? try { sql = Connection to jdbc/MySql:; Context myContext = new InitialContext(); Context envContext = (Context)myContext.lookup(java:comp/env); Ok. javax.sql.DataSource ds = (javax.sql.DataSource)envContext.lookup(jdbc/MySql); conn = ds.getConnection(); stmt = conn.createStatement(); Ok. sql = USE + dbName; // attempt to mymic jdbcConnect set for dbName! stmt.execute(sql); This is not necessary as you have already selected your db via the connection URL. catch (SQLException E) { lastException=*WARNING*+sql+ : connect SQL exception: + E.getMessage(); sysout.display(lastException); //System.exit(4); } catch(Exception eOther) { lastException=*WARNING*+sql+ : connect Other exception: + eOther.getMessage(); sysout.display(lastException); //System.exit(4); } So, the above is the source of the error message which has all your extra stuff like *WARNING*Connection to jdbc/MySql:: connect SQL exception: plus the message from the real exception. I don't recognize Cannot create resource instance so it would be helpful to show the full stack trace and the real exception that caused the message to print. I would recommend not catching Exception unless there is a good reason to do so: allow the exception to propagate up the stack to a place where it can be appropriately caught and dealt with, or at least logged properly. What happens when this code fails and the conn member isn't set properly? I'm guessing you either get NullPointerExceptions later in your code, or you have to have a bunch of null checking in your query code which is kind of ugly. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEUEARECAAYFAktd3f0ACgkQ9CaO5/Lv0PD6CgCXWjgZIBoBQrgS7ciU7Y4L8TGt TQCbBC+bDwqmlEgAeiCXp/PdeweDFWM= =aaxM -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [OT] Securing Tomcat Applications from Reverse Engineering
Good points all around. We had the same issues with our CEO worrying about copies of the app being passed around when we started targeting markets where piracy is fairly common. Eventually, we convinced him the best way to address them was via legal and marketing techniques. That is, a very tight license and convincing the customer that our product provides a unique tactical advantage that they would want to give to their competitors. We did make a few technical product changes to aid in the license compliance arena, one of which was incorporating a license key that is uniquely and obviously tied to the company licensing the product and stored along with the data. The theory being that a customer (or his employee) might be willing to fork over a copy of the code, but not their proprietary data. It's not perfect, but it seems to get the job done. -Original Message- From: André Warnier [mailto:a...@ice-sa.com] Sent: Thursday, January 21, 2010 4:56 PM To: Tomcat Users List Subject: Re: [OT] Securing Tomcat Applications from Reverse Engineering Jeffrey Janner wrote: André - Welcome to the world of small business, for-profit software development. This is a more common attitude that you might be aware. I was being somewhat ironic. Being myself a small for-profit software development business, I am well aware of the circumstances. ;-) But here are another few arguments (apart from the ones I already mentioned in another post) : If you are a small software business whose customers are businesses that use your product, and your product is good and your prices are reasonable, chances are good that none of your customers is even going to bother taking the time to try to copy your product. If they themselves are small/medium businesses, what would they do with it ? They have their own business to run. They are not a software company, you are. And if they are big, they will never risk their reputation and their money trying it. And, agreeing with another post by Leon, you are probably much better off spending your time improving and supporting your product, than developing ways to try protecting it from unfair copying. Things would be different of course if your product was something destined for the mass-market, or if you intend to sell it through resellers, or if your customers are themselves software companies. I will not mention the fact that in all of the above cases, your highest level of risk is probably inside, not outside. And if you really insist on protecting your code, then I am afraid that Java is not the best choice of tool. And I'll finish with another sarcastic note about code obfuscation : in my experience, it is not really necessary to put a lot of effort into this. Other people's code tends to be naturally obfuscated, all by itself. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org *** NOTICE * This message is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply or by telephone (call us collect at 512-343-9100) and immediately delete this message and all its attachments. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Adding/removing hosts dynamically?
Chuck said: Try the HTML version of host-manager to get familiar with it: http://localhost:8080/host-manager/html Note that the updates made by the HTML and plain text servlets are not persistent, so will be lost upon Tomcat restart. You'll need some additional means to preserve the added hosts. Any idea why this is so? The 4.x version of this feature, while clumsy and slightly buggy, updated the server.xml file. Jeff *** NOTICE * This message is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply or by telephone (call us collect at 512-343-9100) and immediately delete this message and all its attachments. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: question for deploystartup forROOT.war on tomcat cluster
Thanks for your reply, but I do not see any errors and also cannot find any configuration error. -Original Message- From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] Sent: Saturday, January 23, 2010 1:44 PM To: Tomcat Users List Subject: Re: question for deploystartup forROOT.war on tomcat cluster 2010/1/23 Okubo, Yasushi (TSD) yasushi.ok...@takedasd.com: 1. What attributes are set on the Host element of your server.xml Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false !-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html -- Valve className=org.apache.catalina.ha.authenticator.ClusterSingleSignOn / !-- Access log processes all example. Documentation at: /docs/config/valve.html -- Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=webclust1_access_log. suffix=.log pattern=common resolveHosts=false/ /Host http://tomcat.apache.org/tomcat-6.0-doc/config/host.html 2. Are there any Context elements inside Host in your server.xml? Remove them, if there are any. None. 3. When ROOT fails to deploy at startup, does Tomcat Manager at that host shows any webapplication mapped to the same path? (E.g. present, but not started). It is running by seeing from the manager, but it is not starting from the log and by accessing from URL(hostname:port/). OK - Listed applications for virtual host localhost /manager:running:1:manager /:running:0:/ /host-manager:running:0:host-manager ... ... HTTP Status 404 - / type Status report message / description The requested resource (/) is not available. 4. Any relevant messages in the log files? No Error generated, but After Stop-Start or Reload from manager generates the following message Jan 25, 2010 10:18:43 AM org.apache.catalina.core.StandardContext start INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/] has already been started Jan 25, 2010 10:18:45 AM org.apache.catalina.core.StandardContext start INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/] has already been started Jan 25, 2010 10:26:25 AM org.apache.catalina.core.StandardContext reload INFO: Reloading this Context has started Jan 25, 2010 10:26:25 AM org.apache.catalina.ha.session.DeltaManager stop INFO: Manager [localhost#] expiring sessions upon shutdown Jan 25, 2010 10:26:25 AM org.apache.catalina.ha.session.DeltaManager start INFO: Register manager localhost# to cluster element Engine with name Catalina Jan 25, 2010 10:26:25 AM org.apache.catalina.ha.session.DeltaManager start INFO: Starting clustering manager at localhost# Jan 25, 2010 10:26:25 AM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions WARNING: Manager [localhost#], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, -6, -56, 33}:4000,{10, -6, -56, 33},4000, alive=436811673,id={-73 -106 -118 34 90 37 69 -120 -107 118 21 127 50 12 28 -85 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. Jan 25, 2010 10:27:25 AM org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions SEVERE: Manager [localhost#]: No session state send at 1/25/10 10:26 AM received, timing out after 60,081 ms. When I restart tomcat node [shutdown.sh/startup.sh], My ROOT.war needs to read database and to initialize servlets as specified in its web.xml, but it looks like it is not reading the data from database under cluster setup like other applications do. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: question for deploystartup forROOT.war on tomcat cluster
2010/1/25 Okubo, Yasushi (TSD) yasushi.ok...@takedasd.com: OK - Listed applications for virtual host localhost This: /manager:running:1:manager /:running:0:/ /host-manager:running:0:host-manager and this: HTTP Status 404 - / type Status report message / description The requested resource (/) is not available. means that the web application is deployed and running. When there is no ROOT application deployed, Tomcat will respond with an empty zero-length response (it looks like a blank page in a browser). It looks like a web application that does not have a welcome page. Please check that your ROOT.war was properly expanded into /webapps/ROOT folder, and that those files (especially WEB-INF/web.xml) are readable by the user that runs that Tomcat instance. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: CSV File Save as dialogue defaults to HTM file
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ran, Thank you, but this solution doesn't seem to work on Jetspeed, due to the fact that I'm running JSR-168 Portlets on it. I don't believe they support changing the response's ContentType. I wanted to know if there was anything about the Tomcat platform that could result in a CSV file defaulting to an HTM file, and if there was anything to do about it. Tomcat will not mess around with any file extensions, etc. If you don't set the Content-Disposition with the attachment attribute, then the filename will default to that used in the URL, which likely ends in .htm in your webapp, apparently. In this case, you might have to switch to using a plain-old servlet (which I would highly recommend over the use of a JSP in this case, as JSPs can add all sorts of unwanted output to your generated files). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktd7mEACgkQ9CaO5/Lv0PAFNQCgjAPtEMbqkuitt0EG08JKZgPM 76cAn2oxfMPsNbCm2/x/7sAd3lGHbD/a =7F2H -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Adding/removing hosts dynamically?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jeffrey, On 1/25/2010 1:28 PM, Jeffrey Janner wrote: Chuck said: Try the HTML version of host-manager to get familiar with it: http://localhost:8080/host-manager/html Note that the updates made by the HTML and plain text servlets are not persistent, so will be lost upon Tomcat restart. You'll need some additional means to preserve the added hosts. Any idea why this is so? The 4.x version of this feature, while clumsy and slightly buggy, updated the server.xml file. Let's say you have an XML file and you want to insert some data into it with a program. Where do you insert it? How do you handle whitespace, comments, etc.? It's just something that is a PITA and nobody has wanted to put the effort into doing it. Patches are always welcome. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktd7sYACgkQ9CaO5/Lv0PBApQCfSaLq6nq3DWMmdn+A6OvzgPtm 9asAoJZ+e9LTszv/QdfWzYQlfJkX40c5 =SnAd -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: TLS+SSLv3 but no SSLv2
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jens, On 1/25/2010 8:16 AM, Jens Neu wrote: Chris, thanks for all your help, everyting is up and running. I settled for 'ALL:!EXP:!LOW:!SSLv2' which is exaclty what I need. You should take a look at this guy's tool, here: http://www.unspecific.com/2009/02/16/ssl-cipher-check this looks helpful, unfortunately the script (not the page) seems to be 404 :( Yup, which was a complaint mentioned (and fixed) in the comments. Again, the script itself yields some dubious results. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktd7vsACgkQ9CaO5/Lv0PDLnQCfSZhQO4a+jLAkfUwavIvj7Bq4 icMAn0oZgUY5kW4Xwicz55p0g8tj98vA =DLCY -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [us...@httpd] SSL error reported from windows socket
Hopefully you are right. It is from the loadrunner virtual user logs and it is a windows API but that may only try to point someone in the right direction not be a root cause. I am having someone look at the Windows settings to see if that is where the problem is. I am hoping to understand what the retrys(0) is all about regardless of the root cause of the error. I would want 5 retries before stopping to try to connect to a port but not sure if it means 0 retries or infinite retries. Thanks, -Tony --- On Mon, 1/25/10, William A. Rowe Jr. wr...@rowe-clan.net wrote: From: William A. Rowe Jr. wr...@rowe-clan.net Subject: Re: [us...@httpd] SSL error reported from windows socket To: us...@httpd.apache.org Cc: Tony Anecito adanec...@yahoo.com, Tomcat Users Group users@tomcat.apache.org Date: Monday, January 25, 2010, 11:14 AM On 1/25/2010 10:05 AM, Tony Anecito wrote: Hi All, I am getting intermittant windows ssl error regarding connections. Something like socket error code 12157 ERROR_INTERNET_SECURITY_CHANNEL_ERROR. This message has no relationship to Apache httpd that I'm aware of, it is from a different set of APIs altogether. Is this from your error.log? It is intermittant and I am load testing against Apache web server using loadrunner 9.0. We are using SSLV3 for Apache 2.2. There is some strange message in the error about retrys(0). Is there some control on the Apache side for setting the retries to more than 0? I believe it's a loadrunner configuration, if I had to guess. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: mod_jk codepage in header values
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mirko, On 1/25/2010 4:06 AM, Mirko Solic wrote: How i understand i don't have control when environment variables on apache side are putted in http header and sent to tomcat side. This is done by mode_jk automatically. I would hate to put encoded values already in environment variables on apache side so mod_jk would transfer them corectly on tomcat side but then other web pages that uses this variables wouldn't work no more. Right way would be (for my understanding) that mod_jk would encode environment varibales according to the rules of RFC 2047. Again, mod_jks job is to deliver the variables (as HTTP headers, right?) without any manipulation whatsoever. It is not mod_jk's job to re-encode things that aren't acceptable to your webapp. If you want to use RFC2047-encoded values, then go ahead and use them. You'll just have to write some code into your webapp to decode them, as Tomcat does not directly support RFC2047 (though it also doesn't interfere with it). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktd758ACgkQ9CaO5/Lv0PDvygCgnFj6uigM/a5WHnu9Eq84+vcU j+4An3SK7tv8KwsqZgIoKFJPXDuwhN9C =QW6J -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: mod_jk codepage in header values
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mirko, On 1/25/2010 4:24 AM, Mirko Solic wrote: On Thu, 2010-01-21 at 10:34 -0500, Christopher Schultz wrote: What would be better is to do something like this: java.net.URLEncoder.encode(request.getHeader(headerName), UTF-8) Of course, this will only work if your client knows that's how the encoding will be done. Yes but what if mod_jk chooses not to send non ISO-8859-1 header values over to tomcat side. This is simply not mod_jk's job: mod_jk pretty much delivers the exact bytes sent by the client. Trust me: it's better that way. According to André Warnier: But, because the HTTP RFC specifies that HTTP headers should contain only US-ASCII character data, mod_jk would be allowed, if it finds non-US-ASCII data in a HTTP header, to strip this data or ignore the header or something like that. I don't know if mod_jk actually does this, but if it did, it would be justified, because according to the HTTP RFC this would be an invalid header. Than i have no values to decode to. I can tell you there's no reason for mod_jk to do this, and I don't believe it does, for the testing I have performed does not demonstrate that behavior. AAI needs to support whatever encoding you intend to use. You can't simply transcode things in an arbitrary way and expect AAI to work properly. What does their documentation say about what format these values should take? The problem is when i want to get data from AAI. AAI is sending data in utf-8 but this is broken when data is send from apache side to tomcat side. So, the bytes are being sent as UTF-8 instead of US-ASCII. I think you're back to where we started: re-encoding strings. It's possible that you may run into a situation where the re-encoding is simply going to fail because of how badly the string has been damaged by an incorrect decoding. Maybe that's not an issue with ISO-8859-1 (at least it's a 1-byte encoding and all bytes are ostensibly legal). A better strategy would be for AAI to provide a numeric token (easily passable in HTTP headers without any encoding issues) and then provide an HTTP-based and/or XML-based API that uses proper document encoding to send textual data across the wire. Using HTTP headers for text data sucks! I agree with you here: Using HTTP headers for text data sucks!. But AAI is not supported on tomcat yet. However it is supported on apache and the only way for me if i want to use AAI and tomcat is to use mod_jk connector. But mod_jk is transporting environment variables from apache to tomcat in HTTP header. That sounds like an AAI bug, not an httpd/mod_jk/Tomcat bug: mod_jk sends environment variables as request /attributes/, not request headers. (See the JkEnvVar directive in http://tomcat.apache.org/connectors-doc/reference/apache.html). If AAI is creating new request headers, it's AAI's fault for incorrectly formatting them. If you can get this data from a request /attribute/ instead, then maybe that's a better option (though there are no references to character encoding in the documentation for JkEnvVar). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktd8hEACgkQ9CaO5/Lv0PBCdACfXGvpCFULt8Cs49xeQjdv+Rwz 2oAAmgNUr3WdHwRJ9T9x5XS+Jx3PkU7c =tG4b -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 100% CPU usage after moving from Java 5 to 6
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jesse, On 1/25/2010 8:25 AM, Jesse Klaasse wrote: I don't know what you mean exactly by re-intrant Re-entrant (never seen it as re-intrant) means that more than one thread of execution might be running the same code concurrently. I've never heard this term used with languages that support threading directly (where it's simply called concurrency), but Leon was basically asking if your method was threadsafe (or if it didn't matter, because there was no shared data in the mix). but your comment points out I have created an endless while-loop! Oops. That ought to create 100% usage :) cvs diff is your friend :) - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktd9OQACgkQ9CaO5/Lv0PBISACfYFKQcf43RwMJbl6zdRKayQOF Bj8AoKWHB2N7iX0iZB7Sjx06AFC67nTp =LEu4 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: log the time between each request being read and the first byte of the response served.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 LE, On 1/25/2010 5:46 AM, LE wrote: thanks for the valve wrapper! No problem. I wrote a program a long time ago that scans a class and dumps a wrapper for it. :) But still not sure where i can grab the time for the first byte leaving tomcat to the client. I warned you that this wouldn't be straightforward. One way is to wrap the OutputStream and/or Writer with one that stores the time when the first non-trivial write() call is made. I call now the response.getContentCount() method in every ActionHook action method. every buffer write i get an ACTION_COMMIT code: 3 event if the response is larger than 8184 bytes i get more ACTION_COMMIT code: 3 events (size of response/8184 = quantity of ACTION_COMMIT code: 3 events). Is the first ACTION_COMMIT code: 3 event sent after the client response to the first write ? I have no idea: I don't know anything about Comet. :( Good luck, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktd9ZoACgkQ9CaO5/Lv0PAu1ACfZH3igZjWKKwx5WJSi9XBKPx8 AeoAoJ4lOsz0vKhCk/qvMTw0YkbFInSF =r+OX -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: RMI reaper thread prevents JVM from exiting
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thomas, On 1/25/2010 2:48 AM, Thomas Chabaud wrote: Le 22/01/2010 18:13, Christopher Schultz wrote : This thread over on the Sun forums (http://forums.sun.com/thread.jspa?threadID=169975) says that you can either unexport all your objects or call System.exit(). :( Are there some objects that you may have forgotten to unexport? I don't think so. Here is how I unexport my objects : Registry lReg = LocateRegistry.getRegistry(RMI_PORT); String[] lNames = lReg.list(); for (String lName : lNames) { Remote lRemoteObj = lReg.lookup(lName); UnicastRemoteObject.unexportObject(lRemoteObj, true); lReg.unbind(lName); } Is there a way to safely check that all objects have been exported, because I don't want to call System.exit() in my web app, it is too ugly and dangerous. You've reached way beyond my understanding of RMI at this point. Is it possible that, like JNDI, you might have trees of objects instead of just a flat list? In that case, you'd have to recursively unexport/unbind objects to make sure you got everything. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktd9qEACgkQ9CaO5/Lv0PBtTwCgmk6qeVtwJ0M6reQr49xUEVyC XqkAnjLvXMAAXa64sWmEtRZ1upuvAxuw =z5J+ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
Starting from the bottom up of your suggestions: 1) I tried removing the try/catch. No can do, Java compiler forces me to catch the exceptions. 2) However, Java does provide a getStackTrace. There were 33 elements, but since pages that don't try to connect ARE working I think only the below apply: 2010-01-25 19:37:09:Stack(5)javax.servlet.http.HttpServlet.service(HttpServlet.java:802) 2010-01-25 19:37:09:Stack(4)org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) 2010-01-25 19:37:09:Stack(3)org.apache.jsp.index_jsp._jspService(index_jsp.java:89) 2010-01-25 19:37:09:Stack(2)com.jsrsys.web.JsrSQL.(JsrSQL.java:42) 2010-01-25 19:37:09:Stack(1)com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86) 2010-01-25 19:37:09:Stack(0)com.jsrsys.web.JsrSQL.connect(JsrSQL.java:503) 2010-01-25 19:37:09:*WARNING*Connection to jdbc/MySql:: connect Other exception: org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource 2010-01-25 19:37:09:JsrSQL: Context cast successfull 2010-01-25 19:37:09:Driver=com.mysql.jdbc.Driver Not much help here, but it is very good to be able to print the trace when debugging so glad I was able to learn how. I am now going to remove the Class.forName code and see if that changes any thing. - Original Message - From: Christopher Schultz ch...@christopherschultz.net To: Tomcat Users List users@tomcat.apache.org Sent: Monday, January 25, 2010 12:07 PM Subject: Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Steve, On 1/25/2010 11:16 AM, Steve Ryder wrote: When I remove the factory line I now get: Cannot create resource instance 2010-01-25 15:56:06:*WARNING*Connection to jdbc/MySql:: connect Other exception: Cannot create resource instance Ok. The libraries are all in common\lib. The ones I have added since the 5.5 install are: jsrweb (my Java code), mysql-connector-java-5.0.8-bin.jar, naming-common.jar, naming-java.jar, mail.jar, and activation.jar. I picked 5.5 because it is not getting active develpment, yet supports Java 1.5, and has all the features I need hoping to minimize incompatabilities. Fair enough. My Java connect code reads: (indentation was lost when I copied) private void connect(String dbName) { lastException = OK; try { // Class.forName(org.gjt.mm.mysql.Driver); ---I changed this last night hoping to fix problem. sysout.display(Driver=com.mysql.jdbc.Driver); Class.forName(com.mysql.jdbc.Driver); } catch (Exception E) {lastException= Unable to load driver; E.printStackTrace(); You don't need any of the above if you are using a connection pool: the pool will register the driver for you. sysout.display(lastException);} What does this print, including the stack trace from the catch block? try { sql = Connection to jdbc/MySql:; Context myContext = new InitialContext(); Context envContext = (Context)myContext.lookup(java:comp/env); Ok. javax.sql.DataSource ds = (javax.sql.DataSource)envContext.lookup(jdbc/MySql); conn = ds.getConnection(); stmt = conn.createStatement(); Ok. sql = USE + dbName; // attempt to mymic jdbcConnect set for dbName! stmt.execute(sql); This is not necessary as you have already selected your db via the connection URL. catch (SQLException E) { lastException=*WARNING*+sql+ : connect SQL exception: + E.getMessage(); sysout.display(lastException); //System.exit(4); } catch(Exception eOther) { lastException=*WARNING*+sql+ : connect Other exception: + eOther.getMessage(); sysout.display(lastException); //System.exit(4); } So, the above is the source of the error message which has all your extra stuff like *WARNING*Connection to jdbc/MySql:: connect SQL exception: plus the message from the real exception. I don't recognize Cannot create resource instance so it would be helpful to show the full stack trace and the real exception that caused the message to print. I would recommend not catching Exception unless there is a good reason to do so: allow the exception to propagate up the stack to a place where it can be appropriately caught and dealt with, or at least logged properly. What happens when this code fails and the conn member isn't set properly? I'm guessing you either get NullPointerExceptions later in your code, or you have to have a bunch of null checking in your query code which is kind of ugly. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEUEARECAAYFAktd3f0ACgkQ9CaO5/Lv0PD6CgCXWjgZIBoBQrgS7ciU7Y4L8TGt TQCbBC+bDwqmlEgAeiCXp/PdeweDFWM= =aaxM -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail:
How to map username.domain.com to www.domain.com/username
Hi, I have a small Web app where users can create and use their accounts and at the moment each user can access the homepage for his/her account at www.domain.com/username where username is his/her username. I want each user to be able to access his/her homepage at username.domain.com instead. I would appreciate that if someone could explain to me have can I achieve this. Thanks in advance, BC - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
Removing the Class.forName code did not change anything, I still get the same error. 2010-01-25 20:00:03:*WARNING*Connection to jdbc/MySql:: connect Other exception: org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource 2010-01-25 20:00:03:Stack(4)=org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) 2010-01-25 20:00:03:Stack(3)=org.apache.jsp.index_jsp._jspService(index_jsp.java:89) 2010-01-25 20:00:03:Stack(2)=com.jsrsys.web.JsrSQL.(JsrSQL.java:42) 2010-01-25 20:00:03:Stack(1)=com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86) 2010-01-25 20:00:03:Stack(0)=com.jsrsys.web.JsrSQL.connect(JsrSQL.java:504) 2010-01-25 20:00:03:JsrSQL: Context cast successfull I have now changed my stack trace display code to stop when it hits the org.apache.jasper... code. - Original Message - From: Christopher Schultz ch...@christopherschultz.net To: Tomcat Users List users@tomcat.apache.org Sent: Monday, January 25, 2010 12:07 PM Subject: Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: How to map username.domain.com to www.domain.com/username
From: Bytecode [mailto:bytec...@me.com] Subject: How to map username.domain.com to www.domain.com/username I want each user to be able to access his/her homepage at username.domain.com instead. Assuming you have DNS set up properly, use this: http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html Alternatively, use a filter to rewrite the request URLs to the internal format: http://tuckey.org/urlrewrite/ - 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.
RE: CSV File Save as dialogue defaults to HTM file
Ran - I'm unfamiliar with Jetspeed, so take what I say next with a grain of salt. When you say print a link to it, do you mean to say you add an A tag to the resulting page with the appropriate path? So the user is just clicking on a regular html A link? If so, then I would think adding a mime-mapping for the .csv extension to your web.xml would be sufficient. There is no mime-mapping for .csv in the standard web.xml file distributed with Tomcat. If instead your portlet/servlet is streaming the file (or anything more complicated), then you'll need the advice of someone more technical than me. Jeff -Original Message- From: Ran Harpaz [mailto:ipa...@hotmail.com] Sent: Monday, January 25, 2010 12:04 PM To: users@tomcat.apache.org Subject: Re: CSV File Save as dialogue defaults to HTM file Alessandro Bahgat wrote: On Mon, Jan 25, 2010 at 11:02 AM, Pid p...@pidster.com wrote: On 25/01/2010 09:17, Ran Harpaz wrote: Hello, I'm using Jetspeed 1.6, running on Tomcat. In a portlet I developed, I create a .csv file and print a link to it. The user then needs to right-click on the file and select save file as. The dialogue that pops up defaults to file type HTML file, and replaces the .csv extension of the file I link to with .htm. Is there anyway to resolve this? I really need to give access to the csv file as-is, and not bother my clients more than neccessary. Are you setting the Content-type header to text/csv, or are you just generating it with a JSP? The latter will automatically set text/html as the content type. You may also want to change the content-disposition header in order to make your server prompt the user with the save as dialog: For example, response.setHeader(Content-disposition, attachment; filename= + defaultCsvFilename ); Regards, Alessandro - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Thank you, but this solution doesn't seem to work on Jetspeed, due to the fact that I'm running JSR-168 Portlets on it. I don't believe they support changing the response's ContentType. I wanted to know if there was anything about the Tomcat platform that could result in a CSV file defaulting to an HTM file, and if there was anything to do about it. -- View this message in context: http://old.nabble.com/CSV-File-%22Save-as%22-dialogue-defaults-to-HTM-fi le-tp27303866p27308426.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org *** NOTICE * This message is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply or by telephone (call us collect at 512-343-9100) and immediately delete this message and all its attachments. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Return from getRemoteUser and isUserInRole Inconsistent
I'm using Tomcat 6.0 with Firefox 3.0.12 and JNDIRealm for authentication. When I call HttpServletRequest.getRemoteUser() and HttpServletRequest.isUserInRole(), I get inconsistent results. Sometimes I get null for user and other times I get the user name. Sometimes I get false for isUserInRole() and other times I get true. More often than not I get null and false, but there is no discernable pattern. I always check after the user has been authenticated. Any ideas? Thanks, Doug Fulford Software Engineering Specialist (626)812-2248
Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Steve, On 1/25/2010 2:56 PM, Steve Ryder wrote: Starting from the bottom up of your suggestions: 1) I tried removing the try/catch. No can do, Java compiler forces me to catch the exceptions. Hmm... what method is declared as throwing Exception instead of something more specific? 2) However, Java does provide a getStackTrace. Throwable.printStackTrace() will also do the trick. 2010-01-25 19:37:09:Stack(5)javax.servlet.http.HttpServlet.service(HttpServlet.java:802) 2010-01-25 19:37:09:Stack(4)org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) 2010-01-25 19:37:09:Stack(3)org.apache.jsp.index_jsp._jspService(index_jsp.java:89) 2010-01-25 19:37:09:Stack(2)com.jsrsys.web.JsrSQL.(JsrSQL.java:42) 2010-01-25 19:37:09:Stack(1)com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86) 2010-01-25 19:37:09:Stack(0)com.jsrsys.web.JsrSQL.connect(JsrSQL.java:503) Is this the code you posted earlier? If so, which line is 503? 2010-01-25 19:37:09:*WARNING*Connection to jdbc/MySql:: connect Other exception: org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource This isn't the error message you posted earlier. The one you posted earlier was: 2010-01-25 15:56:06:*WARNING*Connection to jdbc/MySql:: connect Other exception: Cannot create resource instance Removing the Class.forName code did not change anything, I still get the same error. Right: the Class.forName simply wasn't necessary... I didn't expect it to change anything. 2010-01-25 20:00:03:*WARNING*Connection to jdbc/MySql:: connect Other exception: org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource 2010-01-25 20:00:03:Stack(4)=org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) 2010-01-25 20:00:03:Stack(3)=org.apache.jsp.index_jsp._jspService(index_jsp.java:89) 2010-01-25 20:00:03:Stack(2)=com.jsrsys.web.JsrSQL.(JsrSQL.java:42) 2010-01-25 20:00:03:Stack(1)=com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86) 2010-01-25 20:00:03:Stack(0)=com.jsrsys.web.JsrSQL.connect(JsrSQL.java:504) 2010-01-25 20:00:03:JsrSQL: Context cast successfull Could you re-post the whole method? The object you get from the JNDI context really /should/ be a javax.sql.DataSource object, not a ResourceLink. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkteAdMACgkQ9CaO5/Lv0PAm7wCfSWyuzVUbJ1zXqaruicFBoUnS R6wAn3JGjRZ7uMS5uf1tR8utZ7oWnzpT =ymR0 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Return from getRemoteUser and isUserInRole Inconsistent
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Doug, On 1/25/2010 3:35 PM, Fulford, William wrote: I'm using Tomcat 6.0 with Firefox 3.0.12 and JNDIRealm for authentication. When I call HttpServletRequest.getRemoteUser() and HttpServletRequest.isUserInRole(), I get inconsistent results. Sometimes I get null for user and other times I get the user name. Sometimes I get false for isUserInRole() and other times I get true. More often than not I get null and false, but there is no discernable pattern. I always check after the user has been authenticated. Any ideas? What form of credential gathering are you using? FORM? BASIC? CLIENT-CERT? Can you post the security-constraint sections of your web.xml file? Can you post some specific examples? The return value for HttpServletRequest.isUserInRole depends highly on the parameter passed to it and the roles held by the currently-logged-in user. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkteAx4ACgkQ9CaO5/Lv0PBZRACeJWpje2H/EkTF2Vv4LWKAt7xQ qPgAoL0DaUgH/PIXqc53WioMACs9X7TQ =2HZp -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: How to map username.domain.com to www.domain.com/username
Hi, Assuming you have DNS set up properly, use this: I have not done DNS tweaking before. How should I setup the DNS? Do I have to set the value of host name for the A record to *? http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html Looks like this is not a dynamic approach. I have to specify each subdomain in the server.xml but in my app I need a way to automatically map www.domain.com/newusername to newusername.domain.com. Or have I missed something? Alternatively, use a filter to rewrite the request URLs to the internal format: http://tuckey.org/urlrewrite/ How can I setup this filter to listen for all the *.domain.com requests? Also I don't want the user to be redirected to www.domain.com/username but just like blogspot or wordpress I want him to be able to access his homepage at username.domain.com instead. Thanks in advance, BC - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Basic Authentication Failed with multibyte username
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 1/24/2010 9:22 AM, André Warnier wrote: Christopher Schultz wrote: Maybe all character sets have bytes 0-127 the same as US-ASCII, but I don't know about some of those I never see myself: Shift-JS and all those Asian encodings, etc. It would be better to be explicit. With respect, I think you are mistaken here. Base64 encoding is essentially a method to encode pairs of bytes into triplets of bytes, in such a way that no byte in the resulting triplet has the high bit set. (Use octet instead of byte if it is more comfortable). It's more than that: it uses an explicit set of characters in the US-ASCII encoding as display. If you were to Base64 encode a string and then transmit it as EBCDIC, it would look the same to human eyes but have different underlying byte values (octets, if you prefer). Basically, it was created in order to allow 8-bit character data to be sent over an 7-bit channel. So there is no character set implication at all in either encoding or decoding : - to encode, you take each group of 2 bytes, and encode it into a group of 3 bytes - to decode, you take each group of 3 bytes, and decode it into a group of 2 bytes. Actually, I was wrong above: it's not a US-ASCII encoding. Instead, the byte values are an index into a string of characters, as described in the reference-less Wikipedia article: The buffer is then used, six bits at a time, most significant first, as indices into the string: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/, and the indicated character is output. So, in DBCDEC, the human reader would be confused :( So maybe the authorization.getBytes() above is wrong intellectually (if it implies that authorization is some kind of string expressed in a character set). The Base64-encoded string should really be read as bytes, because that is what it is. Fair enough, though the above string fits nicely into US-ASCII which, coincidentally, is the official encoding of HTTP headers :) The next step after the base64-decoding is where it matters I agree, and here's where your arguments fall on deaf ears: each client does whatever it wants with regard to encoding of this data. The major web browsers don't even agree on what to do. Since the OP has his own client (right? or have I gotten confused with one or two other threads this week), he can do whatever he wants as long as the authentication mechanism agrees with the client. But is is impossible to know which character set the browser used, just by examining that series of bytes. Almost certainly true, although a tight client/server relationship could include a scheme to indicate the encoding in the value itself. Something like RFC2047, for instance. So there are only 2 choices possible : 1) the rules specify that the base64-decoded userid:password string is always encoded using one specific charset. In the case of HTTP, this would have to be iso-8859-1. (And in that case, HTTP Basic Authentication does not allow for non-iso-8859-1 userid's and passwords, and too bad for 80% of the world population) I disagree: the spec is unclear about the encoding used before the Base64 encoding. This is the source of the problem because clients have decided to take it upon themselves to decide what is best (UTF-8, page encoding, random encoding, no encoding, etc.). 2) the rules specify something like : - if the base64-decoded authorization token does not start with the iso-8859-1 characters =?, then it is interpreted as iso-8859-1 (the default) - if it starts with =? and ends with ?=, then it is interpreted as a rfc2047-encoded token, to be decoded using the charset indicated after the leading =?. (And user-id's starting with =? are forbidden, but that's not a very likely case nor a big limitation). That would be a great implementation, but nobody appears to have done it. If the OP wants to use this strategy, he'll have to hack Tomcat's authenticator to accept this type of encoding... or use something like Securityfilter, again, with a patch to accept this type of encoding. So back to Gábor's original problem : His specific client is not a browser, and it allows a user:password string to contain non-iso-8859-1 characters, and it encodes it in UTF-8, prior to encoding it with base64. Fortunately, he has control over the client, which is great. At the Tomcat level : If Gábor modifies the Tomcat container-managed Basic Authentication code, so that it will first base64-decode the token, then convert it to a string using UTF-8 encoding, that will work for requests from this special client. But it will break with any other client. +1 If Gábor can distinguish requests from this special client, from requests from standard clients, then he could make the UTF-8 decoding conditional on where the request comes from. +1 If this is done in the container-based Basic Authentication code, then it would
Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
2010/1/25 Steve Ryder sry...@jsrsys.com: Resource name=jdbc/MySql auth=Container type=javax.sql.Datasource The above should be javax.sql.DataSource Do you have any references to this resource in your web.xml file? Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: AW: Comet Connection Writeable?
http://people.apache.org/~fhanik/tomcat/v6.0.0-gdev6/ Let me know what you think of the programming experience, I wasn't too stoked about it. Lots of concurrency issues that can pop up 1. svn co http://svn.apache.org/repos/asf/tomcat/sandbox/gdev6x/ 2. cd gdev6x 3. echo base.path=`pwd`/includes build.properties 4. export PATH=/path/to/jdk1.5/bin:$PATH 5. export PATH=/path/to/ant1.7/bin:$PATH 6. ant download 7. ant 8. ant -f extras.xml 9. ant -f dist.xml Filip On 01/22/2010 02:11 PM, Steffen Heil wrote: Hi I'd like to try it. However I am not accustomed to building tomcat. Do you have this compiled somewhere? Best regards, Steffen -Ursprüngliche Nachricht- Von: Filip Hanik - Dev Lists [mailto:devli...@hanik.com] Gesendet: Dienstag, 19. Januar 2010 15:50 An: Tomcat Users List Betreff: Re: Comet Connection Writeable? Hi Steffen, At http://svn.apache.org/viewvc/tomcat/sandbox/gdev6x/ I implemented the feature you are looking for. Where you would do CometEvent.interestOps(CometEvent.CometOperation.OP_WRITE); and you will receive a CometEvent.EventType.WRITE When I tried to write sample applications against this, it turned out to be very complex programming. You can check out that branch and build it and see if its something we should still pursue Filip On 01/18/2010 09:06 AM, Steffen Heil wrote: Hi I am using comet connections for some time now in a server push manner: Whenever the server needs to inform the client about some event, it sends a packet to the client and waits for a reply in the same connection. As soon, as a READ event is triggered, that reply is read and the next message can be sent. Now, this requires a round-trip-time between the client and the server and is inappropriate for larger amounts of data especially on high latency connections. I am seeking for a way to determine (from a comet servlets point of view) if a connection is writeable - this is, if output buffers are empty and I can send additional data. Note, that sending a huge amount of data at once is not an option, I need to send distinct parts... So here are my questions: - How can I detect if a connection is writeable? - That is, how can I detect if the output buffers are empty? - Is there a way to use comet connection for something like a selector? Regards, Steffen - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: question for deploystartup forROOT.war on tomcat cluster
-Original Message- From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] Sent: Monday, January 25, 2010 11:16 AM To: Tomcat Users List Subject: Re: question for deploystartup forROOT.war on tomcat cluster 2010/1/25 Okubo, Yasushi (TSD) yasushi.ok...@takedasd.com: OK - Listed applications for virtual host localhost This: /manager:running:1:manager /:running:0:/ /host-manager:running:0:host-manager and this: HTTP Status 404 - / type Status report message / description The requested resource (/) is not available. means that the web application is deployed and running. When there is no ROOT application deployed, Tomcat will respond with an empty zero-length response (it looks like a blank page in a browser). It looks like a web application that does not have a welcome page. Please check that your ROOT.war was properly expanded into /webapps/ROOT folder, and that those files (especially WEB-INF/web.xml) are readable by the user that runs that Tomcat instance. Yes, it has. welcome-file-list welcome-fileindex.html/welcome-file /welcome-file-list -rw-rw-r-- 1 xxx yyy 114 Nov 25 14:05 webapps/ROOT/index.html -rw-rw-r-- 1 xxx yyy 15197 Nov 25 14:51 webapps/ROOT/WEB-INF/web.xml Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Return from getRemoteUser and isUserInRole Inconsistent
Chris, Attached are the relevant sections from the server.xml and web.xml, respectively. I'm using DWR to call Java methods in HttpServletInfo (a class I wrote) from a JavaScript using ExtJs: ... HttpServletInfo.getRemoteUser(function(user) { ... }; ... HttpServletInfo.isUserInRole(tgirs, function(isInRole) { ... }; ... These are called every time my page is loaded (Ext.onReady). I've tried with or without restarting Firefox, with or without restarting Tomcat, and via ctrl-shift Reload (Reload that clears private data). The only consistency is that, after restarting Tomcat, the user name is returned, and isInRole is false. Otherwise the results are inconsistent. Thanks, Doug -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Monday, January 25, 2010 12:46 PM To: Tomcat Users List Subject: Re: Return from getRemoteUser and isUserInRole Inconsistent -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Doug, On 1/25/2010 3:35 PM, Fulford, William wrote: I'm using Tomcat 6.0 with Firefox 3.0.12 and JNDIRealm for authentication. When I call HttpServletRequest.getRemoteUser() and HttpServletRequest.isUserInRole(), I get inconsistent results. Sometimes I get null for user and other times I get the user name. Sometimes I get false for isUserInRole() and other times I get true. More often than not I get null and false, but there is no discernable pattern. I always check after the user has been authenticated. Any ideas? What form of credential gathering are you using? FORM? BASIC? CLIENT-CERT? Can you post the security-constraint sections of your web.xml file? Can you post some specific examples? The return value for HttpServletRequest.isUserInRole depends highly on the parameter passed to it and the roles held by the currently-logged-in user. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkteAx4ACgkQ9CaO5/Lv0PBZRACeJWpje2H/EkTF2Vv4LWKAt7xQ qPgAoL0DaUgH/PIXqc53WioMACs9X7TQ =2HZp -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: How to map username.domain.com to www.domain.com/username
Bytecode wrote: Hi, Assuming you have DNS set up properly, use this: I have not done DNS tweaking before. How should I setup the DNS? Do I have to set the value of host name for the A record to *? http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html Looks like this is not a dynamic approach. I have to specify each subdomain in the server.xml but in my app I need a way to automatically map www.domain.com/newusername to newusername.domain.com. Or have I missed something? Yes. Basically, the whole point of DNS. That part is really out of the scope of this forum, which is dedicated to Tomcat itself. But here is a short rundown : You have to look at it from the client point of view (the browser). Suppose one of your users sits in Timbuctu, along with his workstation, on which runs an OS, on which runs a browser. And supposes your Tomcat host has the public IP address 10.20.30.40. In the browser URL bar, the user types : http://hisname.bytecode-domain.com B (for browser)) What his browser does : B1) ask the local OS for the IP address of hisname.bytecode-domain.com If he gets it (from the OS), then goto B3 B2) If he does not, then print : that host does not exist ! and stop. B3) open a TCP connection with this IP address and port 80 B4) over that TCP connection, send a request that looks like this : GET / HTTP/1.1 Host: hisname.bytecode-domain.com and wait for a server answer on the same connection O (for OS)) What the OS of his workstation does : O1) it gets a request from the browser to translate the name hisname.bytecode-domain.com into an IP address. O2) it looks in the local hosts file to see if that name is mentioned there (under Windows, this would be \windows\system32\drivers\etc\hosts) O3) if yes, it returns the corresponding IP address and is done O4) if not, then it will look for the IP address of a DNS server (on a Windows workstation, type ipconfig /all in a command window to see this) O5) it connects to, and sends a request to this DNS server, to translate the name hisname.bytecode-domain.com into an IP address O6a) possibly, the DNS server returns : I don't know. Then the OS returns I don't know to the browser, and see B2 above O6b) the DNS server returns an IP address (preferably the IP address of your Tomcat host). The OS then returns this IP address to the browser, and the browser can proceed to B3 above In other words, if you want your user in Timbuctu to be able even to connect to your server, the information hisname.bytecode-domain.com = IP address 10.20.30.40 has to be present in either one of two places : - in the local hosts file on the workstation of your user OR - on the DNS servers out on the internet (**) THEN, when that is solved, you can start figuring out how your Tomcat should proceed, when it receives a request for http://hisname.bytecode-domain.com; But you have to solve the above DNS issue first. The Tomcat configuration itself is irrelevant until then. (**) that sounds complicated at first sight, but if you control the main DNS server for your domain bytecode-domain.com, then it is possible. But it is anyway a bit out of the scope of Tomcat. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Recommendations for Automating Deployments and then dev, qa, uat, prod testing
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Fletcher, On 1/23/2010 11:17 AM, Fletcher Cocquyt wrote: This process is not perfectly defined and slow - the developer's check all the code into SVN and tag the release - ops checks it all out and builds it on the tomcat nodes with the dev supplied ant build.xml. This can take several minutes per app per node and if there are any errors the 4-6am window is done. So, you build the project once for each target node? Why not do a single build and then copy the complete WAR onto each target node? Something like this: $ svn checkout $ ant test $ ant war $ scp mywebapp.war u...@node1: $ scp mywebapp.war u...@node2: $ scp mywebapp.war u...@node3: ... Of course, you'd need to put the WAR file in the right place, bounce Tomcat, and possibly run any upgrade scripts required before the webapp would work properly, but that's the general idea. Ideally, the entire release to production process would be such a well defined, quick and pre-tested event, than ops would only be notified if the 4am deployment failed and the automated rollback also failed. It's always a good idea to smoke-test a release, even if it's been pre-tested, because something stupid like the dev db password being used in production can really ruin your day if you're not paying attention. So questions about the things maven seems to address: testing: unit, integration testing - article mentions selenium? sensitive data: database passwords (can these be securely handled in maven?) We have a set of ant scripts that are checked into CVS, but they utilize a user-specific ~/.ant.properties file that defines all kinds of things like installation directories, context paths (i.e. the name of the WAR file to build), and certain other configuration parameters that are merged-into the source, etc. at build time. Thus, in production, we have the production database credentials stored here as well as other things. These values then don't ever make it into our source repo, so we don't have to worry about revealing secrets through that mechanism. Selenium is a UI testing framework that, frankly, is one of the coolest things I've ever seen. Its very fragile, though, because you have to make sure that every screen in your UI includes mark-up to be able to reference everything, plus every time you make a change, you need to change your tests. This isn't always the case with code modifications: you are more likely to change the implementation of a method or class than to change the interface, and so most tests should pass with no modification. I would recommend that Selenium-based testing only be done as part of your develop/test cycle, and not make it a part of the production build. For unit testing, I would also say that it should be a part of your dev/test process, and leave it out of the production build. You could mandate that tagging the repo for a release requires a complete set of unit and/or integration tests be run against what will be tagged or something. Presumably, if it passes tests in dev/test, it will pass those offline tests in production, too. Ideally, your testing environment simulates production in every way except maybe for a handful of service endpoint locations (URLs), credentials, and, of course, physical/logical environment. The process for deploying to production should be to take the successfully-tested WAR file(s) from the testing environment, update the configuration to a production one, push those WAR files directly into production, then do a smoke test to make sure that your production configuration was applied properly. You could even double-check this before the actual deployment if you don't trust your tools/process. Additional, medium-long term goals: Standardize the development environment and processes. We've always been a fan of our ant scripts. In production, this is essentially the upgrade procedure: $ cvs checkout $ ant tomcat-stop (run database upgrade script) $ ant install-clean install tomcat-start (perform smoke tests) This kind of thing even works in development: all ant targets are regularly exercised, because they are used in all environments. There's no special set of procedures for production... it's just like dev/test/demo. Leverage the virtual infrastructure we have built with vmware: have the developers use standard VM images from templates (ensure consistent JDK, libs etc), integrate with lab manager/vApp/VMware Studio concepts. Heh... if you wanted to, you could rotate VM instances in and out of production. Your upgrade procedure (for the app servers) could simply be to switch the IPs of the testing system(s) to the IPs of the production system(s): instant upgrade, and you know you've already tested everything :) - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkteG6AACgkQ9CaO5/Lv0PAvgQCeNPd0etF/kbXtn5FxPPzp9BJv
Re: Return from getRemoteUser and isUserInRole Inconsistent
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Doug, On 1/25/2010 4:59 PM, Fulford, William wrote: Attached are the relevant sections from the server.xml and web.xml, respectively. This mailing list often strips attachments. Could you copy/paste relevant sections into your next post? It's important to know what authentication you are using and what the security constraints look like. It would also be nice to see a few examples of URLs that your web pages are trying to access. I'm using DWR to call Java methods in HttpServletInfo (a class I wrote) from a JavaScript using ExtJs: ... HttpServletInfo.getRemoteUser(function(user) { ... }; ... HttpServletInfo.isUserInRole(tgirs, function(isInRole) { ... }; ... The above doesn't have any information that's really useful to me, at least not now. :( These are called every time my page is loaded (Ext.onReady). I've tried with or without restarting Firefox, with or without restarting Tomcat, and via ctrl-shift Reload (Reload that clears private data). The only consistency is that, after restarting Tomcat, the user name is returned, and isInRole is false. Otherwise the results are inconsistent. So, the function HttpServletInfo.getRemoteUser above returns inconsistent results, or HttpServletRequest.getRemoteUser returns inconsistent results? ...and if you just sit on the same page, repeatedly reloading the page, HttpServletRequest.getRemoteUser and HttpServletRequest.isUserInRole (for the same value every time) return essentially random results? If it's the functions above that return random stuff, I'd look at those. If it's Tomcat's implementation of those methods that appears to be broken, then we'd have a lot of users out there storming the castle with torches and pitchforks. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkteHSoACgkQ9CaO5/Lv0PBATQCeP4jBBqXuMOA18ePdejyUbcqR N28AoJcWuvnpAJYCK2V7zhmz7iRSYaeI =w7CV -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Return from getRemoteUser and isUserInRole Inconsistent
From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: Return from getRemoteUser and isUserInRole Inconsistent If it's the functions above that return random stuff, I'd look at those. I'd be looking for incorrect variable scope: storing a request- or session-specific item in a servlet's instance variable, for example. You can get wondrous strange results with that kind of mistake. - 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.
RE: Return from getRemoteUser and isUserInRole Inconsistent
Chris, Sorry about that. The text came off of a classified system. The easiest way for me to get it you, without going through a lot of hoops, was to print it, make sure it's clean, scan it, and attach it to a file. Unfortunately I don’t have any character recognition software handy, so I'll type it in: server.xml: ... Realm className=org.apache.catalina.realm.JDNIRealm debug=99 connectionURL=ldap://193.10.1.172:389/; userPattern=uid={0},ou=People,dc=aes,dc=com roleBase=ou=group,dc=aes,dc=com roleName=cn roleSearch=memberUid=[1] / Valve className=org.apache.catalina.authenticator.SingleSignOn / ... web.xml: ... security-constraint web-resource-collection web-resource-nameProtected Area/web-resource-name url-pattern/*/url-pattern /web-resource-collection auth-constraint role-nametgirs/role-name /auth-constraint /security-constraint login-config auth-methodBASIC/auth-method /login-config security-role role-nameowd/role-name /security-role ... The best way to characterize the behavior is that null or the correct user name is randomly returned and true or false is randomly return (unless the server is freshly restarted). I don't believe it’s a problem with the JavaScript or DWR interface, because I log out the values returned by the Java methods, and they are the same. My Java methods are just pass-throughs to the javax.servlet.http.HttpServletRequest interface. Doug -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Monday, January 25, 2010 2:38 PM To: Tomcat Users List Subject: Re: Return from getRemoteUser and isUserInRole Inconsistent -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Doug, On 1/25/2010 4:59 PM, Fulford, William wrote: Attached are the relevant sections from the server.xml and web.xml, respectively. This mailing list often strips attachments. Could you copy/paste relevant sections into your next post? It's important to know what authentication you are using and what the security constraints look like. It would also be nice to see a few examples of URLs that your web pages are trying to access. I'm using DWR to call Java methods in HttpServletInfo (a class I wrote) from a JavaScript using ExtJs: ... HttpServletInfo.getRemoteUser(function(user) { ... }; ... HttpServletInfo.isUserInRole(tgirs, function(isInRole) { ... }; ... The above doesn't have any information that's really useful to me, at least not now. :( These are called every time my page is loaded (Ext.onReady). I've tried with or without restarting Firefox, with or without restarting Tomcat, and via ctrl-shift Reload (Reload that clears private data). The only consistency is that, after restarting Tomcat, the user name is returned, and isInRole is false. Otherwise the results are inconsistent. So, the function HttpServletInfo.getRemoteUser above returns inconsistent results, or HttpServletRequest.getRemoteUser returns inconsistent results? ...and if you just sit on the same page, repeatedly reloading the page, HttpServletRequest.getRemoteUser and HttpServletRequest.isUserInRole (for the same value every time) return essentially random results? If it's the functions above that return random stuff, I'd look at those. If it's Tomcat's implementation of those methods that appears to be broken, then we'd have a lot of users out there storming the castle with torches and pitchforks. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkteHSoACgkQ9CaO5/Lv0PBATQCeP4jBBqXuMOA18ePdejyUbcqR N28AoJcWuvnpAJYCK2V7zhmz7iRSYaeI =w7CV -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Return from getRemoteUser and isUserInRole Inconsistent
Chuck, You caught me. Rookie mistake. It's refreshing to know I can still make rookie mistakes after almost 30 years in software. What I did was do a WebContextFactory.get() on class initialization as a private static variable. I should have been doing the get on each call. Thanks, Doug -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Monday, January 25, 2010 3:09 PM To: Tomcat Users List Subject: RE: Return from getRemoteUser and isUserInRole Inconsistent From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: Return from getRemoteUser and isUserInRole Inconsistent If it's the functions above that return random stuff, I'd look at those. I'd be looking for incorrect variable scope: storing a request- or session-specific item in a servlet's instance variable, for example. You can get wondrous strange results with that kind of mistake. - 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.
Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
Sequence of events: 1) With factory got cast error. 2) Took out factory= and got Cannot create resource instance 3) Put factory statement back in. Is there a different one I should try? The cast exception is Thrown by this line javax.sql.DataSource ds = (javax.sql.DataSource)envContext.lookup(jdbc/MySql); in the connect method. Here is the whole method as of the last test: /** * called by setDataBaseName */ private void connect(String dbName) { lastException = OK; /* don't need this if have connection pools try { // Class.forName(org.gjt.mm.mysql.Driver); sysout.display(Driver=com.mysql.jdbc.Driver); Class.forName(com.mysql.jdbc.Driver); } catch (Exception E) {lastException= Unable to load driver; E.printStackTrace(); sysout.display(lastException);} */ try { sql = Connection to jdbc/MySql:; Context myContext = new InitialContext(); Context envContext = (Context)myContext.lookup(java:comp/env); sysout.display(JsrSQL: Context cast successfull); javax.sql.DataSource ds = (javax.sql.DataSource)envContext.lookup(jdbc/MySql); sysout.display(JsrSQL: DataSource cast successfull); conn = ds.getConnection(); sysout.display(JsrSQL: conn = ds successfull); stmt = conn.createStatement(); sql = USE + dbName; // attempt to mymic jdbcConnect set for dbName! stmt.execute(sql); sysout.display(**+sql + : connection to jdbc/MySql established.); } catch (SQLException E) { lastException=*WARNING*+sql+ : connect SQL exception: + E.getMessage(); sysout.display(lastException); } catch(Exception eOther) { StackTraceElement[] stack = eOther.getStackTrace(); for (int s=0; s stack.length; s++) { lastException = Stack(+s+)= + stack[s]; sysout.display(lastException); if (lastException.indexOf(org.apache.jasper) -1) break; } lastException=*WARNING*+sql+ : connect Other exception: + eOther.getMessage(); sysout.display(lastException); } } - Original Message - From: Christopher Schultz ch...@christopherschultz.net To: Tomcat Users List users@tomcat.apache.org Sent: Monday, January 25, 2010 2:40 PM Subject: Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Steve, On 1/25/2010 2:56 PM, Steve Ryder wrote: Starting from the bottom up of your suggestions: 1) I tried removing the try/catch. No can do, Java compiler forces me to catch the exceptions. Hmm... what method is declared as throwing Exception instead of something more specific? 2) However, Java does provide a getStackTrace. Throwable.printStackTrace() will also do the trick. 2010-01-25 19:37:09:Stack(5)javax.servlet.http.HttpServlet.service(HttpServlet.java:802) 2010-01-25 19:37:09:Stack(4)org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) 2010-01-25 19:37:09:Stack(3)org.apache.jsp.index_jsp._jspService(index_jsp.java:89) 2010-01-25 19:37:09:Stack(2)com.jsrsys.web.JsrSQL.(JsrSQL.java:42) 2010-01-25 19:37:09:Stack(1)com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86) 2010-01-25 19:37:09:Stack(0)com.jsrsys.web.JsrSQL.connect(JsrSQL.java:503) Is this the code you posted earlier? If so, which line is 503? 2010-01-25 19:37:09:*WARNING*Connection to jdbc/MySql:: connect Other exception: org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource This isn't the error message you posted earlier. The one you posted earlier was: 2010-01-25 15:56:06:*WARNING*Connection to jdbc/MySql:: connect Other exception: Cannot create resource instance Removing the Class.forName code did not change anything, I still get the same error. Right: the Class.forName simply wasn't necessary... I didn't expect it to change anything. 2010-01-25 20:00:03:*WARNING*Connection to jdbc/MySql:: connect Other exception: org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource 2010-01-25 20:00:03:Stack(4)=org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) 2010-01-25 20:00:03:Stack(3)=org.apache.jsp.index_jsp._jspService(index_jsp.java:89) 2010-01-25 20:00:03:Stack(2)=com.jsrsys.web.JsrSQL.(JsrSQL.java:42) 2010-01-25 20:00:03:Stack(1)=com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86) 2010-01-25 20:00:03:Stack(0)=com.jsrsys.web.JsrSQL.connect(JsrSQL.java:504) 2010-01-25 20:00:03:JsrSQL: Context cast successfull Could you re-post the whole method? The object you get from the JNDI context really /should/ be a javax.sql.DataSource object, not a ResourceLink. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkteAdMACgkQ9CaO5/Lv0PAm7wCfSWyuzVUbJ1zXqaruicFBoUnS R6wAn3JGjRZ7uMS5uf1tR8utZ7oWnzpT =ymR0 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
OK, I took factory out of context.xml, now I get Resource Instance again, but this time I have the trace! 2010-01-26 05:11:30:*WARNING*Connection to jdbc/MySql:: connect Other exception: Cannot create resource instance 2010-01-26 05:11:30:Stack(10)=org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) 2010-01-26 05:11:30:Stack(9)=org.apache.jsp.AppList_jsp._jspService(AppList_jsp.java:157) 2010-01-26 05:11:30:Stack(8)=com.jsrsys.web.JsrSQL.(JsrSQL.java:42) 2010-01-26 05:11:30:Stack(7)=com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86) 2010-01-26 05:11:30:Stack(6)=com.jsrsys.web.JsrSQL.connect(JsrSQL.java:504) 2010-01-26 05:11:30:Stack(5)=org.apache.naming.NamingContext.lookup(NamingContext.java:153) 2010-01-26 05:11:30:Stack(4)=org.apache.naming.NamingContext.lookup(NamingContext.java:781) 2010-01-26 05:11:30:Stack(3)=org.apache.naming.NamingContext.lookup(NamingContext.java:140) 2010-01-26 05:11:30:Stack(2)=org.apache.naming.NamingContext.lookup(NamingContext.java:793) 2010-01-26 05:11:30:Stack(1)=javax.naming.spi.NamingManager.getObjectInstance(libgcj.so.81) 2010-01-26 05:11:30:Stack(0)=org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:143) 2010-01-26 05:11:30:JsrSQL: Context cast successfull line 504 is the middle line of: 503 get's executed (see above): sysout.display(JsrSQL: Context cast successfull); 504 throws exception: javax.sql.DataSource ds = (javax.sql.DataSource)envContext.lookup(jdbc/MySql); 505 never gets here: sysout.display(JsrSQL: DataSource cast successfull); - Original Message - From: Christopher Schultz ch...@christopherschultz.net To: Tomcat Users List users@tomcat.apache.org Sent: Monday, January 25, 2010 2:40 PM Subject: Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Steve, On 1/25/2010 2:56 PM, Steve Ryder wrote: Starting from the bottom up of your suggestions: 1) I tried removing the try/catch. No can do, Java compiler forces me to catch the exceptions. Hmm... what method is declared as throwing Exception instead of something more specific? 2) However, Java does provide a getStackTrace. Throwable.printStackTrace() will also do the trick. 2010-01-25 19:37:09:Stack(5)javax.servlet.http.HttpServlet.service(HttpServlet.java:802) 2010-01-25 19:37:09:Stack(4)org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) 2010-01-25 19:37:09:Stack(3)org.apache.jsp.index_jsp._jspService(index_jsp.java:89) 2010-01-25 19:37:09:Stack(2)com.jsrsys.web.JsrSQL.(JsrSQL.java:42) 2010-01-25 19:37:09:Stack(1)com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86) 2010-01-25 19:37:09:Stack(0)com.jsrsys.web.JsrSQL.connect(JsrSQL.java:503) Is this the code you posted earlier? If so, which line is 503? 2010-01-25 19:37:09:*WARNING*Connection to jdbc/MySql:: connect Other exception: org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource This isn't the error message you posted earlier. The one you posted earlier was: 2010-01-25 15:56:06:*WARNING*Connection to jdbc/MySql:: connect Other exception: Cannot create resource instance Removing the Class.forName code did not change anything, I still get the same error. Right: the Class.forName simply wasn't necessary... I didn't expect it to change anything. 2010-01-25 20:00:03:*WARNING*Connection to jdbc/MySql:: connect Other exception: org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource 2010-01-25 20:00:03:Stack(4)=org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) 2010-01-25 20:00:03:Stack(3)=org.apache.jsp.index_jsp._jspService(index_jsp.java:89) 2010-01-25 20:00:03:Stack(2)=com.jsrsys.web.JsrSQL.(JsrSQL.java:42) 2010-01-25 20:00:03:Stack(1)=com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86) 2010-01-25 20:00:03:Stack(0)=com.jsrsys.web.JsrSQL.connect(JsrSQL.java:504) 2010-01-25 20:00:03:JsrSQL: Context cast successfull Could you re-post the whole method? The object you get from the JNDI context really /should/ be a javax.sql.DataSource object, not a ResourceLink. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkteAdMACgkQ9CaO5/Lv0PAm7wCfSWyuzVUbJ1zXqaruicFBoUnS R6wAn3JGjRZ7uMS5uf1tR8utZ7oWnzpT =ymR0 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
You win the prize for fixing the cast/resource instance errors at line 504. I failed to notice the HumpInTheCamel. I changed the s to S and now I get an even more weird error at line 506 506: conn = ds.getConnection(); 507: sysout.display(JsrSQL: conn = ds successfull); I am going to put the factory= statement back in to see if anything changes now. 2010-01-26 05:20:33:*WARNING*Connection to jdbc/MySql:: connect SQL exception: Cannot create PoolableConnectionFactory (Server connection failure during transaction. Due to underlying exception: 'java.io.CharConversionException'. ** BEGIN NESTED EXCEPTION ** java.io.CharConversionException STACKTRACE: java.io.CharConversionException at gnu.gcj.convert.Input_iconv.read(libgcj.so.81) at java.lang.String.init(libgcj.so.81) at java.lang.String.(libgcj.so.81) at com.mysql.jdbc.SingleByteCharsetConverter.(SingleByteCharsetConverter.java:153) at com.mysql.jdbc.SingleByteCharsetConverter.initCharset(SingleByteCharsetConverter.java:108) at com.mysql.jdbc.SingleByteCharsetConverter.getInstance(SingleByteCharsetConverter.java:86) at com.mysql.jdbc.Connection.getCharsetConverter(Connection.java:3505) at com.mysql.jdbc.Statement.(Statement.java:290) at com.mysql.jdbc.Connection.createStatement(Connection.java:3123) at com.mysql.jdbc.Connection.createStatement(Connection.java:3103) at com.mysql.jdbc.Connection.loadServerVariables(Connection.java:4475) at com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:4062) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2940) at com.mysql.jdbc.Connection.(Connection.java:1555) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) at com.jsrsys.web.JsrSQL.connect(JsrSQL.java:506) at com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86) at com.jsrsys.web.JsrSQL.(JsrSQL.java:42) at org.apache.jsp.AppList_jsp._jspService(AppList_jsp.java:157) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at java.lang.reflect.Method.invoke(libgcj.so.81) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244) at java.security.AccessController.doPrivileged(libgcj.so.81) at javax.security.auth.Subject.doAsPrivileged(libgcj.so.81) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:262) at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:171) at java.security.AccessController.doPrivileged(libgcj.so.81) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:167) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:544) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) 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(libgcj.so.81) ** END NESTED EXCEPTION ** Attempted reconnect 3 times. Giving up.) 2010-01-26 05:20:28:JsrSQL: DataSource cast successfull 2010-01-26 05:20:28:JsrSQL: Context cast successfull - Original Message -
Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
I put the factory statement back in context.xml and I get the same error again (only this time I have added code to the SQL exception logic to display the stack trace stopping at the line that invoced the jsp that calls JsrSQL. All the trace that is part of the message appears to me to be the same as was in the previous email (which did not have the factory line in context.xml). FYI the factory line is: factory=org.apache.commons.dbcp.BasicDataSourceFactory The only context.xml file is in the etc directory and thus applies to all domains. The main difference is for 5.5 vs. 5.0 is that there is one Resource statement in context.xml vs. having a resource link in context.xml for each project and one Resource statement in server.xml. PS: Note the Stack= lines at the bottom. All the stuff before them from Cannot create down is part of the getMessage() return variable. Note the slight difference in line #s. Stack(0) has line 1225 vs. 1221 in the stack dump part of the getMessage() line. 2010-01-26 05:38:29:*WARNING*Connection to jdbc/MySql:: connect SQL exception: Cannot create PoolableConnectionFactory (Server connection failure during transaction. Due to underlying exception: 'java.io.CharConversionException'. ** BEGIN NESTED EXCEPTION ** java.io.CharConversionException STACKTRACE: java.io.CharConversionException at gnu.gcj.convert.Input_iconv.read(libgcj.so.81) at java.lang.String.init(libgcj.so.81) at java.lang.String.(libgcj.so.81) at com.mysql.jdbc.SingleByteCharsetConverter.(SingleByteCharsetConverter.java:153) at com.mysql.jdbc.SingleByteCharsetConverter.initCharset(SingleByteCharsetConverter.java:108) at com.mysql.jdbc.SingleByteCharsetConverter.getInstance(SingleByteCharsetConverter.java:86) at com.mysql.jdbc.Connection.getCharsetConverter(Connection.java:3505) at com.mysql.jdbc.Statement.(Statement.java:290) at com.mysql.jdbc.Connection.createStatement(Connection.java:3123) at com.mysql.jdbc.Connection.createStatement(Connection.java:3103) at com.mysql.jdbc.Connection.loadServerVariables(Connection.java:4475) at com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:4062) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2940) at com.mysql.jdbc.Connection.(Connection.java:1555) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) at com.jsrsys.web.JsrSQL.connect(JsrSQL.java:506) at com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86) at com.jsrsys.web.JsrSQL.(JsrSQL.java:42) at org.apache.jsp.AppList_jsp._jspService(AppList_jsp.java:157) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at java.lang.reflect.Method.invoke(libgcj.so.81) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244) at java.security.AccessController.doPrivileged(libgcj.so.81) at javax.security.auth.Subject.doAsPrivileged(libgcj.so.81) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:262) at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:171) at java.security.AccessController.doPrivileged(libgcj.so.81) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:167) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:544) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at
Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
2010/1/26 Steve Ryder sry...@jsrsys.com: at gnu.gcj.convert.Input_iconv.read(libgcj.so.81) Stop right there. Do not use GNU Java for anything. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
I understand what you mean by don't use, but I am not using it. What do I need to change so that it is not used? How might I track down the offending library? - Original Message - From: Konstantin Kolinko knst.koli...@gmail.com To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, January 26, 2010 12:29 AM Subject: Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource 2010/1/26 Steve Ryder sry...@jsrsys.com: at gnu.gcj.convert.Input_iconv.read(libgcj.so.81) Stop right there. Do not use GNU Java for anything. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Disabled use of AcceptEx() WinSock2 API error on Windows 7
Thanks, Chuck - this problem is fixed. The zip version starts without any problems using startup.bat. I'll just start Tomcat manually as I'm doing only development work at the moment. On Mon, Jan 25, 2010 at 4:40 PM, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: Richard Cooke [mailto:richa...@saratoga.co.za] Subject: Re: Disabled use of AcceptEx() WinSock2 API error on Windows 7 My Tomcat installer file says version 6.0.20. I do not have a version.bat file. My java version is 1.6.0.18. Post your Connector configuration so we can take a look at it. You might also want to try Tomcat 6.0.24; my guess is that won't help, but it doesn't hurt to try. Also, the .zip download gives you a bit more flexibility in how you start Tomcat, so I always prefer that one over the .exe download. See if Tomcat will come up with the startup.bat script, and only after that try to install it as a service. - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Sincerely, Richard Cooke. Saratoga Software. 021 658 4109.
make jsvc error on centos5.3
hi, everybody, I have some question on make jsvc on centos 5.3 linux. and need your help. thanks my step is : 1. install centos chosed: a)server, b)Server-GUI 2. install tomcat. 3. compile jsvc and failed. [r...@hcrm jsvc-src]# make make -C native all make[1]: Entering directory `/usr/local/tomcat/bin/jsvc-src/native' gcc -g -O2 -DOS_LINUX -DDSO_DLFCN -DCPU=3D\i386\ -I/usr/java/jdk1.5.0_22/include -I/usr/java/jdk1.5.0_22/include/linux -Wall -Wstrict-prototypes -c jsvc-unix.c -o jsvc-unix.o In file included from /usr/include/signal.h:333, from jsvc-unix.c:19: /usr/include/bits/sigcontext.h:28:29: error: asm/sigcontext.h: No such file or directory In file included from jsvc-unix.c:29: /usr/include/sys/prctl.h:23:66: error: linux/prctl.h: No such file or direc= tory In file included from jsvc-unix.c:30: /usr/include/sys/syscall.h:25:24: error: asm/unistd.h: No such file or dire= ctory jsvc-unix.c:32:30: error: linux/capability.h: No such file or directory jsvc-unix.c: In function =E2set_caps? jsvc-unix.c:126: error: storage size of =E2caphead?isn=E2t known jsvc-unix.c:127: error: storage size of =E2cap?isn=E2t known jsvc-unix.c:130: error: =E2_LINUX_CAPABILITY_VERSION?undeclared (first use in this function) jsvc-unix.c:130: error: (Each undeclared identifier is reported only once jsvc-unix.c:130: error: for each function it appears in.) jsvc-unix.c:136: error: =E2__NR_capset?undeclared (first use in this functi= on) jsvc-unix.c:127: warning: unused variable =E2cap? jsvc-unix.c:126: warning: unused variable =E2caphead? jsvc-unix.c: In function =E2linuxset_user_group? jsvc-unix.c:145: error: =E2CAP_NET_BIND_SERVICE?undeclared (first use in this function) jsvc-unix.c:145: error: =E2CAP_SETUID?undeclared (first use in this functio= n) jsvc-unix.c:145: error: =E2CAP_SETGID?undeclared (first use in this functio= n) jsvc-unix.c:154: error: =E2PR_SET_KEEPCAPS?undeclared (first use in this function) make[1]: *** [jsvc-unix.o] Error 1 make[1]: Leaving directory `/usr/local/tomcat/bin/jsvc-src/native' make: *** [native/all] Error 2 [r...@hcrm jsvc-src]# - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to javax.sql.DataSource
Steve, --- On Mon, 1/25/10 at 10:50 PM, Steve Ryder sry...@jsrsys.com wrote: I understand what you mean by don't use, but I am not using it. What do I need to change so that it is not used? How might I track down the offending library? What do you get when you type the following commands: $ java -version $ which java - Bob - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org