tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Davidson" <stephen.david...@etcc.com>
Subject RE: Include Classpath not sharing Deployed EJBs?
Date Tue, 26 Jan 2010 17:15:47 GMT
Sure.

The odd thing is, this works when there IS a ejb-jar.xml file.  Only
when there is no ejb-jar.xml does this fail.  I think I still have
Jason's(?) test case around.  If needed, I can probably modify that to
produce this if you would like.

Regards,
Steve

    protected <T extends ServiceInterface> T getImpl(Class<T>
theInterface) {
        if (logger.isTraceEnabled())
            logger.trace("Getting EJB Client for: " +
theInterface.getName());
        InitialContext initialContext = null;
        try {
            initialContext = getInitialContext();
            @SuppressWarnings("unchecked")
            T service = (T)initialContext.lookup("com/etcc/" +
getServiceName(theInterface) + "Local");
            return service;
        } catch (NamingException e) {
          String msg = "Unable to access EJB " +
getServiceName(theInterface) + ": " + e.getMessage();
          throw new RuntimeException(msg, e);
        } finally {
            if (initialContext != null){
                try {
                    initialContext.close();
                } catch (NamingException e) {
                    logger.warn("Exception closing initial context: " +
e.getMessage(), e);
                }
            }
        }

    }

-----Original Message-----
From: David Blevins [mailto:david.blevins@visi.com] 
Sent: Monday, January 25, 2010 9:44 PM
To: users@openejb.apache.org
Subject: Re: Include Classpath not sharing Deployed EJBs?


On Jan 25, 2010, at 9:18 PM, Stephen Davidson wrote:

> Runtime excerpt;
> INFO - Beginning load: C:\Documents and
> Settings\sdavidson\.m2\repository\org\mortbay\jetty\start 
> \6.1.11\start-6
> .1.11.jar
> INFO - Configuring enterprise application: classpath.ear
> INFO - Configuring Service(id=Default Stateless Container,
> type=Container, provider-id=Default Stateless Container)
> INFO - Auto-creating a container for bean com/etcc/Account:
> Container(type=STATELESS, id=Default Stateless Container)
> INFO - Enterprise application "classpath.ear" loaded.
> INFO - Assembling app: classpath.ear
> INFO - Jndi(name=com/etcc/StateLocal) -->
> Ejb(deployment-id=com/etcc/State)
>
> ...
>
> Running com.etcc.csc.delegate.StateDelegateEjbTest
> TRACE - Getting EJB Client for: com.etcc.csc.service.StateInterface
> TRACE - Loading service: State
> TRACE - Loading service: State
> DEBUG - Unable to access EJB State: Name "com/etcc/StateLocal" not
> found.
> javax.naming.NameNotFoundException: Name "com/etcc/StateLocal" not

It looks like everything should work.  The log shows the bean you want  
has been created and the exception shows you're using the right JNDI  
name.  Is it possible you can post some of the test code?


-David

-- 
http://blog.dblevins.com/
http://twitter.com/dblevins
Like OpenEJB?  Tweet it!




Mime
View raw message