Getting "Cannot be resolved to a type" error on java files

Avatar

Avatar
Validate 1
Level 2
velmuruganv38
Level 2

Likes

7 likes

Total Posts

18 posts

Correct reply

1 solution
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 3
Give Back
View profile

Avatar
Validate 1
Level 2
velmuruganv38
Level 2

Likes

7 likes

Total Posts

18 posts

Correct reply

1 solution
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 3
Give Back
View profile
velmuruganv38
Level 2

10-05-2019

Hi,

I'm upgrading to aem6.4 and r7 annotations in project.  We are getting below common error on difference java files on different applications.

the bold lines are the common error that we are getting in different files across difference applications.  The line no. 39 has below line only,

Page page = currentPage;

In every application wherever we use currentPage object it throws a error "cannot be resolved to a type".

Below is the java file where i'm facing error,

Environment : AEM 6.4.4

Any suggestion on this would be more helpful.

Thanks,

Velu

Replies

Avatar

Avatar
Validate 10
Level 3
Radha_Krishna_N
Level 3

Likes

15 likes

Total Posts

51 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile

Avatar
Validate 10
Level 3
Radha_Krishna_N
Level 3

Likes

15 likes

Total Posts

51 posts

Correct reply

4 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 10
View profile
Radha_Krishna_N
Level 3

15-05-2019

Add the package containing your java class to the bundle plugin configuration in the pom file.

Apache Felix - Apache Felix Maven Bundle Plugin (BND)

<plugin>

    <groupId>org.apache.felix</groupId>

    <artifactId>maven-bundle-plugin</artifactId>

    <extensions>true</extensions>

    <configuration>

        <exportScr>true</exportScr>

        <instructions>

            ...

            <Export-Package>

                com.myProject.myProjectchat.global.*

            </Export-Package>

            ...

        </instructions>

    </configuration>

    ...

</plugin>