[seam-dev] Seam JCR and multiple repos
John D. Ament
john.d.ament at gmail.com
Sun Jan 8 17:42:04 EST 2012
Hi Ove,
Looks like the issue is that you are using the same name for both beans.
Do they need to be named?
John
On Sun, Jan 8, 2012 at 5:29 PM, Ove Ranheim <oranheim at gmail.com> wrote:
> Hi,
>
> I'm trying to connect to two different JCR (ModeShape) repos in my app,
> but based on current documentation and some testing, I'm not able to figure
> it out.
>
> Producer bean:
>
> @Produces
> @Named(ConfigParams.JCR_REPOSITORY_CONFIG_MAP)
> @RepositorySessionQualifer
> public Map<String, String> produceJcrConfig(@Resource(
> "contentRepository.xml") URL url) {
> String modeshapeUrl = url.toExternalForm() +
> "?repositoryName=ContentRepository";
> return Collections.singletonMap(MODESHAPE_URL, modeshapeUrl);
> }
>
>
> @Produces
> @Named(ConfigParams.JCR_REPOSITORY_CONFIG_MAP)
> @RepositoryEmailSessionQualifer
> public Map<String, String> produceJcrConfig2(@Resource(
> "contentRepository.xml") URL url) {
> String modeshapeUrl = url.toExternalForm() +
> "?repositoryName=EmailRepository";
> return Collections.singletonMap(MODESHAPE_URL, modeshapeUrl);
> }
>
>
>
> Other bean:
>
> @Inject
> @RepositorySessionQualifer
> private Instance<Session> sessionInstance;
>
>
> Exception:
>
> Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001414 Bean
> name is ambiguous. Name jcrRepositoryConfigMap resolves to beans [Producer
> Method [Map<String, String>] with qualifiers [@Any
> @RepositorySessionQualifer @Named] declared as [[method] @Produces @Named
> @RepositorySessionQualifer public
> com.parts.content.faq.metadata.JcrConfigProducer.produceJcrConfig(URL)],
> Producer Method [Map<String, String>] with qualifiers [@Any
> @RepositoryEmailSessionQualifer @Named] declared as [[method] @Produces
> @Named @RepositoryEmailSessionQualifer public
> com.parts.content.faq.metadata.JcrConfigProducer.produceJcrConfig2(URL)]]
>
> What would be the correct way to wire up correctly?
>
> Ove
>
>
> _______________________________________________
> seam-dev mailing list
> seam-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/seam-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/seam-dev/attachments/20120108/5e091c12/attachment.html
More information about the seam-dev
mailing list