<resource-ref>
<res-ref-name>jdbc/eBanking</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
In the resource reference area of the session bean in the AAT GUI, the
binding name is not specified. In the general tab, however the above details
are displayed correctly.
I am encountering a few problems which i'll list below. I hope somebody can
help me with them:
1. When i try to access any session bean, which calls the following bit of
code in the create method :
initial = new InitialContext();
// create a data source
dataSource = (DataSource) initial.lookup("java:comp/env/jdbc/eBanking");
plConn = dataSource.getConnection();
it fails with the following exception :
javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context
"java:".
at
com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1443)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:824)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1166)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1158)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1210)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at
com.mki.ebanking.manager.beans.AbstractBanksiteManager.initialiseAbstractBan
ksiteManager.java:44)
at
com.mki.ebanking.beans.lclcustyp.LclcustypManagerBean.ejbCreateLclcustypMana
gerBean.java:106).....
I am not able to get the datasource consequently. According to my
understanding the resource reference for the data source is being accessed
properly in the code. Im not sure why its not able to look it up.
2. I therefore specified a name in the bindings section of the resource
reference. I gave it the JNDI name - jdbc/eBanking - same as the name of the
resource. When i tried accessing it now it failed with the following
exception :
javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context
"java:".
at
com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1443)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:824)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1166)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1158)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1210)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at
com.mki.ebanking.manager.beans.AbstractBanksiteManager.initialiseAbstractBan
ksiteManager.java:44)
at
com.mki.ebanking.beans.lclcustyp.LclcustypManagerBean.ejbCreateLclcustypMana
gerBean.java:106).....
I tried then with various other combinations, once with
java:comp/env/jdbc/eBanking itself, but without any success. Only the
exceptions kept differing, the end result was the same.
3. I then removed all jndi names for the resources, installed and restarted
the application. For the beans, whose resource JNDI names i had just
removed, the std. output log displayed this error:
[01.09.19 17:04:09:218 BST] 2877601f IndirectJndiL W NMSV0701W: An
IndirectJNDILookup object was created with an empty name. Lookups using this
object will fail.
java.lang.Throwable
at
com.ibm.ws.naming.util.IndirectJndiLookup.init(IndirectJndiLookup.java:116)
at
com.ibm.ws.naming.util.IndirectJndiLookup.<init>(IndirectJndiLookup.java:61)
at
com.ibm.ws.naming.util.IndirectJndiLookupFactoryImpl.createIndirectJndiLooku
p(IndirectJndiLookupFactoryImpl.java:34)
at
com.ibm.ejs.container.BeanMetaData.populateJavaNameSpace(BeanMetaData.java:1
365)
at
com.ibm.ejs.container.BeanMetaData.completeInitialization(BeanMetaData.java:
753)
at
com.ibm.ejs.container.EJSContainer.loadBeanMetaData(EJSContainer.java:1518)
at
com.ibm.ejs.container.EJSContainer.getHomeInstance(EJSContainer.java:1255)
at com.ibm.ejs.container.EJSContainer.startBean(EJSContainer.java:1219)
at com.ibm.ws.runtime.BeanHelper.startBean(BeanHelper.java:154)
at com.ibm.ws.runtime.EJBEngine.addEjbModule(EJBEngine.java:437)
at com.ibm.ws.runtime.Server.startModule(Server.java:605)
at
com.ibm.ws.runtime.StandardServer.initializeModules(StandardServer.java:321)
at
com.ibm.ws.runtime.StandardServer.initializeRuntime0(StandardServer.java:349
)
at com.ibm.ws.runtime.Server.initializeRuntime(Server.java:882)
at com.ibm.ws.runtime.StandardServer.main(StandardServer.java:519)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:158)
However, the bean deploys. It seems to be only for the resource reference.
When the session bean is accessed in this case the following exception is
thrown:
com.ibm.websphere.naming.CannotInstantiateObjectException: Exception
occurred while attempting to get an instance of the object for the specified
reference object. Root exception is javax.naming.NamingException: Failed to
lookup the object configured with a null or empty name
at
com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstance(Ind
irectJndiLookupObjectFactory.java:123)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:308)
at
com.ibm.ws.naming.urlbase.UrlContextHelper.isReference(UrlContextHelper.java
:115)
at
com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlCo
ntextHelper.java:229)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1181)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1158)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1210)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at
com.mki.ebanking.beans.generalfunctions.picklistmanager.PickListManagerBean.
ejbCreate(PickListManagerBean.java:59)
I have to admit, im stumped. All that i can make out of these errors is that
the system is not able to create a DataSource. And that its somehow related
to an incorrect JNDI name for the resource. But I have no ideas about the
what, where, how, and why.
I will be very gald of ANY help on this score. Im way behind my deliverable
date.
Thanks and regards,
Pavan
com.ibm.websphere.ce.cm.StaleConnectionException: Connection is closed
at
com.ibm.ejs.cm.proxy.ConnectionProxy.getConnection(ConnectionProxy.java:656)
at
com.ibm.ejs.cm.proxy.ConnectionProxy.translateException(ConnectionProxy.java
:142)
at
com.ibm.ejs.cm.proxy.ConnectionProxy.createStatement(ConnectionProxy.java:42
1)
at
com.mki.ebanking.beans.generalfunctions.picklistmanager.PickListManagerBean.
getResults(PickListManagerBean.java:266)
at
com.mki.ebanking.beans.generalfunctions.picklistmanager.PickListManagerBean.
lookUp(PickListManagerBean.java:161)
at
com.mki.ebanking.beans.generalfunctions.picklistmanager.EJSRemoteStatefulPic
kListManager.lookUp(EJSRemoteStatefulPickListManager.java:49)
TAR
Pavan
Pavanapuresan <pav...@midas-kapiti.com> wrote in message
news:9oaiq3$pmo$1...@news.boulder.ibm.com...
1. Specified the JNDI name in the bindings tab in AAT (this is NOT the
same as the stuff that appears in ejb-jar.xml)
or
2. Specified the correct binding when you install the app?
The entry in ejb-jar.xml, that is displayed in the general tab in AAT is
declaring that java:comp/env/jdbc/eBanking is a name that your EJB uses.
The binding is application-server (vendor and instance) specific
information that says what the 'real' JNDI name of the resource is -
i.e. what the container should look up and actually give to the EJB when
the reference is requested.
There's a section in the 6134 redbook on this if I haven't explained
this well enough.
Alex.
> The binding is application-server (vendor and instance) specific
> information that says what the 'real' JNDI name of the resource is -
> i.e. what the container should look up and actually give to the EJB when
> the reference is requested.
1. Do u know the real JNDI name of the resource?
2. Another doubt, should this information be present in the
ibm-ejb-jar-bnd.xmi document?
3. Which section in the redbook discusses this?
TAR
Pavan
Alex Matthews <al...@xelacom.com> wrote in message
news:3BA8EE90...@xelacom.com...
Alex.
com.ibm.websphere.ce.cm.StaleConnectionException: Connection is closed
at
com.ibm.ejs.cm.proxy.ConnectionProxy.getConnection(ConnectionProxy.java:656)
at
com.ibm.ejs.cm.proxy.ConnectionProxy.translateException(ConnectionProxy.java
:142)
at
com.ibm.ejs.cm.proxy.ConnectionProxy.createStatement(ConnectionProxy.java:42
1)
at
com.mki.ebanking.beans.generalfunctions.picklistmanager.PickListManagerBean.
getResults(PickListManagerBean.java:266)
at
com.mki.ebanking.beans.generalfunctions.picklistmanager.PickListManagerBean.
lookUp(PickListManagerBean.java:161)
at
com.mki.ebanking.beans.generalfunctions.picklistmanager.EJSRemoteStatefulPic
kListManager.lookUp(EJSRemoteStatefulPickListManager.java:49)....
BTW, i have specified the resource jndi name for only the session bean that
i am testing. For the others, its still empty. That wouldn't be a problem,
would it?
In weblogic, the weblogic specific xml file has the following snippet of
info. regarding the data source for the session bean:
<reference-descriptor>
<resource-description>
<res-ref-name>jdbc/eBanking</res-ref-name>
<jndi-name>weblogic.jdbc.jts.eBanking</jndi-name>
</resource-description>
</reference-descriptor>
Could u paste a snippet of the websphere specific xmi document that contains
this information of the resource reference?
TAR
Pavan
Alex Matthews <al...@xelacom.com> wrote in message
news:3BA9BB26...@xelacom.com...
If the database has not been restarted, and you haven't had any other
sort of interruption (network outage, etc) that would cause a pooled
connection to become invalid, we'll have to look a bit closer. What
database are you using, and how have you configured the datasource, BTW?
Alex.
Pavan
Alex Matthews <al...@xelacom.com> wrote in message
news:3BA9E552...@xelacom.com...
Why not do it once and check your own bindings XML?
Alex.
Alex Matthews <al...@xelacom.com> wrote in message
news:3BAA02B0...@xelacom.com...