当前位置: 代码迷 >> Java Web开发 >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
  详细解决方案

at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)

热度:474   发布时间:2016-04-17 17:21:27.0
关于DWR框架报Internal server error错误的问题
我写了一个使用dwr框架的程序,在我的电脑上运行没有任何错误,但在另外一台电脑上运行,页面上弹出对话框显示Internal server error
同时控制台报错
java.lang.VerifyError: (class: org/directwebremoting/extend/Reply, method: <init> signature: (Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Throwable;)V) Illegal local variable number
at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:432)
at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283)
at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)
at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)
at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
不知是何原因,请高手指点!程序代码如下:

web.xml代码:
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>
org.directwebremoting.servlet.DwrServlet
</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>

jsp代码:
<script src='dwr/interface/JUserChecker.js'></script>
<script src='dwr/engine.js'></script>
<script src='dwr/util.js'></script>

<script language="JavaScript" type="text/javascript">
  function checkUserExists( ) {
  username = document.getElementById("uname");

  JUserChecker.check(username.value,checkData);
  }

  function checkData(isExist) {
  if(isExist)
  {
  alert("用户名已存在!");
  }
  else
  {
  alert("用户名不存在!");
  }
  }
  </script>

dwr.xml代码:
<dwr>
<allow>

<create creator="new" javascript="JUserChecker">
<param name="class" value="y2ssh.sg.ch10.UserManager" />
<include method="check" />
</create>

</allow>
</dwr>


UserManager.java代码:(经测试该函数可以正确执行)
public boolean check(String uname) {
boolean exist= false;
Session session = HibernateSessionFactory.getSession();
String hql = "from USER as user where user.uname='"+uname+"'";
try {
Query query = session.createQuery(hql);
List list = query.list();
if( list != null && list.size() >= 1 ){
  相关解决方案