>From the codes in DataSourceBuilder, the jndi reference is with prefix aries:service, so there should be something like an ObjectFactory would take care of it. I could see a service org\apache\aries\jndi\url\Activator.class support this schema is registered in the activator, I simply compared that Java file between 0.2 and 0.3 seems that some logic is changed, think this should be a place to begin the debugging. Hope it helps.
2011/4/14 Shenghao Fang <[email protected]> > Hi, > > When I did the enablement for the monitoring portlet, I lookup the > datasource from JNDI and got an object of type javax.naming.Reference > instead of javax.sql.DataSource. > > I debugged into JNDI related modules and found the following clues: > > 1. If the object to be bound is of type javax.naming.Referenceable, > then the object of type javax.naming.Reference retrieved by > Referenceable.getReference() will be bound. And the object should be > dereferenced automatically when lookup. > > 2. When lookup from JNDI, javax.naming.spi.NamingManager tries to use > the ObjectFactoryBuilder set to dereference. In current > implementation, we set org.apache.aries.jndi.OSGiObjectFactoryBuilder > to ObjectFactoryBuilder. > > 3. Since the datasource is not packaged as an OSGi bundle, > OSGiObjectFactoryBuilder returns the Reference directly. > > > I have no idea on how to fix this, any idea? Thanks. > > > -- > Michael > -- Ivan
