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


Posted in Javascript onApril 02, 2013

偶泪滴嘎嘎,终于,终于完成了一部分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
Javascript 相关文章推荐
LazyForm jQuery plugin 定制您的CheckBox Radio和Select
Oct 24 Javascript
IE和firefox浏览器的event事件兼容性汇总
Dec 06 Javascript
javascript,jquery闭包概念分析
Jun 19 Javascript
jQuery弹出层后禁用底部滚动条(移动端关闭回到原位置)
Aug 29 Javascript
详解handlebars+require基本使用方法
Dec 21 Javascript
React Native之prop-types进行属性确认详解
Dec 19 Javascript
Vuejs 2.0 子组件访问/调用父组件的方法(示例代码)
Feb 08 Javascript
JS中获取 DOM 元素的绝对位置实例详解
Apr 23 Javascript
JavaScript偏函数与柯里化实例详解
Mar 27 Javascript
在vue项目中使用sass语法问题
Jul 18 Javascript
Vue组件间数据传递的方式(3种)
Jul 13 Javascript
Node.js利用Express实现用户注册登陆功能(推荐)
Oct 26 Javascript
ExtJS下书写动态生成的xml(兼容火狐)
Apr 02 #Javascript
UpdatePanel和Jquery冲突的解决方法
Apr 01 #Javascript
jQuery弹出层始终垂直居中相对于屏幕或当前窗口
Apr 01 #Javascript
js 获取(接收)地址栏参数值的方法
Apr 01 #Javascript
表格单元格交错着色实现思路及代码
Apr 01 #Javascript
javascript 禁用IE工具栏,导航栏等等实现代码
Apr 01 #Javascript
Js 时间函数getYear()的使用问题探讨
Apr 01 #Javascript
You might like
建立动态的WML站点(一)
2006/10/09 PHP
探讨PHP删除文件夹的三种方法
2013/06/09 PHP
codeigniter使用技巧批量插入数据实例方法分享
2013/12/31 PHP
解析PHP之提取多维数组指定列的方法
2017/01/03 PHP
JQuery实现自定义对话框的代码
2008/06/15 Javascript
不同浏览器对回车提交表单的处理办法
2010/02/13 Javascript
select标记美化--JS式插件、后期加载
2013/04/01 Javascript
jquery实现动态操作select选中
2015/02/11 Javascript
jQuery获取上传文件的名称的正则表达式
2015/05/21 Javascript
javascript实现网页中涉及的简易运动(改变宽高、透明度、位置)
2015/11/29 Javascript
javascript每日必学之条件分支
2016/02/17 Javascript
ichart.js绘制虚线、平均分虚线效果的实现代码
2016/05/05 Javascript
jquery Banner轮播选项卡
2016/12/26 Javascript
vue实现tab切换外加样式切换方法
2018/03/16 Javascript
jQuery实现获取选中复选框的值实例详解
2018/06/28 jQuery
一次微信小程序内地图的使用实战记录
2019/09/09 Javascript
Vuex的实战使用详解
2019/10/31 Javascript
详解微信小程序中var、let、const用法与区别
2020/01/11 Javascript
VUE前端从后台请求过来的数据进行转换数据结构操作
2020/11/11 Javascript
[48:35]2018DOTA2亚洲邀请赛 4.1 小组赛 A组加赛 TNC vs Optic
2018/04/03 DOTA
[47:10]完美世界DOTA2联赛PWL S3 LBZS vs Rebirth 第二场 12.16
2020/12/18 DOTA
python实现下载整个ftp目录的方法
2017/01/17 Python
Python装饰器用法实例总结
2018/02/07 Python
解决Python安装时报缺少DLL问题【两种解决方法】
2019/07/15 Python
Python发送邮件的实例代码讲解
2019/10/16 Python
sklearn+python:线性回归案例
2020/02/24 Python
python程序文件扩展名知识点详解
2020/02/27 Python
jupyternotebook 撤销删除的操作方式
2020/04/17 Python
浅谈Python 命令行参数argparse写入图片路径操作
2020/07/12 Python
使用CSS3滤镜的filter:blur属性制作毛玻璃模糊效果的方法
2016/07/08 HTML / CSS
建筑公司文秘岗位职责
2013/11/29 职场文书
试用期转正鉴定评语
2014/01/27 职场文书
开学寄语大全
2014/04/08 职场文书
小学开学典礼新闻稿
2015/07/17 职场文书
总经理2015中秋节致辞
2015/07/29 职场文书
2016党风廉政建设心得体会范文
2016/01/25 职场文书