Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

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