facebook

data source org.apache.struts.actioaction.DATA_SOURCE

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #252606 Reply

    zqu
    Member

    how to sovle this :(thank you!) i think i may need a connection-pool .jar?!

    tomcat5.5 ; struts1.1;jdk1.5 😯

    Servlet /helloworld threw load() exception
    javax.servlet.UnavailableException: Initializing application data source org.apache.struts.action.DATA_SOURCE

    struts-config.xml

    <data-sources >
    <data-source type=”org.apache.struts.action.LoginstrutsAction” key=”org.apache.struts.action.DATA_SOURCE”>
    <set-property property=”password” value=”123456″ />
    <set-property property=”minCount” value=”” />
    <set-property property=”maxCount” value=”” />
    <set-property property=”user” value=”root” />
    <set-property property=”driverClass” value=”com.mysql.jdbc.Driver” />
    <set-property property=”description” value=”cheetah” />
    <set-property property=”url” value=”jdbc:mysql://localhost:3306/cheetah” />
    <set-property property=”readOnly” value=”false” />
    <set-property property=”autoCommit” value=”false” />
    <set-property property=”loginTimeout” value=”10000″ />
    </data-source>

    action.java

    javax.sql.DataSource ds=getDataSource(request);
    con=ds.getConnection();

    #252630 Reply

    Riyad Kalla
    Member

    What version of MyEclipse do you have installed and did you use it to configure this project and add libraries to it, or did the project already exist?

    #252647 Reply

    Haris Peco
    Member

    and add complete log please

    Thanks

    #252702 Reply

    zqu
    Member

    myeclipse version 3.1 i also put mm.mysql-2.0.4-bin.jar,jdbc-mysql.jar under WEB-INF/lib/,but it’s no use, same error!

    log of the console above ! it
    occurswhen i start tomcat service,and there are no pointed errors of my codes in eclipse!

    2006-5-29 10:12:27 org.apache.catalina.core.ApplicationContext log
    info: Marking servlet action as unavailable
    2006-5-29 10:12:27 org.apache.catalina.core.StandardContext loadOnStartup
    serious: Servlet /helloworld threw load() exception
    javax.servlet.UnavailableException: Initializing application data source org.apache.struts.action.DATA_SOURCE
    at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1091)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
    at javax.servlet.GenericServlet.init(GenericServlet.java:211)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4197)
    at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1079)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1172)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:292)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1305)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1569)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1578)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1558)
    at java.lang.Thread.run(Thread.java:595)
    2006-5-29 10:14:11 org.apache.struts.util.PropertyMessageResources <init>
    infor: Initializing, config=’org.apache.struts.taglib.html.LocalStrings’, returnNull=true
    2006-5-29 10:14:11 org.apache.struts.util.PropertyMessageResources <init>
    infor: Initializing, config=’org.apache.struts.util.LocalStrings’, returnNull=true
    2006-5-29 10:14:11 org.apache.struts.util.PropertyMessageResources <init>
    infor: Initializing, config=’org.apache.struts.taglib.html.LocalStrings’, returnNull=true
    2006-5-29 10:14:11 org.apache.struts.util.PropertyMessageResources <init>
    infor: Initializing, config=’org.apache.struts.taglib.html.LocalStrings’, returnNull=true
    2006-5-29 10:14:11 org.apache.struts.util.PropertyMessageResources <init>
    infor: Initializing, config=’org.apache.struts.taglib.html.LocalStrings’, returnNull=true
    2006-5-29 10:14:11 org.apache.struts.util.PropertyMessageResources <init>
    infor: Initializing, config=’org.apache.struts.taglib.html.LocalStrings’, returnNull=true

    #252703 Reply

    zqu
    Member

    i create the project and add struts1.1 support for it ,and add mm.mysql-2.0.4-bin.jar,jdbc-mysql.jar under WEB-INF/lib/

    #252704 Reply

    zqu
    Member

    my sql version 5.0!

    #252705 Reply

    Haris Peco
    Member

    you have old jdbc driver – try download last driver (3.1.12 stable) from http://dev.mysql.com/downloads/connector/j/3.1.html

    Best

    #252715 Reply

    zqu
    Member

    i remove mm.mysql-2.0.4-bin.jar and jdbc-mysql.jar under WEB-INF/lib/;add mysql-connector-java-3.1.12-bin.jar into the build path,configue the Drivers of eclipse. now DB Browser is connected to the mysql database successfully and can show the tables!but still i can’t open my jsp webpage with the same error! go to crazy!

    #252719 Reply

    Haris Peco
    Member

    try change this

    <data-source type=”org.apache.struts.action.LoginstrutsAction” key=”org.apache.struts.action.DATA_SOURCE”>

    to

    <data-source type=”org.apache.commons.dbcp.BasicDataSource” key=”org.apache.struts.action.DATA_SOURCE”>

    and add commons-dbcp.jar in classpath if doesn’t exists

    or for tomcat5.5 just change to

    <data-source type=”org.apache.tomcat.dbcp.dbcp.BasicDataSource” key=”org.apache.struts.action.DATA_SOURCE”>

    Best

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: data source org.apache.struts.actioaction.DATA_SOURCE

You must be logged in to post in the forum log in