9 Replies Latest reply on Feb 5, 2010 5:41 AM by Luca Molteni

    Deploying Solr 1.3 in JBoss 5

    Luca Molteni Newbie

      Hello list,

       

      I'm having some problem deploying solr to JBoss 5 EAP (5.1).

       

      The problem is with environment variables:

       

      Following this page of the wiki:  http://wiki.apache.org/solr/SolrJBoss

       

      I've added to the web.xml of WEB-INF of solr

       

      <env-entry>
        <env-entry-name>solr/home</env-entry-name>
        <env-entry-type>java.lang.String</env-entry-type>
        <env-entry-value>${solr.home.myhome}</env-entry-value>
      </env-entry>

       

      Since I'm using lots of instances of solr in the same container.

       

      This variable should be expanded by jboss itself in a path using
      properties-services.xml:

       

         <attribute name="Properties">
               solr.home.myhome=C:/mypath/solr
         </attribute>

       

      Unfortunately, during deployment of the solr application, it gives me
      this error:

       

      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse
      source: The content of element type "env-entry" must match
      "(description?,env-entry-name,env-entry-value?,env-entry-type)". @
      vfsfile:/C:/pathtojboss/server/solrrepo/deploy/Solrrepo/solr-mysolr.war/WEB-INF/web.xml[146,14]
             at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)


             ... 33 more
      Caused by: org.xml.sax.SAXException: The content of element type
      "env-entry" must match
      "(description?,env-entry-name,env-entry-value?,env-entry-type)". @
      vfsfile:/C:/pathtojboss/server/solrrepo/deploy/Solrrepo/solr-mysolr.war/WEB-INF/web.xml[146,14]
             at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$MetaDataErrorHandler.error(SaxJBossXBParser.java:426)

       


      Notice that the same .war and properties-services.xml works flawlessly
      in JBoss 4.2.3

       

      Any ideas?

       

      Thank you very much.

       

      This message was crossposted from solr-user mailing list.

      L.M.

        • 1. Re: Deploying Solr 1.3 in JBoss 5
          Luca Molteni Newbie

          I've moved the file xml like this

           

          <env-entry>
            <env-entry-name>solr/home</env-entry-name>

            <env-entry-value>${solr.home.myhome}</env-entry-value>
            <env-entry-type>java.lang.String</env-entry-type>
          </env-entry>

           

          To match the error description and it worked. Amazing. I've never realized that the order of the

          elements in XML is significant, nice to see.

           

          As always, problems leads to other problems, so now I'm facing with a
          Xerces ClassCastException with JDK 6.

           

          org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser
                 at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100)
                 at org.jboss.web.tomcat.service.deployers.JBossContextConfig.processContextConfig(JBossContextConfig.java:549)
                 at org.jboss.web.tomcat.service.deployers.JBossContextConfig.init(JBossContextConfig.java:536)
                 at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279)
                 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
                 at org.apache.catalina.core.StandardContext.init(StandardContext.java:5436)
                 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4148)
                 at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
                 at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
                 at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
                 at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
                 at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:597)
                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
                 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                 at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                 at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                 at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
                 at $Proxy38.start(Unknown Source)
                 at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
                 at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
                 at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                 at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                 at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                 at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                 at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:297)
                 at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1633)
                 at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:935)
                 at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1083)
                 at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:985)
                 at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:823)
                 at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                 at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
                 at org.jboss.system.ServiceController.start(ServiceController.java:460)
                 at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
                 at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
                 at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
                 at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
                 at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
                 at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
                 at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1440)
                 at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1158)
                 at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1179)
                 at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1099)
                 at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                 at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1633)
                 at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:935)
                 at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1083)
                 at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:985)
                 at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:823)
                 at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                 at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:782)
                 at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
                 at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
                 at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
                 at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
                 at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403)
                 at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                 at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1633)
                 at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:935)
                 at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1083)
                 at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:985)
                 at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:775)
                 at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
                 at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308)
                 at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256)
                 at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
                 at org.jboss.Main.boot(Main.java:221)
                 at org.jboss.Main$1.run(Main.java:556)
                 at java.lang.Thread.run(Thread.java:619)
          Caused by: org.jboss.xb.binding.JBossXBException: Failed to create a
          new SAX parser
                 at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:97)
                 at org.jboss.xb.binding.UnmarshallerImpl.<init>(UnmarshallerImpl.java:56)
                 at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:96)
                 ... 73 more
          Caused by: java.lang.ClassCastException:
          org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be
          cast to org.apache.xerces.xni.parser.XMLParserConfiguration

           


          It seems I'm not not the only one in the web, but I'm still working on it.

          • 2. Re: Deploying Solr 1.3 in JBoss 5
            jaikiran pai Master

            volothamp wrote:

             


            Caused by: org.jboss.xb.binding.JBossXBException: Failed to create a
            new SAX parser
                   at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:97)
                   at org.jboss.xb.binding.UnmarshallerImpl.<init>(UnmarshallerImpl.java:56)
                   at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:96)
                   ... 73 more
            Caused by: java.lang.ClassCastException:
            org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be
            cast to org.apache.xerces.xni.parser.XMLParserConfiguration

             


            Are you packaging any xml, xerces jar files in your application? It is a known bug in AS-5 where deployment containing such jar files run into exception. See this for details http://community.jboss.org/wiki/WhydoigetjavalangClassCastExceptionorgapachexercesparsersXIncludeAwareParserConfigurationinAS-5

            • 3. Re: Deploying Solr 1.3 in JBoss 5
              Luca Molteni Newbie

              Yes I am, Solr is shipped with its own xerces jar.

               

              Thank you very much.

              • 4. Re: Deploying Solr 1.3 in JBoss 5
                Luca Molteni Newbie
                What If I can't remove the xerces jar from the war distro?
                • 5. Re: Deploying Solr 1.3 in JBoss 5
                  jaikiran pai Master

                  volothamp wrote:

                   

                  What If I can't remove the xerces jar from the war distro?

                  Then you will have to build JBoss AS-5 from a tag and apply a bug fix patch or you can wait for JBoss AS-6.0.0.M2 (which is scheduled for this month http://lists.jboss.org/pipermail/jboss-development/2010-February/015696.html ), which has the fix for https://jira.jboss.org/jira/browse/JBAS-7210

                  • 6. Re: Deploying Solr 1.3 in JBoss 5
                    Luca Molteni Newbie
                    Thank you very much. You were very helpful.
                    • 7. Re: Deploying Solr 1.3 in JBoss 5
                      jaikiran pai Master

                      volothamp wrote:

                       

                      Hello list,

                       

                      I'm having some problem deploying solr to JBoss 5 EAP (5.1).

                       

                      Ah wait! You are using the EAP version, which means that it's supported. If you are a paid customer then they already have a patch for this issue. You will have to get in touch with the support team.

                      • 8. Re: Deploying Solr 1.3 in JBoss 5
                        Luca Molteni Newbie

                        FYI:

                         

                        The name of the patch is JBPAPP-3236

                         

                        Thank you again.

                        • 9. Re: Deploying Solr 1.3 in JBoss 5
                          Luca Molteni Newbie

                          By the way, I finally solved it.

                           

                          To deploy solr 1.3 in jboss 5, you simply have to remove

                           

                          xercesImpl-2.8.1.jar
                          xml-apis-1.3.03.jar

                           

                          From the WEB-INF/lib folder of solr.war

                           

                          Solr will use the lib provided by jboss 5.

                           

                          The reason why it didn't work before is because I removed only the xercesImpl jar.

                           

                          Thank you again.