Jahia in English > Jahia error when...

0 (0 Good)
0 (0 Bad)

Jahia error when posting custom form

by  tiphukonha@gmail.com »  2018/10/05 09:44

I've created a form with the Jahia Form Builder, but I get this error when posting website my form in Live Mode:

Error: org.jahia.services.usermanager.JahiaUserManagerService.lookupUser(Ljava/lang/String;)Lorg/jahia/services/usermanager/JahiaUser; java.lang.NoSuchMethodError: org.jahia.services.usermanager.JahiaUserManagerService.lookupUser(Ljava/lang/String;)Lorg/jahia/services/usermanager/JahiaUser;

I'm using Digital Factory Community 7.1 and module Jahia Form Builder 2.0.5 Thanks for your help.

  • Jahia error when posting custom form
    2018/10/05 09:45

    tiphukonha@gmail.com <p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; color: rgb(36, 39, 41);">I&#39;ve created a form with the Jahia Form Builder, but I get this error when posting <a href="https://tinomail.com/dich-vu-thiet-ke-website/">website</a>&nbsp;my form in Live Mode:</p> <blockquote> <p>Error: org.jahia.services.usermanager.JahiaUserManagerService.lookupUser(Ljava/lang/String;)Lorg/jahia/services/usermanager/JahiaUser; java.lang.NoSuchMethodError: org.jahia.services.usermanager.JahiaUserManagerService.lookupUser(Ljava/lang/String;)Lorg/jahia/services/usermanager/JahiaUser;</p> </blockquote> <p>I&#39;m using Digital Factory Community 7.1 and module Jahia Form Builder 2.0.5 Thanks for your help.</p>

  • Number of messages  1
    Registration date Oct 5, 2018
    0 (0 Good)
    0 (0 Bad)

    Re: Jahia error when posting custom form

    by  nehasinha@dooinfo.com »  2019/08/12 02:23

    There are a lot of different flavors of NoSuchMethodErrors, but they all boil down to the fact that the compile time classpath differs from the runtime classpath.

    The following steps will help to pinpoint the problem:

    Step 1: Find Out Where the Class Comes From

    First, we need to find out where the class containing the method in question comes from. We find this information in the error message of the NoSuchMethodError:

    Exception in thread "main" java.lang.NoSuchMethodError: 
      io.reflectoring.nosuchmethod.Service.sayHello(Ljava/lang/String;)Ljava/lang/String;
    

    Now, we can search the web or within the IDE to find out which JAR file contains this class. In the case above, we can see that it’s the Service class from our own codebase and not a class from another library.

    If we have trouble finding the JAR file of the class, we can add the Java option -verbose:class when running our application. This will cause Java to print out all classes and the JARs they have been loaded from:

    [Loaded io.reflectoring.nosuchmethod.Service from file:
      /C:/daten/workspaces/code-examples2/patterns/build/libs/java-1.0.jar]
    
    

    Step 2: Find Out Who Calls the Class

    Next, we want find out where the method is being called. This information is available in the first element of the stack trace:

    Exception in thread "main" java.lang.NoSuchMethodError: 
      io.reflectoring.nosuchmethod.Service.sayHello(Ljava/lang/String;)Ljava/lang/String;
      at io.reflectoring.nosuchmethod.ProvokeNoSuchMethodError.main(ProvokeNoSuchMethodError.java:7)
    

    Here, the class ProvokeNoSuchMethodError tries to call a method that does not exist at runtime. We should now find out which library this file belongs to.

    Step 3: Check the Versions

    Now that we know where the NoSuchMethodError is provoked and what method is missing, we can act.

    We should now list all of our project dependencies.

    In Gradle, we can call:

    ./gradlew dependencies > dependencies.txt
    

    If we’re using Maven, a similiar result can be achieved with:

    mvn dependency:list > dependencies.txt`
    

    In this file, we can search for the libraries that contain the class with the missing method and the class that tries to call this method.

    Usually we’ll find an output like this somewhere:

    \--- org.springframework.retry:spring-retry:1.2.2.RELEASE
    |     \--- org.springframework:spring-core:4.3.13.RELEASE -> 5.0.8.RELEASE
    

    The above means that the spring-retry library depends on spring-core in version 4.3.13, but some other library also depends on spring-core in version 5.0.8 and overrules the dependency version.

    We can now search our dependencies.txt file for 5.0.8.RELEASE to find out which library introduces the dependency to this version.

    Finally, we need to decide which of the two versions we actually need to satisfy both dependencies. Usually, this is the newer version since most frameworks are backwards compatible to some point. However, it can be the other way around or we might even not be able to resolve the conflict at all.

      (nehasinha@dooinfo.com)

    Number of messages  2
    Registration date
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page