Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Servlet Action currently Unavailable

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Tomcat 4.1.30 and struts 1.2.
When i call a .do from my browser i am getting the following error

--------------------------------------------------------
HTTP Status 503 - Servlet action is currently unavailable

type Status report
message Servlet action is currently unavailable
description The requested service (Servlet action is currently
unavailable)
is not currently available.

Apache Tomcat/4.1.30
------------------------------------------

My "web.xml" is as follows :
-------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">;

<web-app>
<display-name>Struts Application</display-name>

<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>


<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>


<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>


<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>

</web-app>
--------------------------------------------------
what could be the reason.Please help....Thanks in advance.

Regards
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think u might have forgot to set the path for the struts.jar file. check it once.
 
Shailesh Pillai
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Uma,
Are you referring to the CLASSPATH variable?
If yes, then its value is as follows :
E:\Oracle\Ora81\jdbc\lib; D:\j2sdk1.4.0_01\bin; D:\jakarta-tomcat-4.1.30\common\lib\servlet-api.jar; D:\jakarta-struts-1.2.0\lib\struts.jar

The struts.jar file is in the lib directory of MyApp folder.
i.e. <TOMCAT-HOME>\webapps\MyApp\WEB-INF\lib\
[ March 22, 2006: Message edited by: Shailesh Pillai ]
 
Shailesh Pillai
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the Tomcat log file :
-----------------------------------------------
2006-03-22 15:09:20 HostConfig[localhost]: Expanding web application archive MyFApp.war
2006-03-22 15:09:21 StandardHost[localhost]: Installing web application at context path /MyFApp from URL file :/jakarta-tomcat-4.1.30/webapps/MyFApp
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploying class repositories to work directory D:\jakarta-tomcat-4.1.30\work\Standalone\localhost\MyFApp
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy class files /WEB-INF/classes to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\classes
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/antlr.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\antlr.jar
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/commons-beanutils.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\commons-beanutils.jar
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/commons-collections-2.0.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\commons-collections-2.0.jar
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/commons-collections.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\commons-collections.jar
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/commons-dbcp.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\commons-dbcp.jar
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/commons-digester.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\commons-digester.jar
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/commons-fileupload.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\commons-fileupload.jar
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/commons-lang.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\commons-lang.jar
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/commons-logging.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\commons-logging.jar
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/commons-pool.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\commons-pool.jar
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/commons-resources.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\commons-resources.jar
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/commons-services.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\commons-services.jar
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/commons-validator.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\commons-validator.jar
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/jakarta-oro.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\jakarta-oro.jar
2006-03-22 15:09:21 WebappLoader[/MyFApp]: Deploy JAR /WEB-INF/lib/struts.jar to D:\jakarta-tomcat-4.1.30\webapps\MyFApp\WEB-INF\lib\struts.jar
2006-03-22 15:09:23 StandardManager[/MyFApp]: Seeding random number generator class java.security.SecureRandom
2006-03-22 15:09:23 StandardManager[/MyFApp]: Seeding of random number generator has been completed


2006-03-22 15:09:29 StandardWrapper[/MyFApp:action]: Marking servlet action as unavailable
2006-03-22 15:09:29 StandardContext[/MyFApp]: Servlet /MyFApp threw load() exception


javax.servlet.UnavailableException: Parsing error processing resource path /WEB-INF/struts-config.xml
at org.apache.struts.action.ActionServlet.handleConfigException(ActionServlet.java:775)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:751)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:706)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:365)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3427)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3628)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:307)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:788)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:400)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:718)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:358)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:754)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:363)
at org.apache.catalina.core.StandardService.start(StandardService.java:497)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
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:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

2006-03-22 15:09:29 StandardWrapper[/MyFApp efault]: Loading container servlet default
2006-03-22 15:09:29 StandardWrapper[/MyFApp:invoker]: Loading container servlet invoker
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm generating a simple user registration application with struts frameworks using Netbeans5.5 preview IDE. i just created a data source in the struts-config.xml file. After including those lines i tried to run my applcation... i got he initial screen of entering the values after pressing the submit button i get the following error.. All my configuration files are generated by the IDE itself
StandardWrapperValve[action]: Servlet action is currently unavailable



My struts-config.xml file looks like


<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">;


<struts-config>

<data-sources>
<data-source
type="org.apache.commons.dbcp.BasicDataSource"
key="test">
<set-property
property="driverClassName"
value="com.mysql.jdbc.Driver" />
<set-property
property="url"
value="jdbc:mysql://vijay:3306/test" />
<set-property
property="username"
value="root" />
<set-property
property="password"
value="" />
</data-source>
</data-sources>




<form-beans>
<form-bean name="userRegistrationActionForm" type="com.myapp.struts.userRegistrationActionForm"/>

</form-beans>

<global-exceptions>

</global-exceptions>

<global-forwards>
<forward name="welcome" path="/Welcome.do"/>
</global-forwards>

<action-mappings>
<action input="/Register.jsp" name="userRegistrationActionForm" path="/register" scope="session" type="com.myapp.struts.userRegistrationStrutsAction">
<forward name="success" path="/RegisterSuccess.jsp"/>
<forward name="cancel" path="/RegisterCancel.jsp"/>
</action>
<action forward="/Exit.jsp" path="/logout"/>
<action path="/Welcome" forward="/welcomeStruts.jsp"/>
</action-mappings>



<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>

<message-resources parameter="com/myapp/struts/ApplicationResource"/>

<!-- ========================= Tiles plugin ===============================-->
<!--
This plugin initialize Tiles definition factory. This later can takes some
parameters explained here after. The plugin first read parameters from
web.xml, thenoverload them with parameters defined here. All parameters
are optional.
The plugin should be declared in each struts-config file.
- definitions-config: (optional)
Specify configuration file names. There can be several comma
separated file names (default: ?? )
- moduleAware: (optional - struts1.1)
Specify if the Tiles definition factory is module aware. If true
(default), there will be one factory for each Struts module.
If false, there will be one common factory for all module. In this
later case, it is still needed to declare one plugin per module.
The factory will be initialized with parameters found in the first
initialized plugin (generally the one associated with the default
module).
true : One factory per module. (default)
false : one single shared factory for all modules
- definitions-parser-validate: (optional)
Specify if xml parser should validate the Tiles configuration file.
true : validate. DTD should be specified in file header (default)
false : no validation

Paths found in Tiles definitions are relative to the main context.
-->
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
</plug-in>

<!-- ========================= Validator plugin ================================= -->
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>

</struts-config>



My web.xml looks like


<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" 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_4.xsd">
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<session-config><session-timeout>
30
</session-timeout></session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>





kindly suggest me hw to proceed
regards,
R Vijay

[ March 28, 2006: Message edited by: vijay rajendran ]
[ March 28, 2006: Message edited by: vijay rajendran ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most significant line in the stack trace is:

javax.servlet.UnavailableException: Parsing error processing resource path /WEB-INF/struts-config.xml

This indicates that Struts can't parse your struts-config.xml file because it has errors. Generally, when you get this message the problem is either that the file contains malformed XML, or XML that does not conform to the DTD. I'd suggest reverting to the original struts-config.xml file that comes with the struts-blank.war file, and add back the elements of the file one by one to see which one is in error.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic