Re: Object sharing
Arvind By design I would use an EJB, this way you can also use proper security to comtrol access to your bean. You can access the EJB from any webapps, wether it runs or not on the same server. And you can also expose it as a web service. Using JBoss you will have tomcat out of the box as well as transaction, security, etc And no license cost. Hopes this helps. Bruno Georges Glencore International AG Tel. +41 41 709 3204 Fax +41 41 709 3000 - Original Message - From: "Arvind S." [EMAIL PROTECTED] Sent: 19.05.2006 21:25 To: users@tomcat.apache.org Subject: Object sharing Hi, If a web application wants to access a object being used by another web-application(with a different context root) running on the same webserver, is that possible? If yes, how can it be achieved?Through sharing attributes of ServletContext? Will getting an attribute from the servletContext, return a copy of the object or the reference itself? Thanks & Regards LEGAL DISCLAIMER. The contents of this e-mail and any attachments are strictly confidential and they may not be used or disclosed by someone who is not a named recipient. If you have received this email in error please notify the sender by replying to this email inserting the word "misdirected" as the message and delete this e-mail from your system.
Re: Directory Structure and Can't Find Resources in Tomcat
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Try putting your webapp under: docroot= /usr/share/tomcat5/webapps/ROOT/smsinfo -=> Gregg <=- Mladen Adamovic wrote: > I would suggest you to install and work with Netbeans 5.0. Netbeans > 5.0 have bundled Tomcat which work out of the box. Than you will not > have problems like these before deployment. > > Allen Williams wrote: >> Well, I can't figure out this directory structure and finding stuff >> at all. >> >> Here are my directory listings >> >> docroot= /usr/share/tomcat5/webapps/smsinfo >> *** >> anw-dev:/usr/share/tomcat5/webapps/smsinfo$ ls -laF >> total 20 >> drwxr-xr-x 3 anw root 4096 2006-05-19 21:14 ./ >> drwxr-xr-x 9 tomcat5 root 4096 2006-05-13 16:10 ../ >> -rw-r--r-- 1 anw anw 564 2006-05-19 21:20 login.jsp >> drwxr-xr-x 4 anw anw 4096 2006-05-19 21:15 WEB-INF/ >> -rw-r--r-- 1 anw anw 241 2006-05-19 21:20 welcome.jsp >> >> >> anw-dev:/usr/share/tomcat5/webapps/smsinfo/WEB-INF$ ls -laF >> total 20 >> drwxr-xr-x 4 anw anw 4096 2006-05-19 21:15 ./ >> drwxr-xr-x 3 anw root 4096 2006-05-19 21:14 ../ >> drwxr-xr-x 3 anw root 4096 2006-05-18 20:27 classes/ >> drwxr-xr-x 2 anw root 4096 2006-05-13 15:49 lib/ >> -rw-r--r-- 1 anw anw 440 2006-05-19 21:18 web.xml >> >> (lib is empty) >> *** >> anw-dev:/usr/share/tomcat5/webapps/smsinfo/WEB-INF/classes$ ls -laF >> total 12 >> drwxr-xr-x 3 anw root 4096 2006-05-18 20:27 ./ >> drwxr-xr-x 4 anw anw 4096 2006-05-19 21:15 ../ >> drwxr-xr-x 2 anw root 4096 2006-05-18 20:27 UserConfig/ >> * >> anw-dev:/usr/share/tomcat5/webapps/smsinfo/WEB-INF/classes/UserConfig$ >> ls -laF >> total 12 >> drwxr-xr-x 2 anw root 4096 2006-05-18 20:27 ./ >> drwxr-xr-x 3 anw root 4096 2006-05-18 20:27 ../ >> -rwxr-xr-x 1 anw root 1322 2006-05-19 21:18 login.class* >> * >> >> Here is the source to login.jsp (located in docroot, >> /usr/share/tomcat5/webapps/smsinfo): >> >> >> >> SMS Information Transfer Login Page >> >> >> >> >> >> > action="WEB-INF/classes/UserConfig.login"> >> User Name: >> Password:> name="password"> >> >> >> >> >> >> * >> Here is the source to login.class: >> >> package UserConfig; >> >> import javax.servlet.*; >> import javax.servlet.http.*; >> import java.io.*; >> import java.util.*; >> >> public class login extends HttpServlet >> { >> private String target="/welcome.jsp"; >> private String getUser(String username, String password) >> { >> return username; >> } >> public void doGet(HttpServletRequest request, HttpServletResponse >> response) >> throws ServletException, IOException >> { >> // If it is a Get request, forward to doPost >> doPost(request, response); >> } >> public void doPost(HttpServletRequest request, HttpServletResponse >> response) >> throws ServletException, IOException >> { >> // Get user name and password: >> String username= request.getParameter("username"); >> String password= request.getParameter("password"); >> String user= getUser(username, password); >> // Add fake user to the request >> request.setAttribute("USER", user); >> ServletContext context= getServletContext(); >> RequestDispatcher dispatcher= >> context.getRequestDispatcher(target); >> //target defined above >> dispatcher.forward(request, response); >> } >> } >> *** >> Here is the source for my web.xml file: >> >> >> >> > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" >> "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd";> >> >> >> >> login >> UserConfig.login >> >> >> login >> /servlet/login >> >> >> *** >> >> As can be seen, all this is very simple, my very first Tomcat web >> app. I >> have >> followed the instructions in >> >> http://tomcat.apache.org/tomcat-5.5-doc/appdev/index.html >> >> When I go to http://localhost:8180/smsinfo/login.jsp, I get the >> form, input >> some text, then get the following screen from tomcat: >> >> HTTP Status 404 - /smsinfo/WEB-INF/classes/UserConfig.login >> >> Type: Status report >> >> Message: /smsinfo/WEB-INF/classes/UserConfig.login >> >> Description: The requested resource >> (/smsinfo/WEB-INF/classes/UserConfig.login) is not available. >> Apache Tomcat/5.0 >> * >> >> I've been screwing around with this for days, reading books and the >> web >> help, >> but can't find out what's wrong. Any help is gr
JDBCRealm authentication failing with MD5
Hi all I am trying to set up a security realm on Tomcat using JDBCRealm and MD5 encryption. It works perfectly when using plain text, but it fails the moment I switch to a MD5 digest. I have been through the documentation, forums and FAQ's but I am afraid I can not resolve this on my own, so help would be appreciated. When attempting to login, the logfile simply states: JDBCRealm[/asdf]: Username username1 NOT successfully authenticated I checked and when generating the MD5 with the command line it seems the same. I have tried to play with the database character encoding, without success. If this is the incorrect, please point it out. The relevant section of the context file is: In the web.xml, the relevant section is: Security Constraint Protected Area *.htm operations FORM My Authentication Area /WEB-INF/jsp/login.jsp /WEB-INF/jsp/error.jsp operations The relevant part of the database schema is as follows: CREATE TABLE authuser ( id int(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, uname varchar(25) NOT NULL UNIQUE default '' COMMENT 'Username', passwd varchar(32) NOT NULL default '' COMMENT 'Encrypted password', INDEX FKIndexUserId (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Users table'; CREATE TABLE user_roles ( id int(4) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT 'Id', unamevarchar(15) not null COMMENT 'name, same as in Authuser table', role_name varchar(15) not null COMMENT 'Role this user is allowed', CONSTRAINT CSconstraint FOREIGN KEY (uname) REFERENCES authuser(uname) ); ALTER TABLE user_roles ADD UNIQUE(uname, role_name); Finally, at the risk of making the mail too long, here is the relevant parts login.jsp: Log into system Username: Password: I am using: Tomcat 5.0 MySql 4.1.7nt JDK 1.4 Thank you in advance Rian
Re: JDBCRealm authentication failing with MD5
Good Morning Rian- I would suggest having a look at and following all of the steps in the JDBC How to tutorial at http://tomcat.apache.org/tomcat-3.3-doc/JDBCRealm-howto.html the important item here is to exercise the basic functionality of generating a digested MD5 password which can be accomplished with command line java org.apache.tomcat.modules.aaa.RealmBase -a MD5 where password is the plain text password to be digested Anyone else ?? Martin -- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: "Rian Brand" <[EMAIL PROTECTED]> To: Sent: Saturday, May 20, 2006 9:01 AM Subject: JDBCRealm authentication failing with MD5 Hi all I am trying to set up a security realm on Tomcat using JDBCRealm and MD5 encryption. It works perfectly when using plain text, but it fails the moment I switch to a MD5 digest. I have been through the documentation, forums and FAQ's but I am afraid I can not resolve this on my own, so help would be appreciated. When attempting to login, the logfile simply states: JDBCRealm[/asdf]: Username username1 NOT successfully authenticated I checked and when generating the MD5 with the command line it seems the same. I have tried to play with the database character encoding, without success. If this is the incorrect, please point it out. The relevant section of the context file is: In the web.xml, the relevant section is: Security Constraint Protected Area *.htm operations FORM My Authentication Area /WEB-INF/jsp/login.jsp /WEB-INF/jsp/error.jsp operations The relevant part of the database schema is as follows: CREATE TABLE authuser ( id int(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, uname varchar(25) NOT NULL UNIQUE default '' COMMENT 'Username', passwd varchar(32) NOT NULL default '' COMMENT 'Encrypted password', INDEX FKIndexUserId (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Users table'; CREATE TABLE user_roles ( id int(4) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT 'Id', unamevarchar(15) not null COMMENT 'name, same as in Authuser table', role_name varchar(15) not null COMMENT 'Role this user is allowed', CONSTRAINT CSconstraint FOREIGN KEY (uname) REFERENCES authuser(uname) ); ALTER TABLE user_roles ADD UNIQUE(uname, role_name); Finally, at the risk of making the mail too long, here is the relevant parts login.jsp: > colspan="2"> Log into system Username: Password: I am using: Tomcat 5.0 MySql 4.1.7nt JDK 1.4 Thank you in advance Rian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Directory Structure and Can't Find Resources in Tomcat
The problem with that approach (admittedly valid if all you care about is getting something working) is that I'm doing this for the educational value, and really want to understand how this works and what I'm doing wrong. Actually, for other Java development, I have used Netbeans, and like it. Thanks for the help, though. -Original Message- From: Mladen Adamovic [mailto:[EMAIL PROTECTED] Sent: Saturday, May 20, 2006 2:29 AM To: Tomcat Users List Subject: Re: Directory Structure and Can't Find Resources in Tomcat I would suggest you to install and work with Netbeans 5.0. Netbeans 5.0 have bundled Tomcat which work out of the box. Than you will not have problems like these before deployment. Allen Williams wrote: > Well, I can't figure out this directory structure and finding stuff at all. > > Here are my directory listings > > docroot= /usr/share/tomcat5/webapps/smsinfo > *** > anw-dev:/usr/share/tomcat5/webapps/smsinfo$ ls -laF > total 20 > drwxr-xr-x 3 anw root 4096 2006-05-19 21:14 ./ > drwxr-xr-x 9 tomcat5 root 4096 2006-05-13 16:10 ../ > -rw-r--r-- 1 anw anw 564 2006-05-19 21:20 login.jsp > drwxr-xr-x 4 anw anw 4096 2006-05-19 21:15 WEB-INF/ > -rw-r--r-- 1 anw anw 241 2006-05-19 21:20 welcome.jsp > > > anw-dev:/usr/share/tomcat5/webapps/smsinfo/WEB-INF$ ls -laF > total 20 > drwxr-xr-x 4 anw anw 4096 2006-05-19 21:15 ./ > drwxr-xr-x 3 anw root 4096 2006-05-19 21:14 ../ > drwxr-xr-x 3 anw root 4096 2006-05-18 20:27 classes/ > drwxr-xr-x 2 anw root 4096 2006-05-13 15:49 lib/ > -rw-r--r-- 1 anw anw 440 2006-05-19 21:18 web.xml > > (lib is empty) > *** > anw-dev:/usr/share/tomcat5/webapps/smsinfo/WEB-INF/classes$ ls -laF > total 12 > drwxr-xr-x 3 anw root 4096 2006-05-18 20:27 ./ > drwxr-xr-x 4 anw anw 4096 2006-05-19 21:15 ../ > drwxr-xr-x 2 anw root 4096 2006-05-18 20:27 UserConfig/ > * > anw-dev:/usr/share/tomcat5/webapps/smsinfo/WEB-INF/classes/UserConfig$ > ls -laF > total 12 > drwxr-xr-x 2 anw root 4096 2006-05-18 20:27 ./ > drwxr-xr-x 3 anw root 4096 2006-05-18 20:27 ../ > -rwxr-xr-x 1 anw root 1322 2006-05-19 21:18 login.class* > * > > Here is the source to login.jsp (located in docroot, > /usr/share/tomcat5/webapps/smsinfo): > > > > SMS Information Transfer Login Page > > > > > > action="WEB-INF/classes/UserConfig.login"> > User Name: > Password: > > > > > > * > Here is the source to login.class: > > package UserConfig; > > import javax.servlet.*; > import javax.servlet.http.*; > import java.io.*; > import java.util.*; > > public class login extends HttpServlet > { > private String target="/welcome.jsp"; > private String getUser(String username, String password) > { > return username; > } > public void doGet(HttpServletRequest request, HttpServletResponse > response) > throws ServletException, IOException > { > // If it is a Get request, forward to doPost > doPost(request, response); > } > public void doPost(HttpServletRequest request, HttpServletResponse > response) > throws ServletException, IOException > { > // Get user name and password: > String username= request.getParameter("username"); > String password= request.getParameter("password"); > String user= getUser(username, password); > // Add fake user to the request > request.setAttribute("USER", user); > ServletContext context= getServletContext(); > RequestDispatcher dispatcher= context.getRequestDispatcher(target); > //target defined above > dispatcher.forward(request, response); > } > } > *** > Here is the source for my web.xml file: > > > > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" > "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd";> > > > > login > UserConfig.login > > > login > /servlet/login > > > *** > > As can be seen, all this is very simple, my very first Tomcat web app. I > have > followed the instructions in > > http://tomcat.apache.org/tomcat-5.5-doc/appdev/index.html > > When I go to http://localhost:8180/smsinfo/login.jsp, I get the form, input > some text, then get the following screen from tomcat: > > HTTP Status 404 - /smsinfo/WEB-INF/classes/UserConfig.login > > Type: Status report > > Message: /smsinfo/WEB-INF/classes/UserConfig.login > > Description: The requested resource > (/smsinfo/WEB-INF/classes/UserConfig.login) is not available. > Apache Tomcat/5.0 >
FW: FW: Directory Structure and Can't Find Resources in Tomcat
When I do that, I just get this in my browser: *** Type: Status report Message: /smsinfo/ Description: The requested resource (/smsinfo/) is not available. ** Also, for what it's worth, none of the documentation seems to indicate that I put this under ROOT. Any further ideas, from anyone out there? On Saturday 20 May 2006 11:11, you wrote: > Try putting your webapp under: > > docroot= /usr/share/tomcat5/webapps/ROOT/smsinfo > > -=> Gregg <=- > > Mladen Adamovic wrote: > > I would suggest you to install and work with Netbeans 5.0. Netbeans > > 5.0 have bundled Tomcat which work out of the box. Than you will not > > have problems like these before deployment. > > > > Allen Williams wrote: > >> Well, I can't figure out this directory structure and finding stuff > >> at all. > >> > >> Here are my directory listings > >> > >> docroot= /usr/share/tomcat5/webapps/smsinfo > >> *** > >> anw-dev:/usr/share/tomcat5/webapps/smsinfo$ ls -laF > >> total 20 > >> drwxr-xr-x 3 anw root 4096 2006-05-19 21:14 ./ > >> drwxr-xr-x 9 tomcat5 root 4096 2006-05-13 16:10 ../ > >> -rw-r--r-- 1 anw anw 564 2006-05-19 21:20 login.jsp > >> drwxr-xr-x 4 anw anw 4096 2006-05-19 21:15 WEB-INF/ > >> -rw-r--r-- 1 anw anw 241 2006-05-19 21:20 welcome.jsp > >> > >> > >> anw-dev:/usr/share/tomcat5/webapps/smsinfo/WEB-INF$ ls -laF > >> total 20 > >> drwxr-xr-x 4 anw anw 4096 2006-05-19 21:15 ./ > >> drwxr-xr-x 3 anw root 4096 2006-05-19 21:14 ../ > >> drwxr-xr-x 3 anw root 4096 2006-05-18 20:27 classes/ > >> drwxr-xr-x 2 anw root 4096 2006-05-13 15:49 lib/ > >> -rw-r--r-- 1 anw anw 440 2006-05-19 21:18 web.xml > >> > >> (lib is empty) > >> *** > >> anw-dev:/usr/share/tomcat5/webapps/smsinfo/WEB-INF/classes$ ls -laF > >> total 12 > >> drwxr-xr-x 3 anw root 4096 2006-05-18 20:27 ./ > >> drwxr-xr-x 4 anw anw 4096 2006-05-19 21:15 ../ > >> drwxr-xr-x 2 anw root 4096 2006-05-18 20:27 UserConfig/ > >> * > >> anw-dev:/usr/share/tomcat5/webapps/smsinfo/WEB-INF/classes/UserConfig$ > >> ls -laF > >> total 12 > >> drwxr-xr-x 2 anw root 4096 2006-05-18 20:27 ./ > >> drwxr-xr-x 3 anw root 4096 2006-05-18 20:27 ../ > >> -rwxr-xr-x 1 anw root 1322 2006-05-19 21:18 login.class* > >> * > >> > >> Here is the source to login.jsp (located in docroot, > >> /usr/share/tomcat5/webapps/smsinfo): > >> > >> > >> > >> SMS Information Transfer Login Page > >> > >> > >> > >> > >> > >> >> action="WEB-INF/classes/UserConfig.login"> > >> User Name: > >> Password: >> name="password"> > >> > >> > >> > >> > >> > >> * > >> Here is the source to login.class: > >> > >> package UserConfig; > >> > >> import javax.servlet.*; > >> import javax.servlet.http.*; > >> import java.io.*; > >> import java.util.*; > >> > >> public class login extends HttpServlet > >> { > >> private String target="/welcome.jsp"; > >> private String getUser(String username, String password) > >> { > >> return username; > >> } > >> public void doGet(HttpServletRequest request, HttpServletResponse > >> response) > >> throws ServletException, IOException > >> { > >> // If it is a Get request, forward to doPost > >> doPost(request, response); > >> } > >> public void doPost(HttpServletRequest request, HttpServletResponse > >> response) > >> throws ServletException, IOException > >> { > >> // Get user name and password: > >> String username= request.getParameter("username"); > >> String password= request.getParameter("password"); > >> String user= getUser(username, password); > >> // Add fake user to the request > >> request.setAttribute("USER", user); > >> ServletContext context= getServletContext(); > >> RequestDispatcher dispatcher= > >> context.getRequestDispatcher(target); > >> //target defined above > >> dispatcher.forward(request, response); > >> } > >> } > >> *** > >> Here is the source for my web.xml file: > >> > >> > >> > >> >> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" > >> "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd";> > >> > >> > >> > >> login > >> UserConfig.login > >> > >> > >> login > >> /servlet/login > >> > >> > >> *** > >> > >> As can be seen, all this is very simple, my very first Tomcat web > >> app. I > >> have > >>
Re: error page
It could be that the error page itself is throwing an error. Try using an ultra-simple error page. -- Len On 5/18/06, Zohar <[EMAIL PROTECTED]> wrote: No, I've used the "Letting a page define its error page" option. - Original Message - From: "Franck Borel" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Thursday, May 18, 2006 14:20 Subject: Re: error page > > >> I'm trying to use the error handling mechanism described in >> http://java.sun.com/developer/EJTechTips/2003/tt0114.html. >> When an exception in thrown in JSP1 it is indeed redirected to JSP2. in >> JSP2 I've put "System.out.println(exception.getMessage());" and sure >> enough the exception's message is printed. But what I get as a response >> to the browser is "HTTP 500". >> > > Have you make an entry like this in your Web deployment descriptor > (web.xml)? > > > >your.exception. > >/JSP2.jsp > > > > -- Franck > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Directory Structure and Can't Find Resources in Tomcat
On 5/19/06, Allen Williams <[EMAIL PROTECTED]> wrote: You can't directly address something under WEB-INF; your action should be something like `action="/login"` with a mapping in your web.xml like login UserConfig.login login /login Note: NO "/servlet" in there -- read the Tomcat doc or google for "Tomcat invoker servlet" to understand why... HTH, -- Hassan Schroeder [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: error page
all it does is put <%=exception.getMessage()%> I am a bit lost here. The way I set my error page is : errorPage="error.jsp" Should I use errorPage="/error.jsp" instead? Thanks for your reply, Zohar. > Date: Sat, 20 May 2006 14:05:20 -0400> From: [EMAIL PROTECTED]> To: > users@tomcat.apache.org> Subject: Re: error page> > It could be that the > error page itself is throwing an error. Try using> an ultra-simple error > page.> -- > Len> > On 5/18/06, Zohar <[EMAIL PROTECTED]> wrote:> > No, I've > used the "Letting a page define its error page" option.> >> > - Original > Message -> > From: "Franck Borel" <[EMAIL PROTECTED]>> > To: "Tomcat > Users List" > > Sent: Thursday, May 18, 2006 14:20> > > Subject: Re: error page> >> >> > > >> > >> I'm trying to use the error > handling mechanism described in> > >> > http://java.sun.com/developer/EJTechTips/2003/tt0114.html.> > >> When an > exception in thrown in JSP1 it is indeed redirected to JSP2. in> > >> JSP2 > I've put "System.out.println(exception.getMessage());" and sure> > >> enough > the exception's message is printed. But what I get as a response> > >> to the > browser is "HTTP 500".> > >>> > >> > > Have you make an entry like this in > your Web deployment descriptor> > > (web.xml)?> > >> > > > > > > > > > your.exception.> > >> > > > /JSP2.jsp> > > > > >> > >> > > -- Franck> > > >> > >> > >> >> >> > > > > >> >> > > > -> > > To > unsubscribe, e-mail: [EMAIL PROTECTED]> > > For additional commands, e-mail: > [EMAIL PROTECTED]> >> > > -> > To > unsubscribe, e-mail: [EMAIL PROTECTED]> > For additional commands, e-mail: > [EMAIL PROTECTED]> >> >> > > -> To > unsubscribe, e-mail: [EMAIL PROTECTED]> For additional commands, e-mail: > [EMAIL PROTECTED]> _ Join the next generation of Hotmail and you could win the adventure of a lifetime http://www.imagine-msn.com/minisites/sweepstakes/mail/register.aspx
RE: Re: error page
If anyone has an example I'd love seeing it... > Date: Sat, 20 May 2006 14:05:20 -0400> From: [EMAIL PROTECTED]> To: > users@tomcat.apache.org> Subject: Re: error page> > It could be that the > error page itself is throwing an error. Try using> an ultra-simple error > page.> -- > Len> > On 5/18/06, Zohar <[EMAIL PROTECTED]> wrote:> > No, I've > used the "Letting a page define its error page" option.> >> > - Original > Message -> > From: "Franck Borel" <[EMAIL PROTECTED]>> > To: "Tomcat > Users List" > > Sent: Thursday, May 18, 2006 14:20> > > Subject: Re: error page> >> >> > > >> > >> I'm trying to use the error > handling mechanism described in> > >> > http://java.sun.com/developer/EJTechTips/2003/tt0114.html.> > >> When an > exception in thrown in JSP1 it is indeed redirected to JSP2. in> > >> JSP2 > I've put "System.out.println(exception.getMessage());" and sure> > >> enough > the exception's message is printed. But what I get as a response> > >> to the > browser is "HTTP 500".> > >>> > >> > > Have you make an entry like this in > your Web deployment descriptor> > > (web.xml)?> > >> > > > > > > > > > your.exception.> > >> > > > /JSP2.jsp> > > > > >> > >> > > -- Franck> > > >> > >> > >> >> >> > > > > >> >> > > > -> > > To > unsubscribe, e-mail: [EMAIL PROTECTED]> > > For additional commands, e-mail: > [EMAIL PROTECTED]> >> > > -> > To > unsubscribe, e-mail: [EMAIL PROTECTED]> > For additional commands, e-mail: > [EMAIL PROTECTED]> >> >> > > -> To > unsubscribe, e-mail: [EMAIL PROTECTED]> For additional commands, e-mail: > [EMAIL PROTECTED]> _ Join the next generation of Hotmail and you could win the adventure of a lifetime http://www.imagine-msn.com/minisites/sweepstakes/mail/register.aspx
Re: error page
On 5/18/06, Zohar <[EMAIL PROTECTED]> wrote: When an exception in thrown in JSP1 it is indeed redirected to JSP2. in JSP2 I've put "System.out.println(exception.getMessage());" and sure enough the exception's message is printed. But what I get as a response to the browser is "HTTP 500". Sounds correct to me -- that's the error code. Are you saying that your JSP2 error page doesn't generate any visible output? Is it possible you're using MS IE and your page's output falls below the "show friendly (sic) messages" threshold? -- Hassan Schroeder [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: error page
JSP2 should display the exception's message. What is this "show friendly (sic) messages" threshold?" ? Thanks again, Zohar. > Date: Sat, 20 May 2006 11:25:44 -0700> From: [EMAIL PROTECTED]> To: > users@tomcat.apache.org> Subject: Re: error page> > On 5/18/06, Zohar <[EMAIL > PROTECTED]> wrote:> > > When an exception in thrown in JSP1 it is indeed > redirected to JSP2. in JSP2 I've put > "System.out.println(exception.getMessage());" and sure enough the exception's > message is printed. But what I get as a response to the browser is "HTTP > 500".> > Sounds correct to me -- that's the error code. Are you saying that> > your JSP2 error page doesn't generate any visible output?> > Is it possible > you're using MS IE and your page's output falls below> the "show friendly > (sic) messages" threshold?> > -- > Hassan Schroeder > [EMAIL PROTECTED]> > > -> To > unsubscribe, e-mail: [EMAIL PROTECTED]> For additional commands, e-mail: > [EMAIL PROTECTED]> _ Enter the Windows Live Mail beta sweepstakes http://www.imagine-msn.com/minisites/sweepstakes/mail/register.aspx
Re: Connecting Apache2.2 with Tomcat 5 using mod_proxy_ajp
Hi, I inserted the Location directives in proxy_ajp.conf and when try the url the following error appear in the error_log file: (13)Permission denied: proxy: AJP: attempt to connect to 127.0.0.1:8009 (localhost) failed. Any idea ? - Original Message - From: "Warren Pace" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Friday, May 19, 2006 5:52 AM Subject: Re: Connecting Apache2.2 with Tomcat 5 using mod_proxy_ajp > > > > PROXY_AJP_.CONF *** > > > > ProxyPass /contact/*.jsp ajp://localhost:8080/contact/ > > ProxyPassReverse /contact/*.jsp ajp://localhost:8080/contact/ > > Use port 8009 (the ajp connector uses 8009) instead of 8080 > Add a line in your HTTPD.conf to include your PROXY_AJP_CONF file as below: > Include /etc/apache2/extra/PROXY_AJP_CONF (whatever you've named your file). > Use the Location directive inside your proxy_ajp_conf file > > ProxyPass ajp://localhost:8009/contact/ > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: error page
On 5/20/06, Zohar Amir <[EMAIL PROTECTED]> wrote: JSP2 should display the exception's message. What is this "show friendly (sic) messages" threshold?" ? MS IE will show it's own "friendly" message instead of yours if the page size is less that some threshold value -- I forget exactly how big -- but you should test using some other browser (Firefox, Opera, whatever). -- Hassan Schroeder [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Class loading question
Hi, I'm having a little class loading difficulty, and after spending quite a few hours playing with it and searching for a solution online I figured I should go ahead and ask if anyone can point out a solution to me. Background: I'm developing on Tomcat 5.517 using JDK1.5. The operating system is Windows XP SP2. I'm writing a bit of code that bootstraps the JDT compiler that's included with Tomcat 5.5.17 and uses it to compile a source file that's generated at runtime. After a little tweaking, I finally got that to all work fine: when tomcat starts, it reads through a specified source folder, reads in each source file, compiles each source file, and if the compilation succeeds it reads a bunch of doclet tags from the source file and then generates wrapper source code which is THEN compiled and added to the class path (I could do byte code generation, but I kind of like source code: somewhat less opaque and since I already know it its easier than figuring out the byte code generators: the entire exercise took about 5 hours). In a sense, its sort of like JSPs except the source that gets compiled is not a blend of HTML and scriptlets, its straight Java, and I used doclet tags to dynamically generate the wrapper source. I'm doing all this using a custom class loader that wraps the webapp class loader: that way I can simply discard the class loader and use a completely different one when I reload the webapp. Structurally I have a set of source files that get compiled and placed in WEB-INF\lib, and a set of source files that get compiled at runtime. However, when I try and do a webapp stop/source compile/webapp start I start encountering difficulty. When I use the manager application to stop the webapp context, it stops (like it should). However even after I've stopped the webapp Tomcat still holds an open file handle to the generated library files (in WEB-INF\lib). After I run a stop and view all the open handles tomcat STILL has handles open to all the jar files in the WEB-INF\lib. When I then try and recompile ant complains that it can't delete the project's generated library file. I've enabled antiJARLocking and antiResourceLocking in the webapps Context element in server.xml, but still no love. When I then restart the application I get a "FileNotFoundException" when I try and read a file out of the generated jar file. I'd be grateful if anyone has any tips I can use to get around this. Thanks, Femi.
RE: Directory Structure and Can't Find Resources in Tomcat
So, I don't need 'action="servlet/login"', like the book I'm using said? Or, don't need 'action="classes/login"', like I might infer? Thanks, I'll do the google you recommend, try it, and be back with you in short order (or maybe tomorrow;-). Thanks again! -Original Message- From: Hassan Schroeder [mailto:[EMAIL PROTECTED] Sent: Saturday, May 20, 2006 2:19 PM To: Tomcat Users List Subject: Re: Directory Structure and Can't Find Resources in Tomcat On 5/19/06, Allen Williams <[EMAIL PROTECTED]> wrote: > action="WEB-INF/classes/UserConfig.login"> You can't directly address something under WEB-INF; your action should be something like `action="/login"` with a mapping in your web.xml like login UserConfig.login login /login Note: NO "/servlet" in there -- read the Tomcat doc or google for "Tomcat invoker servlet" to understand why... HTH, -- Hassan Schroeder [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Directory Structure and Can't Find Resources in Tomcat
Sorry, it didn't work. Once again, in my browser I have: HTTP Status 404 - /login Type: Status report Message: /login Description: The requested resource (/login) is not available. Apache Tomcat/5.0 * Here is the suggested line directly from my login.jsp: * Here is my entire web.xml file: http://java.sun.com/j2ee/dtds/web-app_2_3.dtd";> login UserConfig.login login /login All the rest (directory structure, etc.) is as in my first post. -Original Message- From: Hassan Schroeder [mailto:[EMAIL PROTECTED] Sent: Saturday, May 20, 2006 2:19 PM To: Tomcat Users List Subject: Re: Directory Structure and Can't Find Resources in Tomcat On 5/19/06, Allen Williams <[EMAIL PROTECTED]> wrote: > action="WEB-INF/classes/UserConfig.login"> You can't directly address something under WEB-INF; your action should be something like `action="/login"` with a mapping in your web.xml like login UserConfig.login login /login Note: NO "/servlet" in there -- read the Tomcat doc or google for "Tomcat invoker servlet" to understand why... HTH, -- Hassan Schroeder [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]