gpt4 book ai didi

spring - 无法让 WebApp 在 Eclipse 的 Tomcat 上初始化 [以前工作]

转载 作者:行者123 更新时间:2023-11-28 22:47:33 25 4
gpt4 key购买 nike

我无法在 Eclipse 的 tomcat 上初始化我的应用程序。它在 8 小时前工作正常。我没有看管它。

回来后我遇到了一些不相关的问题,其中无法解析来自同一包的类型,所以我:1. 清理 Maven,2. 更新项目 3. 删除/重新添加服务器 4. 重新启动 Eclipse

在此之后,应用程序将不会在 tomcat 上初始化。我运行了 maven build 并构建了 .war(如果有任何不同的话)。

请参阅下面的服务器初始化日志、servlet 初始化程序和 web.xml。一些注意事项: - 我没有编辑我的 pom.xml

  • 应用运行在注释而非 xml 上

  • sysout 的 servlet 初始值设定项不会被打印出来,所以它不会到达那个阶段。

Servlet Init

package domain.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

public class ServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

@Override
protected Class<?>[] getRootConfigClasses() {
System.out.println("Security Servlet init");
return new Class[] { SecurityConfig.class };
}

@Override
protected Class<?>[] getServletConfigClasses() {
System.out.println("Config Servlet init");
return new Class[] { ConfigClass.class };
}

@Override
protected String[] getServletMappings() {
return new String[] { "/" };
}

}

Tomcat log

Nov 29, 2018 4:42:06 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:applicationform' did not find a matching property.
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/9.0.10
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jun 20 2018 17:32:21 UTC
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 9.0.10.0
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 10
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 10.0
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jdk1.8.0_144\jre
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_144-b01
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\Users\OUYanis\Documents\live\.metadata\.plugins\org.eclipse.wst.server.core\tmp4
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\OUYanis\Documents\live\.metadata\.plugins\org.eclipse.wst.server.core\tmp4
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\OUYanis\Documents\live\.metadata\.plugins\org.eclipse.wst.server.core\tmp4\wtpwebapps
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\endorsed
Nov 29, 2018 4:42:06 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Nov 29, 2018 4:42:06 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_144\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files (x86)/Java/jre1.8.0_161/bin/client;C:/Program Files (x86)/Java/jre1.8.0_161/bin;C:/Program Files (x86)/Java/jre1.8.0_161/lib/i386;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Acer\Remote Files\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\PuTTY\;C:\WINDOWS\System32\OpenSSH\;C:\Users\OUYanis\AppData\Local\Microsoft\WindowsApps;C:\sts-3.9.5.RELEASE;;.]
Nov 29, 2018 4:42:07 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Nov 29, 2018 4:42:07 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Nov 29, 2018 4:42:07 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Nov 29, 2018 4:42:07 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Nov 29, 2018 4:42:07 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2540 ms
Nov 29, 2018 4:42:07 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
Nov 29, 2018 4:42:07 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/9.0.10
Nov 29, 2018 4:42:21 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Nov 29, 2018 4:42:21 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Nov 29, 2018 4:42:21 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Nov 29, 2018 4:42:21 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 13723 ms

Edit, Deployment Assembly

EDIT

最佳答案

Yanis,我很高兴这对你有用,实际上我这边也遇到了同样的问题,我确实花了一些时间才弄清楚我必须更改的设置是 Deployment Assembly 就像您在此处发布的屏幕截图一样。

关于spring - 无法让 WebApp 在 Eclipse 的 Tomcat 上初始化 [以前工作],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53543927/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com