第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

Tomcat有異常,運(yùn)行后有報(bào)錯(cuò)(注釋dopost代碼后報(bào)錯(cuò)消失)

七月 27, 2015 4:24:00 下午 org.apache.coyote.AbstractProtocol destroy

信息: Destroying ProtocolHandler ["ajp-nio-8009"]

七月 27, 2015 4:24:00 下午 org.apache.coyote.AbstractProtocol destroy

嚴(yán)重: Failed to destroy end point associated with ProtocolHandler ["ajp-nio-8009"]

java.lang.NullPointerException

at org.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:302)

at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:473)

at org.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:818)

at org.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:532)

at org.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023)

at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)

at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:588)

at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)

at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:859)

at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305)

at org.apache.catalina.startup.Catalina.start(Catalina.java:629)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

附上自己的servlet:

package com.imooc.servlet;


import com.imooc.po.TextMessage;

import com.imooc.util.CheckUtil;

import com.imooc.util.MessageUtil;


import java.util.Date;

import java.util.Map;

import java.io.IOException;

import java.io.PrintWriter;


import javax.servlet.ServletException;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;


import org.dom4j.DocumentException;




public class Wechatservlet extends HttpServlet {

@Override

protected void doGet(HttpServletRequest req, HttpServletResponse resp)

throws ServletException, IOException {

String signature = req.getParameter("signature");

String timestamp = req.getParameter("timestamp");

String nonce = req.getParameter("nonce");

String echostr = req.getParameter("echostr");

PrintWriter out = resp.getWriter();

if(CheckUtil.checkSignature(signature, timestamp, nonce)){

out.print(echostr);

}else{

System.out.println("校驗(yàn)失敗,請(qǐng)從新嘗試");

}

}


@Override

protected void doPost(HttpServletRequest req, HttpServletResponse resp)

? ? ? ? ? ? throws ServletException, IOException {

? ? ? ? // TODO Auto-generated method stub

? ? ? ??

? ? ? ? ? ? req.setCharacterEncoding("UTF-8");

? ? ? ? ? ? resp.setCharacterEncoding("UTF-8");

? ? ? ? ? ? PrintWriter out = resp.getWriter();

? ? ? ? ? ? try {

? ? ? ? ? ? Map<String, String> map = (Map<String, String>) MessageUtil.xmlToMap(req);


? ? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ? String fromUserName = map.get("ToUserName");

? ? ? ? ? ? ? ? String toUserName = map.get("FromUserName");

? ? ? ? ? ? ? ? String createTime = map.get("CreateTime");

? ? ? ? ? ? ? ? String msgType = map.get("MsgType");

? ? ? ? ? ? ? ? String content = map.get("Content");

? ? ? ? ? ? ? ? String msgId = map.get("MsgId");

? ? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ? String message =null;

? ? ? ? ? ? ? ? if("text".equals(msgType)){

? ? TextMessage text = new TextMessage();

? ? text.setToUserName(toUserName);

? ? text.setFromUserName(fromUserName);

? ? ? ? ? ? ? ? ? ? text.setMsgType("test");

? ? ? ? ? ? ? ? ? ? text.setCreateTime(new Date().getTime());

? ? ? ? ? ? ? ? ? ? //text.setMsgId(msgId);

? ? ? ? ? ? ? ? ? ? text.setContent("您發(fā)送的消息是"+content);

? ? message = MessageUtil.textMassagetoXml(text);

? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ? System.out.println(message);

? ? ? ? ? ? ? ? out.print(message);

? ? ? ? ? ? } catch (DocumentException e) {

? ? ? ? ? ? ? ? // TODO Auto-generated catch block

? ? ? ? ? ? ? ? e.printStackTrace();

? ? ? ? ? ? }finally{

? ? ? ? ? ? ? ? out.close();

? ? ? ? ? ? }

? ? ? ? ? ? ?

? ? ? ? }

? ? ? ??

}


正在回答

1 回答

dopost里面的代碼寫錯(cuò)了,只是個(gè)空指針異常

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
初識(shí)Java微信公眾號(hào)開發(fā)
  • 參與學(xué)習(xí)       158313    人
  • 解答問題       684    個(gè)

Java微信公眾號(hào)開發(fā)的入門教程,掌握微信公眾號(hào)基本概念

進(jìn)入課程

Tomcat有異常,運(yùn)行后有報(bào)錯(cuò)(注釋dopost代碼后報(bào)錯(cuò)消失)

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)