# Not able to apply plugin because cast exception

**URL:** <https://discuss.gradle.org/t/not-able-to-apply-plugin-because-cast-exception/32233>\
**Category:** Help/Discuss\
**Created:** [June 27, 2019, 4:54pm UTC](https://discuss.gradle.org/t/not-able-to-apply-plugin-because-cast-exception/32233 "2019-06-27T16:54:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andmey](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@andmey](https://discuss.gradle.org/u/andmey)\
**Post date:** [June 27, 2019, 4:54pm UTC](https://discuss.gradle.org/t/not-able-to-apply-plugin-because-cast-exception/32233/1 "2019-06-27T16:54:57Z")

</div>

Hi,

I raised gradle version from 4.2.1 to 5.4.1 and now, crucial plugins are not applied but failing hard.

I configured this in the build.gradle:

apply plugin: “at.comm\_unity.gradle.plugins.jpamodelgen”  
apply plugin: ‘net.ltgt.apt-eclipse’.

this is what happenend:

> Failed to apply plugin [class ‘net.ltgt.gradle.apt.AptPlugin’]  
> org.gradle.api.internal.tasks.DefaultTaskInputFilePropertyRegistration cannot be cast to org.gradle.api.tasks.TaskInputs

and

> Could not create task ‘:commons:compileJpaModelgenJava’.  
> org.gradle.api.internal.tasks.DefaultTaskInputFilePropertyRegistration cannot be cast to org.gradle.api.tasks.TaskInputs.

If anyone could help me out…I know next to nothing regarding gradle.

thanks in advance
