osgi

How to Set UTF-8 response on doPost() call?

你。 提交于 2019-12-25 08:34:40
问题 I Am trying to have a JSON response back to the page with UTF-8 data, as it is what i have posted from the Form to my osgi servlet. The Servlet code is as shown below: import org.json.simple.JSONArray; import org.json.simple.JSONObject; @SlingServlet(paths="/bin/JsonOsgiCall", methods = "POST", metatype=true) public class JsonOsgiCall extends org.apache.sling.api.servlets.SlingAllMethodsServlet { private static final long serialVersionUID = 2598426539166788515L; protected final Logger log =

Glassfish 4.1.1 and offline JSP compiler (JSP and OSGI)

荒凉一梦 提交于 2019-12-25 07:15:37
问题 As everyone knows jsp can't work with classes outside current osgi web archive bundle. This is a bug in GF. The developers of glassfish for workaround of this bug https://java.net/jira/browse/GLASSFISH-11208 offer to use offline jsp compiler (by other words to compile jsp files not during deployment time but during archive building time). Ok, and I used jspc-maven-plugin to compile my jsp during wab building. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jspc-maven-plugin<

Error after converting org.pbjar library to OSGi bundle

扶醉桌前 提交于 2019-12-25 07:09:03
问题 I'm trying to convert org.pbjar.jxlayer library to an OSGi bundle, I already succeeded in that but when I try to install it in Karaf container, the container claims that there is a missing requirement needed by this bundle: Unable to resolve 312.0: missing requirement [312.0] osgi.wiring.package; (osgi.wiring.package=com.sun.java.swing) I also put the javax.swing in the bundle import directive but the problem persists I changed the version of JDK (1.5, 1.6, 1.7) but no luck Can you help me

Equinox OSGi activating two versions of the same bundle

*爱你&永不变心* 提交于 2019-12-25 06:55:18
问题 I am looking for settung up my RCP and install all of the available applications on it. However; these applications have many internal and external dependencies such as. A -> B [1.0.0, 2.0.0) C -> B [2.0.0, 3.0.0) As a result in order to have both A and C installed on my RCP, I need both versions of B available and running. Assuming that B is not a singleton, what is the behavior of Equinox OSGI? In some places I read that OSGI will catch the latest version and loads that bundle. However, I

How to test if a feature is installed in a karaf console script?

笑着哭i 提交于 2019-12-25 06:38:34
问题 I need to write a karaf console script that uninstalls a feature, if it is present on karaf 3.0.4. So far I have not found any direct references mentionend in the documentation (https://karaf.apache.org/manual/latest-3.0.x/developers-guide/scripting.html). Using shell:env ? always returns null as the value and I'm not sure if ? is a supported environment variable name in karaf. So how can execute a karaf command if a feature is present? 回答1: It is not possible to test if a feature is

Packing multiple OSGi bundles in the same jar

不打扰是莪最后的温柔 提交于 2019-12-25 06:35:44
问题 I am very new to the OSGi platform. Having an OSGi bundle B1 that has a dependency to another bundle B2 , which is very probably not provided by the container, can I package both bundles in the same jar ? If yes: howto do that? what would happen if the jar is installed and the bundle is already installed? 回答1: Yes you can do this... kind of. Normally OSGi bundles are JAR files because they need to have a META-INF/MANIFEST.MF. The OSGi framework cannot directly read your "multi-bundle" JAR.

Packing multiple OSGi bundles in the same jar

a 夏天 提交于 2019-12-25 06:35:02
问题 I am very new to the OSGi platform. Having an OSGi bundle B1 that has a dependency to another bundle B2 , which is very probably not provided by the container, can I package both bundles in the same jar ? If yes: howto do that? what would happen if the jar is installed and the bundle is already installed? 回答1: Yes you can do this... kind of. Normally OSGi bundles are JAR files because they need to have a META-INF/MANIFEST.MF. The OSGi framework cannot directly read your "multi-bundle" JAR.

maven bundle plugin build error

拈花ヽ惹草 提交于 2019-12-25 05:45:08
问题 When I run mvn clean install , maven throws the following exception: Exporting packages that are not on the Bundle-Classpath[Jar:dot] I could build successfully a few days ago, why is it happenning? 回答1: It's hard to be certain without details of your POM configuration, but it looks like you're using a bnd based plugin, which probably means the maven-bundle-plugin or the bnd-maven-plugin . In either case the bundle that's being produced is exporting a package which is not in the bundle. This

Uninstall bundles and force a refresh

拜拜、爱过 提交于 2019-12-25 05:21:13
问题 I have an Eclipse plugin and want to stop, uninstall bundles from the Eclipse instance and then refresh. Stop and uninstall is no problem, but the refresh part of the code is now deprecated and I want to find an alternative. Currently I'm doing this through org.osgi.service.packageadmin . Documentation points to org.osgi.framework.wiring package. And from the JavaDoc org.osgi.framework.wiring.FrameworkWiring.refreshBundles(..) seems to be exactly what I want. But the only class that

Uninstall bundles and force a refresh

余生颓废 提交于 2019-12-25 05:20:18
问题 I have an Eclipse plugin and want to stop, uninstall bundles from the Eclipse instance and then refresh. Stop and uninstall is no problem, but the refresh part of the code is now deprecated and I want to find an alternative. Currently I'm doing this through org.osgi.service.packageadmin . Documentation points to org.osgi.framework.wiring package. And from the JavaDoc org.osgi.framework.wiring.FrameworkWiring.refreshBundles(..) seems to be exactly what I want. But the only class that