无XML的Spring没有设置

时间:2013-08-05 17:21:34

标签: spring spring-mvc config

我以前在STS中运行过这个项目,但是我试图在Eclipse 4.2中复制它而没有运气。我正在运行与http://blog.codeleak.pl/2011/06/spring-31-mvc-xml-free-configuration-in.html所述相同的Spring XML-free基本设置。

我正在使用Eclipse 4.2中嵌入的maven 3和嵌入式tomcat 7。 当我在tomcat 7.0.12上启动项目时......

Aug 05, 2013 1:04:29 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Development\jdks\jdk1.7.0_25_x86\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Development/jdks/jdk1.7.0_25_x86/bin/../jre/bin/client;C:/Development/jdks/jdk1.7.0_25_x86/bin/../jre/bin;C:/Development/jdks/jdk1.7.0_25_x86/bin/../jre/lib/i386;C:\Development\jdks\jdk1.7.0_25_x86\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Dell\DW WLAN Card;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Dell\Dell Data Protection\Access\Advanced\Wave\Gemalto\Access Client\v5\;C:\Program Files (x86)\Security Innovation\SI TSS\bin\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Apache\apache-maven-3.0.5\bin;C:\Program Files (x86)\Git\cmd;C:\Development\eclipse-4.2_x86;;.
Aug 05, 2013 1:04:29 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:inst_tdcsim_server' did not find a matching property.
Aug 05, 2013 1:04:29 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Aug 05, 2013 1:04:29 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Aug 05, 2013 1:04:29 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 422 ms
Aug 05, 2013 1:04:29 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Aug 05, 2013 1:04:29 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Aug 05, 2013 1:04:29 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Aug 05, 2013 1:04:29 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Aug 05, 2013 1:04:29 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 259 ms

没有提到注册的映射,也没有URL工作,只有404s。

我尝试将Eclipse中的上下文根和Tomcat服务器xml更改为'/'并且也没有帮助。

我尝试在代码中设置调试点而没有任何停顿。 在我引入log4j之后,我尝试将所有日志记录设置为“ALL”,没有任何显示。 我尝试在onStartup方法的第一行创建一个明显的nullpointerexception,什么都没有。 这个春季应用程序如何回应我尝试做出的任何回应? 任何帮助都将非常感激。

1 个答案:

答案 0 :(得分:0)

该解决方案涉及Eclipse无法正确部署程序集。

转到项目的属性 - >部署组件 - >添加了“/ src / main / java”部署到“WEB-INF / classes”,然后它选择了我的初始化程序。不知道为什么不能开始这样做。