Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Getting cannot find the class file for org.osgi.framework.ServiceReference build error

Avatar

Level 9

We are trying to deploy our code onto AEM 6.2 version and added dependency for below classes but still getting compilation errors.

org.osgi.framework.Constants;
org.osgi.framework.ServiceReference
;

Parent pom:

<dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.fragment.ws</artifactId>
                <version>1.0.2</version>
                <scope>provided</scope>
  </dependency>

Core pom:

<dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.fragment.ws</artifactId>
 </dependency>

Any idea on usage of this dependency??

attached error screenshot 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

during runtime these bundles are provided by the system bundle, but during compile time they are not available by default. Can you try with a scope of "compile"? What kind of project archetype have you used?

kind regards,
Jörg

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

Hi,

during runtime these bundles are provided by the system bundle, but during compile time they are not available by default. Can you try with a scope of "compile"? What kind of project archetype have you used?

kind regards,
Jörg