Re: Configuring a JSR-356 Websocket
On 04/21/2014 04:30 PM, Daniel Mikusa wrote: On Apr 21, 2014, at 9:58 AM, Thom Hehl th...@corrisoft.com wrote: Tomcat 8/Ubuntu 12.04 I have my tomcat deployed with the example echo application. I wrote a tester that hits the URL provided and sends a message and then receives the response back. I want to deploy my own websocket. I have done so using the @ServerEndpoint(value = /websocket) annotation. When i try to hit this from my client, I get a http 404 status. I looked at the examples again and found that there was this ExamplesConfig.java. Aha! I thought, a magic class that makes this configuration work. I implemented my own and it does not change the results. It does not appear to be calling my config at all because I have System.out.println()s in my config and they are not showing up in the log. I have been through the examples web.xml and cannot find any configuration for websockets at all except the listener definition for the old school version of web sockets. (I'm assuming this predated JSR-356.) So how do i configure tomcat so it knows about my web socket? I don’t think this is really Tomcat specific. Maybe start with a JSR-356 tutorial and see if that helps to answer your questions. http://docs.oracle.com/javaee/7/tutorial/doc/websocket.htm I also have some examples on Github, if you’re looking for more WebSockets examples. https://github.com/dmikusa-pivotal/tomcat-8-features Dan - 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 I appreciate the help, but I've been through the tutorials. I've been debugging the code for tomcat 8.05 and this looks like a defect. It finds my class in ContextConfig.checkHandlesTypes and then passes it to Introspection.loadClass(), but the class load fails and so the class isn't added to the list of endpoints. This is the exact thing that happens when I pull the EchoAnnotation endpoint out of the examples webapp and try it independently. Can I get someone to verify, please? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Configuring a JSR-356 Websocket
On 04/22/2014 07:35 AM, Mark Thomas wrote: On 22/04/2014 12:31, Thom Hehl wrote: I appreciate the help, but I've been through the tutorials. I've been debugging the code for tomcat 8.05 and this looks like a defect. It finds my class in ContextConfig.checkHandlesTypes and then passes it to Introspection.loadClass(), but the class load fails Why / how does the class load fail? and so the class isn't added to the list of endpoints. This is the exact thing that happens when I pull the EchoAnnotation endpoint out of the examples webapp and try it independently. Can I get someone to verify, please? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org As an experiment, I downloaded and ran tomcat 7.0.52 and dropped my same war file in. When I did so, I got an exception in the log because an interface I implemented wasn't found. This must be the reason the class wasn't loading. I'm going to fix this and test again with tomcat 8, but, for some reason, tomcat 8 was eating the exception and not displaying in the log. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Configuring a JSR-356 Websocket
On 04/22/2014 07:50 AM, Konstantin Kolinko wrote: 2014-04-22 15:31 GMT+04:00 Thom Hehl th...@corrisoft.com: On 04/21/2014 04:30 PM, Daniel Mikusa wrote: On Apr 21, 2014, at 9:58 AM, Thom Hehl th...@corrisoft.com wrote: Tomcat 8/Ubuntu 12.04 I have my tomcat deployed with the example echo application. I wrote a tester that hits the URL provided and sends a message and then receives the response back. I want to deploy my own websocket. I have done so using the @ServerEndpoint(value = /websocket) annotation. When i try to hit this from my client, I get a http 404 status. I looked at the examples again and found that there was this ExamplesConfig.java. Aha! I thought, a magic class that makes this configuration work. I implemented my own and it does not change the results. It does not appear to be calling my config at all because I have System.out.println()s in my config and they are not showing up in the log. I have been through the examples web.xml and cannot find any configuration for websockets at all except the listener definition for the old school version of web sockets. (I'm assuming this predated JSR-356.) So how do i configure tomcat so it knows about my web socket? I don’t think this is really Tomcat specific. Maybe start with a JSR-356 tutorial and see if that helps to answer your questions. http://docs.oracle.com/javaee/7/tutorial/doc/websocket.htm I also have some examples on Github, if you’re looking for more WebSockets examples. https://github.com/dmikusa-pivotal/tomcat-8-features I appreciate the help, but I've been through the tutorials. I've been debugging the code for tomcat 8.05 and this looks like a defect. It finds my class in ContextConfig.checkHandlesTypes and then passes it to Introspection.loadClass(), but the class load fails and so the class isn't added to the list of endpoints. This is the exact thing that happens when I pull the EchoAnnotation endpoint out of the examples webapp and try it independently. Can I get someone to verify, please? 1. What exactly version of Tomcat you are using? https://wiki.apache.org/tomcat/FAQ/Linux_Unix#Q5 2. Does you copy of Tomcat has the following libraries in its lib directory? tomcat-websocket.jar websocket-api.jar 3. Loading of what class fails? Your class, or some of its dependencies? What is stacktrace when class loading fails? I have been through the examples web.xml and cannot find any configuration for websockets at all except the listener definition for the old school version of web sockets. (I'm assuming this predated JSR-356.) All websockets in Tomcat 8 are JSR-356. (Old-school were in Tomcat 7, where both them and JSR-356 are available now). Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org 1. Sorry, tomcat 8.0.5. 2. Yes. 3. My class. A class being used was not included on the classpath, which caused the class not to load. The stacktrace is IllegalStateException from ClassNotFoundException. This stack trace doesn't show up anywhere in tomcat 8.0.5. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Configuring a JSR-356 Websocket
On 04/22/2014 07:50 AM, Konstantin Kolinko wrote: 2014-04-22 15:31 GMT+04:00 Thom Hehl th...@corrisoft.com: On 04/21/2014 04:30 PM, Daniel Mikusa wrote: On Apr 21, 2014, at 9:58 AM, Thom Hehl th...@corrisoft.com wrote: Tomcat 8/Ubuntu 12.04 I have my tomcat deployed with the example echo application. I wrote a tester that hits the URL provided and sends a message and then receives the response back. I want to deploy my own websocket. I have done so using the @ServerEndpoint(value = /websocket) annotation. When i try to hit this from my client, I get a http 404 status. I looked at the examples again and found that there was this ExamplesConfig.java. Aha! I thought, a magic class that makes this configuration work. I implemented my own and it does not change the results. It does not appear to be calling my config at all because I have System.out.println()s in my config and they are not showing up in the log. I have been through the examples web.xml and cannot find any configuration for websockets at all except the listener definition for the old school version of web sockets. (I'm assuming this predated JSR-356.) So how do i configure tomcat so it knows about my web socket? I don’t think this is really Tomcat specific. Maybe start with a JSR-356 tutorial and see if that helps to answer your questions. http://docs.oracle.com/javaee/7/tutorial/doc/websocket.htm I also have some examples on Github, if you’re looking for more WebSockets examples. https://github.com/dmikusa-pivotal/tomcat-8-features I appreciate the help, but I've been through the tutorials. I've been debugging the code for tomcat 8.05 and this looks like a defect. It finds my class in ContextConfig.checkHandlesTypes and then passes it to Introspection.loadClass(), but the class load fails and so the class isn't added to the list of endpoints. This is the exact thing that happens when I pull the EchoAnnotation endpoint out of the examples webapp and try it independently. Can I get someone to verify, please? 1. What exactly version of Tomcat you are using? https://wiki.apache.org/tomcat/FAQ/Linux_Unix#Q5 2. Does you copy of Tomcat has the following libraries in its lib directory? tomcat-websocket.jar websocket-api.jar 3. Loading of what class fails? Your class, or some of its dependencies? What is stacktrace when class loading fails? I have been through the examples web.xml and cannot find any configuration for websockets at all except the listener definition for the old school version of web sockets. (I'm assuming this predated JSR-356.) All websockets in Tomcat 8 are JSR-356. (Old-school were in Tomcat 7, where both them and JSR-356 are available now). Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org I created bug 56442 for this issue. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Configuring a JSR-356 Websocket
Tomcat 8/Ubuntu 12.04 I have my tomcat deployed with the example echo application. I wrote a tester that hits the URL provided and sends a message and then receives the response back. I want to deploy my own websocket. I have done so using the @ServerEndpoint(value = /websocket) annotation. When i try to hit this from my client, I get a http 404 status. I looked at the examples again and found that there was this ExamplesConfig.java. Aha! I thought, a magic class that makes this configuration work. I implemented my own and it does not change the results. It does not appear to be calling my config at all because I have System.out.println()s in my config and they are not showing up in the log. I have been through the examples web.xml and cannot find any configuration for websockets at all except the listener definition for the old school version of web sockets. (I'm assuming this predated JSR-356.) So how do i configure tomcat so it knows about my websocket? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat 8 websocket example
I have downloaded the websocket example echo in the examples section of the tomcat 8 docs. I downloaded both java classes and the xhtml file and have placed all of these in my eclipse project. I then created a basic web.xml which is: ?xml version=1.0 encoding=UTF-8? web-app xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd; version=3.0 welcome-file-list welcome-fileecho.xhtml/welcome-file /welcome-file-list /web-app I build all of this into a war with my libraries. I've stripped out the javax.websocket libraries by hand from the jar file just to get the test working. I place this in tomcat, start it, and go to: http://localhost:8080/examples/echo.xhtml. When I choose either API and click connect, it immediately responds with: Info: WebSocket connection closed, Code: 1006. Since I'm just running an example, I can't see where I've erred. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Fwd: Tomcat 8 websocket example
Also, I found several examples of this same issue on stack overflow with no solutions. Original Message Subject:Tomcat 8 websocket example Date: Fri, 18 Apr 2014 12:28:56 -0400 From: Thom Hehl th...@corrisoft.com To: users@tomcat.apache.org I have downloaded the websocket example echo in the examples section of the tomcat 8 docs. I downloaded both java classes and the xhtml file and have placed all of these in my eclipse project. I then created a basic web.xml which is: ?xml version=1.0 encoding=UTF-8? web-app xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd; version=3.0 welcome-file-list welcome-fileecho.xhtml/welcome-file /welcome-file-list /web-app I build all of this into a war with my libraries. I've stripped out the javax.websocket libraries by hand from the jar file just to get the test working. I place this in tomcat, start it, and go to: http://localhost:8080/examples/echo.xhtml. When I choose either API and click connect, it immediately responds with: Info: WebSocket connection closed, Code: 1006. Since I'm just running an example, I can't see where I've erred.
Context configuration file
We are using a context configuration file to provide our database connectivity through a JNDI entry to our application so that the file can change without the purchasers of our software having to tinker about with it internally. Here is our file: Context path=/chronicle debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=ej-Log. suffix=.txt timestamp=true/ Resource name=jdbc/chronicle auth=Container type=javax.sql.DataSource username=sa password=xxx driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://localhost/PsDb maxActive=-1 maxIdle=0 / /Context I picked this trick up from a predecessor on a job and have never found it documented anywhere. I would like to use the same approach to define JNDI keys for the mail server. Can someone help? Thanks.
RE: Context configuration file
This has been very helpful, thank you. I had been unable to find this: One other question, my spring configuration for this looks like this: bean id=mailSender class=org.springframework.mail.javamail.JavaMailSenderImpl property name=host value=smtp..com/ property name=password value=x/ property name=port value=587/ property name=username value=nore...@x.com/ property name=javaMailProperties props prop key=mail.smtp.fromnore...@.com/prop prop key=mail.smtp.usernore...@.com/prop prop key=mail.smtp.authtrue/prop prop key=mail.smtp.starttls.enabletrue/prop /props /property /bean How do I place the properties for javaMailProperties in? -Original Message- From: Daniel Mikusa [mailto:dmik...@vmware.com] Sent: Wednesday, January 11, 2012 8:29 AM To: Tomcat Users List Subject: Re: Context configuration file On Wed, 2012-01-11 at 05:01 -0800, Thom Hehl wrote: We are using a context configuration file to provide our database connectivity through a JNDI entry to our application so that the file can change without the purchasers of our software having to tinker about with it internally. Here is our file: Context path=/chronicle debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=ej-Log. suffix=.txt timestamp=true/ Resource name=jdbc/chronicle auth=Container type=javax.sql.DataSource username=sa password=xxx driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://localhost/PsDb maxActive=-1 maxIdle=0 / /Context I picked this trick up from a predecessor on a job and have never found it documented anywhere. I'm not exactly sure what you mean here, but JNDI (i.e. the Resource/ tag) is document here. https://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html and here. https://tomcat.apache.org/tomcat-7.0-doc/config/globalresources.html I would like to use the same approach to define JNDI keys for the mail server. Can someone help? You can certainly do this. Here's a link to the docs which describes how to define Mail Sessions. https://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html#JavaMail_Sessions Dan
RE: Context configuration file
7.0.8 This is the configuration file in conf/Catalina/localhost and shares the name of my webapp. -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Wednesday, January 11, 2012 10:52 AM To: Tomcat Users List Subject: Re: Context configuration file On 11/01/2012 13:01, Thom Hehl wrote: We are using a context configuration file to provide our database connectivity through a JNDI entry to our application so that the file can change without the purchasers of our software having to tinker about with it internally. Here is our file: Which version of Tomcat is this? Which file is this? p Context path=/chronicle debug=5 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=ej-Log. suffix=.txt timestamp=true/ Resource name=jdbc/chronicle auth=Container type=javax.sql.DataSource username=sa password=xxx driverClassName=net.sourceforge.jtds.jdbc.Driver url=jdbc:jtds:sqlserver://localhost/PsDb maxActive=-1 maxIdle=0 / /Context I picked this trick up from a predecessor on a job and have never found it documented anywhere. I would like to use the same approach to define JNDI keys for the mail server. Can someone help? Thanks. -- [key:62590808] - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: How to forward all kind of request from ROOT to another subdirectory?
Simplest would be to set up an index.html in the root path that redirects to whatever you wish. You can find 500 hits on google about how to do an HTML redirect. -Original Message- From: Xybrek [mailto:xyb...@gmail.com] Sent: Thursday, December 08, 2011 3:07 AM To: users@tomcat.apache.org Subject: How to forward all kind of request from ROOT to another subdirectory? Hello, I need to forward all kind of request from the ROOT, i.e http://localhost:8080/ to http://localhost:8080/myRoot Is it possible, do I need to create a redirect servlet? However, I think tomcat can be configured to behave that way? - 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: Apache HTTPD - Tomcat, Passing Errors
How about a re-direct to a page that Apache will handle. You could re-direct to http://blah.com/invalid.page or some such or even a valid page. -Original Message- From: Jonathan Rosenberg [mailto:shmol...@gmail.com] Sent: Monday, December 05, 2011 3:42 PM To: Tomcat Users List Subject: Apache HTTPD - Tomcat, Passing Errors I am using Tomcat 7.0.22, Java 1.6 on a Linux box. Front-end is Apache/2.2.17 connected using proxypass with ajp. I'd like page-request errors on the Tomcat side to be to be passed back to httpd for handling. right now, Tomcat formats the error page passes that back. I've spent some time digging through docs, etc can;t find an answer. Any help appreciated. -- Jonathan Rosenberg Founder Executive Director Tabby's Place, a Cat Sanctuary http://www.tabbysplace.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: hi
Don't use it. Why build applications on a platform you have doubts about? I think you should build all of your applications using snobol. See http://en.wikipedia.org/wiki/SNOBOL for websites. -Original Message- From: srilaxmi deevela [mailto:deevelasrila...@gmail.com] Sent: Friday, December 02, 2011 2:14 PM To: Tomcat Users List Subject: hi Hi, i havesome doubts on web applications in java, is there any websites like users@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Logging
-Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Wednesday, November 30, 2011 6:15 PM To: Tomcat Users List Subject: Re: Logging -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thom, On 11/30/11 1:04 PM, Thom Hehl wrote: I'm using VI to reading the log file. I running a Windows RDP. Are you using 'vi' in a way that allows it to get updates from the file? I'm no 'vi' expert, but I'm sure it reads the entire file at startup and thinks that it doesn't change. Actually, it monitors the file and allows you to load changes if the file changes. The problem is that this is a test server and so it may take days to dump the log I need. So the tool reading it is not the problem, it's the fact that tomcat hasn't flushed to the file yet. Try using: tail -f stdout.log If you have a POSIX environment handy (like Cygwin, or gnuutils or whatever). - -chris PS: vi on Windows? That's doing things the hard way. ;) Oh, contraire...although one of the hardest editors to learn to use (IBM's XEDIT comes to mind as equally hard) vi is the best editor to use EVER. -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7WuOIACgkQ9CaO5/Lv0PA8hQCfbPXtlASPD28Nr1R7xayvAhZM OWgAoJtmfQ9IHfVNVip7nqSX0vjqonLg =lvdm -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Logging
I'm looking for stack traces. People report defects and we get a stack trace and I need to see it in the log, but instead, the log is still in the buffer. Usually I have to shutdown the server and start it back up to get the log entries. I'd just like to be able to flush the logs without shutting down the server. -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Thursday, December 01, 2011 8:38 AM To: Tomcat Users List Subject: Re: Logging On 01/12/2011 13:03, Thom Hehl wrote: -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Wednesday, November 30, 2011 6:15 PM To: Tomcat Users List Subject: Re: Logging Thom, On 11/30/11 1:04 PM, Thom Hehl wrote: I'm using VI to reading the log file. I running a Windows RDP. Are you using 'vi' in a way that allows it to get updates from the file? I'm no 'vi' expert, but I'm sure it reads the entire file at startup and thinks that it doesn't change. Actually, it monitors the file and allows you to load changes if the file changes. The problem is that this is a test server and so it may take days to dump the log I need. So the tool reading it is not the problem, it's the fact that tomcat hasn't flushed to the file yet. Can you explain a little more about where what is generating log data and into which log it is being written? How long is the delay between when you expect the event to happen and the emission of a log record? p Try using: tail -f stdout.log If you have a POSIX environment handy (like Cygwin, or gnuutils or whatever). - -chris PS: vi on Windows? That's doing things the hard way. ;) Oh, contraire...although one of the hardest editors to learn to use (IBM's XEDIT comes to mind as equally hard) vi is the best editor to use EVER. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- [key:62590808]
RE: Logging
I'm not sure. Whichever log file the stack traces goto. Yes, they're writing to a local drive. Yes as a windows service which came with the installer. -Original Message- From: Daniel Mikusa [mailto:dmik...@vmware.com] Sent: Thursday, December 01, 2011 9:38 AM To: Tomcat Users List Subject: RE: Logging On Thu, 2011-12-01 at 06:01 -0800, Thom Hehl wrote: I'm looking for stack traces. People report defects and we get a stack trace and I need to see it in the log, but instead, the log is still in the buffer. Usually I have to shutdown the server and start it back up to get the log entries. I'd just like to be able to flush the logs without shutting down the server. Is this happening for all of your log files? or just a specific one? If specific, what is the name of the log file where this is occurring? Also, can you confirm that Tomcat is writing the log file to a local disk and not a remote share like Samba or NFS? Lastly, you said you're running Tomcat 7.0.20 as a daemon. I'm assuming this means you're running it as a Windows Service. Please correct me if I'm wrong. Are you using the service wrapper that ships with Tomcat or are you using a different one? Like Java Service Wrapper (http://www.tanukisoftware.com/en/wrapper.php). Dan -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Thursday, December 01, 2011 8:38 AM To: Tomcat Users List Subject: Re: Logging On 01/12/2011 13:03, Thom Hehl wrote: -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Wednesday, November 30, 2011 6:15 PM To: Tomcat Users List Subject: Re: Logging Thom, On 11/30/11 1:04 PM, Thom Hehl wrote: I'm using VI to reading the log file. I running a Windows RDP. Are you using 'vi' in a way that allows it to get updates from the file? I'm no 'vi' expert, but I'm sure it reads the entire file at startup and thinks that it doesn't change. Actually, it monitors the file and allows you to load changes if the file changes. The problem is that this is a test server and so it may take days to dump the log I need. So the tool reading it is not the problem, it's the fact that tomcat hasn't flushed to the file yet. Can you explain a little more about where what is generating log data and into which log it is being written? How long is the delay between when you expect the event to happen and the emission of a log record? p Try using: tail -f stdout.log If you have a POSIX environment handy (like Cygwin, or gnuutils or whatever). - -chris PS: vi on Windows? That's doing things the hard way. ;) Oh, contraire...although one of the hardest editors to learn to use (IBM's XEDIT comes to mind as equally hard) vi is the best editor to use EVER. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Logging
When running Tomcat 7.0.20 as a daemon, it doesn't appear to be writing the logs to the file until tomcat is stopped. Is there some way I can make tomcat dump the logs it's holding onto?
RE: Logging
I am using the out of the box configuration for logging. I did a search of my logging.properties and didn't find buffersize. Here 'tis. # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the License); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an AS IS BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler .handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler # Handler specific properties. # Describes specific configuration info for Handlers. 1catalina.org.apache.juli.FileHandler.level = FINE 1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 1catalina.org.apache.juli.FileHandler.prefix = catalina. 2localhost.org.apache.juli.FileHandler.level = FINE 2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 2localhost.org.apache.juli.FileHandler.prefix = localhost. 3manager.org.apache.juli.FileHandler.level = FINE 3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 3manager.org.apache.juli.FileHandler.prefix = manager. 4host-manager.org.apache.juli.FileHandler.level = FINE 4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 4host-manager.org.apache.juli.FileHandler.prefix = host-manager. java.util.logging.ConsoleHandler.level = FINE java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter # Facility specific properties. # Provides extra control for each logger. org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.FileHandler # For example, set the org.apache.catalina.util.LifecycleBase logger to log # each component that extends LifecycleBase changing state: #org.apache.catalina.util.LifecycleBase.level = FINE # To see debug messages in TldLocationsCache, uncomment the following line: #org.apache.jasper.compiler.TldLocationsCache.level = FINE Note that I'm not unhappy with the logging setting, but sometimes, I need the logs now to debug a problem. I'd just like to be able to tell it to dump the buffer to file. It sounds like there's no way to do that with the default logger. -Original Message- From: Daniel Mikusa [mailto:dmik...@vmware.com] Sent: Wednesday, November 30, 2011 11:46 AM To: Tomcat Users List Subject: Re: Logging On Wed, 2011-11-30 at 07:01 -0800, Thom Hehl wrote: When running Tomcat 7.0.20 as a daemon, it doesn't appear to be writing the logs to the file until tomcat is stopped. Is there some way I can make tomcat dump the logs it's holding onto? Just a guess, but it sounds like it could be buffering. org.apache.juli.FileHandler supports buffering of the logs. The buffering is not enabled by default. To configure it, use the bufferSize property of a handler. The value of 0 uses system default buffering (typically an 8K buffer will be used). A value of 0 forces a writer flush upon each log write. A value 0 uses a BufferedOutputStream with the defined value but note that the system default buffering will also be applied. https://tomcat.apache.org/tomcat-7.0-doc/logging.html It's hard to tell exactly though, without seeing your logging configuration. Please try including your logging.properties (assuming you are using the Java logging), so that we can all see it. Dan
RE: Logging
I'm using VI to reading the log file. I running a Windows RDP. -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Wednesday, November 30, 2011 1:03 PM To: Tomcat Users List Subject: Re: Logging -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thom, On 11/30/11 10:01 AM, Thom Hehl wrote: When running Tomcat 7.0.20 as a daemon, it doesn't appear to be writing the logs to the file until tomcat is stopped. Is there some way I can make tomcat dump the logs it's holding onto? What tool are you using to read the log file? Anything else we should know? Remote file share/NFS? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7Wb9oACgkQ9CaO5/Lv0PAjCACfdkWGJ/O+Bv+jPKUxv+bzdL+6 hA0AoIuQpNdivsS6tIB6I06uVl/Xa5ZZ =9PE+ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Spawning a thread
Isn't there a caveat about spawning a new thread inside of a servlet? Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Spawning a thread
Can you point me to some documentation about context listener threads? I have no idea what you're talking about. Thanks. George Sexton wrote: -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Saturday, January 14, 2006 1:20 PM To: Tomcat Users List Subject: Re: Spawning a thread risks. But, if you have something like a background process that isn't tied to a request, with the caveat the other poster made about daemon A good way of starting threads not tied to a request is to have a context listener class start the threads and handle any required shutdown. George Sexton MH Software, Inc. http://www.mhsoftware.com/ Voice: 303 438 9585 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Threads and SocketException
The issue is that this works just fine when not running inside of Tomcat. Any ideas what runing inside of a servlet context-spawned thread can cause this kind of error? Wade Chandler wrote: --- Thom Hehl [EMAIL PROTECTED] wrote: OK, I'm using tomcat and a sevlet to launch a background process in a separate thread. It seems to launch just fine, but after it runs for maybe 30 seconds it dies, spitting out this error: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(Unknown Source) at java.io.BufferedInputStream.read1(Unknown Source) at java.io.BufferedInputStream.read(Unknown Source) at java.io.BufferedInputStream.fill(Unknown Source) at java.io.BufferedInputStream.read(Unknown Source) at org.apache.commons.net.telnet.TelnetInputStream.__read(TelnetInputStream.java:114) at org.apache.commons.net.telnet.TelnetInputStream.run(TelnetInputStream.java:535) at java.lang.Thread.run(Unknown Source) Any ideas as to what may be happening, how I can fix? Thanks. Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby Well what ever it is has to do with your connecting to some service/resource and reading something. Commons net Telnet connections maybe? What ever it is is getting an exception. I'd start there. You can also debug your application. Develop in an IDE and step through the code giving you an error. Netbeans and Eclipse can help you there. Wade - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Path issues
Wanted to run this by the list before turning this in as a bug. I'm running the following servlet fragment... package rex; /* * Copyright 2006, Heavyweight Software. All rights reserved. */ import java.io.File; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.RequestDispatcher; import rex.IdxFileConverter; /** * servlet to simply launch the rex conversion process */ public final class LaunchRex extends HttpServlet implements Runnable { /** * Respond to a GET request for the content produced by * this servlet. * * @param request The servlet request we are processing * @param response The servlet response we are producing * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { File path=new File(./); System.out.println(path.getAbsolutePath()); When I run this under windows, the path points to the Tomcat5.5, which is where tomcat is installed. When I run this under Redhat Linux, it points to the webapps directory under the tomcat directory. Is there anyone that doesn't think this is broken? Thanks. Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Path issues
I think, though, that tomcat should be consistent in the way it handles things. Tomcat on Unix should behave like tomcat under windows. Inconsistency is a real problem here. Wendy Smoak wrote: On 1/14/06, Thom Hehl [EMAIL PROTECTED] wrote: Wanted to run this by the list before turning this in as a bug. I'm running the following servlet fragment... public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { File path=new File(./); System.out.println(path.getAbsolutePath()); When I run this under windows, the path points to the Tomcat5.5, which is where tomcat is installed. When I run this under Redhat Linux, it points to the webapps directory under the tomcat directory. Is there anyone that doesn't think this is broken? Me. :) The only thing the Servlet container is required to do for you is provide a temporary working directory. Servlet 2.4 Specification: SRV.3.7.1 Temporary Working Directories A temporary storage directory is required for each servlet context. Servlet containers must provide a private temporary directory for each servlet context, and make it available via the javax.servlet.context.tempdir context attribute. The objects associated with the attribute must be of type java.io.File. Depending on what you're going to do with the File, if the temporary directory won't work, several things may be more appropriate. A database, or configuring a context param with a known good location to which the user running Tomcat has permission to write, for example. HTH, -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot find servlet
Sigh, I don't know why I keep having problems like this. I have the following servlet: package rex; /* * Copyright 2006, Heavyweight Software. All rights reserved. */ import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.RequestDispatcher; import rex.IdxFileConverter; /** * servlet to simply launch the rex conversion process */ public final class LaunchRex extends HttpServlet { Boring stuff here... } Here is my web.xml file: ?xml version=1.0 encoding=ISO-8859-1? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 display-nameLaunches the REX converter/display-name description Launches the REX converter /description servlet servlet-nameLaunchRex/servlet-name servlet-class rex.LaunchRex /servlet-class /servlet servlet-mapping servlet-nameLaunchRex/servlet-name url-pattern/LaunchRex/url-pattern /servlet-mapping /web-app I have stored LaunchRex.class in rex.jar file in the lib directory of my webapp. When I access http://localhost:81/rex/LaunchRex I get this error: javax.servlet.ServletException: Wrapper cannot find servlet class rex.LaunchRex or a class it depends on org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) java.lang.Thread.run(Unknown Source) I'm not sure where to look next. Help? Thanks. Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot find servlet
I verified this and the class is correctly stored in the jar. I'm really stumped on this one. Wade Chandler wrote: --- Thom Hehl [EMAIL PROTECTED] wrote: Sigh, I don't know why I keep having problems like this. I have the following servlet: package rex; /* * Copyright 2006, Heavyweight Software. All rights reserved. */ import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.RequestDispatcher; import rex.IdxFileConverter; /** * servlet to simply launch the rex conversion process */ public final class LaunchRex extends HttpServlet { Boring stuff here... } Here is my web.xml file: ?xml version=1.0 encoding=ISO-8859-1? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 display-nameLaunches the REX converter/display-name description Launches the REX converter /description servlet servlet-nameLaunchRex/servlet-name servlet-class rex.LaunchRex /servlet-class /servlet servlet-mapping servlet-nameLaunchRex/servlet-name url-pattern/LaunchRex/url-pattern /servlet-mapping /web-app I have stored LaunchRex.class in rex.jar file in the lib directory of my webapp. When I access http://localhost:81/rex/LaunchRex I get this error: javax.servlet.ServletException: Wrapper cannot find servlet class rex.LaunchRex or a class it depends on org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) java.lang.Thread.run(Unknown Source) I'm not sure where to look next. Help? Thanks. Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com Well, there isn't really a lot to go on here. My guess would be that you have put the class file in the jar, but didn't put the package and class in the jar. Meaning: If you extract your jar using a zip utility the top level would have simply LaunchRex.class when it should have rex/LaunchRex.class. Wade - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Fwd: Re: Cannot find servlet]
I tried uncompressing the jar file into the classes directory, but it didn't change anything. Anyone have any ideas for me to look at? I don't know what's up. Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby ---BeginMessage--- I verified this and the class is correctly stored in the jar. I'm really stumped on this one. Wade Chandler wrote: --- Thom Hehl [EMAIL PROTECTED] wrote: Sigh, I don't know why I keep having problems like this. I have the following servlet: package rex; /* * Copyright 2006, Heavyweight Software. All rights reserved. */ import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.RequestDispatcher; import rex.IdxFileConverter; /** * servlet to simply launch the rex conversion process */ public final class LaunchRex extends HttpServlet { Boring stuff here... } Here is my web.xml file: ?xml version=1.0 encoding=ISO-8859-1? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 display-nameLaunches the REX converter/display-name description Launches the REX converter /description servlet servlet-nameLaunchRex/servlet-name servlet-class rex.LaunchRex /servlet-class /servlet servlet-mapping servlet-nameLaunchRex/servlet-name url-pattern/LaunchRex/url-pattern /servlet-mapping /web-app I have stored LaunchRex.class in rex.jar file in the lib directory of my webapp. When I access http://localhost:81/rex/LaunchRex I get this error: javax.servlet.ServletException: Wrapper cannot find servlet class rex.LaunchRex or a class it depends on org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) java.lang.Thread.run(Unknown Source) I'm not sure where to look next. Help? Thanks. Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com Well, there isn't really a lot to go on here. My guess would be that you have put the class file in the jar, but didn't put the package and class in the jar. Meaning: If you extract your jar using a zip utility the top level would have simply LaunchRex.class when it should have rex/LaunchRex.class. Wade - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby ---End Message--- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Fwd: Re: Cannot find servlet]
As we all suspected, I was, in fact, being an idiot. My lib directory was under the rex directory, not under rex/WEB-INF. I've been looking at this for hours and it just never sunk in. Must be tired. Been a long week. Thanks! Thom Hehl wrote: I tried uncompressing the jar file into the classes directory, but it didn't change anything. Anyone have any ideas for me to look at? I don't know what's up. Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com Subject: Re: Cannot find servlet From: Thom Hehl [EMAIL PROTECTED] Date: Fri, 13 Jan 2006 14:44:13 -0500 To: Tomcat Users List users@tomcat.apache.org To: Tomcat Users List users@tomcat.apache.org I verified this and the class is correctly stored in the jar. I'm really stumped on this one. Wade Chandler wrote: --- Thom Hehl [EMAIL PROTECTED] wrote: Sigh, I don't know why I keep having problems like this. I have the following servlet: package rex; /* * Copyright 2006, Heavyweight Software. All rights reserved. */ import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.RequestDispatcher; import rex.IdxFileConverter; /** * servlet to simply launch the rex conversion process */ public final class LaunchRex extends HttpServlet { Boring stuff here... } Here is my web.xml file: ?xml version=1.0 encoding=ISO-8859-1? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 display-nameLaunches the REX converter/display-name description Launches the REX converter /description servlet servlet-nameLaunchRex/servlet-name servlet-class rex.LaunchRex /servlet-class /servlet servlet-mapping servlet-nameLaunchRex/servlet-name url-pattern/LaunchRex/url-pattern /servlet-mapping /web-app I have stored LaunchRex.class in rex.jar file in the lib directory of my webapp. When I access http://localhost:81/rex/LaunchRex I get this error: javax.servlet.ServletException: Wrapper cannot find servlet class rex.LaunchRex or a class it depends on org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) java.lang.Thread.run(Unknown Source) I'm not sure where to look next. Help? Thanks. Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com Well, there isn't really a lot to go on here. My guess would be that you have put the class file in the jar, but didn't put the package and class in the jar. Meaning: If you extract your jar using a zip utility the top level would have simply LaunchRex.class when it should have rex/LaunchRex.class. Wade - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Session from a tag
I'm trying to get to the session from a tag. I have a bean stored there that I want to use in my tag. How can I retrieve this. I can't find this information anywhere. Thanks. Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session from a tag
Ah!!! That's what I was looking for. Thanks so much! David Delbecq wrote: getJspContext().getAttribute(someKey,PageContext.SESSION_SCOPE) Le Mercredi 11 Janvier 2006 16:19, Thom Hehl a écrit : This explains the code I found. What if you extend SimpleTagSupport. What's the difference? David Delbecq wrote: to expose bean in jsp: http://java.sun.com/products/jsp/tags/11/syntaxref11.fm14.html to access session in a custom tag, assuming you extend TagSupport class: pageContext.getSession(); Le Mercredi 11 Janvier 2006 15:57, Thom Hehl a écrit : I'm trying to get to the session from a tag. I have a bean stored there that I want to use in my tag. How can I retrieve this. I can't find this information anywhere. Thanks. Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
First webapp/JSP
OK, I've looked through the docs and googled and I'm not having any luck with this. I have a brand new servlet for my webapp. I have it connected up and running OK. The problem is the forward to the JSP. I'm getting this error: HTTP Status 404 - /visioneer/WEB-INF/SearchErrors.jsp *type* Status report *message* _/visioneer/WEB-INF/SearchErrors.jsp_ *description* _The requested resource (/visioneer/WEB-INF/SearchErrors.jsp) is not available._ Here is the URL that calls my servlet: http://localhost:81/visioneer/controller And here is the code in my servlet: public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { //retrieve the session HttpSession session = request.getSession(); String act=request.getParameter(PARM_ACTION); if(act==null) { String url = /visioneer/WEB-INF/SearchErrors.jsp; RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url); dispatcher.forward(request, response); return; } } And in my tomcat directory, I have webapps/visioneer/WEB-INF/SearchErrors.jsp. I have also tried my forward as: /visioneer/SearchErrors.jsp I don't know what to try next and need advice. Thanks. Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: First webapp/JSP
Thanks for the response. I moved my JSPs to /visioneer and modified my forward to: String url = /visioneer/HomeSearch.jsp; RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url); dispatcher.forward(request, response); And I now get this error: *type* Status report *message* _/visioneer/HomeSearch.jsp_ *description* _The requested resource (/visioneer/HomeSearch.jsp) is not available. _ Mark Thomas wrote: Thom Hehl wrote: OK, I've looked through the docs and googled and I'm not having any luck with this. I have a brand new servlet for my webapp. I have it connected up and running OK. The problem is the forward to the JSP. I'm getting this error: HTTP Status 404 - /visioneer/WEB-INF/SearchErrors.jsp The servlet spec requires that no resources are served from the WEB-INF directory for security reasons. Move the jsp to /visioneer/SearchErrors.jsp and all should be fine. mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: First webapp/JSP
Wow! Thanks, that's it. I started without that, but added it when I was having problems. Thanks again! Wendy Smoak wrote: On 1/8/06, Thom Hehl [EMAIL PROTECTED] wrote: String url = /visioneer/HomeSearch.jsp; RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url); dispatcher.forward(request, response); And I now get this error: *type* Status report *message* _/visioneer/HomeSearch.jsp_ In general, you should not be hard-coding the name of the context in your app. http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/ServletContext.html#getRequestDispatcher(java.lang.String) The pathname must begin with a / and is interpreted as relative to the current context root. So leave off the 'visioneer' part, (which is the context name,) start with / and then give the path to the resource, depending on where you moved it to. HTH, -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thom Hehl Heavyweight Software for Heavyweight Needs www.heavyweightsoftware.com -- In every revolution, there is one man with a vision.--Jerome Bixby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]