kundera icon indicating copy to clipboard operation
kundera copied to clipboard

First attempt to OSGI-fy Kundera

Open dzalbo opened this issue 11 years ago • 13 comments

pom.xml got a bit messed up because of whitespaces... What I basically did is added maven-bundle-plugin to generate OSGI Manifest and maven-jar-plugin to include this Manifest. I've done it now only for core module and mongo client. WIll need to be replicated for the rest

In the Core module, I added OSGI Activator and modified PersistenceUnitConfiguration to be able to load persistence.xml from other bundles.

dzalbo avatar Feb 13 '14 17:02 dzalbo

Thanks for your contribution. I will have a look and merge it.

Cheers, -Vivek

mevivs avatar Feb 13 '14 18:02 mevivs

One more important note: JTA transactions will not work as of now.

Has to do with java:comp naming space not being available in OSGI environment. Maybe I will have a look into this sometime later as well..

dzalbo avatar Feb 14 '14 07:02 dzalbo

JTA transactions will not work as of now.

This needs to be fixed.

Technically this means a separate bundle for each client type and one for core. Finally add each as a module with module loader (say add with in modules with JBoss) with jar reference?

To start with change looks ok. But this require a bit more work for completion

Thanks. I will analyze and post an update on this.

-Vivek

mevivs avatar Feb 20 '14 09:02 mevivs

If I have time, I might have a look at fixing the JTA transactions (will require me to dive into javax.naming a bit) and update pom files for all clients, just as was done for Mongo.

not sure what you mean by modules... I don't really have much experience with JBoss.

Can share the features for the Karaf though, which makes installation of Kundera pretty simple.

dzalbo avatar Feb 20 '14 10:02 dzalbo

Thanks. Please share your thoughts on Karaf. Let me find time and deploy these changes over JBoss.

@dzalbo Using Kundera for?

Would request you to spend few minutes to fill in for kundera survey: http://www.surveymonkey.com/s/BMB9PWG

Cheers, -Vivek

mevivs avatar Feb 20 '14 10:02 mevivs

@mevivs I've added another fix to this pull request... unrelated to the OSGI though..

https://github.com/dzalbo/Kundera/commit/f9b3fa39d0a71d16c0666a7c1186eae72cf7ecd8

it's a bug with MongoDBQuery. maxResult was lost for cases, when orderBy was present...

dzalbo avatar Feb 26 '14 13:02 dzalbo

I have just came across kundera and cassandra deployment in OSGi env. using my own patches as i haven't seen @dzalbo patches before. But 1st look at @dzalbo patches seems to solve OSGi env problems. I know that there is a JTA problem, but please note that Kundera does not fully implement JPA standard yet (for example metadata support) which is not a problem as it is still usable in most cases. So then it is better to have resource_local support in OSGi env than having no support for OSGi env at all. From me +1 for @dzalbo patches. Then the community will solve the problem with JTA support (which i confirm to exists in @dzalbo solution as well in my own).

Piotr-Klimczak avatar Apr 06 '14 21:04 Piotr-Klimczak

@dzalbo Few questions.

  1. Did you deploy these bundle over Jboss AS7.1.1? As i am getting into number of issues to deploy kundera-core jar with suggested changes, after resolving few of them finally stuck with
:06:26,376 INFO  [stdout] (MSC service thread 1-3) false
18:06:26,376 INFO  [stdout] (MSC service thread 1-3) true
18:06:26,377 ERROR [org.jboss.as.osgi] (MSC service thread 1-3) JBAS011900: Cannot start bundle: com.impetus.kundera.core.kundera-core:2.12.0.SNAPSHOT: org.osgi.framework.BundleException: com.impetus.kundera.osgi.Activator is not an implementation of org.osgi.framework.BundleActivator
    at org.jboss.osgi.framework.internal.HostBundleState.transitionToActive(HostBundleState.java:302) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
    at org.jboss.osgi.framework.internal.HostBundleState.startInternal(HostBundleState.java:223) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
    at org.jboss.osgi.framework.internal.AbstractBundleState.start(AbstractBundleState.java:494) [jbosgi-framework-core-1.1.8.Final.jar:1.1.8.Final]
    at org.jboss.as.osgi.deployment.BundleStartTracker$1.processService(BundleStartTracker.java:144) [jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.osgi.deployment.BundleStartTracker$1.transition(BundleStartTracker.java:119) [jboss-as-osgi-service-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl.invokeListener(ServiceControllerImpl.java:1416) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl.access$2700(ServiceControllerImpl.java:49) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$ListenerTask.run(ServiceControllerImpl.java:1954) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]

Does it something to do with java version? As i am building it with jdk 1.7

Am i missing anything?

-Vivek

mevivs avatar Apr 08 '14 12:04 mevivs

@mevivs I did not. I used it with Apache Karaf. I am not good with JBoss.. but It feels like you have problem with multiple versions of OSGI libraries. Probably more than 1 bundles deployed, which exports org.osgi.framework package.

The error log most probably suggests that though com.impetus.kundera.osgi.Activator implements org.osgi.framework.BundleActivator, it is not of the same version JBoss expects.

dzalbo avatar Apr 10 '14 10:04 dzalbo

JBoss last release, I believe, supports OSGI 4.2.0, while in the pom.xml I suggested, I used 4.3.1.

Maybe, decreasing the version will help.

dzalbo avatar Apr 10 '14 10:04 dzalbo

@dzalbo Yeah, Tried it with 4.2.0 as well. Error

:06:26,376 INFO  [stdout] (MSC service thread 1-3) false
18:06:26,376 INFO  [stdout] (MSC service thread 1-3) true
18:06:26,377 ERROR [org.jboss.as.osgi] (MSC service thread 1-3) JBAS011900: Cannot start bundle: com.impetus.kundera.core.kundera-core:2.12.0.SNAPSHOT: org.osgi.framework.BundleException: 
com.impetus.kundera.osgi.Activator is not an implementation of org.osgi.framework.BundleActivator

is bit strange.

-Vivek

mevivs avatar Apr 10 '14 10:04 mevivs

Did you install any OSGI bundles into JBoss?

dzalbo avatar Apr 10 '14 10:04 dzalbo

Trying to install kundera-core as an OSGI bundle

-Vivek

mevivs avatar Apr 10 '14 11:04 mevivs