Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-379

Arquillian does not allow any configuration of OpenEJB

    Details

      Description

      The OpenEJBContainer in Arquillian only starts a couple basic services with OpenEJB without any configuration or addition of other services and resource adapters. Without Arquillian, one would use a jndi.properties file, for instance, and then create the initial context which would start OpenEJB with all of its configuration options. Without configuration, Arquillian tests cannot be used in real environments.

      As an example, consider the arquillian-samples/jpalab. When Maven is run with the default profile for OpenEJB and OpenJPA, the following log output is produced (excerpt with only OpenEJB startup lines):

      INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
      INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
      INFO - Configuring enterprise application: /tmp/b99ee272-36b3-4d8c-a76a-379064eb1d62/81778d28-0e83-44b5-aecc-ced777c397a6.jar
      INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container)
      INFO - Auto-creating a container for bean JavaPersistenceHelperBean: Container(type=STATELESS, id=Default Stateless Container)
      INFO - Configuring Service(id=Default Stateful Container, type=Container, provider-id=Default Stateful Container)
      INFO - Auto-creating a container for bean RepositoryBean: Container(type=STATEFUL, id=Default Stateful Container)
      INFO - Configuring PersistenceUnit(name=test)
      INFO - Configuring Service(id=Default JDBC Database, type=Resource, provider-id=Default JDBC Database)
      INFO - Auto-creating a Resource with id 'Default JDBC Database' of type 'DataSource for 'test'.
      INFO - Configuring Service(id=Default Unmanaged JDBC Database, type=Resource, provider-id=Default Unmanaged JDBC Database)
      INFO - Auto-creating a Resource with id 'Default Unmanaged JDBC Database' of type 'DataSource for 'test'.
      INFO - Adjusting PersistenceUnit test <jta-data-source> to Resource ID 'Default JDBC Database' from 'testDatabase'
      INFO - Adjusting PersistenceUnit test <non-jta-data-source> to Resource ID 'Default Unmanaged JDBC Database' from 'null'
      INFO - Enterprise application "/tmp/b99ee272-36b3-4d8c-a76a-379064eb1d62/81778d28-0e83-44b5-aecc-ced777c397a6.jar" loaded.
      INFO - Assembling app: /tmp/b99ee272-36b3-4d8c-a76a-379064eb1d62/81778d28-0e83-44b5-aecc-ced777c397a6.jar
      INFO - PersistenceUnit(name=test, provider=org.apache.openjpa.persistence.PersistenceProviderImpl)
      ERROR - JAVA AGENT NOT INSTALLED. The JPA Persistence Provider requested installation of a ClassFileTransformer which requires a JavaAgent. See http://openejb.apache.org/3.0/javaagent.html
      INFO - Jndi(name=JavaPersistenceHelperBeanLocal) --> Ejb(deployment-id=JavaPersistenceHelperBean)
      INFO - Jndi(name=RepositoryBeanLocal) --> Ejb(deployment-id=RepositoryBean)
      INFO - Created Ejb(deployment-id=JavaPersistenceHelperBean, ejb-name=JavaPersistenceHelperBean, container=Default Stateless Container)
      INFO - Created Ejb(deployment-id=RepositoryBean, ejb-name=RepositoryBean, container=Default Stateful Container)
      INFO - Deployed Application(path=/tmp/b99ee272-36b3-4d8c-a76a-379064eb1d62/81778d28-0e83-44b5-aecc-ced777c397a6.jar)

      The key items to look at is that only a "Default JDBC Database" data source and its unmanaged complement are created. There is no testDatabase data source being defined, as specified in the jndi.properties file. Also note that the persistence unit was automatically modified to point to the default data source since OpenEJB could not find any testDatabase source.

      I'll show what the log should look like shortly. I have this fixed already and in use on a project.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  dallen6 David Allen
                  Reporter:
                  dallen6 David Allen
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: