我遇到以下异常?请高手帮忙

张懿fighting 发布于 2012/08/07 09:56
阅读 540
收藏 0
The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.NullPointerException
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:500)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:428)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88)

root cause

java.lang.NullPointerException
	org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java:1161)
	org.apache.struts.taglib.TagUtils.message(TagUtils.java:1024)
	org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:224)
	org.apache.jsp.reg_jsp._jspx_meth_bean_005fmessage_005f0(reg_jsp.java:289)
	org.apache.jsp.reg_jsp._jspService(reg_jsp.java:123)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter
加载中
0
情天大圣
情天大圣
空指针异常是java里最好解决的问题,提示很清楚了!
0
liujb88
liujb88
我几乎完全不怎么懂java 差不多都能明白你这个错误
 java.lang.NullPointerException 空指针 俗称 未将对象设置引用为对象的实例
 在调用每一个实例的时候注意其是不是null
0
张懿fighting
张懿fighting

还是没解决

 

 

醪糟儿蛋
醪糟儿蛋
从异常的第一行打断点dbg,看哪个对象为null,找原因 每个函数都跟进去看看
0
yjpfj1203
yjpfj1203
你是不是页面上有东西写错了。
0
Andre.Z
Andre.Z
reg_jsp.java,查下你的reg.jsp,问题在里面,可以去找编译后的java类,错误就在123行。貌似是某个啥信息找不到。
0
sxgkwei
sxgkwei
MessageTag写的不好,里面没有对null的判断就去做事了。而你reg.jsp里面又用到这个标签,刚好就给它传来个null,所以悲剧了。
0
指尖的舞者
指尖的舞者

应该是前台jsp中引用的标签有问题。你可以试试先把jsp全部设置为空,跑一次看报错不,不报错的话就意味以上说的是对了,jsp中标签的问题。再看看你用到了哪些~

 

姑娘,其实最好的办法,你把该异常抛给我,我接着给你处理掉~

0
张懿fighting
张懿fighting
<%@ page language="java" import="java.util.*" import="com.haole.user.vo.UserVo"pageEncoding="utf-8"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>  
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
  <meta charset="utf-8"/>
    <base href="<%=basePath%>">
    
    <title>享乐圈_享乐生活第一站,刷Q卡享优惠 _享乐圈</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	
	<meta name="keywords" content="享乐,Q享乐,享乐圈,享乐Q卡,Q卡,优惠打折,享乐消费,购物分享,消费点评,生活搜索,商家推荐,积分兑换,活动优惠,打折信息,生活服务,吃喝玩乐,江南春,分众,分众传媒,享乐生活第一站" />
	<meta name="description" content="享乐圈是中国首家生活消费分享社区。随时随地分享消费乐趣,掌握消费资讯,体验消费特权。提供最新最潮最真实最有料的吃喝玩乐、逛街购物、优惠打折、商户店铺的信息。" />
	
	
	
	<link type="text/css" rel="stylesheet" href="web/css/uerstyle.css?v=20111129" />
<link type="text/css" rel="stylesheet" href="web/css/reset.css?v=20111129" />
<link type="text/css" rel="stylesheet" href="web/css/weebox.css?v=20111129" />
<link type="text/css" rel="stylesheet" href="web/css/popup.css?v=20111129" />
<link type="text/css" rel="stylesheet" href="web/css/powerFloat.css?v=20111129">

 </head>
  
  <body>
  <%UserVo u=(UserVo)request.getSession().getAttribute("UserVo"); %>

<!-- 表情DIV -->
<div id="append_parent"></div>
<div id="go-to-top"></div>
<!-- Start (公用头1) -->
<div class="head-bg mr-b20">
  <div class="head-bor1"></div>
  <!-- Start (导航) -->
  <div class="area pos">
    <h1><a href="web/coupon/CouponList.jsp" title="享乐圈"><span>享乐圈LOGO</span></a></h1>
    <div class="head-nav fb14">
        <a href="web/user/BasicInfo.jsp" title="用户中心">用户中心</a>
        <a href="web/square/square.jsp" title="情报圈">情报圈</a>
        <a href="web/business/index.jsp" title="商户圈">商户圈</a>
        <a href="web/coupon/CouponList.jsp" title="优惠券">优惠圈</a>
        <!--<span class="head-hot"></span>-->
    </div>
    <!-- Start (搜索) -->
    <div class="head-topinput">
    <form id="search-form" action="" method="get" onSubmit="return submitSearch()">
        <input type="hidden" value="member" name="search_type" id="search_type" />
        <input type="submit" class="all-topsearch" value="搜索" />
        <span><input name="keyword" id="search-keyword" type="text" class="cor-ccc" value="搜索"  onfocus="thisClear(this, '搜索');this.select();" onBlur="thisClear(this, '搜索');"></span>
        <a href="javascript:;" class="ico-toparrow09 r" id="search-text" onClick="showMenu(this, '#search-menu')">找人</a>
    </form>
</div>
<!-- Start (搜索下拉菜单) .none 隐藏   .block显示-->
<div class="head-select none" id="search-menu">
  <a href="javascript:;" sid="member" title="找人">找人</a>
  <!--<a href="javascript:;" sid="weibo" title="Q语">Q语</a>-->
  <a href="javascript:;" sid="shop" title="商户">商户</a>
  <a href="javascript:;" sid="coupon" title="优惠券">优惠券</a>
  <a href="javascript:;" sid="square" title="情报圈">情报圈</a>
</div>

  <!-- Start 通知 城市 -->

    <div class="hd-select">
    
        
    </div>
    <!-- Start (个人资料下拉)-->
    
        <!-- 尖角 -->
        <span class="head-arrow1"></span>
  </div>
</div>
<!-- End (公用头1) -->
<link  type="text/css" href="web/css/jquery.Jcrop.css?v=20111129" rel="stylesheet"  />


<!--通用用户中心开始-->
<!--浮层 编辑头像开始-->
<div class="f_portrait" style="display:none;" id="divUpload">
	<dl class="upload">
		<dt>
			<form>
				<div class="hea-btn">
					<span id="spanButtonPlaceholder" ></span>
				</div>
			</form>
		</dt>
		<dd>支持JPG/JIF/PNG/BMP等图片格式,大小不超过5MB</dd>
		<dd id="megerror" style="color:#FF0000; display:none">支持JPG/JIF/PNG/BMP等图片格式,大小不超过5MB</dd>
	</dl>
	<div class="show c_b">
	   <div class="img_div_left">
			<div id="cropbox_div" class="img_1" style="display:block">
				<img src="http://passport.q.com.cn/img/info/head.png" width="300" height="300"   id="cropboxa" />
			</div>
			<div id="loading" class="img_1" style="display:none">
				<img src="web/js/user/loading.gif"  width="89" height="90" />
			</div>
				<!--<a href="###" title="从电脑选择图片" class="hea-btn head-li">从电脑选择图片</a>-->
				<form onsubmit="return false;">
				<input type="hidden" size="4" id="x" value="" name="x" />
				<input type="hidden" size="4" id="y" value="" name="y" />
				<input type="hidden" size="4" id="x2" value="" name="x2" />
				<input type="hidden" size="4" id="y2" value="" name="y2" />
				<input type="hidden" size="4" id="w" value="" name="w" />
				<input type="hidden" size="4" id="h" value="" name="h" />
				</form>			

				<input type="hidden" id="caijian_img" value=""/>
				<span id="caijiandiv" style="display:none"></span>
		</div>
		<div class="img_div_right">
		<dl>
			<dt>头像尺寸预览</dt>
			<dd>
				<span style="width:160px; height:160px;overflow:hidden;"><img src="http://passport.q.com.cn/images/user_1.png" alt="头像" id="preview" /></span>
				<tt style="width:160px;">160*160</tt>
				<span style="width:60px; height:60px;overflow:hidden;"><img src="http://passport.q.com.cn/images/user_2.png" alt="头像" id="preview2"  /></span>
				<tt style="width:60px;">60x60</tt>
			</dd>
		</dl>
		</div>
	</div>
	<div class="btn2">
		<a href="javascript:;" class="btn_1"  id="caijian" onclick="toCreatPic('titlepic','/user/index/avatar-jcrop/');">保存头像</a>
		<!--<a href="javascript:;"  onclick="divRest(0);" class="btn_2">重置</a>-->
		<span class="re_tsBox" id="upload_success" style="display:none"></span>
	</div>
	<a class="btn_clear" href="#" title="#" onclick="javascript:$('#divUpload').hide();">关闭</a>
	
</div>
<!--浮层 编辑头像结束-->
<div class="re_userCenter c_b" id="divInfo">
<form action="user.do?mand=ModifyUserInformation&userId=<%=u.getUserId() %>" method="post" id="frInfo">
		<!--通用用户中心左侧开始-->
	<div class="re_userCenterLeft c_b">
		<!--用户中心菜单开始-->
		<div class="uCenterMenu">
			<h3>账户管理</h3>
			<div class="show c_b">
				<a title="#" href="web/user/BasicInfo.jsp" class='now'>基本资料</a>
				<a title="#" href="web/user/ModifyPwd.jsp" >修改密码</a>
				<a title="#" href="web/user/BindPhone.jsp" >绑定手机</a>
				
			</div>
		</div>
		<!--用户中心菜单结束-->
	</div>
	<!--通用用户中心左侧结束-->
	<!--通用用户中心右侧开始-->
	<div class="re_userCenterRight c_b">
		<!--用户中心通用栏目信息开始-->
		<div class="re_uCenterTitle c_b">
			<h2>基本信息管理</h2>
		</div>
		<!--用户中心通用栏目信息结束-->
		<!--用户中心内容主体开始-->
		<div class="re_uCenterMain c_b">
			<!--基本资料开始-->
			<div class="baseData c_b">
				<ul class="c_b">
					<li class="portrait">
						<label class="t_1">头像:</label>
						<img src="http://passport.q.com.cn/images/user_1.png" width="160" height="160" alt="#"  id="newPic"/>
						<img src="web/js/user/loading.gif"  id="newloading" width="89" height="90" style="display:none" />
						
						<input type="hidden" name="picture" id="picture" value="" />
						<a title="#" href="#" class="edit" onclick="$('#divUpload').show();" >修改头像</a>
					</li>
					<li>
						<label class="t_1"><tt>*</tt>昵称:</label>
						<tt class="re_inputTxt txtInput_1">
							<em><input type="text" name="userName"  maxlength="20" id="userName" value="<%=u.getUserName() %>" /></em>
						</tt>
						<label class="t_2"></label>
					</li>
					<li>
						<label class="t_1">密码:</label><a title="#" href="web/user/ModifyPwd.jsp" class="passwored">修改登录密码</a>
					</li>
					<label class="t_1"><tt>*</tt>邮箱:</label>
						<tt class="re_inputTxt txtInput_1">
							<em><input type="text" name="email"  maxlength="20" id="email" value="<%=u.getEmail() %>" /></em>
						</tt>
					<!--  <li>
						<label class="t_1">邮箱:</label><label class="t_2">您还没验证邮箱<a title="#" href="/user/mail/modify">立即验证</a></label>	</li>-->
					<li>
						<label class="t_1">手机:</label>
						<tt class="re_inputTxt txtInput_1">
							<em><input type="text" name="phoneNumber"  maxlength="20" id="phoneNumber" value="<%=u.getPhoneNumber() %>" /></em>
						</tt>
					</li>
					<li>
						<label class="t_1"><tt>*</tt>性别:</label>
						<input name="userSex" id="rdoman" type="radio" value="1"  class="sex_2"  /><span class="sex_1">男</span>
						<input name="userSex" id="rdowoman" type="radio" value="0" class="sex_2" checked /><span class="sex_1">女</span>
					</li>
					<li>
						<label class="t_1">年龄:</label>
						<tt class="re_inputTxt txtInput_1">
							<em><input type="text" name="userAge"  maxlength="20" id="userAge" value="<%=u.getUserAge() %>" /></em>
						</tt>
					</li>
					<li>
						<label class="t_1"><tt>*</tt>所在城市:</label>
						<tt class="re_inputTxt txtInput_1">
							<em><input type="text" name="adress"  maxlength="20" id="adress" value="<%=u.getAdress() %>" /></em>
						</tt>
					</li>
					<li class="noBorder">
						<input name="btnSub" type="button" class="btn" id="btnSub" value="保存设置" />
						<span id="errmsg" name="errmsg"></span>
					</li>
				</ul>
			</div>
			<!--基本资料结束-->
		</div>
		<!--用户中心内容主体结束-->
	</div>
	<!--通用用户中心右侧结束-->
</form>
</div>
<!--通用用户中心结束-->

<!--通用底部版权开始-->
<div class="re_la_footShow">
	<div class="re_footShow c_b">
		<p class="txt_1">Copyright © 昊乐传媒 All Rights Reserved <a title="#" href="#">赣ICP备12002557号</a></p>
		<p class="txt_2">
			<a title="#" href="#">乐购介绍</a>
			<a title="#" href="#">乐购推广</a>
			<a title="#" href="#">乐购宝</a>
			
			<a title="#" href="web/biz/BizRegister.jsp">我是商家</a>
		</p>
	</div>
</div>
<!--通用底部版权结束-->
</body>
</html>
<style>
.picker{display:inline-block;}
.picker select{margin-right:5px;}
</style>
<!--<script>
$(function() {
 	//创建命名空间
	function namespace(namespace) {
		var node = arguments[1] || this;
		var path = (namespace || '').split('.');
		var current = path.shift();
		if (current) {
		  node[current] = node[current] || {};
		  if (path.length) {
		   arguments.callee(path.join('.'), node[current]);
		  }
		}
	};

	//初始化表单数据
		namespace('userData.vals');
		namespace('userData.msgs');
		var formObj = $('#divInfo');
		userData.msgs.nickname = formObj.find('input[name=txtnickname]').parent().parent().parent().find('.t_2');
		userData.msgs.city = formObj.find('input[type=address]').parent().find('.t_2');
		userData.msgs.nickname.html('');
		userData.msgs.city.html('');
		
	$('#district_id').hide();

	$("input[type='text']").on('focus', function(){
 		$(this).parent().parent().toggleClass('re_inputTxtNow');
 	});
 	$("input[type='text']").on('blur', function(){
 		$(this).parent().parent().toggleClass('re_inputTxtNow');
		//昵称
		if($(this).attr('name') == 'txtnickname'){
			if($(this).val() == ''){
				userData.msgs.nickname.html('支持中英文、数字或者“_”!');
				return false;
				
			}
			else if($(this).val().replace(/[^\x00-\xff]/g,"**").length < 4){
				userData.msgs.nickname.html('请输入4个字符以上的昵称!');
				return false;
				
			}
			else if($(this).val().replace(/[^\x00-\xff]/g,"**").length >20){
				userData.msgs.nickname.html('请输入20个字符以下的昵称!');
				return false;
				
			}
			//判断昵称是否已注册
			else{
				$.ajax({
					url : '/User/UserInfo/ajaxCheckNickName/',
					type : 'POST',
					data : $(this),
					async : false,
					success : function(data) { //返回的数据
					    //alert(data);
						if (data == 'ok') { 
							//成功
							userData.msgs.nickname.html('<span class="re_icoPass"></span>');
							return false;
						} else {
							//失败就给提示
							userData.msgs.nickname.html(data);
							return false;
						 }
					}
				});				
			}
		}
 	}); 	

 

	//修改头像
	$('.editavatar').on('click',function(){
		$('.f_portrait').css('display','block');
	});
	//修改头像关闭按钮
	$('.btn_clear').on('click',function(){
		$('.f_portrait').css('display','none');
	});

	

 	//form submit
	$('#btnSub').on('click',function(){
		userData.vals.nickname =  formObj.find('input[name=txtnickname]').val();
		var year = formObj.find('select[name=selYear]').val();
		var month = formObj.find('select[name=selMonth]').val();
		var day = formObj.find('select[name=selDay]').val();
		userData.vals.birthday = year + '-' + month + '-' + day;
		//userData.vals.avatar_url = $('#avatar_url').val();
		userData.vals.province_id=formObj.find('select[name=province_id]').val();
		userData.vals.city_id=formObj.find('select[name=city_id]').val();
		userData.vals.province_name=formObj.find('input[name=province_name]').val();
		userData.vals.city_name=formObj.find('input[name=city_name]').val();
		userData.vals.rdoGender=formObj.find('radio[name=rdoGender]').val();
		userData.msgs.city = formObj.find('input[type=address]').parent().find('.t_2');
		
		var chk=false;
		
        if ($('#rdoman').attr('checked')){
        	userData.vals.rdoGender='1';
        }
        if ($('#rdowoman').attr('checked')){
        	userData.vals.rdoGender='0';
        }
 		 		
		//检查是否为空
		if (userData.vals.nickname == '' ){			
			userData.msgs.nickname.html('请输入昵称');
            chk=true;
        }

        if (userData.vals.province_id=="0" || userData.vals.city_id=="0" ){
        	userData.msgs.city.html('请选择所在城市');
        	chk=true;
        }
        if (chk){
            return false;
        }else{
			$.ajax({
	            url : '/User/UserInfo/modify',
	            type : 'POST',
	            data : userData.vals,
	            //dataType : 'json',
	            async : false,
	            success : function(data) { //返回的数据
	                if (data == 'ok') { 
						//成功, 返回需要跳转的页面 在data.gotourl;
						//$('#errmsg').removeClass('re_tsBox2');
						//alert('chris');
						//$('#errmsg').addClass('re_tsBox');
						//$('#errmsg').html('资料修改成功');
						$('.btn').after('<span class="re_tsBox">修改成功</span>');
	                   	setTimeout(function(){
	                   		$('.re_tsBox').remove();
	                   	    window.location.href="/user/userinfo/";
	 					},2000);  
	 					return false;
	                } else {
						//失败
	                	$('.btn').after('<span class="re_tsBox2">'+data+'</span>');
	                   	setTimeout(function(){
	                   		$('.re_tsBox2').remove();
	 					},2000);
	 					return false;                 	
	                 }
	            }
	        });
        }
	});
})


</script>  -->

看了半天还是这样,不知道错在哪里
返回顶部
顶部