Bean with circular reference?

334 views
Skip to first unread message

Robert van der Spek

unread,
Apr 12, 2017, 9:05:00 AM4/12/17
to Hippo Community
To give my hippo project a rest endpoint, I have followed the instructions (1). I have now noticed this gives some problems while initializing the bean context. The console output:
 
[INFO] [talledLocalContainer] 12.04.2017 14:56:36 WARN  localhost-startStop-1 [AbstractBeanFactory.getTypeForFactoryBean:1524] Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.MethodInvokingFactoryBean#8' defined in class path resource [org/hippoecm/hst/site/optional/jaxrs/SpringComponentManager-rest-plain-pipeline.xml]: Cannot create inner bean 'org.hippoecm.hst.core.container.HstSitePipeline#327a13a0' of type [org.hippoecm.hst.core.container.HstSitePipeline] while setting bean property 'arguments' with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.hippoecm.hst.core.container.HstSitePipeline#327a13a0' defined in class path resource [org/hippoecm/hst/site/optional/jaxrs/SpringComponentManager-rest-plain-pipeline.xml]: Cannot resolve reference to bean 'jaxrsRestPlainServiceValve' while setting bean property 'processingValves' with key [4]; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'jaxrsRestPlainServiceValve': Requested bean is currently in creation: Is there an unresolvable circular reference?

code snippet from site/src/main/resources/META-INF/hst-assembly/overrides/hst-spring-config.xml :
<!-- The following three imports will include pipeline configurations for >>>
<<<< both JaxrsRestPlainPipeline and JaxrsRestContentPipeline !!! -->

<import resource="classpath:/org/hippoecm/hst/site/optional/jaxrs/SpringComponentManager-rest-jackson.xml" />

<import resource="classpath:/org/hippoecm/hst/site/optional/jaxrs/SpringComponentManager-rest-plain-pipeline.xml" />

<import resource="classpath:/org/hippoecm/hst/site/optional/jaxrs/SpringComponentManager-rest-content-pipeline.xml" />

The warning dissapears when the second import is commented out. However, as is to be expected, the endpoint now gives a server error. Is it possible to fix this?

Woonsan Ko

unread,
Apr 12, 2017, 9:15:00 AM4/12/17
to hippo-c...@googlegroups.com
Could it be the same issue as the following?

Regards,

Woonsan


--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
 
To post to this group, send email to hippo-community@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-community+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.



--
71 Summer Street, 2nd Floor, Boston, MA 02110
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466

Ard Schrijvers

unread,
Apr 12, 2017, 9:49:38 AM4/12/17
to hippo-c...@googlegroups.com
I think it is related or the same as [1] which I want to fix according [2].

@Robert: Can you check whether the <import> resources are not present
in other local spring xml files as well? If so, can you try to remove
the duplicates

Regards Ard

[1] https://issues.onehippo.com/browse/HSTTWO-3639
[2] https://issues.onehippo.com/browse/HSTTWO-3441
>> To post to this group, send email to hippo-c...@googlegroups.com
>> RSS:
>> https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Hippo Community" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to hippo-communi...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/hippo-community.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> woons...@bloomreach.com www.onehippo.com
> 71 Summer Street, 2nd Floor, Boston, MA 02110
> Amsterdam - Oosteinde 11, 1017 WT Amsterdam
> US +1 877 414 4776 (toll free)
> Europe +31(0)20 522 4466
>
> --
> Hippo Community Group: The place for all discussions and announcements about
> Hippo CMS (and HST, repository etc. etc.)
>
> To post to this group, send email to hippo-c...@googlegroups.com
> RSS:
> https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
> ---
> You received this message because you are subscribed to the Google Groups
> "Hippo Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to hippo-communi...@googlegroups.com.
> Visit this group at https://groups.google.com/group/hippo-community.
> For more options, visit https://groups.google.com/d/optout.



--
Hippo Netherlands, Oosteinde 11, 1017 WT Amsterdam, Netherlands
Hippo USA, Inc. 71 Summer Street, 2nd Floor Boston, MA 02110, United
states of America.

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

Robert van der Spek

unread,
Apr 12, 2017, 9:53:08 AM4/12/17
to Hippo Community
Thanks Woonsan, I think it is the same. As you said in the other discussion: it does not seem to affect the application. I will ignore the warning until a fix is available. 

@Ard: it is only being imported once :)
Reply all
Reply to author
Forward
0 new messages