0 Replies Latest reply on Jun 7, 2014 2:10 PM by CHANDRA SEKHARREDDY

    Unable to read the bean-config.xml from inner jar of sar package

    CHANDRA SEKHARREDDY Newbie

      Please help me to fix the issue below - jboss-7.2.0.Final, While exposing an mbean from Jboss7 as below;

      ------- jboss-service.xml -------

      <?xml version="1.0" encoding="UTF-8"?>

      <server xmlns="urn:jboss:service:7.0"

            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

            xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">

          <mbean code="com.own.spring.JBossSpringDeployerService"

                 name="com.test:service=Test,type=Deployer">

              <attribute name="Resources">/bean-config.xml, /bean-infrastructure.xml</attribute>      

              <!--depends>jboss.jca:service=DataSourceBinding,name=MysqlDB</depends-->

          </mbean>

      </server>

       

      The files /bean-config.xml, /bean-infrastructure.xml were in inner jar bean-test.jar

      the folder structure of the sar package is as follows;

       

      bean-test-sar-1.0.sar

      -lib

           -bean-test.jar

                -com.test.bean.*.class

                -bean-config.xml

                -bean-infrastructure.xml

           -own-spring.jar

                -com.own.spring.JBossSpringDeployerService

           -*.jar

      -META-INF

           -jboss-service.xml

       

      Code which reads the bean-config.xml:

      context = new ClassPathXmlApplicationContext(paths); where paths[] = [bean-config.xml,bean-infrastructure.xml]

       

      Following error is occurring;

      [Server:server-one] 23:08:52,561 WARN  [com.own.spring.JBossSpringDeployerService] (MSC service thread 1-3) Starting failed com.test:service=Test,type=Deployer: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [bean-config.xml]; nested exception is java.io.FileNotFoundException: class path resource [bean-config.xml] cannot be opened because it does not exist

      [Server:server-one]     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)

      [Server:server-one]     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)

      [Server:server-one]     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

      [Server:server-one]     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

      [Server:server-one]     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)

      [Server:server-one]     at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)

      [Server:server-one]     at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)

      [Server:server-one]     at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80)

      [Server:server-one]     at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)

      [Server:server-one]     at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)

      [Server:server-one]     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)

      [Server:server-one]     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)

      [Server:server-one]     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)

      [Server:server-one]     at com.own.spring.JBossSpringDeployerService.startService(JBossSpringDeployerService.java:70)

      [Server:server-one]     at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:250)

      [Server:server-one]     at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:158)

      [Server:server-one]     at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:229)

      [Server:server-one]     at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:154)

      [Server:server-one]     at org.jboss.system.ServiceMBeanSupport.postRegister(ServiceMBeanSupport.java:364)

      [Server:server-one]     at com.sun.jmx.mbeanserver.MBeanSupport.postRegister(MBeanSupport.java:192) [rt.jar:1.6.0_16]

      [Server:server-one]     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postRegisterInvoke(DefaultMBeanServerInterceptor.java:1035) [rt.jar:1.6.0_16]

      [Server:server-one]     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:974) [rt.jar:1.6.0_16]

      [Server:server-one]     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917) [rt.jar:1.6.0_16]

      [Server:server-one]     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312) [rt.jar:1.6.0_16]

      [Server:server-one]     at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482) [rt.jar:1.6.0_16]

      [Server:server-one]     at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.registerMBean(PluggableMBeanServerImpl.java:551) [jboss-as-jmx-7.2.0.Final.jar:7.2.0.Final]

      [Server:server-one]     at org.jboss.as.jmx.PluggableMBeanServerImpl.registerMBean(PluggableMBeanServerImpl.java:319) [jboss-as-jmx-7.2.0.Final.jar:7.2.0.Final]

      [Server:server-one]     at org.jboss.as.jmx.MBeanRegistrationService.start(MBeanRegistrationService.java:95) [jboss-as-jmx-7.2.0.Final.jar:7.2.0.Final]

      [Server:server-one]     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA.jar:1.0.4.GA]

      [Server:server-one]     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA.jar:1.0.4.GA]

      [Server:server-one]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_16]

      [Server:server-one]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_16]

      [Server:server-one]     at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_16]

      [Server:server-one] Caused by: java.io.FileNotFoundException: class path resource [bean-config.xml] cannot be opened because it does not exist

      [Server:server-one]     at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143)

      [Server:server-one]     at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)

      [Server:server-one]     ... 32 more