• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with Connection pooling in tomcat 5.5

 
Sri Dharan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,
I am doing small web application ,in that I am doing connection pooling.I followed these steps:
1.In Conf/server.xml - added below code
<Server port="8005" shutdown="SHUTDOWN">...

<Resource name="jdbc/myoracle" auth="Container"
type="javax.sql.DataSource"
description="Oracle 9i database that can be updated and saved"
factory="oracle.jdbc.driver.OracleDriver"
url="jdbcracleci9:@oracle"
username="scott" password="tiger" maxActive="20" maxIdle="10" maxWait="-1""/>
....
</Server>

2. In web.xml of my web application:
<web-app>...
<resource-ref>
<description>Oracle Datasource example</description>
<res-ref-name>jdbc/myoracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

...</web-app>

3.In my class :

Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
Connection con = ds.getConnection();


4. I started tomcat 5.5 server , it is not starting and getting error in log file like:

Nov 18, 2008 11:31:22 PM org.apache.tomcat.util.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 42 column 85: Element type "Resource" must be followed by either attribute specifications, ">" or "/>".
org.xml.sax.SAXParseException: Element type "Resource" must be followed by either attribute specifications, ">" or "/>".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
at org.apache.catalina.startup.Catalina.load(Catalina.java:475)
at org.apache.catalina.startup.Catalina.load(Catalina.java:512)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:243)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:408)




I am not able to run tha server.Could you please help inthis concern.
 
Joe Ess
Bartender
Pie
Posts: 9266
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like you have an extra quote mark here:

The easiest way to spot errors in XML is to use an editor which checks your text against the XML's DTD. There are many. I use JEdit with the XML plugin.
 
Sri Dharan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your valuable reply...
I reomved that quotations and tried then server is running but same error is coming.
 
Joe Ess
Bartender
Pie
Posts: 9266
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The easiest way to spot errors in XML is to use an editor which checks your text against the XML's DTD. There are many. I use JEdit with the XML plugin.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic