org.json.simple -- Cannot be resolved in bundle | Community
Skip to main content
New Participant
May 13, 2016
Solved

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

  • May 13, 2016
  • 3 replies
  • 10934 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by mallipanchal

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.

3 replies

kautuk_sahni
Employee
May 13, 2016

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

Kautuk Sahni
kautuk_sahni
Employee
May 13, 2016

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
mallipanchalAccepted solution
New Participant
May 13, 2016

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.