2

I am using GeneXus Evolution 2 for my project. While I was developing, I got the following error:

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

I don't know what it is and how to solve this. Any ideas?

Pablo Sarturi
  • 161
  • 1
  • 10
Nyi Ma Lay Win Lae Aye
  • 6,250
  • 2
  • 13
  • 10

4 Answers4

2

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

Stefan Walter
  • 602
  • 3
  • 10
1

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.

Stefan van den Akker
  • 6,661
  • 7
  • 48
  • 63
guindous
  • 41
  • 4
0

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.

Pablo Sarturi
  • 161
  • 1
  • 10
0

It may also be that the method you are calling does not exist, or exists with different parameters, either by quantity or by type.

JuanManf
  • 1
  • 3