2 Replies Latest reply on Jan 25, 2008 4:17 AM by annegret

    Exception deploying spring beans in JBoss 5

    annegret

      Hi,

      I'm trying to deploy a war-archieve containing spring-beans into JBoss5.0.0Beta3 and get

      JBossXBRuntimeException: Failed to resolve schema nsURI=http://www.springframework.org/schema/beans location=http://www.springframework.org/schema/beans/spring-beans.xsd


      2008-01-22 14:49:53,695 DEBUG [org.jboss.deployers.vfs.deployer.kernel.BeanDeployer] Error during deploy: vfsfile:/C:/Tools/jboss-5.0.0.Beta3/server/pantherupm/deploy/um.war/
      org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfsfile:/C:/Tools/jboss-5.0.0.Beta3/server/pantherupm/deploy/um.war/
       at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:232)
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:199)
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:162)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:245)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:131)
       at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:408)
       at org.jboss.Main.boot(Main.java:208)
       at org.jboss.Main$1.run(Main.java:534)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to resolve schema nsURI=http://www.springframework.org/schema/beans location=http://www.springframework.org/schema/beans/spring-beans.xsd
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:193)
       at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:153)
       at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:120)
       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:112)
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:225)
       ... 20 more
      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to resolve schema nsURI=http://www.springframework.org/schema/beans location=http://www.springframework.org/schema/beans/spring-beans.xsd
       at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:309)
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:407)
       at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
       at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
       at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
       at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
       at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
       at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:189)
       ... 24 more
      


      The war contains the class files of the spring beans in WEB-INF/classes and the configuration files spring-beans.xml in WEB-INF directly,
      spring.jar is available in WEB-INF/lib (I tried also to extract spring.jar to WEB-INF/classes)

      spring-beans.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:tx="http://www.springframework.org/schema/tx"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/tx
       http://www.springframework.org/schema/tx/spring-tx.xsd
       http://www.springframework.org/schema/aop
       http://www.springframework.org/schema/aop/spring-aop.xsd">
      
       <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
      
      <snip>
      
      </beans>
      
      




      The same archieve is deployed successfully in jboss4.2.2GA.
      Java version is 1.5.0_11.

      I know the deployment changed much from jboss4 to jboss5. Which change may cause this error ?

      Any idea/hint how to get the war running in JBoss5 ?

      Annegret

        • 1. Re: Exception deploying spring beans in JBoss 5
          annegret

          Hi,

          some more info:

          it seems that the file spring.schema can not be found which contains the translation of the URL http://www.springframework.org/scheman/beans/spring-beans.xsd to the local location org/springframework/beans/factory/xml/spring-beans-2.5.xsd

          JBoss gets a ConnectionTimeout that means it tries to resolve the URL instead of searching the xsd-file locally in the classpath.

          spring.schema is located in um.war/WEB-INF/lib/spring.jar, but I copied it also to the conf-directory (still the same error)

          Anybody has any suggestion ?

          The war file does not contain a jboss-web.xml, maybe I can try some jboss configuration issues ?

          Annegret

          • 2. Re: Exception deploying spring beans in JBoss 5
            annegret

            Hi,

            solved it :-).

            The spring configuration file located in mywar.war/WEB-INF was named spring-beans.xml. Renaming it to spring-config.xml did the trick. The file must not be named anything ending with -beans.xml.

            I assume that JBoss 5 evaluates a file named *-beans.xml as microcontainer beans which surely does not work for a srping beans configuration file.

            Annegret