欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2022-06-17 17:02:39
偶泪滴嘎嘎,终于,终于完成了一部分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吧: