This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web app exception: Name jdbc is not bound in this Context

 
Antigoni Tsouri
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there,
I am trying to build a maven web application with tomcat, I am very new here, and I keep getting an exception:

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context.

The exception keeps appearing in the tomcat server when trying to validate a login.

This is our index.jsp:

This is our redirectPage.jsp:
<jsp:forward page="/WEB-INF/jsp/shMainView.jsp"></jsp:forward>

There is the shMainView:


Here is the validation file (the validation is supposed to go through the j_security_check):


And finally here is the respective part of the web.xml:


We 've also double checked the server.xml, context.xml and the credentials for the database connection, but nothing works!
I would appreciate any help here, because we' ve searched for feedback in the Internet, tried lots of staff and nothing works!

Thanks in advance!

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch Antigoni Tsouri :)

what's your full stack trace error message?
perhaps,exception-jdbc-bound-context this helps?
 
Antigoni Tsouri
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again, my full stack trace error message is:

18-Dec-2012 14:29:49 org.apache.catalina.realm.DataSourceRealm open
SEVERE: Exception performing authentication
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:415)
at org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:296)
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:260)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:454)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)


As far as the other link you posted in your reply, we tried searching for a an exploded or simple .war file to delete, but we didn't found such file.
My actual question is when you do validation through the doFilter() function, do you also have to explicitly connect to your Database through your program (e.g. use connection object and relevant database classes) or is it connected to the database automatically?

Thanks a lot again!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic