ExtJS下 Ext.Direct加载和提交过程排错小结

偶泪滴嘎嘎,终于,终于完成了一部分ExtJS。
(基础夯实一点,会有好处的,排错的时候就体现出来了)
下面就Ext.Direct做一些排错笔记:

错误一


代码如下:

严重: StandardWrapper.Throwable
java.lang.ArrayIndexOutOfBoundsException: 1
at com.softwarementors.extjs.djn.api.RegisteredStandardMethod.isValidFormHandlingMethod(RegisteredStandardMethod.java:53)
at com.softwarementors.extjs.djn.scanner.Scanner.scanAndRegisterActionClass(Scanner.java:206)
at com.softwarementors.extjs.djn.scanner.Scanner.scanAndRegisterActionClass(Scanner.java:105)
at com.softwarementors.extjs.djn.scanner.Scanner.scanAndRegisterApiConfiguration(Scanner.java:82)
at com.softwarementors.extjs.djn.scanner.Scanner.scanAndRegisterApiConfigurations(Scanner.java:64)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createDirectJNgineRouter(DirectJNgineServlet.java:182)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.init(DirectJNgineServlet.java:155)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5033)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5317)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2013-3-28 17:43:52 org.apache.catalina.core.StandardContext loadOnStartup

这是为什么呢?
答案:
@DirectFormPostMethod
这个不对,这个产生了上面的错误,改成: @DirectMethod
同时删掉,由@DirectFormPostMethod生成的输出:


代码如下:

import com.softwarementors.extjs.djn.config.annotations.DirectFormPostMethod;

错误二


代码如下:

ERROR: com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor - "(Controlled) server error: 1 for Method 'FormAction.submitData'" (rid=1000)
java.lang.ArrayIndexOutOfBoundsException: 1
at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.checkJsonMethodParameterTypes(JsonRequestProcessor.java:352)
at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.getIndividualRequestParameters(JsonRequestProcessor.java:247)
at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.processIndividualRequest(JsonRequestProcessor.java:404)
at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.processIndividualRequestsInThisThread(JsonRequestProcessor.java:143)
at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.process(JsonRequestProcessor.java:126)
at com.softwarementors.extjs.djn.router.RequestRouter.processJsonRequest(RequestRouter.java:83)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.processRequest(DirectJNgineServlet.java:617)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.doPost(DirectJNgineServlet.java:580)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

控制层出错,也就是逻辑上不对,我的函数里面要求传入的参数,和提交的参数不对,
放心,不是xml配置问题,是传入的参数问题。所以重点在参数上,也就是语法。

我的错误原因
Java要求传入的参数为两个:


代码如下:

public Info submitData(String name,String password)

而我在ExtJS 中实际传入的参数是一个:


代码如下:

var params= username.getValue()+Password.getValue();
FormAction.submitData(params,function(result,e){}

改写一下就行了:


代码如下:

FormAction.submitData(username.getValue(),Password.getValue(),function(result,e){}

错误三


代码如下:

FATAL: com.softwarementors.extjs.djn.servlet.DirectJNgineServlet - "Unable to find class 'com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting'" ()
com.softwarementors.extjs.djn.servlet.ServletConfigurationException: Unable to find class 'com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting'
at com.softwarementors.extjs.djn.servlet.ServletConfigurationException.forClassNotFound(ServletConfigurationException.java:63)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.getGsonBuilderConfiguratorClass(DirectJNgineServlet.java:362)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createGlobalConfiguration(DirectJNgineServlet.java:324)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createDirectJNgineRouter(DirectJNgineServlet.java:164)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.init(DirectJNgineServlet.java:155)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5033)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5317)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.getGsonBuilderConfiguratorClass(DirectJNgineServlet.java:353)
... 16 more
2013-3-28 17:59:39 org.apache.catalina.core.ApplicationContext log
严重: StandardWrapper.Throwable
com.softwarementors.extjs.djn.servlet.ServletConfigurationException: Unable to find class 'com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting'
at com.softwarementors.extjs.djn.servlet.ServletConfigurationException.forClassNotFound(ServletConfigurationException.java:63)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.getGsonBuilderConfiguratorClass(DirectJNgineServlet.java:362)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createGlobalConfiguration(DirectJNgineServlet.java:324)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createDirectJNgineRouter(DirectJNgineServlet.java:164)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.init(DirectJNgineServlet.java:155)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5033)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5317)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.getGsonBuilderConfiguratorClass(DirectJNgineServlet.java:353)
... 16 more
2013-3-28 17:59:39 org.apache.catalina.core.StandardContext loadOnStartup
严重: Servlet /DirectJS threw load() exception
java.lang.ClassNotFoundException: com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.getGsonBuilderConfiguratorClass(DirectJNgineServlet.java:353)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createGlobalConfiguration(DirectJNgineServlet.java:324)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createDirectJNgineRouter(DirectJNgineServlet.java:164)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.init(DirectJNgineServlet.java:155)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5033)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5317)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

原因是里面没有这个类
com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting
这个错误在web.xml里面,把它们删了就行了:


代码如下:

<init-param>
<param-name>registryConfiguratorClass</param-name>
<param-value>com.softwarementors.extjs.djn.test.servlet.config.RegistryConfiguratorForTesting</param-value> </init-param>
<init-param>
<param-name>gsonBuilderConfiguratorClass</param-name>
<param-value>com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting</param-value></init-param>

大概就这三个,我的情况就是这样。
(MLGBD,我在百度发博文被封杀了,已经是第四篇了,我再也不再百度写博客了,R百度)
给我的样例URL吧:
http://www.kuaipan.cn/file/id_22384145481082698.htm

(0)

相关推荐

  • ExtJS下 Ext.Direct加载和提交过程排错小结

    偶泪滴嘎嘎,终于,终于完成了一部分ExtJS. (基础夯实一点,会有好处的,排错的时候就体现出来了) 下面就Ext.Direct做一些排错笔记: 错误一: 复制代码 代码如下: 严重: StandardWrapper.Throwable java.lang.ArrayIndexOutOfBoundsException: 1 at com.softwarementors.extjs.djn.api.RegisteredStandardMethod.isValidFormHandlingMethod

  • windows服务器下IIS6/7下PHP 无法加载 php_curl.dll 等动态链接库

    问题: PHP 在 IIS6 或 IIS7 中无法加载 php_curl.dll 动态链接库. 解决方法: 在PHP手册中有相关说明:php_curl.dll:CURL,客户端 URL 库函数库:需要:libeay32.dll,ssleay32.dll(已附带) 所以只要将 libeay32.dll,ssleay32.dll 这两个库复制到 %WINDOWS% 目录下即可. PS:网上有很多人说将以上两个库复制到 %SYSTEM32%,而这完全不起作用,文章只会COPY,又不经考证,简直就是误人

  • AngularJS基于ngInfiniteScroll实现下拉滚动加载的方法

    本文实例讲述了AngularJS基于ngInfiniteScroll实现下拉滚动加载的方法.分享给大家供大家参考,具体如下: 1.分页加载数据的基础上,如何通过滚动加载,实现分页加载数据的效果,github上,针对AngularJS,有一款不错的插件,地址为:https://github.com/sroze/ngInfiniteScroll 2.下面来看官方给出的文档 (1)使用样例: <ANY infinite-scroll='{expression}' [infinite-scroll-di

  • 浏览器环境下JavaScript脚本加载与执行探析之defer与async特性

    defer和async特性相信是很多JavaScript开发者"熟悉而又不熟悉"的两个特性,从字面上来看,二者的功能很好理解,分别是"延迟脚本"和"异步脚本"的作用.然而,以defer为例,一些细节问题可能开发者却并不一定熟悉,比如:有了defer特性的脚本会延迟到什么时候执行:内部脚本和外部脚本是不是都能够支持defer:defer后的脚本除了会延迟执行之外,还有哪些特殊的地方等等.本文结合已有的一些文章以及MDN文档中对两个特性的阐述,对de

  • pc加载更多功能和移动端下拉刷新加载数据

    感觉一个人玩lol也没意思了,玩会手机,看到这个下拉刷新功能就写了这个demo! 这个demo写的比较随意,咱不能当做插件使用,基本思想是没问题的,要用就自己封装吧! 直接上代码分析下吧! 布局: <ul class="show-area" style="min-height:100px;"></ul> <button class='page-btn-nick' >加载更多</button> 就2行,只为实现功能,足矣

  • ListView实现下拉刷新加载更多的实例代码(直接拿来用)

    ListView Api bixu 好好看看 mNewsAdapter.notifyDataSetChanged();//刷新ListView 自定义的RefreashListView package com.itguang.dell_pc.myapplication.view; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import and

  • jQuery实现模仿微博下拉滚动条加载数据效果

    本文实例讲述了jQuery实现模仿微博下拉滚动条加载数据效果.分享给大家供大家参考,具体如下: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>滚动条距离底部</title> <script src="jquery-1.6.2.min.js" type="text/javascript&

  • 浏览器环境下JavaScript脚本加载与执行探析之动态脚本与Ajax脚本注入

    在<浏览器环境下JavaScript脚本加载与执行探析之defer与async特性>中,我们研究了延迟脚本(defer)和异步脚本(async)的执行时机.浏览器支持情况.浏览器bug以及其他的细节问题.而除了defer和async特性,动态脚本和Ajax脚本注入也是两种常用的创建无阻塞脚本的方法.总的来看,这两种方法都能达到脚本加载不影响页面解析和渲染的作用,但是在不同的浏览器中,这两种技术所创建的脚本的执行时机还是有一定差异,今天我们再来探讨一下通过动态脚本技术和Ajax注入的脚本在这些方

  • Vue实现下拉滚动加载数据的示例

    目录 第一步:安装 第二步:引用 第三步:使用 Web项目经常会用到下拉滚动加载数据的功能,今天就来种草 Vue-infinite-loading这个插件,讲解一下使用方法! 第一步:安装 npm install vue-infinite-loading --save 第二步:引用 import InfiniteLoading from 'vue-infinite-loading'; export default { components: { InfiniteLoading } } 第三步:使

  • python从内存地址上加载python对象过程详解

    这篇文章主要介绍了python从内存地址上加载pythn对象过程详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下 在python中我们可以通过id函数来获取某个python对象的内存地址,或者可以通过调用对象的__repr__魔术函数来获取对象的详细信息 def tt(): print(111) print(tt.__repr__()) print(id(tt)) 但是不知大家是否想过,其实这个内存地址可以直接加载python对象的.有两种方

随机推荐