Is there a way to run karaf providing user and pass that it executes a command and exit

2019-04-30 Thread ellirael
Something like this:
karaf -u user -p password feature:install wrapper && wrapper:install



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html


Re: Kar needs to be uninstalled twice

2017-02-13 Thread ellirael
up



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Kar-needs-to-be-uninstalled-twice-tp4049390p4049546.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Maven bundle plaugin ver 3.2 adds "aries-jpa" require capability

2017-02-13 Thread ellirael
гз



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Maven-bundle-plaugin-ver-3-2-adds-aries-jpa-require-capability-tp4049391p4049545.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Maven bundle plaugin ver 3.2 adds "aries-jpa" require capability

2017-01-31 Thread ellirael
I need to mention that there is no error message in console. Kar is not
installed.
Error mesage info could be found in the log:
2017-01-31 13:48:41,786 | WARN  | nsole user karaf | KarServiceImpl 
 
| 152 - org.apache.karaf.kar.core - 4.0.8 | Unable to install Kar feature
lorien-niichi/0.2.0.SNAPSHOT
org.osgi.service.resolver.ResolutionException: Unable to resolve root:
missing requirement [root] osgi.identity; osgi.identity=lorien-niichi;
type=karaf.feature; version="[0.2.0.SNAPSHOT,0.2.0.SNAPSHOT]";
filter:="(&(osgi.identity=lorien-niichi)(type=karaf.feature)(version>=0.2.0.SNAPSHOT)(version<=0.2.0.SNAPSHOT))"
[caused by: Unable to resolve lorien-niichi/0.2.0.SNAPSHOT: missing
requirement [lorien-niichi/0.2.0.SNAPSHOT] osgi.identity;
osgi.identity=biz.lorien.niichi.model; type=osgi.bundle;
version="[0.2.0.SNAPSHOT,0.2.0.SNAPSHOT]"; resolution:=mandatory [caused by:
Unable to resolve biz.lorien.niichi.model/0.2.0.SNAPSHOT: missing
requirement [biz.lorien.niichi.model/0.2.0.SNAPSHOT] osgi.extender;
osgi.extender=aries.jpa]]
at
org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)[8:org.apache.karaf.features.core:4.0.8]
at
org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:389)[8:org.apache.karaf.features.core:4.0.8]
at
org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375)[8:org.apache.karaf.features.core:4.0.8]
at
org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:347)[8:org.apache.karaf.features.core:4.0.8]
at
org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:216)[8:org.apache.karaf.features.core:4.0.8]
at
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263)[8:org.apache.karaf.features.core:4.0.8]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1176)[8:org.apache.karaf.features.core:4.0.8]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1074)[8:org.apache.karaf.features.core:4.0.8]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Maven-bundle-plaugin-ver-3-2-adds-aries-jpa-require-capability-tp4049391p4049392.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Maven bundle plaugin ver 3.2 adds "aries-jpa" require capability

2017-01-31 Thread ellirael
My model bundle manifest part:
Require-Capability: osgi.extender;osgi.extender="aries.jpa",osgi.ee;fi
 lter:="(&(osgi.ee=JavaSE)(version=1.8))"

Feature installer cannot satisfy "aries-jpa" require capability when
installing a feature.
When I install bundle by bundle there is no error message. And all is
working fine.

Downgrading to bundle-pluging ver 3.0.1 solves the problem.

Since Karaf itself is built by 3.2 version it is pretty logical to build
functional applications with ver 3.2 also.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Maven-bundle-plaugin-ver-3-2-adds-aries-jpa-require-capability-tp4049391.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Kar needs to be uninstalled twice

2017-01-31 Thread ellirael
Check my console log

karaf@root()> kar:list
KAR Name

lorien-niichi-0.1.0-SNAPSHOT

karaf@root()> kar:uninstall lorien-niichi-0.1.0-SNAPSHOT
Error executing command: Feature named 'lorien-niichi/0.1.0.SNAPSHOT' is not
installed

karaf@root()> kar:list
KAR Name

lorien-niichi-0.1.0-SNAPSHOT

karaf@root()> kar:uninstall lorien-niichi-0.1.0-SNAPSHOT
karaf@root()> kar:list
KAR Name




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Kar-needs-to-be-uninstalled-twice-tp4049390.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: factory configuration record deletion

2016-08-23 Thread ellirael
yep. i need it too

and does anybody know how to define factory config in a feature?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/factory-configuration-record-deletion-tp4047500p4047627.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: openjpa/2.4.1 and jpa/2.3.0 features

2016-06-15 Thread ellirael
Oh I found related bug https://issues.apache.org/jira/browse/KARAF-4535
It seems openjpa is not working out of the box for now.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/openjpa-2-4-1-and-jpa-2-3-0-features-tp4046860p4046870.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: openjpa 2.4.1

2016-06-14 Thread ellirael
Has anybody got a working example with OpenJPA 2.4.1?

My model EntityManager is not registered as a service.
My api cannot start:
Error executing command: Error executing command on bundles:
Error starting bundle 223: Uses constraint violation. Unable to
resolve resource biz.lorien.niichi.api [biz.lorien.niichi.api [223]
(R 223.1)] because it is exposed to package 'javax.persistence' from
resources org.apache.geronimo.specs.geronimo-jpa_2.0_spec [org.apache.
geronimo.specs.geronimo-jpa_2.0_spec [115](R 115.0)] and javax.persistence
[javax.persistence [58](R 58.0)] via two dependency chains.

Chain 1:
  biz.lorien.niichi.api [biz.lorien.niichi.api [223](R 223.1)]
import:
(&(osgi.wiring.package=javax.persistence)(version>=1.1.0)(!(version>=2.0.0)))
 |
export: osgi.wiring.package: javax.persistence
  org.apache.geronimo.specs.geronimo-jpa_2.0_spec
[org.apache.geronimo.specs.geronimo-jpa_2.0_spec [115](R 115.0)]

Chain 2:
  biz.lorien.niichi.api [biz.lorien.niichi.api [223](R 223.1)]
import:
(&(osgi.wiring.package=org.apache.aries.jpa.supplier)(version>=1.0.0)(!(version>=2.0.0)))
 |
export: osgi.wiring.package=org.apache.aries.jpa.supplier;
uses:=javax.persistence
  org.apache.aries.jpa.api [org.apache.aries.jpa.api [81](R 81.0)]
import:
(&(osgi.wiring.package=javax.persistence)(version>=1.1.0)(!(version>=3.0.0)))
 |
export: osgi.wiring.package: javax.persistence
  javax.persistence [javax.persistence [58](R 58.0)] Unresolved
requirements: [[biz.lorien.niichi.api [223](R 223.1)] osgi.wiring.package;
(&(osgi.wiring.package=org.apache.aries.jpa.supplier)(version>=1.0.0)(!(version>=2.0.0)))]

All is ok with JPA Eclipselink implemetation.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/openjpa-2-4-1-tp4045020p4046862.html
Sent from the Karaf - User mailing list archive at Nabble.com.


openjpa/2.4.1 and jpa/2.3.0 features

2016-06-14 Thread ellirael
openjpa/2.4.1 feature depends on and installs persistence-api 2.0 featute.
jpa/2.3.0 feature depends on and installs persistence-api 2.1 featute.

We have two versions of persistence api.
Can it be some sort of version conflict between openjpa/2.4.1 and jpa/2.3.0
features?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/openjpa-2-4-1-and-jpa-2-3-0-features-tp4046860.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: How to inject constant values to my properties via blueprint?

2016-05-31 Thread ellirael
Any ideas? It is common task to init something with constant values.

Another example:




I need to use constant value instead String one. Like this:







--
View this message in context: 
http://karaf.922171.n3.nabble.com/How-to-inject-constant-values-to-my-properties-via-blueprint-tp4046734p4046749.html
Sent from the Karaf - User mailing list archive at Nabble.com.


How to share HTTPContext between two bundles?

2016-05-31 Thread ellirael
I register Servlet in one bundle via blueprint. And I register Filter in a
nother bndle using blueprint also, whiteboard pattern.
To make things work I need my bundles share the same HTTPContext.

I looked through https://ops4j1.jira.com/projects/PAXWEB/issues/PAXWEB-344?
but couldnt firure out what should I do to solve my problem. Any ideas?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/How-to-share-HTTPContext-between-two-bundles-tp4046748.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: How to inject constant values to my properties via blueprint?

2016-05-30 Thread ellirael
I have got an interface that holds my constant values. For example rolenames.

Now I want inject one of my constant value to bean's property.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/How-to-inject-constant-values-to-my-properties-via-blueprint-tp4046734p4046736.html
Sent from the Karaf - User mailing list archive at Nabble.com.


How to inject constant values to my properties via blueprint?

2016-05-30 Thread ellirael
How should I do it? For example I use something like this:
#{T(mypack.MyInterface).ROLE_NAME}



--
View this message in context: 
http://karaf.922171.n3.nabble.com/How-to-inject-constant-values-to-my-properties-via-blueprint-tp4046734.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Deploy datasource config with feature.xml

2016-04-05 Thread ellirael
Could it be related somehow to:
http://karaf.922171.n3.nabble.com/Factory-config-in-feature-xml-td4045530.html



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Deploy-datasource-config-with-feature-xml-tp4045941p4046177.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Blueprint or DS or what to use?

2016-03-19 Thread ellirael
I personally use Blueprint cause of:
1. common spring-like xml style of DI
2. prototype scopes
3. creating and describing internal skeleton of bundle in one file
4. CXF integration




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Blueprint-or-DS-or-what-to-use-tp4045845p4045852.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Factory config in feature.xml

2016-02-24 Thread ellirael
How can I define factory config in feature.xml file? Basic config works fine.
*For example* I need to "featurize" this script:
config:edit --factory org.ops4j.datasource
config:property-append dataSourceName ds
config:property-append osgi.jdbc.driver.name postgresql-pool-xa
config:property-append url jdbc:postgresql://ds
config:property-append user user
config:property-append password pass
config:property-append pool.testOnBorrow true
config:update

How to do it in general. Not for datasource creation use case only.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Factory-config-in-feature-xml-tp4045530.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Building karaf custom destribution with eventadmin as a startup feature

2016-02-17 Thread ellirael
jbonofre wrote
> I remember I changed the assembly archetype due to an issue when an user 
> define eventadmin as boot or startup feature.

Does it mean I should wait for a bug fix and removing runtime scope for
standard feature is another work-around?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Building-karaf-custom-destribution-with-eventadmin-as-a-startup-feature-tp4045415p4045433.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Building karaf custom destribution with eventadmin as a startup feature

2016-02-17 Thread ellirael
Thanks. It works.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Building-karaf-custom-destribution-with-eventadmin-as-a-startup-feature-tp4045415p4045432.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Dynamically wrapping jars

2016-02-17 Thread ellirael
I unstall my DB2 driver with this command:
install -s
wrap:mvn:com.ibm.db2.jdbc/db2jcc4\$Export-Package=com.ibm.db2.jcc\;version=4.18.60=4.18.60=com.ibm.db2.jdbc.db2jcc4=IBM\%20DB2\%20Driver

All is ok and is working fine.

But now I put it in my feature project and I have got some problems.
I cannot figure it out how to type my feature in template for making build
works.

This works in feature template:
wrap:mvn:com.ibm.db2.jdbc/db2jcc4$Export-Package=com.ibm.db2.jcc

But any instructions I add after Export-Package ruins the feauture build
process.

And I wish I have a possibility to customise wrapping when I do not use
feature templates at all, when I descrive my feature with maven
dependencies.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Dynamically-wrapping-jars-tp4045411.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: NullPointer Exception when deploying EclipseLink model bundle

2016-02-17 Thread ellirael
Any thoughts of the reason or how to get rid of this exception?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/NullPointer-Exception-when-deploying-EclipseLink-model-bundle-tp4044897p4045410.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Building karaf custom destribution with eventadmin as a startup feature

2016-02-17 Thread ellirael
I've a got a problem when define eventadmin feature as a startup feature. As
it should be. When I do it the build of custom destribution fails with
bundle resolve errors.

My work around is to maually defne startup.properties file and put it in
archive during build.
I describe then eventadmin as installed feature.




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Building-karaf-custom-destribution-with-eventadmin-as-a-startup-feature-tp4045415.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Dynamically wrapping jars

2016-02-17 Thread ellirael
The error message looks like:

[ERROR] Failed to execute goal
org.apache.karaf.tooling:karaf-maven-plugin:4.0.4:features-generate-descriptor
(default-features-generate-des
criptor) on project jdbc: Unable to create features.xml file:
java.lang.RuntimeException: Unable to load file:
.../feature/filteredInputFeature.xml: UnmarshalException: The reference to
entity "Bundle-Version" must end with the ';' delimiter. -> [Help 1]



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Dynamically-wrapping-jars-tp4045411p4045414.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 4.0.4 boot features not working

2016-02-15 Thread ellirael
I have checked your use case. Everything works for me.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-0-4-boot-features-not-working-tp4045121p4045369.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: [ANN] Apache Karaf 4.0.4 released

2016-01-19 Thread ellirael
I just see the one of purposes of this mailing group be a knowledge exchange.
I just want to ask the developers should I take a close view on that
dependency upgrades to know API changes. Or it is bug fixes only upgrades.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/ANN-Apache-Karaf-4-0-4-released-tp4044829p4044910.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Configuring connection pool properties

2016-01-19 Thread ellirael
I checked https://ops4j1.jira.com/wiki/display/PAXJDBC/Documentation page.
And I couldn't find the info you mentioned. :(
Christian, may be you know the site where to look?

What is your plans about Postresql adapter?
Check
http://karaf.922171.n3.nabble.com/Karaf-4-ds-create-command-creates-wrong-config-for-Postgres-td4043304.html

What is scheduled date for 0.8 release?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Configuring-connection-pool-properties-tp4044805p4044912.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: [ANN] Apache Karaf 4.0.4 released

2016-01-19 Thread ellirael
Thanks for an answer. But I cannot completely agree with you. One of 4.0.x
release seriously changed ways of working with jpa and transactions. But
yes, with backward compatibility.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/ANN-Apache-Karaf-4-0-4-released-tp4044829p4044913.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Configuring connection pool properties

2016-01-19 Thread ellirael
Thanks guys. I successfully created my DS with config scope commands.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Configuring-connection-pool-properties-tp4044805p4044917.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: [ANN] Apache Karaf 4.0.4 released

2016-01-15 Thread ellirael
* KARAF-4197 - Upgrade to blueprint.core-1.5.0, jpa-2.3.0,
transaction.blueprint-2.1.0
* KARAF-4220 - Upgrade to eclipselink 2.6.1
* KARAF-4230 - Upgrade to Aries Blueprint Core 1.5.0
* KARAF-4233 - Upgrade to Aries JPA Container 1.0.3

Any new API or other changes here?
Or bug fixes in dependencies only?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/ANN-Apache-Karaf-4-0-4-released-tp4044829p4044852.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: [ANN] Apache Karaf 4.0.4 released

2016-01-15 Thread ellirael
It may be dependency bug fix or new API introduced.

Like it was with Karaf 4.0.2 version:
Aries Transaction 2.0.0 is using pure @Transactional annotations. The
xml only contains an enabled Element to activate this.
So if you use the new namespace you will use this approach if you use
the old one nothing changes as it will be handled by the old version.
Aries JPA 2.2.0 uses an improved mechanism to bind the EntityManager
service. So your bundle should go into graceperiod until it is found.




--
View this message in context: 
http://karaf.922171.n3.nabble.com/ANN-Apache-Karaf-4-0-4-released-tp4044829p4044867.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Configuring connection pool properties

2016-01-15 Thread ellirael
Anybody?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Configuring-connection-pool-properties-tp4044805p4044868.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Configuring connection pool properties

2016-01-13 Thread ellirael
How can I configure connection pool properties for datasources created by
ds-create command?
I am using dbcp2 implementation.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Configuring-connection-pool-properties-tp4044805.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Aries JPA blueprint schema locations

2015-12-14 Thread ellirael
Oh, thanks a lot.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Aries-JPA-blueprint-schema-locations-tp4043435p4044291.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Aries JPA blueprint schema locations

2015-12-14 Thread ellirael
How does user know what xml schemas version is supported by Karaf verision?




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Aries-JPA-blueprint-schema-locations-tp4043435p4044282.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karan Command Blueprint Bean Injection

2015-12-04 Thread ellirael
Yep JB, I've found it by myself. But I could not find a way to surpass a
filter expression. How to do it?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karan-Command-Blueprint-Bean-Injection-tp4044096p4044105.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Problems with Apache Aries Transaction Blueprint bundle start in Karaf 4.0.3

2015-11-23 Thread ellirael
I've *never* seen Transaction bundle fail without exception from JMX. But
I've seen exception from JMX without Transaction bundle fail.

Looking forward to hear from you.
This problem is pretty stable in my environment.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Problems-with-Apache-Aries-Transaction-Blueprint-bundle-start-in-Karaf-4-0-3-tp4043420p4043675.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Problems with Apache Aries Transaction Blueprint bundle start in Karaf 4.0.3

2015-11-21 Thread ellirael
I have recorded some logs with DEBUG level. One with normal start and another
with problem start.
http://www.lorien.biz/karaf/logs.zip
May be it can help.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Problems-with-Apache-Aries-Transaction-Blueprint-bundle-start-in-Karaf-4-0-3-tp4043420p4043648.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Problems with Apache Aries Transaction Blueprint bundle start in Karaf 4.0.3

2015-11-17 Thread ellirael
I figured out how to get an exception.
Watch this video please: https://www.youtube.com/watch?v=GzFy_suhwNg
OS: Win7 x64



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Problems-with-Apache-Aries-Transaction-Blueprint-bundle-start-in-Karaf-4-0-3-tp4043420p4043564.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Problems with Apache Aries Transaction Blueprint bundle start in Karaf 4.0.3

2015-11-12 Thread ellirael
Any new info here?
This problem kills production env for sure.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Problems-with-Apache-Aries-Transaction-Blueprint-bundle-start-in-Karaf-4-0-3-tp4043420p4043482.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Problems with Apache Aries Transaction Blueprint bundle start in Karaf 4.0.3

2015-11-11 Thread ellirael
I have found some unstable behavior when starting Karaf 4.0.3.
Apache Aries Transaction Blueprint 2.0.0 bundle start success is random.
I have to restart Karaf several (about 3 to 10) times to get the error.
It looks like it is some sort of a bundle race or something.

*The list of features to be installed:*
feature:install -v eventadmin/${version};
feature:install -v http-whiteboard/${version};
feature:install -v jdbc/${version};
feature:install -v pax-jdbc-pool-dbcp2/0.7.0;
feature:install -v eclipselink/2.6.0;
feature:install -v jpa/2.2.0;

*Exception during Karaf start:*
karaf@root()> ERROR: Bundle org.apache.aries.blueprint.core [13]
EventDispatcher: Error during dispatch. (java.lang.NullPointerException)
java.lang.NullPointerException
at
org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl.addingService(NamespaceHandlerRegistryImpl.java:126)
at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at
org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
at
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)
at
org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:991)
at
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:839)
at
org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:546)
at
org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)
at org.apache.felix.framework.Felix.registerService(Felix.java:3549)
at
org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:459)
at
org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:193)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:710)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:385)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:270)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
at
org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

*Cut from bundle:list command result:*
108 | Active   |  80 | 1.2 | javax.interceptor API
109 | Active   |  80 | 1.2 | javax.transaction API
110 | Active   |  80 | 1.1.1   | Apache Aries Transaction
Blueprint
111 | Failure  |  80 | 2.0.0   | Apache Aries Transaction
Blueprint
112 | Active   |  80 | 1.3.0   | Apache Aries Transaction
Manager

*Diag command result for problem bundle:*
Apache Aries Transaction Blueprint (111)

Status: Failure
Blueprint
11.11.15 12:06
Exception:
Service already unregistered.
java.lang.IllegalStateException: Service already unregistered.
at
org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:140)
at
org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:195)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:710)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:385)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:270)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
at

Re: Problems with Apache Aries Transaction Blueprint bundle start in Karaf 4.0.3

2015-11-11 Thread ellirael
Should eventadmin be in this list?

On a clean Karaf:
karaf@root()> feature:list -i
Name| Version | Required | State   | Repository |
Description
---
aries-proxy | 4.0.3   |  | Started | standard-4.0.3 | Aries
Proxy
aries-blueprint | 4.0.3   | x| Started | standard-4.0.3 | Aries
Blueprint
feature | 4.0.3   | x| Started | standard-4.0.3 | Features
Support
shell   | 4.0.3   | x| Started | standard-4.0.3 | Karaf
Shell
shell-compat| 4.0.3   | x| Started | standard-4.0.3 | Karaf
Shell Compatibility
deployer| 4.0.3   | x| Started | standard-4.0.3 | Karaf
Deployer
bundle  | 4.0.3   | x| Started | standard-4.0.3 | Provide
Bundle support
config  | 4.0.3   | x| Started | standard-4.0.3 | Provide
OSGi ConfigAdmin support
diagnostic  | 4.0.3   | x| Started | standard-4.0.3 | Provide
Diagnostic support
instance| 4.0.3   | x| Started | standard-4.0.3 | Provide
Instance support
jaas| 4.0.3   | x| Started | standard-4.0.3 | Provide
JAAS support
log | 4.0.3   | x| Started | standard-4.0.3 | Provide
Log support
package | 4.0.3   | x| Started | standard-4.0.3 | Package
commands and mbeans
service | 4.0.3   | x| Started | standard-4.0.3 | Provide
Service support
system  | 4.0.3   | x| Started | standard-4.0.3 | Provide
System support
kar | 4.0.3   | x| Started | standard-4.0.3 | Provide
KAR (KARaf archive) support
ssh | 4.0.3   | x| Started | standard-4.0.3 | Provide a
SSHd server on Karaf
management  | 4.0.3   | x| Started | standard-4.0.3 | Provide a
JMX MBeanServer and a set of MBeans in
wrap| 0.0.0   | x| Started | standard-4.0.3 | Wrap URL
handler



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Problems-with-Apache-Aries-Transaction-Blueprint-bundle-start-in-Karaf-4-0-3-tp4043420p4043426.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Problems with Apache Aries Transaction Blueprint bundle start in Karaf 4.0.3

2015-11-11 Thread ellirael
Do we need eventadmin feature nowtimes?

karaf@root()> feature:list | grep event
eventadmin| 4.0.3|  | Uninstalled |
standard-4.0.3

karaf@root()> feature:install eventadmin
karaf@root()> feature:list | grep event

eventadmin| 4.0.3| x| Started |
standard-4.0.3



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Problems-with-Apache-Aries-Transaction-Blueprint-bundle-start-in-Karaf-4-0-3-tp4043420p4043431.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Problems with Apache Aries Transaction Blueprint bundle start in Karaf 4.0.3

2015-11-11 Thread ellirael
>But I meant that eventadmin bundle is part of startup.properties.
What does it change for me as a user?




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Problems-with-Apache-Aries-Transaction-Blueprint-bundle-start-in-Karaf-4-0-3-tp4043420p4043434.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Cant create JDBC DS (4.0.2)

2015-11-11 Thread ellirael
And check this thread:
http://karaf.922171.n3.nabble.com/Karaf-4-ds-create-command-creates-wrong-config-for-Postgres-tp4043304.html



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Cant-create-JDBC-DS-4-0-2-tp4043368p4043421.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 4 ds-create command creates wrong config for Postgres

2015-11-09 Thread ellirael
Should I wait for pax-jdbc 8 or something?
Do you plan to include pax-jdbc in karaf distribution cause jdbc scope
commands are useless without it?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-ds-create-command-creates-wrong-config-for-Postgres-tp4043304p4043372.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 4 ds-create command creates wrong config for Postgres

2015-11-09 Thread ellirael
What's the sheduled 4.0.3 release date?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-ds-create-command-creates-wrong-config-for-Postgres-tp4043304p4043388.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Karaf 4 ds-create command creates wrong config for Postgres

2015-11-05 Thread ellirael
There was a change with DataSource creation in Karaf 4.
The new ds-create command creates configs fox pax-jdbc adapters for
DataSourceFactories.

But the current pax-jdbc-version 7.0 doesn't include an adapter for
Postgres.
The Postgress team coded their factory/adpater in their driver.

But their code requires a little bit different config file.

Needed:
dataSourceName="test_postgres"
osgi.jdbc.driver.name="PostgreSQL\ JDBC\ Driver-pool-xa"
serverName="host"
portNumber="5432"
databaseName="n"
user="u"
password="p"

Generated by ds-create:
dataSourceName="test_postgres"
osgi.jdbc.driver.name="PostgreSQL\ JDBC\ Driver-pool-xa"
url="connection_string"
user="u"
password="p"

The only way to setup Postgres connection I know is to go the bundle3 folder
and manually change it.

But I need to do this configuration in Karaf shell script.




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-ds-create-command-creates-wrong-config-for-Postgres-tp4043304.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Bundle is waiting for namespace handlers [http://aries.apache.org/xmlns/jpa/v1.0.0]

2015-09-07 Thread ellirael
Mohammad, things changed slightly in karaf 4.

Check this page: http://aries.apache.org/modules/jpaproject.html.




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Bundle-is-waiting-for-namespace-handlers-http-aries-apache-org-xmlns-jpa-v1-0-0-tp4042275p4042371.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 4 command bundle using service

2015-09-03 Thread ellirael
I need to say that it is appearing/disappearing bug. Sometimes I have it.
Sometimes I have not.
I cannot understand a reason or prerequisites.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-command-bundle-using-service-tp4042065p4042313.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 4 command bundle using service

2015-09-01 Thread ellirael
I mean command disappears.

139 | Active |  80 | 1.0.0.SNAPSHOT  | Lorien Niichi API
140 | Active |  80 | 1.0.0.SNAPSHOT  | Lorien Niichi Command
karaf@root()> niichi
niichi   niichi:add-player
karaf@root()> niichi:add-player
Error executing command niichi:add-player: argument id is required
karaf@root()> update 139
[EL Warning]: 2015-09-01 12:17:41.524--session_manager_no_partition
[EL Warning]: 2015-09-01 12:17:46.335--session_manager_no_partition
karaf@root()> niichi:add-player
Command not found: niichi:add-player
karaf@root()>

Command bundle is active afte updating service bundle.
139 | Active |  80 | 1.0.0.SNAPSHOT  | Lorien Niichi API
140 | Active |  80 | 1.0.0.SNAPSHOT  | Lorien Niichi Command
karaf@root()>



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-command-bundle-using-service-tp4042065p404.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 4 command bundle using service

2015-09-01 Thread ellirael
Need help to resolve it.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-command-bundle-using-service-tp4042065p4042219.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 4 command bundle using service

2015-09-01 Thread ellirael
karaf@root()> service:list PlayerService
[biz.lorien.niichi.api.service.PlayerService]
-
 osgi.service.blueprint.compname = playerService
 service.bundleid = 139
 service.id = 168
 service.scope = bundle
Provided by :
 Lorien Niichi API (139)

karaf@root()>



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-command-bundle-using-service-tp4042065p4042224.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 4 command bundle using service

2015-09-01 Thread ellirael
Restarting command bundle doesn't help.
Uninstalling and installing command bundle helps.

BTW, why do I keep getting that nasty EclipseLink warning?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-command-bundle-using-service-tp4042065p4042226.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 4 command bundle using service

2015-09-01 Thread ellirael
Service is present.

I have installed different verision of vaadin - 7.5.4 instead of 7.4.5. It
is strange but the problem is gone.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-command-bundle-using-service-tp4042065p4042251.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 4 command bundle using service

2015-09-01 Thread ellirael
In my case command disappearing is very stable.
There is a log on "restart 139" command:

* diffs k1.log, k2.log
2015-09-01 17:37:32,228 | INFO  | nsole user karaf | BlueprintExtender  
 
| 12 - org.apache.aries.blueprint.core - 
1.4.3 | Destroying BlueprintContainer for bundle biz.lorien.niichi.api
2015-09-01 17:37:32,229 | INFO  | nsole user karaf | CommandExtension   
 
| 43 - org.apache.karaf.shell.core - 4.0.
1 | Unregistering commands for bundle
biz.lorien.niichi.command/1.0.0.SNAPSHOT
2015-09-01 17:37:32,232 | INFO  | nsole user karaf |
PersistenceBundleTracker | 114 - org.apache.aries.jpa.container - 
2.1.0 | removing persistence units for biz.lorien.niichi.api UNINSTALLED
2015-09-01 17:37:32,233 | INFO  | nsole user karaf |
PersistenceProviderTracker   | 114 - org.apache.aries.jpa.container - 
2.1.0 | Lost provider for niichi
org.eclipse.persistence.jpa.PersistenceProvider
2015-09-01 17:37:32,233 | INFO  | nsole user karaf | DataSourceTracker  
 
| 114 - org.apache.aries.jpa.container - 
2.1.0 | Lost DataSource for niichi
osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=niichi)
2015-09-01 17:37:35,303 | INFO  | nsole user karaf |
PersistenceBundleTracker | 114 - org.apache.aries.jpa.container - 
2.1.0 | Found persistence unit niichi in bundle biz.lorien.niichi.api with
provider org.eclipse.persistence.jpa.PersistenceProv
ider.
2015-09-01 17:37:35,313 | INFO  | nsole user karaf |
PersistenceProviderTracker   | 114 - org.apache.aries.jpa.container - 
2.1.0 | Found provider for niichi
org.eclipse.persistence.jpa.PersistenceProvider
2015-09-01 17:37:35,353 | INFO  | nsole user karaf | JPAWeavingHook 
 
| 114 - org.apache.aries.jpa.container - 
2.1.0 | Adding transformer
org.eclipse.persistence.internal.jpa.weaving.PersistenceWeaver
2015-09-01 17:37:35,356 | INFO  | nsole user karaf | DataSourceTracker  
 
| 114 - org.apache.aries.jpa.container - 
2.1.0 | Tracking DataSource for punit niichi with filter
(&(objectClass=javax.sql.DataSource)(osgi.jndi.service.name=niichi))
2015-09-01 17:37:35,357 | INFO  | nsole user karaf | DataSourceTracker  
 
| 114 - org.apache.aries.jpa.container - 
2.1.0 | Found DataSource for niichi
osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=niichi)
2015-09-01 17:37:35,361 | INFO  | ies.jpa.niichi]) | ManagedEMF 
 
| 114 - org.apache.aries.jpa.container - 
2.1.0 | Registering EntityManagerFactory for persistence unit niichi
2015-09-01 17:37:35,462 | INFO  | ies.jpa.niichi]) | JPAWeavingHook 
 
| 114 - org.apache.aries.jpa.container - 
2.1.0 | Adding transformer
org.eclipse.persistence.internal.jpa.weaving.PersistenceWeaver
*




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-command-bundle-using-service-tp4042065p4042249.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Aries JPA EmSupplier understanding

2015-08-26 Thread ellirael
Looking through page at http://aries.apache.org/modules/jpaproject.html and
samples at
https://svn.apache.org/repos/asf/aries/trunk/jpa/examples/tasklist-blueprint/src/main/java/org/apache/aries/jpa/example/tasklist/blueprint/impl/
I understand that I should use EmSupplier if I want thread safe application.

But I cannot understand some rows in the example.

@Transaction 
@Override
public void addTask(Task task) {
em.get().persist(task);
em.get().flush();
}
Does @Transaction annotation do or mean something? How is it merged with
tx tag in blueprint config?
Shouldn't I get EntityManager once in a method and use it?
  EntityManage em =  emSupplier.get();
  em.persist(task);
  em.flush();


   @Override
public void deleteTask(Integer id) {
em.get().remove(getTask(id));
}
Why we delete newly queried object from database instead of object that
client views? There can be changes from other clients in database and we
delete the same object but not the same object state.
I'd like to be sure that I delete that I viewed.

public void setEm(EmSupplier em) {
this.em = em;
}
Is there any need in this setter method?! I thought there is field
injection.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Aries-JPA-EmSupplier-understanding-tp4042066.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Karaf 4 command bundle using service

2015-08-26 Thread ellirael
I've got 2 bundles. One registers the service via blueprint. And another one
is command bundle. Command bundle injects registered service with command
lifecycle annotation. The problem is when I update service bundle command
disappears until I restart Karaf.

package biz.lorien.niichi.command;

import biz.lorien.niichi.api.model.entity.Player;
import biz.lorien.niichi.api.service.PlayerService;
import org.apache.karaf.shell.api.action.Action;
import org.apache.karaf.shell.api.action.Argument;
import org.apache.karaf.shell.api.action.Command;
import org.apache.karaf.shell.api.action.lifecycle.Reference;
import org.apache.karaf.shell.api.action.lifecycle.Service;

@Service
@Command(scope = niichi, name = add-player)
public class AddPlayerCommand implements Action {

@Reference
private PlayerService playerService;

@Argument(index = 0, name = id, required = true, multiValued = false)
private String id;

@Argument(index = 1, name = name, required = true, multiValued =
false)
private String name;

@Override
public Object execute() throws Exception {
Player player = new Player();
player.setId(id);
player.setName(name);
player.setNiichi(true);
playerService.addPlayer(player);
return player;
}

}




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-command-bundle-using-service-tp4042065.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Need help with OpenJPA JTA

2015-08-12 Thread ellirael
I've created api and command bundles.
My api bundle uses OpenJPA and registers PlayerService.
My command bundle uses PlayerService to add some players.

EntityManagerFactory is successfully created for my api bundle.

My *persistence.xml* file:
?xml version=1.0 encoding=UTF-8?
persistence version=2.0 xmlns=http://java.sun.com/xml/ns/persistence;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd;
persistence-unit name=niichi transaction-type=JTA
providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider
jta-data-sourceosgi:service/javax.sql.DataSource/(osgi.jndi.service.name=niichi)/jta-data-source
class.../class
/persistence-unit
/persistence

My *blueprint.xml* file:
?xml version=1.0 encoding=UTF-8?
blueprint xmlns=http://www.osgi.org/xmlns/blueprint/v1.0.0; 
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
   xmlns:jpa=http://aries.apache.org/xmlns/jpan/v1.0.0;
   xmlns:tx=http://aries.apache.org/xmlns/transactions/v1.0.0; 
   xsi:schemaLocation=
http://www.osgi.org/xmlns/blueprint/v1.0.0
https://osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://aries.apache.org/xmlns/transactions/v1.0.0
http://aries.apache.org/schemas/transaction/transactionv10.xsd;
jpa:enable /
reference id=eventAdmin interface=org.osgi.service.event.EventAdmin
/
bean id=playerDao
class=biz.lorien.niichi.api.internal.JpaPlayerDao
tx:transaction method=* value=Required /
/bean
bean id=playerService
class=biz.lorien.niichi.api.internal.OsgiPlayerService
property name=eventAdmin ref=eventAdmin /
property name=playerDao ref=playerDao /
/bean
service interface=biz.lorien.niichi.api.services.PlayerService
ref=playerService /
/blueprint

When I run my command I get his text in log:
2015-08-13 08:29:01,409 | WARN  | nsole user karaf | EMSupplierImpl 
 
| 111 - org.apache.aries.jpa.support - 2.0.0 | No EntityManager present on
this thread. Remember to call preCall() first
2015-08-13 08:29:01,409 | ERROR | nsole user karaf | ShellUtil  
 
| 43 - org.apache.karaf.shell.core - 4.0.0 | Exception caught while
executing command
java.lang.NullPointerException
at
org.apache.aries.jpa.support.impl.EMSupplierImpl.closeAndRemoveLocalEm(EMSupplierImpl.java:118)[111:org.apache.aries.jpa.support:2.0.0]
at
org.apache.aries.jpa.support.impl.EMSupplierImpl.postCall(EMSupplierImpl.java:110)[111:org.apache.aries.jpa.support:2.0.0]
at
org.apache.aries.jpa.blueprint.supplier.impl.EmSupplierProxy.postCall(EmSupplierProxy.java:68)[109:org.apache.aries.jpa.blueprint:2.0.0]
at
org.apache.aries.jpa.blueprint.impl.JpaInterceptor.postCallWithException(JpaInterceptor.java:62)[109:org.apache.aries.jpa.blueprint:2.0.0]
at
org.apache.aries.blueprint.proxy.Collaborator.postInvokeExceptionalReturn(Collaborator.java:136)[12:org.apache.aries.blueprint.core:1.4.3]
at Proxy15739f62_90de_433c_be3c_257ec24b7289.addPlayer(Unknown 
Source)[:]
at
biz.lorien.niichi.api.internal.OsgiPlayerService.addPlayer(OsgiPlayerService.java:26)[125:biz.lorien.niichi.api:1.0.0.SNAPSHOT]
at
biz.lorien.niichi.commands.AddPlayerCommand.execute(AddPlayerCommand.java:40)[126:biz.lorien.niichi.commands:1.0.0.SNAPSHOT]
at
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:83)[43:org.apache.karaf.shell.core:4.0.0]
at
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:67)[43:org.apache.karaf.shell.core:4.0.0]
at
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:87)[43:org.apache.karaf.shell.core:4.0.0]
at
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[43:org.apache.karaf.shell.core:4.0.0]
at
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[43:org.apache.karaf.shell.core:4.0.0]
at
org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[43:org.apache.karaf.shell.core:4.0.0]
at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[43:org.apache.karaf.shell.core:4.0.0]
at
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[43:org.apache.karaf.shell.core:4.0.0]
at
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)[43:org.apache.karaf.shell.core:4.0.0]
at
org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:267)[43:org.apache.karaf.shell.core:4.0.0]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_80]

And this text in console:
karaf@root() niichi:add-player 771 asdf
openjpa-2.3.0-r422266:1540826 fatal user error
org.apache.openjpa.persistence.InvalidStateException: Could not perform
automatic lookup of EJB container's 

OpenJPA feature and Java 8

2015-08-10 Thread ellirael
Is there any problem with OpenJPA working on Java 8?
Karaf 3 OpenJPA feauture doesn't require Java 7. But Karaf 4 do.
I know that the feature resolver was changed.
But I have successfully run OpenJPA application on Karaf 3 and Java 8.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/OpenJPA-feature-and-Java-8-tp4041811.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: OpenJPA feature and Java 8

2015-08-10 Thread ellirael
What about OpenJPA 2.3.x?
According to enterprise-4.0.0-features.xml both OpenJPA versions require
Java 1.7:

feature name=openjpa description=Apache OpenJPA 2.2.x persistence engine
support version=2.2.2
...
requirementosgi.ee;filter:=quot;(amp;(osgi.ee=JavaSE)(!(versiongt;=1.8)))quot;/requirement
/feature

feature name=openjpa description=Apache OpenJPA 2.3.x persistence engine
support version=2.3.0
...
requirementosgi.ee;filter:=quot;(amp;(osgi.ee=JavaSE)(!(versiongt;=1.8)))quot;/requirement
/feature

May it be some sort of an error?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/OpenJPA-feature-and-Java-8-tp4041811p4041813.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 4 jdbc commands changes and problems

2015-07-24 Thread ellirael
JB, the info you asked is in my first message. Features installation went ok.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-jdbc-commands-changes-and-problems-tp4041571p4041601.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Strange folder in karaf 4.0 windows distribution

2015-07-23 Thread ellirael
np ty



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Strange-folder-in-karaf-4-0-windows-distribution-tp4041539p4041565.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 4 jdbc commands changes and problems

2015-07-23 Thread ellirael
Tried to use dbcp2 instead of aries-pool. Dbcp2 works fine in my scenario.

ds-list command output:
Name   | Product | Version | URL   | Status
---
dbname | MySQL   | 5.1.36  | jdbc:mysql://host/dbname | OK




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-jdbc-commands-changes-and-problems-tp4041571p4041572.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Karaf 4 jdbc commands changes and problems

2015-07-23 Thread ellirael
Am I right that Karaf 4 jdbc feature requires now some external
DataSourceFactory libraries (unlike Karaf 3)?

I've installed these features:
jpa | 2.0.0| x| Started |
enterprise-4.0.0
openjpa | 2.3.0| x| Started |
enterprise-4.0.0
jdbc| 4.0.0| x| Started |
enterprise-4.0.0
pax-jdbc-config | 0.6.0| x| Started |
org.ops4j.pax.jdbc-0.6.0
pax-jdbc-mysql  | 0.6.0| x| Started |
org.ops4j.pax.jdbc-0.6.0
pax-jdbc-pool-aries | 0.6.0| x| Started |
org.ops4j.pax.jdbc-0.6.0

Then I've created my MySQL datasource:
jdbc:ds-create -dn mysql-pool-xa -url jdbc:mysql://host/dbname -u root -p
admin dbname

ds-factories command output:
Name  | Class | Version
---
mysql-pool-xa | com.mysql.jdbc.Driver-pool-xa |
mysql-pool| com.mysql.jdbc.Driver-pool|
mysql | com.mysql.jdbc.Driver |

Config file is created and it seems to be correct:
dataSourceName=dbname
osgi.jdbc.driver.name=mysql-pool-xa
password=admin
service.factoryPid=org.ops4j.datasource
service.pid=org.ops4j.datasource.094411fb-f8b6-4794-81d6-5077cc00643a
url=jdbc:mysql://host/dbname
user=root

Then I see doubled datasource. And both of them miss password somehow...
ds-list command output:
Name   | Product | Version | URL | Status
-
dbname | | | | Error Access denied for user
''@'192.168.9.6' (using password: NO)
dbname | | | | Error Access denied for user
''@'192.168.9.6' (using password: NO)

Am I right about jdbc commands changes? How to fix my problems with
datasources?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-jdbc-commands-changes-and-problems-tp4041571.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf 4 jdbc commands changes and problems

2015-07-23 Thread ellirael
JB, I didn't quite understand your answer.
Am I right that I need external feature(s) to make jdbc commands work?
What's wrong with aries pool and how to resolve my problem with lost
password and DS doubling?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-4-jdbc-commands-changes-and-problems-tp4041571p4041578.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Strange folder in karaf 4.0 windows distribution

2015-07-21 Thread ellirael
I've noticed there is a strange folder file: with colon in name located in
/system folder of karaf 4.0 windows distribution. What should I do with it?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Strange-folder-in-karaf-4-0-windows-distribution-tp4041539.html
Sent from the Karaf - User mailing list archive at Nabble.com.


RE: Best way to access OSGi services from classes which object creation I cannot handle

2015-06-24 Thread ellirael
Jean-Philippe, and there was original question what is the best tech to
easily retrieve OSGi service from my dynamically loaded JPA listener.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Best-way-to-access-OSGi-services-from-classes-which-object-creation-I-cannot-handle-tp4040986p4041062.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Security in Module

2015-06-23 Thread ellirael
Christian, any news on a proplem? I'm trying to use embedded security
solution. Or you'd advice to try shiro? Any problems is known with shiro?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Security-in-Module-tp4039307p4041046.html
Sent from the Karaf - User mailing list archive at Nabble.com.


RE: Best way to access OSGi services from classes which object creation I cannot handle

2015-06-22 Thread ellirael
Jean-Philippe, you're reffering JPAStuff. What is it?
My JPA listener created by JPA engine, not by blueprint.

Is is possible to intercept myJPAStuff creation via blueprint?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Best-way-to-access-OSGi-services-from-classes-which-object-creation-I-cannot-handle-tp4040986p4041026.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Best way to access OSGi services from classes which object creation I cannot handle

2015-06-19 Thread ellirael
Christian, I'm using OpenJPA.
I implement @PostPersist method in entity event listener which I registered
by means of @EntityListeners annotation.
ServiceTracker... My API bundle will depend on OSGi framework... But I'll
try it. There will b no problems with dynamism?

My quick test solution was to inject needed services through constructor to
blueprint bean. And in constructor write needed services to static bean
fields.

As I remember blueprint it will be proxy objects and blueprint will handle
service implementation change.
Am I mistaken?

I'm looking for the best :) way.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Best-way-to-access-OSGi-services-from-classes-which-object-creation-I-cannot-handle-tp4040986p4040994.html
Sent from the Karaf - User mailing list archive at Nabble.com.


RE: Best way to access OSGi services from classes which object creation I cannot handle

2015-06-19 Thread ellirael
Jean-Philippe, dynamic change of services impl have many ways to use.
For example I can dynamically register calback methods, hot-update app
version without needs of app stopping, implementing point of extension
template.

In different cases there will be different requirements how to handle
services change, removing and creating.

For now my task is to call special services if it exists. If it not exists
then ignore. If it changes it must be no need of some sort of app stop. It
must just to start call new services impl.




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Best-way-to-access-OSGi-services-from-classes-which-object-creation-I-cannot-handle-tp4040986p4040995.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Best way to access OSGi services from classes which object creation I cannot handle

2015-06-18 Thread ellirael
I'm looking for best solution to gain access to OSGi services in classes
which object creation I cannot handle.
For example I need to call some OSGi services in JPA event listener
@PostPersist callback method.
How to inject services to such objects?
How to refresh services links when their implementation change?
How to ensure that all resources are freed when I update or restart bundle
with services?
To save dynamism is a must for my tasks.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Best-way-to-access-OSGi-services-from-classes-which-object-creation-I-cannot-handle-tp4040986.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Problem with JPA,JNDI after installing CXF feature

2015-05-28 Thread ellirael
I use pax jdbc and define my ds in config file. Built-in jdbc scope doesn't
provide for some reason Jta enabled datasources.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Problem-with-JPA-JNDI-after-installing-CXF-feature-tp4040429p4040614.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Problem with JPA,JNDI after installing CXF feature

2015-05-27 Thread ellirael
Is there any successful projects using blueprint and cхf in karaf? I have
some problems intergrating cxf into karaf.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Problem-with-JPA-JNDI-after-installing-CXF-feature-tp4040429p4040595.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Problem with JPA,JNDI after installing CXF feature

2015-05-27 Thread ellirael
Thanks Achim. I will.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Problem-with-JPA-JNDI-after-installing-CXF-feature-tp4040429p4040602.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Security in Module

2015-05-25 Thread ellirael
Any info from Achym?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Security-in-Module-tp4039307p4040555.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Problem with JPA,JNDI after installing CXF feature

2015-05-18 Thread ellirael
After installing CXF feature I met some problem with datasource recognition
from bundle that uses JPA and registers servet.

javax.naming.NoInitialContextException: Unable to find the
InitialContextFactory org.eclipse.jetty.jndi.InitialContextFactory.
at
org.apache.aries.jndi.ContextHelper.getInitialContext(ContextHelper.java:148)
at
org.apache.aries.jndi.OSGiInitialContextFactoryBuilder.getInitialContext(OSGiInitialContextFactoryBuilder.java:49)
at 
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
at 
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
at javax.naming.InitialContext.init(InitialContext.java:242)
at javax.naming.InitialContext.init(InitialContext.java:216)
at
org.apache.aries.jpa.container.unit.impl.JndiDataSource.getDs(JndiDataSource.java:64)
at
org.apache.aries.jpa.container.unit.impl.DelayedLookupDataSource.getConnection(DelayedLookupDataSource.java:36)
at
org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110)
at
org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
at
org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:91)
at
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:603)

The same DataSource works nice when I inject dao service that uses the same
datasource in my command bundle. After command invocation servlets starts to
work properly.

The problem seems to occur for JPA bundles only. There is some sort of
InitialContextFactory replacement.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Problem-with-JPA-JNDI-after-installing-CXF-feature-tp4040429.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Apache Karaf 3.0.4 release ETA

2015-05-16 Thread ellirael
Any news on release?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Apache-Karaf-3-0-4-release-ETA-tp4040249p4040403.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Is there a way to access current blueprint container?

2015-05-16 Thread ellirael
Nope, I just register Vaadin servlet via Pax Web whiteboard wrappers using
blueprint.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Is-there-a-way-to-access-current-blueprint-container-tp4040301p4040401.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Is there a way to access current blueprint container?

2015-05-16 Thread ellirael
Like this:

service id=vaadinServletMappingService
interface=org.ops4j.pax.web.extender.whiteboard.ServletMapping
bean
class=org.ops4j.pax.web.extender.whiteboard.runtime.DefaultServletMapping
property name=servlet ref=vaadinServlet /
property name=initParams
map
entry key=UI value=p.MainUI /
/map
/property
property name=loadOnStartup value=1 /
property name=urlPatterns
array
value/niichi/*/value
/array
/property
/bean
/service
bean id=playerView class=p.PlayerView scope=prototype
argument ref=playerService /
/bean

And then in UI created by Vaadin I request playerView bean from Blueprint
container.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Is-there-a-way-to-access-current-blueprint-container-tp4040301p4040402.html
Sent from the Karaf - User mailing list archive at Nabble.com.


JTA spec dependency when using blueprint tx tag

2015-05-14 Thread ellirael
Should I add maven provided scope dependency on jta spec if I creating this
bean:

service id=playerService
interface=biz.lorien.niichi.api.services.PlayerService
  bean class=biz.lorien.niichi.api.internal.services.JpaPlayerService
jpa:context property=entityManager unitname=niichi /
tx:transaction method=getPlayers addPlayer editPlayer deletePlayer
value=Required /
  /bean
/service




--
View this message in context: 
http://karaf.922171.n3.nabble.com/JTA-spec-dependency-when-using-blueprint-tx-tag-tp4040349.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf JTA and JDBC DataSource

2015-05-12 Thread ellirael
Thanks, Christian. The docs you provided helped me a lot. It works.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-JTA-and-JDBC-DataSource-tp4039081p4040300.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Is there a way to access current blueprint container?

2015-05-12 Thread ellirael
When I create blueprint container manually I can ger access to it:

BlueprintContainerImpl container = new BlueprintContainerImpl(classLoader,
resourcePaths);
Foo foo = (Foo) container.getComponentInstance(foo);
container.destroy();

Is there a way to access Karaf blueprint container?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Is-there-a-way-to-access-current-blueprint-container-tp4040301.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Is there a way to access current blueprint container?

2015-05-12 Thread ellirael
Type is BluePrintContainer? Interface?

How to do it inside my code without injection?
My objects lifecycle controlled from another container.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Is-there-a-way-to-access-current-blueprint-container-tp4040301p4040307.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Is there a way to access current blueprint container?

2015-05-12 Thread ellirael
I'm trying to get blueprint service proxy inside vaadin UI.
My current solution is to create BlueprintContainer Vaadin aware servlet
with BlueprintContainer property. Then register my servlet with whiteboard
pattern injecting blueprintContainer in it. Then in UI access my service
proxies like this:
VaadinBlueprintAwareServlet vaadinServlet = (VaadinBlueprintAwareServlet)
VaadinBlueprintAwareServlet.getCurrent();
personService = (PersonService)
vaadinServlet.getBlueprintContainer.getComponentInstance(personService);



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Is-there-a-way-to-access-current-blueprint-container-tp4040301p4040320.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Is there a way to access current blueprint container?

2015-05-12 Thread ellirael
The place where I need BlueprintContainer reference is the class which object
creation maintained by another container. I cannot let blueprint do it.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Is-there-a-way-to-access-current-blueprint-container-tp4040301p4040317.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf JTA and JDBC DataSource

2015-05-08 Thread ellirael
Is there something wrong with pax-jdbc-postresql?

Compairing 4.0 and 5.0 feature files I found out that one bundle is missed.

feature name=pax-jdbc-postgresql description=Provides JDBC PostgreSQL
DataSourceFactory version=0.5.0
resolver=(obr)featuretransaction/featurefeaturepax-jdbc-spec/featurebundle
dependency=truemvn:org.postgresql/postgresql/9.4-1200-jdbc41/bundle/feature

feature name=pax-jdbc-postgresql description=Provides JDBC PostgreSQL
DataSourceFactory version=0.4.0
resolver=(obr)featurepax-jdbc/featurebundle
dependency=truemvn:org.ancoron.postgresql/org.postgresql/9.1.901.jdbc4.1-rc9/bundlebundlemvn:org.ops4j.pax.jdbc/pax-jdbc-postgresql/0.4.0/bundle/feature

There is no more adapter bundle in 5.0 for postgress. And karaf doesn't
create DataSource without an adapter.

Then I checked git repo: https://github.com/ops4j/org.ops4j.pax.jdbc.
There is no mention about postgress.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-JTA-and-JDBC-DataSource-tp4039081p4040239.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Declarative JTA transactions XA aware resources auto-enlistment rules

2015-03-25 Thread ellirael
I tested JTA JPA earlier. It works.
I had problems when tried JTA JDBC. It works too, with pax-jdbc. Pax-jdbc
grants pooling and XA wrapping for DataSources.

When I saw your message, I wanted to try another solution of XA DataSource
auto wrapping. I've tried and it doesn't work. I think it is because of
wrappers bundle absence.

Looked through org.apache.aries.transaction.manager pom.xml. Could not find
wrapper dependency.
Wrappers depends on manager instead.

Is this your framework?
Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Declarative-JTA-transactions-XA-aware-resources-auto-enlistment-rules-tp4039247p4039278.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Declarative JTA transactions XA aware resources auto-enlistment rules

2015-03-24 Thread ellirael
Great docs. How did you find it?

Bundle org.apache.aries.transaction.wrappers doesn't included in Karaf
3.0.3.
Should I install it manually?
Maybe it is some feature that installs it?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Declarative-JTA-transactions-XA-aware-resources-auto-enlistment-rules-tp4039247p4039263.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Declarative JTA transactions XA aware resources auto-enlistment rules

2015-03-24 Thread ellirael
Thanks.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Declarative-JTA-transactions-XA-aware-resources-auto-enlistment-rules-tp4039247p4039262.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Declarative JTA transactions XA aware resources auto-enlistment rules

2015-03-24 Thread ellirael
I've tried and tested declarative transactions with JDBC DataSources using
pax-jdbc. Thanks to 
Christian Schneider.

I'v trying to understand the XA aware resources auto-enlistment. But I
cannot found any info. Lack of docs.
All bundle resources are enslisted?
All bundle resources that appears in blueprint config are enslisted?
All karaf platform XA aware resuorces are enlisted?




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Declarative-JTA-transactions-XA-aware-resources-auto-enlistment-rules-tp4039247.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf JTA and JDBC DataSource

2015-03-19 Thread ellirael
Christian, I've tried. It works!
Have some question though.

Where to get pax-jdbc-db2 feature? Is IBM DB2 supported by pax-jdbc?

Could you explain that background magic you talked earlier? I wonder how JTA
finds my XAResources. How do I know what XA resources will be enlisted and
what will not? Can I manage that autoenlistment somehow?

My blueprint.xml fragment:
reference id=dataSource3 interface=javax.sql.DataSource
   filter=(osgi.jndi.service.name=jdbc/kb3) /
reference id=dataSource4 interface=javax.sql.DataSource
   filter=(osgi.jndi.service.name=jdbc/kb4) /
bean id=testDao class=biz.lorien.umrp.kb.dao.jdbc.JdbcTestDao
property name=dataSource ref=dataSource4 /
/bean
bean id=jdbcPersonService
class=biz.lorien.umrp.kb.dao.jdbc.JdbcPersonService
property name=dataSource ref=dataSource3 /
property name=testDao ref=testDao /
tx:transaction method=addPerson value=Required /
/bean
The result is that kb3 and kb4 participate in JTA transaction and commit or
rollback together. Is it right?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-JTA-and-JDBC-DataSource-tp4039081p4039171.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf JTA and JDBC DataSource

2015-03-16 Thread ellirael
Hi, Achim. It seems I am the only one who wants to use JTA with JDBC. :)



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-JTA-and-JDBC-DataSource-tp4039081p4039088.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf JTA and JDBC DataSource

2015-03-16 Thread ellirael
Thanks again, Christian.

What is the difference between XADataSource and XA aware DataSource.
If I inject an XA aware DataSource and use blueprint.xml that I mention
earlier Transaction Manager will find my XA resource and start transaction?

What will it be if I injecty two or more XA aware DataSources and two or
more entity managers?
Will it be one global transaction be opened for all XA aware resourses?
Like that:
reference id=dataSource1 interface=XA aware DataSource
   filter=(osgi.jndi.service.name=jdbc/kb) /
reference id=dataSource2 interface=XA aware DataSource
   filter=(osgi.jndi.service.name=jdbc/kb2) /
bean id=jdbcPersonService class=mynamespace.JdbcPersonService
jpa:context property=entityManager unitname=kb3 /
jpa:context property=entityManager unitname=kb4 /
property name=dataSource1 ref=dataSource1 /
property name=dataSource2 ref=dataSource2 /
tx:transaction method=addPerson changePerson deletePerson
value=Required /
/bean



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-JTA-and-JDBC-DataSource-tp4039081p4039090.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf JTA and JDBC DataSource

2015-03-16 Thread ellirael
Thanks for your help. I'll try your solutions. Including pax-jdbc.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-JTA-and-JDBC-DataSource-tp4039081p4039094.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf JTA and JDBC DataSource

2015-03-16 Thread ellirael
Christian, thanks. You're right. Coonnection doesn't take part in
transaction. And it is strange for me that I cannot use declarative
transactions in Karaf with JDBC.

Please, explain me, why I should use pax-jdbc in both cases?
Afaik, database drivers includes XADataSource implementation that supports
pooling. I can simply create blueprint file like that created with
jdbc:create command.
How aries wrapper links with pooling? Pooling usualy emplemented by
DataSource.

Read your tutorials. Thanks for info about blueprint-maven plugin.
Is it impossible now to use declarative JTA with JDBC?

Does JTA delegate transaction to JDBCConnection when only one Resource in
transaction and it is DstaSource? I mean if I use manual correct way:
getTransManager, enslitRes and so on. I'm afraid that XA transaction takes
much more time and resources than Database transaction.




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-JTA-and-JDBC-DataSource-tp4039081p4039087.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Container management JPA example

2014-06-01 Thread ellirael
Jamie, thanks. Have you tried those recipes? Is is working with Karaf 3.0.1
and container management JPA? Container management JPA is one of the main
Karaf features. And I cannot stop trying to use it.



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Container-management-JPA-example-tp4033329p4033365.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Container management JPA example

2014-05-30 Thread ellirael
Thanks again, Christian.

I've installed snapshot version.
But I've met another poroblem running my test jpa bundle.

Karaf log fragment:
2014-05-30 12:59:02,895 | WARN  | raf-3.0.1/deploy | fileinstall
 
| 11 - org.apache.felix.fileinstall - 3.2.8 | Error while starting bundle:
deploy/user.api-0.0.0.jar
org.osgi.framework.BundleException: Unresolved constraint in bundle user.api
[78]: Unable to resolve 78.0: missing requirement [78.0]
osgi.wiring.package;
((osgi.wiring.package=javax.persistence)(version=1.1.0)(!(version=2.0.0)))
at
org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)[org.apache.felix.framework-4.2.1.jar:]

My bundle manifest fragment:
Import-Package: javax.persistence;version=[1.1,2),org.osgi.service.blu
 eprint;version=[1.0.0,2.0.0)

Result of package:exports | grep javax.persistence command (meaningless
packages omited):
javax.persistence | 1.1.0 | 82 |
org.apache.geronimo.specs.geronimo-jpa_2.0_spec
javax.persistence | 2.0.0 | 82 |
org.apache.geronimo.specs.geronimo-jpa_2.0_spec





--
View this message in context: 
http://karaf.922171.n3.nabble.com/Container-management-JPA-example-tp4033329p4033346.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Container management JPA example

2014-05-30 Thread ellirael
JB, yes.

Result of package:exports | grep javax.persistence command:
javax.persistence | 1.1.0 | 82 |
org.apache.geronimo.specs.geronimo-jpa_2.0_spec
javax.persistence | 2.0.0 | 82 |
org.apache.geronimo.specs.geronimo-jpa_2.0_spec 

Result of la | grep 82 command:
 82 | Active   |  30 | 1.1   | Apache Geronimo JSR-317 JPA
2.0 Spec API




--
View this message in context: 
http://karaf.922171.n3.nabble.com/Container-management-JPA-example-tp4033329p4033349.html
Sent from the Karaf - User mailing list archive at Nabble.com.


karaf:features-generate-descriptor goal generated feature dependency problem

2014-05-26 Thread ellirael
I'm using karaf-maven-plugin/3.0.1 to build my feature projects.

pom.xml dependency section:
dependencies
dependency
groupId${project.groupId}/groupId
artifactIdperson.api.feature/artifactId
version${project.version}/version
classifierfeatures/classifier
typexml/type
/dependency
dependency
groupId${project.groupId}/groupId
artifactIdperson.impl.simple/artifactId
version${project.version}/version
/dependency
dependency
groupId${project.groupId}/groupId
artifactIdperson.command/artifactId
version${project.version}/version
/dependency
/dependencies

my feature.xml file:
?xml version=1.0 encoding=UTF-8?
features name=${project.artifactId}-${project.version} 
  xmlns=http://karaf.apache.org/xmlns/features/v1.0.0;
feature name=${project.artifactId}
 description=${project.name}
 version=${project.version}
/feature
/features

According to this text:
aggregateFeatures   boolean (false) Specifies processing of feature
repositories that are (transitive) Maven dependencies. If false, all
features in these repositories become dependencies of the generated feature.
If true, all features in these repositories are copied into the generated
feature repository. 

when I build my feature project with aggregateFeatures set to false I should
get attached artifact file looks like this:
?xml version=1.0 encoding=UTF-8 standalone=yes?
features ...
feature name=person.impl.simple.feature version=0.0.0
featureperson.api.feature/feature
bundlemvn:group/person.impl.simple/0.0.0/bundle
bundlemvn:group/person.command/0.0.0/bundle
/feature
/features

But I get file looks like this:
?xml version=1.0 encoding=UTF-8 standalone=yes?
features ...
feature name=person.impl.simple.feature version=0.0.0
bundlemvn:group/person.impl.simple/0.0.0/bundle
bundlemvn:group/person.command/0.0.0/bundle
/feature
/features

No depended feature line included.
When I try to resolve dependencies with maven resolver I see bundles from
person.api.feature included in dependency list. But karaf-maven.plugin miss
them.




--
View this message in context: 
http://karaf.922171.n3.nabble.com/karaf-features-generate-descriptor-goal-generated-feature-dependency-problem-tp4033282.html
Sent from the Karaf - User mailing list archive at Nabble.com.


  1   2   >