StackOverflowError - Infinite loop when deploying ear with ejb and demoiselle

4

When deploying an EAR with an EJB that depends on demoiselle-core , a StackOverflowError exception is thrown.

When you try to create a ResourceBundle (ResourceBundleProducer.createNamed (ResourceBundleProducer.java:77)), the Beans class (line 159) throws a NoSuchElementException that is handled in block:

} catch (NoSuchElementException cause) {
    StringBuffer buffer = new StringBuffer();
    buffer.append(beanClass.getCanonicalName());

    if (qualifiers != null) {
        for (Annotation qualifier : qualifiers) {
            buffer.append(", ");
            buffer.append(qualifier.getClass().getCanonicalName());
        }
    }

    String message = getBundle().getString("bean-not-found", buffer.toString());
    throw new DemoiselleException(message, cause);
}

That is, the catch block depends on the ResourceBundle and enters the loop infinity.

For some reason the Locale dependency of the ResourceBundle is not satisfied and the BeanManager.getBeans() method returns an EmptyImmutableSet causing NoSuchElementException . p>

The sample application is at: link .

Note: Before version 2.4.0-BETA2 the error occurred only in the class that inject the ResourceBundle and not in the deploy of the application.

Editing :

After studying the demoiselle code ( github.com/demoiselle ), I realized that if my project depended on one of the packages - demoiselle-se or demoiselle-servlet - the class object java.util.Locale could be injected thus solving the exception thrown NoSuchElementException . >

The result is that every project that depends on the demoiselle-core should also depend on one of these two dependencies to work properly.

    
asked by anonymous 29.01.2015 / 13:09

0 answers