Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core bundle does not resolve on AEM 6.2 due to different version of javax.inject #59

Closed
rombert opened this issue Mar 29, 2016 · 6 comments
Assignees
Labels
bug Unexpected problem or unintended behavior that impairs normal functioning of the product.
Milestone

Comments

@rombert
Copy link
Contributor

rombert commented Mar 29, 2016

With AEM 6.2 the javax.inject package is exported with version 1.0.0 by org.apache.geronimo.specs.geronimo-atinject_1.0_spec. Before that it was exported with version 0.0.0, and the core bundle ( when compiled ) creates an import range of [0,1)

javaxinjectmissing

@rombert rombert added the bug Unexpected problem or unintended behavior that impairs normal functioning of the product. label Mar 29, 2016
@rombert rombert added this to the 11 milestone Mar 29, 2016
@rombert rombert self-assigned this Mar 29, 2016
@bertoltmeier
Copy link

bertoltmeier commented Sep 1, 2016

Hi.

I tried out the fix in my local POM, which was created from the archetype for an AEM6.1 project, but the fix would not work.

I had to add the following dependencies to the core/pom.xml to make javax.inject work in AEM6.2:

    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-atinject_1.0_spec</artifactId>
        <version>1.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>1</version>
    </dependency>

@marcelkottmann
Copy link

The fixing commit e8239a9 fixes also the same problem in AEM 6.1 after installing the Service Pack 2 .

@ksurendra
Copy link

The same also shows up on AEM 6.3

and adding the dependencies does not fix the issue.

@vaibhavvasa236
Copy link

vaibhavvasa236 commented Jan 10, 2017

This issue is mainly due to version mismatch.
Add the following package import inside <configuration>/<instructions> in pom.xml of your project's core.
<Import-Package>
javax.inject;version=0.0.0,com.day.cq.replication;version="[6.0.0,7)",
org.apache.sling.event.jobs;version="[1.5,2]",
com.day.cq.workflow;version="[1.0,2)",
com.day.cq.workflow.exec;version="[1.0,2)",
com.day.cq.workflow.metadata;version="[1.0,2)",
org.apache.sling.models.annotations;version="[1.1,2)",
com.day.cq.commons.jcr;version="[5.7.0,7.0.0)",
*
</Import-Package>
It should work then

@somanath11
Copy link

Thanks @vaibhavvasa236 it worked for me.

@SahilAhmedSheikh
Copy link

hello @vaibhavvasa236,

I m using AEM 6.2.0.
I have created a simple custom text component , but when i create java file for the same and using @model the following error "package org.apache.sling.models.annotations does not exist
[ERROR] symbol: class Model"
to resolve the same i have included the external jar "org.apache.sling.models.api-1.3.8" into my project as well. i m using Intelij. Could u help me resolving the issue.

Regards
Sahil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior that impairs normal functioning of the product.
Projects
None yet
Development

No branches or pull requests

7 participants