Announcement Announcement Module
Collapse
No announcement yet.
<context:annotation-config/> issues Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • <context:annotation-config/> issues

    Hi

    I tried to add this annotation tag on my xml for my Spring MVC Portlet and it fails to load my portlet. However when i removed it, my portlet loaded successfully with no issues. Is there any jars that i need?

    mycontroller.xml
    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
    
    
    
    <context:annotation-config/>
    
    ...


    pom.xml
    Code:
    <!-- Spring Dependencies -->
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring</artifactId>
    			<version>2.5.5</version>
    		</dependency>
    
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-webmvc-portlet</artifactId>
    			<version>2.5.5</version>
    		</dependency>
    	
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-test</artifactId>
    			<version>2.5.5</version>
    			<scope>test</scope>
    		</dependency>

  • #2
    Posting a stacktrace would clarify some things. In general it should work.

    Comment


    • #3
      Hi Marten,

      Still seems to fail when I added this line:

      Code:
      <context:annotation-config/>
      Here are the log generated:

      Code:
      2010-03-27 15:28:22,888 INFO [org.springframework.web.portlet.DispatcherPortlet] - <Initializing portlet 'Add Product'>
      2010-03-27 15:28:22,889 INFO [org.springframework.web.portlet.DispatcherPortlet] - <FrameworkPortlet 'Add Product': initialization started>
      2010-03-27 15:28:22,889 DEBUG [org.springframework.web.portlet.DispatcherPortlet] - <Portlet with name 'Add Product' will try to create custom ApplicationContext context of class 'org.springframework.web.portlet.context.XmlPortletApplicationContext', using parent context [[email protected]635421: display name [Root WebApplicationContext]; startup date [Sat Mar 27 15:14:33 EST 2010]; root of context hierarchy]>
      2010-03-27 15:28:22,889 INFO [org.springframework.web.portlet.context.XmlPortletApplicationContext] - <Refreshing org.springframework.web.portlet.context.XmlPortletApplicationContext@169751d: display name [PortletApplicationContext for namespace 'Add Product-portlet']; startup date [Sat Mar 27 15:28:22 EST 2010]; parent: [email protected]635421>
      2010-03-27 15:28:22,889 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loading XML bean definitions from PortletContext resource [/WEB-INF/context/portlet/products/addProduct.xml]>
      2010-03-27 15:28:22,891 DEBUG [org.springframework.beans.factory.xml.DefaultDocumentLoader] - <Using JAXP provider [weblogic.xml.jaxp.RegistryDocumentBuilderFactory]>
      2010-03-27 15:28:22,892 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - <Loading schema mappings from [META-INF/spring.schemas]>
      2010-03-27 15:28:22,893 DEBUG





      Originally posted by Marten Deinum View Post
      Posting a stacktrace would clarify some things. In general it should work.

      Comment


      • #4
        Con't of the logs


        Code:
        [org.springframework.beans.factory.xml.PluggableSchemaResolver] - <Loaded schema mappings: {http://www.springframework.org/schema/lang/spring-lang-2.5.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd, http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd, http://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd, http://www.springframework.org/schema/jms/spring-jms-2.5.xsd=org/springframework/jms/config/spring-jms-2.5.xsd, http://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-2.5.xsd, http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-2.5.xsd, http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd, http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd, http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd, http://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd, http://www.springframework.org/schema/jms/spring-jms.xsd=org/springframework/jms/config/spring-jms-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd, http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd, http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd, http://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee-2.5.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd, http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd}>
        2010-03-27 15:28:22,893 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - <Found XML schema [http://www.springframework.org/schema/beans/spring-beans-2.5.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-2.5.xsd>
        2010-03-27 15:28:22,912 DEBUG [org.springframework.beans.factory.xml.PluggableSchemaResolver] - <Found XML schema [http://www.springframework.org/schema/context/spring-context-2.5.xsd] in classpath: org/springframework/context/config/spring-context-2.5.xsd>
        2010-03-27 15:28:22,919 DEBUG [org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader] - <Loading bean definitions>
        2010-03-27 15:28:22,923 DEBUG [org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver] - <Loaded mappings [{http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler, http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler, http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler, http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler, http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler, http://www.springframework.org/schema/jms=org.springframework.jms.config.JmsNamespaceHandler, http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler, http://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler}]>
        2010-03-27 15:28:22,923 DEBUG [org.springframework.beans.factory.xml.BeanDefinitionParserDelegate] - <Neither XML 'id' nor 'name' specified - using generated bean name [org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping#0]>
        2010-03-27 15:28:22,924 DEBUG [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - <Loaded 8 bean definitions from location pattern [/WEB-INF/context/portlet/products/addProduct.xml]>
        2010-03-27 15:28:22,924 INFO [org.springframework.web.portlet.context.XmlPortletApplicationContext] - <Bean factory for application context [org.springframework.web.portlet.context.XmlPortletApplicationContext@169751d]: org.springframework.beans.factory.support.DefaultListableBeanFactory@c16f66>
        2010-03-27 15:28:22,924 DEBUG [org.springframework.web.portlet.context.XmlPortletApplicationContext] - <8 beans defined in org.[email protected]169751d: display name [PortletApplicationContext for namespace 'Add Product-portlet']; startup date [Sat Mar 27 15:28:22 EST 2010]; parent: [email protected]635421>
        2010-03-27 15:28:22,925 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Creating shared instance of singleton bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor'>
        2010-03-27 15:28:22,925 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Creating instance of bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor'>
        2010-03-27 15:28:22,925 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Eagerly caching bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor' to allow for resolving potential circular references>
        2010-03-27 15:28:22,925 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Finished creating instance of bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor'>
        2010-03-27 15:28:22,925 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'>
        2010-03-27 15:28:22,925 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Creating instance of bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'>
        2010-03-27 15:28:22,926 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Eagerly caching bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor' to allow for resolving potential circular references>
        2010-03-27 15:28:22,926 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Finished creating instance of bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'>
        2010-03-27 15:28:22,926 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'>
        2010-03-27 15:28:22,926 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Creating instance of bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'>
        2010-03-27 15:28:22,926 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Eagerly caching bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor' to allow for resolving potential circular references>
        2010-03-27 15:28:22,926 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Finished creating instance of bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'>
        2010-03-27 15:28:22,926 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Creating shared instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'>
        2010-03-27 15:28:22,927 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Creating instance of bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'>
        2010-03-27 15:28:22,927 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Eagerly caching bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor' to allow for resolving potential circular references>
        2010-03-27 15:28:22,927 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Finished creating instance of bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'>

        Comment


        • #5
          Sorry about this .. seem like I can only post 10k line each time.

          Code:
          2010-03-27 15:28:22,927 DEBUG [org.springframework.web.portlet.context.XmlPortletApplicationContext] - <Unable to locate MessageSource with name 'messageSource': using default [[email protected]7]>
          2010-03-27 15:28:22,927 DEBUG [org.springframework.web.portlet.context.XmlPortletApplicationContext] - <Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@114ba77]>
          2010-03-27 15:28:22,927 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@c16f66: defining beans [org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,addProductController,org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping#0,productValidator,defaultExceptionHandler]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@12164ea>
          2010-03-27 15:28:22,927 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Returning cached instance of singleton bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor'>
          2010-03-27 15:28:22,927 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Returning cached instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'>
          2010-03-27 15:28:22,927 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Returning cached instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'>
          2010-03-27 15:28:22,927 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Returning cached instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'>
          2010-03-27 15:28:22,927 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Creating shared instance of singleton bean 'addProductController'>
          2010-03-27 15:28:22,927 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Creating instance of bean 'addProductController'>

          Comment


          • #6
            There is currently nothing indicating an error, if you get a 404 there must be either an error stating that the application didn't start or an error that there is nothing to handle the request.

            Simply zip your log file and attach it to a post.

            Comment

            Working...
            X