Link to home
Start Free TrialLog in
Avatar of tsunpo
tsunpo

asked on

Upgrating Struts 1.1 to 1.2.4 - "servlet is unavailable"

Hi every expert,

Ive been experiencing annoying problems with my upgrating struts from 1.1 to 1.2.4
Should be not the "new URL of tlds" or some "new EL tags" problems...


1. Plaese have a look of the log file:

2004-11-04 11:01:15 StandardContext[/bioinfo]Marking servlet controller as unavailable
2004-11-04 11:01:15 StandardContext[/bioinfo]Servlet /bioinfo 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:782)
      at org.apache.struts.action.ActionServlet.init(ActionServlet.java:331)
      at javax.servlet.GenericServlet.init(GenericServlet.java:211)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
      at org.apache.catalina.core.StandardService.start(StandardService.java:480)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

2004-11-04 11:01:22 StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
2004-11-04 11:02:44 StandardWrapperValve[controller]: Servlet controller is currently unavailable


2. Here is the struts-config.xml (I use struts-config_1_2.dtd):

    <data-sources>
        <data-source type="org.apache.commons.dbcp.BasicDataSource">
            <set-property property="description" value="xxx"/>
            <set-property property="driverClass" value="com.mysql.jdbc.Driver"/>
            <set-property property="url"         value="jdbc:mysql://xxx.xxx.xxx.xxx/xxx"/>
            <set-property property="user"        value="xxx"/>
            <set-property property="password"    value="xxx"/>
            <set-property property="autoCommit"  value="false"/>
        </data-source>
    </data-sources>


3. And the web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.3"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_3.xsd">

    <display-name>Struts deployment descriptor</display-name>

    <servlet>
        <servlet-name>controller</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>controller</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>


Is there any change in these 2 files since Struts 1.2.x?? me is using Tomcat 5.0.28 as the front end


Please help,
George
Avatar of tsunpo
tsunpo

ASKER

HTTP Status 404 - Servlet controller is not available

Thanks in advance!!
George
Avatar of TimYates
Can you try:

    <data-sources>
        <data-source type="org.apache.commons.dbcp.BasicDataSource">
            <set-property property="description" value="xxx"/>
            <set-property property="driverClassName" value="com.mysql.jdbc.Driver"/>
            <set-property property="url"         value="jdbc:mysql://xxx.xxx.xxx.xxx/xxx"/>
            <set-property property="user"        value="xxx"/>
            <set-property property="password"    value="xxx"/>
            <set-property property="autoCommit"  value="false"/>
        </data-source>
    </data-sources>
ie:  driverClassName instead of driverClass
ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

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
Avatar of tsunpo

ASKER

hi pal,

u know what??? u just save my life  :)
wicked!!!!!! how stupid am i~~~

i saw the light, i saw the light  :p
george
:-D  Cool!  That worked then I take it ;-)

Hee hee!

Good luck with it all!

Glad I coul help :-)

Tim
Avatar of tsunpo

ASKER

One more thing, Tim...

I've noticed and am now busy in modifying the EL tag...
from
<tiles:put name="content" value="/intranet/${param.mode}.jsp"/>
to
<tiles-el:put name="content" value="/intranet/${param.mode}.jsp"/>

Is that I cannot simply use ${w.well} in the jsp file, sth like:
<td>${w.subWell}</td>
What should I used, then....


one more question, please~~~
:P
> <td>${w.subWell}</td>

What is "w"?

How is it passed to the tile?

And have you looked at:

https://www.experts-exchange.com/questions/21193428/Syntax-problems-when-trying-to-print-out-a-value-of-an-object's-property.html

Apparently, to use the new EL stuff in JSP, you need to put:

<%@ page isELIgnored="false" %>

At the top of the jsp...

then

${w.subWell}

might work :-)

Tim
Avatar of tsunpo

ASKER

It works perfectly like baby...  :D

Thank u so so so much, splendid!! now I can leave office earily finally  :p

Will buy me a Guinness for celebration tonight...
If I were still in Bristol, will definitely rush to Manchester and buy u a drink  :p


Now I am back in Taiwan,
George
Hehe, that's a bit far to go ;-)

Have a cool drink!! Wish I was there!  Not least for the drink ;-)

Good luck with it!

Tim