osgi

How can I install postgresqljdbc to work in Karaf OSGi?

丶灬走出姿态 提交于 2020-01-02 09:26:22
问题 I want to install org.postgresql/postgresql/9.4-1201-jdbc41 in Karaf but I get errors. How can I resolve these errors? Strangely on Windows my Karaf doesn't have errors with this Postgres jdbc but on Ubuntu it has these errors. Any clues appreciated. Install Kar feature social_importer.kar/1.0-SNAPSHOT java.lang.Exception: Could not start bundle mvn:org.postgresql/postgresql/9.4-1201-jdbc41 in feature(s) T: Unresolved constraint in bundle org.postgresql.jdbc41 [127]: Unable to resolve 127.0:

Transaction rollback in OSGi

被刻印的时光 ゝ 提交于 2020-01-02 08:17:34
问题 I have an OSGi bundle in which I declare a service and inject into it a transaction with blueprint: <bean id="MyServiceImpl" class="com.test.impl.MyServiceImpl"> <jpa:context property="em" unitname="mypu" /> <tx:transaction method="*" value="Required" /> </bean> <service id="MyService" ref="MyServiceImpl" interface="com.test.api.MyService" /> In this service I have two methods each one of which is writing data in the database, something like the following: public void createParent() throws

<Export-Package> for all resources using maven-bundle-plugin

こ雲淡風輕ζ 提交于 2020-01-02 05:36:28
问题 As a temporary measure to be able to transition quickly to OSGi I need to create a single jar with all my libraries in it. What i did was put all the jar libraries in src/main/resources so they end up in the root of the created jar. The problem i am having is telling the maven-bundle-plugin to export ALL the packages in the jars. So basically, i want to expose all my libraries to other OSGi bundles This is the first thing I tried in my POM <build> <plugins> <plugin> <groupId>org.apache.felix<

EclipseLink : No Persistence provider for EntityManager named

不问归期 提交于 2020-01-02 03:53:09
问题 I'd like to create one Bundle that is able to use Java Persistence. To achieve this, I've created a plugin project within Eclipse. In my project, I've created a persistence.xml file into META-INF. I've aslo added in my MANIFEST.mf (into the depencies) those 3 packages : javax.persistence.jar org.eclipse.persistence.jar org.eclipse.persistence.jar Then, in my Activator I use this lines to create an EntityManager : factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);

How to get control over JAXBContext in JAX-WS?

微笑、不失礼 提交于 2020-01-01 09:42:16
问题 I need to deploy the same web service for each customer. This @javax.jws.WebService uses Object as method arguments and return types (resulting in <xs:anyType/> in wsdl). Each instance of web service is deployed along with customer's jar on the classpath. This jar has known structure and contains JAXB-annotated classes which client wants to handle via my service. The problem is that when customer passes an instance of his class as method agrument, server-side JAXB context unmarshals it into

Where to place module-info.java using Java 9?

情到浓时终转凉″ 提交于 2020-01-01 08:38:50
问题 I have an OSGI application and I have around 30 bundles (jar files). Today I decided to see how it works/if it works with Java 9. So I started my application and got WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.apache.felix.framework.util.SecureAction (file:/home/.../jar/org.apache.felix.framework-5.4.0.jar) to method java.net.URLClassLoader.addURL(java.net.URL) WARNING: Please consider reporting this to the maintainers of org.apache

Using Java 7 Comparators in Java 8

元气小坏坏 提交于 2020-01-01 07:39:09
问题 Situation I have an OSGi project that I'm trying to migrate to Java 8. In my project, I have dependencies to third party libraries that I "OSGi-fied" (by just adding the MANIFEST.MF file and putting metadata into it). These libraries are checked out from read-only SVN repositories, so I just can checkout updates from then when needed and therefore I don't want to make any other changes than in the MANIFEST.MF file, since I cannot commit them. Problem However, these libraries use lots of

OSGi: Does Blueprint replace Declarative Services?

别等时光非礼了梦想. 提交于 2020-01-01 01:17:06
问题 The new R4.2 spec for OSGi describes the Blueprint service, for dependency injection and service wiring. Does Blueprint replace Declarative Services (which is still part of the spec, as well), or are they intended to work together? Is Blueprint already available for the popular implementations (Felix and Equinox)? 回答1: I asked myself the same question and while discussing this with others involved in the topic, the tenor was that although the two are overlapping to some degree, the use case

OSGi Service wrapping a jar

吃可爱长大的小学妹 提交于 2019-12-31 05:14:08
问题 I am trying to create an OSGi service that wraps another jar. I added the jar to the project, the classpath and the binary build. I registered the service in the Activator but when the consuming bundle calls the service I get a java.lang.NoClassDefFoundError on the wrapper jar. Does anyone have any idea what I am doing wrong here? Thanks in advance. 回答1: Are you exporting the packages that are required by the consumer, as well as all those that the implementation requires. The consumer will

karaf not displaying any error while component factory example

纵饮孤独 提交于 2019-12-31 04:25:08
问题 i have tried component factory example from this link. interface: package com.java.examplefactoryservice; public interface ExampleFactoryService { public void start(); public void stop(); } factory provider: package com.java.examplecomponentfactoryserviceprovider; import java.util.Map; import org.apache.felix.scr.annotations.Activate; import org.apache.felix.scr.annotations.Component; import com.java.examplefactoryservice.ExampleFactoryService; @Component(name =