0

web.xml :

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

    <!-- The definition of the Root Spring Container shared by all Servlets and Filters -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
        /WEB-INF/applicationContext.xml
        </param-value>
    </context-param>

    <!-- Creates the Spring Container shared by all Servlets and Filters -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!-- Processes application requests -->
    <servlet>
        <servlet-name>spring</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <filter>
        <filter-name>hiddenHttpMethodFilter</filter-name>
        <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>hiddenHttpMethodFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-app>

applicationContext.xml

    <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">
<context:property-placeholder properties-ref="deployProperties" />

    <!-- Activates various annotations to be detected in bean classes -->
    <context:annotation-config />

    <import resource="spring-social.xml" />

    <bean id="deployProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"
        p:location="/WEB-INF/spring.properties" />
</beans>

spring-servlet.xml

    <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:util="http://www.springframework.org/schema/util"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
        http://www.springframework.org/schema/util 
        http://www.springframework.org/schema/util/spring-util-3.1.xsd">


    <context:component-scan base-package="com.springsocial.fb.controller"></context:component-scan>

    <mvc:annotation-driven/>
        <mvc:resources location="/resources/**" mapping="/resources/" />

        <!-- REST -->
        <bean
            class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
            <property name="order" value="1" />
            <property name="contentNegotiationManager">
                <bean class="org.springframework.web.accept.ContentNegotiationManager">
                    <constructor-arg>
                        <bean
                            class="org.springframework.web.accept.PathExtensionContentNegotiationStrategy">
                            <constructor-arg>
                                <map>
                                    <entry key="json" value="application/json" />
                                    <entry key="xml" value="application/xml" />
                                </map>
                            </constructor-arg>
                        </bean>
                    </constructor-arg>
                </bean>
            </property>


            <property name="defaultViews">
                <list>
                    <!-- JSON View -->
                    <bean
                        class="org.springframework.web.servlet.view.json.MappingJacksonJsonView" />


                </list>
            </property>
        </bean>

        <!-- Resolves views selected for rendering by @Controllers to .jsp resources 
            in the /WEB-INF/views directory -->
        <bean
            class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="order" value="2" />
            <property name="prefix" value="/WEB-INF/views/" />
            <property name="suffix" value=".jsp" />
        </bean>




</beans>

(簡略化された) コントローラー:

package com.springsocial.fb.controller;

@Controller
@Scope("request")
@RequestMapping("/fb")
public class FacebookController {

    @Autowired
    private ConnectionRepository userConnectionRepository;

    @Autowired
    private FbConnectionHelper fbConnectionHelper;

    @Autowired
    private FbOperationsHelper fbOperationsHelper;

    @RequestMapping(value = "/profile/{providerUserId}/{facebookAccessToken}", method = RequestMethod.GET)
    public String getProfile(
            @PathVariable("facebookAccessToken") String facebookAccessToken,
            @PathVariable("providerUserId") String providerUserId, Model model) {
.....
    }

    @RequestMapping(value = "/friends/{providerUserId}/{facebookAccessToken}", method = RequestMethod.GET)
    public String getFriends(
            @PathVariable("facebookAccessToken") String facebookAccessToken,
            @PathVariable("providerUserId") String providerUserId, Model model) {

.......
    }

}

http://:8080/fb/の場合、 404 を取得しています:

Sep 18, 2013 5:35:22 PM com.springsource.tcserver.security.PropertyDecoder <init>
INFO: tc Runtime property decoder using memory-based key
Sep 18, 2013 5:35:22 PM com.springsource.tcserver.security.PropertyDecoder <init>
INFO: tcServer Runtime property decoder has been initialized in 249 ms
Sep 18, 2013 5:35:23 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Sep 18, 2013 5:35:23 PM com.springsource.tcserver.serviceability.rmi.JmxSocketListener init
INFO: Started up JMX registry on 127.0.0.1:6969 in 156 ms
Sep 18, 2013 5:35:23 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 815 ms
Sep 18, 2013 5:35:23 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 18, 2013 5:35:23 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: VMware vFabric tc Runtime 2.9.2.RELEASE/7.0.39.B.RELEASE
Sep 18, 2013 5:35:23 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor D:\Omkar\Development\Softwares\IDE\2013\springsource\vfabric-tc-server-developer-2.9.2.RELEASE\base-instance\conf\Catalina\localhost\fb.xml
Sep 18, 2013 5:35:23 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:FBScratchpad' did not find a matching property.
Sep 18, 2013 5:35:23 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\Omkar\Development\Softwares\IDE\2013\springsource\vfabric-tc-server-developer-2.9.2.RELEASE\base-instance\wtpwebapps\FBScratchpad\WEB-INF\lib\javaee-api-6.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Sep 18, 2013 5:35:23 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\Omkar\Development\Softwares\IDE\2013\springsource\vfabric-tc-server-developer-2.9.2.RELEASE\base-instance\wtpwebapps\FBScratchpad\WEB-INF\lib\javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Sep 18, 2013 5:35:23 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\Omkar\Development\Softwares\IDE\2013\springsource\vfabric-tc-server-developer-2.9.2.RELEASE\base-instance\wtpwebapps\FBScratchpad\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Sep 18, 2013 5:35:26 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: 
        http://java.sun.com/jsf/html
     is already defined
Sep 18, 2013 5:35:26 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsf/core is already defined
Sep 18, 2013 5:35:26 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://mojarra.dev.java.net/mojarra_ext is already defined
Sep 18, 2013 5:35:26 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Sep 18, 2013 5:35:26 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Sep 18, 2013 5:35:26 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Sep 18, 2013 5:35:26 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Wed Sep 18 17:35:26 IST 2013]; root of context hierarchy
Sep 18, 2013 5:35:26 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
Sep 18, 2013 5:35:26 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-social.xml]
Sep 18, 2013 5:35:27 PM org.springframework.core.io.support.PropertiesLoaderSupport loadProperties
INFO: Loading properties file from ServletContext resource [/WEB-INF/spring.properties]
Sep 18, 2013 5:35:27 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@e945ce: defining beans [org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,facebookController,mvcContentNegotiationManager,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.context.support.PropertySourcesPlaceholderConfigurer#1,connectionFactoryRegistry,textEncryptor,jdbcConnectionRepository,scopedTarget.userConnectionRepository,userConnectionRepository,org.springframework.social.connect.web.ConnectController#0,fbConnectionHelper,fbOperationsHelper,dataSource,deployProperties,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
Sep 18, 2013 5:35:27 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
INFO: Mapped "{[/fb/profile/{providerUserId}/{facebookAccessToken}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.springsocial.fb.controller.FacebookController.getProfile(java.lang.String,java.lang.String,org.springframework.ui.Model)
Sep 18, 2013 5:35:27 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
INFO: Mapped "{[/fb/friends/{providerUserId}/{facebookAccessToken}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.springsocial.fb.controller.FacebookController.getFriends(java.lang.String,java.lang.String,org.springframework.ui.Model)
Sep 18, 2013 5:35:27 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
INFO: Mapped "{[/connect/{providerId}],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.view.RedirectView org.springframework.social.connect.web.ConnectController.connect(java.lang.String,org.springframework.web.context.request.NativeWebRequest)
Sep 18, 2013 5:35:27 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
INFO: Mapped "{[/connect/{providerId}],methods=[DELETE],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.view.RedirectView org.springframework.social.connect.web.ConnectController.removeConnections(java.lang.String,org.springframework.web.context.request.NativeWebRequest)
Sep 18, 2013 5:35:27 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
INFO: Mapped "{[/connect/{providerId}/{providerUserId}],methods=[DELETE],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.view.RedirectView org.springframework.social.connect.web.ConnectController.removeConnection(java.lang.String,java.lang.String,org.springframework.web.context.request.NativeWebRequest)
Sep 18, 2013 5:35:27 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
INFO: Mapped "{[/connect/{providerId}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.springframework.social.connect.web.ConnectController.connectionStatus(java.lang.String,org.springframework.web.context.request.NativeWebRequest,org.springframework.ui.Model)
Sep 18, 2013 5:35:27 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
INFO: Mapped "{[/connect],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String org.springframework.social.connect.web.ConnectController.connectionStatus(org.springframework.web.context.request.NativeWebRequest,org.springframework.ui.Model)
Sep 18, 2013 5:35:27 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
INFO: Mapped "{[/connect/{providerId}],methods=[GET],params=[oauth_token],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.view.RedirectView org.springframework.social.connect.web.ConnectController.oauth1Callback(java.lang.String,org.springframework.web.context.request.NativeWebRequest)
Sep 18, 2013 5:35:27 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
INFO: Mapped "{[/connect/{providerId}],methods=[GET],params=[code],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.view.RedirectView org.springframework.social.connect.web.ConnectController.oauth2Callback(java.lang.String,org.springframework.web.context.request.NativeWebRequest)
Sep 18, 2013 5:35:27 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
INFO: Mapped URL path [/resources/] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
Sep 18, 2013 5:35:28 PM com.mchange.v2.log.MLog <clinit>
INFO: MLog clients using java 1.4+ standard logging.
Sep 18, 2013 5:35:28 PM com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
Sep 18, 2013 5:35:28 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 2063 ms
Sep 18, 2013 5:35:28 PM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.2.3 ( 20130905-1955 https://svn.java.net/svn/mojarra~svn/tags/2.2.3@12484) for context '/fb'
Sep 18, 2013 5:35:28 PM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present.  ManagedBeans methods marked with these annotations will have said annotations processed.
Sep 18, 2013 5:35:29 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor D:\Omkar\Development\Softwares\IDE\2013\springsource\vfabric-tc-server-developer-2.9.2.RELEASE\base-instance\conf\Catalina\localhost\SpringSocialScratchpad.xml
Sep 18, 2013 5:35:29 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SpringSocialScratchpad' did not find a matching property.
Sep 18, 2013 5:35:29 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\Omkar\Development\Softwares\IDE\2013\springsource\vfabric-tc-server-developer-2.9.2.RELEASE\base-instance\wtpwebapps\SpringSocialScratchpad\WEB-INF\lib\javaee-api-6.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Sep 18, 2013 5:35:29 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\Omkar\Development\Softwares\IDE\2013\springsource\vfabric-tc-server-developer-2.9.2.RELEASE\base-instance\wtpwebapps\SpringSocialScratchpad\WEB-INF\lib\javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Sep 18, 2013 5:35:29 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(D:\Omkar\Development\Softwares\IDE\2013\springsource\vfabric-tc-server-developer-2.9.2.RELEASE\base-instance\wtpwebapps\SpringSocialScratchpad\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Sep 18, 2013 5:35:30 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Sep 18, 2013 5:35:30 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class com.sun.faces.config.ConfigureListener
java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4823)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

Sep 18, 2013 5:35:30 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Sep 18, 2013 5:35:30 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Sep 18, 2013 5:35:30 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/SpringSocialScratchpad] startup failed due to previous errors
Sep 18, 2013 5:35:30 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Omkar\Development\Softwares\IDE\2013\springsource\vfabric-tc-server-developer-2.9.2.RELEASE\base-instance\webapps\manager
Sep 18, 2013 5:35:30 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Omkar\Development\Softwares\IDE\2013\springsource\vfabric-tc-server-developer-2.9.2.RELEASE\base-instance\webapps\ROOT
Sep 18, 2013 5:35:30 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Sep 18, 2013 5:35:30 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6781 ms
Sep 18, 2013 5:35:31 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'spring'
Sep 18, 2013 5:35:31 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'spring': initialization started
Sep 18, 2013 5:35:31 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'spring-servlet': startup date [Wed Sep 18 17:35:31 IST 2013]; parent: Root WebApplicationContext
Sep 18, 2013 5:35:31 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-servlet.xml]
Sep 18, 2013 5:35:31 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@19897e4: defining beans [org.springframework.web.servlet.view.ContentNegotiatingViewResolver#0,org.springframework.web.servlet.view.InternalResourceViewResolver#0]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@e945ce
Sep 18, 2013 5:35:31 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'spring': initialization completed in 109 ms
Sep 18, 2013 5:35:31 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/fb/] in DispatcherServlet with name 'spring'

java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListenerエラーは私の理解を超えていますが (JSF がどのように見えてくるのか??? javax.faces-2.2.3.jar を無駄に追加しました!)、私はコンテナーがコントローラーのパッケージをスキャンできない理由を理解できませんでした:

Sep 18, 2013 5:35:31 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/fb/] in DispatcherServlet with name 'spring'
4

1 に答える 1

0

あなたがする必要があるのはこれらを取ることです

<context:component-scan base-package="com.springsocial.fb"></context:component-scan>

アプリケーションのコンテキストから、より具体的にします。コントローラーパッケージは含まれていません。また、削除

<mvc:annotation-driven>
<mvc:resources location="/resources/**" mapping="/resources/" />

次に、追加する必要があります

<context:component-scan base-package="com.springsocial.fb.controller"></context:component-scan>
<mvc:annotation-driven>
<mvc:resources location="/resources/**" mapping="/resources/" />

あなたのサーブレットコンテキストに。

DispatcherServlet、コントローラー、ビュー、マッピングなどに関連するものはすべて、ルート アプリケーション コンテキストではなく、サーブレット コンテキストにある必要があります。

また、@Controllerインスタンスは、リクエスト スコープではなく、アプリケーション スコープにする必要があります。を取り外します@Scope("request")

于 2013-09-18T12:36:29.367 に答える