6 Replies Latest reply on Nov 11, 2004 2:06 PM by vitaly1

    Can't load MBean as standard MLET? ZipException: error in op

    vitaly1

      Hi !
      I need to be able to load a simple JMX bean using standard MLET,
      defined by JMX spec, and not as JBoss service.
      So, I wrote a simple ps-jmx-service.mlet file, below, and put it into
      C:\jboss-4.0.0\server\default\deploy directory.
      The PSJmx.jar it has is placed into C:\jboss-4.0.0\server\default\lib directory.

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




      The JBoss does something weird - it picks up my jar, copies it into tmp/
      with the rest of deployable jars, names it as tmp31883PSJmx.jar.mlet
      So, I checked it is my jar only renamed with .mlet extension;
      Then it tries to deploy it and throws Zip exception:

      10:17:24,334 WARN [JARDeployer] Failed to add deployable jar: file:/C:/jboss-4.0.0/server/default/tmp/deploy/tmp31886p
      -jmx-service.mlet
      java.util.zip.ZipException: error in opening zip file
      at java.util.zip.ZipFile.open(Native Method)
      at java.util.zip.ZipFile.(ZipFile.java:112)
      at java.util.jar.JarFile.(JarFile.java:127)
      at java.util.jar.JarFile.(JarFile.java:65)
      at org.jboss.deployment.SubDeployerSupport.processNestedDeployments(SubDeployerSupport.java:245)
      at org.jboss.deployment.SubDeployerSupport.init(SubDeployerSupport.java:143)
      at org.jboss.deployment.MainDeployer.init(MainDeployer.java:799)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:736)
      ...

      I checked the jar - it is fine, java has no problem with it, Winzip also opens it no problem.

      Can anybody tell what could be the issue?

      Thanks a lot,
      -Vitaly

        • 1. Re: Can't load MBean as standard MLET? ZipException: error i
          dimitris

          The behaviour with the jar is normal, however, you cannot deploy .mlet files! In JBoss terms, you would need an MLET SubDeployer which doesn't exist currently (unless you want to write it), or you could deploy the mlet programmatically, by writing an application that uses the standard JMX API.

          But why you want to do this? It's very easy to just write an -service.xml descriptor that does the same with the MLET descriptor (and much more).

          • 2. Re: Can't load MBean as standard MLET? ZipException: error i
            vitaly1

            The reason I want standard MLET descriptor is that I want to be able
            to drop the same jar with MBeans onto JBoss Weblogic and Websphere
            Using JBoss service binds me to the JBoss API, which I can not do in my case., besides MLET is a standard thing that is defined by Sun's JMX spec..
            If JBoss is JMX copliant why then this basic service is not there?

            • 3. Re: Can't load MBean as standard MLET? ZipException: error i
              starksm64

              There is no spec defined mechanism for hot deployment of mlet files. This requires a programtic deployment using the standard jmx interfaces. This causes a chicken and egg problem as you need an app server specific startup mechanism.

              • 4. Re: Can't load MBean as standard MLET? ZipException: error i
                vitaly1

                Scott,

                I'm not sure what you mean by this?
                I do use pure JMX API to load my beans,
                something similar to JBoss's service config,
                only mine also supports JMS relations and more.

                I wanted to use MLET config to load my bootstrap bean, assuming that since MLET config is really a JMX spec thing it would then be supported by all JMX compliant app servers.

                -Vitaly

                • 5. Re: Can't load MBean as standard MLET? ZipException: error i
                  starksm64

                  Our deployers don't know what to do with a ps-jmx-service.mlet file since the jmx spec says nothing about how such a file should be loadable into a jmx server. You have to have a piece of code that registers the mlet via an MLET, which requires a piece of code to create the MLET, which requires a jboss startup service. So you need jboss to add an mlet deployer. Create an RFE on sourceforge.

                  • 6. Re: Can't load MBean as standard MLET? ZipException: error i
                    vitaly1

                    I understand now, the Sun's spec doesn't specify file naming convention for MLET and where it should be expected..
                    So, most likely Bea won't do it either.

                    Thanks
                    -Vitaly