Tomcat JDBC Sample

Trying to follow the jdbc connectivity example in Chopra, Li and Geneder's Apache Tomcat 6 book and i keep seeing ths 'quote symbol expected' at 3,20.  In which one of the files is this 3,20 that needs the quote symbol?   The only files i've added since the example last worked is a context.xml file.  Also I've made some changes to the server.xml file and the web .xml file.

To server.xml i added

<Resource name=”jdbc/WroxTC6” auth=”Container”
         type=”javax.sql.DataSource
         maxActive=”20”
         maxIdle=”30”
         maxWait=”10000”
         username=”empro”
         password=”empass”
         driverClassName=”com.mysql.jdbc.Driver”
         url=”jdbc:mysql://localhost:3306/test?autoReconnect=true
/>

To web.xml i added:

<env-entry>
<env-entry-name>foo/name4</env-entry-name>
<env-entry-type>java.lang.Integer</env-entry-type>
<env-entry-value>10</env-entry-value>
</env-entry>

Prior to that my tomcat would startup without error.   Now when i try startup i get this quotes error.


INFO: Deploying web application directory examples
Apr 8, 2011 1:39:21 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory examples
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Inval
id byte 1 of 1-byte UTF-8 sequence.
        at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF
8Reader.java:684)
        at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader
.java:554)
        at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEnti
tyScanner.java:1742)
        at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipSpaces(X
MLEntityScanner.java:1492)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanAttribute(XMLDocumentFragmentScannerImpl.java:1533)



*********************************************************************************************************************************

Apr 8, 2011 11:21:50 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /jsp/wroxjdbc/JDBCTest.jsp(3,20) quote symbol expected
      at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
      at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
      at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
      at org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:198)
      at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:148)
      at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:160)

context.xml
xoxomosAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Amitkumar PSr. ConsultantCommented:
Replace with " in your xml file.

or

update the context.xml with the following

<Context>
<Resource name="jdbc/WroxTC6"
auth="Container"
type="javax.sql.DataSource"
maxActive="20"
maxIdle="30"
maxWait="10000"
username="empro"
password="empass"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/test?autoReconnect=true"
/>
</Context>

Basically, you may have copied and pasted code from the book. Due to this, (”) is used rather than (").

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java App Servers

From novice to tech pro — start learning today.