?
Solved

Upgrating Struts 1.1 to 1.2.4 - "servlet is unavailable"

Posted on 2004-11-03
10
Medium Priority
?
1,770 Views
Last Modified: 2011-04-14
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
0
Comment
Question by:tsunpo
  • 6
  • 4
10 Comments
 

Author Comment

by:tsunpo
ID: 12490792
HTTP Status 404 - Servlet controller is not available

Thanks in advance!!
George
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12491237
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>
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12491243
ie:  driverClassName instead of driverClass
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Accepted Solution

by:
TimYates earned 2000 total points
ID: 12491252
actually:  username instead of user and defaultAutoCommit instead of autoCommit

    <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="username"     value="xxx"/>
            <set-property property="password"     value="xxx"/>
            <set-property property="defaultAutoCommit"  value="false"/>
        </data-source>
    </data-sources>

see:  http://struts.apache.org/faqs/database.html
0
 

Author Comment

by:tsunpo
ID: 12491703
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
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12491724
:-D  Cool!  That worked then I take it ;-)

Hee hee!

Good luck with it all!

Glad I coul help :-)

Tim
0
 

Author Comment

by:tsunpo
ID: 12492342
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
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12492371
> <td>${w.subWell}</td>

What is "w"?

How is it passed to the tile?

And have you looked at:

http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_21193428.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
0
 

Author Comment

by:tsunpo
ID: 12492473
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
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12492584
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
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I came across an unsolved Outlook issue and here is my solution.
Currently, there is an issue with being able to copy values from an external application to a dropdown list in Project Web Access (PWA).  The standard copy and paste methods don't seem to work properly. Here is a way to accomplish this task to s…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question