osgi

Using @Resource injection for Mongo db, inside Web Bundle inside OSGI, under Liberty Profile

a 夏天 提交于 2019-12-11 08:20:27
问题 I want to inject Mongo database (com.mongodb.DB) into OSGI Web Bundle Project, using @Resource. The application is to deployed to WebSphere Liberty Profile V8.5.5.1. Is this possible to do it? I got an error message "....The annotations could not be obtained because of the exception : java.lang.NoClassDefFoundError" However, I can inject Mongo database into WAR, using @Resource, running on WebSphere Liberty Profile, if not using OSGI. Below is lookup return null. public static final DB

Felix OSGI Embedded application issue

泄露秘密 提交于 2019-12-11 08:18:16
问题 I was using Felix as a embedded application as explained in, How to start and use Apache Felix from code?. What I want to do is dynamically load jar files from my host application via OSGi and invoke methods of implementation classes. So I have following three maven projects 1) A maven project which has an interface. And the package of this interface is exported. ---> ProjA . 2) A implementation project --> ProjB, another maven project which import ProjA as a maven dependency and implement

Who loads javax.swing.* classes in Equinox osgi container?

六月ゝ 毕业季﹏ 提交于 2019-12-11 08:12:53
问题 I read some equinox code and doc. I came to understand that, at present, only class loading for java.* packages are delegated to the parent classloader(given that i have not modified org.osgi.bootdelegation property, which by the way seems to be null). Then who is loading the javax.swing.* classes. I have not mentioned it anywhere in the imported packages/ required bundles, but still it loads just fine. I wanted to know who the heck is "formally" responsible for loading it? Thanks a lot in

how to set rxtx with OSGi Equinox?

随声附和 提交于 2019-12-11 07:43:55
问题 I am looking for a solution to my problem. I am developing a bundle that has to read from the serial port by means of rxtx jar. When I launch the application, I get the following error java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "Thread-2" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source)

osgi spring hibernate virgo example ClassNotFoundException: org.hibernate.cfg.Configuration

让人想犯罪 __ 提交于 2019-12-11 07:42:40
问题 I'm trying to build very simple app that saving data to DB run as osgi bundle (under Virgo). When I try to upload jar to virgo trough webinterface, and get next error. [2011-02-13 23:19:26.317] start-signalling-4 org.eclipse.virgo.medic.eventlog.default DE0006E Start failed for bundle 'com.company.heartbeat' version '0.1.0'. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beatDao' defined in URL [bundleentry://63.fwk1755147655/META-INF/spring

Injecting components into a POJO using OSGi

主宰稳场 提交于 2019-12-11 07:24:34
问题 I'm new to OSGi and I'm interested in retrofitting some of my jars as OSGi bundles. However I do not want to introduce additional dependencies to any osgi-specific libraries. As such annotations are out of the question as are programmatic calls to bundle contexts and what not. I have found a near match to my requirements in declarative services which allows me to expose my lower level bundles without impacting dependencies however at the higher level (where i actually need to consume the

ClassCastException during JNDI lookup for MongoDB, inside WAB, running Liberty

风流意气都作罢 提交于 2019-12-11 07:09:06
问题 I want to use JNDI lookup for MongoDB, inside WAB/OSGi, running Liberty Profile. import com.mongodb.DB; @WebServlet("/MongoServlet") public class MongoServlet extends HttpServlet { private static final long serialVersionUID = 1L; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { DB db = (DB) new InitialContext().lookup("java:comp/env/mongodb"); } catch (NamingException e) { e.printStackTrace(); } } } The JNDI lookup

two dependency chains OSGI

馋奶兔 提交于 2019-12-11 06:51:41
问题 I have the following error: in text : Error executing command: Error restarting bundles: Unable to start bundle 278: Uses constraint violation. Unable to resolve resource demo-persistence-jpa [demo-persistence-jpa [278](R 278.0)] because it is exposed to package 'javax.persistence' from resources javax.persistence [javax.persistence [248](R 248.0)] and org.apache.geronimo.specs.geronimo-jpa_2.0_spec [org.apache.geronimo.specs.geronimo-jpa_2.0_spec [266](R 266.0)] via two dependency chains.

Osgi Property Placeholder

一笑奈何 提交于 2019-12-11 06:44:45
问题 I can only use string binding here, enableRequestValidation should be always string, put in my bean i want to use boolean, how can i achieve this using property-placeholder bindings? <property-placeholder persistent-id="JsonValidator" update-strategy="reload" placeholder-prefix="$[" placeholder-suffix="]"> <default-properties> <property name="enableRequestValidation" value="false"></property> </default-properties> </property-placeholder> <bean id="jsonSchemaRegistration" class="rest.service

Jetty, websocket, java.lang.RuntimeException: Cannot load platform configurator

故事扮演 提交于 2019-12-11 06:24:46
问题 I try to get http session in Endpoint. I followed this recomendations https://stackoverflow.com/a/17994303 . Thats why I did: public class MyConfigurator extends ServerEndpointConfig.Configurator { @Override public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request, HandshakeResponse response) { HttpSession httpSession = (HttpSession)request.getHttpSession(); config.getUserProperties().put(HttpSession.class.getName(),httpSession); } } and @ServerEndpoint(value = "/foo"