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
[email protected]
https://lists.jboss.org/mailman/listinfo/seam-dev

Reply via email to