struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "nathan.vel" <thangavel.loganat...@nttdata.com>
Subject Null Pointer Exception during Struts-2 with Struts-1 Plugin
Date Thu, 04 Sep 2014 06:41:27 GMT
Hi Techies,

             I'm integrating my existing Struts1 application with Struts2
using the plugin,

My web.xml,

        <filter>
	    <filter-name>struts2</filter-name>
	   
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
	</filter>
	
	<filter-mapping>
	    <filter-name>struts2</filter-name>
	    <url-pattern>*.nav</url-pattern>
        </filter-mapping>


and it contains struts1 configuration as well,

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

So if the URL ending with xxx.nav which takes me to Struts.xml file resides
in the classes folder,

My Struts.xml file,

<?xml version="1.0" encoding="UTF-8" ?> 
<!DOCTYPE struts PUBLIC &quot;-//Apache Software Foundation//DTD Struts 
            Configuration 2.3//EN&quot; 
&quot;http://struts.apache.org/dtds/struts-2.3.dtd&quot;>
<struts>

	<constant name="struts.devMode" value="true" />
	<constant name="struts.action.extension" value=",nav" />

	<package name="sample" namespace="/" extends="struts1-default">
		
		<interceptors>
			<interceptor name="makeReservationForm"
class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor">
				com.formcomponent.ReservationFormBean
				makeReservationForm
				 session
			</interceptor>
			
			<interceptor-stack name="sample-example">
				<interceptor-ref name="staticParams"/> 
				<interceptor-ref name="makeReservationForm"/>
				<interceptor-ref name="modelDriven"/>
				<interceptor-ref name="basicStack"/>
			</interceptor-stack>
	  
		</interceptors>

		<default-interceptor-ref name="sample-example"/>
		
		<action name="ReservationInitializeStart"
class="org.apache.struts2.s1.Struts1Action">
			com.actions.ReservationInitializeAction
			<interceptor-ref name="sample-example"></interceptor-ref>  
			<result name="SUCCESSFUL">reservation_stay.jsp</result>
			<result name="FAILURE">welcome.jsp</result>
		</action>
	
	</package>

</struts> 

While hitting with the URL
http://localhost:90/Application/ReservationInitializeStart.nav, am facing
null pointer exception as below,

 Struts has detected an unhandled exception:
Messages: 	
File: 	org/apache/struts2/s1/Struts1Action.java
Line number: 	113
Stacktraces
java.lang.NullPointerException

    org.apache.struts2.s1.Struts1Action.execute(Struts1Action.java:113)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:592)
   
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)
   
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)
   
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)
   
org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41)
   
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
   
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
   
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
   
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254)
   
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
   
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
   
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254)
   
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
   
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
   
org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
   
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
   
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
   
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
   
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
   
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)

I'm using the below jar files,

struts-1.1-rc2-b1
struts2-core-2.3.16.3
struts2-struts1-plugin-2.1.2
struts-core-1.3.5


Please help me out to resolve this issue. Thanks in advance !!


--
Regards,

Nathan.




--
View this message in context: http://struts.1045723.n5.nabble.com/Null-Pointer-Exception-during-Struts-2-with-Struts-1-Plugin-tp5716608.html
Sent from the Struts - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message