Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1427

Surefire-plugin throws NoClassDefFoundError with static initialiser

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.20
    • None
    • Maven Surefire Plugin
    • None
    • jdk 1.8
      maven 3.3.3

    Description

      when maven-surefire-plugin encounters static initialiser such as
      public class AxisDescription {
      org.apache.axiom.om.OMFactory omFactory = org.apache.axiom.om.OMAbstractFactory.getOMFactory();
      //surefire throws NoClassDefFoundError on OMAbstractFactory ?!?!?

      //but if i remove static initialiser to wait until runtime to load OMAbstractFactory it loads ok

      org.apache.axis2.description.AxisDescription:
      public void setDocumentation(String documentation) {
      org.apache.axiom.om.OMFactory omFactory = org.apache.axiom.om.OMAbstractFactory.getOMFactory();
      if (!"".equals(documentation))

      { this.documentation = omFactory.createOMText(documentation); }

      }

      why does surefire not find classes referenced by static initialiser?

      Attachments

        Activity

          People

            Unassigned Unassigned
            mgainty@hotmail.com Martin Gainty
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified