javax.inject,version=[0.0,1) — Cannot be resolved

Avatar

Avatar
Validate 10
Level 4
Var
Level 4

Likes

44 likes

Total Posts

113 posts

Correct reply

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

Avatar
Validate 10
Level 4
Var
Level 4

Likes

44 likes

Total Posts

113 posts

Correct reply

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

09-04-2017

Is there any other work around to fix the javax.inject,version=[0.0,1) -- Cannot be resolvedissue in OSGI bundle.

I have tried all the approaches provided in the below forum. but still my bundle doesn't resolve.

I am using AEM 6.2 + Java version: 1.8.0_121 + Apache Maven 3.3.9 and archetypeVersion=10 

http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

The POC code snippet can be found in my drive here

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 50
Employee
Feike_Visser1
Employee

Likes

247 likes

Total Posts

970 posts

Correct reply

221 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Give Back 50
Employee
Feike_Visser1
Employee

Likes

247 likes

Total Posts

970 posts

Correct reply

221 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Feike_Visser1
Employee

10-04-2017

add this dependency:

        <dependency>

            <groupId>javax.inject</groupId>

            <artifactId>javax.inject</artifactId>

            <version>1</version>

            <scope>provided</scope>

        </dependency>

Answers (5)

Answers (5)

Avatar

Avatar
Boost 5
Level 4
vjetty
Level 4

Likes

25 likes

Total Posts

83 posts

Correct reply

20 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile

Avatar
Boost 5
Level 4
vjetty
Level 4

Likes

25 likes

Total Posts

83 posts

Correct reply

20 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile
vjetty
Level 4

09-04-2017

Hi, Try these dependencies.

<dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.models.api</artifactId> <version>1.2.2</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.models.impl</artifactId> <version>1.2.2</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-atinject_1.0_spec</artifactId> <version>1.0</version> <scope>provided</scope> </dependency>

And also check the required uber-jar is present.

<dependency> <groupId>com.adobe.aem</groupId> <artifactId>uber-jar</artifactId> <version>6.2.0</version> <classifier>apis</classifier> <scope>provided</scope> </dependency>

Hope this helps!

Thanks,

Vamsi

Avatar

Avatar
Give Back
Level 1
AasishJain
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile

Avatar
Give Back
Level 1
AasishJain
Level 1

Like

1 like

Total Posts

2 posts

Correct reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile
AasishJain
Level 1

18-02-2021

Spoiler
 

add this dependency in your core/pom.xml

Screenshot 2021-02-19 at 8.35.17 AM.png

Avatar

Avatar
Validate 1
Level 2
Abhishek_jha65-
Level 2

Likes

5 likes

Total Posts

7 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
Abhishek_jha65-
Level 2

Likes

5 likes

Total Posts

7 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
Abhishek_jha65-
Level 2

23-07-2017

It's working!

Avatar

Avatar
Validate 10
Level 4
Var
Level 4

Likes

44 likes

Total Posts

113 posts

Correct reply

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

Avatar
Validate 10
Level 4
Var
Level 4

Likes

44 likes

Total Posts

113 posts

Correct reply

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

10-04-2017

Feike Visser wrote...

add this dependency:

        <dependency>

            <groupId>javax.inject</groupId>

            <artifactId>javax.inject</artifactId>

            <version>1</version>

            <scope>provided</scope>

        </dependency>

 

Thanks Feike,

after so many rebuilds with modification of pom files finally found it works with

<dependency><groupId>org.apache.sling</groupId><artifactId>o‌​rg.apache.sling.mode‌​ls.api</artifactId><‌​/dependency> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.models.impl</artifactId> </dependency> <dependency> <groupId>javax.inject</groupId> <artifactId>javax.inject</artifactId> </dependency>

 as mandatory in build and remaining uber-jar and geronimo-atinject_1.0_spec jars as optional. even both together works.

Avatar

Avatar
Springboard
Level 7
Prince_Shivhare
Level 7

Likes

123 likes

Total Posts

407 posts

Correct reply

65 solutions
Top badges earned
Springboard
Establish
Give Back 100
Boost 100
Validate 1
View profile

Avatar
Springboard
Level 7
Prince_Shivhare
Level 7

Likes

123 likes

Total Posts

407 posts

Correct reply

65 solutions
Top badges earned
Springboard
Establish
Give Back 100
Boost 100
Validate 1
View profile
Prince_Shivhare
Level 7

10-04-2017

Hi,

This issue is only in AEM 6.2 once you create or deploy new project. you need to add the below dependency in your core project:

<dependency> <groupId>javax.inject</groupId> <artifactId>javax.inject</artifactId> <version>1</version> </dependency>

AEM versions prior to 6.2, there was a dependency to javax.inject version 0 whereas now they need version 1 and that's not reflected in the pom.xml.

 

~ Prince