Link to home
Start Free TrialLog in
Avatar of James Cochrane
James CochraneFlag for United States of America

asked on

Tomcat admin error Exception retrieving attribute 'driverClassName'

I use the http://localhost:8080/admin to configure datasources and I always get the following error:

org.apache.jasper.JasperException: Exception retrieving attribute 'driverClassName'
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
      at org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.java:1759)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1596)
      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
      at org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.java:1759)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1596)
      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:551)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
      at java.lang.Thread.run(Thread.java:536)


I have various machines that I use and they all get the same error.  The connection works as I am able to retrieve database information (MS SQLServer 2000) from my web pages.  I haven't been able to find any information about this error anywhere.  I do not typically update the server.xml manually, I use the admin tool.

Thank you,
Jim Cochrane
Avatar of vzilka
vzilka

Can you print a portion of your server.xml file, the one that specifies the definition of the data source (was the creation of the data source successful?)

Also, did you place the JDBC driver JAR files in your shared\lib or \lib directories?
Avatar of James Cochrane

ASKER

Hi,

Sorry for the delay in answering.  I suddendly had more pressing fires to put out.

My SQL Server jar files are in my common/lib directory.  I am able create a new context, add a JNDI connection copy into the appropriate context and even view the newly created context.  When I change the context name to the one that I need, in this case /tdp, it gives me that server error.  

I am successfully able to use the JNDI connection below.  It's when I try to make changes or access it within the admin tool that I run into trouble.  Even when I copy the block for the context and change it to the appropriate name I get the error.

Here is the portion of server.xml:

        <Context className="org.apache.catalina.core.StandardContext" cachingAllowed="true" charsetMapperClass="org.apache.catalina.util.CharsetMapper" cookies="true" crossContext="true" debug="0" displayName="TDP Demo Area" docBase="c:\Tomcat\webapps\tdp" mapperClass="org.apache.catalina.core.StandardContextMapper" path="/tdp" privileged="false" reloadable="true" swallowOutput="false" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper">
          <Resource auth="Container" description="DB Connection" name="jdbc/MSSQLTDP" scope="Shareable" type="javax.sql.DataSource"/>
          <Resource auth="Container" name="jdbc/MSTDPDB" scope="Shareable" type="javax.sql.DataSource"/>
          <Resource auth="Container" description="DB Connection" name="jdbc/TestDB" scope="Shareable" type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/MSTDPDB">
            <parameter>
              <name>maxWait</name>
              <value>5000</value>
            </parameter>
            <parameter>
              <name>maxActive</name>
              <value>10</value>
            </parameter>
            <parameter>
              <name>password</name>
              <value>place1XHolder</value>
            </parameter>
            <parameter>
              <name>url</name>
              <value>jdbc:microsoft:sqlserver://localhost:1433;Database=tdp</value>
            </parameter>
            <parameter>
              <name>driverClassName</name>
              <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
            </parameter>
            <parameter>
              <name>maxIdle</name>
              <value>4</value>
            </parameter>
            <parameter>
              <name>username</name>
              <value>webuser</value>
            </parameter>
          </ResourceParams>
        </Context>
What Tomcat version are you using?
4.1.24
DOes the problem happens when you administrate Tomcat, or during your application runtime?

I saw these 2 links:
http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg104787.html
http://archives.real-time.com/pipermail/tomcat-devel/2002-September/039380.html

Both describe problems similar to yours.
Just to make sure - if you deploy the same context anywhere it works, but if path of the context is /tdp you get the error?
It only happens in the administration.  There are various contexts that work and others that don't.  /tdp happens to be one that doesn't.  The ones that I usually don't need are the ones that usually work.  I don't know how Tomcat figures out which ones I need! LOL.

I'll check out those links.

Thanks,
Jim
Can you run a find on the server.xml and find if there is a /tdp context?
Maybe the admin console didn't clean the server.xml properly.
Also, try to make the web-apps directory does not contain a tdp file.
The server.xml does have a /tdp context.  The XML segment that I sent you is from server.xml.  I am not sure what you mean by your last comment.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of vzilka
vzilka

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Techboud, did this work?
At first it seemed it did. But then it started happening again and I didn't alter server.xml manually.  I've resolved to just changing the XML files at this point.  
Which XML files?
server.xml
So editing the server.xml file helps?
My application works fine.  It is when trying to use the JDBC congurator of the admin tool that gives the error.  I have no choice but to manually edit the server.xml file as that is the only way I can configure my settings properly, at least with respect to JDBC.
You can try to report this bug at Tomcat's site.