Binding local EJB Client to any non existent JNDI name does not cause any exception in EAP 6

Solution Unverified - Updated -

Issue

  • After Specifying ic.bind("java:global/a/b/c/d/e/f", "foobar"); in EJB JAR as follows does not generate an exception:-
@Startup
@Singleton
public class AbcPqr
{
    @PostConstruct
    @SuppressWarnings("rawtypes")
    public void onStartup() throws IOException
    {
        Context ic = new InitialContext();

        ic.bind("java:global/a/b/c/d/e/f", "foobar");

    }

However, with regards to JavaDoc, it is specified that it Binds a name to an object. All intermediate contexts and the target context (that named by all but terminal atomic component of the name) must already exist.

Environment

  • Red Hat Enterprise Application Platform (EAP)
    • 6.1.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.