1 2 Previous Next 18 Replies Latest reply on Jun 13, 2005 11:16 AM by nobel

    Broken XMBean persistence with 1.5 and org.jboss.mx.persiste

    hennejg

      If I try to persist an XMBean using the org.jboss.mx.persistence.ObjectStreamPersistenceManager under Java 5.0 and JBoss 3.2.7, I get lots of exceptions of this kind:

      java.io.FileNotFoundException: file:\C:\workspace\jboss-3.2.7\server\ceptix\data\xmbean-attrs\NFSServer.xml (Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch)
      at java.io.FileOutputStream.open(Native Method)
      at java.io.FileOutputStream.(FileOutputStream.java:179)
      at java.io.FileOutputStream.(FileOutputStream.java:70)
      at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:235)
      at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:278)
      at org.jboss.system.pm.XMLAttributePersistenceManager.outputXmlFile(XMLAttributePersistenceManager.java:758)
      at org.jboss.system.pm.XMLAttributePersistenceManager.store(XMLAttributePersistenceManager.java:332)
      at org.jboss.mx.persistence.DelegatingPersistenceManager.store(DelegatingPersistenceManager.java:187)
      at org.jboss.mx.modelmbean.ModelMBeanInvoker.store(ModelMBeanInvoker.java:330)
      at org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInterceptor.java:89)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:84)
      at org.jboss.mx.server.AbstractMBeanInvoker.setAttribute(AbstractMBeanInvoker.java:416)
      at org.jboss.mx.server.MBeanServerImpl.setAttribute(MBeanServerImpl.java:455)
      at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:567)
      at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:275)
      at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:163)
      at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:117)
      at org.jboss.system.ServiceController.install(ServiceController.java:199)
      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:585)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:198)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy4.install(Unknown Source)
      at org.jboss.deployment.SARDeployer.create(SARDeployer.java:204)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:783)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:640)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
      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:585)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
      ...

      Please note the "file:/"-prefix of the path given in the exception message.
      The problem seems to be that for some strange reason, xalan behaves differently on 1.5. XMLAttributePersistenceManager.outputXmlFile(XMLAttributePersistenceManager.java:758) calls xformer.transform with a StreamResult into which it passed a perfectly Ok looking File-instance. The TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:235) lateron calls the FileOutputStream(String) constructor with the path mangled in a way such that it has the "file:/"-prefix causing the constructor to fail.

      Do you have any ideas? I did not trace into Xalan, but I suppose it does something with the File, which suffers from a semantic change in 1.5.

      Joerg Henne

        • 1. Re: Broken XMBean persistence with 1.5 and org.jboss.mx.pers
          dimitris

          I just fixed that for 4.0.2:

          http://wiki.jboss.org/wiki/Wiki.jsp?page=WhyMyPersistentMBeanFailsToRedeployOnJBossV4.0.2

          But I thought it was working ok with 3.2.7?

          • 2. Re: Broken XMBean persistence with 1.5 and org.jboss.mx.pers
            dimitris

            I just checked and it works for me on 3.2.7, i.e. deploy the example at

            docs/examples/jmx/persistent-service.sar

            • 3. Re: Broken XMBean persistence with 1.5 and org.jboss.mx.pers
              hennejg

              Strange. It doesn't work for me.

              This test was using:
              - a stock JBoss 3.2.7, virgin "default" server, except for the deployed example
              - JDK 1.5.0_03
              - XP

              java.io.FileNotFoundException: file:\C:\workspace\jboss-3.2.7\server\default\data\xmbean-attrs\jboss.jmx@3Aservice@3DPersistentServiceExample.xml (Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch)
              at java.io.FileOutputStream.open(Native Method)
              at java.io.FileOutputStream.(FileOutputStream.java:179)
              at java.io.FileOutputStream.(FileOutputStream.java:70)
              at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:235)
              at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:278)
              at org.jboss.system.pm.XMLAttributePersistenceManager.outputXmlFile(XMLAttributePersistenceManager.java:758)
              at org.jboss.system.pm.XMLAttributePersistenceManager.store(XMLAttributePersistenceManager.java:332)
              at org.jboss.mx.persistence.DelegatingPersistenceManager.store(DelegatingPersistenceManager.java:187)
              at org.jboss.mx.modelmbean.ModelMBeanInvoker.store(ModelMBeanInvoker.java:330)
              at org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInterceptor.java:89)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:84)

              Is there anything I can do to help you debug this?

              Thanks
              Joerg Henne

              • 4. Re: Broken XMBean persistence with 1.5 and org.jboss.mx.pers
                hennejg

                As an afterthought and to clarify: as you can see in the stack trace, this time I tested with the example.

                • 5. Re: Broken XMBean persistence with 1.5 and org.jboss.mx.pers
                  dimitris

                  with a slightly older jdk, it still works for me:

                  stock 3.2.7
                  jdk 1.5.0-b64
                  XP

                  Try to see what is going on in the log. Look for entries from:

                  XMLAttributePersistenceManager
                  DelegatingPersistenceManager

                  • 6. Re: Broken XMBean persistence with 1.5 and org.jboss.mx.pers

                    Hi FYI,

                    I am now using with success the lastest jboss-common.jar and mymbean are now persistent. However, another problem appear. In the jmx-console, I cannot view bean that are on the form bli@122123, where @122123 seems to be a memory address. I have two driven message beans that have jndi name finishing with '@1871212' and that I cannot access through the jmx console.

                    I don't understand why their jndi name is ending by @1123 anyways, as it is now impossible to use a depency (jndi-name) within mbean and ejb.

                    Nicolas

                    • 7. Re: Broken XMBean persistence with 1.5 and org.jboss.mx.pers
                      starksm64
                      • 8. Re: Broken XMBean persistence with 1.5 and org.jboss.mx.pers

                        Wouldn't that be better to use the archive (jar) name then? How can I use dependency now? I would like also to be able to retrieve the MBean associated with the MDB. Is that still possible? I am trying to use the local-jndi-name but I still need to lookup for the bean after. How can I get access to the MBean associated to the MDB? How do you solve the depency problem ( has to refer to an MBean)?

                        Thanks,

                        Nicolas

                        • 9. Re: Broken XMBean persistence with 1.5 and org.jboss.mx.pers
                          starksm64

                          Use local-jndi-name and there is no @nnnnnn

                          The jar name has no guarentee of uniqueness, it can be contained in an ear.

                          • 10. Re: Broken XMBean persistence with 1.5 and org.jboss.mx.pers

                            I am trying using the loca-jndi-name. It does not work at all:

                            my ejb-jar.xml contains something like:

                             <ejb-local-ref >
                             <ejb-ref-name>ejb/Stage1EventBatchReceiverMDB</ejb-ref-name>
                             <ejb-ref-type>Message Driven</ejb-ref-type>
                             <local-home>something.message.Stage1EventBatchReceiverMDBLocalHome</local-home>
                             <local>something.message.Stage1EventBatchReceiverMDBLocal</local>
                             <ejb-link>Stage1EventBatchReceiverMDB</ejb-link>
                             </ejb-local-ref>
                            


                            I have to reference it from the jboss.xml but how?? Reading the jboss_4_0.dtd, for message driven bean only ejb-ref are allowed and not ejb-local-ref. There is apparently no way to get rid of the @nnnn?

                            If you have a solution, please enlight me.

                            Thanks,

                            Nicolas

                            • 11. Re: Broken XMBean persistence with 1.5 and org.jboss.mx.pers

                              It turns out that I had to add a <local-jndi-name> in the jboss.xml. (as Scott kindly mentioned). However, reading the jboss_4_0.dtd this tag is not allowed, it's why I did not quite understand. So now I have the following:

                               <message-driven>
                               <ejb-name>Stage1EventBatchReceiverMDB</ejb-name>
                               <destination-jndi-name>queue/trigger/Stage1EventBatchQueue</destination-jndi-name>
                               <configuration-name>Singleton Message Driven Bean</configuration-name>
                               <local-jndi-name>ejb/local/trigger/Stage1EventBatchReceiver</local-jndi-name>
                               </message-driven>
                              


                              and I have no more @nnn. However, it is not valid according to the DTD! (and the local-jndi-name tag is not supported by xdoclet for MDB).

                              Nicolas

                              • 12. Re: Broken XMBean persistence with 1.5 and org.jboss.mx.pers
                                nobel

                                if I run jboss from inside eclipse 3.0 using the jboss ide 141, jdk1.5.0_02 and jboss 327 i get a number of XMBean related FileNotFoundExceptions. however if i fire up jboss 327 with jdk1.5.0_02 from the command line instead it works.

                                /nobel

                                • 13. Re: Broken XMBean persistence with 1.5 and org.jboss.mx.pers
                                  dimitris

                                  Yes, this is known (and patched). Look in the JMX FAQ at the bottom:

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

                                  • 14. Re: Broken XMBean persistence with 1.5 and org.jboss.mx.pers
                                    nobel

                                    well, i have tried to patch jboss-3.2.7/lib/jboss-common.jar as suggested. starting up jboss from the command line using jdk1.5.0_02. jboss won't start. stacktrace below. something wrong with the jar file? /nobel

                                    Caused by: java.lang.reflect.UndeclaredThrowableException
                                    at org.jboss.system.ServiceCreator.install(ServiceCreator.java:202)
                                    at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:152)
                                    at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:117)
                                    ... 35 more
                                    Caused by: java.lang.VerifyError: (class: org/jboss/invocation/pooled/server/PooledInvoker, method: loadCustomSocketFact
                                    ories signature: ()V) Bad type in putfield/putstatic
                                    at java.lang.Class.getDeclaredConstructors0(Native Method)
                                    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
                                    at java.lang.Class.getConstructor0(Class.java:2640)
                                    at java.lang.Class.getConstructor(Class.java:1629)
                                    at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:870)
                                    at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:290)
                                    at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:317)
                                    at org.jboss.system.ServiceCreator.install(ServiceCreator.java:124)
                                    ... 37 more
                                    14:48:11,296 INFO [Server] JBoss SHUTDOWN: Undeploying all packages

                                    1 2 Previous Next