Announcement Announcement Module
Collapse
No announcement yet.
application_context.xml working with spring 2.0.2 but NOT with spring 2.0.4 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • application_context.xml working with spring 2.0.2 but NOT with spring 2.0.4

    Hello,

    i have just switched to spring 2.04 from spring 2.02 - and now my ClassPathXmlContext creation is failing - do I have to add something to the path? (in the moment i have spring-core, spring-context and spring-beans, which was enough until now...)
    I don't think its the groovy, ruby staff -
    thanx a lot in advance,

    2006-05-24 14:52:18,123 [main] INFO org.springframework.core.CollectionFactory - JDK 1.4+ collections available
    2006-05-24 14:52:18,185 [main] INFO org.springframework.core.CollectionFactory - Commons Collections 3.x available
    2006-05-24 14:52:18,185 [main] DEBUG org.springframework.core.CollectionFactory - Creating [java.util.LinkedHashMap]
    2006-05-24 14:52:18,263 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefin itionReader - Loading XML bean definitions from class path resource [spring/hoManager_context.xml]
    2006-05-24 14:52:18,295 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanDefin itionReader - Using JAXP provider [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@ 111a3a4]
    2006-05-24 14:52:18,717 [main] DEBUG org.springframework.beans.factory.xml.ResourceEnti tyResolver - Attempting to resolve DTD [http://www.springframework.org/dtd/spring-beans.dtd] using [org.springframework.beans.factory.xml.BeansDtdReso lver].
    2006-05-24 14:52:18,717 [main] DEBUG org.springframework.beans.factory.xml.BeansDtdReso lver - Trying to resolve XML entity with public ID [-//SPRING//DTD BEAN//EN] and system ID [http://www.springframework.org/dtd/spring-beans.dtd]
    2006-05-24 14:52:18,717 [main] DEBUG org.springframework.beans.factory.xml.BeansDtdReso lver - Trying to locate [spring-beans.dtd] in Spring jar
    2006-05-24 14:52:18,717 [main] DEBUG org.springframework.beans.factory.xml.BeansDtdReso lver - Found beans DTD [http://www.springframework.org/dtd/spring-beans.dtd] in classpath
    2006-05-24 14:52:18,779 [main] DEBUG org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser - Loading bean definitions

    2006-05-24 14:52:18,842 [main] DEBUG org.springframework.util.ClassUtils - Class [groovy.lang.GroovyObject] or one of its dependencies is not present
    java.lang.ClassNotFoundException: groovy.lang.GroovyObject

    xxxxxxxxxxx

    2006-05-24 14:52:18,873 [main] DEBUG
    org.springframework.util.ClassUtils - Class [org.jruby.IRuby] or one of its dependencies is not present
    java.lang.ClassNotFoundException: org.jruby.IRuby
    xxxxxxxxxxx

    2006-05-24 14:52:18,873 [main] DEBUG org.springframework.util.ClassUtils - Class [bsh.Interpreter] or one of its dependencies is not present
    java.lang.ClassNotFoundException: bsh.Interpreter
    xxxxxxxxxxx

    2006-05-24 14:52:18,920 [main] INFO
    org.springframework.beans.factory.xml.DefaultNames paceHandlerResolver - Ignoring handler [org.springframework.web.servlet.config.MvcNamespac eHandler]: class not found
    Exception in thread "main" java.lang.AbstractMethodError
    at org.springframework.beans.factory.xml.DefaultNames paceHandlerResolver.initHandlerMappings(DefaultNam espaceHandlerResolver.java:119)
    at org.springframework.beans.factory.xml.DefaultNames paceHandlerResolver.<init>(DefaultNamespaceHandler Resolver.java:84)
    at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.createNamespaceHandlerResolver( DefaultXmlBeanDefinitionParser.java:126)
    at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.createHelper(DefaultXmlBeanDefi nitionParser.java:92)
    at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.registerBeanDefinitions(Default XmlBeanDefinitionParser.java:84)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:509)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:353)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:302)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:277)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:129)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:145)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:171)
    at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:116)
    at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:82)
    at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:89)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:279)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:92)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:77)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:68)
    at com.siemens.md.hoManager.ContextTester.main(Contex tTester.java:37)

  • #2
    This is only debug output and indicates no error. As others already found that to be disturbing, the stacktrace logging will be removed in RC1.

    Regards,
    Andreas

    Comment


    • #3
      Hello,

      but my testprogram terminates with an error and the application context
      object is not created.
      So there has to be a difference to the 2.02 version...

      Exception in thread "main" java.lang.AbstractMethodError
      at org.springframework.beans.factory.xml.DefaultNames paceHandlerResolver.initHandlerMappings(DefaultNam espaceHandlerResolver.java:119)
      at org.springframework.beans.factory.xml.DefaultNames paceHandlerResolver.<init>(DefaultNamespaceHandler Resolver.java:84)
      at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.createNamespaceHandlerResolver( DefaultXmlBeanDefinitionParser.java:126)
      at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.createHelper(DefaultXmlBeanDefi nitionParser.java:92)
      at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.registerBeanDefinitions(Default XmlBeanDefinitionParser.java:84)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:509)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:353)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:302)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:277)
      at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:129)
      at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:145)
      at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:171)
      at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:116)
      at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:82)
      at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:89)
      at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:279)
      at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:92)
      at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:77)
      at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:68)
      at com.siemens.md.hoManager.ContextTester.main(Contex tTester.java:37)

      Comment


      • #4
        I think some things related to namespace schemas have changed - please see the changelog for more info.

        Comment


        • #5
          Similar Issue cleared by adding to class path

          As far as I can see this error is cause by items missing from the class path.

          The exception should be caught and reports as an inconsistency in the configuration file with some attempt at identifying the missing modules.

          In my case the following file cause the following exception until I added spring-jdbc to the class path.

          cheers


          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
          "http://www.springframework.org/dtd/spring-beans.dtd">

          <beans>

          <!-- AOP Advisor -->
          <bean id="userSecurityInterceptor" class="org.springframework.aop.support.RegexpMetho dPointcutAdvisor">
          <property name="advice" ref="userSecurityAdvice"/>
          <property name="patterns">
          <list>
          <value>.*saveUser</value>
          </list>
          </property>
          </bean>

          <!-- Advice Class -->
          <bean id="userSecurityAdvice" class="com.silverbrookresearch.qaco.supervisor.mod ules.service.UserSecurityAdvice">
          <property name="userCache" ref="userCache"/>
          </bean>

          <bean id="userManager" class="com.silverbrookresearch.qaco.supervisor.mod ules.service.impl.UserManagerImpl"/>

          <bean id="target" class="org.springframework.aop.framework.ProxyFact oryBean">
          <property name="proxyInterfaces" value="com.silverbrookresearch.qaco.supervisor.mod ules.service.UserManager"/>
          <property name="interceptorNames">
          <list>
          <idref local="userSecurityInterceptor"/>
          <idref local="userManager"/>
          </list>
          </property>
          </bean>

          <bean id="userCache" class="org.acegisecurity.providers.dao.cache.EhCac heBasedUserCache">
          <property name="cache">
          <bean class="org.springframework.cache.ehcache.EhCacheFa ctoryBean">
          <property name="cacheManager">
          <bean class="org.springframework.cache.ehcache.EhCacheMa nagerFactoryBean"/>
          </property>
          <property name="cacheName" value="userCache"/>
          </bean>
          </property>
          </bean>
          </beans>

          <error type="java.lang.AbstractMethodError" message="org.springframework.jndi.config.JndiNames paceHandler.init()V">java.lang.AbstractMethodError : org.springframework.jndi.config.JndiNamespaceHandl er.init()V
          at org.springframework.beans.factory.xml.DefaultNames paceHandlerResolver.initHandlerMappings(DefaultNam espaceHandlerResolver.java:119)
          at org.springframework.beans.factory.xml.DefaultNames paceHandlerResolver.&lt;init&gt;(DefaultNamespaceH andlerResolver.java:84)
          at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.createNamespaceHandlerResolver( DefaultXmlBeanDefinitionParser.java:126)
          at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.createHelper(DefaultXmlBeanDefi nitionParser.java:92)
          at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.registerBeanDefinitions(Default XmlBeanDefinitionParser.java:84)
          at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:509)
          at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:353)
          at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:302)
          at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:277)
          at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:129)
          at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:145)
          at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:113)
          at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:81)
          at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:89)
          at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:279)
          at org.springframework.context.support.ClassPathXmlAp plicationContext.&lt;init&gt;(ClassPathXmlApplicat ionContext.java:87)
          at org.springframework.context.support.ClassPathXmlAp plicationContext.&lt;init&gt;(ClassPathXmlApplicat ionContext.java:72)
          at org.springframework.test.AbstractSpringContextTest s.loadContextLocations(AbstractSpringContextTests. java:135)
          at org.springframework.test.AbstractDependencyInjecti onSpringContextTests.loadContextLocations(Abstract DependencyInjectionSpringContextTests.java:224)
          at org.springframework.test.AbstractSpringContextTest s.getContext(AbstractSpringContextTests.java:115)
          at org.springframework.test.AbstractDependencyInjecti onSpringContextTests.setUp(AbstractDependencyInjec tionSpringContextTests.java:192)
          at junit.framework.TestCase.runBare(TestCase.java:125 )
          at junit.framework.TestResult$1.protect(TestResult.ja va:106)

          Comment


          • #6
            Hello again,

            after putting everything on the classpath, I still get the same error.
            I even changed from dtd to schema in my context xml - no change.
            I looked at the code - but this is not really helping me either.
            (the namespaceHandler.init() method throws the exception)
            Probably somebody else can link the exception from above to the code..

            Thanx in advance for any help...

            Code:
            /**
            	 * Load the namespace URI -> <code>NamespaceHandler</code> class mappings from the configured
            	 * mapping file. Converts the class names into actual class instances and checks that
            	 * they implement the <code>NamespaceHandler</code> interface. Pre-instantiates an instance
            	 * of each <code>NamespaceHandler</code> and maps that instance to the corresponding
            	 * namespace URI.
            	 */
            	private void initHandlerMappings() {
            		Properties mappings = loadMappings();
            		this.handlerMappings = new HashMap(mappings.size());
            		for (Enumeration en = mappings.propertyNames(); en.hasMoreElements();) {
            			String namespaceUri = (String) en.nextElement();
            			String className = mappings.getProperty(namespaceUri);
            			try {
            				Class handlerClass = ClassUtils.forName(className);
            				if (!NamespaceHandler.class.isAssignableFrom(handlerClass)) {
            					throw new IllegalArgumentException("Class [" + className +
            							"] does not implement the NamespaceHandler interface");
            				}
            				NamespaceHandler namespaceHandler = (NamespaceHandler) BeanUtils.instantiateClass(handlerClass);
            				namespaceHandler.init();
            				this.handlerMappings.put(namespaceUri, namespaceHandler);
            			}
            			catch (ClassNotFoundException ex) {
            				if (logger.isInfoEnabled()) {
            					logger.info("Ignoring handler [" + className + "]: class not found");
            				}
            			}
            		}
            	}

            Comment

            Working...
            X