简体   繁体   English

java.lang.NoSuchMethodError GeneXus)

[英]java.lang.NoSuchMethodError GeneXus)

I am using GeneXus Evolution 2 for my project. 我正在为我的项目使用GeneXus Evolution 2。 During I am developing, The errors that is showed in following image appeared. 在我开发期间,出现了下图中显示的错误。 I don't know what it is and how I solve this errors. 我不知道这是什么以及如何解决此错误。 I am out of idea now. 我现在不知道了。 Would you give any advice to me? 你能给我什么建议吗? Thank you very much. 非常感谢你。

HTTPステータス 500 -java.lang.NoSuchMethodError:com.genexus.ModelContext.server2webcli(Ljava/util/Date;)Ljava/util/Date; HTTP 500个-java.lang.NoSuchMethodError:com.genexus.ModelContext.server2webcli(Ljava / util / Date;)Ljava / util / Date;

A NoSuchMethodError usually indicates that a method (declaration) was there when you compiled the code, but the implementation is missing when you're running it. NoSuchMethodError通常指示您在编译代码时有一个方法(声明),但是在运行它时缺少实现。 In most cases, the reason for this is that you had one version of the respective library's JAR file on your class path when compiling, and another, incompatible one when running. 在大多数情况下,这样做的原因是,编译时在类路径上具有相应库的JAR文件的一个版本,而在运行时具有一个不兼容的版本。

A more detailed answer would require a more detailed question...;-) 更详细的答案将需要更详细的问题... ;-)

Supposing you're using Tomcat as servlet container, look at {Tomcat_Home}/webapps/MyApp/WEB-INF/lib , where MyApp is your app name. 假设您使用Tomcat作为servlet容器,请查看{Tomcat_Home}/webapps/MyApp/WEB-INF/lib ,其中MyApp是您的应用程序名称。 There will be a gxclassR.jar file that should match with the version of your Genexus installation. 将有一个gxclassR.jar文件,该文件应与您的Genexus安装版本匹配。 To test if you have the right one: 要测试您是否合适,请执行以下操作:

  1. Assure that there is not other similar lib, like gxclassD.jar , in the same folder. 确保在同一文件夹中没有其他类似的库,例如gxclassD.jar If there is, delete it. 如果有,请将其删除。
  2. Go to the environment target folder where you're working (from the Genexus DE Menu "Tools -> Explore Target Environment Directory") and look for the gxclassR.zip file. 转到您正在工作的环境目标文件夹(从Genexus DE菜单“工具->探索目标环境目录”),然后查找gxclassR.zip文件。 Copy to the WEB-INF/lib folder , rename it to gxclassR.jar replacing actual gxclassR.zip file. 复制到WEB-INF/lib folder ,将其重命名为gxclassR.jar替换实际的gxclassR.zip文件。
  3. Restart tomcat application to assure that the new gxclassR.jar is being used. 重新启动tomcat应用程序,以确保正在使用新的gxclassR.jar

If your object keep failing, then the problem may be the .class associated to your genexus object. 如果您的对象继续失败,则问题可能出在与您的Genexus对象相关联的.class Maybe isn't correctly generated/compiled. 也许未正确生成/编译。 So, to fix this: 因此,要解决此问题:

  1. Force the building of the genexus object. 强制建立Genexus对象。 For this, try the Build with this only option associated to the object. 为此,请尝试Build with this only与对象关联的“ Build with this only选项。 Activate the Force option for this action, accessing to "Tools -> Options -> Build -> Build with this Only" 激活“ Force选项以执行此操作,访问“工具->选项->构建->仅以此构建”
  2. Once forced the build, go once again to the environment target folder and look for the .class file/s associated to the object. 强制构建后,再次转到环境目标文件夹,然后查找与该对象关联的.class文件。 Usually the name of the file/s matches the name of the object. 通常,文件名与对象名匹配。 Look the modification date and confirm that is recently. 查看修改日期并确认是最近的日期。
  3. Copy this .class files to WEB-INF\\classes folder inside your webapp folder. 将此.class文件复制到webapp文件夹内的WEB-INF\\classes文件夹中。

I think this is good enough info to fix your problem. 我认为这足以解决您的问题。 If not, detail your error a little bit more. 如果没有,请详细说明您的错误。

Check the date and size of the file "gxclassR.zip" that is on your web folder inside your KB (Tools --> Explore Target Environment Directory), and compare it with the one used by your web application (folder WEB-INF/lib). 检查KB内Web文件夹中“ gxclassR.zip”文件的日期和大小(工具->浏览目标环境目录),并将其与Web应用程序使用的文件(文件夹WEB-INF / LIB)。 If they don't match, replace the one in your web application with the one in your KB. 如果它们不匹配,请用KB中的一个替换您的Web应用程序中的一个。 If you are unsure about it, and would rather GX handle it, delete all the .ver files in your web folder and force a build. 如果不确定并希望由GX处理,请删除Web文件夹中的所有.ver文件并强制进行构建。 That should synchronize all the files to the proper version. 那应该将所有文件同步到正确的版本。

也可能是您正在调用的方法不存在,或者存在数量不同或类型不同的参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM