Hi,

I'm experiencing the following problem:

NamingException in ejbStore() of a CMP Entity Bean while obtaining a
reference
to another entity bean that is bound in the java:comp/env/ejb namespace.
In the
ejbCreate() method of the same bean it works, but in the ejbStore() not.
According
to the ejb1.1 specs I should have access to the namespace inside both
methods.
Can anyone help me out, or give me a pointer to the piece of code that
checks
this?

--code snippet--

public void ejbStore() throws EJBException, RemoteException {
        // store TestReports
        if( dirty ) {
            BlobEntityHome blobEntityHome = null;
            try {
                Context context = new InitialContext();
                Object result = context.lookup(BLOBENTITY_REF);
                blobEntityHome = (BlobEntityHome)
                    PortableRemoteObject.narrow(result,
BlobEntityHome.class);
            } catch (NamingException e) {
                e.printStackTrace();
                throw new EJBException("BlobEntityHome (bound to " +
                    BLOBENTITY_REF + ") could not be found");
            }
            try {
                BlobEntity blob =
                    blobEntityHome.findByPrimaryKey( this.testReportId
);
                blob.setBlob( this.testReports );
            } catch( ObjectNotFoundException e ) {
                /**@todo: should we try to recreate here?*/
                throw new EJBException( e );
            } catch( FinderException e ) {
                throw new EJBException( e );
            }
            dirty=false;
        }

        }

Thanx in advance,

Joost van de Wijgerd
Senior Software Engineer
SmartHaven B.V.
Amsterdam, The Netherlands

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to