blueprint-osgi

DBCP Idle Connections not being reused in Camel Route

ぐ巨炮叔叔 提交于 2019-12-06 06:31:47
问题 I am pretty sure the idle connections are not being re-used or I am leaking connections. I have a simple route that start from a file consumer. The file consumer consumes text files. After picking up the file I check a table to ensure that this is not a duplicate file. I then convert the message body from a file to string. I then split the file up and run the individual pieces through a route depending on what type of record it is. Each one of these routes eventually inserts this record into

Transaction rollback in OSGi

走远了吗. 提交于 2019-12-06 01:55:17
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 MyException { Parent parent = new Parent(); ... // Set parent fields em.persist(parent); createChild(); /

java.lang.ClassCastException: [B cannot be cast to java.lang.String

怎甘沉沦 提交于 2019-12-05 05:04:48
I have written an entitity class with Field LoginId and Password. Iam encrypting the passwrd and stoiring it in the db using the AES_ENCRYPT. I want to retrive only the password which is decrypted. so, im using AES_DECRYPT using NAtiveQueryis in OPen JPA 2.0. Query i have written is : Query q = em.createNativeQuery("select AES_DECRYPT(l.password,?2) from loginDetails l where l.loginID = ?1"); q.setParameter(1, loginId); q.setParameter(2, getKey()); String s = q.getSingleResult(); But im getting the following exception: java.lang.ClassCastException: [B cannot be cast to java.lang.String at com

Can I inject proxies in front of Blueprint services published by other bundles?

核能气质少年 提交于 2019-12-02 18:29:48
问题 We are using Karaf and a number of OSGI Blueprint services to implement a system. Is it possible to make a "BundleListener" type of bundle that, when present in the OSGI container, decorates our Blueprint services with a proxy so bundles referring these services will call the proxy instead? (I guess this could be accomplished either by somehow adding the proxy in front of the service already in the Service Registry, or by changing the reference obtained by the referring bundle -

Can I inject proxies in front of Blueprint services published by other bundles?

夙愿已清 提交于 2019-12-02 09:06:06
We are using Karaf and a number of OSGI Blueprint services to implement a system. Is it possible to make a "BundleListener" type of bundle that, when present in the OSGI container, decorates our Blueprint services with a proxy so bundles referring these services will call the proxy instead? (I guess this could be accomplished either by somehow adding the proxy in front of the service already in the Service Registry, or by changing the reference obtained by the referring bundle - ServiceTracker.addingService style) The standard way to do these hacks is to use the service hooks in the OSGi core

Wiring a prototype in blueprint

半世苍凉 提交于 2019-12-02 09:01:15
问题 Like Spring, blueprint supports the prototype scope. But unlike Spring I can't see any documentation about how to use it. In Spring you can ask the context to give you a new bean, what's the equivalent in the Blueprint world? 回答1: BlueprintContainer.getComponentInstance() does exactly what you are looking for. osgi documentation: A Blueprint Container represents the managed state of a Blueprint bundle. A Blueprint Container provides access to all managed components. These are the beans,

Bundle is waiting for namespace handlers [http://camel.apache.org/schema/blueprint]

僤鯓⒐⒋嵵緔 提交于 2019-12-01 06:26:08
I have written a simple apache camel project which will eventually be deployed in a FUSE container. For now, I'm simply trying to get a basic unit test working. I'm using the example here as a starting point. I have written unit tests which work, but when I include a blueprint file, I get the following entry in the test output: Bundle TestMainRoute is waiting for namespace handlers [http://camel.apache.org/schema/blueprint] And the test fails with the following stack trace: java.lang.RuntimeException: Gave up waiting for service (objectClass=org.apache.camel.CamelContext) at org.apache.camel

Bundle is waiting for namespace handlers [http://camel.apache.org/schema/blueprint]

雨燕双飞 提交于 2019-12-01 05:34:28
问题 I have written a simple apache camel project which will eventually be deployed in a FUSE container. For now, I'm simply trying to get a basic unit test working. I'm using the example here as a starting point. I have written unit tests which work, but when I include a blueprint file, I get the following entry in the test output: Bundle TestMainRoute is waiting for namespace handlers [http://camel.apache.org/schema/blueprint] And the test fails with the following stack trace: java.lang