[jira] [Commented] (ARIES-1674) Multiple inharitance levels with generics cause ClassCastException when JPA is enabled

2017-02-23 Thread Christian Schneider (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIES-1674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15880376#comment-15880376
 ] 

Christian Schneider commented on ARIES-1674:


Ok .. got it now.

I am not a specialist in generics but I assume that in the compiled code the 
actual class ReportDAO is lost. At the level of AbstractPersistenceManager we 
only know that DAO extends AbstractJpaDao and that is why Aries JPA injects the 
object as this type. I have no idea how to fix that.


> Multiple inharitance levels with generics cause ClassCastException when JPA 
> is enabled
> --
>
> Key: ARIES-1674
> URL: https://issues.apache.org/jira/browse/ARIES-1674
> 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
>
> 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:
> https://github.com/fwassmer/inheritance



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIES-1674) Multiple inharitance levels with generics cause ClassCastException when JPA is enabled

2017-02-23 Thread Felix Wassmer (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIES-1674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15880313#comment-15880313
 ] 

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:

{noformat}
2017-02-23T12:52:03,238 | ERROR | nsole user karaf | 56  - 
org.apache.karaf.shell.core- 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(ReportPersistenceManagerImpl.java:16)
 [144:persistence:1.0.0.SNAPSHOT]
at Proxy624ce083_da0e_44bb_a2b1_7b85440ec359.getAccountReports(Unknown 
Source) [?:?]
at org.broken.command.BasicCommand.execute(BasicCommand.java:21) 
[109:command:1.0.0.SNAPSHOT]
at 
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:83)
 [56:org.apache.karaf.shell.core:4.0.8]
[...]
{noformat}

> Multiple inharitance levels with generics cause ClassCastException when JPA 
> is enabled
> --
>
> Key: ARIES-1674
> URL: https://issues.apache.org/jira/browse/ARIES-1674
> 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:
> https://github.com/fwassmer/inheritance



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIES-1674) Multiple inharitance levels with generics cause ClassCastException when JPA is enabled

2017-02-23 Thread Christian Schneider (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIES-1674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15880235#comment-15880235
 ] 

Christian Schneider commented on ARIES-1674:


I checked the example and I am not sure if this is really an error. What you 
see is the fact that aries jpa uses an Interceptor to provide the preCall and 
postCall behaviour.
If an interceptor is used on a bean then blueprint will create a proxy for the 
bean and when injecting the bean into other beans in fact the proxy is injected.

The example only shows that a proxy is used. I do not see a ClassCastException. 
Can you show how to replicate this?

> Multiple inharitance levels with generics cause ClassCastException when JPA 
> is enabled
> --
>
> Key: ARIES-1674
> URL: https://issues.apache.org/jira/browse/ARIES-1674
> 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:
> https://github.com/fwassmer/inheritance



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIES-1674) Multiple inharitance levels with generics cause ClassCastException when JPA is enabled

2017-02-21 Thread Felix Wassmer (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIES-1674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15875912#comment-15875912
 ] 

Felix Wassmer commented on ARIES-1674:
--

I didn't try to compile that example on linux, so there was some relative path 
issue,
which is now fixed. (successfully compiles on linux)

So please try again.

If it somehow still doesn't work for you, I can paste the stacktraces.

> Multiple inharitance levels with generics cause ClassCastException when JPA 
> is enabled
> --
>
> Key: ARIES-1674
> URL: https://issues.apache.org/jira/browse/ARIES-1674
> 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:
> https://github.com/fwassmer/inheritance



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIES-1674) Multiple inharitance levels with generics cause ClassCastException when JPA is enabled

2017-02-21 Thread Christian Schneider (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIES-1674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15875862#comment-15875862
 ] 

Christian Schneider commented on ARIES-1674:


I was not able to build your project. I got this exception:
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install) 
on project features: Failed to install artifact 
org.broken:features:xml:datasource:1.0-SNAPSHOT: 
/home/cschneider/checkout/inheritance/features/src/main/java/../resources/datasource-h2.xml
 (No such file or directory) -> [Help 1]

Can you give some more information about the ClassCastException you see?

> Multiple inharitance levels with generics cause ClassCastException when JPA 
> is enabled
> --
>
> Key: ARIES-1674
> URL: https://issues.apache.org/jira/browse/ARIES-1674
> 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:
> https://github.com/fwassmer/inheritance



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIES-1674) Multiple inharitance levels with generics cause ClassCastException when JPA is enabled

2017-01-27 Thread Christian Schneider (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIES-1674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15842501#comment-15842501
 ] 

Christian Schneider commented on ARIES-1674:


It might be jpa or blueprint related. Will look into it.

> Multiple inharitance levels with generics cause ClassCastException when JPA 
> is enabled
> --
>
> Key: ARIES-1674
> URL: https://issues.apache.org/jira/browse/ARIES-1674
> 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:
> https://github.com/fwassmer/inheritance



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)