Cause: java.lang.NoSuchMethodException: spring_cache.springtest.dao.Employee.<init>()?

图片说明

以下是pojo

 package spring_cache.springtest.pojo;

public class Employee {

    private Integer id;
    private String lastName;
    private String email;
    //性别 1男  0女
    private Integer gender;
    private Integer dId;

    public Employee() {
    }


    public Employee(Integer id, String lastName, String email, Integer gender, Integer dId) {
        super();
        this.id = id;
        this.lastName = lastName;
        this.email = email;
        this.gender = gender;
        this.dId = dId;
    }

    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getLastName() {
        return lastName;
    }
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public Integer getGender() {
        return gender;
    }
    public void setGender(Integer gender) {
        this.gender = gender;
    }
    public Integer getdId() {
        return dId;
    }
    public void setdId(Integer dId) {
        this.dId = dId;
    }
    @Override
    public String toString() {
        return "Employee [id=" + id + ", lastName=" + lastName + ", email=" + email + ", gender=" + gender + ", dId="
                + dId + "]";
    }



}

mapper文件

 package spring_cache.springtest.dao;

import org.apache.ibatis.annotations.*;

/**
 * @author Dell
 */
@Mapper
public interface Employee {
        @Select("SELECT * FROM employee WHERE id=#{id}")
        public  Employee getEmployeeById(Integer id);
        @Update("update Employee set lastName=#{lastName},email=#{email},gender=#{gender},d_id=#{dId} where id=#{id}")
        public Employee updateEmp(Employee emp);
        @Delete("delete from Employee where id=#{id}")
        public void deleteEmp(Employee emp);
        @Insert("insert into Employee(lastName,email,gender,d_id) values(#{lastName},#{email},#{gender},#{dId})")
        public void InsertEmp(Employee emp);
}

配置文件

 spring.datasource.url=jdbc:mysql://localhost:3306/spring_cache
spring.datasource.username=root
spring.datasource.password=123

测试类

package spring_cache.springtest;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import spring_cache.springtest.dao.Employee;

@RunWith(SpringRunner.class)
@SpringBootTest
public class SpringtestApplicationTests {
    @Autowired
    Employee employee;
    @Test
    public void contextLoads() {
        Employee employeeById = employee.getEmployeeById(1);
        System.out.println(employeeById);
    }

}


错误信息

Caused by: org.apache.ibatis.reflection.ReflectionException: Error instantiating interface spring_cache.springtest.dao.Employee with invalid types () or values (). Cause: java.lang.NoSuchMethodException: spring_cache.springtest.dao.Employee.<init>()

0

1个回答

解决了,mapper文件以mapper后缀命名

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Cause: java.lang.NoSuchMethodException: spring_cache.springtest.dao.Employee.()?
![图片说明](https://img-ask.csdn.net/upload/201810/06/1538800958_237033.jpg)rnrn以下是pojorn```rn package spring_cache.springtest.pojo;rnrnpublic class Employee rn rn private Integer id;rn private String lastName;rn private String email;rn //性别 1男 0女rn private Integer gender;rn private Integer dId;rnrn public Employee() rn rnrnrn public Employee(Integer id, String lastName, String email, Integer gender, Integer dId) rn super();rn this.id = id;rn this.lastName = lastName;rn this.email = email;rn this.gender = gender;rn this.dId = dId;rn rn rn public Integer getId() rn return id;rn rn public void setId(Integer id) rn this.id = id;rn rn public String getLastName() rn return lastName;rn rn public void setLastName(String lastName) rn this.lastName = lastName;rn rn public String getEmail() rn return email;rn rn public void setEmail(String email) rn this.email = email;rn rn public Integer getGender() rn return gender;rn rn public void setGender(Integer gender) rn this.gender = gender;rn rn public Integer getdId() rn return dId;rn rn public void setdId(Integer dId) rn this.dId = dId;rn rn @Overridern public String toString() rn return "Employee [id=" + id + ", lastName=" + lastName + ", email=" + email + ", gender=" + gender + ", dId="rn + dId + "]";rn rn rn rnrnrnrn```rnmapper文件rnrn```rn package spring_cache.springtest.dao;rnrnimport org.apache.ibatis.annotations.*;rnrn/**rn * @author Dellrn */rn@Mapperrnpublic interface Employee rn @Select("SELECT * FROM employee WHERE id=#id")rn public Employee getEmployeeById(Integer id);rn @Update("update Employee set lastName=#lastName,email=#email,gender=#gender,d_id=#dId where id=#id")rn public Employee updateEmp(Employee emp);rn @Delete("delete from Employee where id=#id")rn public void deleteEmp(Employee emp);rn @Insert("insert into Employee(lastName,email,gender,d_id) values(#lastName,#email,#gender,#dId)")rn public void InsertEmp(Employee emp);rnrnrn```rnrn配置文件rnrn```rn spring.datasource.url=jdbc:mysql://localhost:3306/spring_cachernspring.datasource.username=rootrnspring.datasource.password=123rnrn```rn 测试类rn```rnpackage spring_cache.springtest;rnrnimport org.junit.Test;rnimport org.junit.runner.RunWith;rnimport org.springframework.beans.factory.annotation.Autowired;rnimport org.springframework.boot.test.context.SpringBootTest;rnimport org.springframework.test.context.junit4.SpringRunner;rnimport spring_cache.springtest.dao.Employee;rnrn@RunWith(SpringRunner.class)rn@SpringBootTestrnpublic class SpringtestApplicationTests rn @Autowiredrn Employee employee;rn @Testrn public void contextLoads() rn Employee employeeById = employee.getEmployeeById(1);rn System.out.println(employeeById);rn rnrnrnrnrn```rn错误信息rnrn```rnCaused by: org.apache.ibatis.reflection.ReflectionException: Error instantiating interface spring_cache.springtest.dao.Employee with invalid types () or values (). Cause: java.lang.NoSuchMethodException: spring_cache.springtest.dao.Employee.()rn rn```
java.lang.NoSuchMethodException
[code="java"]java.lang.NoSuchMethodException: com.kinrich.action.MediaAction.deleteMedia()rn java.lang.Class.getMethod(Class.java:1581)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:75)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:47)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn[/code]rn[color=red]报错[/color]rnrn[color=red]Action[/color]rn[code="java"]rn public String deleteMedia() throws Exceptionrn String[] mediaid = request.getParameterValues("mediaid");rn for (int i = 0; i < mediaid.length; i++) rn manageMediaDao.deleteMedia(Integer.parseInt(mediaid[i]));rn rn return getList();rn rn rn[/code]rnrn[color=red]页面[/color]rn[code="java"]rn rnrn rn rn rn rn rn rnrn[/code]rnrnrn[color=red]struts[/color]rn[code="java"]rnrnrnrn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn /ManageMemor.jsprn /updateToMemor.jsprn rn rnrn[/code]
java.lang.NoSuchMethodException异常
根据方法名自动调用方法: 异常名称:java.lang.NoSuchMethodException 原因:自己定义的方法缺少request和response这两个参数!
java.lang.NoSuchMethodException: .getPortClassMap()
NULL 博文链接:https://hw1287789687.iteye.com/blog/2034439
java.lang.NoSuchMethodException: setId([Ljava.lang.String;)
写的一段程序可以正常运行,运行过程中报出以下异常:[code=text]rn2012-12-26 13:19:09 WARN OgnlValueStack:49 - Error setting valuernognl.MethodFailedException: Method "setId" failed for object 系统菜单:ID=0,菜单名=null,URL=null [java.lang.NoSuchMethodException: setId([Ljava.lang.String;)]rn at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:823)rn at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:964)rn at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:75)rn at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:131)rn at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:28)rn at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)rn at ognl.ASTProperty.setValueBody(ASTProperty.java:101)rn at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)rn at ognl.SimpleNode.setValue(SimpleNode.java:246)rn at ognl.ASTChain.setValueBody(ASTChain.java:172)rn at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)rn at ognl.SimpleNode.setValue(SimpleNode.java:246)rn at ognl.Ognl.setValue(Ognl.java:476)rn at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:192)rn at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:155)rn at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:143)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:273)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:187)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)rn at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.esse.common.service.listener.CheckSessionFilter.doFilter(CheckSessionFilter.java:63)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.esse.common.service.listener.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:84)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)rn at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)rn at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:574)rn at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1527)rn at java.lang.Thread.run(Thread.java:619)rnrn[/code]
Error cause?
in my project there is a error .it is "E2294 structure required on the left side of . or .*".rnwhat does it mean?rnhow to solve?
求助,struts2 java.lang.NoSuchMethodException: com.opensymphony.xwork2.ActionSuppor
今天熟悉新公司项目,里面的sturts2 配置跟我平常看见的不一样,后来写了一个action报一下错误,望各位帮忙解答下,阿里嘎多。rnrnStacktracesrnrnjava.lang.NoSuchMethodException: com.opensymphony.xwork2.ActionSupport.assetlist()rn java.lang.Class.getMethod(Unknown Source)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:75)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:47)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)rn org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn com.ssbank.filter.GzipFilter.doFilter(GzipFilter.java:60)rn org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)rn org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)rn org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:140)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)rn org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)rn org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)rn org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)rn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)rn org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)rn org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)rn org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)rn org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)rn org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)rn java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)rn java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)rn org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn java.lang.Thread.run(Unknown Source)rn rnYou are seeing this page because development mode is enabled. Development mode, or devMode, enables extra debugging behaviors and reports to assist developers. To disable this mode, set:rnrn struts.devMode=falsernin your WEB-INF/classes/struts.properties file.rnrn这是我的页面请求:rnrnstruts.xml:这个struts.xml我不是很明白配置。action通过注解实现的,但我对注解的认识很粗浅。rnrn rn rn rn rn rn rn rn rnrn rnrn rn rn /html/login.htmlrn $loginRedirectUrlrn rn rn /shoprn redirectrn $redirectUrlrn rn /WEB-INF/template/shop/invalid_token.ftlrn /WEB-INF/template/shop/error.ftlrn rn rn rn rn /WEB-INF/page/success.jsp rn rn rn /WEB-INF/template/shop/tradeReq.jsprn rn rn rnrnaction 代码:rn/**rn * rn * @author Administratorrn *rn */rn@ParentPackage("shop")rn@InterceptorRefs(rn @InterceptorRef(value = "memberVerifyInterceptor"),rn @InterceptorRef(value = "shopStack")rn)rn@Result(name = "assetlist", location = "/WEB-INF/template/shop/member_asset_list.ftl")rnpublic class MemberAssetAction extends BaseShopAction rnrn private static final long serialVersionUID = -3568504222758246021L;rn private Member member;rn private String message ;rn @Resourcern MemberService memberService;rn rn public String list()rn rn return "assetlist";rn rn rnrnrn
ofbiz 异常: Exception : java.lang.NoSuchMethodException
这几天在看ofbiz,出了个异常,搞不定,求大神。rnrn[img=https://img-bbs.csdn.net/upload/201408/29/1409309982_454084.png][/img]rnrnrnl类PracticeDepartmentEvents 代码如下:rnrnrnrn[img=https://img-bbs.csdn.net/upload/201408/29/1409310096_275072.png][/img]
struts 跳转java.lang.NoSuchMethodException
页面报这样的错误rnrnjava.lang.NoSuchMethodException: com.paraview.action.MainAction.regUser() rn java.lang.Class.getMethod(Class.java:1605)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:75)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:47)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)rn org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)rn org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)rn org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)rn org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594)rn org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)rn java.lang.Thread.run(Thread.java:619)rnrnrnrn可是我在jsp中写的action连的不是MainAction 而是另一个 spring配置文件和struts配置文件的路径rn都没错 rnrn rn rn 账号:rn rn rn 密码:rn rn rn rn rn rn rn rn rn
报错java.lang.NoSuchMethodException怎么解决?
错误如下:rnrn严重: Servlet.service() for servlet action threw exceptionrnjava.lang.NoSuchMethodException: Action[/stuInfo] does not contain specified metrnhod (check logs)rn at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:rn264)rn at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcesrnsor.java:431)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationrnFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChrnain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.jarnva:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.jarnva:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128rn)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102rn)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.javarn:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Httprn11Protocol.java:584)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Unknown Source)rnrnrnrn我的action是:rnrnpublic class UserInfoAction extends DispatchAction rn rn private UserBiz biz = new UserBizImpl();rn rn public ActionForward doLogin(ActionMapping mapping, ActionForm form,rn HttpServletRequest request, HttpServletResponse response) rn rn UserInfoForm userInfoForm = (UserInfoForm) form;// TODO Auto-generated method stubrn Admin admin = new Admin();rn admin.setId(userInfoForm.getId());rn admin.setUsername(userInfoForm.getUsername());rn admin.setPassword(userInfoForm.getPassword());rn if (biz.login(admin)) rn HttpSession session = request.getSession();rn session.setAttribute("admin", admin);rn return mapping.findForward("login_success");rn rn return mapping.findForward("login_fail");rn rn rnrnrnrnform如下:rnrnpublic class UserInfoForm extends ActionForm rn rn private Integer id;rn private String username;rn private String password;rn rn rnrn public Integer getId() rn return id;rn rnrn public void setId(Integer id) rn this.id = id;rn rnrn public String getUsername() rn return username;rn rnrn public void setUsername(String username) rn this.username = username;rn rnrn public String getPassword() rn return password;rn rnrn public void setPassword(String password) rn this.password = password;rn rnrn rnrnrnrndao如下:rnrnpublic class UserDaoImpl implements UserDao rn public boolean isExist(Admin admin) rn Connection conn = null;rn PreparedStatement ps = null;rn ResultSet rs = null;rn try rn conn = DBGet.getConn();rn String sql = "select * from admin where username=?";rn ps = conn.prepareStatement(sql);rn ps.setString(1, admin.getUsername());rn rs = ps.executeQuery();rn if (rs.next()) rn if(admin.getPassword().equals(rs.getString("password"))) rn return true;rn rn rn catch (Exception e) rn e.printStackTrace();rn finally rn DBGet.closeResultSet(rs);rn DBGet.closePreparedStatement(ps);rn DBGet.closeConnection(conn);rn rnrn return false;rn rnrnrn这种情况怎么改呢?哪里错了?请教大家
java.lang.NoSuchMethodException因该怎么改
高手们帮忙看看 这个错误 是什么? 应该怎么改?从哪些地方找错误!我做了好几个功能都保类似的错,程序是struts2+hibernate+spring的,谢谢了rnrn2010-4-11 15:09:01 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet default threw exceptionrnjava.lang.NoSuchMethodException: com.menu.struts.CharacteristicdishAction.delete()rn at java.lang.Class.getMethod(Unknown Source)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:55)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:41)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:184)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept
Java反射 java.lang.NoSuchMethodException
rnrn```rn public static void testTT() throws Exception rn Class clazz = Class.forName("reflect.Person");rn // 获得构造器rn Constructor constructor = clazz.getDeclaredConstructor(new Class[] );rn // 根据类的默认构造器来获得一个对象rn Object instance = constructor.newInstance(new Object[] );rn System.out.println(instance);rn rn Constructor constructor2 = clazzrn .getDeclaredConstructor(new Class[] Integer.class, String.class, Integer.class );rn Object instance2 = constructor2.newInstance(new Object[]1,"Tom",21);rn System.out.println(instance2);rn rn```rnrnrnrn```rn public Person(int id, String name, int age) rn super();rn this.id = id;rn this.name = name;rn this.age = age;rn rn```rnrnrn```rn Exception in thread "main" java.lang.NoSuchMethodException: reflect.Person.(java.lang.Integer, java.lang.String, java.lang.Integer)rn at java.lang.Class.getConstructor0(Unknown Source)rn at java.lang.Class.getDeclaredConstructor(Unknown Source)rn```rnrnrn
java.lang.NoSuchMethodException的一种可能错误
今天遇到了java.lang.NoSuchMethodException Error 500--Internal Server Error错误,原因是DispatchAction找不到action中对应的method,我的错误是将方法定义成private,索引DispatchAction是找不到对应方法的。希望能够帮助遇到该错误的同学。
java.lang.NoSuchMethodException 出现怎么解决
项目是Spring 3.2 版本rnrn[code=java]java.lang.NoSuchMethodException: $Proxy5.getDateTime()rn at java.lang.Class.getMethod(Class.java:1605)rn at test.execute(CtrlCenter2.java:81)rn at log.doPost(WebPort.java:134)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:163)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:401)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:242)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:267)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:245)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:260)rn at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)rn at java.lang.Thread.run(Thread.java:619)[/code]rnrnAccessManager类的方法:rnpublic void getDateTime()rn{rn}rnrnrn配置:rnrn
struts2异常java.lang.NoSuchMethodException: com.struts.action.UserAction.create()
原来用的struts2.0版本,运行项目没有问题。后来换了struts2.2.1版本后,只要访问Action,都会出现rnjava.lang.NoSuchMethodException: com.struts.action.UserAction.create()类似的错误,就是说Action中找不到create这个方法。rnstruts.xmlrn[code="xml"]rnrnrnrn rn rn rn rn rn rn rn rn login,registerrn updatern rn rn /main.jsprn /index.jsprn rn rn rnrn[/code]rn我设定的是方法拦截,所以当进入user_update.action的时候,没有问题,因为它可以进入拦截器。但是我没有拦截login和register方法,进入这两个方法时就会出错。说找不到create方法。我Action里面没有这个方法,肯定找不到。而且继承的ActionSupport的里面也没有这个方法,只有excute方法。不知道为什么struts会非要找这个create方法!后来上网查了半天,人家说去掉这部分就可以。rndefaults.xmlrn[code="xml"]rnrnrnrn rn rn /error.jsprn rn rn rn rn rn rn rnrn[/code]rn试了下,果然奏效。但是用原来struts2.0的版本没有这样的问题啊!不知道为什么,哪位高人来解释下,感激不尽!最好能带 struts的源代码分析下!还有struts2.0和2.1之后的地方,有哪些区别?rnrnrnrnrnrnOh My God!现在又不行了。不知道是不是我刚才手动加的create方法没去掉,现在又报这个错误,蛋疼啊!高手速来解答!感激不尽啊!rn
mapreduce执行报错:java.lang.NoSuchMethodException:
13/11/07 08:45:08 INFO mapred.JobClient: Task Id : attempt_201311070843_0001_r_000000_0, Status : FAILEDrnjava.lang.RuntimeException: java.lang.NoSuchMethodException: com.group2.UserBean.()rn at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:115)rn at org.apache.hadoop.io.serializer.WritableSerialization$WritableDeserializer.deserialize(WritableSerialization.java:62)rn at org.apache.hadoop.io.serializer.WritableSerialization$WritableDeserializer.deserialize(WritableSerialization.java:40)rn at org.apache.hadoop.mapreduce.ReduceContext.nextKeyValue(ReduceContext.java:117)rn at org.apache.hadoop.mapreduce.ReduceContext.nextKey(ReduceContext.java:92)rn at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:175)rn at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:572)rn at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:414)rn at org.apache.hadoop.mapred.Child$4.run(Child.java:266)rn at java.security.AccessController.doPrivileged(Native Method)rn at javax.security.auth.Subject.doAs(Subject.java:396)rn at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformrnattempt_201311070843_0001_r_000000_0: log4j:WARN No appenders could be found for logger (org.apache.hadoop.hdfs.DFSClient).rnattempt_201311070843_0001_r_000000_0: log4j:WARN Please initialize the log4j system properly.rnrnrn代码如下:rnpackage com.group2;rnpublic class DisGroupCount extends Configured implements Tool rnrn public int run(String[] args) throws Exception rn rn Job job = new Job(this.getConf());rn job.setJarByClass(this.getClass());rn job.setJobName("DisGroupCount");rn job.setMapperClass(DisGroupMapper.class);rn job.setReducerClass(DisGroupReduce.class);rn job.setMapOutputKeyClass(Text.class);rn job.setMapOutputValueClass(UserBean.class);rn job.setOutputKeyClass(NullWritable.class);rn job.setOutputValueClass(TextOutputFormat.class);rn FileInputFormat.addInputPath(job,new Path(args[0]));rn FileOutputFormat.setOutputPath(job,new Path(args[1]));rn return job.waitForCompletion(true) ? 0 : 1;rn rn public static void main(String[] args) throws Exception rn rn ToolRunner.run(new DisGroupCount(), args);rn rnrnrnpackage com.group2;rnpublic class DisGroupMapper extends Mapperrnrn protected void map(LongWritable key, Text value,Context context)throws IOException, InterruptedExceptionrn rn String[] values = value.toString().split(",");rn context.write(new Text(values[0]),new UserBean(new Text(values[1]),new LongWritable(Long.parseLong(values[2]))));rn rnrnpackage com.group2;rnpublic class DisGroupReduce extends Reducerrnrn protected void reduce(Text key,Iterable value,Context context) throws IOException, InterruptedExceptionrn rn HashSet tmpSet = new HashSet();rn long sum = 0l;rn while(value.iterator().hasNext())rn rn UserBean tmp = value.iterator().next();rn tmpSet.add(tmp.getEmpNo());rn sum += tmp.getSumAmr().get();rn rn String outValue = "时间:"+key.toString()+",人数合计:"+tmpSet.size()+",业绩合计:"+sum;rn context.write(null,new Text(outValue));rn rnrnrnpackage com.group2;rnpublic class UserBean implements Writable rnrn private Text empNo;rn private LongWritable sumAmr;rn public UserBean(Text empNo,LongWritable sumAmr)rn rn this.empNo = empNo;rn this.sumAmr = sumAmr;rn rn public void readFields(DataInput input) throws IOException rn rn empNo.readFields(input);rn sumAmr.readFields(input);rn rn public void write(DataOutput output) throws IOException rn rn empNo.write(output);rn sumAmr.write(output);rn rn public Text getEmpNo() rn return empNo;rn rn public void setEmpNo(Text empNo) rn this.empNo = empNo;rn rn public LongWritable getSumAmr() rn return sumAmr;rn rn public void setSumAmr(LongWritable sumAmr) rn this.sumAmr = sumAmr;rn rn
java.lang.NoSuchMethodException: $Proxy13.get()帮忙看看。。
struts的配置文件rn[code=XML]rnrnrnrn rn rn rn rn yes.htmlrn no.jsprn rn rn yes.jsprn no.jsprn rn rn yes.jsprn no.jsprn rn rn rn[/code]rnspring 的配置文件rn[code=XML]rnrnrn rn rn rn rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn rnrn rn rn rn rnrn rn rn rn rn rn rn rn rn rnrn[/code]rnaction的代码rn[code=Java]rn rn public String Insert() rn //将页面填写的省,市,区,详细地址合并成送货地址rn this.purvey.setProvinces(this.getCity()+","+this.getRegion());rn String str=purveryBiz.insert(purvey);rn if(str =="插入成功")rn return SUCCESS;rn elsern return ERROR;rn rn rn public String update()rn String ret =purveryBiz.updateById(purvey);rn if(ret =="修改成功")rn return SUCCESS;rn rn return ERROR;rn rn rn public String get()rn List list = purveryBiz.getAll();rn if(list != null)rn ActionContext ac = ActionContext.getContext();rn ac.getSession().put("supplierList", list);rn return SUCCESS;rn elsern return ERROR;rn rn rn public String getByTrading()rn Purvey pu = this.purveryBiz.getByTrading(this.getTrading());rn if(pu != null)rn ActionContext ac = ActionContext.getContext();rn ac.getSession().put("purvey", pu);rn return SUCCESS;rn elsern rn return INPUT;rn rn rn rn rnrn[/code]rn页面的代码:rn[code=HTML]rn rn rn rn rn 供货商信息rn rn rn rn rn rn *供货商代码:rn rn rn rn rn rn *中文名称:rn rn rn rn rn rn rn rn *英文名称:rn rn rn rn rn rn *网址:rn rn rn rn rn rn rn rn *联系人:rn rn rn rn rn rn *联系电话:rn rn rn rn rn rn rn rn *省市:rn rn rn 国家 rn 省rn 市 rn rn rn *详细地址:rn rn rn rn rn rn rn rn *邮政编码:rn rn rn rn rn rn *企业简称:rn rn rn rn rn rn rn rn *开户银行:rn rn rn rn rn rn *账号:rn rn rn rn rn rn rn rn *收款单位:rn rn rn rn rn rn *付款条件:rn rn rn rn rn rn rn rn 备注:rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn[/code]rnrn报错。:rnjava.lang.NoSuchMethodException: $Proxy13.get()rn java.lang.Class.getMethod(Class.java:1605)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:75)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:47)rn
ROOT CAUSE ANALYZE
这个资源提供的是个关于如何做ROOT CAUSE ANALYZE的文档。
init()
谁能告诉我init()是什么意思?应当怎么用?
Cause: Undefined instruction
本人用uC/OS-2 + uC/GUI 上开发嵌入式应用程序rnrn用ICE连好板子后,在AXD中调试例子DEMO出错啊,rnrn错误在OSStart()函数中的rnrn rnrnProcessor ARM7TDMI raised an exceptionrnrnCause: Undefined instructionrnrn请问是什么原因呢?rn按理说例子DEMO是完全正确的,这个例子是竞赛主办方提供的,而且已经在板子上运行良好了啊!
isdn cause codes
详细的isdn cause codes英文版。
Reasoning with cause and effect
An introduction about how to reason based on cause-effect.
throwable和cause和getCause问题?
throwable和cause和getCause问题?rnrn都是什么含义 都什么时候用?
Root Cause Analysis_Study Book
1. RCA是问题收集,分析,解决的一种工具或方法。2. RCA两份英文资料(非常适合初级学者) 3. 内容很丰富,实用性很好。
ITU-Q.850 Usage of cause and location
Usage of cause and location in the Digital Subscriber Signalling System No. 1 and the Signalling System No. 7 ISDN User Part
init s与init 1的区别
solaris 运行级别有几种?rninit s与init 1有什么区别?
window.onunload = init(); 与window.onunload = init;区别
window.onunload = init(); 与window.onunload = init;区别
做ssh项目报java.lang.NoSuchMethodException
type Exception reportnnmessage com.action.LoginAction.Login()nndescription The server encountered an internal error that prevented it from fulfilling this request.nnexception njava.lang.NoSuchMethodException: com.action.LoginAction.Login()n java.lang.Class.getMethod(Class.java:1605)n org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:75)n org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:47)n com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)n com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)n com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)n com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)n com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)n com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)n com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)n com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)n com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)n com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)nn配置文件也没有问题,Login方法也有,但是就是一直出现这个异常。
java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException:
我的工程运行后错误提示:java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: org.xml.sax.SAXParseException: The content of element type "sqlMapConfig" must match "(properties?,settings?,resultObjectFactory?,typeAlias*,typeHandler*,transactionManager?,sqlMap+)+".rn有高手遇到过类似的情况,请不吝赐教。
Auto mold cause sagging wire
Auto mold sagging wire investigate table, to investigate sagging wire , it is very help to investigate root cause .
导包错误,提示with root cause
Stacktrace:] with root cause java.lang.NoClassDefFoundError: com/google/common/collect/Multiset$Entry jsp编辑过程中,给map 的entry导入了错误的包,提示com/google/common/collect/Multiset$Entry, 修改代码后,发现为导包错误。。
Root Cause Analysis_学习手册
非常使用的一个Root cause analysis学习手册!
Just Cause系列游戏品鉴
没错, 这又是一个游戏点评, 因为实在没地写了, 想起来我还欠JC系列许多售后评价, 就专门写了这篇blog来总结下JC系列的特色, 以及它最新的游戏引擎apex, JC4月初的时候发布的, 虽然和3一样刚开始都有很多画质问题, 但是随着不断的更新, 体验院内袁浩了, 但是建议在圣诞节时候购买~“正当防卫”系列中的每一部分都有一个故事,讲述了为控制一个小国而...
java.lang.IllegalStateException: Can't overwrite cause
在Java里使用xfire-webservice的时候,加入了缓存技术ehcache后报了如下错误,不知道是怎么回事,哪位大侠知道的帮忙解决下啊,先谢谢了。rn[acepherics] 2010-09-02 18:05:14,230 ERROR [http-8080-2] DefaultFaultHandler.sendFault(96) | Could not send fault.rnjava.lang.IllegalStateException: Can't overwrite causern at java.lang.Throwable.initCause(Throwable.java:320)rn at com.ctc.wstx.compat.Jdk14Impl.setInitCause(Jdk14Impl.java:70)rn at com.ctc.wstx.exc.WstxException.(WstxException.java:46)rn at com.ctc.wstx.exc.WstxIOException.(WstxIOException.java:16)rn at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:313)rn at org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerializer.java:88)rn at org.codehaus.xfire.transport.http.HttpChannel.writeWithoutAttachments(HttpChannel.java:56)rn at org.codehaus.xfire.transport.http.XFireServletChannel.sendViaServlet(XFireServletChannel.java:87)rn at org.codehaus.xfire.transport.http.XFireServletChannel.send(XFireServletChannel.java:44)rn at org.codehaus.xfire.fault.FaultSender.invoke(FaultSender.java:37)rn at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)rn at org.codehaus.xfire.handler.DefaultFaultHandler.sendFault(DefaultFaultHandler.java:88)rn at org.codehaus.xfire.handler.DefaultFaultHandler.invoke(DefaultFaultHandler.java:51)rn at org.codehaus.xfire.service.binding.PostInvocationHandler.invoke(PostInvocationHandler.java:50)rn at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)rn at org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64)rn at org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38)rn at org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireServletController.java:301)rn at org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:130)rn at org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)rn at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)rn at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)rn at java.lang.Thread.run(Unknown Source)rn
linux init
inittetetetewrtewtertertertertertew
init进程
前言众所周知的是,Linux中的所有进程都是由init进程创建并运行的。首先Linux内核启动,然后在用户空间启动init进程,再依次启动系统运行的其他进程。在系统启动完成后,init进程会作为守护进程监视其他进程。若是某个监视中的进程一旦终结,进入到僵死状态,它就会释放进程所占用的系统资源。其实,在Android平台中也存在init进程,除了提供以上常见的功能外,还提供几种额外的功能。与Linux
__init的用法
http://blog.csdn.net/eroswang/article/details/2317771 在kernel中有很多__init,这个东东到底是何方神圣捏?且听小生我一一道来。下面是其定义:file:/include/linux/init.h 43 #define __init      __attribute__ ((__section__ (".init.text"))
init()的作用
[code=Java] public static void main(String[] args)rn rn new TestCheckbox().init(); rn [/code]rnrninit()我在JDK帮助里找不到....rn
类函数init()?
[code=C/C++]rnstatic VappDesktopDirector *s_vapp_desktop = NULL;rnvoid vapp_desktop_create(void)rnrn VFX_ASSERT(s_vapp_desktop == NULL);rnrn VfxAppCatScr::initalizeWithScrAsmSize(VAPP_DESKTOP_MAX_CNTX_MEM_SIZE);rnrn VFX_OBJ_CREATE(rn s_vapp_desktop,rn VappDesktopDirector,rn VfxAppCatScr::getContext());rnrnrn#define VFX_OBJ_CREATE(_ptr, _className, _parent) \rn do \rn \rn VFX_ALLOC_NEW(_ptr, _className, _parent); \rn (_ptr)->init(_parent); ********* \rn while (0)rnrn[/code]rnrn请问,上面*********这个init函数怎么来的。我找了这几个类中代码,都没有对init进行声明。是否不需要声明?
init介绍
注重实践,剔除繁琐的理论,通过案例讲解我们常用的知识点,各个知识点之间相对独立,不用担心某一个知识点学不会而耽搁学其他的知识点。轻轻松松入门Git。