Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First attempt to OSGI-fy Kundera #525

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from
Open

Conversation

dzalbo
Copy link

@dzalbo dzalbo commented Feb 13, 2014

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.

@mevivs
Copy link
Collaborator

mevivs commented Feb 13, 2014

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

Cheers,
-Vivek

@dzalbo
Copy link
Author

dzalbo commented Feb 14, 2014

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..

@mevivs
Copy link
Collaborator

mevivs commented Feb 20, 2014

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

@dzalbo
Copy link
Author

dzalbo commented Feb 20, 2014

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.

@mevivs
Copy link
Collaborator

mevivs commented Feb 20, 2014

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

@dzalbo
Copy link
Author

dzalbo commented Feb 26, 2014

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

dzalbo@f9b3fa3

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

@Piotr-Klimczak
Copy link

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).

@mevivs
Copy link
Collaborator

mevivs commented Apr 8, 2014

@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

@dzalbo
Copy link
Author

dzalbo commented Apr 10, 2014

@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
Copy link
Author

dzalbo commented Apr 10, 2014

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.

@mevivs
Copy link
Collaborator

mevivs commented Apr 10, 2014

@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

@dzalbo
Copy link
Author

dzalbo commented Apr 10, 2014

Did you install any OSGI bundles into JBoss?

@mevivs
Copy link
Collaborator

mevivs commented Apr 10, 2014

Trying to install kundera-core as an OSGI bundle

-Vivek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants