Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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

interceptor not working

 
Greenhorn
Posts: 17
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no problem with the interceptor, Have you declared the class name how exactly you define class name.
 
Sandeep Bhoyar
Greenhorn
Posts: 17
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<?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>
 
    Bookmark Topic Watch Topic
  • New Topic