users@glassfish.java.net

Re: Can I inject a JCA Connection Factory?

From: <glassfish_at_javadesktop.org>
Date: Tue, 09 Oct 2007 17:15:42 PDT

From what I can tell, this exception is in NamingManagerImpl.lookup.

    public Object lookup(String name, SerialContext serialContext)
        throws NamingException {
        _logger.fine("serialcontext in NamingManagerImpl.." + serialContext);
        Context ic = null;
        
        if (serialContext != null) {
            ic = serialContext;
        } else {
            ic = initialContext;
        }
        
        //initialContext is used as ic in case of PE while
        //serialContext is used as ic in case of EE/SE
        if (_logger.isLoggable(Level.FINE))
            _logger.log(Level.FINE,"NamingManagerImpl : looking up name : " + name);
        
        // Get the component id and namespace to lookup
        String componentId = getComponentId();
        
        HashMap namespace = (HashMap)namespaces.get(componentId);
        
        Object obj = namespace.get(name);
        
        if ( obj == null )
            throw new NameNotFoundException("No object bound to name " + name);
        
        if ( obj instanceof J2EEEnvWrapper ) {
            J2EEEnvWrapper wr = (J2EEEnvWrapper)obj;
            switch ( wr.type ) {
            case J2EEEnvWrapper.MUTABLE:
                // XXX is this copy necessary ?
                
                obj= NamingUtils.makeCopyOfObject(wr.object); <-- THIS ERRORS
                break;
                
            case J2EEEnvWrapper.JDBC_REF:
                obj = wr.object;
                break;
...

So, the J2EEEnvWrapper for the object in the namespace is a MUTABLE type. What I'm not sure of, is where this is set. Further down in this switch statement, it's checking for RESOURCE_ADAPTER or RESOURCE_ADAPTER_REF, which looks plausible.
[Message sent by forum member 'hildo' (hildo)]

http://forums.java.net/jive/thread.jspa?messageID=239218