You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by BinhMinh Nguyen <st...@yahoo.com> on 2001/07/30 21:34:40 UTC
problem loading ActionServlet with DataSource
For some reason, my application cannot load
ActionServlet if we use Connection Pooling using
DataSource in the struts-config.xml, Please help me
spot my error. Thank you.
B Nguyen
--------------------------------------------------
strut-config.xml:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts
Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<!--
This is the Struts configuration file for the
application,
using the proposed new syntax.
NOTE: You would only flesh out the details in
the "form-bean"
declarations if you had a generator tool that
used them to create
the corresponding Java classes for you.
Otherwise, you would
need only the "form-bean" element itself, with
the corresponding
"name" and "type" attributes.
-->
<struts-config>
<!-- ========== Form Bean Definitions
=================================== -->
<form-beans>
<!-- Logon form bean -->
<form-bean name="mainForm"
type="com.furnishnet.MainForm"/>
<!-- Process form bean -->
<form-bean name="processForm"
type="com.furnishnet.operation.ProcessForm"/>
</form-beans>
<!-- ========== Global Forward Definitions
============================== -->
<global-forwards>
<forward name="default"
path="/index.jsp"/>
<forward name="error"
path="/errorpage.jsp"/>
</global-forwards>
<!-- ========== Action Mapping Definitions
============================== -->
<action-mappings>
<!-- Main -->
<action path="/main/main"
type="com.furnishnet.MainAction"
name="mainForm"
input="/main/main_screen.jsp"
validate="true">
<forward name="process"
path="/main/operation/process_screen.jsp"/>
</action>
<!-- Process -->
<action path="/main/operation/process"
type="com.furnishnet.operation.ProcessAction"
name="processForm"
input="/main/operation/process_screen.jsp">
<forward name="search"
path="/main/main_screen.jsp"/>
</action>
</action-mappings>
<!-- DataSource -->
<data-sources>
<data-source>
<set-property property="key"
value="FN_local"/>
<set-property property="autoCommit"
value="true"/>
<set-property property="description"
value="FN Data Source Configuration"/>
<set-property property="driverClass"
value="oracle.jdbc.driver.OracleDriver"/>
<set-property property="maxCount"
value="4"/>
<set-property property="minCount"
value="2"/>
<set-property property="password"
value="furnnet"/>
<set-property property="user"
value="furnnet"/>
<set-property property="url"
value="jdbc:oracle:thin://localhost:1521/furnnet"/>
</data-source>
</data-sources>
</struts-config>
----------------------------------------------------------
error-message:
Parse Error at line 71 column -1: Element
"struts-config" allows no further input;
"data-sources" is not allowed.
org.xml.sax.SAXParseException: Element "struts-config"
allows no further input; "data-sources" is not
allowed.
at
com.sun.xml.parser.Parser.error(Parser.java:2795)
at
com.sun.xml.parser.ValidatingParser$ChildrenValidator.consume(ValidatingParser.java:306)
at
com.sun.xml.parser.Parser.maybeElement(Parser.java:1281)
at
com.sun.xml.parser.Parser.content(Parser.java:1499)
at
com.sun.xml.parser.Parser.maybeElement(Parser.java:1400)
at
com.sun.xml.parser.Parser.parseInternal(Parser.java:492)
at
com.sun.xml.parser.Parser.parse(Parser.java:284)
at
javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
at
javax.xml.parsers.SAXParser.parse(SAXParser.java:77)
at
org.apache.struts.digester.Digester.parse(Digester.java:755)
at
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1271)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:459)
at
s1.struts.component.ActionComponentServlet.init(ActionComponentServlet.java:45)
at
javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
at
org.apache.tomcat.core.Handler.init(Handler.java:215)
at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
at
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.java:130)
at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:491)
at
org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
at
org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
at
org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
New org.apache.struts.util.GenericDataSource
Set org.apache.struts.util.GenericDataSource
properties
Call
s1.struts.component.ActionComponentServlet.addDataSource(org.apache.struts.action.DATA_SOURCE,
GenericDataSource[activeCount=0
, autoCommit=true, closed=false, driverClass=null,
loginTimeout=0, maxCount=2, minCount=1, password=null,
readOnly=false, url=null,
useCount=0, user=null])
Set org.apache.struts.util.GenericDataSource property
key to FN_local
Set org.apache.struts.util.GenericDataSource property
autoCommit to true
Set org.apache.struts.util.GenericDataSource property
description to FN Data Source Configuration
Set org.apache.struts.util.GenericDataSource property
driverClass to oracle.jdbc.driver.OracleDriver
Set org.apache.struts.util.GenericDataSource property
maxCount to 4
Set org.apache.struts.util.GenericDataSource property
minCount to 2
Set org.apache.struts.util.GenericDataSource property
password to furnnet
Set org.apache.struts.util.GenericDataSource property
user to furnnet
Set org.apache.struts.util.GenericDataSource property
url to jdbc:oracle:thin://localhost:1521/furnnet
Pop org.apache.struts.util.GenericDataSource
cannot load servlet name: action: Exception
initializing application data source org.apache.struts.action.DATA_SOURCE
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/