2013年9月2日星期一

SSH recurring problems java.lang.RuntimeException: Invalid actionclass configuration that r

The error is:
java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [userRegisterAction]
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.validator.ValidationInterceptor.doIntercept (ValidationInterceptor.java: 252)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept (AnnotationValidationInterceptor.java: 68)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java: 87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept (ConversionErrorInterceptor.java: 122)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (ParametersInterceptor.java: 195)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java: 87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (ParametersInterceptor.java: 195)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java: 87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept (StaticParametersInterceptor.java: 179)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
org.apache.struts2.interceptor.MultiselectInterceptor.intercept (MultiselectInterceptor.java: 75)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
org.apache.struts2.interceptor.CheckboxInterceptor.intercept (CheckboxInterceptor.java: 94)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
org.apache.struts2.interceptor.FileUploadInterceptor.intercept (FileUploadInterceptor.java: 235)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept (ModelDrivenInterceptor.java: 89)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept (ScopedModelDrivenInterceptor.java: 130)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept (DebuggingInterceptor.java: 267)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept (ChainingInterceptor.java: 126)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept (PrepareInterceptor.java: 138)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java: 87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept (I18nInterceptor.java: 165)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept (ServletConfigInterceptor.java: 164)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept (AliasInterceptor.java: 179)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept (ExceptionMappingInterceptor.java: 176)
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java: 237)
org.apache.struts2.impl.StrutsActionProxy.execute (StrutsActionProxy.java: 52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java: 488)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction (ExecuteOperations.java: 77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter (StrutsPrepareAndExecuteFilte
UserRegister.jsp
<s:form action="UserRegisterAction">
  <s:textfield name="custorm.name" label="姓名" required="true"/>
  <s:password name="custorm.password" label="密码" required="true"/>
  <s:submit value="注册"/>
  <s:reset value="重填"/>
  </s:form>

UserRegisterAction.java
private Custorm custorm;
private ServiceDao serviceDao;
public Custorm getCustorm() {
return custorm;
}
public void setCustorm(Custorm custorm) {
this.custorm = custorm;
}
public ServiceDao getServiceDao() {
return serviceDao;
}
public void setServiceDao(ServiceDao serviceDao) {
this.serviceDao = serviceDao;
}

public String execute() throws Exception{
this.serviceDao.saveCustorm(this.custorm);
return SUCCESS;

}

with the struts validation framework
UserRegsiterAction-validation.xml
<validators>
<field name="custorm">
<field-validator type="visitor">
<param name="context">user</param>
<param name="appendPrefix">true</param>
<message>用户的</message>
</field-validator>
</field>
</validators>

Custorm-user-validaton.xml



user name can not be empty




password can not be empty



When I click the Register this situation occurs when the supposedly should not be empty like xx is what causes it ?
------ Solution ---------------------------------------- ----
attention to the case , the action on the page of action consistent with the struts , struts of the class of the bean with spring consistent
------ Solution ----------- ---------------------------------
should be to find the root cause of the
your validation does not pass validation , return input it did not find a corresponding input result will be attempts to go forward with the ACTION class being given a new object so that you do not have the entrance path . . . . .
------ For reference only -------------------------------------- -
userRegisterAction check this class in the spring of the configuration
------ For reference only ---------------------- -----------------
struts.xml
<action name="UserRegisterAction" class="userRegisterAction">
<result>/success.jsp</result>
</action>

appligcationContext.xml
<bean name="userRegisterAction" class="action.UserRegisterAction" scope="prototype">	<property name="serviceDao" ref="serviceDao"/></bean>

no problem
------ For reference only ------------------------------- --------
your struts and the spring are not integrated Okay
------ For reference only ------------------ ---------------------

/ success.jsp


Did you write the anti- ah ? ?

/ success.jsp

------ For reference only ----------------------------- ----------
<action   name= "UserRegisterAction "   class= "userRegisterAction "> 

Are u sure that?
write against it buddy ! ~ ~ Your class name is lowercase ? ? ? ? ?
------ For reference only -------------------------------------- -
Yes indeed it UserRegisterAction "> UserRegisterAction "class =" userRegisterAction ">
userRegisterAction "class =" action.UserRegisterAction "scope =" prototype ">
------ For reference only ---------------------------------------
indeed written backwards
------ For reference only ---------------------------------------
Is not it ! ! ! ! ! Experts point out
------ For reference only ---------------------------------- -----
posted under web.xml configuration it
------ For reference only ---------------------- -----------------
landlord troubleshoot the following two problems may occur where :
1, struts configuration file need to be added
2, web.xml needs to start spring org.springframework.web.context.ContextLoaderListener

------ For reference only ----------------------------- ----------
WEB.XML:

struts2

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter



struts2
/ *


contextConfigLocation
/ WEB-INF/applicationContext.xml



org.springframework.web.context.ContextLoaderListener


11 F, I saw there was
------ For reference only ------------------------ ---------------

/ success.jsp


add this attribute try it, I checked the code seems to need this when integrated with the spring . . .
------ For reference only -------------------------------------- -
userRegisterAction class name did not write
------ For reference only -------------------------- -------------
15th Floor solved the problem really a phrase I have not configured input is indeed the result of scattered points. .
------ For reference only -------------------------------------- -
but the landlord is how to configure it ?
------ For reference only -------------------------------------- -







changed








------ For reference only ---------------------------------- -----
15 F ox , good sharp ! ! !
------ For reference only ---------------------------------- -----
...
------ For reference only --------------------------- ------------
15 Floor indeed powerful ah !
------ For reference only -------------------------------------- -
what do you mean ? ? I still did not solve ah
------ For reference only --------------------------------- ------
15 -floor master , can you elaborate a little , ah, I do not have validation verification ah
------ For reference only -------- -------------------------------
first glance , I thought it does not have this class , but naming exist, in fact, the real reason is that there is no suitable result name, this error can be really misleading too outrageous ah forget to add the corresponding result name it. When the addition was complete , a Qieou it.



------ For reference only ---------------------------------- -----
add , Action page if the return is an uppercase "SUCCESS" or "INPUT", the result in Struts.xml name attribute must be uppercase. If lowercase to configure lowercase. If a mismatch error will lead to the above . This is what I have just encountered an error today proposed to share with you .
------ For reference only -------------------------------------- -
15 floor master , can you elaborate a little , ah, ah I do not have validation verification

------ For reference only ---------------------------------- -----
  This reply was moderator deleted at 2012-05-14 08:40:43

------ For reference only ---------------------------------- -----
my useless labels such struts
if there are other problems , experts enlighten
------ For reference only ----------------------- ----------------
I found a problem
1, hidden field value = null
2, the uploaded file and forgot to add enctype = "multipart / form-data"

look maybe helpful
------ For reference only ---------------------------- -----------
  This reply was moderator deleted at 2012-05-23 08:29:02

------ For reference only ---------------------------------- -----


Indeed, there is to it !
------ For reference only -------------------------------------- -
15 F Niu . really envy ah .
------ For reference only ------------------------- --------------
15 F cattle X ah
------ For reference only ---------------- -----------------------
15 Building strong ! I solved the problem ! I am also the same problem !!
------ For reference only ------------------------------- --------
I also this wrong , change for a long time have to change, however
------ For reference only ------------------------- --------------
cow ! ! ! !
------ For reference only -------------------------------------- -
ERROR org.apache.struts2.dispatcher.Dispatcher - Dispatcher initialization failed
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.opensymphony.xwork2.inject.ContainerBuilder $ 4.create (ContainerBuilder.java: 132)
at com.opensymphony.xwork2.inject.Scope $ 2 $ 1.create (Scope.java: 51)
at com.opensymphony.xwork2.inject.ContainerImpl.getInstance (ContainerImpl.java: 507)
at com.opensymphony.xwork2.inject.ContainerImpl $ 8.call (ContainerImpl.java: 540)
at com.opensymphony.xwork2.inject.ContainerImpl.callInContext (ContainerImpl.java: 574)
at com.opensymphony.xwork2.inject.ContainerImpl.getInstance (ContainerImpl.java: 538)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer (DefaultConfiguration.java: 213)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration (ConfigurationManager.java: 66)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration (Dispatcher.java: 390)
at org.apache.struts2.dispatcher.Dispatcher.init (Dispatcher.java: 436)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher (InitOperations.java: 69)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init (StrutsPrepareAndExecuteFilter.java: 51)
at o
------ For reference only ------------------------------- --------
please help us to see what is wrong ah
------ For reference only ----------------- ----------------------
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java . lang.reflect.InvocationTargetException
at com.opensymphony.xwork2.inject.ContainerBuilder $ 4.create (ContainerBuilder.java: 132)
at com.opensymphony.xwork2.inject.Scope $ 2 $ 1.create (Scope.java: 51)
at com.opensymphony.xwork2.inject.ContainerImpl.getInstance (ContainerImpl.java: 507)
at com.opensymphony.xwork2.inject.ContainerImpl $ 8.call (ContainerImpl.java: 540)
at com.opensymphony.xwork2.inject.ContainerImpl.callInContext (ContainerImpl.java: 574)
at com.opensymphony.xwork2.inject.ContainerImpl.getInstance (ContainerImpl.java: 538)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer (DefaultConfiguration.java: 213)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration (ConfigurationManager.java: 66)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration (Dispatcher.java: 390)
at org.apache.struts2.dispatcher.Dispatcher.init (Dispatcher.java: 436)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher (InitOperations.java: 69)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init (StrutsPrepareAndExecuteFilter.java: 51)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter (ApplicationFilterConfig.java: 281)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter (ApplicationFilterConfig.java: 262)
at org.apache.catalina.core.ApplicationFilterConfig. (ApplicationFilterConfig.java: 107)
at org.apache.catalina.core.StandardContext.filterStart (StandardContext.java: 4656)
at org.apache.catalina.core.StandardContext.startInternal (StandardContext.java: 5309)
at org.apache.catalina.util.LifecycleBase.start (LifecycleBase.java: 150)
at org.apache.catalina.core.ContainerBase.addChildInternal (ContainerBase.java: 901)
at org.apache.catalina.core.ContainerBase.addChild (ContainerBase.java: 877)
at org.apache.catalina.core.StandardHost.addChild (StandardHost.java: 633)
at org.apache.catalina.startup.HostConfig.deployDirectory (HostConfig.java: 1114)
at org.apache.catalina.startup.HostConfig $ DeployDirectory.run (HostConfig.java: 1673)
at java.util.concurrent.Executors $ RunnableAdapter.call (Executors.java: 471)
at java.util.concurrent.FutureTask $ Sync.innerRun (FutureTask.java: 334)
at java.util.concurrent.FutureTask.run (FutureTask.java: 166)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java: 1145)
at java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java: 615)
at java.lang.Thread.run (Thread.java: 722)
------ For reference only ------------------ ---------------------
15 F, 15 F, positive Solutions positive Solutions

没有评论:

发表评论