users@glassfish.java.net

Packaging of "Custom MBean" which utilizes JPA

From: <glassfish_at_javadesktop.org>
Date: Sun, 04 Nov 2007 23:16:47 PST

Hello,

  I would like to provide a handful of custom MBeans that perform CRUD operations on an underlying RDBMS via JMX MBean operations. These MBeans would be deployed as an independent jar file and the MBean implementation class would utilize a container managed JNDI Datasource where the transaction type is "RESOURCE_LOCAL".

  I'm able to access the MBean in a J2SE environment and in the Glassfish J2EE environment via a WAR file w/ the following persistence.xml:

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence persistence_1_0.xsd"
             version="1.0">

    <persistence-unit name="foo" transaction-type="RESOURCE_LOCAL">
        <provider>oracle.toplink.essentials.PersistenceProvider</provider>

        <non-jta-data-source>jdbc/FooDB</non-jta-data-source>

        <jar-file>./foo-model.jar</jar-file>
        <class>org.bar.bop.Foo</class>

        <properties>
            <property name="toplink.logging.level" value="FINE"/>
            <property name="toplink.logging.exceptions" value="true"/>
        </properties>

    </persistence-unit>
</persistence>

  But I would really like the Mbean and associated Entity classes to be self-contained and deployed as a Custom MBean. Does anyone know how to package and configure such an MBean/JPA component?

Thanks,
John
[Message sent by forum member 'da3m0npr0c3ss' (da3m0npr0c3ss)]

http://forums.java.net/jive/thread.jspa?messageID=243757