osgi

How to use servlet with OSGi

偶尔善良 提交于 2019-11-30 23:27:36
问题 I want to create and deploy a web service to OSGi container. For example, publish the service to the address: http://localhost:8080/testservice. The service generate HTML response in a servlet. I have searched a lot and got: public class HelloWorldServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html>");

Is Struts 2 available as an OSGi bundle?

青春壹個敷衍的年華 提交于 2019-11-30 22:52:54
I have a server application that consists of multiple OSGi bundles, some mine, some third-party. One of the bundles provides a web frontend using Struts. The necessary Struts libraries live inside the web front-end bundle. Now I want to add a second bundle that provides another web front-end, with different dependencies and a very different use case. I want to use Struts for that bundle, too, but I don't want to put the same libraries into two bundles. With OSGi, it should be no problem to separate the Struts libs in a bundle of their own and use that from both my bundles. However, I couldn't

OSGI expose An “ClassNotFoundException: org.w3c.dom.***” Error when release

烈酒焚心 提交于 2019-11-30 22:13:07
I only wrote the following codes in Activator.start() function public void start(BundleContext bundleContext) throws Exception { Activator.context = bundleContext; Node node = new Node() { @Override public Object setUserData(String arg0, Object arg1, UserDataHandler arg2) { // TODO Auto-generated method stub return null; } @Override public void setTextContent(String arg0) throws DOMException { // TODO Auto-generated method stub } @Override public void setPrefix(String arg0) throws DOMException { // TODO Auto-generated method stub } @Override public void setNodeValue(String arg0) throws

Integrating Equinox OSGi into Apache Tomcat web app

戏子无情 提交于 2019-11-30 20:48:11
Is it possible to introduce osgi-equinox into existing java Apache Tomcat project? From my understanding OSGI must run inside some kind of "container". How would I integrate it? I am also using Jersey for RESTful resources. sjlee You may want to look at this question: OSGI runtime inside traditional Java EE server . In this bridge model, a special servlet is installed and Tomcat invokes this servlet to handle the request. An OSGi runtime is spawned from within this servlet, but the OSGi runtime itself (e.g. equinox) is agnostic of things like HTTP. An OSGi HTTP service bundle is also installed

Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV

这一生的挚爱 提交于 2019-11-30 19:54:38
So I was working with JSTL in OSGi, under Gemini runtime. And I'm getting following exception, when I try to access the url to my servlet : - SEVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: /WEB-INF/login.jsp (line: 3, column: 66) Unable to read TLD "META-INF/c.tld" from JAR file "file:/D:/OSGi%20Runtime/Gemini/gemini-web/dep/com.springsource.javax.servlet.jsp.jstl-1.2.0.v20110728.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV However, I have checked, that

Can Eclipse 3.5 discover all bundles in the plugins dir?

ぃ、小莉子 提交于 2019-11-30 19:29:42
Simple usecase : assemble an Eclipse product using simple scripts, just dumping bundles into the plugins dir . This used to work with 3.3 - with 3.5 it's broken: my application doesn't start as the app plugin is not found. Question : what's the easiest way to fix that? This seems to be the only pain in the whole upgrade process for me. Attempts : I guess this is a no-no for P2: it maintains the bundles.info file instead, which is probably very smart.. a bit too smart for me. Some ideas I had: can I just skip P2 altogether and get back to plain old, simple -dirty- discovery mechanism? can I set

Why (and in favor of what) are maven-bundle-plugin's wrap/bundleall goals deprecated?

强颜欢笑 提交于 2019-11-30 18:51:23
http://svn.apache.org/repos/asf/felix/releases/maven-bundle-plugin-2.3.7/doc/site/wrap-mojo.html says bundle:wrap is deprecated, same with bundle:bundleall . I currently use wrap to create an OSGi bundle from a non-OSGi dependency, as described at http://www.lucamasini.net/Home/osgi-with-felix/creating-osgi-bundles-of-your-maven-dependencies . What should they be replaced by and what's the reason for the deprecation? The alternative is to just use the bundle:bundle goal, then in your pom.xml configure the plugin similar to the following: <plugin> <groupId>org.apache.felix</groupId> <artifactId

When should I use a platform like OSGI and when it must be avoided?

青春壹個敷衍的年華 提交于 2019-11-30 17:27:18
My question is pretty straightforward: What are the features of an application that force the developer to exploit OSGI-like system? What are the cases, when such a utility is unneeded? Mirko Jahn I just posted the following link to another question ( What does OSGi solve ), but I think here it is an even better fit. Hal Hildebrand wrote a blog about why and when he thinks OSGi is helping your development/product. The core essence of the (pretty long) post is that it helps especially when dealing with long running, complex enterprise projects. In particular in the long run, the benefit of

Why (and in favor of what) are maven-bundle-plugin's wrap/bundleall goals deprecated?

末鹿安然 提交于 2019-11-30 16:51:37
问题 http://svn.apache.org/repos/asf/felix/releases/maven-bundle-plugin-2.3.7/doc/site/wrap-mojo.html says bundle:wrap is deprecated, same with bundle:bundleall . I currently use wrap to create an OSGi bundle from a non-OSGi dependency, as described at http://www.lucamasini.net/Home/osgi-with-felix/creating-osgi-bundles-of-your-maven-dependencies. What should they be replaced by and what's the reason for the deprecation? 回答1: The alternative is to just use the bundle:bundle goal, then in your pom

Android Activity in OSGI Bundle

独自空忆成欢 提交于 2019-11-30 15:52:11
I am working on developing OSGI bundles that have a full support for android. So far, by my previous questions, I was able to use android API inside OSGI bundle. It works fine and I tried it. I am using Felix framework. However, I am stuck now at the mission of making an OSGI bundle to have an android activity and to start that activity. I also need these activities to be able to request permissions so I guess I will need an AndroidManifest.xml in the OSGI bundle. While doing a research, I was able to find only one person describing his experience in achieving this. Unfortunately, the steps he