相关疑难解决方法(0)

在类路径上没有检测到Spring WebApplicationInitializer类型

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

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

May 01, 2013 12:00:45 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:\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 begin
WARNING: [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 init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
May 01, 2013 12:00:45 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
May …
Run Code Online (Sandbox Code Playgroud)

model-view-controller spring tomcat servlets spring-mvc

17
推荐指数
4
解决办法
11万
查看次数

带Jetty的AbstractAnnotationConfigDispatcherServletInitializer

我正在使用Jetty 9.1.0.RC2和Spring 4.有一个AbstractAnnotationConfigDispatcherServletInitializer并尝试启动初始化:

Server server = new Server();

WebAppContext webAppContext = new WebAppContext();
webAppContext.setContextPath("/");
webAppContext.setConfigurations(new Configuration[] { new AnnotationConfiguration() });
webAppContext.setParentLoaderPriority(true);

webAppContext.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern", ".*/target/classes/.*");

server.setHandler(webAppContext);
server.start();
server.join();
Run Code Online (Sandbox Code Playgroud)

但未能发现:

No Spring WebApplicationInitializer types detected on classpath
Run Code Online (Sandbox Code Playgroud)

java spring spring-mvc embedded-jetty

9
推荐指数
1
解决办法
1395
查看次数

WAS 8.5.5.2:在类路径上没有检测到spring webapplicationinitializer类型

我有一个spring mvc项目.我正在尝试在IBM Websphere 8.5.5.2上部署此项目

我为项目构建了一个战争,并使用管理控制台将其部署在Websphere上

我正在使用基于Java的配置.我正在使用AbstractAnnotationConfigDispatcherServletInitializer和WebMvcConfigurerAdapter类进行配置.

但是当我部署应用程序时,我基于控制台获得以下内容: 在类路径上没有检测到Spring Webapplicationinitializer类型

并且不会触发弹簧初始化.

我的代码如下

@EnableWebMvc
@Configuration
@ComponentScan({ "com.demo" })
public class SpringWebConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
    }

    @Bean
    public InternalResourceViewResolver viewResolver() {
        InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
        viewResolver.setViewClass(JstlView.class);
        viewResolver.setPrefix("/WEB-INF/jsp/");
        viewResolver.setSuffix(".jsp");
        return viewResolver;
    }

}
Run Code Online (Sandbox Code Playgroud)
public class MyWebInitializer extends
        AbstractAnnotationConfigDispatcherServletInitializer {

    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[] { };
    }

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

    @Override
    protected Class<?>[] getRootConfigClasses() …
Run Code Online (Sandbox Code Playgroud)

spring spring-mvc websphere-8

5
推荐指数
1
解决办法
772
查看次数