GVKun编程网logo

在类路径上未检测到Spring WebApplicationInitializer类型(在类路径或引导路径中找不到程序包java.lang)

15

对于在类路径上未检测到SpringWebApplicationInitializer类型感兴趣的读者,本文将提供您所需要的所有信息,我们将详细讲解在类路径或引导路径中找不到程序包java.lang,并

对于在类路径上未检测到Spring WebApplicationInitializer类型感兴趣的读者,本文将提供您所需要的所有信息,我们将详细讲解在类路径或引导路径中找不到程序包java.lang,并且为您提供关于"No Spring WebApplicationInitializer types detected on classpath" 一种解决方案、INFO:在类路径上未检测到Spring WebApplicationInitializer类型、INFO:在类路径(jre 1.8)上未检测到Spring WebApplicationInitializer类型、Initializing Spring root WebApplicationContext的宝贵知识。

本文目录一览:

在类路径上未检测到Spring WebApplicationInitializer类型(在类路径或引导路径中找不到程序包java.lang)

在类路径上未检测到Spring WebApplicationInitializer类型(在类路径或引导路径中找不到程序包java.lang)

我的Eclipse项目突然不再正确部署。我无法追溯到我对环境所做的任何特定更改。

我已经测试了多个源代码控制的项目,它们的行为方式都相同:

May 01, 2013 12:00:45 PM org.apache.catalina.core.AprLifecycleListener initINFO: 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   (x86)\Java\jdk1.7.0_11\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\NVIDIA     Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows \System32\WindowsPowerShell\v1.0\;.May 01, 2013 12:00:45 PM org.apache.tomcat.util.digester.SetPropertiesRule beginWARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ''source'' to ''org.eclipse.jst.jee.server:fismacm'' did not find a matching property.May 01, 2013 12:00:45 PM org.apache.coyote.AbstractProtocol initINFO: Initializing ProtocolHandler ["http-bio-8080"]May 01, 2013 12:00:45 PM org.apache.coyote.AbstractProtocol initINFO: Initializing ProtocolHandler ["ajp-bio-8009"]May 01, 2013 12:00:45 PM org.apache.catalina.startup.Catalina loadINFO: Initialization processed in 296 msMay 01, 2013 12:00:45 PM org.apache.catalina.core.StandardService startInternalINFO: Starting service CatalinaMay 01, 2013 12:00:45 PM org.apache.catalina.core.StandardEngine startInternalINFO: Starting Servlet Engine: Apache Tomcat/7.0.35May 01, 2013 12:00:46 PM org.apache.catalina.core.ApplicationContext logINFO: No Spring WebApplicationInitializer types detected on classpathMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/core is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://www.springframework.org/tags/form is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://www.springframework.org/tags is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.startup.TaglibUriRule bodyINFO: TLD skipped. URI: http://www.springframework.org/security/tags is already definedMay 01, 2013 12:00:48 PM org.apache.catalina.core.ApplicationContext logINFO: No Spring WebApplicationInitializer types detected on classpathMay 01, 2013 12:00:48 PM org.apache.catalina.core.ApplicationContext logINFO: No Spring WebApplicationInitializer types detected on classpathMay 01, 2013 12:00:48 PM org.apache.catalina.core.ApplicationContext logINFO: Set web app root system property: ''webapp.root'' =     [X:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\fismacm\]May 01, 2013 12:00:48 PM org.apache.catalina.core.ApplicationContext logINFO: Initializing log4j from [X:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\fismacm\WEB-    INF\log4j.properties]May 01, 2013 12:00:48 PM org.apache.catalina.core.ApplicationContext logINFO: Initializing Spring root WebApplicationContextSLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".SLF4J: Defaulting to no-operation (NOP) logger implementationSLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.May 01, 2013 12:00:49 PM org.apache.coyote.AbstractProtocol startINFO: Starting ProtocolHandler ["http-bio-8080"]May 01, 2013 12:00:49 PM org.apache.coyote.AbstractProtocol startINFO: Starting ProtocolHandler ["ajp-bio-8009"]May 01, 2013 12:00:49 PM org.apache.catalina.startup.Catalina startINFO: Server startup in 3898 ms

这似乎是关键组件:INFO:在类路径上未检测到Spring WebApplicationInitializer类型。

我试过清理项目,重新定义服务器,甚至创建全新的工作区。我显然已经错过了分数。

任何对此清理的提示将不胜感激。

答案1

小编典典

原来这是一个愚蠢的错误。我的log4j未配置为捕获我的错误输出。我在后台抛出配置错误,一旦修复了这些错误,我就很好了,我的请求映射也可以正常工作。

"No Spring WebApplicationInitializer types detected on classpath" 一种解决方案

1.运行环境:

    idea2017.2

    maven3.5.0

    tomcat7.0插件

    maven多模块项目

2.当基础配置搭建完成测试的时候,启动tomcat,发现程序一直卡在

No Spring WebApplicationInitializer types detected on classpath
log4j:WARN No appenders could be found for logger (dao.hsqlmanager).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

    我以为是"No Spring WebApplicationInitializer types detected on classpath" 的原因,网上的大部分解决方法无效,后来发现log4j没有配置,配置之后发现是我的其他地方出错,但没有被log4j显示出来,所以一直卡在这里。

解决方案:

    配置log4j,让错误信息显示出来,解决出错的地方,然后就可以正常运行了,但"No Spring WebApplicationInitializer types detected on classpath" 是什么呢?

这是一个可以忽略的警告,意思是在classpath下面没有检测到自定义配置的spring配置。

 

 

INFO:在类路径上未检测到Spring WebApplicationInitializer类型

INFO:在类路径上未检测到Spring WebApplicationInitializer类型

如何解决INFO:在类路径上未检测到Spring WebApplicationInitializer类型?

我发现了错误:我有一个库是使用jdk 1.6构建的。Spring主控制器和组件在此库中。以及我如何使用jdk 1.7,它找不到1.6内置的类。

该解决方案全部使用“编译器符合性级别:1.7”和“生成的.class文件兼容性:1.6”,“源兼容性:1.6”来构建。

我在Eclipse中设置了此选项:Preferences \ Java \ Compiler。

谢谢大家。

解决方法

当我从eclipse部署时,我有一个spring项目在我的tomcat7服务器上运行良好:运行方式>>在服务器上运行。在eclipse标签的“服务器”中,我看到:

Servers
 Tomcat v7.0 Server at localhost [Started,Synchronized]
   my_project [Synchronized]
     spring-web-3.2.4-RELEASE.jar

我的项目:

  • 不使用web.xml,我使用javaconf @批注。
  • 不使用Maven,我使用用户库

我看到该项目在:

/srv/applications/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0

而且,我还看到以下文件夹:conf,logs,temp,webapps,work,wtpwebapps

我确认当我从eclipse部署时,所有内容都可以在tomcat7服务器上正常运行!

在Eclipse控制台中,我得到:

Apr 08,2014 3:26:59 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ''source'' to ''org.eclipse.jst.j2ee.server:my_project'' did not find a matching property.
Apr 08,2014 3:27:00 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8888"]
Apr 08,2014 3:27:00 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8843"]
Apr 08,2014 3:27:01 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 3215 ms
Apr 08,2014 3:27:01 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 08,2014 3:27:01 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
Apr 08,2014 3:27:11 PM org.apache.catalina.core.ApplicationContext log
INFO: Spring WebApplicationInitializers detected on classpath: [my_project.web.context.WebApplicationInitializer@3599e94c]
Apr 08,2014 3:27:12 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Apr 08,2014 3:27:24 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet ''dispatcher''
Apr 08,2014 3:27:24 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8888"]
Apr 08,2014 3:27:24 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8843"]
Apr 08,2014 3:27:24 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 23821 ms

现在:问题是当我在同一tomcat7服务器/ var / lib / tomcat7 / webapps中部署同一应用程序(使用文件.war)时

我可以在没有数据的情况下打开我的初始页面Web BUT,

我在日志中看到:

INFO: No Spring WebApplicationInitializer types detected on classpath

当我重新启动tomcat7时,我进入了日志文件:

INFO: Destroying ProtocolHandler ["http-bio-8843"]
Apr 8,2014 3:25:30 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ''source'' to ''org.eclipse.jst.j2ee.server:my_project'' did not find a matching property.
Apr 8,2014 3:25:30 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8888"]
Apr 8,2014 3:25:31 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8843"]
Apr 8,2014 3:25:31 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1664 ms
Apr 8,2014 3:25:31 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 8,2014 3:25:31 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
Apr 8,2014 3:25:38 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8888"]
Apr 8,2014 3:25:38 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8843"]
Apr 8,2014 3:25:38 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7576 ms

INFO:在类路径(jre 1.8)上未检测到Spring WebApplicationInitializer类型

INFO:在类路径(jre 1.8)上未检测到Spring WebApplicationInitializer类型

我从腻子收到此错误消息:

错误:在类路径上未检测到Spring WebApplicationInitializer类型。

当我使用Eclipse和Maven部署WAR文件时。现在,我正在使用jre
1.8和tomcat版本7。我检查了编译器,其版本为1.8。这个问题有什么解决办法吗?我还自动启用了选项构建。

这些是我从腻子得到的错误消息

2017年1月17日17:50:03.587信息[主]
org.apache.coyote.AbstractProtocol.init初始化ProtocolHandler [“ http-nio-9485”]

2017年1月17日17:50:11.982信息[ruthhere.cafe24.com-startStop-1]
org.apache.jasper.servlet.TldScanner.scanJars至少扫描了一个JAR来查找TLD,但其中没有TLD。为该记录器启用调试日志记录,以获取已扫描的JAR的完整列表,但未在其中找到TLD。在扫描过程中跳过不需要的JAR可以缩短启动时间和JSP编译时间。

2017年1月17日17:50:11.989信息[ruthhere.cafe24.com-startStop-1]
org.apache.catalina.core.ApplicationContext.log在类路径上未检测到Spring
WebApplicationInitializer类型

答案1

小编典典

我刚刚解决了这个问题。我一直收到此错误的原因是因为我拥有的Java版本和eclipse项目属性中的Java版本不匹配。首先,我检查了我拥有的Java版本。比打开pom.xml并更改Java版本,以便它可以与Java版本匹配。

<java-version>1.7</java-version>

另外,我检查了window> properties> project facets并更改了Java版本。

Initializing Spring root WebApplicationContext

Initializing Spring root WebApplicationContext

出差去云南的同事,重新把项目上传到了 svn,让我下载新项目并提交代码。一切弄好之后,不知道怎么在启动 Tomcat 时一直在 Initializing Spring root WebApplicationContext 这句卡住,等了 450 秒还是没有反应。在网上搜索 tomcat 一直起不来,搜到的答案五花八门,后来搜索这句英文后找到个答案可能是数据库 IP 或端口更换了的问题。

看了之后,果然同事把他们云南的数据库的配置提交上来了。于是换成我本地的数据库后,Tomcat 正常启动。。

关于在类路径上未检测到Spring WebApplicationInitializer类型在类路径或引导路径中找不到程序包java.lang的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于"No Spring WebApplicationInitializer types detected on classpath" 一种解决方案、INFO:在类路径上未检测到Spring WebApplicationInitializer类型、INFO:在类路径(jre 1.8)上未检测到Spring WebApplicationInitializer类型、Initializing Spring root WebApplicationContext等相关内容,可以在本站寻找。

本文标签: