Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes interceptor not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "interceptor not working" Watch "interceptor not working" New topic
Author

interceptor not working

Sandeep Bhoyar
Greenhorn

Joined: May 17, 2010
Posts: 17

Hi,

I want to use token session in one of my action shippingAction .Below is given my strut config Details


<action name="shippingdetails" class="shippingAction" method="getshipdetails" >
<interceptor-ref name="tokenSession" />
<interceptor-ref name="basicStack"/>
<result name="success">shippingdetails.jsp</result>
</action>

but I am getting this exception, Can any one know what I am doing wrong


HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [shippingAction]
org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:100)
org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:385)
org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:274)
com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:227)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:368)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:278)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:498)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)

root cause

java.lang.ClassNotFoundException: shippingAction
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
org.apache.struts2.util.ClassLoaderUtils.loadClass(ClassLoaderUtils.java:111)
org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:98)
org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:385)
org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:274)
com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:227)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:368)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:278)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:498)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.19 logs.
Apache Tomcat/7.0.19


$andybo
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

There is no problem with the interceptor, Have you declared the class name how exactly you define class name.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Sandeep Bhoyar
Greenhorn

Joined: May 17, 2010
Posts: 17

yes Mohan , the Action name is correct. actually I am using custom interceptor also I tired with that also but still i am getting exception

<interceptors>
<interceptor name="tokenSession" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/> -->
<interceptor name="SessionVerify" class="net.foodlink.core.common.utils.SessionInterceptor"></interceptor>
<interceptor-stack name="FLODefStack">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="SessionVerify"/>
<interceptor-ref name="tokenSession" />
<interceptor-ref name="basicStack"/>
</interceptor-stack>
</interceptors>

Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

post your complete struts.xml file. Did you put the shippingAction class in root. <action name="shippingdetails" class="shippingAction" method="getshipdetails" >
java.lang.ClassNotFoundException: shippingAction it's not able find the shippingAction class.
Sandeep Bhoyar
Greenhorn

Joined: May 17, 2010
Posts: 17

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

<struts>
<constant name="struts.devMode" value="true" />
<constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
<constant name="struts.objectFactory.spring.autoWire.alwaysRespect" value="true" />
<constant name="struts.objectFactory.spring.autoWire" value="Flo" />
<!-- -->


<package name="invoice" namespace="/jsp" extends="struts-default">
<interceptors>
<interceptor name="tokenSession" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>
<interceptor name="SessionVerify" class="net.foodlink.core.common.utils.SessionInterceptor"></interceptor>
<interceptor-stack name="FLODefStack">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="SessionVerify"/>
<interceptor-ref name="tokenSession" />
<interceptor-ref name="basicStack"/>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="FLODefStack"/>
<action name="InvPageLoad" class="invoicesAction" method="getPOs" >
<result name="success">invoicelist.jsp</result>
</action>
<action name="InvoiceList" class="invoicesAction" method="getInv" >
<result name="success">invoicelist.jsp</result>
</action>

<!-- Start of Shipping actions -->
<action name="ShippingPageLoad" class="shippingAction" method="getShipHeaderData" >
<result name="success">shippinglist.jsp</result>
</action>
<action name="ShippingPageList" class="shippingAction" method="getShipLineData" >
<result name="success">shippinglist.jsp</result>
</action>
<action name="ShippingListProcess" class="shippingAction" method="getShipProcessData" >
<result name="success">shippinglist.jsp</result>
<param name="actionName">noprint</param>
</action>
<action name="ShippingListDetails" class="shippingAction" method="getShipProcess" >
<result name="success">shippingdetails.jsp</result>
</action>

<!-- Shipping Details -->
<action name="shippingdetails" class="shippingAction" method="getshipdetails" >
<result name="success">shippingdetails.jsp</result>
</action>

<action name="shippingprocess" class="shippingAction" method="shipProcess" >
<result name="success">shippingconfirmation.jsp</result>
</action>
<action name="shippingConfirmation" class="shippingAction" method="displayCon">
<result name="success">shippingconfirmation.jsp</result>
</action>
<!-- End of Shipping actions -->

<!-- Start of receiving actions -->
<action name="receivingList" class="receivingAction" method="getUserProfile">
<result name="success">receivinglist.jsp</result>
</action>
<action name="filterClick" class="receivingAction" method="getPOsForR">
<result name="success">receivinglist.jsp</result>
</action>
<action name="receivingJob" class="receivingAction" method="receivingJob">
<result name="success">receivingconfirmation.jsp</result>
</action>
<action name="receivingdetail" class="receivingAction" method="getPoLinesForR">
<result name="success">receivingdetail.jsp</result>
</action>

<action name="receivingprocess" class="receivingAction" method="polinesProcessForR">
<result name="success">receiveConfirmation.jsp</result>
</action>

<action name="receiveConfirmation" class="receivingAction" method="displayCon">
<result name="success">receiveConfirmation.jsp</result>
</action>


<!-- End of receiving actions -->



<action name="MenuAction" class="menusAction" method="getMenuData">
<result name="success">Menu.jsp</result>
</action>

<!-- For TransMonitor -->
<action name="transMonitor" class="transMonitorAction" method="displayTransError" >
<result name="success">transMonitorError.jsp</result>
</action>
</package>
</struts>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: interceptor not working