Re: Struts2+Spring2+Interceptor+Invalid action class configuration that references an unknown class named
Thanks Wes for reply. I figured out that we can only forward to jsp not to action from interceptor. So Now I am forwarding to jsp from interceptor and it's working fine. Below is my changed code in struts.xml and LoginInterceptor.java. [code] http://struts.apache.org/dtds/struts-2.0.dtd";> page.Login page.Login LoginInterceptor.java public class LoginInterceptor extends AbstractInterceptor { public String intercept(ActionInvocation invocation) throws Exception { ActionContext context = invocation.getInvocationContext(); Map contextMap = context.getContextMap(); HttpServletRequestWrapper request = (HttpServletRequestWrapper) contextMap .get(HTTP_REQUEST); synchronized (request) { ThreadContext.setRequest(request); UserInfo userInfo = UserContext.getCurrentUserInfo(); if (userInfo == null && !"authenticate".equals(contextMap.get(ACTION_NAME))) { return "logonPage"; } return invocation.invoke(); } }} Regards, Devendra Wes Wannemacher wrote: > > On Tue, May 25, 2010 at 8:47 AM, rocks > wrote: >> Martin, >> >> I haven't get any response from Wes [:(]. >> > > Sorry I didn't notice that I was being called out directly :)... I was > out of town, in a magical place that my children really enjoyed, but > unfortunately charged $9.99 / day for internet access[1] > > I am still trying to catch up on a lot of email (it's amazing how far > behind you can get on email when you're cut off for only a few days). > I haven't read your message thoroughly, and I can't promise that I > will right away. But, I do have an example that might help[2]. If it > doesn't help, post back here, there are tons of users on this list > combining struts2, spring and hibernate. If you didn't get many > responses before, you probably haven't posted enough details or the > description of your problem was too vague. > > [1] > http://disneyworld.disney.go.com/resorts/contemporary-resort/services-amenities/ > [2] > http://code.google.com/p/struts2inpractice/source/browse/#svn/trunk/ch04ex01 > (check the ch04ex01 project) > > -Wes > -- > Wes Wannemacher > > Head Engineer, WanTii, Inc. > Need Training? Struts, Spring, Maven, Tomcat... > Ask me for a quote! > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > > -- View this message in context: http://old.nabble.com/Struts2%2BSpring2%2BInterceptor%2BInvalid-action-class-configuration-that-references-an-unknown-class-named-tp28636590p28680342.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts2+Spring2+Interceptor+Invalid action class configuration that references an unknown class named
On Tue, May 25, 2010 at 8:47 AM, rocks wrote: > Martin, > > I haven't get any response from Wes [:(]. > Sorry I didn't notice that I was being called out directly :)... I was out of town, in a magical place that my children really enjoyed, but unfortunately charged $9.99 / day for internet access[1] I am still trying to catch up on a lot of email (it's amazing how far behind you can get on email when you're cut off for only a few days). I haven't read your message thoroughly, and I can't promise that I will right away. But, I do have an example that might help[2]. If it doesn't help, post back here, there are tons of users on this list combining struts2, spring and hibernate. If you didn't get many responses before, you probably haven't posted enough details or the description of your problem was too vague. [1] http://disneyworld.disney.go.com/resorts/contemporary-resort/services-amenities/ [2] http://code.google.com/p/struts2inpractice/source/browse/#svn/trunk/ch04ex01 (check the ch04ex01 project) -Wes -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts2+Spring2+Interceptor+Invalid action class configuration that references an unknown class named
Martin, I haven't get any response from Wes [:(]. Guys, Please let me know if any one has clue on the below issue. Regards, Devendra mgainty wrote: > > > Devendra > > > > did you contact the local struts resource as suggested..? > > Martin-- > __ > Verzicht und Vertraulichkeitanmerkung > > > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene > Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte > Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht > dient lediglich dem Austausch von Informationen und entfaltet keine > rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von > E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. > > > >> Date: Fri, 21 May 2010 19:53:42 -0700 >> From: devendra_tiwari12...@yahoo.com >> To: user@struts.apache.org >> Subject: Re: Struts2+Spring2+Interceptor+Invalid action class >> configuration that references an unknown class named >> >> >> >> >> > >> > Hantsy Bai-2 wrote: >> >> >> >> 于 2010/5/22 1:05, rocks 写道: >> >>> Dear, >> >>> >> >>> Apologize the posting same subject, but I did not find any solution >> so >> >>> far. >> >>> I am developing a web application based on struts 2.1.8.1+ spring 2+ >> >>> hibernate 3 + tomcat 5.5. There is requisite library like >> >>> struts2-convention-plugin-2.1.8.1.jar in my classpath. >> >>> >> >>> For authentication I am using struts interceptor. >> >>> Below are my configuration files. >> >>> >> >>> struts.xml := >> >>> >> >>> >> >>> > >>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" >> >>> "http://struts.apache.org/dtds/struts-2.0.dtd";> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> > >>> value="AUTOWIRE_BY_NAME"/> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> > >>> class="org.apache.struts2.views.tiles.TilesResult" /> >> >>> >> >>> >> >>> >> >>> > >>> class="com.ncr.framework.interceptor.LoginInterceptor"/> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> page.Login >> >>> >> >>> >> >>> >> >>> >> >>> applicationContext.xml :- >> >>> >> >>> >> >>> >> >>> >> >>> > >>> class="com.ncr.user.actions.LoginAction"> >> >>> >> >>> >> >>> >> >>> >> >>> LoginInterceptor.java >> >>> >> >>> public class LoginInterceptor extends AbstractInterceptor { >> >>> public String intercept(ActionInvocation invocation) throws Exception >> { >> >>> ActionContext context = invocation.getInvocationContext(); >> >>> Map contextMap = context.getContextMap(); >> >>> HttpServletRequestWrapper request = (HttpServletRequestWrapper) >> >>> contextMap >> >>> .get(HTTP_REQUEST); >> >>> synchronized (request) { >> >>> ThreadContext.setRequest(request); >> >>> UserInfo userInfo = UserContext.getCurrentUserInfo(); >> >>> >> >>> if (userInfo == null >> >>> && !"authenticate".equals(contextMap.get(ACTION_NAME))) { >> >>> return "logon"; >> >>> } >> >>> return invocation.invoke(); >> >>> } >> >>> }} >> >>> >> >>> When I hit url http://localhost:8080/mytest/logon.do it throws an >> error. >> >>> >> >>> java.lang.RuntimeException: Invalid action class configuration that >> >>> references an unknown class named [loginAction] >> >>> >> >>> >> org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(Conve
RE: Struts2+Spring2+Interceptor+Invalid action class configuration that references an unknown class named
Devendra did you contact the local struts resource as suggested..? Martin-- __ Verzicht und Vertraulichkeitanmerkung Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. > Date: Fri, 21 May 2010 19:53:42 -0700 > From: devendra_tiwari12...@yahoo.com > To: user@struts.apache.org > Subject: Re: Struts2+Spring2+Interceptor+Invalid action class configuration > that references an unknown class named > > > > > > > > Hantsy Bai-2 wrote: > >> > >> 于 2010/5/22 1:05, rocks 写道: > >>> Dear, > >>> > >>> Apologize the posting same subject, but I did not find any solution so > >>> far. > >>> I am developing a web application based on struts 2.1.8.1+ spring 2+ > >>> hibernate 3 + tomcat 5.5. There is requisite library like > >>> struts2-convention-plugin-2.1.8.1.jar in my classpath. > >>> > >>> For authentication I am using struts interceptor. > >>> Below are my configuration files. > >>> > >>> struts.xml := > >>> > >>> > >>> >>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" > >>> "http://struts.apache.org/dtds/struts-2.0.dtd";> > >>> > >>> > >>> > >>> > >>> > >>> > >>> >>> value="AUTOWIRE_BY_NAME"/> > >>> > >>> > >>> > >>> > >>> > >>> >>> class="org.apache.struts2.views.tiles.TilesResult" /> > >>> > >>> > >>> > >>> >>> class="com.ncr.framework.interceptor.LoginInterceptor"/> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> page.Login > >>> > >>> > >>> > >>> > >>> applicationContext.xml :- > >>> > >>> > >>> > >>> > >>> >>> class="com.ncr.user.actions.LoginAction"> > >>> > >>> > >>> > >>> > >>> LoginInterceptor.java > >>> > >>> public class LoginInterceptor extends AbstractInterceptor { > >>> public String intercept(ActionInvocation invocation) throws Exception { > >>> ActionContext context = invocation.getInvocationContext(); > >>> Map contextMap = context.getContextMap(); > >>> HttpServletRequestWrapper request = (HttpServletRequestWrapper) > >>> contextMap > >>> .get(HTTP_REQUEST); > >>> synchronized (request) { > >>> ThreadContext.setRequest(request); > >>> UserInfo userInfo = UserContext.getCurrentUserInfo(); > >>> > >>> if (userInfo == null > >>> && !"authenticate".equals(contextMap.get(ACTION_NAME))) { > >>> return "logon"; > >>> } > >>> return invocation.invoke(); > >>> } > >>> }} > >>> > >>> When I hit url http://localhost:8080/mytest/logon.do it throws an error. > >>> > >>> java.lang.RuntimeException: Invalid action class configuration that > >>> references an unknown class named [loginAction] > >>> > >>> 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:76) > >>> > >>> com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:215) > >>> > >>> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.
Re: Struts2+Spring2+Interceptor+Invalid action class configuration that references an unknown class named
> > Hantsy Bai-2 wrote: >> >> 于 2010/5/22 1:05, rocks 写道: >>> Dear, >>> >>> Apologize the posting same subject, but I did not find any solution so >>> far. >>> I am developing a web application based on struts 2.1.8.1+ spring 2+ >>> hibernate 3 + tomcat 5.5. There is requisite library like >>> struts2-convention-plugin-2.1.8.1.jar in my classpath. >>> >>> For authentication I am using struts interceptor. >>> Below are my configuration files. >>> >>> struts.xml := >>> >>> >>> >> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" >>> "http://struts.apache.org/dtds/struts-2.0.dtd";> >>> >>> >>> >>> >>> >>> >>> >> value="AUTOWIRE_BY_NAME"/> >>> >>> >>> >>> >>> >>> >> class="org.apache.struts2.views.tiles.TilesResult" /> >>> >>> >>> >>> >> class="com.ncr.framework.interceptor.LoginInterceptor"/> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> page.Login >>> >>> >>> >>> >>> applicationContext.xml :- >>> >>> >>> >>> >>> >> class="com.ncr.user.actions.LoginAction"> >>> >>> >>> >>> >>> LoginInterceptor.java >>> >>> public class LoginInterceptor extends AbstractInterceptor { >>> public String intercept(ActionInvocation invocation) throws Exception { >>> ActionContext context = invocation.getInvocationContext(); >>> Map contextMap = context.getContextMap(); >>> HttpServletRequestWrapper request = (HttpServletRequestWrapper) >>> contextMap >>> .get(HTTP_REQUEST); >>> synchronized (request) { >>> ThreadContext.setRequest(request); >>> UserInfo userInfo = UserContext.getCurrentUserInfo(); >>> >>> if (userInfo == null >>> && >>> !"authenticate".equals(contextMap.get(ACTION_NAME))) { >>> return "logon"; >>> } >>> return invocation.invoke(); >>> } >>> }} >>> >>> When I hit url http://localhost:8080/mytest/logon.do it throws an error. >>> >>> java.lang.RuntimeException: Invalid action class configuration that >>> references an unknown class named [loginAction] >>> >>> 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:76) >>> >>> com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:215) >>> >>> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:356) >>> >>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266) >>> >>> com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165) >>> >>> >>> As per my investigation, I found that ClassLoaderUtils's below method >>> could >>> not return class name for 'loginAction'. There should be some way for to >>> map >>> 'loginAction' to the class com.ncr.user.actions.LoginAction. >>> >>> public static Class loadClass(String className, Class callingClass) >>> throws ClassNotFoundException { >>> try { >>> >>> return >>> Thread.currentThread().getContextClassLoader().loadClass( >>> className); >>> } catch (ClassNotFoundException e) { >>> try { >>> return Class.forName(className); >>> } catch (ClassNotFoundException ex) { >>> try { >>> return >>> ClassLoaderUtils.class.getClassLoader().loadClass( >>> className); >>> } catch (ClassNotFoundException exc) { >>> return >>> callingClass.getClassLoader().loadClass(className); >>> } >>> } >>> } >>> } >>> >>> When I remove the entry '>> name="capabilityStack"/>' >>> from struts.xml then it's working perfectly fine i.e desired page is >>> coming. >>> >>> I also noticed that in the classes variable of >>> Thread.currentThread().getContextClassLoader()(WebappClassLoader) which >>> is >>> private contains class com.ncr.user.actions.LoginAction but i did not >>
Re: Struts2+Spring2+Interceptor+Invalid action class configuration that references an unknown class named
于 2010/5/22 1:05, rocks 写道: Dear, Apologize the posting same subject, but I did not find any solution so far. I am developing a web application based on struts 2.1.8.1+ spring 2+ hibernate 3 + tomcat 5.5. There is requisite library like struts2-convention-plugin-2.1.8.1.jar in my classpath. For authentication I am using struts interceptor. Below are my configuration files. struts.xml := http://struts.apache.org/dtds/struts-2.0.dtd";> page.Login applicationContext.xml :- LoginInterceptor.java public class LoginInterceptor extends AbstractInterceptor { public String intercept(ActionInvocation invocation) throws Exception { ActionContext context = invocation.getInvocationContext(); Map contextMap = context.getContextMap(); HttpServletRequestWrapper request = (HttpServletRequestWrapper) contextMap .get(HTTP_REQUEST); synchronized (request) { ThreadContext.setRequest(request); UserInfo userInfo = UserContext.getCurrentUserInfo(); if (userInfo == null && !"authenticate".equals(contextMap.get(ACTION_NAME))) { return "logon"; } return invocation.invoke(); } }} When I hit url http://localhost:8080/mytest/logon.do it throws an error. java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [loginAction] 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:76) com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:215) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:356) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165) As per my investigation, I found that ClassLoaderUtils's below method could not return class name for 'loginAction'. There should be some way for to map 'loginAction' to the class com.ncr.user.actions.LoginAction. public static Class loadClass(String className, Class callingClass) throws ClassNotFoundException { try { return Thread.currentThread().getContextClassLoader().loadClass( className); } catch (ClassNotFoundException e) { try { return Class.forName(className); } catch (ClassNotFoundException ex) { try { return ClassLoaderUtils.class.getClassLoader().loadClass( className); } catch (ClassNotFoundException exc) { return callingClass.getClassLoader().loadClass(className); } } } } When I remove the entry '' from struts.xml then it's working perfectly fine i.e desired page is coming. I also noticed that in the classes variable of Thread.currentThread().getContextClassLoader()(WebappClassLoader) which is private contains class com.ncr.user.actions.LoginAction but i did not find any way to get it. Your kind guesture is appreciated. -Dev Convention plugin provide annotation configration for struts2 instead of the XML configuration. But it is optional, if you do not use it, there is no need add it to your project. From you provided, I do not know the content of LoginAction. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts2+Spring2+Interceptor+Invalid action class configuration that references an unknown class named
Dear, Apologize the posting same subject, but I did not find any solution so far. I am developing a web application based on struts 2.1.8.1+ spring 2+ hibernate 3 + tomcat 5.5. There is requisite library like struts2-convention-plugin-2.1.8.1.jar in my classpath. For authentication I am using struts interceptor. Below are my configuration files. struts.xml := http://struts.apache.org/dtds/struts-2.0.dtd";> page.Login applicationContext.xml :- LoginInterceptor.java public class LoginInterceptor extends AbstractInterceptor { public String intercept(ActionInvocation invocation) throws Exception { ActionContext context = invocation.getInvocationContext(); Map contextMap = context.getContextMap(); HttpServletRequestWrapper request = (HttpServletRequestWrapper) contextMap .get(HTTP_REQUEST); synchronized (request) { ThreadContext.setRequest(request); UserInfo userInfo = UserContext.getCurrentUserInfo(); if (userInfo == null && !"authenticate".equals(contextMap.get(ACTION_NAME))) { return "logon"; } return invocation.invoke(); } }} When I hit url http://localhost:8080/mytest/logon.do it throws an error. java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [loginAction] 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:76) com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:215) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:356) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165) As per my investigation, I found that ClassLoaderUtils's below method could not return class name for 'loginAction'. There should be some way for to map 'loginAction' to the class com.ncr.user.actions.LoginAction. public static Class loadClass(String className, Class callingClass) throws ClassNotFoundException { try { return Thread.currentThread().getContextClassLoader().loadClass( className); } catch (ClassNotFoundException e) { try { return Class.forName(className); } catch (ClassNotFoundException ex) { try { return ClassLoaderUtils.class.getClassLoader().loadClass( className); } catch (ClassNotFoundException exc) { return callingClass.getClassLoader().loadClass(className); } } } } When I remove the entry '' from struts.xml then it's working perfectly fine i.e desired page is coming. I also noticed that in the classes variable of Thread.currentThread().getContextClassLoader()(WebappClassLoader) which is private contains class com.ncr.user.actions.LoginAction but i did not find any way to get it. Your kind guesture is appreciated. -Dev -- View this message in context: http://old.nabble.com/Struts2%2BSpring2%2BInterceptor%2BInvalid-action-class-configuration-that-references-an-unknown-class-named-tp28636590p28636590.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org