RE: PageContextImpl.handlePageException
A little much for a jsp page, I'd factor this into a class. However, change this to: try { Cart cart = (Cart) pageContext.getAttribute(cart, PageContext.SESSION_SCOPE); if (cart == null) { cart = new Cart(); pageContext.setAttribute(cart, cart, PageContext.SESSION_SCOPE); } String email = null; String password = null; Cookie cook; Customer customer = (Customer) pageContext.getAttribute(customer, PageContext.SESSION_SCOPE); if (customer == null) { Cookie[] cookies = request.getCookies(); BASE64Decoder dec = new BASE64Decoder(); if (cookies != null) { for (int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(bfgUsername)) { email = new String(dec.decodeBuffer(cookies[i].getValue())); } if (cookies[i].getName().equals(bfgPassword)) { password = new String(dec.decodeBuffer(cookies[i].getValue())); } } } if ((email != null) (password != null)) { Customer c = Customer.findCustomer(email); if ((c != null) (c.getPassword().equals(password))) { c.setCart(cart); c.fillCart(); pageContext.setAttribute(customer,c, PageContext.SESSION_SCOPE); } } else { Customer c = new Customer(); c.setCart(cart); pageContext.setAttribute(customer, c, PageContext.SESSION_SCOPE); } } } catch(Throwable t){ t.printStackTrace(out); } Now what do you get? --- jsp [EMAIL PROTECTED] wrote: This is the page causing the error. Im getting warmer. Thanks for all the help. I think I just need to read more %@ page import=com.bfg.customer.Customer % %@ page import=com.bfg.cart.Cart % %@ page import=javax.servlet.http.Cookie % %@ page import=sun.misc.BASE64Decoder % % { Cart cart = (Cart) pageContext.getAttribute(cart, PageContext.SESSION_SCOPE); if (cart == null) { cart = new Cart(); pageContext.setAttribute(cart, cart, PageContext.SESSION_SCOPE); } String email = null; String password = null; Cookie cook; Customer customer = (Customer) pageContext.getAttribute(customer, PageContext.SESSION_SCOPE); if (customer == null) { Cookie[] cookies = request.getCookies(); BASE64Decoder dec = new BASE64Decoder(); if (cookies != null) { for (int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(bfgUsername)) { email = new String(dec.decodeBuffer(cookies[i].getValue())); } if (cookies[i].getName().equals(bfgPassword)) { password = new String(dec.decodeBuffer(cookies[i].getValue())); } } } if ((email != null) (password != null)) { Customer c = Customer.findCustomer(email); if ((c != null) (c.getPassword().equals(password))) { c.setCart(cart); c.fillCart(); pageContext.setAttribute(customer,c, PageContext.SESSION_SCOPE); } } else { Customer c = new Customer(); c.setCart(cart); pageContext.setAttribute(customer, c, PageContext.SESSION_SCOPE); } } } % -Original Message- From: Sean Dockery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 2:59 PM To: Tomcat Users List Subject: RE: PageContextImpl.handlePageException That may not be *the* cause. It may just be a symptom of the cause. You should follow your root cause stack until you are satisfied that you discovered the real cause. At 15:47 2003-02-04, you wrote: Hi thanks for the reply, this is the cause. if (pageContext != null) pageContext.handlePageException(t); Im just trying to find out whats causing this thought maybe someone Would have an idea besides my own incompetence. Thanks -Original Message- From: Sean Dockery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 2:34 PM To: Tomcat Users List Subject: Re: PageContextImpl.handlePageException Look at line 251 in $TOMCAT_HOME/_work/appname/org/apache/jsp/index_jsp.java to see what caused the exception. At 14:22 2003-02-04, you wrote: root cause javax.servlet.ServletException at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageConte x tImpl.java:533) at org.apache.jsp.index_jsp._jspService(index_jsp.java:251) Sean Dockery [EMAIL PROTECTED] Certified Java Web Component Developer Certified Delphi Programmer SBD Consultants http://www.sbdconsultants.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PageContextImpl.handlePageException
A little much for a jsp page, I'd factor this into a class. However, change this to: try { Cart cart = (Cart) pageContext.getAttribute(cart, PageContext.SESSION_SCOPE); if (cart == null) { cart = new Cart(); pageContext.setAttribute(cart, cart, PageContext.SESSION_SCOPE); } String email = null; String password = null; Cookie cook; Customer customer = (Customer) pageContext.getAttribute(customer, PageContext.SESSION_SCOPE); if (customer == null) { Cookie[] cookies = request.getCookies(); BASE64Decoder dec = new BASE64Decoder(); if (cookies != null) { for (int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(bfgUsername)) { email = new String(dec.decodeBuffer(cookies[i].getValue())); } if (cookies[i].getName().equals(bfgPassword)) { password = new String(dec.decodeBuffer(cookies[i].getValue())); } } } if ((email != null) (password != null)) { Customer c = Customer.findCustomer(email); if ((c != null) (c.getPassword().equals(password))) { c.setCart(cart); c.fillCart(); pageContext.setAttribute(customer,c, PageContext.SESSION_SCOPE); } } else { Customer c = new Customer(); c.setCart(cart); pageContext.setAttribute(customer, c, PageContext.SESSION_SCOPE); } } } catch(Throwable t){ t.printStackTrace(out); } Now what do you get? --- jsp [EMAIL PROTECTED] wrote: This is the page causing the error. Im getting warmer. Thanks for all the help. I think I just need to read more %@ page import=com.bfg.customer.Customer % %@ page import=com.bfg.cart.Cart % %@ page import=javax.servlet.http.Cookie % %@ page import=sun.misc.BASE64Decoder % % { Cart cart = (Cart) pageContext.getAttribute(cart, PageContext.SESSION_SCOPE); if (cart == null) { cart = new Cart(); pageContext.setAttribute(cart, cart, PageContext.SESSION_SCOPE); } String email = null; String password = null; Cookie cook; Customer customer = (Customer) pageContext.getAttribute(customer, PageContext.SESSION_SCOPE); if (customer == null) { Cookie[] cookies = request.getCookies(); BASE64Decoder dec = new BASE64Decoder(); if (cookies != null) { for (int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(bfgUsername)) { email = new String(dec.decodeBuffer(cookies[i].getValue())); } if (cookies[i].getName().equals(bfgPassword)) { password = new String(dec.decodeBuffer(cookies[i].getValue())); } } } if ((email != null) (password != null)) { Customer c = Customer.findCustomer(email); if ((c != null) (c.getPassword().equals(password))) { c.setCart(cart); c.fillCart(); pageContext.setAttribute(customer,c, PageContext.SESSION_SCOPE); } } else { Customer c = new Customer(); c.setCart(cart); pageContext.setAttribute(customer, c, PageContext.SESSION_SCOPE); } } } % -Original Message- From: Sean Dockery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 2:59 PM To: Tomcat Users List Subject: RE: PageContextImpl.handlePageException That may not be *the* cause. It may just be a symptom of the cause. You should follow your root cause stack until you are satisfied that you discovered the real cause. At 15:47 2003-02-04, you wrote: Hi thanks for the reply, this is the cause. if (pageContext != null) pageContext.handlePageException(t); Im just trying to find out whats causing this thought maybe someone Would have an idea besides my own incompetence. Thanks -Original Message- From: Sean Dockery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 2:34 PM To: Tomcat Users List Subject: Re: PageContextImpl.handlePageException Look at line 251 in $TOMCAT_HOME/_work/appname/org/apache/jsp/index_jsp.java to see what caused the exception. At 14:22 2003-02-04, you wrote: root cause javax.servlet.ServletException at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageConte x tImpl.java:533) at org.apache.jsp.index_jsp._jspService(index_jsp.java:251) Sean Dockery [EMAIL PROTECTED] Certified Java Web Component Developer Certified Delphi Programmer SBD Consultants http://www.sbdconsultants.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PageContextImpl.handlePageException
A little much for a jsp page, I'd factor this into a class. However, change this to: try { Cart cart = (Cart) pageContext.getAttribute(cart, PageContext.SESSION_SCOPE); if (cart == null) { cart = new Cart(); pageContext.setAttribute(cart, cart, PageContext.SESSION_SCOPE); } String email = null; String password = null; Cookie cook; Customer customer = (Customer) pageContext.getAttribute(customer, PageContext.SESSION_SCOPE); if (customer == null) { Cookie[] cookies = request.getCookies(); BASE64Decoder dec = new BASE64Decoder(); if (cookies != null) { for (int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(bfgUsername)) { email = new String(dec.decodeBuffer(cookies[i].getValue())); } if (cookies[i].getName().equals(bfgPassword)) { password = new String(dec.decodeBuffer(cookies[i].getValue())); } } } if ((email != null) (password != null)) { Customer c = Customer.findCustomer(email); if ((c != null) (c.getPassword().equals(password))) { c.setCart(cart); c.fillCart(); pageContext.setAttribute(customer,c, PageContext.SESSION_SCOPE); } } else { Customer c = new Customer(); c.setCart(cart); pageContext.setAttribute(customer, c, PageContext.SESSION_SCOPE); } } } catch(Throwable t){ t.printStackTrace(out); } Now what do you get? --- jsp [EMAIL PROTECTED] wrote: This is the page causing the error. Im getting warmer. Thanks for all the help. I think I just need to read more %@ page import=com.bfg.customer.Customer % %@ page import=com.bfg.cart.Cart % %@ page import=javax.servlet.http.Cookie % %@ page import=sun.misc.BASE64Decoder % % { Cart cart = (Cart) pageContext.getAttribute(cart, PageContext.SESSION_SCOPE); if (cart == null) { cart = new Cart(); pageContext.setAttribute(cart, cart, PageContext.SESSION_SCOPE); } String email = null; String password = null; Cookie cook; Customer customer = (Customer) pageContext.getAttribute(customer, PageContext.SESSION_SCOPE); if (customer == null) { Cookie[] cookies = request.getCookies(); BASE64Decoder dec = new BASE64Decoder(); if (cookies != null) { for (int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(bfgUsername)) { email = new String(dec.decodeBuffer(cookies[i].getValue())); } if (cookies[i].getName().equals(bfgPassword)) { password = new String(dec.decodeBuffer(cookies[i].getValue())); } } } if ((email != null) (password != null)) { Customer c = Customer.findCustomer(email); if ((c != null) (c.getPassword().equals(password))) { c.setCart(cart); c.fillCart(); pageContext.setAttribute(customer,c, PageContext.SESSION_SCOPE); } } else { Customer c = new Customer(); c.setCart(cart); pageContext.setAttribute(customer, c, PageContext.SESSION_SCOPE); } } } % -Original Message- From: Sean Dockery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 2:59 PM To: Tomcat Users List Subject: RE: PageContextImpl.handlePageException That may not be *the* cause. It may just be a symptom of the cause. You should follow your root cause stack until you are satisfied that you discovered the real cause. At 15:47 2003-02-04, you wrote: Hi thanks for the reply, this is the cause. if (pageContext != null) pageContext.handlePageException(t); Im just trying to find out whats causing this thought maybe someone Would have an idea besides my own incompetence. Thanks -Original Message- From: Sean Dockery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 2:34 PM To: Tomcat Users List Subject: Re: PageContextImpl.handlePageException Look at line 251 in $TOMCAT_HOME/_work/appname/org/apache/jsp/index_jsp.java to see what caused the exception. At 14:22 2003-02-04, you wrote: root cause javax.servlet.ServletException at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageConte x tImpl.java:533) at org.apache.jsp.index_jsp._jspService(index_jsp.java:251) Sean Dockery [EMAIL PROTECTED] Certified Java Web Component Developer Certified Delphi Programmer SBD Consultants http://www.sbdconsultants.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PageContextImpl.handlePageException
A little much for a jsp page, I'd factor this into a class. However, change this to: %@ page import=com.bfg.customer.Customer % %@ page import=com.bfg.cart.Cart % %@ page import=javax.servlet.http.Cookie % %@ page import=sun.misc.BASE64Decoder % % try { Cart cart = (Cart) pageContext.getAttribute(cart, PageContext.SESSION_SCOPE); if (cart == null) { cart = new Cart(); pageContext.setAttribute(cart, cart, PageContext.SESSION_SCOPE); } String email = null; String password = null; Cookie cook; Customer customer = (Customer) pageContext.getAttribute(customer, PageContext.SESSION_SCOPE); if (customer == null) { Cookie[] cookies = request.getCookies(); BASE64Decoder dec = new BASE64Decoder(); if (cookies != null) { for (int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(bfgUsername)) { email = new String(dec.decodeBuffer(cookies[i].getValue())); } if (cookies[i].getName().equals(bfgPassword)) { password = new String(dec.decodeBuffer(cookies[i].getValue())); } } } if ((email != null) (password != null)) { Customer c = Customer.findCustomer(email); if ((c != null) (c.getPassword().equals(password))) { c.setCart(cart); c.fillCart(); pageContext.setAttribute(customer,c, PageContext.SESSION_SCOPE); } } else { Customer c = new Customer(); c.setCart(cart); pageContext.setAttribute(customer, c, PageContext.SESSION_SCOPE); } } } catch(Throwable t){ t.printStackTrace(out); } % Now what do you get? __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PageContextImpl.handlePageException
Sorry all for the multiple posts, Yahoo kept giving me an erro and I didn't think they sent. --- Carl Trusiak [EMAIL PROTECTED] wrote: A little much for a jsp page, I'd factor this into a class. However, change this to: try { Cart cart = (Cart) pageContext.getAttribute(cart, PageContext.SESSION_SCOPE); if (cart == null) { cart = new Cart(); pageContext.setAttribute(cart, cart, PageContext.SESSION_SCOPE); } String email = null; String password = null; Cookie cook; Customer customer = (Customer) pageContext.getAttribute(customer, PageContext.SESSION_SCOPE); if (customer == null) { Cookie[] cookies = request.getCookies(); BASE64Decoder dec = new BASE64Decoder(); if (cookies != null) { for (int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(bfgUsername)) { email = new String(dec.decodeBuffer(cookies[i].getValue())); } if (cookies[i].getName().equals(bfgPassword)) { password = new String(dec.decodeBuffer(cookies[i].getValue())); } } } if ((email != null) (password != null)) { Customer c = Customer.findCustomer(email); if ((c != null) (c.getPassword().equals(password))) { c.setCart(cart); c.fillCart(); pageContext.setAttribute(customer,c, PageContext.SESSION_SCOPE); } } else { Customer c = new Customer(); c.setCart(cart); pageContext.setAttribute(customer, c, PageContext.SESSION_SCOPE); } } } catch(Throwable t){ t.printStackTrace(out); } Now what do you get? --- jsp [EMAIL PROTECTED] wrote: This is the page causing the error. Im getting warmer. Thanks for all the help. I think I just need to read more %@ page import=com.bfg.customer.Customer % %@ page import=com.bfg.cart.Cart % %@ page import=javax.servlet.http.Cookie % %@ page import=sun.misc.BASE64Decoder % % { Cart cart = (Cart) pageContext.getAttribute(cart, PageContext.SESSION_SCOPE); if (cart == null) { cart = new Cart(); pageContext.setAttribute(cart, cart, PageContext.SESSION_SCOPE); } String email = null; String password = null; Cookie cook; Customer customer = (Customer) pageContext.getAttribute(customer, PageContext.SESSION_SCOPE); if (customer == null) { Cookie[] cookies = request.getCookies(); BASE64Decoder dec = new BASE64Decoder(); if (cookies != null) { for (int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(bfgUsername)) { email = new String(dec.decodeBuffer(cookies[i].getValue())); } if (cookies[i].getName().equals(bfgPassword)) { password = new String(dec.decodeBuffer(cookies[i].getValue())); } } } if ((email != null) (password != null)) { Customer c = Customer.findCustomer(email); if ((c != null) (c.getPassword().equals(password))) { c.setCart(cart); c.fillCart(); pageContext.setAttribute(customer,c, PageContext.SESSION_SCOPE); } } else { Customer c = new Customer(); c.setCart(cart); pageContext.setAttribute(customer, c, PageContext.SESSION_SCOPE); } } } % -Original Message- From: Sean Dockery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 2:59 PM To: Tomcat Users List Subject: RE: PageContextImpl.handlePageException That may not be *the* cause. It may just be a symptom of the cause. You should follow your root cause stack until you are satisfied that you discovered the real cause. At 15:47 2003-02-04, you wrote: Hi thanks for the reply, this is the cause. if (pageContext != null) pageContext.handlePageException(t); Im just trying to find out whats causing this thought maybe someone Would have an idea besides my own incompetence. Thanks -Original Message- From: Sean Dockery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 2:34 PM To: Tomcat Users List Subject: Re: PageContextImpl.handlePageException Look at line 251 in $TOMCAT_HOME/_work/appname/org/apache/jsp/index_jsp.java to see what caused the exception. At 14:22 2003-02-04, you wrote: root cause javax.servlet.ServletException at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageConte x tImpl.java:533) at org.apache.jsp.index_jsp._jspService(index_jsp.java:251) Sean Dockery [EMAIL PROTECTED] Certified Java Web Component Developer Certified Delphi Programmer SBD Consultants http
RE: Tomcat 3.3.1 HttpSessionBindingListener not found
HttpSessionBindingListener was introduced with Servlet 2.3. Tomcat 3.3 is based on Servlet 2.2. The servlet.jar you added into your classpath must be for 2.3. I don't think you can be sure of any behavior with this configuration. If you want to use HttpSessionBindingListener you should upgrade to Tomcat 4.x --- Filip Hanik [EMAIL PROTECTED] wrote: also, when you load the stuff, also try Thread.currentThread().getContextClassloader().loadClass() which might work better than Class.forName() Filip -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 3:01 PM To: Tomcat Users List Subject: RE: Tomcat 3.3.1 HttpSessionBindingListener not found This confirms that the problem class is on your CLASSPATH. However, putting servlet.jar on the CLASSPATH is not a good solution. Now servlet.jar can't see any classes in the TOMCAT_HOME/lib/common classloader that it could previously. You've traded one symptom for different symptoms which may be more difficult to diagnose. The correct solution is to find the class on the CLASSPATH that depends on servlet.jar and move it off of the CLASSPATH to TOMCAT_HOME/lib/common, TOMCAT_HOME/lib/apps, or the webapp's WEB-INF/lib (assuming the class is in a jar). Which directory is best depends on the nature of the class. I would recommend trying WEB-INF/lib first. This should be doable since the webapp is working on other servers. Unfortunately, I know of no simple way to find the offending class, other than trial and error. Larry -Original Message- From: Daniel Lemberg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 4:41 PM To: 'Tomcat Users List' Subject: RE: Tomcat 3.3.1 HttpSessionBindingListener not found Yep, adding servlet.jar to the classpath did the trick! Thanks! -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 3:14 PM To: Tomcat Users List Subject: RE: Tomcat 3.3.1 HttpSessionBindingListener not found This means that the class that Class.ForName() is trying to load has a dependency chain that includes a class that has a dependency on HttpSessionBindingListener, i.e. servlet.jar. That class with the servlet.jar dependency is being found in a classloader that is below (i.e. a parent,) of the TOMCAT_HOME/lib/common classloader that contains servlet.jar. Thus it can't see servlet.jar classes. This class is likely to be in the CLASSPATH or extension directory. If you haven't messed with the CLASSPATH, then check the extensions directory. It is probably likely that this class is a duplicate of one that is located in the proper location. The systems that work don't have this duplicate in the wrong location. HTH. Cheers, Larry -Original Message- From: Daniel Lemberg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 2:45 PM To: '[EMAIL PROTECTED]' Subject: Tomcat 3.3.1 HttpSessionBindingListener not found Hey, I'm running into an odd problem on Tomcat 3.3.1 on Sun, and am hoping somone could help shed some light on the problem. I have a few classes in a JAR file that implement HttpSessionBindingListener. In my test environment on my PC (Tomcat 3.3.1a for Windows), the classes work fine. But on one of our customer's server (which might be configured wrong), the classes throw: java.lang.NoClassDefFoundError: javax/servlet/http/HttpSessionBindingListener whenever anything tries to load them (which we do via Class.ForName()). Note that we have some 40 other customers that don't have this problem, but none of them that I know of are using Tomcat. Does anyone have any idea how this could happen? How could Tomcat not know what a HttpSessionBindingListener is? I'm about stumped. - 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] __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PageContextImpl.handlePageException
Did you add the try to the top? I threw that in quick, ensure your brackets matchup properly and try again. --- jsp [EMAIL PROTECTED] wrote: With your code I get a syntax error it looks like... org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 6 in the jsp file: /jsp/cust/AutoLogin2.jsp Generated servlet error: [javac] Compiling 1 source file E:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\bfg\jsp\cust\AutoLogin2_jsp.java:95: 'catch' without 'try' catch(Throwable t){ ^ 1 error hm. The pain -Original Message- From: Carl Trusiak [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 3:23 PM To: Tomcat Users List Subject: RE: PageContextImpl.handlePageException A little much for a jsp page, I'd factor this into a class. However, change this to: try { Cart cart = (Cart) pageContext.getAttribute(cart, PageContext.SESSION_SCOPE); if (cart == null) { cart = new Cart(); pageContext.setAttribute(cart, cart, PageContext.SESSION_SCOPE); } String email = null; String password = null; Cookie cook; Customer customer = (Customer) pageContext.getAttribute(customer, PageContext.SESSION_SCOPE); if (customer == null) { Cookie[] cookies = request.getCookies(); BASE64Decoder dec = new BASE64Decoder(); if (cookies != null) { for (int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(bfgUsername)) { email = new String(dec.decodeBuffer(cookies[i].getValue())); } if (cookies[i].getName().equals(bfgPassword)) { password = new String(dec.decodeBuffer(cookies[i].getValue())); } } } if ((email != null) (password != null)) { Customer c = Customer.findCustomer(email); if ((c != null) (c.getPassword().equals(password))) { c.setCart(cart); c.fillCart(); pageContext.setAttribute(customer,c, PageContext.SESSION_SCOPE); } } else { Customer c = new Customer(); c.setCart(cart); pageContext.setAttribute(customer, c, PageContext.SESSION_SCOPE); } } } catch(Throwable t){ t.printStackTrace(out); } Now what do you get? --- jsp [EMAIL PROTECTED] wrote: This is the page causing the error. Im getting warmer. Thanks for all the help. I think I just need to read more %@ page import=com.bfg.customer.Customer % %@ page import=com.bfg.cart.Cart % %@ page import=javax.servlet.http.Cookie % %@ page import=sun.misc.BASE64Decoder % % { Cart cart = (Cart) pageContext.getAttribute(cart, PageContext.SESSION_SCOPE); if (cart == null) { cart = new Cart(); pageContext.setAttribute(cart, cart, PageContext.SESSION_SCOPE); } String email = null; String password = null; Cookie cook; Customer customer = (Customer) pageContext.getAttribute(customer, PageContext.SESSION_SCOPE); if (customer == null) { Cookie[] cookies = request.getCookies(); BASE64Decoder dec = new BASE64Decoder(); if (cookies != null) { for (int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(bfgUsername)) { email = new String(dec.decodeBuffer(cookies[i].getValue())); } if (cookies[i].getName().equals(bfgPassword)) { password = new String(dec.decodeBuffer(cookies[i].getValue())); } } } if ((email != null) (password != null)) { Customer c = Customer.findCustomer(email); if ((c != null) (c.getPassword().equals(password))) { c.setCart(cart); c.fillCart(); pageContext.setAttribute(customer,c, PageContext.SESSION_SCOPE); } } else { Customer c = new Customer(); c.setCart(cart); pageContext.setAttribute(customer, c, PageContext.SESSION_SCOPE); } } } % -Original Message- From: Sean Dockery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 2:59 PM To: Tomcat Users List Subject: RE: PageContextImpl.handlePageException That may not be *the* cause. It may just be a symptom of the cause. You should follow your root cause stack until you are satisfied that you discovered the real cause. At 15:47 2003-02-04, you wrote: Hi thanks for the reply, this is the cause. if (pageContext != null) pageContext.handlePageException(t); Im just trying to find out whats causing this thought maybe someone Would have an idea besides my own incompetence. Thanks -Original Message- From: Sean Dockery [mailto:[EMAIL PROTECTED]] Sent: Tuesday
RE: Why won't anyone help me out??
Good, now on to your original question. When you reference the JSP bean, add the fully qualified class name to it(package and class name ex: java.lang.String). Since you didn't specify the package, JSP trys to add the package of your page to the front of the class anme and load it. --- Steve Burrus [EMAIL PROTECTED] wrote: Ken, this is the constant whiner, and I sincerely apologize to you and others for my less-than-desirable manner in which I seem to have posted my pleas for help both now and in the past!!! I will certainly admit that I have a lot to learn about manners, as others do also (I won't name names!). I will try to be more charming and gracious in my dealings with our newsgroup in the future, I promise you! __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 3.3.1 HttpSessionBindingListener not found
I stand corrected Thanks:) --- Larry Isaacs [EMAIL PROTECTED] wrote: To set the record straight, the servlet 2.3 spec did add some new listeners. However, HttpSessionBindingListener wasn't one of them. It was already present in servlet 2.2. You will find it in Tomcat 3.x's servlet.jar. Cheers, Larry -Original Message- From: Carl Trusiak [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 6:35 PM To: Tomcat Users List Subject: RE: Tomcat 3.3.1 HttpSessionBindingListener not found HttpSessionBindingListener was introduced with Servlet 2.3. Tomcat 3.3 is based on Servlet 2.2. The servlet.jar you added into your classpath must be for 2.3. I don't think you can be sure of any behavior with this configuration. If you want to use HttpSessionBindingListener you should upgrade to Tomcat 4.x --- Filip Hanik [EMAIL PROTECTED] wrote: also, when you load the stuff, also try Thread.currentThread().getContextClassloader().loadClass() which might work better than Class.forName() Filip -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 3:01 PM To: Tomcat Users List Subject: RE: Tomcat 3.3.1 HttpSessionBindingListener not found This confirms that the problem class is on your CLASSPATH. However, putting servlet.jar on the CLASSPATH is not a good solution. Now servlet.jar can't see any classes in the TOMCAT_HOME/lib/common classloader that it could previously. You've traded one symptom for different symptoms which may be more difficult to diagnose. The correct solution is to find the class on the CLASSPATH that depends on servlet.jar and move it off of the CLASSPATH to TOMCAT_HOME/lib/common, TOMCAT_HOME/lib/apps, or the webapp's WEB-INF/lib (assuming the class is in a jar). Which directory is best depends on the nature of the class. I would recommend trying WEB-INF/lib first. This should be doable since the webapp is working on other servers. Unfortunately, I know of no simple way to find the offending class, other than trial and error. Larry -Original Message- From: Daniel Lemberg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 4:41 PM To: 'Tomcat Users List' Subject: RE: Tomcat 3.3.1 HttpSessionBindingListener not found Yep, adding servlet.jar to the classpath did the trick! Thanks! -Original Message- From: Larry Isaacs [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 3:14 PM To: Tomcat Users List Subject: RE: Tomcat 3.3.1 HttpSessionBindingListener not found This means that the class that Class.ForName() is trying to load has a dependency chain that includes a class that has a dependency on HttpSessionBindingListener, i.e. servlet.jar. That class with the servlet.jar dependency is being found in a classloader that is below (i.e. a parent,) of the TOMCAT_HOME/lib/common classloader that contains servlet.jar. Thus it can't see servlet.jar classes. This class is likely to be in the CLASSPATH or extension directory. If you haven't messed with the CLASSPATH, then check the extensions directory. It is probably likely that this class is a duplicate of one that is located in the proper location. The systems that work don't have this duplicate in the wrong location. HTH. Cheers, Larry -Original Message- From: Daniel Lemberg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 2:45 PM To: '[EMAIL PROTECTED]' Subject: Tomcat 3.3.1 HttpSessionBindingListener not found Hey, I'm running into an odd problem on Tomcat 3.3.1 on Sun, and am hoping somone could help shed some light on the problem. I have a few classes in a JAR file that implement HttpSessionBindingListener. In my test environment on my PC (Tomcat 3.3.1a for Windows), the classes work fine. But on one of our customer's server (which might be configured wrong), the classes throw: java.lang.NoClassDefFoundError: javax/servlet/http/HttpSessionBindingListener whenever anything tries to load them (which we do via Class.ForName()). Note that we have some 40 other customers that don't have this problem, but none of them that I know of are using Tomcat. Does anyone have any idea how this could happen? How could Tomcat not know what a HttpSessionBindingListener is? I'm about === message truncated === __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable
Re: Simultaneous request from same IP
I have seen this. The only time was caused by html and javascript. We had input type=submit onclick=javascript:doSomething(); Then in the doSomething() method, we did a form.submit(); The click of the submit input caused a submit of the form, followed by a submit by the javascript. We corrected this by changing the input type to button. May not help in your case but, felt I should relate my experience. --- Mike W-M [EMAIL PROTECTED] wrote: Chris, I've played around with a servlet almost identical to your original (not full!) test-case (below). (Did you actually get the problem to appear on this one or is it just a theoretical cut-down of the larger example you posted later?) I've made - not exactly concurrent, but definitely sub-second-apart - requests from two instances of Internet Explorer. (Nifty finger/mouse coordination.) I cannot reproduce your confused results. [I've even added a thread.sleep(1) into the servlet to ensure that the requests are running (or at least in existence) concurrently. ] I still can't think of anything you're doing in the servlet that would produce the results you describe. I (still) think that the problem is most likely with your simultaneous requests themselves. How are you making these requests - via code? Can you reproduce the problem with nifty-I.E. fingerwork? Mike. - Original Message - From: Chris Bick [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, December 16, 2002 3:13 PM Subject: RE: Simultaneous request from same IP Thanks for responding. I don't think it is an instance variable problem. Here is the code to reproduce the problem: public class AServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse reponse) throws ServletException, IOException { printWriter pw = reponse.getWriter(); reponse.setContentType(text/html); synchronized(System.out) { System.out.println(Query String: + request.getQueryString()); System.our.println(Header : +request.getHeader(Test-Header); } out.println(Done); } Two different request hit this servlet about 1 sec apart everything is fine. It's only when they enter the servlet at the same time. I will submit a bug report if know one sees a problem with the above code. -cb -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 15, 2002 10:22 PM To: Tomcat Users List Subject: Re: Simultaneous request from same IP On Sun, 15 Dec 2002, Chris Bick wrote: Date: Sun, 15 Dec 2002 22:05:45 -0500 From: Chris Bick [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Simultaneous request from same IP Hello, Has anyone seen two requests from the same IP hitting a servlet at approximately the time result in the same query string and headers? I can reproduce this every time. Make two requests from one machine that hits my servlet at approximately the same time. Both HttpServletRequest objects contain query string and header information of the first request in. If the IPs are different everything works properly. This seems *much* more likely to be a thread-safety problem in your user code than a bug in Tomcat. For example, using instance variables in your servlet to store per-request state information is pretty much guaranteed to have difficulties. The only way to know for sure would be for you to post a bug report (http://nagoya.apache.org/bugzilla/) with a reproducible test case, so that Tomcat developers can see what you are seeing. Thanks, -cb Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Precomplie Jsps
If you are using Ant, there is an Optional task which ships with it. I use it on my project and it works great. I have Tomcat 4.1.12 and Ant 1.5.1 The Relavent portions are: taskdef name=jspc classname=org.apache.tools.ant.taskdefs.optional.jsp.JspC/ !-- create reusable classpath -- path id=1 pathelement location=${project.home}/webapp/WEB-INF/classes / pathelement location=${project.home}/pittjugtest / fileset dir=${project.home}/lib include name=**/*.jar / /fileset fileset dir=${tomcat.home}/common/lib include name=*.jar / /fileset /path !-- Jspc -- target name=buildJSP depends=cleanJSPBuildDir, createJSPBuildDir jspc srcdir=${project.home} destdir=${project.home}/gensrc verbose=9 classpath refid=1/ include name=**/*.jsp / /jspc /target !-- cleanJSPBuildDirectory -- target name=cleanJSPBuildDir delete includeEmptyDirs=true quiet=false failonerror=false fileset dir=${project.home}/gensrc / /delete /target !-- createJSPBuildDir -- target name=createJSPBuildDir mkdir dir=${project.home}/gensrc/ /target You can also exclude files that are fragments that will not complile properly on thier own. I haven't tried to use the compiled classes with Tomcat but, I think if you set your TragetDirectory to ${TOMCAT_HOME}/${WORK_DIRECTORY}/${WEBAPP_NAME} it should use these. Work directory is how your tomcat names the work directory. On my machine, I'm running as standalone and localhost so it is standalone/localhost Check to see what it is on yours. See the JspC task under optional tasks http://jakarta.apache.org/ant/manual/index.html Carl --- Billy Ng [EMAIL PROTECTED] wrote: Hi folks, Would any body please tell me how to pre-compile jsp files. Any websites with step by step instruction will help too. Thanks in advance! Billy Ng __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Where to put JSP files?
To prevent users from seeing any directory add the entry welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list To your web.xml and in every directory, place a copy of index.jsp. It can just be a redirect to your home page. --- Peter Lee [EMAIL PROTECTED] wrote: Where should I put my jsp files? I usually put them above the /web-inf folder, but this would allow clients to see the directory listing. Should I use a redirect mapping to protect them from being viewed? In which file should I do it? Thanks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Hi all .. licence issue ..
The license states : 1. LICENSE TO USE. Sun grants you a non-exclusive and non-transferable license for the internal use only of the accompanying software... This seems to me to be all the permission you need to use the SDK within your company. In addition, there is language that allows you to Distribute within your company or with your product binarys as long as : (i) you distribute the Redistributables complete and unmodified... So, read it real close once again. --- Eriam Schaffter [EMAIL PROTECTED] wrote: I did read the licence but .. can I use sdk or jre in a commercial environnment (not just research developpment but production environment .. ) ? Simple question .. and it was not clear to me in the licence .. Eriam Bill Barker a écrit: Craig R. McClanahan [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Wed, 27 Nov 2002, Eriam Schaffter wrote: Date: Wed, 27 Nov 2002 02:08:47 + From: Eriam Schaffter [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Hi all .. licence issue .. I just did right now .. One question remains wich is a bit off-topic but maybe people hav experience with it .. Does tomcat includes code from sun (code not covered by Apache licence) and if yes what parts ? Tomcat binary distributions (other than the LE version for 1.4-based JVMs) include the following Sun packages that are redistributable according to the Sun binary license: * activation.jar (JavaBeans Activation Framework APIs) * jdbc2_0-stdext.jar (JDBC 2.0 Optional Package APIs) * jndi.jar (Java Naming and Directory Interface APIs) * jta.jar (Java Transaction Architecture APIs) * mail.jar (JavaMail APIs) * jaas.jar (Java Authencation and Authorization Service APIs) The LE version of Tomcat doesn't include these, because they have all been built in to a JDK 1.4 JVM. Nearly all the other code is from Apache, under the Apache Software License. Exceptions include: * mx4j-jmx.jar (Open source implementation of JMX - license included) Actually can I use the java sdk from sun in a business environment for free ? As with all software, you need to obey the terms of the license. In the case of a Sun JDK, the terms and conditions are in the license you had to click through to download it. You DID read that, didn't you? ;-) Does tomcat run with kaffe or another GPL JVM .. ? I don't know of anyone who has tested Tomcat under such JVMs -- it's possible but IMHO not real likely to run reliably. There is at least one of the developers who tests against kaffe and gcj. Unfortunately for you, he doesn't spend a lot of his time on the 4.x version. According to his reports, at least at one point, Tomcat 4 ran fine with kaffe and gcj (and commented that gcj didn't really beat HotSpot :). The only way to know for sure is to test your application against it. Eriam Craig Subir Sengupta a écrit: Have you looked here http://www.apache.org/foundation/licence-FAQ.html -Original Message- From: Eriam Schaffter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 26, 2002 5:54 PM To: [EMAIL PROTECTED] Subject: Hi all .. licence issue .. I would like to hack a little with tomcat .. I think it would be no problem but my question is if then I want to redistribute a product with tomcat stuff in it what are the requierements ? Does tomcat includes any sun proprietary code ? Is it GPL ? Can I just take tomcat sources, recompile it with added features and distribute back both to tomcat community and to public under my own or my company's brand ? If think it must just be as easier as it (stating in my softs that I use some code from apache fundation ..) as I believe the tomcat licence allows that kind of deals .. Am I right ? Thanks for any tips .. Eriam Schaffter -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] === message truncated === __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]