OpenJPA
  1. OpenJPA
  2. OPENJPA-2240

JVMVRFY012 when using openjpa together with hyperjaxb3

    Details

      Description

      We are facing a problem with class enhancing generated by hyperjaxb3.

      "Caused by: java.lang.VerifyError: JVMVRFY012 stack shape inconsistent; class=foo/Bar, metoda=pcgetDataTimeItem()Ljava/util/Date;, pc=7"

      The problem occurs on every usage of non JPA compatible type like XMLGregorianCalendar.
      For those types, the hyperjaxb3 plugin creates a kind of "proxy" setter/getter that uses JPA capable type.

      Example of such proxy getter/setter:
      <code>
      @Basic
      @Column(name = "DATATIMEITEM")
      @Temporal(TemporalType.TIMESTAMP)
      public Date getDataTimeItem()

      { return XmlAdapterUtils.unmarshall(XMLGregorianCalendarAsDateTime.class, this.getDataTime()); }

      </code>

      then the XmlAdapterUtils.unmarshall looks like:

      <code>
      public static <ValueType, BoundType> BoundType unmarshall(
      Class<? extends XmlAdapter<ValueType, BoundType>> xmlAdapterClass,
      ValueType v) {
      try

      { final XmlAdapter<ValueType, BoundType> xmlAdapter = getXmlAdapter(xmlAdapterClass); return xmlAdapter.unmarshal(v); }

      catch (Exception ex)

      { throw new RuntimeException(ex); }

      }
      </code>

      I have found that the problem occurs only because of the type of XmlAdapterUtils.unmarshall method. The problem is that it's 1st type is a "Class". Changing the 1st type from Class type to any other like Object solves the problem but it is not a solution.

      I think the problem is somewhere in serp project as after the enhancment process of classes containing non JPA capable XSD types, each call of that class generates the JVMVRFY012 exception- even during junit tests.

      Please note, that this bug is a blocker for my project.

      1. mvn.out
        2 kB
        Kevin Sutter
      2. OpenJpa2240BugTestProject_v1.1.tar.gz
        4 kB
        Piotr Klimczak
      3. serp-1.14.1.jar
        202 kB
        Kevin Sutter
      4. serp-1.14.1.pom
        4 kB
        Kevin Sutter

        Issue Links

          Activity

          Piotr Klimczak created issue -
          Piotr Klimczak made changes -
          Field Original Value New Value
          Description We are facing a problem with class enhancing generated by hyperjaxb3.

          "Caused by: java.lang.VerifyError: JVMVRFY012 stack shape inconsistent; class=foo/Bar, metoda=pcgetDataTimeItem()Ljava/util/Date;, pc=7"

          The problem occurs on every usage of non JPA compatible type like XMLGregorianCalendar.
          For those types, the hyperjaxb3 plugin creates a kind of "proxy" setter/getter that uses JPA capable type.

          Example of such proxy getter/setter:
          <code>
                  @Basic
                  @Column(name = "DATATIMEITEM")
                  @Temporal(TemporalType.TIMESTAMP)
                  public Date getDataTimeItem() {
                      return XmlAdapterUtils.unmarshall(XMLGregorianCalendarAsDateTime.class, this.getDataTime());
                  }
          </code>

          then the XmlAdapterUtils.unmarshall looks like:

          <code>
          public static <ValueType, BoundType> BoundType unmarshall(
          Class<? extends XmlAdapter<ValueType, BoundType>> xmlAdapterClass,
          ValueType v) {
          try {
          final XmlAdapter<ValueType, BoundType> xmlAdapter = getXmlAdapter(xmlAdapterClass);
          return xmlAdapter.unmarshal(v);
          } catch (Exception ex) {
          throw new RuntimeException(ex);
          }
          }
          </code>

          I have found that the problem occurs only because of the type of XmlAdapterUtils.unmarshall method. The problem is that it's 1st type is a "Class". Changing the 1st type from Class type to any other like Object solves the problem but it is not a solution.

          I think the problem is somewhere in serp project as after the enhancment process of classes containing non JPA capable XSD types, each call of that class generates the JVMVRFY012 exception- even during junit tests.
          We are facing a problem with class enhancing generated by hyperjaxb3.

          "Caused by: java.lang.VerifyError: JVMVRFY012 stack shape inconsistent; class=foo/Bar, metoda=pcgetDataTimeItem()Ljava/util/Date;, pc=7"

          The problem occurs on every usage of non JPA compatible type like XMLGregorianCalendar.
          For those types, the hyperjaxb3 plugin creates a kind of "proxy" setter/getter that uses JPA capable type.

          Example of such proxy getter/setter:
          <code>
                  @Basic
                  @Column(name = "DATATIMEITEM")
                  @Temporal(TemporalType.TIMESTAMP)
                  public Date getDataTimeItem() {
                      return XmlAdapterUtils.unmarshall(XMLGregorianCalendarAsDateTime.class, this.getDataTime());
                  }
          </code>

          then the XmlAdapterUtils.unmarshall looks like:

          <code>
          public static <ValueType, BoundType> BoundType unmarshall(
          Class<? extends XmlAdapter<ValueType, BoundType>> xmlAdapterClass,
          ValueType v) {
          try {
          final XmlAdapter<ValueType, BoundType> xmlAdapter = getXmlAdapter(xmlAdapterClass);
          return xmlAdapter.unmarshal(v);
          } catch (Exception ex) {
          throw new RuntimeException(ex);
          }
          }
          </code>

          I have found that the problem occurs only because of the type of XmlAdapterUtils.unmarshall method. The problem is that it's 1st type is a "Class". Changing the 1st type from Class type to any other like Object solves the problem but it is not a solution.

          I think the problem is somewhere in serp project as after the enhancment process of classes containing non JPA capable XSD types, each call of that class generates the JVMVRFY012 exception- even during junit tests.

          Please note, that this bug is a blocker for my project.
          Priority Major [ 3 ] Critical [ 2 ]
          Piotr Klimczak made changes -
          Attachment OpenJpa2240BugTestProject.tar.bz2 [ 12541038 ]
          Kevin Sutter made changes -
          Attachment mvn.out [ 12542932 ]
          Piotr Klimczak made changes -
          Attachment OpenJpa2240BugTestProject.tar.bz2 [ 12541038 ]
          Piotr Klimczak made changes -
          Attachment OpenJpa2240BugTestProject_v1.1.tar.gz [ 12543056 ]
          Kevin Sutter made changes -
          Attachment serp-1.14.1.jar [ 12543430 ]
          Attachment serp-1.14.1.pom [ 12543431 ]
          Kevin Sutter made changes -
          Assignee Kevin Sutter [ kwsutter ]
          Fix Version/s 2.3.0 [ 12319463 ]
          Affects Version/s 2.3.0 [ 12319463 ]
          Affects Version/s 2.2.1 [ 12319943 ]
          Kevin Sutter made changes -
          Link This issue is related to OPENJPA-2122 [ OPENJPA-2122 ]
          Albert Lee made changes -
          Fix Version/s 2.2.2 [ 12323356 ]
          Albert Lee made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Albert Lee made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Kevin Sutter
              Reporter:
              Piotr Klimczak
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development