异常“ java.lang.IllegalArgumentException:参数类型[java.lang.String]的名称不可用”蚂蚁生成问题

时间:2019-03-27 07:17:35

标签: java spring spring-boot tomcat antbuilder

我有一个项目,当通过eclipse导出war文件生成war文件时,该项目运行良好。 我使用build.xml通过ant build生成了war文件,并将war文件作为项目导入并运行。 出现了应用程序用户界面,但是当我测试其功能时,会出现以下异常。

  

严重:路径为[/ crest]的上下文中servlet [rest]的Servlet.service()抛出异常[请求处理失败;嵌套的异常是java.lang.IllegalArgumentException:参数类型[java.lang.String]的名称不可用,并且在类文件中也找不到参数名称信息。   java.lang.IllegalArgumentException:参数类型[java.lang.String]的名称不可用,并且在类文件中也找不到参数名称信息。          在org.springframework.util.Assert.notNull(Assert.java:112)          在org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.updateNamedValueInfo(AbstractNamedValueMethodArgumentResolver.java:138)处          在org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.getNamedValueInfo(AbstractNamedValueMethodArgumentResolver.java:117)          在org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:84)          在org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:79)          在org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:157)          在org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:124)          在org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)          在org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:748)          在org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)          在org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)          在org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)          在org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)          在org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931)          在org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:822)          在javax.servlet.http.HttpServlet.service(HttpServlet.java:621)          在org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)          在javax.servlet.http.HttpServlet.service(HttpServlet.java:722)          在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)          在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)          在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)          在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)          在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)          在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)          在org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)          在org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)          在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)          在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)          在org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)          在org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:188)          在org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:166)          在org.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run(JIoEndpoint.java:302)          在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)          在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)          在java.lang.Thread.run(Thread.java:724)

build.xml

`

<?xml version="1.0" encoding="UTF-8"?>
<project name="APPNAME" default="deploy-tomcat">
<property file="build.properties"/>
<!-- Define the CLASSPATH -->
<path id="compile.classpath">
<fileset dir="../WebContent/WEB-INF/lib">
  <include name="*.jar"/>
</fileset> 
</path>
<target name="path-test">
<property environment="env"/>
<echo message="Path is :${env.Path}"/>
</target>
<target name="init"  description="init">
<property environment="env"/>
 <echo message="Path is :${env.Path}"/>
<mkdir dir="../dest"/>
 <mkdir dir="../target"/>
</target>
<target name="clean" description="clean" depends ="init">
<echo>Cleaning out directories</echo>
 <delete file="../WebContent/WEB-INF/lib/APPNAME.jar"/>
<delete file="../target/APPNAME.war"/>
<delete>
<fileset dir="../dest" includes="**/*.class"/>
 </delete>
</target>
<target name="compile" depends="init, clean"
description="Compile Java sources and copy to WEB-INF/classes dir">
<javac source="1.7" target="1.7" srcdir="../src"
destdir="../dest">
<classpath refid="compile.classpath"/>
 </javac> 
</target>
<target name="jar"  depends="compile" description="jar">
<jar destfile="../WebContent/WEB-INF/lib/APPNAME.jar" basedir="../dest">
 </jar>   
 </target>
 <target name="build-war" depends = "jar">
<war destfile="../target/APPNAME.war"webxml="../WebContent/WEB-INF/web.xml">
<fileset dir="../WebContent">
<include name="**/*.*"/>
</fileset>    
</war>
</target> 
<target name="deploy-tomcat" depends="build-war">
<antcall target="tomcat-shutdown"></antcall>
<sleep seconds="5"/>
<echo>Deleting ${tomcat.dfoflag.dir}</echo>
<delete dir="${tomcat.APPNAME.dir}"/>
 <copy file="../target/APPNAME.war" todir="${tomcat.home}/webapps">
</copy>
<antcall target="tomcat-startup"></antcall>
</target>
</project>

` 我认为问题在于,在进行战争期间,弹簧罐未正确编译,有人可以提出任何解决方案吗?

0 个答案:

没有答案