9 Replies Latest reply on Feb 11, 2009 1:28 PM by alesj

    jar inside sar is not deployed, jboss5

      i hav a sar with structure like this :

      myApp.sar
      - lib
      - axis.jar
      - another1.sar
      - META-INF
      - my-ds.xml
      - another2.sar
      - another3.sar

      now it gives me an exception ClassNotFound with class which resides in axis.jar, but if i keep this jar in default/lib then it doesnt give me this exception. do i hav to keep all jars in default/lib folder?

      as seen from structure above i hav my-ds.xml inside another1.sar which is kept inside myApp.sar which i have kept in default/deploy folder. now i have my-ds.xml in deploy folder also with regular oracle configuration. the one inside sar has two mbeans :

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

      <datasources>
      <mbean code="org.jboss.mq.server.jmx.Queue"
      name="jboss.mq.destination:service=Queue,name=notifier@router">
      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
      </mbean>

      <mbean code="org.jboss.mq.server.jmx.Queue"
      name="jboss.mq.destination:service=Queue,name=notificationsender@router">
      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
      </mbean>

      </datasources>


      now without myApp.sar in deploy server starts without any exceptions. all my jms tables are created in oracle db. but after deploying myApp.sar it gives me this exception :

      14:27:25,912 WARN [AbstractDeploymentContext] Unable to register deployment mbean vfszip:/D:/jboss5/server/default/deploy/10CoreFramework.sar/50Notification.sar/nu-ds.xml
      javax.management.InstanceAlreadyExistsException: jboss.deployment:id="vfszip:/D:/jboss5/server/default/deploy/10CoreFramework.sar/50Notification.sar/nu-ds.xml",type=SubDeployment already registered.
      at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)
      at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:236)
      at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
      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.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1426)
      at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:376)
      at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.registerMBeans(AbstractDeploymentContext.java:989)
      at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.registerMBeans(AbstractDeploymentContext.java:998)
      at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.registerMBeans(AbstractDeploymentContext.java:998)
      at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.postRegister(AbstractDeploymentContext.java:964)
      at org.jboss.mx.server.AbstractMBeanInvoker.invokePostRegister(AbstractMBeanInvoker.java:974)
      at org.jboss.mx.server.AbstractMBeanInvoker.postRegister(AbstractMBeanInvoker.java:681)
      at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:338)
      at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
      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.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1426)
      at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:376)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.registerMBean(DeployersImpl.java:1602)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:755)
      at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
      at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
      at org.jboss.Main.boot(Main.java:209)
      at org.jboss.Main$1.run(Main.java:547)
      at java.lang.Thread.run(Thread.java:619)


      so how can i redeploy my-ds.xml second time with jms queue mbeans. it used to work fine with 4.0.2.

        • 1. Re: jar inside sar is not deployed, jboss5

           

          myApp.sar
          - lib
          - axis.jar
          - another1.sar
          - META-INF
          - my-ds.xml
          - another2.sar
          - another3.sar


          <?xml version="1.0" encoding="UTF-8"?>
          
          <datasources>
           <mbean code="org.jboss.mq.server.jmx.Queue"
           name="jboss.mq.destination:service=Queue,name=notifier@nurouter">
           <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
           </mbean>
          
           <mbean code="org.jboss.mq.server.jmx.Queue"
           name="jboss.mq.destination:service=Queue,name=notificationsender@nurouter">
           <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
           </mbean>
          
          </datasources>



          • 2. Re: jar inside sar is not deployed, jboss5

            sorry for posting again but it was not showing it properly...

            myApp.sar
            -lib
            --axis.jar
            -another1.sar
            --META-INF
            --my-ds.xml
            -another2.sar
            -another3.sar

            • 3. Re: jar inside sar is not deployed, jboss5
              jaikiran

               

              14:27:25,912 WARN [AbstractDeploymentContext] Unable to register deployment mbean vfszip:/D:/jboss5/server/default/deploy/10CoreFramework.sar/50Notification.sar/nu-ds.xml
              javax.management.InstanceAlreadyExistsException: jboss.deployment:id="vfszip:/D:/jboss5/server/default/deploy/10CoreFramework.sar


              Some other users too have reported this. http://www.jboss.org/index.html?module=bb&op=viewtopic&t=149531 The WARN appears when the -ds.xml or *-service.xml file is placed at the root of the archive. Move the -ds.xml to .sar/META-INF folder instead.

              By the way, a -ds.xml file is meant for datasources and not queue definitions. So rename it to something-service.xml and change the contents to something like

              <?xml version="1.0" encoding="UTF-8"?>
              
              <server>
               <mbean code="org.jboss.mq.server.jmx.Queue"
               name="jboss.mq.destination:service=Queue,name=notifier@nurouter">
               <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
               </mbean>
              
               <mbean code="org.jboss.mq.server.jmx.Queue"
               name="jboss.mq.destination:service=Queue,name=notificationsender@nurouter">
               <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
               </mbean>
              
              </server>
              


              • 4. Re: jar inside sar is not deployed, jboss5
                alesj

                 

                "abhinav.ind" wrote:

                now it gives me an exception ClassNotFound with class which resides in axis.jar, but if i keep this jar in default/lib then it doesnt give me this exception.

                This .sar's lib directory was an old 4.x sar notion.
                New 5.x or MC doesn't consider .sar's lib as classpath by default.

                You can either
                - move axis.jar to root
                - add jboss-structure.xml to describe sar's structure
                - enable DirectoryStructure (performance hit)

                "abhinav.ind" wrote:

                do i hav to keep all jars in default/lib folder?

                No, none of them.
                default/lib or common/lib is a place for more general libs, not user libs.
                e.g. classes/libs that change some core jbossas behavior

                • 5. Re: jar inside sar is not deployed, jboss5
                  alesj

                   

                  "jaikiran" wrote:

                  Some other users too have reported this. http://www.jboss.org/index.html?module=bb&op=viewtopic&t=149531 The WARN appears when the -ds.xml or *-service.xml file is placed at the root of the archive. Move the -ds.xml to .sar/META-INF folder instead.

                  This is the reason:

                  -service.xml or -ds.xml in root is treated as sub-deployment - via FileStructure.
                  It's metadata location is the file itself.
                  And this metadata location generates component.
                  All are registered into MBeanServer.
                  But since these are all the same file, hence duplicate registration.

                  But if you place the file in some META-INF (or any other metadata location),
                  this is treated as just component, not also as a sub-deployment.

                  ;-)

                  • 6. Re: jar inside sar is not deployed, jboss5
                    jaikiran

                     

                    "alesj" wrote:
                    This is the reason: ...


                    Thanks :)

                    • 7. Re: jar inside sar is not deployed, jboss5

                      thanks guys, it resolved my issues...

                      • 8. Re: jar inside sar is not deployed, jboss5
                        wolfgangknauf

                        Ales,

                        This is the reason:

                        -service.xml or -ds.xml in root is treated as sub-deployment - via FileStructure.
                        It's metadata location is the file itself.
                        And this metadata location generates component.
                        All are registered into MBeanServer.
                        But since these are all the same file, hence duplicate registration.


                        Shouldn't this be reported as an error by jboss, as it results in a logged exception and is some invalid situation?

                        Thanks

                        Wolfgang

                        • 9. Re: jar inside sar is not deployed, jboss5
                          alesj

                          Actually guys, I got it wrong. :-(

                          Thinking about it more, I saw that component couldn't be the cause.
                          The dev post is here to follow-up:
                          - http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4209189#4209189