You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Charles Moulliard <cm...@gmail.com> on 2009/12/04 11:05:41 UTC

Question about camel-jpa and camel-etl

In the wiki page of camel-jpa component, it is mentioned that a
entityManagerFactory must be specified like this :

<bean id="jpa" class="org.apache.camel.component.jpa.JpaComponent">
   <property name="entityManagerFactory" ref="myEMFactory"/>
</bean>


Surprisingly, I don't see this in the camel-example-etl example.

When deploying camel-example-etl on Apache Felix Karaf, felix complains that
:

Caused by: java.lang.IllegalArgumentException: entityManagerFactory must be
specified
    at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:244)
    at
org.apache.camel.component.jpa.JpaEndpoint.validate(JpaEndpoint.java:230)
    at
org.apache.camel.component.jpa.JpaEndpoint.createConsumer(JpaEndpoint.java:87)

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm

Re: Question about camel-jpa and camel-etl

Posted by Charles Moulliard <cm...@gmail.com>.
I have found a workaround by adding this in the spring config file, it works

    <!--  Added for OSGI platform to allow to retrieve entityManagerFactory
-->
    <bean id="jpa" class="org.apache.camel.component.jpa.JpaComponent">
           <property name="entityManagerFactory"
ref="entityManagerFactory"/>
    </bean>


Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm


On Fri, Dec 4, 2009 at 1:11 PM, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> Why dont you try to fix it yourself? Maybe its just a matter of adding
> that factory to the configuration.
>
>
> On Fri, Dec 4, 2009 at 11:05 AM, Charles Moulliard <cm...@gmail.com>
> wrote:
> > In the wiki page of camel-jpa component, it is mentioned that a
> > entityManagerFactory must be specified like this :
> >
> > <bean id="jpa" class="org.apache.camel.component.jpa.JpaComponent">
> >   <property name="entityManagerFactory" ref="myEMFactory"/>
> > </bean>
> >
> >
> > Surprisingly, I don't see this in the camel-example-etl example.
> >
> > When deploying camel-example-etl on Apache Felix Karaf, felix complains
> that
> > :
> >
> > Caused by: java.lang.IllegalArgumentException: entityManagerFactory must
> be
> > specified
> >    at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:244)
> >    at
> > org.apache.camel.component.jpa.JpaEndpoint.validate(JpaEndpoint.java:230)
> >    at
> >
> org.apache.camel.component.jpa.JpaEndpoint.createConsumer(JpaEndpoint.java:87)
> >
> > Charles Moulliard
> > Senior Enterprise Architect
> > Apache Camel Committer
> >
> > *****************************
> > blog : http://cmoulliard.blogspot.com
> > twitter : http://twitter.com/cmoulliard
> > Linkedlin : http://www.linkedin.com/in/charlesmoulliard
> >
> > Apache Camel Group :
> > http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm
> >
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>

Re: Question about camel-jpa and camel-etl

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Why dont you try to fix it yourself? Maybe its just a matter of adding
that factory to the configuration.


On Fri, Dec 4, 2009 at 11:05 AM, Charles Moulliard <cm...@gmail.com> wrote:
> In the wiki page of camel-jpa component, it is mentioned that a
> entityManagerFactory must be specified like this :
>
> <bean id="jpa" class="org.apache.camel.component.jpa.JpaComponent">
>   <property name="entityManagerFactory" ref="myEMFactory"/>
> </bean>
>
>
> Surprisingly, I don't see this in the camel-example-etl example.
>
> When deploying camel-example-etl on Apache Felix Karaf, felix complains that
> :
>
> Caused by: java.lang.IllegalArgumentException: entityManagerFactory must be
> specified
>    at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:244)
>    at
> org.apache.camel.component.jpa.JpaEndpoint.validate(JpaEndpoint.java:230)
>    at
> org.apache.camel.component.jpa.JpaEndpoint.createConsumer(JpaEndpoint.java:87)
>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> *****************************
> blog : http://cmoulliard.blogspot.com
> twitter : http://twitter.com/cmoulliard
> Linkedlin : http://www.linkedin.com/in/charlesmoulliard
>
> Apache Camel Group :
> http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus