You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2018/12/27 07:59:24 UTC

[1/4] tomee git commit: TOMEE-2388

Repository: tomee
Updated Branches:
  refs/heads/master b489fca7a -> 4289150f0


TOMEE-2388


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/b50392f1
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/b50392f1
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/b50392f1

Branch: refs/heads/master
Commit: b50392f1342093a95d8f865bc4c1b86be4cf412f
Parents: b489fca
Author: Mariani Federico <fe...@eng.it>
Authored: Wed Dec 26 18:43:56 2018 +0100
Committer: Mariani Federico <fe...@eng.it>
Committed: Wed Dec 26 18:43:56 2018 +0100

----------------------------------------------------------------------
 examples/multi-jpa-provider-testing/README.md | 281 +++++++++++++++++++++
 1 file changed, 281 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/b50392f1/examples/multi-jpa-provider-testing/README.md
----------------------------------------------------------------------
diff --git a/examples/multi-jpa-provider-testing/README.md b/examples/multi-jpa-provider-testing/README.md
new file mode 100644
index 0000000..b24a54d
--- /dev/null
+++ b/examples/multi-jpa-provider-testing/README.md
@@ -0,0 +1,281 @@
+index-group=JPA Providers
+type=page
+status=published
+title=Multiple JPA providers test
+~~~~~~
+
+This test shows how to use multiple JPA providers, Hibernate and Openjpa. Using JPA annotations the code can be easily used with different implementations. The @Entity class is straight forward, a Person POJO with an id and a name, the persistence.xml creates and drop Person table for both implementations. The examples and implementations dependency are inside test resources, in particularly: arquillian.xml for test purpose, hibernate-pom.xml loads hibernate-core dependencies and openjpa-pom.xml loads openjpa dependencies. The test inside JPATest.java class is executed twice, once for each implementation.
+
+## @Entity
+
+Simple POJO class that follows JPA standard
+
+    import javax.persistence.Entity;
+    import javax.persistence.GeneratedValue;
+    import javax.persistence.Id;
+
+    @Entity
+    public class Person {
+
+        @Id
+        @GeneratedValue
+        private long id;
+
+        private String name;
+
+        public long getId() {
+            return id;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+    }
+
+## persistence.xml
+
+Create and drop Person table
+
+    <persistence version="2.0"
+             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
+                       http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
+    <persistence-unit name="jpa">
+        <jta-data-source>jdbc/jpa</jta-data-source>
+        <properties>
+        <!--
+            OpenJPA
+        -->
+        <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
+
+        <!--
+            Hibernate
+        -->
+        <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+        </properties>
+    </persistence-unit>
+    </persistence>
+
+## JPA test
+
+The entity manager is injected through cdi and an Object Person is created and inserted into the inmemory database
+
+    import org.jboss.arquillian.container.test.api.Deployment;
+    import org.jboss.arquillian.junit.Arquillian;
+    import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
+    import org.jboss.arquillian.transaction.api.annotation.Transactional;
+    import org.jboss.shrinkwrap.api.ArchivePaths;
+    import org.jboss.shrinkwrap.api.ShrinkWrap;
+    import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+    import org.jboss.shrinkwrap.api.spec.WebArchive;
+    import org.junit.Test;
+    import org.junit.runner.RunWith;
+    import org.superbiz.model.Person;
+
+    import javax.persistence.EntityManager;
+    import javax.persistence.PersistenceContext;
+
+    import static org.junit.Assert.assertNotNull;
+
+    @RunWith(Arquillian.class)
+    public class JPATest {
+
+        @Deployment
+        public static WebArchive war() {
+            return ShrinkWrap.create(WebArchive.class)
+                    .addClass(Person.class)
+                    .addAsWebInfResource(new ClassLoaderAsset("META-INF/persistence.xml"), ArchivePaths.create("persistence.xml"));
+        }
+
+        @PersistenceContext
+        private EntityManager em;
+
+        @Test
+        @Transactional(TransactionMode.ROLLBACK)
+        public void persist() {
+            assertNotNull(em);
+
+            // do something with the em
+            final Person p = new Person();
+            p.setName("Apache OpenEJB");
+            em.persist(p);
+        }
+    }
+
+Inside the example there are no reference to the JPA implementations.
+
+## Test implementations
+
+The test classes inside org.superbiz.enricher package simply load the implementation libraries and the test runs twice as described inside the pom.xml, a system property variable is used to distinguish between Hibernate and OpenJPA.
+
+# Running
+
+Running the example can be done from maven with a simple 'mvn clean install' command run from the 'multi-jpa-provider-testing' directory.
+
+When run you should see output similar to the following.
+
+    -------------------------------------------------------
+    T E S T S
+    -------------------------------------------------------
+    Running org.superbiz.JPATest
+    INFO - ********************************************************************************
+    INFO - OpenEJB http://tomee.apache.org/
+    INFO - Startup: Wed Dec 26 17:55:31 CET 2018
+    INFO - Copyright 1999-2018 (C) Apache OpenEJB Project, All Rights Reserved.
+    INFO - Version: 8.0.0-SNAPSHOT
+    INFO - Build date: 20181226
+    INFO - Build time: 02:26
+    INFO - ********************************************************************************
+    INFO - openejb.home = /tomee/examples/multi-jpa-provider-testing
+    INFO - openejb.base = /tomee/examples/multi-jpa-provider-testing
+    INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@5db45159
+    INFO - Succeeded in installing singleton service
+    INFO - Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
+    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+    INFO - Using 'openejb.deployments.classpath=false'
+    INFO - Creating TransactionManager(id=Default Transaction Manager)
+    INFO - Creating SecurityService(id=Default Security Service)
+    INFO - Using 'openejb.classloader.forced-load=org.superbiz.model'
+    INFO - Configuring enterprise application: /tomee/examples/multi-jpa-provider-testing/413724ac-4a44-48a3-ae4a-db190b95cc62.war
+    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+    INFO - Auto-creating a container for bean 413724ac-4a44-48a3-ae4a-db190b95cc62_org.superbiz.JPATest: Container(type=MANAGED, id=Default Managed Container)
+    INFO - Creating Container(id=Default Managed Container)
+    INFO - Using directory /tmp for stateful session passivation
+    INFO - Configuring PersistenceUnit(name=jpa)
+    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 'jpa'.
+    INFO - Creating Resource(id=Default JDBC Database)
+    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 'jpa'.
+    INFO - Creating Resource(id=Default Unmanaged JDBC Database)
+    INFO - Adjusting PersistenceUnit jpa <jta-data-source> to Resource ID 'Default JDBC Database' from 'jdbc/jpa'
+    INFO - Adjusting PersistenceUnit jpa <non-jta-data-source> to Resource ID 'Default Unmanaged JDBC Database' from 'null'
+    INFO - Using 'javax.persistence.provider=org.hibernate.ejb.HibernatePersistence'
+    INFO - Enterprise application "/tomee/examples/multi-jpa-provider-testing/413724ac-4a44-48a3-ae4a-db190b95cc62.war" loaded.
+    INFO - Assembling app: /tomee/examples/multi-jpa-provider-testing/413724ac-4a44-48a3-ae4a-db190b95cc62.war
+    INFO - HCANN000001: Hibernate Commons Annotations {4.0.2.Final}
+    INFO - HHH000412: Hibernate Core {4.2.18.Final}
+    INFO - HHH000206: hibernate.properties not found
+    INFO - HHH000021: Bytecode provider name : javassist
+    INFO - HHH000204: Processing PersistenceUnitInfo [
+        name: jpa
+        ...]
+    INFO - HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
+    INFO - HHH000400: Using dialect: org.hibernate.dialect.HSQLDialect
+    INFO - HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
+    INFO - HHH000397: Using ASTQueryTranslatorFactory
+    INFO - HHH000227: Running hbm2ddl schema export
+    INFO - HHH000230: Schema export complete
+    INFO - PersistenceUnit(name=jpa, provider=org.hibernate.ejb.HibernatePersistence) - provider time 1053ms
+    INFO - Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@5db45159
+    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 - HV000001: Hibernate Validator 5.1.3.Final
+    INFO - All injection points were validated successfully.
+    INFO - OpenWebBeans Container has started, it took 194 ms.
+    INFO - Deployed Application(path=/tomee/examples/multi-jpa-provider-testing/413724ac-4a44-48a3-ae4a-db190b95cc62.war)
+    INFO - Undeploying app: /tomee/examples/multi-jpa-provider-testing/413724ac-4a44-48a3-ae4a-db190b95cc62.war
+    INFO - HHH000227: Running hbm2ddl schema export
+    INFO - HHH000230: Schema export complete
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.951 sec - in org.superbiz.JPATest
+    INFO - Destroying container system
+    INFO - Closing DataSource: Default JDBC Database
+    INFO - Closing DataSource: Default Unmanaged JDBC Database
+
+    Results :
+
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+
+    -------------------------------------------------------
+    T E S T S
+    -------------------------------------------------------
+    SUREFIRE-859: 57  classpath-bootstrap  INFO   [main] openjpa.Enhance - You have enabled runtime enhancement, but have not specified the set of persistent classes.  OpenJPA must look for metadata for every loaded class, which might increase class load times significantly.
+    353  classpath-bootstrap  INFO   [main] openjpa.Runtime - OpenJPA dynamically loaded a validation provider.
+    Running org.superbiz.JPATest
+    INFO - ********************************************************************************
+    INFO - OpenEJB http://tomee.apache.org/
+    INFO - Startup: Wed Dec 26 17:55:35 CET 2018
+    INFO - Copyright 1999-2018 (C) Apache OpenEJB Project, All Rights Reserved.
+    INFO - Version: 8.0.0-SNAPSHOT
+    INFO - Build date: 20181226
+    INFO - Build time: 02:26
+    INFO - ********************************************************************************
+    INFO - openejb.home = /tomee/examples/multi-jpa-provider-testing
+    INFO - openejb.base = /tomee/examples/multi-jpa-provider-testing
+    INFO - Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@4a8a60bc
+    INFO - Succeeded in installing singleton service
+    INFO - Cannot find the configuration file [conf/openejb.xml].  Will attempt to create one for the beans deployed.
+    INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
+    INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+    INFO - Using 'openejb.deployments.classpath=false'
+    INFO - Creating TransactionManager(id=Default Transaction Manager)
+    INFO - Creating SecurityService(id=Default Security Service)
+    INFO - Configuring enterprise application: /tomee/examples/multi-jpa-provider-testing/450e397e-de39-49eb-837f-7b066fc9f248.war
+    INFO - Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+    INFO - Auto-creating a container for bean 450e397e-de39-49eb-837f-7b066fc9f248_org.superbiz.JPATest: Container(type=MANAGED, id=Default Managed Container)
+    INFO - Creating Container(id=Default Managed Container)
+    INFO - Using directory /tmp for stateful session passivation
+    INFO - Configuring PersistenceUnit(name=jpa)
+    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 'jpa'.
+    INFO - Creating Resource(id=Default JDBC Database)
+    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 'jpa'.
+    INFO - Creating Resource(id=Default Unmanaged JDBC Database)
+    INFO - Adjusting PersistenceUnit jpa <jta-data-source> to Resource ID 'Default JDBC Database' from 'jdbc/jpa'
+    INFO - Adjusting PersistenceUnit jpa <non-jta-data-source> to Resource ID 'Default Unmanaged JDBC Database' from 'null'
+    INFO - Using 'javax.persistence.provider=org.apache.openjpa.persistence.PersistenceProviderImpl'
+    INFO - Enterprise application "/tomee/examples/multi-jpa-provider-testing/450e397e-de39-49eb-837f-7b066fc9f248.war" loaded.
+    INFO - Assembling app: /tomee/examples/multi-jpa-provider-testing/450e397e-de39-49eb-837f-7b066fc9f248.war
+    INFO - OpenJPA dynamically loaded a validation provider.
+    INFO - PersistenceUnit(name=jpa, provider=org.apache.openjpa.persistence.PersistenceProviderImpl) - provider time 116ms
+    INFO - Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@4a8a60bc
+    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 - HV000001: Hibernate Validator 5.1.3.Final
+    INFO - All injection points were validated successfully.
+    INFO - OpenWebBeans Container has started, it took 170 ms.
+    INFO - Deployed Application(path=/tomee/examples/multi-jpa-provider-testing/450e397e-de39-49eb-837f-7b066fc9f248.war)
+    INFO - Starting OpenJPA 3.0.0
+    INFO - Using dictionary class "org.apache.openjpa.jdbc.sql.HSQLDictionary" (HSQL Database Engine 2.3.2 ,HSQL Database Engine Driver 2.3.2).
+    INFO - Connected to HSQL Database Engine version 2.2 using JDBC driver HSQL Database Engine Driver version 2.3.2. 
+    INFO - Undeploying app: /tomee/examples/multi-jpa-provider-testing/450e397e-de39-49eb-837f-7b066fc9f248.war
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.666 sec - in org.superbiz.JPATest
+    INFO - Destroying container system
+    INFO - Closing DataSource: Default JDBC Database
+    INFO - Closing DataSource: Default Unmanaged JDBC Database
+
+    Results :
+
+    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+
+From the log you can see that both implementations are used: INFO - Using 'javax.persistence.provider=org.apache.openjpa.persistence.PersistenceProviderImpl', INFO - Using 'javax.persistence.provider=org.hibernate.ejb.HibernatePersistence'. 
+
+## Inside the jar
+
+If we look at the jar built by maven, we'll see the application itself is quite small:
+
+    jar tvf multi-jpa-provider-testing-8.0.0-SNAPSHOT.jar 
+        0 Wed Dec 26 17:55:40 CET 2018 META-INF/
+    134 Wed Dec 26 17:55:38 CET 2018 META-INF/MANIFEST.MF
+        0 Wed Dec 26 17:55:30 CET 2018 org/
+        0 Wed Dec 26 17:55:30 CET 2018 org/superbiz/
+        0 Wed Dec 26 17:55:30 CET 2018 org/superbiz/model/
+    780 Wed Dec 26 17:55:30 CET 2018 org/superbiz/model/Person.class
+    1554 Wed Dec 26 17:55:30 CET 2018 META-INF/persistence.xml
+        0 Wed Dec 26 17:55:40 CET 2018 META-INF/maven/
+        0 Wed Dec 26 17:55:40 CET 2018 META-INF/maven/org.superbiz/
+        0 Wed Dec 26 17:55:40 CET 2018 META-INF/maven/org.superbiz/multi-jpa-provider-testing/
+    5696 Wed Dec 26 17:41:54 CET 2018 META-INF/maven/org.superbiz/multi-jpa-provider-testing/pom.xml
+    132 Wed Dec 26 17:55:38 CET 2018 META-INF/maven/org.superbiz/multi-jpa-provider-testing/pom.properties
+
+
+Inside the resources package there is only a java class and the persistence.xml and the only dependency is javaee-api:8.0.
\ No newline at end of file


[2/4] tomee git commit: TOMEE-2391

Posted by jl...@apache.org.
TOMEE-2391


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/c041d98a
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/c041d98a
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/c041d98a

Branch: refs/heads/master
Commit: c041d98aa99be2591ef380c4dd6b0765b44545b7
Parents: b50392f
Author: Mariani Federico <fe...@eng.it>
Authored: Wed Dec 26 21:28:14 2018 +0100
Committer: Mariani Federico <fe...@eng.it>
Committed: Wed Dec 26 21:28:14 2018 +0100

----------------------------------------------------------------------
 examples/pojo-webservice/README.md | 273 ++++++++++++++++++++++++++++++++
 1 file changed, 273 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/c041d98a/examples/pojo-webservice/README.md
----------------------------------------------------------------------
diff --git a/examples/pojo-webservice/README.md b/examples/pojo-webservice/README.md
new file mode 100644
index 0000000..40585c5
--- /dev/null
+++ b/examples/pojo-webservice/README.md
@@ -0,0 +1,273 @@
+index-group=Web Services
+type=page
+status=published
+title=JAX-WS @WebService example
+~~~~~~
+
+Creating Web Services with JAX-WS is quite easy.  Little has to be done aside from annotating a class with `@WebService`.  Thie example shows the use of CDI with webservice annotation. The web.xml expose the webservice servlet at the address http://${host}:${port}/pojo-webservice?wsdl. To run the sample you can use the tomee maven plugin, mvn tomee:run.
+
+## web.xml
+
+Expose a servlet for the webservice
+
+    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+            version="3.0">
+    <servlet>
+        <servlet-name>ws</servlet-name>
+        <servlet-class>org.superbiz.ws.pojo.PojoWS</servlet-class>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>ws</servlet-name>
+        <url-pattern>/*</url-pattern>
+    </servlet-mapping>
+    </web-app>
+
+## @PojoWS
+
+This is the only concrete class annotated as @WebService that expose one operation ws(), also WebServiceContext and UserTransaction are injected in the class and used in the operation.
+
+    import javax.annotation.Resource;
+    import javax.jws.WebService;
+    import javax.transaction.UserTransaction;
+    import javax.xml.ws.WebServiceContext;
+
+    @WebService
+    public class PojoWS implements WS {
+
+        @Resource
+        private WebServiceContext webServiceContext;
+
+        @Resource
+        private UserTransaction userTransaction;
+
+        @Override
+        public String ws() {
+            return webServiceContext + " & " + userTransaction;
+        }
+
+        public void setWebServiceContext(WebServiceContext webServiceContext) {
+            this.webServiceContext = webServiceContext;
+        }
+
+        public void setUserTransaction(UserTransaction userTransaction) {
+            this.userTransaction = userTransaction;
+        }
+    }
+
+## @WebService Endpoint Interface
+
+Having an endpoint interface is not required, but it can make testing and using the web service from other Java clients far easier.
+
+    import javax.jws.WebService;
+
+    @WebService
+    public interface WS {
+
+        String ws();
+    }
+
+## PojoWS WSDL
+
+The wsdl for our service is autmatically created for us and available at `http://127.0.0.1:8080/pojo-webservice?wsdl`.
+
+    <?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://pojo.ws.superbiz.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="PojoWSService" targetNamespace="http://pojo.ws.superbiz.org/">
+    <wsdl:types>
+    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://pojo.ws.superbiz.org/" elementFormDefault="unqualified" targetNamespace="http://pojo.ws.superbiz.org/" version="1.0">
+
+    <xs:element name="ws" type="tns:ws"/>
+
+    <xs:element name="wsResponse" type="tns:wsResponse"/>
+
+    <xs:complexType name="ws">
+        <xs:sequence/>
+    </xs:complexType>
+
+    <xs:complexType name="wsResponse">
+        <xs:sequence>
+        <xs:element minOccurs="0" name="return" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    </xs:schema>
+    </wsdl:types>
+    <wsdl:message name="ws">
+        <wsdl:part element="tns:ws" name="parameters">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="wsResponse">
+        <wsdl:part element="tns:wsResponse" name="parameters">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="WS">
+        <wsdl:operation name="ws">
+        <wsdl:input message="tns:ws" name="ws">
+        </wsdl:input>
+        <wsdl:output message="tns:wsResponse" name="wsResponse">
+        </wsdl:output>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="PojoWSServiceSoapBinding" type="tns:WS">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="ws">
+        <soap:operation soapAction="" style="document"/>
+        <wsdl:input name="ws">
+            <soap:body use="literal"/>
+        </wsdl:input>
+        <wsdl:output name="wsResponse">
+            <soap:body use="literal"/>
+        </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="PojoWSService">
+        <wsdl:port binding="tns:PojoWSServiceSoapBinding" name="PojoWSPort">
+        <soap:address location="http://localhost:8080/pojo-webservice"/>
+        </wsdl:port>
+    </wsdl:service>
+
+## Invoke ws operation
+
+The operation can be tested with a client like SoapUI that will generate the following request for the ws operation
+
+### ws()
+
+Request SOAP message:
+
+    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pojo="http://pojo.ws.superbiz.org/">
+        <soapenv:Header/>
+        <soapenv:Body>
+            <pojo:ws/>
+        </soapenv:Body>
+    </soapenv:Envelope>
+
+Response SOAP message:
+
+    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+        <soap:Body>
+            <ns2:wsResponse xmlns:ns2="http://pojo.ws.superbiz.org/">
+                <return>org.apache.cxf.jaxws.context.WebServiceContextImpl@94b724d &amp; org.apache.openejb.resource.GeronimoTransactionManagerFactory$DestroyableTransactionManager@5fe405bf</return>
+            </ns2:wsResponse>
+        </soap:Body>
+    </soap:Envelope>
+
+This shows that WebServiceContext and UserTransaction are successfully injected.
+
+# Running
+
+Running the example can be done from maven with a simple 'mvn tomee:run' command run from the 'pojo-webservice' directory.
+
+When run you should see output similar to the following.
+
+    26-Dec-2018 21:20:55.667 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke Server version:        Apache Tomcat (TomEE)/9.0.12 (8.0.0-SNAPSHOT)
+    26-Dec-2018 21:20:55.668 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke Server built:          Sep 4 2018 22:13:41 UTC
+    26-Dec-2018 21:20:55.668 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke Server number:         9.0.12.0
+    26-Dec-2018 21:20:55.668 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke OS Name:               Linux
+    26-Dec-2018 21:20:55.668 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke OS Version:            4.15.0-43-generic
+    26-Dec-2018 21:20:55.668 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke Architecture:          amd64
+    26-Dec-2018 21:20:55.668 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke Java Home:             /usr/lib/jvm/java-8-oracle/jre
+    26-Dec-2018 21:20:55.669 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke JVM Version:           1.8.0_144-b01
+    26-Dec-2018 21:20:55.669 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke JVM Vendor:            Oracle Corporation
+    26-Dec-2018 21:20:55.669 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke CATALINA_BASE:         /tomee/examples/pojo-webservice/target/apache-tomee
+    26-Dec-2018 21:20:55.669 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke CATALINA_HOME:         /tomee/examples/pojo-webservice/target/apache-tomee
+    26-Dec-2018 21:20:55.669 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke Command line argument: -XX:+HeapDumpOnOutOfMemoryError
+    26-Dec-2018 21:20:55.669 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke Command line argument: -Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=false
+    26-Dec-2018 21:20:55.669 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke Command line argument: -Dopenejb.session.manager=org.apache.tomee.catalina.session.QuickSessionManager
+    26-Dec-2018 21:20:55.669 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke Command line argument: -Dtomee.remote.support=true
+    26-Dec-2018 21:20:55.670 INFO [main] sun.reflect.NativeMethodAccessorImpl.invoke Command line argument: -Dopenejb.system.apps=false
+    26-Dec-2018 21:20:55.670 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Command line argument: -Dtomee.jsp-development=true
+    26-Dec-2018 21:20:55.670 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Command line argument: -Djava.util.logging.config.file=/tomee/examples/pojo-webservice/target/apache-tomee/conf/logging.properties
+    26-Dec-2018 21:20:55.670 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Command line argument: -javaagent:/tomee/examples/pojo-webservice/target/apache-tomee/lib/openejb-javaagent.jar
+    26-Dec-2018 21:20:55.670 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
+    26-Dec-2018 21:20:55.670 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Command line argument: -Djava.io.tmpdir=/tomee/examples/pojo-webservice/target/apache-tomee/temp
+    26-Dec-2018 21:20:55.670 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Command line argument: -Dcatalina.base=/tomee/examples/pojo-webservice/target/apache-tomee
+    26-Dec-2018 21:20:55.670 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Command line argument: -Dcatalina.home=/tomee/examples/pojo-webservice/target/apache-tomee
+    26-Dec-2018 21:20:55.670 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Command line argument: -Dcatalina.ext.dirs=/tomee/examples/pojo-webservice/target/apache-tomee/lib
+    26-Dec-2018 21:20:55.670 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Command line argument: -Dorg.apache.tomcat.util.http.ServerCookie.ALLOW_HTTP_SEPARATORS_IN_V0=true
+    26-Dec-2018 21:20:55.670 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Command line argument: -ea
+    26-Dec-2018 21:20:55.671 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
+    26-Dec-2018 21:20:55.855 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Initializing ProtocolHandler ["http-nio-8080"]
+    26-Dec-2018 21:20:55.873 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Using a shared selector for servlet write/read
+    26-Dec-2018 21:20:55.893 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Initializing ProtocolHandler ["ajp-nio-8009"]
+    26-Dec-2018 21:20:55.896 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Using a shared selector for servlet write/read
+    26-Dec-2018 21:20:56.206 INFO [main] org.apache.openejb.util.OptionsLog.info Using 'tomee.remote.support=true'
+    26-Dec-2018 21:20:56.217 INFO [main] org.apache.openejb.util.OptionsLog.info Using 'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
+    26-Dec-2018 21:20:56.302 INFO [main] org.apache.openejb.OpenEJB$Instance.<init> ********************************************************************************
+    26-Dec-2018 21:20:56.302 INFO [main] org.apache.openejb.OpenEJB$Instance.<init> OpenEJB http://tomee.apache.org/
+    26-Dec-2018 21:20:56.302 INFO [main] org.apache.openejb.OpenEJB$Instance.<init> Startup: Wed Dec 26 21:20:56 CET 2018
+    26-Dec-2018 21:20:56.302 INFO [main] org.apache.openejb.OpenEJB$Instance.<init> Copyright 1999-2018 (C) Apache OpenEJB Project, All Rights Reserved.
+    26-Dec-2018 21:20:56.302 INFO [main] org.apache.openejb.OpenEJB$Instance.<init> Version: 8.0.0-SNAPSHOT
+    26-Dec-2018 21:20:56.303 INFO [main] org.apache.openejb.OpenEJB$Instance.<init> Build date: 20181226
+    26-Dec-2018 21:20:56.303 INFO [main] org.apache.openejb.OpenEJB$Instance.<init> Build time: 02:24
+    26-Dec-2018 21:20:56.303 INFO [main] org.apache.openejb.OpenEJB$Instance.<init> ********************************************************************************
+    26-Dec-2018 21:20:56.303 INFO [main] org.apache.openejb.OpenEJB$Instance.<init> openejb.home = /tomee/examples/pojo-webservice/target/apache-tomee
+    26-Dec-2018 21:20:56.303 INFO [main] org.apache.openejb.OpenEJB$Instance.<init> openejb.base = /tomee/examples/pojo-webservice/target/apache-tomee
+    26-Dec-2018 21:20:56.305 INFO [main] org.apache.openejb.cdi.CdiBuilder.initializeOWB Created new singletonService org.apache.openejb.cdi.ThreadSingletonServiceImpl@159f197
+    26-Dec-2018 21:20:56.305 INFO [main] org.apache.openejb.cdi.CdiBuilder.initializeOWB Succeeded in installing singleton service
+    26-Dec-2018 21:20:56.344 INFO [main] org.apache.openejb.config.ConfigurationFactory.init TomEE configuration file is '/tomee/examples/pojo-webservice/target/apache-tomee/conf/tomee.xml'
+    26-Dec-2018 21:20:56.431 INFO [main] org.apache.openejb.config.ConfigurationFactory.configureService Configuring Service(id=Tomcat Security Service, type=SecurityService, provider-id=Tomcat Security Service)
+    26-Dec-2018 21:20:56.433 INFO [main] org.apache.openejb.config.ConfigurationFactory.configureService Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
+    26-Dec-2018 21:20:56.435 INFO [main] org.apache.openejb.util.OptionsLog.info Using 'openejb.system.apps=false'
+    26-Dec-2018 21:20:56.436 INFO [main] org.apache.openejb.util.OptionsLog.info Using 'openejb.deployments.classpath=false'
+    26-Dec-2018 21:20:56.454 INFO [main] org.apache.openejb.assembler.classic.Assembler.createRecipe Creating TransactionManager(id=Default Transaction Manager)
+    26-Dec-2018 21:20:56.504 INFO [main] org.apache.openejb.assembler.classic.Assembler.createRecipe Creating SecurityService(id=Tomcat Security Service)
+    26-Dec-2018 21:20:56.564 INFO [main] org.apache.openejb.server.ServiceManager.initServer Creating ServerService(id=cxf)
+    26-Dec-2018 21:20:56.724 INFO [main] org.apache.openejb.server.ServiceManager.initServer Creating ServerService(id=cxf-rs)
+    26-Dec-2018 21:20:56.778 INFO [main] org.apache.openejb.server.SimpleServiceManager.start   ** Bound Services **
+    26-Dec-2018 21:20:56.778 INFO [main] org.apache.openejb.server.SimpleServiceManager.printRow   NAME                 IP              PORT  
+    26-Dec-2018 21:20:56.778 INFO [main] org.apache.openejb.server.SimpleServiceManager.start -------
+    26-Dec-2018 21:20:56.779 INFO [main] org.apache.openejb.server.SimpleServiceManager.start Ready!
+    26-Dec-2018 21:20:56.779 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Initialization processed in 1609 ms
+    26-Dec-2018 21:20:56.806 INFO [main] org.apache.tomee.catalina.OpenEJBNamingContextListener.bindResource Importing a Tomcat Resource with id 'UserDatabase' of type 'org.apache.catalina.UserDatabase'.
+    26-Dec-2018 21:20:56.807 INFO [main] org.apache.openejb.assembler.classic.Assembler.createRecipe Creating Resource(id=UserDatabase)
+    26-Dec-2018 21:20:56.822 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Starting service [Catalina]
+    26-Dec-2018 21:20:56.822 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Starting Servlet Engine: Apache Tomcat (TomEE)/9.0.12 (8.0.0-SNAPSHOT)
+    26-Dec-2018 21:20:56.839 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Deploying web application archive [/tomee/examples/pojo-webservice/target/apache-tomee/webapps/pojo-webservice.war]
+    26-Dec-2018 21:20:56.846 INFO [main] org.apache.tomee.catalina.TomcatWebAppBuilder.init ------------------------- localhost -> /pojo-webservice
+    26-Dec-2018 21:20:56.847 INFO [main] org.apache.openejb.util.JarExtractor.extract Extracting jar: /tomee/examples/pojo-webservice/target/apache-tomee/webapps/pojo-webservice.war
+    26-Dec-2018 21:20:56.850 INFO [main] org.apache.openejb.util.JarExtractor.extract Extracted path: /tomee/examples/pojo-webservice/target/apache-tomee/webapps/pojo-webservice
+    26-Dec-2018 21:20:56.852 INFO [main] org.apache.openejb.util.OptionsLog.info Using 'openejb.session.manager=org.apache.tomee.catalina.session.QuickSessionManager'
+    26-Dec-2018 21:20:57.121 INFO [main] org.apache.openejb.config.ConfigurationFactory.configureApplication Configuring enterprise application: /tomee/examples/pojo-webservice/target/apache-tomee/webapps/pojo-webservice
+    26-Dec-2018 21:20:57.227 INFO [main] org.apache.openejb.config.ConfigurationFactory.configureService Configuring Service(id=Default Managed Container, type=Container, provider-id=Default Managed Container)
+    26-Dec-2018 21:20:57.227 INFO [main] org.apache.openejb.config.AutoConfig.createContainer Auto-creating a container for bean pojo-webservice.Comp1279740095: Container(type=MANAGED, id=Default Managed Container)
+    26-Dec-2018 21:20:57.228 INFO [main] org.apache.openejb.assembler.classic.Assembler.createRecipe Creating Container(id=Default Managed Container)
+    26-Dec-2018 21:20:57.238 INFO [main] org.apache.openejb.core.managed.SimplePassivater.init Using directory /tomee/examples/pojo-webservice/target/apache-tomee/temp for stateful session passivation
+    26-Dec-2018 21:20:57.278 INFO [main] org.apache.openejb.config.AppInfoBuilder.build Enterprise application "/tomee/examples/pojo-webservice/target/apache-tomee/webapps/pojo-webservice" loaded.
+    26-Dec-2018 21:20:57.283 INFO [main] org.apache.openejb.assembler.classic.Assembler.createApplication Assembling app: /tomee/examples/pojo-webservice/target/apache-tomee/webapps/pojo-webservice
+    26-Dec-2018 21:20:57.538 INFO [main] org.apache.openejb.assembler.classic.Assembler.createApplication Deployed Application(path=/tomee/examples/pojo-webservice/target/apache-tomee/webapps/pojo-webservice)
+    26-Dec-2018 21:20:57.643 INFO [main] org.apache.myfaces.ee.MyFacesContainerInitializer.onStartup Using org.apache.myfaces.ee.MyFacesContainerInitializer
+    26-Dec-2018 21:20:57.717 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars 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.
+    26-Dec-2018 21:20:58.086 INFO [main] org.apache.cxf.common.injection.ResourceInjector.visitField failed to resolve resource org.superbiz.ws.pojo.PojoWS/userTransaction
+    26-Dec-2018 21:20:58.370 INFO [main] org.apache.openejb.server.webservices.WsService.afterApplicationCreated Webservice(wsdl=http://localhost:8080/pojo-webservice/*, qname={http://pojo.ws.superbiz.org/}PojoWSService) --> Pojo(id=localhost.pojo-webservice.ws)
+    26-Dec-2018 21:20:58.411 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Deployment of web application archive [/tomee/examples/pojo-webservice/target/apache-tomee/webapps/pojo-webservice.war] has finished in [1,571] ms
+    26-Dec-2018 21:20:58.422 INFO [main] org.apache.catalina.core.StandardContext.setClassLoaderProperty Unable to set the web application class loader property [clearReferencesRmiTargets] to [true] as the property does not exist.
+    26-Dec-2018 21:20:58.423 INFO [main] org.apache.catalina.core.StandardContext.setClassLoaderProperty Unable to set the web application class loader property [clearReferencesObjectStreamClassCaches] to [true] as the property does not exist.
+    26-Dec-2018 21:20:58.423 INFO [main] org.apache.catalina.core.StandardContext.setClassLoaderProperty Unable to set the web application class loader property [skipMemoryLeakChecksOnJvmShutdown] to [false] as the property does not exist.
+    26-Dec-2018 21:20:58.438 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Starting ProtocolHandler ["http-nio-8080"]
+    26-Dec-2018 21:20:58.456 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Starting ProtocolHandler ["ajp-nio-8009"]
+    26-Dec-2018 21:20:58.463 INFO [main] sun.reflect.DelegatingMethodAccessorImpl.invoke Server startup in 1681 ms
+
+## Inside the jar
+
+With so much going on it can make things look more complex than they are.  It can be hard to believe that so much can happen with such little code.  That's the benefit of having an app server.
+
+If we look at the jar built by maven, we'll see the application itself is quite small:
+
+    $ jar tvf target/pojo-webservice.war 
+        99 Wed Dec 26 21:08:26 CET 2018 META-INF/MANIFEST.MF
+        0 Wed Dec 26 21:08:26 CET 2018 META-INF/
+        0 Wed Dec 26 21:08:26 CET 2018 WEB-INF/
+        0 Wed Dec 26 21:08:26 CET 2018 WEB-INF/classes/
+        0 Wed Dec 26 21:08:26 CET 2018 WEB-INF/classes/org/
+        0 Wed Dec 26 21:08:26 CET 2018 WEB-INF/classes/org/superbiz/
+        0 Wed Dec 26 21:08:26 CET 2018 WEB-INF/classes/org/superbiz/ws/
+        0 Wed Dec 26 21:08:26 CET 2018 WEB-INF/classes/org/superbiz/ws/pojo/
+    1160 Wed Dec 26 21:08:24 CET 2018 WEB-INF/classes/org/superbiz/ws/pojo/PojoWS.class
+    207 Wed Dec 26 21:08:24 CET 2018 WEB-INF/classes/org/superbiz/ws/pojo/WS.class
+    1349 Wed Dec 26 17:41:54 CET 2018 WEB-INF/web.xml
+    3661 Wed Dec 26 17:41:54 CET 2018 META-INF/maven/org.superbiz/pojo-webservice/pom.xml
+    102 Wed Dec 26 21:08:26 CET 2018 META-INF/maven/org.superbiz/pojo-webservice/pom.properties
+
+This single jar could be deployed any any compliant Java EE implementation.
+
+The server already contains the right libraries to run the code, such as Apache CXF, so no need to include anything extra beyond your own application code.


[4/4] tomee git commit: This closes #311. Thanks Croway.

Posted by jl...@apache.org.
This closes #311. Thanks Croway.


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/4289150f
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/4289150f
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/4289150f

Branch: refs/heads/master
Commit: 4289150f02d3b68a5ac7c98c88329559be7cf469
Parents: 14aa653
Author: Jean-Louis Monteiro <je...@gmail.com>
Authored: Thu Dec 27 08:59:09 2018 +0100
Committer: Jean-Louis Monteiro <je...@gmail.com>
Committed: Thu Dec 27 08:59:09 2018 +0100

----------------------------------------------------------------------

----------------------------------------------------------------------



[3/4] tomee git commit: TOMEE-2391

Posted by jl...@apache.org.
TOMEE-2391


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/14aa6531
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/14aa6531
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/14aa6531

Branch: refs/heads/master
Commit: 14aa65318afe31e70cb847b2173fbff2d4c547b8
Parents: c041d98
Author: Mariani Federico <fe...@eng.it>
Authored: Wed Dec 26 21:40:08 2018 +0100
Committer: Mariani Federico <fe...@eng.it>
Committed: Wed Dec 26 21:40:08 2018 +0100

----------------------------------------------------------------------
 examples/pojo-webservice/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/14aa6531/examples/pojo-webservice/README.md
----------------------------------------------------------------------
diff --git a/examples/pojo-webservice/README.md b/examples/pojo-webservice/README.md
index 40585c5..ab26f15 100644
--- a/examples/pojo-webservice/README.md
+++ b/examples/pojo-webservice/README.md
@@ -4,7 +4,7 @@ status=published
 title=JAX-WS @WebService example
 ~~~~~~
 
-Creating Web Services with JAX-WS is quite easy.  Little has to be done aside from annotating a class with `@WebService`.  Thie example shows the use of CDI with webservice annotation. The web.xml expose the webservice servlet at the address http://${host}:${port}/pojo-webservice?wsdl. To run the sample you can use the tomee maven plugin, mvn tomee:run.
+Creating Web Services with JAX-WS is quite easy.  Little has to be done aside from annotating a class with `@WebService`.  Thie example shows the use of CDI with webservice annotation. The web.xml expose the webservice servlet at the address http://${host}:${port}/pojo-webservice?wsdl. To run the sample you can use the tomee maven plugin, mvn tomee:run. 
 
 ## web.xml