Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

org.json.simple -- Cannot be resolved in bundle

kiranc13433869
Level 4
Level 4

i have added a jar in pom.xml as 

    <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1</version>
        </dependency>

bundle is  installed  but in http://localhost:4502/system/console/bundles--> imported files 

i am getting issue as org.json.simple -- Cannot be resolved 

because of which my bundle is not getting activated 

and i am getting error in log as  ServiceEvent UNREGISTERING

this is because of same reason or no i am not getting.

1 Accepted Solution
mallipanchal
Correct answer by
Level 2
Level 2

org.json.simple api wont be available in Felix so dependency cont be resolved. better use following one for json org.apache.sling.commons.json.JSONObject, its part of osgi.

View solution in original post

0 Replies
mallipanchal
Correct answer by
Level 2
Level 2

org.json.simple api wont be available in Felix so dependency cont be resolved. better use following one for json org.apache.sling.commons.json.JSONObject, its part of osgi.

View solution in original post

kautuk_sahni
Community Manager
Community Manager

Hi 

Check this post:- 

Link:- http://stackoverflow.com/questions/31380082/cq5-osgi-bundle-error-org-json-simple-cannot-be-resolved

//Change your maven bundle configuration

<plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>2.3.7</version> <configuration> <instructions> <Embed-Dependency>*;scope=compile;inline=false</Embed-Dependency> <Embed-Transitive>true</Embed-Transitive> </instructions> </configuration> </plugin>

I hope this would be of some help to you.

Thanks and Regards

Kautuk Sahni

kautuk_sahni
Community Manager
Community Manager

mallipanchal wrote...

org.json.simple api wont be available in Felix so dependency cont be resolved. better use following one for json org.apache.sling.commons.json.JSONObject, its part of osgi.

 

You are correct, but we can use it as third party JAR.

See this :- https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html

~kautuk