开发者社区> 问答> 正文

org.apache.catalina.core.StandardWrapper?报错

org.apache.catalina.core.StandardWrapperValve invoke 信息: Servlet AddQuestionsServlet is currently unavailable? 400 报错

第一次运行出错,信息如下:

2013-7-27 18:21:04 org.apache.catalina.core.ApplicationContext log
信息: Marking servlet AddQuestionsServlet as unavailable
2013-7-27 18:21:04 org.apache.catalina.core.ApplicationContext log
严重: Error loading WebappClassLoader
  context: /Questionnaire
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@c79809
 com.surveyServlet.AddQuestionsServlet
java.lang.ClassNotFoundException: com.surveyServlet.AddQuestionsServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:600)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1703)
at java.lang.Thread.run(Thread.java:619)
2013-7-27 18:21:04 org.apache.catalina.core.StandardWrapperValve invoke
严重: Allocate exception for servlet AddQuestionsServlet
java.lang.ClassNotFoundException: com.surveyServlet.AddQuestionsServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:600)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1703)
at java.lang.Thread.run(Thread.java:619)


第二次运行:

2013-7-27 18:21:36 org.apache.catalina.core.StandardWrapperValve invoke
信息: Servlet AddQuestionsServlet is currently unavailable
都一天啦!急死我啦!大侠们,救救我吧!

展开
收起
优选2 2020-06-04 21:18:39 1188 0
1 条回答
写回答
取消 提交回答
  • 哎!没人理啊!我还是自己搞定吧!在url前边加上standardSubmit:true,就可以跳转啦!######把配置文件贴出来, 你这是 在做什么? 详细描述清楚######

    楼主啊,你这是急着赶公交呢还是急着交差啊?是不是做不出来就要被老板辞退啊,要不然怎么这么急。。

    什么都不说,错误信息一贴就问。我把我大腿伸出来给你看,问“你猜猜我同桌今天打麻将赢了多少钱”。。

    你回答啊。。简直莫名其妙

    ###### AddQuestionsServlet 这个servlet有问题啊######好大的凶兆,好凶啊!我不是急吗?就赶紧提了错误。其实啊,我现在也不晓得到底是哪里错啦!我就又重新进了一个servlet,把 AddQuestionsServlet里的内容粘过来,重启MyEclipse就OK啦!不过谢谢你们的关注!######

    不过又出现一个新问题:center_left.jsp,内容是Ext的一个form表单,


    url:'servlet/AddQueServlet',
    具体如下:



    <script type="text/javascript">
    Ext.require([ '*' ]);
    Ext.onReady(function() {//onReady()函数在页面注册多个函数,依次执行
     Ext.QuickTips.init();
     Ext.state.Manager.setProvider(Ext.create('Ext.state.CookieProvider'));
    				// NOTE: This is an example showing simple state management. During development,
    				// it is generally best to disable state management as dynamically-generated ids
    				// can change across page loads, leading to unpredictable results.  The developer
    				// should ensure that stable state ids are set for stateful components in real apps.
    				Ext.state.Manager.setProvider(Ext
    						.create('Ext.state.CookieProvider'));
    				
    			//表单组合控件在中间部分的左侧
    			var form = new Ext.form.FormPanel({
    					labelAlign : 'right',
    					autoScroll : true,
    					labelWidth : 50,
    					width : 600,
    					// title: 'form',
    					frame : true,
    					url:'servlet/AddQueServlet',
    					items : [ {
    						layout : 'form',
    						items : [ {
    							//columnWidth:.7,
    							xtype : 'fieldset',
    							layout : 'form',
    							checkboxToggle : true,//折叠fieldset
    							title : '文字输入',
    							autoHeight : true,
    							defaults : {
    								width : 400
    							},
    							defaultType : 'textfield',
    							items : [ {
    								fieldLabel : '题目',
    								name : 'head',
    								allowBlank : false
    							}, {
    
    								xtype : 'htmleditor',
    								fieldLabel : '题目备注及说明',
    								id : 'editor',
    								anchor : '98%',
    							    name : 'des',
    							    fontFamilies: ["宋体", "隶书", "黑体","Times New Roman"]
    							   
    							}, {
    								xtype : 'hidden',
    								name : 'hidden'
    							} ]
    						}, {
    							//columnWidth:.3,
    
    							xtype : 'fieldset',
    							checkboxToggle : true,
    							title : '数据验证',
    							autoHeight : true,
    							defaultType : 'checkbox',
    							hideLabels : true,
    							layout : 'column',
    							name:'checkValue',
    							//style: 'margin-left:10px;',
    							//bodyStyle: 'margin-left:20px;',
    							items : [ {
    								boxLabel : '必填',
    								columnWidth : .125,
    								name : 'check',
    								inputValue : '1',
    								checked : true,
    								width : 'auto'
    							}, {
    								boxLabel : '手机号码',
    								columnWidth : .125,
    								name : 'check',
    								inputValue : '2',
    								//checked: true,
    								width : 'auto'
    							}, {
    								boxLabel : '邮编',
    								columnWidth : .125,
    								name : 'check',
    								inputValue : '3',
    								width : 'auto'
    							}, {
    								boxLabel : '身份证号',
    								columnWidth : .125,
    								name : 'check',
    								inputValue : '4',
    								width : 'auto'
    							}, {
    								boxLabel : '日期',
    								columnWidth : .125,
    								name : 'check',
    								inputValue : '5',
    								width : 'auto'
    							}, {
    								boxLabel : 'Email',
    								columnWidth : .125,
    								name : 'check',
    								inputValue : '6',
    								width : 'auto'
    							}, {
    								boxLabel : '必答题',
    								columnWidth : .25,
    								name : 'check',
    								inputValue : '7',
    								width : 'auto'
    							} ]
    						}, {
    							xtype : 'fieldset',
    							checkboxToggle : true,
    							title : '选项(每行一个)',
    							autoHeight : true,
    							defaultType : 'textarea',
    							hideLabels : true,
    							layout:'form',
    							//style: 'margin-left:10px;',
    							//bodyStyle: 'margin-left:20px;',
    							items : [ {
    								xtype:'textfield',
    								fieldLabel : '输入选项个数',
    								name : 'number'
    							},{
    								width : 400,
    								grow : true,
    								name : 'options',
    								//allowBlank : false,
    								emptyText : '输入选项',
    								maxLength : 10,
    								minLength : 2
    							} ]
    						}, {
    							xtype : 'fieldset',
    							//checkboxToggle:true,
    							title : '选项排列',
    							autoHeight : true,
    						    defaultType : 'radio',
    							hideLabels : true,
    							layout : 'column',
    							//style: 'margin-left:10px;',
    							//bodyStyle: 'margin-left:20px;',
    							items : [ {
    
    								boxLabel : '横向',
    								name : 'rank',
    								inputValue : '1',
    								//checked: true,
    								width : 'auto'
    							}, {
    
    								boxLabel : '竖向',
    								name : 'rank',
    								inputValue : '2',
    								checked : true,
    								width : 'auto'
    							} ]
    						} ]
    
    					} ], buttons: [{
    			            text: '保存',
    			            handler:function(){
    			            	form.getForm().submit();
    			            }
    			        },{
    			            text: '读取'
    			        },{
    			            text: '取消'
    			        }]
    				});
    			var viewport = Ext.create('Ext.Viewport',
    					{
    				       id : 'Center_left',
    					   layout : 'fit',
    					   autoScroll : true,
    					items : [form]
    			});
    			form.render("form");
    			});
    	
    
    			</script>
    AddQueServlet如下:
    public class AddQueServlet extends HttpServlet {
    	public void doGet(HttpServletRequest request, HttpServletResponse response)
    			throws ServletException, IOException {
    				response.setContentType("text/html");
    				doPost(request, response);// 调用doPost方法
    			}
    
    			public void doPost(HttpServletRequest request, HttpServletResponse response)
    					throws ServletException, IOException {
    				request.setCharacterEncoding("utf-8");
    				response.setContentType("text/html;utf-8");
    				response.setCharacterEncoding("utf-8");
    				// 获得表单提交的参数
    				String head=request.getParameter("head");
    				String des=request.getParameter("des");
    				int number=0;
    				if(request.getParameter("number")!=""){
    					number= Integer.parseInt(request.getParameter("number"));
    				}
    				
    				//System.out.print(number+"###################");
    				String body=request.getParameter("options");
    				String checkValue[]= request.getParameterValues("check");
    				int rank=Integer.parseInt(request.getParameter("rank"));
    				//System.out.print(rank+"###################");
    				HttpSession session=request.getSession();
    				
    				
    				//int qt_id = Integer.parseInt((String)session.getAttribute("qt_id"));// 获得所选问题类型的ID
    				//System.out.print(qt_id);
    				int qt_id =1;
    				QuestionType qType = new QuestionType();
    
    				
    				QuestionTypeDao questionType = new QuestionTypeDaoImpl();
    				qType = questionType.findQueTypeById(qt_id);
    				Questions question = new Questions();
    
    				question.setQ_head(head);
    				question.setQ_body(body);
    				question.setQ_type(qType);
    				question.setQ_number(number);
    				
    
    				
    				QuestionsDao questionsDao = new QuestionsDaoImpl();
    				questionsDao.add(question);// 调用实现类的的添加方法
    
    					response.sendRedirect("../DesignQuestions/Center_right.jsp");// 重定向到显示全部的Servlet中
    					}
    }
    问题就是:Center_right.jsp无法显示,在表单里点击保存后,页面不跳转,也不报错!大侠们,说说答案吧


    ######web.xml里这个Servlet配置正常否? AddQuestionsServlet ######

    引用来自“王瑞平”的答案

    web.xml里这个Servlet配置正常否? AddQuestionsServlet 
    不是 AddQuestionsServlet 是AddQueServlet,以下是XML的配置:
    <servlet-mapping>
        <servlet-name>AddQueServlet</servlet-name>
        <url-pattern>/servlet/AddQueServlet</url-pattern>
      </servlet-mapping>
    我觉得没什么问题啊?求教
    ######就是这里的错误######错哪里啦?您给指出来啊!
    2020-06-05 11:37:48
    赞同 展开评论 打赏
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Apache Flink技术进阶 立即下载
Apache Spark: Cloud and On-Prem 立即下载
Hybrid Cloud and Apache Spark 立即下载

相关镜像