You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Bonnie MacKellar <BM...@mobius.com> on 2003/04/09 21:07:45 UTC
JNDI setup problems
OK, I have decided that my problems must be with the way I am specifying
JNDI lookup in the repository_database.xml file.
Here are the steps I have tried so far :
In weblogic, I create a pooled DataSource whose JNDI name is OJBDataSource.
I verify that this works using a straight JDBC lookup.
I then create this entry in the repository_database.xml file :
<!-- Datasource example -->
<!-- jdbc-connection-descriptor
jcd-alias="testOJB"
default-connection="true"
platform="MsSqlServer"
jdbc-level="2.0"
jndi-datasource-name="OJBDataSource"
username="admin"
password="ActiveBill"
eager-release="false"
batch-mode="false"
useAutoCommit="0"
ignoreAutoCommitExceptions="false"
>
<sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl">
<attribute attribute-name="grabSize" attribute-value="20"/>
</sequence-manager>
</jdbc-connection-descriptor -->
and I have these entries in ojb.properties (I think these are the relevant
ones) :
----------------------------------------------------------------------------
ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryPo
oledImpl
ConnectionManagerClass=org.apache.ojb.broker.accesslayer.ConnectionManagerIm
pl
OJBTxManagerClass=org.apache.ojb.odmg.LocalTxManager
----------------------------------------------------------------------------
I have verified that the correct repository.xml and ojb.properties files are
actually being used. I have also tried different means of specifying the
Broker, most currently by this call :
------------------------------------------------------------------
broker = PersistenceBrokerFactory.
createPersistenceBroker(new
PBKey("testOJB","admin","ActiveBill"));
-----------------------------------------------------------------
The user name and password which I am passing are the Weblogic ones, not the
MsSQLServer ones. I did try using the MsSQLServer ones, to no avail.
The error message that I get is
----------------------------------------------------------------
[org.apache.ojb.broker.metadata.ConnectionRepository] INFO: Could not found
org.
apache.ojb.broker.metadata.JdbcConnectionDescriptor for PBKey
org.apache.ojb.bro
ker.PBKey: repository=testOJB, user=admin, password=*****
[org.apache.ojb.broker.accesslayer.ConnectionManagerFactory] ERROR:
Configurable
Factory instantiation failed for class class
org.apache.ojb.broker.accesslayer.C
onnectionManagerImpl
* Factory types:
1 - Type: org.apache.ojb.broker.PersistenceBroker
* Factory arguments:
1 - Argument: org.apache.ojb.broker.singlevm.PersistenceBrokerImpl@491525
null
java.lang.reflect.InvocationTargetException: java.lang.NullPointerException
at
org.apache.ojb.broker.platforms.PlatformFactory.getPlatformFor(Unknow
n Source)
at
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.<init>(Unknow
n Source)
at java.lang.reflect.Constructor.newInstance(Native Method)
at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown
Source)
at
org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInsta
nce(Unknown Source)
at
org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInsta
nce(Unknown Source)
at
org.apache.ojb.broker.accesslayer.ConnectionManagerFactory.createConn
ectionManager(Unknown Source)
at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.<init>(Unknown S
ource)
at java.lang.reflect.Constructor.newInstance(Native Method)
at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown
Source)
at
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createNe
wBrokerInstance(Unknown Source)
at
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl$PBKeyedP
oolableObjectFactory.makeObject(Unknown Source)
at
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Gene
ricKeyedObjectPool.java:748)
at
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createPe
rsistenceBroker(Unknown Source)
at
org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroke
r(Unknown Source)
----------------------------------------------------------------------------
-
Obviously, I am doing something wrong. But what? I cannot find the problem.
I have tried many different possibilities.
thanks,
Bonnie MacKellar
software engineer
Mobius Management Systems, Inc.
bmackell@mobius.com