aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Wassmer (JIRA)" <>
Subject [jira] [Commented] (ARIES-1674) Multiple inharitance levels with generics cause ClassCastException when JPA is enabled
Date Thu, 23 Feb 2017 12:00:50 GMT


Felix Wassmer commented on ARIES-1674:

The example is now updated to work with karaf 4.0.8  and it's dependencies.
To reproduce the ClassCastException, you need to install the feature "buggy"
and then execute the shell command "break:me" (as described in the readme),
which calls the dao and leads to the Exception:

2017-02-23T12:52:03,238 | ERROR | nsole user karaf | 56  -   
- 4.0.8      | ShellUtil                        | Exception caught while executing command
java.lang.ClassCastException: org.broken.persistence.dao.$AbstractJpaDao2014372852 cannot
be cast to org.broken.persistence.dao.ReportDao
	at org.broken.persistence.ReportPersistenceManagerImpl.getAccountReports(
	at Proxy624ce083_da0e_44bb_a2b1_7b85440ec359.getAccountReports(Unknown Source) [?:?]
	at org.broken.command.BasicCommand.execute( [109:command:1.0.0.SNAPSHOT]

> Multiple inharitance levels with generics cause ClassCastException when JPA is enabled
> --------------------------------------------------------------------------------------
>                 Key: ARIES-1674
>                 URL:
>             Project: Aries
>          Issue Type: Bug
>          Components: JPA
>    Affects Versions: jpa-2.5.0
>         Environment: Win 7 x64, JDK 1.8.0_73, Karaf 4.0.4
>            Reporter: Felix Wassmer
>            Assignee: Christian Schneider
>             Fix For: jpa-2.6.0
> I'm using inheritance with generics over multiple levels.
> Injecting properties to those beans works fine, but on access of a property of the lowest
class, there is a ClassCastException thrown.
> I could narrow it down to enabling JPA in the blueprint causing the issue:
> When disabling JPA, the proper bean class is resolved,
> enabled the type resolving stopped at the parent abstract class of the expected class,
thus throwing a ClassCastException.
> Example project to reproduce this issue:

This message was sent by Atlassian JIRA

View raw message