简体   繁体   中英

java.lang.NoSuchMethodError GeneXus)

I am using GeneXus Evolution 2 for my project. 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;

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. 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.

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. There will be a gxclassR.jar file that should match with the version of your Genexus installation. To test if you have the right one:

  1. Assure that there is not other similar lib, like gxclassD.jar , in the same folder. 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. Copy to the WEB-INF/lib folder , rename it to gxclassR.jar replacing actual gxclassR.zip file.
  3. Restart tomcat application to assure that the new gxclassR.jar is being used.

If your object keep failing, then the problem may be the .class associated to your genexus object. Maybe isn't correctly generated/compiled. So, to fix this:

  1. Force the building of the genexus object. For this, try the Build with this only option associated to the object. Activate the Force option for this action, accessing to "Tools -> Options -> Build -> Build with this Only"
  2. Once forced the build, go once again to the environment target folder and look for the .class file/s associated to the object. 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.

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). If they don't match, replace the one in your web application with the one in your KB. 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. That should synchronize all the files to the proper version.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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