Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When deployed an application containing Dozer, the java.lang.ClassCastException was thrown. /FISH-743 #4952

Closed
otukatigayim opened this issue Oct 15, 2020 · 7 comments
Assignees
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev Type: Bug Label issue as a bug defect

Comments

@otukatigayim
Copy link

Description


When deployed an application containing Dozer, the following Exception was thrown.

  Exception while visiting com/github/dozermapper/core/util/MappingOptions.class of size 764
java.lang.ClassCastException: org.glassfish.hk2.classmodel.reflect.impl.InterfaceModelImpl cannot be cast to org.glassfish.hk2.classmodel.reflect.impl.AnnotationTypeImpl
        at org.glassfish.hk2.classmodel.reflect.impl.ModelClassVisitor$ModelDefaultAnnotationVisitor.visit(ModelClassVisitor.java:420)
        at org.objectweb.asm.ClassReader.readElementValue(ClassReader.java:3045)
        at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1375)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:717)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:401)
        at org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:336)
        at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:165)
        at com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:127)
        at org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:321)
        at org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:44)
        at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:280)
        at org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Expected Outcome

No exceptions will be thrown.

Current Outcome

An exception was thrown.

Steps to reproduce (Only for bug reports)

  1. Build the following Appilication. mvn clean package
  2. bin/asadmin start-domain
  3. bin/asadmin deploy --contextroot=payara-dozer --name=payara-dozer --virtualservers=server payara-dozer.war
  4. View the server.log.

Environment

  • Payara Version: 5.2020.5
  • Edition: Full
  • JDK Version: 8
  • Operating System: Windows
  • Database: None
@borjapenman
Copy link

I am seeing the same issue without dozer with the Payara full version. It does not appear on 5 2020.4. Could be related to #4865 when H2K types are being discarded?

@AlanRoth
Copy link

AlanRoth commented Nov 6, 2020

Hi @otukatigayim I was able to reproduce this easily, I have raised an internal issue FISH-743.

@AlanRoth AlanRoth added the Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev label Nov 6, 2020
@AlanRoth AlanRoth self-assigned this Nov 6, 2020
@Slartibartfast27
Copy link

I also have tons of
java.lang.ClassCastException: class org.glassfish.hk2.classmodel.reflect.impl.InterfaceModelImpl cannot be cast to class org.glassfish.hk2.classmodel.reflect.impl.AnnotationTypeImpl
when deploying my application using docker image payara/server-full:5.2020.5-jdk11.

Can I safely ignore these exceptions or should I better go back to payara/server-full:5.2020.4-jdk11 and hope/wait for a fix in payara/server-full:5.2020.6-jdk11 ?

@carlbradwell17
Copy link

Same exceptions for me in Payara Micro 5.2020.5, where the deployed project uses Hibernate and MariaDB.

@AlanRoth AlanRoth changed the title When deployed an application containing Dozer, the java.lang.ClassCastException was thrown. When deployed an application containing Dozer, the java.lang.ClassCastException was thrown. /FISH-743 Nov 10, 2020
@fturizo fturizo added Type: Bug Label issue as a bug defect and removed reproducible labels Nov 12, 2020
@asgreflexx
Copy link

We are also having the same issue on payara enterprise 5.23.0 and JDK 11.

As @Slartibartfast27 mentioned, we are getting tons of ClassCastExceptions:

java.lang.ClassCastException: class org.glassfish.hk2.classmodel.reflect.impl.InterfaceModelImpl cannot be cast to class org.glassfish.hk2.classmodel.reflect.impl.AnnotationTypeImpl

@AlanRoth
Copy link

AlanRoth commented Dec 2, 2020

Hi @asgreflexx, if you have purchased Payara Enterprise, please feel free to raise a ticket to our Zendesk or ask your named contact to do it for you. We can provide workarounds and we can escalate this issue directly to the engineering team to expedite a solution.

Thank you,
Alan

@AlanRoth
Copy link

AlanRoth commented Dec 7, 2020

Hi All,

I will be closing this issue as the solution has been merged and will be included in the next Payara Community and Payara Enterprise releases in January time.

Thank you,
Alan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev Type: Bug Label issue as a bug defect
Projects
None yet
Development

No branches or pull requests

7 participants