我在本地tomcat上运行很好,但是发布到服务器jboss上就报错,错误如下:

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了我在本地tomcat上运行很好,但是发布到服务器jboss上就报错,错误如下:相关的知识,希望对你有一定的参考价值。

org.apache.jasper.JasperException: File "/struts-tags" not found
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:160)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:429)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:491)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1438)
org.apache.jasper.compiler.Parser.parse(Parser.java:137)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:171)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:333)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:313)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:300)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

参考技术A 本地开发环境也用jboss来调式开发,重新编译发布,然后再部署试试。 参考技术B 缺少相应的jar包 可能是struts core 或者是jar包冲突 干掉sevlet.jar试试看追问

你出现过这样的问题吗?我的架包中本来就没有sevlet.jar

追答

出现过 weblogic上的问题 感觉这些都是相通的

有没添加引用啊 eclispse 项目 右键 buildpath 最后 再 add jars 或者第二项

你再看看jsp页面内有空指针异常没

本回答被提问者和网友采纳
参考技术C 你少加了struts-tags文件 参考技术D 复制过程中是不是丢包了?显示你struts标签的引用没有找到?重新启动或者复制下,把包重新考进去。引用struts-tags的时候,我建议别名还是起全名

Vaadin Spring Projekt期望no-arg构造函数,只在tomcat上不是本地的

我试图在Ubuntu 18.04服务器上的Tomcat应用程序服务器上运行Spring Boot的Vaadin projekt。

我下载了Vaadin Flow Spring Starter Projekt:https://vaadin.com/start/latest/project-base-spring

但是当我在tomcat上部署并尝试打开它时,我收到此错误:

There was an exception while trying to navigate to '' with the exception message 'Unable to create an instance of 'de.web.michail.spring.MainView'. Make sure the class has a public no-arg constructor.'
java.lang.IllegalArgumentException: Unable to create an instance of 'de.web.michail.spring.MainView'. Make sure the class has a public no-arg constructor.
    at com.vaadin.flow.internal.ReflectTools.createProxyInstance(ReflectTools.java:515)
    at com.vaadin.flow.internal.ReflectTools.createInstance(ReflectTools.java:447)
    at com.vaadin.flow.di.DefaultInstantiator.getOrCreate(DefaultInstantiator.java:65)
    at com.vaadin.flow.di.Instantiator.createRouteTarget(Instantiator.java:158)
    at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.lambda$getRouteTarget$1(AbstractNavigationStateRenderer.java:116)
    at java.base/java.util.Optional.orElseGet(Optional.java:358)
    at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.getRouteTarget(AbstractNavigationStateRenderer.java:115)
    at com.vaadin.flow.router.internal.AbstractNavigationStateRenderer.handle(AbstractNavigationStateRenderer.java:167)
    at com.vaadin.flow.router.Router.handleNavigation(Router.java:221)
    at com.vaadin.flow.router.Router.navigate(Router.java:192)
    at com.vaadin.flow.router.Router.initializeUI(Router.java:95)
    at com.vaadin.flow.server.BootstrapHandler.createAndInitUI(BootstrapHandler.java:1117)
    at com.vaadin.flow.server.BootstrapHandler.synchronizedHandleRequest(BootstrapHandler.java:396)
    at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
    at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1533)
    at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:227)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:844)

我不明白这个基本示例项目是如何运行的。你是tomcat的问题吗?也许像WildFly这样的其他应用程序服务器会运行正确吗?

答案

让Application扩展SpringBootServletInitializer解决了这个问题。

public class Application extends SpringBootServletInitializer {
// ...
}

以上是关于我在本地tomcat上运行很好,但是发布到服务器jboss上就报错,错误如下:的主要内容,如果未能解决你的问题,请参考以下文章

在本地 tomcat 上运行的 Spring Boot 应用程序在 Elastic Beanstalk 上提供 404

icepdf无法在JFrame中的linux实例上呈现

将tomcat重定向到本地系统中的apache

将tomcat重定向到本地系统中的apache

Vaadin Spring Projekt期望no-arg构造函数,只在tomcat上不是本地的

本地开发的java项目发布在本地的tomcat上,如何让本地项目可以外网访问