rave-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Franklin <m.ben.frank...@gmail.com>
Subject Re: Conversion factory not set by the Spring context
Date Sun, 09 Jun 2013 23:47:19 GMT
On Sun, Jun 9, 2013 at 5:14 PM, Gustavo Monarin <gustavomonarin@gmail.com>wrote:

> Hi Gonzalo and Matt,
>
> I had the same problem when i created a project based on the archtype.
>
> It happes because the JpaConverter bean(singleton spring bean) is a kind of
> Java Singleton object as well(There is a comment in the class explaining
> it why of the workaround, but i didn;t get the reason.). On the startup
> time, the @PostConstruct from the DataImporter makes  use of the
> JpaConverter  that has not been initialized by spring yet.
>
> This only happens in the archtype because of the order of the
> CotextConfigLocation, where in the web.xml generated by the archtype the
> dataContext.xml comes first and in the trunk it is after the
> applicationContext.xml
>
> Possible solutions would be:
> 1) Change the CotextConfigLocation xml's order in the archetype template
> 2) Put an annotation @DependsOn("jpa/modelConverter")  in the DataImporter
> 3) Review the static singleton strategy in the JpaConverter.
>
> I could contribute with a patch for the 1 or 2(better in my opinion), but i
> don't know if i would manage to check the item 3.
>

I think 3 will need a bit of work; but, would be the long-term best option.
 However, a patch for #2 would at least resolve the bug, so if you are
willing, we will take it.


>
> Regards
>
>
>
>
>
>
>
> On Sun, Jun 2, 2013 at 7:35 PM, Gonzalo Aguilar Delgado <
> gaguilar@aguilardelgado.com> wrote:
>
> > Hello,
> >
> > Nope, I've just created a project from archetype and let it run.
> >
> > It only happnes when running from archetype. I ran the solution by just
> > using the source and it worked. Then I just copied the database created
> and
> > with the database plugged in it also works.
> >
> > I think that is just the database population on first time when using
> > archetype.
> >
> > El 01/06/13 20:13, Matt Franklin escribió:
> >
> >  Sounds like the component scan is not picking up that package.  Have you
> >> overridden any of the application contexts?
> >>
> >>
> >> On Sat, Jun 1, 2013 at 12:34 PM, Gonzalo Aguilar Delgado <
> >> gaguilar@aguilardelgado.com> wrote:
> >>
> >>  Hello,
> >>>
> >>> I'm testing new version 0.22-SNAPSHOT but found this when trying to
> start
> >>> the portal:
> >>>
> >>>
> >>> INFO : org.apache.rave.util.****OverridablePropertyPlaceholder**
> >>> **Configurer
> >>> - Loading properties file from class path resource [portal.properties]
> >>> 26  ravePersistenceUnit  WARN   [main] openjpa.Runtime - An error
> >>> occurred
> >>> while registering a ClassTransformer with PersistenceUnitInfo: name
> >>> 'ravePersistenceUnit', root URL [file:/home/gad/workspace-**
> >>> platform/.metadata/.plugins/****org.eclipse.wst.server.core/**
> >>> tmp0/wtpwebapps/level2-rave-****overlay-portal/WEB-INF/lib/****
> >>> rave-jpa-0.22-SNAPSHOT.jar].
> >>> The error has been consumed. To see it, set your openjpa.Runtime log
> >>> level
> >>> to TRACE. Load-time class transformation will not be available.
> >>> ERROR: org.springframework.web.****context.ContextLoader - Context
> >>> initialization failed
> >>> org.springframework.beans.****factory.BeanCreationException: Error
> >>> creating
> >>> bean with name 'dataImporter': Invocation of init method failed; nested
> >>> exception is java.lang.****IllegalStateException: Conversion factory
> not
> >>> set by the Spring context
> >>>
> >>> ....
> >>>
> >>> Caused by: java.lang.****IllegalStateException: Conversion factory not
> >>> set
> >>> by the Spring context
> >>>      at org.apache.rave.portal.model.****conversion.JpaConverter.**
> >>> getInstance(JpaConverter.java:****70)
> >>>      at org.apache.rave.portal.model.****conversion.**
> >>> ConvertingListProxyFactory$****ConvertingListInvocationHandle**
> >>> **r.convertAll(
> >>> **ConvertingListProxyFactory.****java:76)
> >>>      at org.apache.rave.portal.model.****conversion.**
> >>> ConvertingListProxyFactory$****ConvertingListInvocationHandle**
> >>> **r.invoke(**
> >>> ConvertingListProxyFactory.****java:68)
> >>>      at com.sun.proxy.$Proxy65.addAll(****Unknown Source)
> >>>      at org.apache.rave.portal.model.****JpaPerson.setProperties(**
> >>> JpaPerson.java:272)
> >>>
> >>>
> >>>
> >>> What can this be?
> >>>
> >>>
> >>> Thank you.
> >>>
> >>>
> >
>
>
> --
>
> Gustavo Monarin de Sousa
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message