亲宝软件园·资讯

展开

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

人气:0
偶泪滴嘎嘎,终于,终于完成了一部分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

加载全部内容

相关教程
猜你喜欢
用户评论