extended classes from jar does not work












0















I've a project in which xmlbeans 2.6.0 jars are referenced and are added to the classpath. I create a class similar to the below:



import org.apache.xmlbeans.SchemaType;
import org.apache.xmlbeans.impl.values.XmlComplexContentImpl;
import org.apache.xmlbeans.impl.values.XmlObjectBase;

public class Test3 extends XmlComplexContentImpl {

public Test3(SchemaType type) {
super(type);
}

public void hello() {

// The below method is present in XmlObjectBase which is extended by XmlComplexContentImpl
// XmlObjectBase and XmlComplexContentImpl are part of jar
generatedSetterHelperImpl(null, null, 0, (short)2);

}

}


And when I create an instance of Test3 and call hello() method, an error NoSuchMethodError is thrown. It basically does not lookup the extended class for the method instead searches for the method in Test3.



java.lang.NoSuchMethodError: com.voxify.vui.action.Test3.generatedSetterHelperImpl(Lorg/apache/xmlbeans/XmlObject;Ljavax/xml/namespace/QName;IS)Lorg/apache/xmlbeans/XmlObject;









share|improve this question





























    0















    I've a project in which xmlbeans 2.6.0 jars are referenced and are added to the classpath. I create a class similar to the below:



    import org.apache.xmlbeans.SchemaType;
    import org.apache.xmlbeans.impl.values.XmlComplexContentImpl;
    import org.apache.xmlbeans.impl.values.XmlObjectBase;

    public class Test3 extends XmlComplexContentImpl {

    public Test3(SchemaType type) {
    super(type);
    }

    public void hello() {

    // The below method is present in XmlObjectBase which is extended by XmlComplexContentImpl
    // XmlObjectBase and XmlComplexContentImpl are part of jar
    generatedSetterHelperImpl(null, null, 0, (short)2);

    }

    }


    And when I create an instance of Test3 and call hello() method, an error NoSuchMethodError is thrown. It basically does not lookup the extended class for the method instead searches for the method in Test3.



    java.lang.NoSuchMethodError: com.voxify.vui.action.Test3.generatedSetterHelperImpl(Lorg/apache/xmlbeans/XmlObject;Ljavax/xml/namespace/QName;IS)Lorg/apache/xmlbeans/XmlObject;









    share|improve this question



























      0












      0








      0








      I've a project in which xmlbeans 2.6.0 jars are referenced and are added to the classpath. I create a class similar to the below:



      import org.apache.xmlbeans.SchemaType;
      import org.apache.xmlbeans.impl.values.XmlComplexContentImpl;
      import org.apache.xmlbeans.impl.values.XmlObjectBase;

      public class Test3 extends XmlComplexContentImpl {

      public Test3(SchemaType type) {
      super(type);
      }

      public void hello() {

      // The below method is present in XmlObjectBase which is extended by XmlComplexContentImpl
      // XmlObjectBase and XmlComplexContentImpl are part of jar
      generatedSetterHelperImpl(null, null, 0, (short)2);

      }

      }


      And when I create an instance of Test3 and call hello() method, an error NoSuchMethodError is thrown. It basically does not lookup the extended class for the method instead searches for the method in Test3.



      java.lang.NoSuchMethodError: com.voxify.vui.action.Test3.generatedSetterHelperImpl(Lorg/apache/xmlbeans/XmlObject;Ljavax/xml/namespace/QName;IS)Lorg/apache/xmlbeans/XmlObject;









      share|improve this question
















      I've a project in which xmlbeans 2.6.0 jars are referenced and are added to the classpath. I create a class similar to the below:



      import org.apache.xmlbeans.SchemaType;
      import org.apache.xmlbeans.impl.values.XmlComplexContentImpl;
      import org.apache.xmlbeans.impl.values.XmlObjectBase;

      public class Test3 extends XmlComplexContentImpl {

      public Test3(SchemaType type) {
      super(type);
      }

      public void hello() {

      // The below method is present in XmlObjectBase which is extended by XmlComplexContentImpl
      // XmlObjectBase and XmlComplexContentImpl are part of jar
      generatedSetterHelperImpl(null, null, 0, (short)2);

      }

      }


      And when I create an instance of Test3 and call hello() method, an error NoSuchMethodError is thrown. It basically does not lookup the extended class for the method instead searches for the method in Test3.



      java.lang.NoSuchMethodError: com.voxify.vui.action.Test3.generatedSetterHelperImpl(Lorg/apache/xmlbeans/XmlObject;Ljavax/xml/namespace/QName;IS)Lorg/apache/xmlbeans/XmlObject;






      java jar xmlbeans






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 1 '15 at 4:22









      candlejack

      73221439




      73221439










      asked Apr 1 '15 at 4:17









      alloutallout

      235




      235
























          2 Answers
          2






          active

          oldest

          votes


















          0














          These errors generally arise from jar version conflict. You may have different jar version at compile time and run time.One way to quickly check that is to remove the jar where you think it is getting referred to. That way you might find the different version of the same jar in classpath which is actually getting loaded.






          share|improve this answer
























          • Thanks! There are dependent projects for this project. And in the them, xmlbeans jars are present but with the same version

            – allout
            Apr 1 '15 at 6:51



















          0














          In my case I had two version of the same jar, xmlbeans-2.6.0 and xmlbeans-2.3.0 in my application path. Once I remove the oldest, the program runs.






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29382772%2fextended-classes-from-jar-does-not-work%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            These errors generally arise from jar version conflict. You may have different jar version at compile time and run time.One way to quickly check that is to remove the jar where you think it is getting referred to. That way you might find the different version of the same jar in classpath which is actually getting loaded.






            share|improve this answer
























            • Thanks! There are dependent projects for this project. And in the them, xmlbeans jars are present but with the same version

              – allout
              Apr 1 '15 at 6:51
















            0














            These errors generally arise from jar version conflict. You may have different jar version at compile time and run time.One way to quickly check that is to remove the jar where you think it is getting referred to. That way you might find the different version of the same jar in classpath which is actually getting loaded.






            share|improve this answer
























            • Thanks! There are dependent projects for this project. And in the them, xmlbeans jars are present but with the same version

              – allout
              Apr 1 '15 at 6:51














            0












            0








            0







            These errors generally arise from jar version conflict. You may have different jar version at compile time and run time.One way to quickly check that is to remove the jar where you think it is getting referred to. That way you might find the different version of the same jar in classpath which is actually getting loaded.






            share|improve this answer













            These errors generally arise from jar version conflict. You may have different jar version at compile time and run time.One way to quickly check that is to remove the jar where you think it is getting referred to. That way you might find the different version of the same jar in classpath which is actually getting loaded.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Apr 1 '15 at 4:32









            YantraguruYantraguru

            9012917




            9012917













            • Thanks! There are dependent projects for this project. And in the them, xmlbeans jars are present but with the same version

              – allout
              Apr 1 '15 at 6:51



















            • Thanks! There are dependent projects for this project. And in the them, xmlbeans jars are present but with the same version

              – allout
              Apr 1 '15 at 6:51

















            Thanks! There are dependent projects for this project. And in the them, xmlbeans jars are present but with the same version

            – allout
            Apr 1 '15 at 6:51





            Thanks! There are dependent projects for this project. And in the them, xmlbeans jars are present but with the same version

            – allout
            Apr 1 '15 at 6:51













            0














            In my case I had two version of the same jar, xmlbeans-2.6.0 and xmlbeans-2.3.0 in my application path. Once I remove the oldest, the program runs.






            share|improve this answer




























              0














              In my case I had two version of the same jar, xmlbeans-2.6.0 and xmlbeans-2.3.0 in my application path. Once I remove the oldest, the program runs.






              share|improve this answer


























                0












                0








                0







                In my case I had two version of the same jar, xmlbeans-2.6.0 and xmlbeans-2.3.0 in my application path. Once I remove the oldest, the program runs.






                share|improve this answer













                In my case I had two version of the same jar, xmlbeans-2.6.0 and xmlbeans-2.3.0 in my application path. Once I remove the oldest, the program runs.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 21 '18 at 22:38









                JippyJoeJippyJoe

                1




                1






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29382772%2fextended-classes-from-jar-does-not-work%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                    ComboBox Display Member on multiple fields

                    Is it possible to collect Nectar points via Trainline?