-
1. Re: Calling DataSource via JNDI in ServiceMix 4.4.1
mikevoxcap Apr 12, 2012 12:34 PM (in response to mikevoxcap)Planning to try the example here:
https://github.com/cschneider/Karaf-Tutorial
Hopefully this resolves my issue. Thanks!
-
2. Re: Calling DataSource via JNDI in ServiceMix 4.4.1
mikevoxcap Apr 12, 2012 3:51 PM (in response to mikevoxcap)Fixed my issue. I switched from using JEE to do the JNDI lookup and moved to having everything in the persistence.xml.
-
3. Re: Calling DataSource via JNDI in ServiceMix 4.4.1
mikevoxcap Apr 18, 2012 10:10 PM (in response to mikevoxcap)Okay, I moved to trying to do this with a blueprint rather than doing this via spring configurations. It is really disappointing how long it takes to configure something that I expect to take no more than an hour (it has taken me well over 40 hours between pouring through documentation and trying different combinations). Here is where I am at.
First, I have a blueprint that defines the datasource I am using:
I am able to deploy this and it starts up fine.
Next, I have my bundle. The bundle has the following files:
/src/main/resources/jpa/EachEntity.xml
These contain the entity mappings. These worked fine with a Spring configuration. Here is an example:
/src/main/resources/META-INF/persistence.xml
Here is a snippet:
/src/main/resources/OSGI-INF/blueprint.xml
This is the blueprint for the service that I am exposing.
pom.xml
My felix configuration:
Result
First, the blueprint of the service has errors for <jpa:context /> and <jpa:unit />
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jpa:context'.
Second, when the bundle is deployed, there is no web service and the only log I see is:
2012-04-18 20:50:36,642 | WARN | l Console Thread | container | ? ? | 170 - org.apache.aries.jpa.container - 0.3.0 | There are no providers available.
Doesnt look like any of the beans are initialized from the blueprint.xml.
Also, I am looking for opinions / information / options on the following:
1) Can I use spring's component scanning mechanism in a blueprint? I was not sure if I was forced to use <jpa:context /> and <jpa:unit />.
2) Looking at the documentation for aries, it also looks like the transactions schema forces me to define transactions at the DAO level. Is this true?
3) Can I refer to blueprint.xml beans from the spring configured beans?
Again, your help is appreciated. I really want to feel comfortable with and be an advocate for this product.