8 Replies Latest reply on May 23, 2006 7:12 PM by Sergiu Bivol

    user-service.xml

    Claus Kerpen Newbie

      Hi,

      I do need a template of user-service.xml. It is not part of jboss4.0.1.zip, although it is referenced in chapter 2.4.2 in the official documentation. How can I get it ?

      I would like to deploy a Standard MBean into JBoss, which is independent of JBoss Services. The documentation tells me I just have to add an appropriate mbean tag in .../deploy/user-service.xml. But there is neither the xml file nor the dtd (schema).

      Hope, somebody can help me soon. Thanks.

        • 1. Re: user-service.xml
          Dimitris Andreadis Master

          user-service.xml is just an example. Create any file of yours, just name it xxx-service.xml, and put in there your xml.

          • 2. Re: user-service.xml
            Claus Kerpen Newbie

            Thanks, but I don't even know the tags I have to use, because I don't have a dtd or xml schema.

            Anyway, my user-service.xml looks like the following:

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





            The problem I still have is the following:
            The MBean com.regenwetter.Test is deployed within an ear-File (named test.ear). Therefore I do get a ClassNotFoundException because the classloader is not able to load the MBean com.regenwetter.Test. Hence I used the classpath tag:






            But of course the classloader is still not able to load the MBean com.regenwetter.Test, because the MBean is located in an jar file (named test.jar) within the ear file. Everything is working fine, if I extract the ear-File and write something like:






            But we are not allowed to extract the ear-File. In addtion to that I don't want to create a separate sar directory and put the jar File into that, because I have to provide the jar file twice in this case. So, what can I do or what is the best way to go respectively ?




            • 3. Re: user-service.xml
              Claus Kerpen Newbie

              Sorry, I used the wrong format. Therefore a second trial:

              Thanks, but I don't even know the tags I have to use, because I don't have a dtd or xml schema.

              Anyway, my user-service.xml looks like the following:

              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE server>
              
              <server>
              <mbean code="com.regenwetter.Test" name="regenwetter:service=Test">
              </mbean>
              </server>
              


              The problem I still have is the following:
              The MBean com.regenwetter.Test is deployed within an ear-File (named test.ear). Therefore I do get a ClassNotFoundException because the classloader is not able to load the MBean com.regenwetter.Test. Hence I used the classpath tag:

              <server>
              <classpath codebase="deploy" archives="test.ear"/>
              <mbean code="com.regenwetter.Test" name="regenwetter:service=Test">
              </mbean>
              </server>
              


              But the classloader is still not able to load the MBean com.regenwetter.Test, because the MBean is located in an jar file (named test.jar) within the ear file. Everything is working fine, if I extract the ear-File and write something like:

              <server>
              <classpath codebase="deploy/test.ear" archives="test.jar"/>
              <mbean code="com.regenwetter.Test" name="regenwetter:service=Test">
              </mbean>
              </server>
              


              But we are not allowed to extract the ear-File. In addtion to that I don't want to create a separate sar directory and put the jar File into that, because I have to provide the jar file twice in this case. So, what can I do or what is the best way to go respectively ?


              • 4. Re: user-service.xml
                Dimitris Andreadis Master

                Ok, make a .sar with a META-INF/jboss-service.xml with your descriptor.

                Put the .sar inside the .ear, or deploy the .sar separately.

                Or put the shared classes inside a third .jar and deploy it seperately.

                Read the wikis!

                http://www.jboss.org/wiki/Wiki.jsp?page=FAQJBossJMX
                http://www.jboss.org/wiki/Wiki.jsp?page=ExampleHelloWorldService

                • 5. Re: user-service.xml
                  Claus Kerpen Newbie

                  I have already read the wikis. The ExampleHelloWorldService Example doesn't reference other jar files and none of the FAQJBossJMX questions cover my special problem.

                  If I put the sar file into the ear file, the MBean disappears. It is no longer visible on the jmx console. In addition to that no log message appears so that I'm not able to guess what actually has happened.

                  I already described in my last posting what has happened if I deploy the sar file separately. Everything is working fine if I extract the ear file, otherwise it fails.

                  Lastly, I can't put the shared classes into a separate jar file because they reference other classes which have to be deployed separately.

                  I'm sorry to bother you, but I still don't know how I can solve my problem.

                  • 6. Re: user-service.xml
                    Dimitris Andreadis Master

                    I think you need to explicitly specify it in the .ear jboss-app.xml descriptor when you embed the .sar:

                     <module>
                     <service>external.sar</service>
                     </module>
                    


                    • 7. Re: user-service.xml
                      Claus Kerpen Newbie

                      Oh yes, I forgot this. Thanks a lot. Now it works :)

                      • 8. Re: user-service.xml
                        Sergiu Bivol Newbie

                         

                        "regenwetter" wrote:
                        Oh yes, I forgot this. Thanks a lot. Now it works :)


                        I have a similar case, but the ear's classloader is configured as follows:
                        <jboss-app>
                        <loader-repository>
                        com.example:loader=example.ear
                        <loader-repository-config>
                        java2ParentDelegaton=false
                        </loader-repository-config>
                        </loader-repository>

                        example.sar


                        </jboss-app>

                        The service (which is packaged in the ear) cannot load the home interface classes of the dependent ejb (ClassNotFound exception).

                        Anyone knows if it can work at all in this configuration? Tested on 4.0.4GA.

                        Thanks in advance.