{"action":"closed","issue":{"url":"https://api.github.com/repos/FasterXML/jackson-modules-base/issues/10","repository_url":"https://api.github.com/repos/FasterXML/jackson-modules-base","labels_url":"https://api.github.com/repos/FasterXML/jackson-modules-base/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/FasterXML/jackson-modules-base/issues/10/comments","events_url":"https://api.github.com/repos/FasterXML/jackson-modules-base/issues/10/events","html_url":"https://github.com/FasterXML/jackson-modules-base/issues/10","id":153599893,"number":10,"title":"Afterburner failing inside Karaf 3.0.5","user":{"login":"debraj-manna","id":8141860,"avatar_url":"https://avatars.githubusercontent.com/u/8141860?v=3","gravatar_id":"","url":"https://api.github.com/users/debraj-manna","html_url":"https://github.com/debraj-manna","followers_url":"https://api.github.com/users/debraj-manna/followers","following_url":"https://api.github.com/users/debraj-manna/following{/other_user}","gists_url":"https://api.github.com/users/debraj-manna/gists{/gist_id}","starred_url":"https://api.github.com/users/debraj-manna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/debraj-manna/subscriptions","organizations_url":"https://api.github.com/users/debraj-manna/orgs","repos_url":"https://api.github.com/users/debraj-manna/repos","events_url":"https://api.github.com/users/debraj-manna/events{/privacy}","received_events_url":"https://api.github.com/users/debraj-manna/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-05-07T15:22:22Z","updated_at":"2016-05-09T04:38:37Z","closed_at":"2016-05-09T04:38:37Z","body":"I have a simple Hello World type Karaf Bundle. The activator code looks like below:-\r\n\r\n```\r\npublic class HelloWorldActivator implements BundleActivator {\r\n\t \t@Override\r\n\t    public void start(BundleContext bundleContext) throws Exception {\r\n\t        System.out.println(\"STARTING DEMO: hello, world\\n\");\r\n\t        System.out.println(getJsonDataAsString());\r\n\t    }\r\n\t \r\n\t    @Override\r\n\t    public void stop(BundleContext bundleContext) throws Exception {\r\n\t        System.out.println(\"STOPPING DEMO\");\r\n\t    }\t\r\n\t    \r\n\t    private String getJsonDataAsString() {\r\n\t    \tJsonDataBlob jsonDataBlob = new JsonDataBlob();\r\n\t    \tObjectMapper objectMapper = new ObjectMapper();\r\n\t    \tobjectMapper.registerModule(new AfterburnerModule());\r\n\t    \ttry {\r\n\t    \t\treturn objectMapper.writeValueAsString(jsonDataBlob);\r\n\t    \t} catch(Exception e) {\r\n\t    \t\te.printStackTrace();\r\n\t    \t}\r\n\t    \treturn \"\";\t    \t\r\n\t    }\t    \t    \r\n}\r\n```\r\n\r\n`pom.xml` looks like below:-\r\n\r\n```\r\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n\txsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\r\n\t<modelVersion>4.0.0</modelVersion>\r\n\t<groupId>com.hello</groupId>\r\n\t<artifactId>world</artifactId>\r\n\t<version>0.0.1</version>\r\n\t<packaging>bundle</packaging>\r\n\t<name>Hello World</name>\r\n\t<dependencies>\r\n\t\t<!-- OSGi -->\r\n\t\t<dependency>\r\n\t\t\t<groupId>org.osgi</groupId>\r\n\t\t\t<artifactId>org.osgi.core</artifactId>\r\n\t\t\t<version>4.3.1</version>\r\n\t\t</dependency>\r\n\t\t<dependency>\r\n\t\t\t<groupId>org.osgi</groupId>\r\n\t\t\t<artifactId>org.osgi.compendium</artifactId>\r\n\t\t\t<version>4.3.1</version>\r\n\t\t</dependency>\r\n\t\t<dependency>\r\n\t\t\t<groupId>org.json</groupId>\r\n\t\t\t<artifactId>json</artifactId>\r\n\t\t\t<version>20160212</version>\r\n\t\t</dependency>\r\n\t\t<dependency>\r\n\t\t\t<groupId>com.fasterxml.jackson.core</groupId>\r\n\t\t\t<artifactId>jackson-core</artifactId>\r\n\t\t\t<version>2.6.2</version>\r\n\t\t</dependency>\r\n\r\n\t\t<dependency>\r\n\t\t\t<groupId>com.fasterxml.jackson.core</groupId>\r\n\t\t\t<artifactId>jackson-annotations</artifactId>\r\n\t\t\t<version>2.6.2</version>\r\n\t\t</dependency>\r\n\r\n\t\t<dependency>\r\n\t\t\t<groupId>com.fasterxml.jackson.core</groupId>\r\n\t\t\t<artifactId>jackson-databind</artifactId>\r\n\t\t\t<version>2.6.2</version>\r\n\t\t</dependency>\r\n\r\n\t\t<dependency>\r\n\t\t\t<groupId>com.fasterxml.jackson.module</groupId>\r\n\t\t\t<artifactId>jackson-module-afterburner</artifactId>\r\n\t\t\t<version>2.7.1</version>\r\n\t\t</dependency>\r\n\r\n\r\n\r\n\t</dependencies>\r\n\t<build>\r\n\t\t<sourceDirectory>src</sourceDirectory>\r\n\t\t<plugins>\r\n\t\t\t<plugin>\r\n\t\t\t\t<artifactId>maven-compiler-plugin</artifactId>\r\n\t\t\t\t<version>3.3</version>\r\n\t\t\t\t<configuration>\r\n\t\t\t\t\t<source>1.8</source>\r\n\t\t\t\t\t<target>1.8</target>\r\n\t\t\t\t\t<excludes>\r\n\t\t\t\t\t\t<exclude>**/com/hello/main/*</exclude>\r\n\t\t\t\t\t</excludes>\r\n\t\t\t\t</configuration>\r\n\t\t\t</plugin>\r\n\t\t\t<plugin>\r\n\t\t\t\t<groupId>org.apache.felix</groupId>\r\n\t\t\t\t<artifactId>maven-bundle-plugin</artifactId>\r\n\t\t\t\t<version>2.4.0</version>\r\n\t\t\t\t<inherited>true</inherited>\r\n\t\t\t\t<extensions>true</extensions>\r\n\t\t\t\t<configuration>\r\n\t\t\t\t\t<instructions>\r\n\t\t\t\t\t\t<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>\r\n\t\t\t\t\t\t<Bundle-Version>${project.version}</Bundle-Version>\r\n\t\t\t\t\t\t<Bundle-Activator>com.hello.world.HelloWorldActivator</Bundle-Activator>\r\n\t\t\t\t\t\t<Import-Package>*;resolution:=optional</Import-Package>\r\n\t\t\t\t\t</instructions>\r\n\t\t\t\t</configuration>\r\n\t\t\t</plugin>\r\n\t\t</plugins>\r\n\t</build>\r\n</project>\r\n```\r\n\r\nThe java object which I am trying to convert to json is a simple object as shown below:-\r\n\r\n```\r\npackage com.hello.world;\r\npublic class JsonDataBlob {\r\n\tprivate String add1 = \"JP Naagar\";\r\n\tprivate String add2 = \"\";\r\n\tprivate int shippartagent = 1;\r\n\r\n\tpublic String getAdd1() {\r\n\t\treturn add1;\r\n\t}\r\n\r\n\tpublic void setAdd1(String add1) {\r\n\t\tthis.add1 = add1;\r\n\t}\r\n\r\n\tpublic String getAdd2() {\r\n\t\treturn add2;\r\n\t}\r\n\r\n\tpublic void setAdd2(String add2) {\r\n\t\tthis.add2 = add2;\r\n\t}\r\n\r\n\tpublic int getShippartagent() {\r\n\t\treturn shippartagent;\r\n\t}\r\n\r\n\tpublic void setShippartagent(int shippartagent) {\r\n\t\tthis.shippartagent = shippartagent;\r\n\t}\r\n}\r\n\r\n\r\n```\r\nWhenever I am trying to install the bundle I am getting the below exception:-\r\n\r\n```\r\n2016-05-07 15:36:48,986 | WARN  | x-6.1-2.0/deploy | fileinstall                      | 7 - org.apache.felix.fileinstall - 3.5.0 | Error while starting bundle: file:/Users/debraj/Downloads/apache-servicemix-6.1-2.0/deploy/world-0.0.1.jar\r\norg.osgi.framework.BundleException: Activator start error in bundle world [239].\r\n        at org.apache.felix.framework.Felix.activateBundle(Felix.java:2196)[org.apache.felix.framework-4.2.1.jar:]\r\n        at org.apache.felix.framework.Felix.startBundle(Felix.java:2064)[org.apache.felix.framework-4.2.1.jar:]\r\n        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)[org.apache.felix.framework-4.2.1.jar:]\r\n        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1245)[7:org.apache.felix.fileinstall:3.5.0]\r\n        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1217)[7:org.apache.felix.fileinstall:3.5.0]\r\n        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:509)[7:org.apache.felix.fileinstall:3.5.0]\r\n        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:358)[7:org.apache.felix.fileinstall:3.5.0]\r\n        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:310)[7:org.apache.felix.fileinstall:3.5.0]\r\nCaused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/module/afterburner/AfterburnerModule\r\n        at java.lang.Class.getDeclaredConstructors0(Native Method)[:1.8.0_77]\r\n        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)[:1.8.0_77]\r\n        at java.lang.Class.getConstructor0(Class.java:3075)[:1.8.0_77]\r\n        at java.lang.Class.newInstance(Class.java:412)[:1.8.0_77]\r\n        at org.apache.felix.framework.Felix.createBundleActivator(Felix.java:4336)\r\n        at org.apache.felix.framework.Felix.activateBundle(Felix.java:2141)\r\n        ... 7 more\r\nCaused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.module.afterburner.AfterburnerModule not found by world [239]\r\n        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]\r\n        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]\r\n        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)\r\n        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_77]\r\n        ... 13 more\r\n\r\n```\r\n\r\nAll the required Jackson bundles are installed in Karaf:-\r\n\r\n```\r\nkaraf@root>bundle:list | grep Jackson\r\n123 | Active    |  50 | 2.6.2                              | Jackson-core                                   \r\n125 | Active    |  50 | 2.6.2                              | Jackson-annotations                            \r\n238 | Installed |  80 | 2.7.1                              | Jackson-module-Afterburner                     \r\nkaraf@root>bundle:list | grep jackson\r\n124 | Active    |  50 | 2.6.2                              | jackson-databind  \r\n```\r\n\r\nEverything works fine if I just comment out the below line:-\r\n\r\n```\r\nobjectMapper.registerModule(new AfterburnerModule());\r\n```\r\n\r\nI have placed the required code in [github](https://github.com/debraj-manna/afterburner-issue)\r\n\r\n_I have also reported the same issue [here](https://github.com/FasterXML/jackson-module-afterburner/issues/65) . as I was not sure where to report issues. Let me know I will close one of the issue._"}}