D
Demi
Hello All,
I have been trying to run a sample struts application on JBoss for
quite sometime now and i have been stuck at this point.
Id appreciate if anyone can give me some pointers as to where im going
wrong.
This application worked perfectly on Tomcat 5.5. but im having problems
with JBoss. All the required libraries and jboss-web.xml are in place.
Any help would be greatly appreciated.
ERROR :
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
root cause
java.lang.NullPointerException
org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:521)
org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:436)
org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:396)
org.apache.struts.taglib.logic.RedirectTag.doEndTag(RedirectTag.java:294)
org.apache.jsp.index_jsp._jspx_meth_logic_redirect_0(org.apache.jsp.index_jsp:79)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:55)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:
I looked into the log files : It says something like
*******************************
2006-01-16 22:06:01,593 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/WebForum]]
Servlet /WebForum threw load() exception
javax.servlet.UnavailableException: Parsing error processing resource
path
at
org.apache.struts.action.ActionServlet.handleConfigException(ActionServlet.java:1035)
at
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1014)
at
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
*****************************
My web.xml
**************
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Web Forum</display-name>
<description>web.xml file for the Web Forum Struts demo
application.</description>
<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/config/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>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</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>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<resource-ref>
<description>WebForum data source.</description>
<res-ref-name>jdbc/WebForumDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
**************
My struts-config.xml
***************
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD
Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<!-- =============================================== Form Bean
Definitions -->
<form-beans>
<form-bean name="loginForm"
type="com.johntopley.webforum.controller.form.LoginForm" />
<form-bean name="newReplyForm"
type="com.johntopley.webforum.controller.form.NewReplyForm" />
<form-bean name="newTopicForm"
type="com.johntopley.webforum.controller.form.NewTopicForm" />
<form-bean name="newUserForm"
type="com.johntopley.webforum.controller.form.NewUserForm" />
</form-beans>
<!-- ======================================== Global Exception
Definitions -->
<global-exceptions>
<exception type="java.lang.Throwable" key="app.exception"
path="/WEB-INF/pages/error.jsp" scope="request"/>
</global-exceptions>
<!-- ========================================== Global Forward
Definitions -->
<global-forwards>
<forward name="Login" path="/Login.do" />
<forward name="Logout" path="/Logout.do" />
<forward name="NewReply" path="/NewReply.do" />
<forward name="NewTopic" path="/NewTopic.do" />
<forward name="Register" path="/Register.do" />
<!--
| Setting redirect to true ensures the cookie containing the user
ID isn't
| cached after logging out.
+-->
<forward name="ViewTopics" path="/ViewTopics.do" redirect="true" />
<forward name="ViewTopic" path="/ViewTopic.do" />
</global-forwards>
<!-- ========================================== Action Mapping
Definitions -->
<action-mappings>
<action path="/Login" forward="/WEB-INF/pages/login.jsp" />
<action path="/Logout"
type="com.johntopley.webforum.controller.action.LogoutAction" />
<action path="/LoginSubmit"
type="com.johntopley.webforum.controller.action.LoginSubmitAction"
name="loginForm" input="/WEB-INF/pages/login.jsp" validate="true"
scope="request" />
<action path="/NewReply" forward="/WEB-INF/pages/newreply.jsp" />
<action path="/NewReplySubmit"
type="com.johntopley.webforum.controller.action.NewReplySubmitAction"
name="newReplyForm" input="/WEB-INF/pages/newreply.jsp" validate="true"
scope="request" />
<action path="/NewTopic" forward="/WEB-INF/pages/newtopic.jsp"/>
<action path="/NewTopicSubmit"
type="com.johntopley.webforum.controller.action.NewTopicSubmitAction"
name="newTopicForm" input="/WEB-INF/pages/newtopic.jsp" validate="true"
scope="request" />
<action path="/Register" forward="/WEB-INF/pages/register.jsp" />
<action path="/RegisterSubmit"
type="com.johntopley.webforum.controller.action.RegisterSubmitAction"
name="newUserForm" input="/WEB-INF/pages/register.jsp" validate="true"
scope="request" />
<action path="/ViewTopics"
type="com.johntopley.webforum.controller.action.ViewTopicsAction"
scope="request">
<forward name="Topics" path="/WEB-INF/pages/topics.jsp"/>
</action>
<action path="/ViewTopic"
type="com.johntopley.webforum.controller.action.ViewTopicAction"
scope="request">
<forward name="Topic" path="/WEB-INF/pages/topic.jsp"/>
</action>
</action-mappings>
<!-- ======================================== Message Resource
Definitions -->
<!--
| Setting null to false displays bad key values on the page.
+-->
<message-resources parameter="com.johntopley.webforum.view.Resources"
null="false"/>
<message-resources
parameter="com.johntopley.webforum.view.GlobalErrors" null="false"
key="GlobalErrors"/>
<!-- ================================================= Plug-In
Definitions -->
</struts-config>
****************
I have been trying to run a sample struts application on JBoss for
quite sometime now and i have been stuck at this point.
Id appreciate if anyone can give me some pointers as to where im going
wrong.
This application worked perfectly on Tomcat 5.5. but im having problems
with JBoss. All the required libraries and jboss-web.xml are in place.
Any help would be greatly appreciated.
ERROR :
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
root cause
java.lang.NullPointerException
org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:521)
org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:436)
org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:396)
org.apache.struts.taglib.logic.RedirectTag.doEndTag(RedirectTag.java:294)
org.apache.jsp.index_jsp._jspx_meth_logic_redirect_0(org.apache.jsp.index_jsp:79)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:55)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:
I looked into the log files : It says something like
*******************************
2006-01-16 22:06:01,593 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/WebForum]]
Servlet /WebForum threw load() exception
javax.servlet.UnavailableException: Parsing error processing resource
path
at
org.apache.struts.action.ActionServlet.handleConfigException(ActionServlet.java:1035)
at
org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1014)
at
org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
*****************************
My web.xml
**************
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Web Forum</display-name>
<description>web.xml file for the Web Forum Struts demo
application.</description>
<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/config/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>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</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>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<resource-ref>
<description>WebForum data source.</description>
<res-ref-name>jdbc/WebForumDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
**************
My struts-config.xml
***************
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD
Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<!-- =============================================== Form Bean
Definitions -->
<form-beans>
<form-bean name="loginForm"
type="com.johntopley.webforum.controller.form.LoginForm" />
<form-bean name="newReplyForm"
type="com.johntopley.webforum.controller.form.NewReplyForm" />
<form-bean name="newTopicForm"
type="com.johntopley.webforum.controller.form.NewTopicForm" />
<form-bean name="newUserForm"
type="com.johntopley.webforum.controller.form.NewUserForm" />
</form-beans>
<!-- ======================================== Global Exception
Definitions -->
<global-exceptions>
<exception type="java.lang.Throwable" key="app.exception"
path="/WEB-INF/pages/error.jsp" scope="request"/>
</global-exceptions>
<!-- ========================================== Global Forward
Definitions -->
<global-forwards>
<forward name="Login" path="/Login.do" />
<forward name="Logout" path="/Logout.do" />
<forward name="NewReply" path="/NewReply.do" />
<forward name="NewTopic" path="/NewTopic.do" />
<forward name="Register" path="/Register.do" />
<!--
| Setting redirect to true ensures the cookie containing the user
ID isn't
| cached after logging out.
+-->
<forward name="ViewTopics" path="/ViewTopics.do" redirect="true" />
<forward name="ViewTopic" path="/ViewTopic.do" />
</global-forwards>
<!-- ========================================== Action Mapping
Definitions -->
<action-mappings>
<action path="/Login" forward="/WEB-INF/pages/login.jsp" />
<action path="/Logout"
type="com.johntopley.webforum.controller.action.LogoutAction" />
<action path="/LoginSubmit"
type="com.johntopley.webforum.controller.action.LoginSubmitAction"
name="loginForm" input="/WEB-INF/pages/login.jsp" validate="true"
scope="request" />
<action path="/NewReply" forward="/WEB-INF/pages/newreply.jsp" />
<action path="/NewReplySubmit"
type="com.johntopley.webforum.controller.action.NewReplySubmitAction"
name="newReplyForm" input="/WEB-INF/pages/newreply.jsp" validate="true"
scope="request" />
<action path="/NewTopic" forward="/WEB-INF/pages/newtopic.jsp"/>
<action path="/NewTopicSubmit"
type="com.johntopley.webforum.controller.action.NewTopicSubmitAction"
name="newTopicForm" input="/WEB-INF/pages/newtopic.jsp" validate="true"
scope="request" />
<action path="/Register" forward="/WEB-INF/pages/register.jsp" />
<action path="/RegisterSubmit"
type="com.johntopley.webforum.controller.action.RegisterSubmitAction"
name="newUserForm" input="/WEB-INF/pages/register.jsp" validate="true"
scope="request" />
<action path="/ViewTopics"
type="com.johntopley.webforum.controller.action.ViewTopicsAction"
scope="request">
<forward name="Topics" path="/WEB-INF/pages/topics.jsp"/>
</action>
<action path="/ViewTopic"
type="com.johntopley.webforum.controller.action.ViewTopicAction"
scope="request">
<forward name="Topic" path="/WEB-INF/pages/topic.jsp"/>
</action>
</action-mappings>
<!-- ======================================== Message Resource
Definitions -->
<!--
| Setting null to false displays bad key values on the page.
+-->
<message-resources parameter="com.johntopley.webforum.view.Resources"
null="false"/>
<message-resources
parameter="com.johntopley.webforum.view.GlobalErrors" null="false"
key="GlobalErrors"/>
<!-- ================================================= Plug-In
Definitions -->
</struts-config>
****************