0

I just created a fresh Oracle Linux 7 VM with Tomcat 7 and Java 8_40. I've created several servers with Apache and Tomcat before, but never connecting to databases before. SELinux and firewalld are both off (for testing purposes.) I can't seem to get the jdbc configured correctly. Here's what I have:

Context.xml:

<ResourceLink global="jdbc/JCAppsCoreDS" name="jdbc/JCAppsCoreDS" type="javax.sql.DataSource"/>

Server.xml

    <Resource name="jdbc/JCAppsCoreDS" auth="Container"
   type="javax.sql.DataSource"
   driverClassName="oracle.jdbc.OracleDriver"
   url="jdbc:oracle:thin:@//******/PROD"
   username="******" password="*****"
   initialSize="5" maxActive="100" maxIdle="-1" maxWait="30"
   validationQuery="select 1 from dual"
   testOnBorrow="true"
   factory="org.apache.commons.dbcp.BasicDataSourceFactory" />

With the ***** being actual items of course. When I try to go to the URL of my application I get:

Naming exception Error while connecting to the database : javax.naming.NameNotFoundException: Name [jdbc/JCAppsCoreDS] is not bound in this Context. Unable to find [jdbc].

As far as I can tell, my config is correct, but I'm still getting errors. Anybody have any ideas? Also, I don't see much as far as this error goes in the logs. Does anyone know which logs and where I need to increase the log level? I've messed with them a bit, but haven't been able to get more info.

Thanks!

dlemp
  • 21
  • 1
  • 1
  • 5

2 Answers2

2

Did you configure the Resource reference in web.xml?

<resource-ref>
  <res-ref-name>jdbc/JCAppsCoreDS</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
</resource-ref>
raupach
  • 235
  • 1
  • 5
  • I did not, thanks for that! I'm still getting the same error though. What I'm doing is moving a Weblogic application over to Tomcat. I basically just grabbed the war file off of the Weblogic server and deployed it on my new Tomcat server. Maybe that'll help us come up with an answer? Thanks! – dlemp Feb 12 '16 at 14:11
  • Does anyone know of any logs that could be set to show any errors for this issue? I can't seem to find ANYTHING of any use in the logs currently. – dlemp Feb 18 '16 at 19:59
  • Did you configure the database in the GlobalNamingResources? – raupach Feb 25 '16 at 13:28
  • partial solution, new errors appeared, but it looks like a step forward – Damir Olejar Mar 14 '18 at 17:08
1

We just figured out the issue yesterday though, the applications we are trying to move from weblogic to tomcat calls the database in a way that weblogic recognizes, but tomcat does not. We're going to edit the database call and use spring to hopefully make everything work together. Thanks for the tips though!

dlemp
  • 21
  • 1
  • 1
  • 5