Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 56074 invoked from network); 7 May 2008 18:45:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 May 2008 18:45:12 -0000 Received: (qmail 4676 invoked by uid 500); 7 May 2008 18:45:04 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 4392 invoked by uid 500); 7 May 2008 18:45:03 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 4381 invoked by uid 99); 7 May 2008 18:45:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 May 2008 11:45:03 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of techhelp07@gmail.com designates 64.233.170.189 as permitted sender) Received: from [64.233.170.189] (HELO rn-out-0910.google.com) (64.233.170.189) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 May 2008 18:44:17 +0000 Received: by rn-out-0910.google.com with SMTP id a46so146611rne.9 for ; Wed, 07 May 2008 11:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=FFR8QDHEdEunJ7lWNJEnqi+BvK/Qgpd1SHfk8xlr0UI=; b=kYEn35Puac2arhwXmBH0l5Ewt3zkfkEPOfNmwUG4LjvEiPQDn/3OKzOw4+iIbtST9uVq5/PR4D6UuN9/F2CO0UH1fajQixcpjPsXE5XVNaEgOoN4fsZeOlV7ttsRQUoHrInf56gSDgXSd/CRndvSmyPd52xPVEvnAcyYu4oP5ps= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=PQZgSUPQaV5uyTB0+E4lVoacBA/z3yS7QLkWo1bWIYJRYAOTZhHJyYaPqVwPqAEHBTsi0Tlj7ySHz3WYPI0Q0Yra0TzYN3PkxrS9xIpepp2uENGlnXObVmP3XyNBsFZECBava+VdiuMRMPGeny1zE//ZLgQ+WEOOtwsS+88HFxQ= Received: by 10.142.223.20 with SMTP id v20mr950258wfg.264.1210185871253; Wed, 07 May 2008 11:44:31 -0700 (PDT) Received: by 10.142.179.13 with HTTP; Wed, 7 May 2008 11:44:31 -0700 (PDT) Message-ID: Date: Wed, 7 May 2008 14:44:31 -0400 From: "Raghuveer Rawat" To: "Struts Users Mailing List" Subject: Re: Action servlet becomes null in UNIX environment In-Reply-To: <431CF4CD710A274AA1A541F1F4F221FF01E16827@nyc.kbcfp.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1027_28108557.1210185871256" References: <431CF4CD710A274AA1A541F1F4F221FF01E16827@nyc.kbcfp.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_1027_28108557.1210185871256 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks for the prompt reply. Its a late 90's huge application in which now i cannot start using Strus 2 as iam the only developer working on this. We are using html in java code because the JSP changes at run time according to the user inputs . Yeah , i agree that coz of diff environment we face lot of problems but i cannot do anything as its not my decision. We run Apache as a front end for Tomcat. Apache serves up the html pages and uses mod_jk mounts to forward the java application requests to Tomcat. I'll try to find out what else i can do as i am unable to see anything in apache logs as well. On Wed, May 7, 2008 at 1:48 PM, Allen, Daniel wrote: > A couple of things strike me as really odd about this. > > First: why are you creating HTML using strings in Java code? The whole > point of JSPs was to avoid doing exactly that. You should either make > use of .jsp files and the logic tags in Struts [1] or just use regular > servlets if you really want to manually compose HTML. > > Second, why is your test environment different from your production > environment? That sort of defeats the purpose of testing, since you can > no longer rely on the fact that something you tested works. > > > That said, chances are pretty good that you're getting null from that > line because the HTTP request represented by the request object didn't > have a parameter called "actionSelection". I suggest you stick in a > breakpoint and have a look at the contents of the object. > > Hope that helps. > ~DVA > > [1] http://struts.apache.org/1.3.8/struts-taglib/index.html Looks as > though you're using Struts 1, but you didn't specify a version, so > here's the last release's tag documents. If this is a new app, may I > humbly suggest you use Struts2 instead? No sense in starting a project > using a deprecated framework. > > > -----Original Message----- > From: Raghuveer Rawat [mailto:techhelp07@gmail.com] > Sent: Wednesday, May 07, 2008 1:18 PM > To: Struts Users Mailing List > Subject: Action servlet becomes null in UNIX environment > > Hi, > I have a problem with my application where actionServlet becomes null in > UNIX environment and works fine in windows XP system. While saving data > on > test environment (UNIX) I am getting action servlet as null in My Action > class. The jsp is built dynamically in as below > > *JSP code:* > > if (newGuide) { > > sb.append("\n"); > > sb.append("\n"); > > sb.append(""); > > sb.append(" > value=\"Complete\" class=Button >"); > > sb.append("\n"); > > sb.append("\n"); > > } > > * Action Class // Action class used for security * > > public void setServlet(ActionServlet actionServlet) { > > super.setServlet(actionServlet); // Here I get actionServlet as null > > ServletContext servletContext = actionServlet.getServletContext(); > > WebApplicationContext wac = WebApplicationContextUtils > > .getRequiredWebApplicationContext(servletContext); > > setIcrProcessor((CareRequestProcessor)wac.getBean("myCareRequestProcesso > > r")); > > } > > Because of this I get null pointer exception in class Main Action Class > used > for saving the data. > > *Action class code :* > > public ActionForward saveHAGuide(ActionMapping mapping, ActionForm form, > HttpServletRequest request, > > HttpServletResponse response) throws Exception { > > String method = "saveHAGuide"; > > Exception ex = null; > > ActionForward forward = null; > > AppUser appUser = getAppUser(request); > > appUser.methodStart(this, "saveHAGuide"); > > HttpSession session = request.getSession(false); > > String action = request.getParameter("actionSelection"); // Here I get > action as null > > Action becomes null and it throws null pointer exception. > > As UNIX is case sensitive I checked the request parameter which is > actionSelection in this class and I do not see any problem with it. I > don't > know why action servlet becomes null at this point. Please suggest if > you > have any idea about this. > > Note: This happens only in test environment (UNIX). Works fine in my > local > system (Windows XP) . > > Thanks and regards, > > -- > This message may contain confidential, proprietary, or legally privileged > information. No confidentiality or privilege is waived by any transmission > to an unintended recipient. If you are not an intended recipient, please > notify the sender and delete this message immediately. Any views expressed > in this message are those of the sender, not those of any entity within the > KBC Financial Products group of companies (together referred to as "KBC > FP"). > > This message does not create any obligation, contractual or otherwise, on > the part of KBC FP. It is not an offer (or solicitation of an offer) of, or > a recommendation to buy or sell, any financial product. Any prices or other > values included in this message are indicative only, and do not necessarily > represent current market prices, prices at which KBC FP would enter into a > transaction, or prices at which similar transactions may be carried on KBC > FP's own books. The information contained in this message is provided "as > is", without representations or warranties, express or implied, of any kind. > Past performance is not indicative of future returns. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > ------=_Part_1027_28108557.1210185871256--