Expand my Community achievements bar.

SOLVED

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

Avatar

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

Avatar

Correct answer by
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

3 Replies

Avatar

Correct answer by
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.

Avatar

Administrator

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

Avatar

Administrator

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