This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
We have very old application running on WAS5.1. We used to use properties file to get the DB connection information. Due to some issues now we are trying to use DataSource of WAS.
Accordingly we modified our code to get the DB connection through DataSource. We have used resource-ref to avoid WAS default warning.
Here is the code snippet:
But during running the application we are getting below error:
[1/13/12 16:26:59:545 CST] 214aa0e8 SessionContex E SESN0043E: BackedHashtable: problem obtaining the configured datasource. Ensure that you have properly co
nfigured a datasource. When Session Manager persistence is enabled the Session Manager configuration must contain a valid datasource.
[1/13/12 16:26:59:593 CST] 214aa0e8 SessionContex E Exception is: javax.naming.NameNotFoundException: Context: mspdev23aipdev112a/nodes/mspdev23aipdev112a/se
rvers/server1, name: jdbc/Sessions: First component in name Sessions not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDLmg.o
We couldn't understand why WAS is looking for "jdbc/Sessions"
1.you have to create datasource from websphere administrative console.I don't know whether WAS5.1 has option to create JNDI from administrative console.
2.Why did you keep ejb code in web.xml for web container ? move the code to ejb-jar.xml
Joined: Dec 04, 2001
WAS5.1 has option to create JNDI. As I have mentioned earlier that it's a pretty old application and and it's working fine with ejb references in the web.xml file.
And it is also working fine with below connection class:
But the problem is WAS throwing default warning message in the log file due to absence of resource-ref.
So to avoid that warning message we introduced resource-ref and after we started getting below exception in the log file.
Could you please give us some clue why WAS is looking for 'jdbc/sessions'.