blob: a3584536ec694d5425db77c833d7a6ed942feac2 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Apache TomEE</title>
<meta name="description"
content="Apache TomEE is a lightweight, yet powerful, JavaEE Application server with feature rich tooling." />
<meta name="keywords" content="tomee,asf,apache,javaee,jee,shade,embedded,test,junit,applicationcomposer,maven,arquillian" />
<meta name="author" content="Luka Cvetinovic for Codrops" />
<link rel="icon" href="../../../favicon.ico">
<link rel="icon" type="image/png" href="../../../favicon.png">
<meta name="msapplication-TileColor" content="#80287a">
<meta name="theme-color" content="#80287a">
<link rel="stylesheet" type="text/css" href="../../../css/normalize.css">
<link rel="stylesheet" type="text/css" href="../../../css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="../../../css/owl.css">
<link rel="stylesheet" type="text/css" href="../../../css/animate.css">
<link rel="stylesheet" type="text/css" href="../../../fonts/font-awesome-4.1.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../../../fonts/eleganticons/et-icons.css">
<link rel="stylesheet" type="text/css" href="../../../css/jqtree.css">
<link rel="stylesheet" type="text/css" href="../../../css/idea.css">
<link rel="stylesheet" type="text/css" href="../../../css/cardio.css">
<script type="text/javascript">
<!-- Matomo -->
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
/* We explicitly disable cookie tracking to avoid privacy issues */
_paq.push(['disableCookies']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function () {
var u = "//matomo.privacy.apache.org/";
_paq.push(['setTrackerUrl', u + 'matomo.php']);
_paq.push(['setSiteId', '5']);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.async = true;
g.src = u + 'matomo.js';
s.parentNode.insertBefore(g, s);
})();
<!-- End Matomo Code -->
</script>
</head>
<body>
<div class="preloader">
<img src="../../../img/loader.gif" alt="Preloader image">
</div>
<nav class="navbar">
<div class="container">
<div class="row"> <div class="col-md-12">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/" title="Apache TomEE">
<span>
<img
src="../../../img/apache_tomee-logo.svg"
onerror="this.src='../../../img/apache_tomee-logo.jpg'"
height="50"
>
</span>
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right main-nav">
<li><a href="../../../docs.html">Documentation</a></li>
<li><a href="../../../community/index.html">Community</a></li>
<li><a href="../../../security/security.html">Security</a></li>
<li><a class="btn btn-accent accent-orange no-shadow" href="../../../download.html">Downloads</a></li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div></div>
</div>
<!-- /.container-fluid -->
</nav>
<div id="main-block" class="container main-block">
<div class="row title">
<div class="col-md-12">
<div class='page-header'>
<h1>Arquillian Persistence Extension</h1>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Uma amostra mostrando como usar TomEE, Arquillian e sua extensão de persistência e JakartaEE 9.</p>
</div>
<div class="paragraph">
<p>Observe que ele só funciona com um contêiner interno. (tomee-embedded)</p>
</div>
</div>
</div>
<h1 id="_executando_saída" class="sect0">Executando (saída)</h1>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code> -------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.superbiz.arquillian.test.persistence.PersistenceTest
SEVERE: Unable to initialize agent: null
INFO: Starting TomEE from: C:\Users\zotyi\Documents\NetBeansProjects\tomee\examples\arquillian-jpa\target\apache-tomee-embedded
INFO: Initializing ProtocolHandler ["http-nio-49324"]
INFO: Starting service [Tomcat]
INFO: Starting Servlet engine: [Apache Tomcat/10.0.22]
INFO: Starting ProtocolHandler ["http-nio-49324"]
INFO: Using 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
INFO: ********************************************************************************
INFO: OpenEJB http://tomee.apache.org/
INFO: Startup: Thu Jun 30 21:45:55 CEST 2022
INFO: Copyright 1999-2021 (C) Apache TomEE Project, All Rights Reserved.
INFO: Version: 9.0.0-M9-SNAPSHOT
INFO: Build date: 20220630
INFO: Build time: 06:28
INFO: ********************************************************************************
INFO: openejb.home = C:\Users\zotyi\Documents\NetBeansProjects\tomee\examples\arquillian-jpa\target\apache-tomee-embedded
INFO: openejb.base = C:\Users\zotyi\Documents\NetBeansProjects\tomee\examples\arquillian-jpa\target\apache-tomee-embedded
INFO: Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@7b122839
INFO: Succeeded in installing singleton service
INFO: TomEE configuration file is 'C:\Users\zotyi\Documents\NetBeansProjects\tomee\examples\arquillian-jpa\target\apache-tomee-embedded\conf\openejb.xml'
INFO: Configuring Service(id=Tomcat Security Service, type=SecurityService, provider-id=Tomcat Security Service)
INFO: Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
INFO: Configuring Service(id=demoDataSource, type=Resource, provider-id=Default JDBC Database)
INFO: Using 'openejb.system.apps=false'
INFO: Using 'openejb.deployments.classpath=false'
INFO: Creating TransactionManager(id=Default Transaction Manager)
INFO: Creating SecurityService(id=Tomcat Security Service)
INFO: Creating Resource(id=demoDataSource)
INFO: Using 'openejb.servicemanager.enabled=false'
INFO: Extracting jar: C:\Users\zotyi\Documents\NetBeansProjects\tomee\examples\arquillian-jpa\target\arquillian-test-working-dir\0\UserPersistenceTest.war
INFO: Extracted path: C:\Users\zotyi\Documents\NetBeansProjects\tomee\examples\arquillian-jpa\target\arquillian-test-working-dir\0\UserPersistenceTest
INFO: using default host: localhost
INFO: ------------------------- localhost -&gt; /UserPersistenceTest
INFO: Using 'openejb.session.manager=org.apache.tomee.catalina.session.QuickSessionManager'
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.openejb.ClassLoaderUtil (file:/C:/Users/zotyi/.m2/repository/org/apache/tomee/openejb-core/9.0.0-M9-SNAPSHOT/openejb-core-9.0.0-M9-SNAPSHOT.jar) to field java.net.URLClassLoader.ucp
WARNING: Please consider reporting this to the maintainers of org.apache.openejb.ClassLoaderUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: Configuring enterprise application: C:\Users\zotyi\Documents\NetBeansProjects\tomee\examples\arquillian-jpa\target\arquillian-test-working-dir\0\UserPersistenceTest
INFO: Auto-deploying ejb TransactionBean: EjbDeployment(deployment-id=TransactionBean)
INFO: Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container)
INFO: Auto-creating a container for bean TransactionBean: Container(type=STATELESS, id=Default Stateless Container)
INFO: Creating Container(id=Default Stateless Container)
INFO: Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
INFO: Auto-creating a container for bean UserPersistenceTest.Comp824348035: Container(type=MANAGED, id=Default Managed Container)
INFO: Creating Container(id=Default Managed Container)
INFO: Using directory C:\Users\zotyi\AppData\Local\Temp for stateful session passivation
INFO: Configuring PersistenceUnit(name=demoApplicationPU)
INFO: Auto-creating a Resource with id 'demoDataSourceNonJta' of type 'DataSource' for 'demoApplicationPU'.
INFO: Configuring Service(id=demoDataSourceNonJta, type=Resource, provider-id=demoDataSource)
INFO: Creating Resource(id=demoDataSourceNonJta)
INFO: Adjusting PersistenceUnit demoApplicationPU &lt;non-jta-data-source&gt; to Resource ID 'demoDataSourceNonJta' from 'null'
INFO: Enterprise application "C:\Users\zotyi\Documents\NetBeansProjects\tomee\examples\arquillian-jpa\target\arquillian-test-working-dir\0\UserPersistenceTest" loaded.
INFO: Assembling app: C:\Users\zotyi\Documents\NetBeansProjects\tomee\examples\arquillian-jpa\target\arquillian-test-working-dir\0\UserPersistenceTest
INFO: Ignoring XML Configuration for validator org.apache.bval.jsr.ConfigurationImpl
INFO: JAVA AGENT NOT INSTALLED. The JPA Persistence Provider requested installation of a ClassFileTransformer which requires a JavaAgent. See http://tomee.apache.org/javaagent.html
INFO: OpenJPA dynamically loaded a validation provider.
INFO: Starting OpenJPA 3.2.2
INFO: Using dictionary class "org.apache.openjpa.jdbc.sql.HSQLDictionary" (HSQL Database Engine 2.6.0 ,HSQL Database Engine Driver 2.6.0).
INFO: Connected to HSQL Database Engine version 2.6 using JDBC driver HSQL Database Engine Driver version 2.6.0.
INFO: SELECT SEQUENCE_SCHEMA, SEQUENCE_NAME FROM INFORMATION_SCHEMA.SYSTEM_SEQUENCES --&gt; 0ms
INFO: CREATE TABLE User (id BIGINT NOT NULL, name VARCHAR(255), PRIMARY KEY (id)) --&gt; 0ms
WARNING: Creating subclass for "[class org.superbiz.arquillian.persistence.User]". This means that your application will be less efficient and will consume more memory than it would if you ran the OpenJPA enhancer. Additionally, lazy loading will not be available for one-to-one and many-to-one persistent attributes in types using field access; they will be loaded eagerly instead.
jún. 30, 2022 9:46:03 DU. org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory createDelegate
INFO: PersistenceUnit(name=demoApplicationPU, provider=org.apache.openjpa.persistence.PersistenceProviderImpl) - provider time 1103ms
INFO: Jndi(name=TransactionBeanLocal) --&gt; Ejb(deployment-id=TransactionBean)
INFO: Jndi(name=global/UserPersistenceTest/TransactionBean!org.superbiz.arquillian.test.persistence.PersistenceTest$Caller) --&gt; Ejb(deployment-id=TransactionBean)
INFO: Jndi(name=global/UserPersistenceTest/TransactionBean) --&gt; Ejb(deployment-id=TransactionBean)
INFO: Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@7b122839
INFO: Some Principal APIs could not be loaded: org.eclipse.microprofile.jwt.JsonWebToken out of org.eclipse.microprofile.jwt.JsonWebToken not found
INFO: OpenWebBeans Container is starting...
INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
INFO: All injection points were validated successfully.
INFO: OpenWebBeans Container has started, it took 758 ms.
INFO: Created Ejb(deployment-id=TransactionBean, ejb-name=TransactionBean, container=Default Stateless Container)
INFO: Started Ejb(deployment-id=TransactionBean, ejb-name=TransactionBean, container=Default Stateless Container)
INFO: Deployed Application(path=C:\Users\zotyi\Documents\NetBeansProjects\tomee\examples\arquillian-jpa\target\arquillian-test-working-dir\0\UserPersistenceTest)
INFO: Using org.apache.myfaces.ee.MyFacesContainerInitializer
INFO: Added FacesServlet with mappings=[/faces/*, *.jsf, *.faces, *.xhtml]
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
INFO: Installing &lt;listener&gt;org.apache.myfaces.webapp.StartupServletContextListener&lt;/listener&gt;
INFO: Reading standard config META-INF/standard-faces-config.xml
log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
log4j:WARN Please initialize the log4j system properly.
INFO: Reading config : jar:file:/C:/Users/zotyi/.m2/repository/org/apache/openwebbeans/openwebbeans-jsf/2.0.27/openwebbeans-jsf-2.0.27-jakarta.jar!/META-INF/faces-config.xml
INFO: Reading config : jar:file:/C:/Users/zotyi/.m2/repository/org/apache/openwebbeans/openwebbeans-el22/2.0.27/openwebbeans-el22-2.0.27-jakarta.jar!/META-INF/faces-config.xml
INFO: Artifact 'myfaces-api' was found in version '3.0.2' from path 'file:/C:/Users/zotyi/.m2/repository/org/apache/myfaces/core/myfaces-api/3.0.2/myfaces-api-3.0.2.jar'
INFO: Artifact 'myfaces-impl' was found in version '3.0.2' from path 'file:/C:/Users/zotyi/.m2/repository/org/apache/myfaces/core/myfaces-impl/3.0.2/myfaces-impl-3.0.2.jar'
INFO: MyFaces Core CDI support enabled
INFO: Using InjectionProvider org.apache.myfaces.spi.impl.CDIAnnotationDelegateInjectionProvider
INFO: MyFaces Core Bean Validation support enabled
INFO: Couldn't discover the current project stage, using Production
INFO: Serialization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory
INFO: Using LifecycleProvider org.apache.myfaces.config.annotation.Tomcat7AnnotationLifecycleProvider
INFO: ServletContext initialized.
INFO: org.apache.myfaces.CACHE_EL_EXPRESSIONS web config parameter is set to "noCache". To enable view pooling this param must be set to "alwaysRecompile". View Pooling disabled.
INFO: MyFaces Core has started, it took [1505] ms.
INFO: INSERT INTO User (id, name) VALUES (1, TomEE) --&gt; 0ms
INFO: INSERT INTO User (id, name) VALUES (2, Old) --&gt; 0ms
INFO: SELECT COUNT(t0.id) FROM User t0 --&gt; 3ms
INFO: UPDATE User SET name = OpenEJB WHERE id = 2 --&gt; 2ms
INFO: Undeploying app: C:\Users\zotyi\Documents\NetBeansProjects\tomee\examples\arquillian-jpa\target\arquillian-test-working-dir\0\UserPersistenceTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 16.775 s - in org.superbiz.arquillian.test.persistence.PersistenceTest
INFO: Stopping ProtocolHandler ["http-nio-49324"]
INFO: Pausing ProtocolHandler ["http-nio-49324"]
INFO: Stopping service [Tomcat]
INFO: Closing DataSource: demoDataSource
INFO: Closing DataSource: demoDataSourceNonJta
INFO: Destroying ProtocolHandler ["http-nio-49324"]
Results:
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0</code></pre>
</div>
</div>
<div class="sect1">
<h2 id="_apis_used">APIs Used</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="../../../jakartaee-10.0/javadoc/jakarta/ejb/EJB.html">jakarta.ejb.EJB</a></p>
</li>
<li>
<p><a href="../../../jakartaee-10.0/javadoc/jakarta/ejb/Stateless.html">jakarta.ejb.Stateless</a></p>
</li>
<li>
<p><a href="../../../jakartaee-10.0/javadoc/jakarta/persistence/Entity.html">jakarta.persistence.Entity</a></p>
</li>
<li>
<p><a href="../../../jakartaee-10.0/javadoc/jakarta/persistence/EntityManager.html">jakarta.persistence.EntityManager</a></p>
</li>
<li>
<p><a href="../../../jakartaee-10.0/javadoc/jakarta/persistence/Id.html">jakarta.persistence.Id</a></p>
</li>
<li>
<p><a href="../../../jakartaee-10.0/javadoc/jakarta/persistence/PersistenceContext.html">jakarta.persistence.PersistenceContext</a></p>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="margin-bottom: 30px;"></div>
<footer>
<div class="container">
<div class="row">
<div class="col-sm-6 text-center-mobile">
<h3 class="white">Be simple. Be certified. Be Tomcat.</h3>
<h5 class="light regular light-white">"A good application in a good server"</h5>
<ul class="social-footer">
<li><a href="https://www.facebook.com/ApacheTomEE/"><i class="fa fa-facebook"></i></a></li>
<li><a href="https://twitter.com/apachetomee"><i class="fa fa-twitter"></i></a></li>
</ul>
<h5 class="light regular light-white">
<a href="../../../privacy-policy.html" class="white">Privacy Policy</a>
</h5>
</div>
<div class="col-sm-6 text-center-mobile">
<div class="row opening-hours">
<div class="col-sm-3 text-center-mobile">
<h5><a href="../../../latest/docs/" class="white">Documentation</a></h5>
<ul class="list-unstyled">
<li><a href="../../../latest/docs/admin/configuration/index.html" class="regular light-white">How to configure</a></li>
<li><a href="../../../latest/docs/admin/file-layout.html" class="regular light-white">Dir. Structure</a></li>
<li><a href="../../../latest/docs/developer/testing/index.html" class="regular light-white">Testing</a></li>
<li><a href="../../../latest/docs/admin/cluster/index.html" class="regular light-white">Clustering</a></li>
</ul>
</div>
<div class="col-sm-3 text-center-mobile">
<h5><a href="../../../latest/examples/" class="white">Examples</a></h5>
<ul class="list-unstyled">
<li><a href="../../../latest/examples/simple-cdi-interceptor.html" class="regular light-white">CDI Interceptor</a></li>
<li><a href="../../../latest/examples/rest-cdi.html" class="regular light-white">REST with CDI</a></li>
<li><a href="../../../latest/examples/ejb-examples.html" class="regular light-white">EJB</a></li>
<li><a href="../../../latest/examples/jsf-managedBean-and-ejb.html" class="regular light-white">JSF</a></li>
</ul>
</div>
<div class="col-sm-3 text-center-mobile">
<h5><a href="../../../community/index.html" class="white">Community</a></h5>
<ul class="list-unstyled">
<li><a href="../../../community/contributors.html" class="regular light-white">Contributors</a></li>
<li><a href="../../../community/social.html" class="regular light-white">Social</a></li>
<li><a href="../../../community/sources.html" class="regular light-white">Sources</a></li>
</ul>
</div>
<div class="col-sm-3 text-center-mobile">
<h5><a href="../../../security/index.html" class="white">Security</a></h5>
<ul class="list-unstyled">
<li><a href="https://apache.org/security" target="_blank" class="regular light-white">Apache Security</a></li>
<li><a href="https://apache.org/security/projects.html" target="_blank" class="regular light-white">Security Projects</a></li>
<li><a href="https://cve.mitre.org" target="_blank" class="regular light-white">CVE</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="row bottom-footer text-center-mobile">
<div class="col-sm-12 light-white">
<p>Copyright &copy; 1999-2022 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache TomEE, TomEE, Apache, the Apache feather logo, and the Apache TomEE project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.</p>
</div>
</div>
</div>
</footer>
<!-- Holder for mobile navigation -->
<div class="mobile-nav">
<ul>
<li><a hef="../../../latest/docs/admin/index.html">Administrators</a>
<li><a hef="../../../latest/docs/developer/index.html">Developers</a>
<li><a hef="../../../latest/docs/advanced/index.html">Advanced</a>
<li><a hef="../../../community/index.html">Community</a>
</ul>
<a href="#" class="close-link"><i class="arrow_up"></i></a>
</div>
<!-- Scripts -->
<script src="../../../js/jquery-1.11.1.min.js"></script>
<script src="../../../js/owl.carousel.min.js"></script>
<script src="../../../js/bootstrap.min.js"></script>
<script src="../../../js/wow.min.js"></script>
<script src="../../../js/typewriter.js"></script>
<script src="../../../js/jquery.onepagenav.js"></script>
<script src="../../../js/tree.jquery.js"></script>
<script src="../../../js/highlight.pack.js"></script>
<script src="../../../js/main.js"></script>
</body>
</html>