Repository: tomee Updated Branches: refs/heads/master 63929301a -> 7d54b679b
TOMEE-2316 Convert Markdown files to Asciidoc in the docs folder - 11 Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/6da75cac Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/6da75cac Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/6da75cac Branch: refs/heads/master Commit: 6da75cacf47ce82312c0bd7c80e28c4e88428e55 Parents: 388460f Author: Carlos Chacin <[email protected]> Authored: Wed Dec 5 22:07:27 2018 -0800 Committer: Carlos Chacin <[email protected]> Committed: Wed Dec 5 22:07:27 2018 -0800 ---------------------------------------------------------------------- docs/telnet-console.adoc | 158 ++++++++++++++++++++++++++++++++ docs/telnet-console.md | 166 ---------------------------------- docs/tip-concurrency.adoc | 33 +++++++ docs/tip-concurrency.md | 26 ------ docs/tip-jersey-client.adoc | 34 +++++++ docs/tip-jersey-client.md | 22 ----- docs/tip-weblogic.adoc | 22 +++++ docs/tip-weblogic.md | 17 ---- docs/tomcat-object-factory.adoc | 17 ++++ docs/tomcat-object-factory.md | 15 ---- docs/tomee-and-eclipse.adoc | 138 ++++++++++++++++++++++++++++ docs/tomee-and-eclipse.md | 145 ------------------------------ docs/tomee-and-hibernate.adoc | 170 +++++++++++++++++++++++++++++++++++ docs/tomee-and-hibernate.md | 163 --------------------------------- docs/tomee-and-intellij.adoc | 82 +++++++++++++++++ docs/tomee-and-intellij.md | 81 ----------------- docs/tomee-and-netbeans.adoc | 107 ++++++++++++++++++++++ docs/tomee-and-netbeans.md | 97 -------------------- docs/tomee-and-security.adoc | 54 +++++++++++ docs/tomee-and-security.md | 45 ---------- docs/tomee-and-webspheremq.adoc | 26 ++++++ docs/tomee-and-webspheremq.md | 136 ---------------------------- 22 files changed, 841 insertions(+), 913 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/telnet-console.adoc ---------------------------------------------------------------------- diff --git a/docs/telnet-console.adoc b/docs/telnet-console.adoc new file mode 100644 index 0000000..21e6347 --- /dev/null +++ b/docs/telnet-console.adoc @@ -0,0 +1,158 @@ +# Telnet Console +:index-group: Unrevised +:jbake-date: 2018-12-05 +:jbake-type: page +:jbake-status: published + +\{note} Availability: Since OpenEJB 0.9\{note} + +# Basic Usage + +To use OpenEJB's Telnet Console, simply boot your server normally. + +_____________________ +$ ./bin/openejb start +_____________________ + +.... +OPENEJB_HOME=/Users/dblevins/Desktop/openejb-1.0 +OpenEJB 1.0 build: 20060226-1701 +http://www.openejb.org +resources 1 +OpenEJB ready. +[init] +.... + +OpenEJB Remote Server ** Starting Services ** NAME IP PORT + +webadmin 0.0.0.0 4203 + +httpejbd 0.0.0.0 4204 + +telnet 0.0.0.0 4202 + +ejbd 0.0.0.0 4201 + +admin 0.0.0.0 4200 + +------- Ready! + +Then in another shell telnet in + +_______________________ +$ telnet localhost 4202 +_______________________ + +.... +Trying ::1... +Connected to localhost. +Escape character is '^] +.... + +'. OpenEJB Remote Server Console type 'help' for a list of commands +[openejb] $ help stop exit system version lookup help [openejb] $ system +Containers: Default BMP Container Default CMP Container Default Stateful +Container Default Stateless Container + +.... +Deployments: + client/tests/stateful/EncBean + client/tests/entity/cmp/RMI-over-IIOP/EJBHome + client/tests/stateful/BasicStatefulHome + ClientTools/ViewClass + Webadmin/Configuration + EJBGenerator/CreateEJB + ClientTools/InvokeObject + Webadmin/Properties + client/tests/stateful/RMI-over-IIOP/EJBHome + Webadmin/Home + client/tests/entity/bmp/allowed_operations/EntityHome + client/tests/entity/cmp/EncBean + httpd/DefaultBean + client/tests/stateful/BeanManagedBasicStatefulHome + client/tools/DatabaseHome + client/tests/entity/bmp/EncBean + config/webadmin/ConfigurationData + deploy/webadmin/Deployer + ClientTools/ViewJndi + Webadmin/DeploymentList + client/tests/stateless/BeanManagedBasicStatelessHome + Webadmin/CMPMapping + client/tests/stateless/EncBean + client/tests/stateful/BeanManagedTransactionTests/EJBHome + client/tests/entity/bmp/RMI-over-IIOP/EJBHome + Webadmin/ListLogs + client/tests/stateless/BeanManagedTransactionTests/EJBHome + ClientTools/ViewEjb + client/tests/entity/bmp/BasicBmpHome + mapping/webadmin/CMPMappingData + client/tests/stateless/BasicStatelessHome + client/tests/entity/cmp/BasicCmpHome + Webadmin/Deployment + httpd/session + client/tests/entity/cmp/allowed_operations/EntityHome + client/tests/stateless/RMI-over-IIOP/EJBHome +[openejb] +.... + +$ exit Connection closed by foreign host. + +# Configuring the Telnet Service + +The configuration of all server services (network facing services) is +done in xinet.d style config files. The telnet shell is controlled via +the $OPENEJB_HOME/conf/telnet.properties file. This file is created for +you automatically after the first time OpenEJB boots. + +____________________________ +$ cat conf/telnet.properties +____________________________ + +.... + server = org.openejb.server.telnet.TelnetServer + bind = 127.0.0.1 + port = 4202 + disabled = false + threads = 5 +# only_from = 192.168.1.123 +.... + +You can change the IP, port, and even the number of threads allowed to +concurrently access the Telnet service via this file. + +# Disabling the Telnet Service + +Simply edit the config file and set 'disabled' to true + +.... + disabled = true +.... + +Then restart OpenEJB. + +# Restricting Access + +It is unlikely you want just anyone to be able to login and execute +commands. While you can't restrict access on a user basis, yet, you can +restrict access to specific hosts. Host based access control (HBA) is a +built-in part of any Server Service in OpenEJB and the Telnet Service is +no different. This is done with the 'only_from' property, which like the +rest of the file is a direct copy of the xinet.d syntax for HBA. + +For an example to restrict access to the localhost, you could configure +the Telnet Service like this: + +.... + server = org.openejb.server.telnet.TelnetServer + bind = 127.0.0.1 + port = 4202 + disabled = false + threads = 5 + only_from = localhost +.... + +If you wanted to restrict access to localhost _and_ say the hosts +192.168.1.207 and 192.168.1.16, you can simply add them to the list. + +.... + server = org.openejb.server.telnet.TelnetServer + bind = 127.0.0.1 + port = 4202 + disabled = false + threads = 5 + only_from = localhost, 192.168.1.207, 192.168.1.16 +.... http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/telnet-console.md ---------------------------------------------------------------------- diff --git a/docs/telnet-console.md b/docs/telnet-console.md deleted file mode 100644 index ddb9533..0000000 --- a/docs/telnet-console.md +++ /dev/null @@ -1,166 +0,0 @@ -index-group=Unrevised -type=page -status=published -title=Telnet Console -~~~~~~ -{note} Availability: Since OpenEJB 0.9{note} - -<a name="TelnetConsole-BasicUsage"></a> -# Basic Usage - -To use OpenEJB's Telnet Console, simply boot your server normally. - -> $ ./bin/openejb start - - - OPENEJB_HOME=/Users/dblevins/Desktop/openejb-1.0 - OpenEJB 1.0 build: 20060226-1701 - http://www.openejb.org - resources 1 - OpenEJB ready. - [init] - OpenEJB Remote Server - ** Starting Services ** - NAME IP PORT - webadmin 0.0.0.0 4203 - httpejbd 0.0.0.0 4204 - telnet 0.0.0.0 4202 - ejbd 0.0.0.0 4201 - admin 0.0.0.0 4200 - ------- - Ready! - - - -Then in another shell telnet in - -> $ telnet localhost 4202 - - Trying ::1... - Connected to localhost. - Escape character is '^] -'. - OpenEJB Remote Server Console - type 'help' for a list of commands - [openejb] -$ help - stop - exit - system - version - lookup - help - [openejb] -$ system - Containers: - Default BMP Container - Default CMP Container - Default Stateful Container - Default Stateless Container - - Deployments: - client/tests/stateful/EncBean - client/tests/entity/cmp/RMI-over-IIOP/EJBHome - client/tests/stateful/BasicStatefulHome - ClientTools/ViewClass - Webadmin/Configuration - EJBGenerator/CreateEJB - ClientTools/InvokeObject - Webadmin/Properties - client/tests/stateful/RMI-over-IIOP/EJBHome - Webadmin/Home - client/tests/entity/bmp/allowed_operations/EntityHome - client/tests/entity/cmp/EncBean - httpd/DefaultBean - client/tests/stateful/BeanManagedBasicStatefulHome - client/tools/DatabaseHome - client/tests/entity/bmp/EncBean - config/webadmin/ConfigurationData - deploy/webadmin/Deployer - ClientTools/ViewJndi - Webadmin/DeploymentList - client/tests/stateless/BeanManagedBasicStatelessHome - Webadmin/CMPMapping - client/tests/stateless/EncBean - client/tests/stateful/BeanManagedTransactionTests/EJBHome - client/tests/entity/bmp/RMI-over-IIOP/EJBHome - Webadmin/ListLogs - client/tests/stateless/BeanManagedTransactionTests/EJBHome - ClientTools/ViewEjb - client/tests/entity/bmp/BasicBmpHome - mapping/webadmin/CMPMappingData - client/tests/stateless/BasicStatelessHome - client/tests/entity/cmp/BasicCmpHome - Webadmin/Deployment - httpd/session - client/tests/entity/cmp/allowed_operations/EntityHome - client/tests/stateless/RMI-over-IIOP/EJBHome - [openejb] -$ exit - Connection closed by foreign host. - - -<a name="TelnetConsole-ConfiguringtheTelnetService"></a> -# Configuring the Telnet Service - -The configuration of all server services (network facing services) is done -in xinet.d style config files. The telnet shell is controlled via the -$OPENEJB_HOME/conf/telnet.properties file. This file is created for you -automatically after the first time OpenEJB boots. - -> $ cat conf/telnet.properties - - server = org.openejb.server.telnet.TelnetServer - bind = 127.0.0.1 - port = 4202 - disabled = false - threads = 5 - # only_from = 192.168.1.123 - - -You can change the IP, port, and even the number of threads allowed to -concurrently access the Telnet service via this file. - -<a name="TelnetConsole-DisablingtheTelnetService"></a> -# Disabling the Telnet Service - -Simply edit the config file and set 'disabled' to true - - - disabled = true - - -Then restart OpenEJB. - -<a name="TelnetConsole-RestrictingAccess"></a> -# Restricting Access - -It is unlikely you want just anyone to be able to login and execute -commands. While you can't restrict access on a user basis, yet, you can -restrict access to specific hosts. Host based access control (HBA) is a -built-in part of any Server Service in OpenEJB and the Telnet Service is no -different. This is done with the 'only_from' property, which like the -rest of the file is a direct copy of the xinet.d syntax for HBA. - -For an example to restrict access to the localhost, you could configure the -Telnet Service like this: - - - server = org.openejb.server.telnet.TelnetServer - bind = 127.0.0.1 - port = 4202 - disabled = false - threads = 5 - only_from = localhost - - -If you wanted to restrict access to localhost *and* say the hosts -192.168.1.207 and 192.168.1.16, you can simply add them to the list. - - - server = org.openejb.server.telnet.TelnetServer - bind = 127.0.0.1 - port = 4202 - disabled = false - threads = 5 - only_from = localhost, 192.168.1.207, 192.168.1.16 http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tip-concurrency.adoc ---------------------------------------------------------------------- diff --git a/docs/tip-concurrency.adoc b/docs/tip-concurrency.adoc new file mode 100644 index 0000000..fe641b5 --- /dev/null +++ b/docs/tip-concurrency.adoc @@ -0,0 +1,33 @@ +:index-group: Tips +and Tricks +:jbake-date: 2018-12-05 +:jbake-type: page +:jbake-status: published +:jbake-title: Global Concurrency Management + + +If for whatever reason you want to define the global default concurrency +add this to your META-INF/ejb-jar.xml: + +.... +<?xml version="1.0"?> +<ejb-jar + 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/ejb-jar_3_1.xsd" + version="3.1"> + + <enterprise-beans> + <session> + <ejb-name>*</ejb-name> + <concurrency-management-type>Bean</concurrency-management-type> + </session> + <enterprise-beans> +</ejb-jar> +.... + +You may need to create the file if it does not exist. + +.... +src/main/resources/META-INF/ejb-jar.xml +.... http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tip-concurrency.md ---------------------------------------------------------------------- diff --git a/docs/tip-concurrency.md b/docs/tip-concurrency.md deleted file mode 100644 index ba98657..0000000 --- a/docs/tip-concurrency.md +++ /dev/null @@ -1,26 +0,0 @@ -index-group=Tips and Tricks -type=page -status=published -title=Global Concurrency Management -~~~~~~ - -If for whatever reason you want to define the global default concurrency add this to your META-INF/ejb-jar.xml: - - <?xml version="1.0"?> - <ejb-jar - 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/ejb-jar_3_1.xsd" - version="3.1"> - - <enterprise-beans> - <session> - <ejb-name>*</ejb-name> - <concurrency-management-type>Bean</concurrency-management-type> - </session> - <enterprise-beans> - </ejb-jar> - -You may need to create the file if it does not exist. - - src/main/resources/META-INF/ejb-jar.xml http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tip-jersey-client.adoc ---------------------------------------------------------------------- diff --git a/docs/tip-jersey-client.adoc b/docs/tip-jersey-client.adoc new file mode 100644 index 0000000..2c6a81f --- /dev/null +++ b/docs/tip-jersey-client.adoc @@ -0,0 +1,34 @@ +:index-group: Tips +and Tricks +:jbake-date: 2018-12-05 +:jbake-type: page +:jbake-status: published +:jbake-title: Jersey Client + + +If you have an application that uses jersey-client in any way then it +may fail with an error along the lines of: + +.... +Caused by: java.lang.ClassNotFoundException: com.sun.jersey.core.util.FeaturesAndProperties +at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java) +at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java) +at org.apache.tomee.catalina.LazyStopWebappClassLoader.loadClass(LazyStopWebappClassLoader.java) +... 34 more +.... + +This is due to the fact that the jersey-core.jar contains some classes +that should not be deployed as part of a javaEE application. For +example, it contains javax.ws.rs.Path but does not contain +javax.ws.rs.core.Configurable, so the jar is usually ignored by TomEE. + +You could switch to using the http://cxf.apache.org/[Apache CXF Client], +which is what we would recommend. If you really want to keep Jersey then +you can use set the following property in your _[TomEE].properties_ + +.... +openejb.api.javax.ws.rs.Path.validation=false +.... + +This will then allow Jersey classes to be loaded by TomEE (After a +restart). http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tip-jersey-client.md ---------------------------------------------------------------------- diff --git a/docs/tip-jersey-client.md b/docs/tip-jersey-client.md deleted file mode 100644 index 9cdf120..0000000 --- a/docs/tip-jersey-client.md +++ /dev/null @@ -1,22 +0,0 @@ -index-group=Tips and Tricks -type=page -status=published -title=Jersey Client -~~~~~~ - -If you have an application that uses jersey-client in any way then it may fail with an error along the lines of: - - Caused by: java.lang.ClassNotFoundException: com.sun.jersey.core.util.FeaturesAndProperties - at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java) - at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java) - at org.apache.tomee.catalina.LazyStopWebappClassLoader.loadClass(LazyStopWebappClassLoader.java) - ... 34 more - -This is due to the fact that the jersey-core.jar contains some classes that should not be deployed as part of a javaEE application. For example, it contains javax.ws.rs.Path but does not contain javax.ws.rs.core.Configurable, so the jar is usually ignored by TomEE. - -You could switch to using the [Apache CXF Client](http://cxf.apache.org/), which is what we would recommend. -If you really want to keep Jersey then you can use set the following property in your *[TomEE]\conf\system.properties* - - openejb.api.javax.ws.rs.Path.validation=false - -This will then allow Jersey classes to be loaded by TomEE (After a restart). http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tip-weblogic.adoc ---------------------------------------------------------------------- diff --git a/docs/tip-weblogic.adoc b/docs/tip-weblogic.adoc new file mode 100644 index 0000000..df9436a --- /dev/null +++ b/docs/tip-weblogic.adoc @@ -0,0 +1,22 @@ +:index-group: Tips +and Tricks +:jbake-date: 2018-12-05 +:jbake-type: page +:jbake-status: published +:jbake-title: WebLogic Lookup + + +How to lookup WebLogic Objects from within a TomEE context: + +.... +Hashtable<String, String> props = new Hashtable<String, String>(); +props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); +props.put(javax.naming.Context.URL_PKG_PREFIXES, "weblogic.jndi.factories"); +props.put("java.naming.provider.url", "t3://your.host.name:7023"); +Context ctx = new InitialContext(props); + +IService s = (IService) ctx.lookup("java:global.com.test.ServiceImpl!com.test.IService"); +.... + +Obviously you will need to change the actual lookup to your specific +object, but you get the idea. http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tip-weblogic.md ---------------------------------------------------------------------- diff --git a/docs/tip-weblogic.md b/docs/tip-weblogic.md deleted file mode 100644 index ba78c82..0000000 --- a/docs/tip-weblogic.md +++ /dev/null @@ -1,17 +0,0 @@ -index-group=Tips and Tricks -type=page -status=published -title=WebLogic Lookup -~~~~~~ - -How to lookup WebLogic Objects from within a TomEE context: - - Hashtable<String, String> props = new Hashtable<String, String>(); - props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); - props.put(javax.naming.Context.URL_PKG_PREFIXES, "weblogic.jndi.factories"); - props.put("java.naming.provider.url", "t3://your.host.name:7023"); - Context ctx = new InitialContext(props); - - IService s = (IService) ctx.lookup("java:global.com.test.ServiceImpl!com.test.IService"); - -Obviously you will need to change the actual lookup to your specific object, but you get the idea. http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tomcat-object-factory.adoc ---------------------------------------------------------------------- diff --git a/docs/tomcat-object-factory.adoc b/docs/tomcat-object-factory.adoc new file mode 100644 index 0000000..a065dd6 --- /dev/null +++ b/docs/tomcat-object-factory.adoc @@ -0,0 +1,17 @@ +# Tomcat Object Factory +:index-group: Unrevised +:jbake-date: 2018-12-05 +:jbake-type: page +:jbake-status: published + +_The TomcatEjbFactory as discussed in the +http://www.onjava.com/pub/a/onjava/2003/02/12/ejb_tomcat.html[OnJava +article "OpenEJB: EJB for Tomcat"] is no longer required._ + +As of OpenEJB 3.0 references from Servlets to EJBs happen automatically +with usage of the [@EJB +annotation](openejbx30:injection-of-other-ejbs-example.html) in the +Servlet, Filter or Listener or with the or declared in the web.xml. + +See the openejbx30:tomcat.html[Tomcat Integration] page for the most +up-to-date details on using OpenEJB inside Tomcat. http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tomcat-object-factory.md ---------------------------------------------------------------------- diff --git a/docs/tomcat-object-factory.md b/docs/tomcat-object-factory.md deleted file mode 100644 index be91f41..0000000 --- a/docs/tomcat-object-factory.md +++ /dev/null @@ -1,15 +0,0 @@ -index-group=Unrevised -type=page -status=published -title=Tomcat Object Factory -~~~~~~ -*The TomcatEjbFactory as discussed in the [OnJava article "OpenEJB: EJB for Tomcat"](http://www.onjava.com/pub/a/onjava/2003/02/12/ejb_tomcat.html) - is no longer required.* - -As of OpenEJB 3.0 references from Servlets to EJBs happen automatically -with usage of the [@EJB annotation](openejbx30:injection-of-other-ejbs-example.html) - in the Servlet, Filter or Listener or with the <ejb-ref> or -<ejb-local-ref> declared in the web.xml. - -See the [Tomcat Integration](openejbx30:tomcat.html) - page for the most up-to-date details on using OpenEJB inside Tomcat. http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tomee-and-eclipse.adoc ---------------------------------------------------------------------- diff --git a/docs/tomee-and-eclipse.adoc b/docs/tomee-and-eclipse.adoc new file mode 100644 index 0000000..a12743d --- /dev/null +++ b/docs/tomee-and-eclipse.adoc @@ -0,0 +1,138 @@ +# TomEE and Eclipse +:index-group: IDE +:jbake-date: 2018-12-05 +:jbake-type: page +:jbake-status: published + +NOTE: Licensed to the Apache Software Foundation (ASF) under +one or more contributor license agreements. See the NOTICE file +distributed with this work for additional information regarding +copyright ownership. The ASF licenses this file to you under the Apache +License, Version 2.0 (the "License"); you may not use this file except +in compliance with the License. You may obtain a copy of the License at +. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by +applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for +the specific language governing permissions and limitations under the +License. + +Using TomEE in Eclipse is pretty simple since it uses the existing +Tomcat 7 server adaptor that comes with Eclipse. + +== Quick Start + +An excellent instructional video with step-by-step instructions on how +to install Eclipse, TomEE and create/deploy your first project is +available on YouTube here: +http://www.youtube.com/watch?v=Lr8pxEACVRI[Getting Started with Apache +TomEE] (Remember to select the 'Generate web.xml descriptor' checkbox +during project setup. Otherwise the ejb does not get injected and you +will get an error.). + +[arabic] +. Download and install both Apache TomEE and Eclipse. +. Start Eclipse and from the main menu go to *File* - *New* - *Dynamic +Web Project* +. Enter a new project name +. In the *Target Runtime* section click on the *New Runtime* button. +. Pick *Apache Tomcat v7.0* and click Next +. Change the *Name* field to _TomEE_ to indicate that this is a TomEE +server rather than a Tomcat server. +. Set the *Tomcat installation directory* by clicking the *Browse* +button and selecting the folder where you extracted TomEE +. Click *Finish* to return to the New Project dialog +. Click *Finish* to complete creating your new Project +. When you're ready to deploy your project, right-click your project and +select Run As - Run On Server +. Make sure that the _TomEE_ environment is selected in the *Server +runtime environment* +. On the *Run on Server* dialog, click the *Always use this server when +running this project* checkbox +. Click *Finish* - Eclipse will start TomEE and deploy your project + +== Advanced installation + +[arabic] +. In Eclipse, click on the *Servers* tab, right click and select New - +Server. +. Select *Apache - Tomcat v7.0 Server* and click *Next* +. Set the *Tomcat installation directory* by clicking the *Browse* +button and selecting the folder where you extracted TomEE +. Add your webapp to the server. Click *Finish*. +. In the *Servers* tab, double click on your server to open up the +*Overview* page. Click on the *Modules* tab +. Click *Add External Web Module*. In the *Add Web Module* dialog, for +document base, browse to `<TomEE>/webapps/tomee`. Set *Path:* to +`/tomee`. Uncheck *Auto reloading enabled*. Click OK. +. Return to the *Overview* tab for the server. +. Deselect the *Modules auto reload by default* checkbox. +. If you do not want Eclipse to take control of your TomEE installation, +select *Use Workspace Metadata* under *Server Locations*. Please review +the _Workspace Metadata Installation_ section below for additional steps +in this scenario. Otherwise, select *Use Tomcat Installation* +. Click the Save button in Eclipse so the server configuration gets +saved. +. Click on your webapp project, then select Project - clean. Hit OK. +This will cause Eclipse to clean and rebuild +. In the *Servers* tab, right click on the server and select *Publish*. +. Start the server. + +=== Workspace Metadata Installation + +If you used *Use Workspace Metadata* in the *Server Locations* +definition of the TomEE server, you will have to add TomEE specific +configuration files to your Servers project in your workspace in case +you need to change system properties or add containers / resources and +have those reflected in the server running under Eclipse. + +[arabic] +. Locate your TomEE server configuration in Workspace / Servers +. Right-click the server project and select *Import* +. Select General - File System and click *Next* +. Browse to your `<TomEE>/conf` folder +. Select the following files for import: `logging.properties`, +`system.properties` and `tomee.xml` +. Click *Finish* to import the files. +. In the *Servers* tab, right-click the TomEE server and select +*Publish* to publish the files to the Eclipse metadata folder + +If you need to modify system properties or change your TomEE resources, +containers, etc., you now need to make those changes in the Workspace / +Servers / `<`Your Server`>` location and publish them to the server for +the changes to take effect. + +=== JSP Hot Deployment + +If jsp changes are not being hot deployed then this is because the jsp +servlet is set to development=false in the web.xml file. To allow jsp +hot deployment alter this value to true and restart Tomee. + +This is the relevant snippet of the web.xml file. + +.... +<servlet> + <servlet-name>jsp</servlet-name> + <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> + .... + <init-param> + <param-name>development</param-name> + <param-value>true</param-value> + </init-param> + .... +</servlet> +.... + +== How to use JULI for TomEE in WTP? + +It seems that WTP doesn't manage correctly Tomcat logging configuration +(which needs to be done through system properties). A quick workaround +is to add these properties manually: + +.... +-Djava.util.logging.config.file="<tomee>/conf/logging.properties" +-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager +.... + +More information on: +http://wiki.eclipse.org/WTP_Tomcat_FAQ#How_do_I_enable_the_JULI_logging_in_a_Tomcat_5.5_Server_instance.3F http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tomee-and-eclipse.md ---------------------------------------------------------------------- diff --git a/docs/tomee-and-eclipse.md b/docs/tomee-and-eclipse.md deleted file mode 100644 index 70094f9..0000000 --- a/docs/tomee-and-eclipse.md +++ /dev/null @@ -1,145 +0,0 @@ -index-group=IDE -type=page -status=published -title=TomEE and Eclipse -~~~~~~ -Notice: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - . - http://www.apache.org/licenses/LICENSE-2.0 - . - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - -Using TomEE in Eclipse is pretty simple since it uses the existing Tomcat 7 server adaptor that comes -with Eclipse. - -## Quick Start - -An excellent instructional video with step-by-step instructions on how to install Eclipse, TomEE -and create/deploy your first project is available on YouTube here: [Getting Started with Apache TomEE][1] (Remember to select the 'Generate web.xml descriptor' checkbox during project setup. Otherwise the ejb does not get injected and you will get an error.). - -1. Download and install both Apache TomEE and Eclipse. - -1. Start Eclipse and from the main menu go to **File** - **New** - **Dynamic Web Project** - -1. Enter a new project name - -1. In the **Target Runtime** section click on the **New Runtime** button. - -1. Pick **Apache Tomcat v7.0** and click Next - -1. Change the **Name** field to *TomEE* to indicate that this is a TomEE server rather than a Tomcat server. - -1. Set the **Tomcat installation directory** by clicking the **Browse** button and selecting the folder -where you extracted TomEE - -1. Click **Finish** to return to the New Project dialog - -1. Click **Finish** to complete creating your new Project - -1. When you're ready to deploy your project, right-click your project and select Run As - Run On Server - -1. Make sure that the *TomEE* environment is selected in the **Server runtime environment** - -1. On the **Run on Server** dialog, click the **Always use this server when running this project** checkbox - -1. Click **Finish** - Eclipse will start TomEE and deploy your project - -## Advanced installation - -1. In Eclipse, click on the **Servers** tab, right click and select New - Server. - -1. Select **Apache - Tomcat v7.0 Server** and click **Next** - -1. Set the **Tomcat installation directory** by clicking the **Browse** button and selecting the folder -where you extracted TomEE - -1. Add your webapp to the server. Click **Finish**. - -1. In the **Servers** tab, double click on your server to open up the **Overview** page. -Click on the **Modules** tab - -1. Click **Add External Web Module**. In the **Add Web Module** dialog, for document base, browse -to `<TomEE>/webapps/tomee`. Set **Path:** to `/tomee`. Uncheck **Auto reloading enabled**. Click OK. - -1. Return to the **Overview** tab for the server. - -1. Deselect the **Modules auto reload by default** checkbox. - -1. If you do not want Eclipse to take control of your TomEE installation, select **Use Workspace Metadata** -under **Server Locations**. Please review the *Workspace Metadata Installation* section below for additional steps -in this scenario. Otherwise, select **Use Tomcat Installation** - -1. Click the Save button in Eclipse so the server configuration gets saved. - -1. Click on your webapp project, then select Project - clean. Hit OK. This will cause -Eclipse to clean and rebuild - -1. In the **Servers** tab, right click on the server and select **Publish**. - -1. Start the server. - -### Workspace Metadata Installation -If you used **Use Workspace Metadata** in the **Server Locations** definition of the TomEE server, -you will have to add TomEE specific configuration files to your Servers project in your workspace -in case you need to change system properties or add containers / resources and have those reflected in the -server running under Eclipse. - -1. Locate your TomEE server configuration in Workspace / Servers - -1. Right-click the server project and select **Import** - -1. Select General - File System and click **Next** - -1. Browse to your `<TomEE>/conf` folder - -1. Select the following files for import: `logging.properties`, `system.properties` and `tomee.xml` - -1. Click **Finish** to import the files. - -1. In the **Servers** tab, right-click the TomEE server and select **Publish** to publish the files to the -Eclipse metadata folder - -If you need to modify system properties or change your TomEE resources, containers, etc., you now need to make -those changes in the Workspace / Servers / `<`Your Server`>` location and publish them to the server for -the changes to take effect. - -### JSP Hot Deployment - -If jsp changes are not being hot deployed then this is because the jsp servlet is set to development=false in the web.xml file. To allow jsp hot deployment alter this value to true and restart Tomee. - -This is the relevant snippet of the web.xml file. - - <servlet> - <servlet-name>jsp</servlet-name> - <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> - .... - <init-param> - <param-name>development</param-name> - <param-value>true</param-value> - </init-param> - .... - </servlet> - -## How to use JULI for TomEE in WTP? - -It seems that WTP doesn't manage correctly Tomcat logging configuration (which needs to be done through -system properties). A quick workaround is to add these properties manually: - - -Djava.util.logging.config.file="<tomee>/conf/logging.properties" - -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager - -More information on: http://wiki.eclipse.org/WTP_Tomcat_FAQ#How_do_I_enable_the_JULI_logging_in_a_Tomcat_5.5_Server_instance.3F - - - [1]: http://www.youtube.com/watch?v=Lr8pxEACVRI "Getting Started with Apache TomEE" http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tomee-and-hibernate.adoc ---------------------------------------------------------------------- diff --git a/docs/tomee-and-hibernate.adoc b/docs/tomee-and-hibernate.adoc new file mode 100644 index 0000000..c2b4cb4 --- /dev/null +++ b/docs/tomee-and-hibernate.adoc @@ -0,0 +1,170 @@ +# TomEE and Hibernate +:index-group: JPA +:jbake-date: 2018-12-05 +:jbake-type: page +:jbake-status: published + + +Apache TomEE ships with OpenJPA as the default JPA provider, however any +valid JPA 2.0 provider can be used. + +The basic steps are: + +[arabic] +. Add the Hibernate jars to `<tomee-home>/lib/` +. Configure the webapp or the server to use Hibernate + +*The atifact versions defined here are just for example, so please feel +free to use current library versions.* + +== Webapp Configuration + +Any webapp can specify the JPA provider it would like to use via the +`persistence.xml` file, which can be at any of the following locations +in a webapp + +* `WEB-INF/persistence.xml` of the `.war` file +* `META-INF/persistence.xml` in any jar located in `WEB-INF/lib/` + +A single webapp may have many `persistence.xml` files and each may use +whichever JPA provider it needs. + +The following is an example of a fairly common `persistence.xml` for +Hibernate + +.... +<persistence version="1.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_1_0.xsd"> + + <persistence-unit name="movie-unit"> + <provider>org.hibernate.ejb.HibernatePersistence</provider> + <jta-data-source>movieDatabase</jta-data-source> + <non-jta-data-source>movieDatabaseUnmanaged</non-jta-data-source> + + <properties> + <property name="hibernate.hbm2ddl.auto" value="create-drop"/> + </properties> + </persistence-unit> +</persistence> +.... + +Note, TomEE will automatically add the following property unless it is +explicitly configured: + +.... + <property name="hibernate.transaction.manager_lookup_class" + value="org.apache.openejb.hibernate.TransactionManagerLookup"/> +.... + +== Server Configuration + +The default JPA provider can be changed at the server level to favor +Hibernate over OpenJPA. + +Using the `<tomee-home>/conf/system.properties` file or any other valid +means of setting `java.lang.System.getProperties()`, the following +standard properties can set the detault for any `persistence.xml` file. + +* `javax.persistence.provider` +* `javax.persistence.transactionType` +* `javax.persistence.jtaDataSource` +* `javax.persistence.nonJtaDataSource` + +So, for example, Hibernate can become the default provider via setting + +`CATALINA_OPTS=-Djavax.persistence.provider=org.hibernate.ejb.HibernatePersistence` + +You *must* of course add the Hibernate libraries to `<tomee-home>/lib/` +for this to work. + +== Hibernate libraries + +Jars needed for Hibernate 4.x: + +Add: + +* `<tomee-home>/lib/antlr-2.7.7.jar` +* `<tomee-home>/lib/dom4j-1.6.1.jar` +* `<tomee-home>/lib/hibernate-commons-annotations-4.0.1.Final.jar` +* `<tomee-home>/lib/hibernate-core-4.1.4.Final.jar` +* `<tomee-home>/lib/hibernate-entitymanager-4.1.4.Final.jar` +* `<tomee-home>/lib/hibernate-validator-4.3.0.Final.jar` +* `<tomee-home>/lib/jboss-logging-3.1.0.GA.jar` + +Remove (optional): + +* `<tomee-home>/lib/asm-3.2.jar` +* `<tomee-home>/lib/openjpa-2.2.0.jar` + +== Ehcache (optional) + +To use Hibernate with Ehcache, add: + +* `<tomee-home>/lib/hibernate-ehcache-4.1.4.Final.jar` +* `<tomee-home>/lib/ehcache-core-2.5.1.jar` +* `<tomee-home>/lib/ehcache-terracotta-2.5.1.jar` +* `<tomee-home>/lib/terracotta-toolkit-1.4-runtime-4.1.0.jar` + +== Infinispan (optional) + +To use Infinispan cache (default Hibernate 2nd level cache) you need the +below jars: + +There are many guides on how to use 2nd level cache with JPA 2. You can +remove OpenJPA jar so less jars are in `<tomee-home>/lib` folder. Also, +be sure to put your Database JDBC driver in `<tomee-home>/lib`. + +The actual Maven dependencies for your project can be added in the usual +way: + +.... + <!-- Hibernate --> + <dependency> + <groupId>antlr</groupId> + <artifactId>antlr</artifactId> + <version>2.7.7</version> + </dependency> + <dependency> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + <version>1.6.1</version> + </dependency> + <dependency> + <groupId>org.hibernate.common</groupId> + <artifactId>hibernate-commons-annotations</artifactId> + <version>4.0.5.Final</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-core</artifactId> + <version>4.2.16.Final</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-ehcache</artifactId> + <version>4.2.16.Final</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-entitymanager</artifactId> + <version>4.2.16.Final</version> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-validator</artifactId> + <version>4.3.2.Final</version> + </dependency> + <dependency> + <groupId>org.jboss.logging</groupId> + <artifactId>jboss-logging</artifactId> + <version>3.1.0.GA</version> + </dependency> + <dependency> + <groupId>org.javassist</groupId> + <artifactId>javassist</artifactId> + <version>3.15.0-GA</version> + </dependency> +.... http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tomee-and-hibernate.md ---------------------------------------------------------------------- diff --git a/docs/tomee-and-hibernate.md b/docs/tomee-and-hibernate.md deleted file mode 100644 index 79ebd62..0000000 --- a/docs/tomee-and-hibernate.md +++ /dev/null @@ -1,163 +0,0 @@ -index-group=JPA -type=page -status=published -title=TomEE and Hibernate -~~~~~~ - -Apache TomEE ships with OpenJPA as the default JPA provider, however any valid JPA 2.0 provider can be used. - -The basic steps are: - - 1. Add the Hibernate jars to `<tomee-home>/lib/` - 2. Configure the webapp or the server to use Hibernate - - -**The atifact versions defined here are just for example, so please feel free to use current library versions.** - -# Webapp Configuration - -Any webapp can specify the JPA provider it would like to use via the `persistence.xml` file, which can be at any of the following locations in a webapp - - - `WEB-INF/persistence.xml` of the `.war` file - - `META-INF/persistence.xml` in any jar located in `WEB-INF/lib/` - -A single webapp may have many `persistence.xml` files and each may use whichever JPA provider it needs. - -The following is an example of a fairly common `persistence.xml` for Hibernate - - <persistence version="1.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_1_0.xsd"> - - <persistence-unit name="movie-unit"> - <provider>org.hibernate.ejb.HibernatePersistence</provider> - <jta-data-source>movieDatabase</jta-data-source> - <non-jta-data-source>movieDatabaseUnmanaged</non-jta-data-source> - - <properties> - <property name="hibernate.hbm2ddl.auto" value="create-drop"/> - </properties> - </persistence-unit> - </persistence> - - -Note, TomEE will automatically add the following property unless it is explicitly configured: - - <property name="hibernate.transaction.manager_lookup_class" - value="org.apache.openejb.hibernate.TransactionManagerLookup"/> - -# Server Configuration - -The default JPA provider can be changed at the server level to favor Hibernate over OpenJPA. - -Using the `<tomee-home>/conf/system.properties` file or any other valid means of setting `java.lang.System.getProperties()`, the following standard properties can set the detault for any `persistence.xml` file. - - - `javax.persistence.provider` - - `javax.persistence.transactionType` - - `javax.persistence.jtaDataSource` - - `javax.persistence.nonJtaDataSource` - -So, for example, Hibernate can become the default provider via setting - - `CATALINA_OPTS=-Djavax.persistence.provider=org.hibernate.ejb.HibernatePersistence` - -You **must** of course add the Hibernate libraries to `<tomee-home>/lib/` for this to work. - -# Hibernate libraries - -Jars needed for Hibernate 4.x: - -Add: - -- `<tomee-home>/lib/antlr-2.7.7.jar` -- `<tomee-home>/lib/dom4j-1.6.1.jar` -- `<tomee-home>/lib/hibernate-commons-annotations-4.0.1.Final.jar` -- `<tomee-home>/lib/hibernate-core-4.1.4.Final.jar` -- `<tomee-home>/lib/hibernate-entitymanager-4.1.4.Final.jar` -- `<tomee-home>/lib/hibernate-validator-4.3.0.Final.jar` -- `<tomee-home>/lib/jboss-logging-3.1.0.GA.jar` - -Remove (optional): - -- `<tomee-home>/lib/asm-3.2.jar` -- `<tomee-home>/lib/openjpa-2.2.0.jar` - -# Ehcache (optional) - -To use Hibernate with Ehcache, add: - -- `<tomee-home>/lib/hibernate-ehcache-4.1.4.Final.jar` -- `<tomee-home>/lib/ehcache-core-2.5.1.jar` -- `<tomee-home>/lib/ehcache-terracotta-2.5.1.jar` -- `<tomee-home>/lib/terracotta-toolkit-1.4-runtime-4.1.0.jar` - -# Infinispan (optional) - -To use Infinispan cache (default Hibernate 2nd level cache) you need the below jars: - -<pre><code> - <lib>org.infinispan:infinispan-core:5.1.4.FINAL</lib> - <lib>org.hibernate:hibernate-infinispan:${hibernate.core.version}</lib> - <lib>org.jgroups:jgroups:3.0.9.Final</lib> - <lib>org.jboss.marshalling:jboss-marshalling-river:1.3.11.GA:</lib> - <lib>org.jboss.marshalling:jboss-marshalling:1.3.11.GA</lib> - <lib>org.codehaus.woodstox:woodstox-core-asl:4.1.1</lib> - <lib>org.codehaus.woodstox:stax2-api:3.1.1</lib> - <lib>org.rhq.helpers:rhq-pluginAnnotations:3.0.4</lib> - <lib>org.jboss.logmanager:jboss-logmanager:1.2.2.GA</lib> -</code></pre> - -There are many guides on how to use 2nd level cache with JPA 2. -You can remove OpenJPA jar so less jars are in `<tomee-home>/lib` folder. -Also, be sure to put your Database JDBC driver in `<tomee-home>/lib`. - -The actual Maven dependencies for your project can be added in the usual way: - - <!-- Hibernate --> - <dependency> - <groupId>antlr</groupId> - <artifactId>antlr</artifactId> - <version>2.7.7</version> - </dependency> - <dependency> - <groupId>dom4j</groupId> - <artifactId>dom4j</artifactId> - <version>1.6.1</version> - </dependency> - <dependency> - <groupId>org.hibernate.common</groupId> - <artifactId>hibernate-commons-annotations</artifactId> - <version>4.0.5.Final</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-core</artifactId> - <version>4.2.16.Final</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-ehcache</artifactId> - <version>4.2.16.Final</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-entitymanager</artifactId> - <version>4.2.16.Final</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-validator</artifactId> - <version>4.3.2.Final</version> - </dependency> - <dependency> - <groupId>org.jboss.logging</groupId> - <artifactId>jboss-logging</artifactId> - <version>3.1.0.GA</version> - </dependency> - <dependency> - <groupId>org.javassist</groupId> - <artifactId>javassist</artifactId> - <version>3.15.0-GA</version> - </dependency> http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tomee-and-intellij.adoc ---------------------------------------------------------------------- diff --git a/docs/tomee-and-intellij.adoc b/docs/tomee-and-intellij.adoc new file mode 100644 index 0000000..11ce679 --- /dev/null +++ b/docs/tomee-and-intellij.adoc @@ -0,0 +1,82 @@ +# TomEE and Intellij +:index-group: IDE +:jbake-date: 2018-12-05 +:jbake-type: page +:jbake-status: published + +NOTE: Licensed to the Apache Software Foundation (ASF) +under one or more contributor license agreements. See the NOTICE file +distributed with this work for additional information regarding +copyright ownership. The ASF licenses this file to you under the Apache +License, Version 2.0 (the "License"); you may not use this file except +in compliance with the License. You may obtain a copy of the License at +. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by +applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for +the specific language governing permissions and limitations under the +License. + +Intellij is the preferred editor of most of the developers on Apache +TomEE. It's fast and light and goes out of its way to guess what you're +thinking and act accordingly in efforts to save you time and increase +your enjoyment. In this regard TomEE and Intellij have a lot in common. + +While TomEE works with most IDEs via the Tomcat adapter and this covers +WAR files, JetBrains has stepped up to the plate with a TomEE specific +adapter to allow deployment of the full range of archives that TomEE +supports. The evolving TomEE/Intellij integration sets the pace for all +other IDE integrations. +http://youtrack.jetbrains.com/issues/IDEA[Feature requests very +welcome!] TomEE is to Intellij what GlassFish is to NetBeans and your +feedback is a critcal part of that. + +== Getting Started + +We will use one of the existing +https://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/[examples] +for this demo. Let's import it. +image:http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_01.png[alt +text] +image:http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_02.png[alt +text] +image:http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_03.png[alt +text] + +Give a minute while Intellij imports the dependencies. +image:http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_04.png[alt +text] + +It's time to run the application. Open "Edit Configurations". +image:http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_05.png[alt +text] + +Click the "+" icon and select "TomEE Server" and "Local". +image:http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_06.png[alt +text] + +If your server is still not configured, click the "Configure" button and +point it to your local TomEE installation. +image:http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_07.png[alt +text] + +If you see a warning message like "No artifacts marked for deployment", +click the "Fix" button and select one of the options. +image:http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_08.png[alt +text] + +You can change the "Application Context". +image:http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_09.png[alt +text] + +Now you can run it. Click the "play" button. +image:http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_10.png[alt +text] +image:http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_11.png[alt +text] + +Your application is up and running. +image:http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_12.png[alt +text] +image:http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_13.png[alt +text] http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tomee-and-intellij.md ---------------------------------------------------------------------- diff --git a/docs/tomee-and-intellij.md b/docs/tomee-and-intellij.md deleted file mode 100644 index 0b8ce17..0000000 --- a/docs/tomee-and-intellij.md +++ /dev/null @@ -1,81 +0,0 @@ -index-group=IDE -type=page -status=published -title=TomEE and Intellij -~~~~~~ -Notice: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - . - http://www.apache.org/licenses/LICENSE-2.0 - . - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - -Intellij is the preferred editor of most of the developers on Apache TomEE. It's fast and light and goes out of its way -to guess what you're thinking and act accordingly in efforts to save you time and increase your enjoyment. In this regard -TomEE and Intellij have a lot in common. - -While TomEE works with most IDEs via the Tomcat adapter and this covers WAR files, JetBrains has stepped up to the plate -with a TomEE specific adapter to allow deployment of the full range of archives that TomEE supports. The evolving -TomEE/Intellij integration sets the pace for all other IDE integrations. -[Feature requests very welcome!](http://youtrack.jetbrains.com/issues/IDEA) TomEE is to Intellij -what GlassFish is to NetBeans and your feedback is a critcal part of that. - - -# Getting Started - -We will use one of the existing [examples][1] for this demo. Let's import it. - ![alt text][2] - ![alt text][3] - ![alt text][4] - -Give a minute while Intellij imports the dependencies. - ![alt text][5] - -It's time to run the application. Open "Edit Configurations". - ![alt text][6] - -Click the "+" icon and select "TomEE Server" and "Local". - ![alt text][7] - -If your server is still not configured, click the "Configure" button and point it to your local TomEE installation. - ![alt text][8] - -If you see a warning message like "No artifacts marked for deployment", click the "Fix" button and select one of the options. - ![alt text][9] - -You can change the "Application Context". - ![alt text][10] - -Now you can run it. Click the "play" button. - ![alt text][11] - ![alt text][12] - -Your application is up and running. - ![alt text][13] - ![alt text][14] - - - [1]: https://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/ - [2]: http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_01.png - [3]: http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_02.png - [4]: http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_03.png - [5]: http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_04.png - [6]: http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_05.png - [7]: http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_06.png - [8]: http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_07.png - [9]: http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_08.png - [10]: http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_09.png - [11]: http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_10.png - [12]: http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_11.png - [13]: http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_12.png - [14]: http://people.apache.org/~tveronezi/tomee/tomee_site/intellij_integration/windows8_13.png http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tomee-and-netbeans.adoc ---------------------------------------------------------------------- diff --git a/docs/tomee-and-netbeans.adoc b/docs/tomee-and-netbeans.adoc new file mode 100644 index 0000000..19b99e7 --- /dev/null +++ b/docs/tomee-and-netbeans.adoc @@ -0,0 +1,107 @@ +# TomEE and NetBeans +:index-group: IDE +:jbake-date: 2018-12-05 +:jbake-type: page +:jbake-status: published + +NOTE: Licensed to the Apache Software Foundation (ASF) under +one or more contributor license agreements. See the NOTICE file +distributed with this work for additional information regarding +copyright ownership. The ASF licenses this file to you under the Apache +License, Version 2.0 (the "License"); you may not use this file except +in compliance with the License. You may obtain a copy of the License at +. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by +applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for +the specific language governing permissions and limitations under the +License. + +There is some great information over at +https://blogs.oracle.com/geertjan/entry/tomee_apache_cxf_and_maven[Geertjan's +Blog] on how to hit the ground running with Netbeans, CXF and Maven. +Geertjan is a Netbeans evangelist and has an incredible insight into +everything Netbeans. + +*WORKAROUND*: There is a known issue with Netbeans 8 and TomEE detection +that currently requires the following workaround: + +Netbeans 8 has a bug in which it fails to find the +*tomee-common-[version].jar* in the *[TomEE]/lib* directory. The +solution is to simply rename the jar file to an older version. + +For example, you have *[TomEE]/lib/tomee-common-1.6.0.2.jar* or +*[TomEE]/lib/tomee-common-1.7.1.jar*. Rename these files to +*[TomEE]/lib/tomee-common-1.6.0.jar* + +This should resolve the detection issue and will not break your +installation - Be sure to document the change for yourself as a +reminder. + +###Quickstart Check out this video on +https://www.youtube.com/watch?v=HISV7eagogI[How to Consume REST in a +Java Client] + +You can download Netbeans 8 here: +https://netbeans.org/community/releases/80/ + +Here is a quick run through on how to set up TomEE. We will use one of +the existing examples for this demo. Let's import it. + +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_01.png[Subversion +Checkout] +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_02.png[Subversion +URL] +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_03.png[Local +Project] +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_04.png[alt +text] + +Click 'Open Project'. + +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_05.png[alt +text] +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_06.png[alt +text] + +It's time to add our local TomEE server. Click 'Tools' and then +'Servers'. + +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_07.png[alt +text] + +Select 'Apache Tomcat'. + +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_08.png[alt +text] + +Select your local TomEE directory. + +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_09.png[alt +text] +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_10.png[alt +text] +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_11.png[alt +text] + +It's time to run it. Click the play button. + +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_12.png[alt +text] + +Select 'Apache Tomcat'. + +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_13.png[alt +text] + +Give it some time. It's building your application. + +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_14.png[alt +text] + +Done. Your server is up and running. + +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_15.png[alt +text] +image:http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_16.png[alt +text] http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tomee-and-netbeans.md ---------------------------------------------------------------------- diff --git a/docs/tomee-and-netbeans.md b/docs/tomee-and-netbeans.md deleted file mode 100644 index 39b5007..0000000 --- a/docs/tomee-and-netbeans.md +++ /dev/null @@ -1,97 +0,0 @@ -index-group=IDE -type=page -status=published -title=TomEE and NetBeans -~~~~~~ -Notice: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - . - http://www.apache.org/licenses/LICENSE-2.0 - . - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - -There is some great information over at [Geertjan's Blog](https://blogs.oracle.com/geertjan/entry/tomee_apache_cxf_and_maven) on how to hit the ground running with Netbeans, CXF and Maven. Geertjan is a Netbeans evangelist and has an incredible insight into everything Netbeans. - -**WORKAROUND**: There is a known issue with Netbeans 8 and TomEE detection that currently requires the following workaround: - -Netbeans 8 has a bug in which it fails to find the **tomee-common-[version].jar** in the **[TomEE]/lib** directory. The solution is to simply rename the jar file to an older version. - -For example, you have **[TomEE]/lib/tomee-common-1.6.0.2.jar** or **[TomEE]/lib/tomee-common-1.7.1.jar**. Rename these files to **[TomEE]/lib/tomee-common-1.6.0.jar** - -This should resolve the detection issue and will not break your installation - Be sure to document the change for yourself as a reminder. - -###Quickstart -Check out this video on [How to Consume REST in a Java Client ](https://www.youtube.com/watch?v=HISV7eagogI) - -You can download Netbeans 8 here: [https://netbeans.org/community/releases/80/](https://netbeans.org/community/releases/80/) - -Here is a quick run through on how to set up TomEE. We will use one of the existing examples for this demo. Let's import it. - - ![Subversion Checkout][1] - ![Subversion URL][2] - ![Local Project][3] - ![alt text][4] - -Click 'Open Project'. - - ![alt text][5] - ![alt text][6] - -It's time to add our local TomEE server. Click 'Tools' and then 'Servers'. - - ![alt text][7] - -Select 'Apache Tomcat'. - - ![alt text][8] - -Select your local TomEE directory. - - ![alt text][9] - ![alt text][10] - ![alt text][11] - -It's time to run it. Click the play button. - - ![alt text][12] - -Select 'Apache Tomcat'. - - ![alt text][13] - -Give it some time. It's building your application. - - ![alt text][14] - -Done. Your server is up and running. - - ![alt text][15] - ![alt text][16] - - - [1]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_01.png - [2]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_02.png - [3]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_03.png - [4]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_04.png - [5]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_05.png - [6]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_06.png - [7]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_07.png - [8]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_08.png - [9]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_09.png - [10]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_10.png - [11]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_11.png - [12]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_12.png - [13]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_13.png - [14]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_14.png - [15]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_15.png - [16]: http://people.apache.org/~tveronezi/tomee/tomee_site/netbeans_integration/windows8_16.png http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tomee-and-security.adoc ---------------------------------------------------------------------- diff --git a/docs/tomee-and-security.adoc b/docs/tomee-and-security.adoc new file mode 100644 index 0000000..da76d52 --- /dev/null +++ b/docs/tomee-and-security.adoc @@ -0,0 +1,54 @@ +# Apache TomEE and security +:index-group: Configuration +:jbake-date: 2018-12-05 +:jbake-type: page +:jbake-status: published + +NOTE: Licensed to the Apache Software Foundation +(ASF) under one or more contributor license agreements. See the NOTICE +file distributed with this work for additional information regarding +copyright ownership. The ASF licenses this file to you under the Apache +License, Version 2.0 (the "License"); you may not use this file except +in compliance with the License. You may obtain a copy of the License at +. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by +applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for +the specific language governing permissions and limitations under the +License. + +Rather than providing its own security implementation, TomEE makes full +use of the security features that are part of Tomcat. Any Catalina realm +is supported or you can provide your own security module using the +login.config file. + +For example, to add some simple security to the +http://tomee.apache.org/examples-trunk/webapps/moviefun/README.html[moviefun +application] , all we would need to do is: + +[arabic] +. Add some users to the tomcat-users.xml file + +. Add the necessary @DefineRoles and @RolesAllowed annotations on +MoviesImpl + +. Add some security config to do HTTP Basic authentication to web.xml +Webservice security is also looked after â username/password based +security (HTTP basic, or WS-Security) uses the same Tomcat security. +Certificate based security is also available. + +To put it short, + +* TomEE uses Tomcat's Security Realm +* .... +Extra TomEE layer adds support for JAAS JACC WS Security +.... +* .... +Supports any org.apache.catalina.Realm implementation +.... +* .... +E.g. add users to $CATALINA_BASE/conf/tomcat-users.xml +.... +* .... +Alternatively use login.config to provide your own security module +.... + +####See Also: link:tomee-jaas.html[TomEE-and-JAAS] http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tomee-and-security.md ---------------------------------------------------------------------- diff --git a/docs/tomee-and-security.md b/docs/tomee-and-security.md deleted file mode 100644 index 23e9ce0..0000000 --- a/docs/tomee-and-security.md +++ /dev/null @@ -1,45 +0,0 @@ -index-group=Configuration -type=page -status=published -title=Apache TomEE and security -~~~~~~ -Notice: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - . - http://www.apache.org/licenses/LICENSE-2.0 - . - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - -Rather than providing its own security implementation, TomEE makes full use of the security features that are part of Tomcat. Any Catalina realm is supported or you can provide your own security module using the login.config file. - -For example, to add some simple security to the [moviefun application](http://tomee.apache.org/examples-trunk/webapps/moviefun/README.html) , all we would need to do is: - -1. Add some users to the tomcat-users.xml file -2. Add the necessary @DefineRoles and @RolesAllowed annotations on MoviesImpl -3. Add some security config to do HTTP Basic authentication to web.xml Webservice security is also looked after â username/password based security (HTTP basic, or WS-Security) uses the same Tomcat security. Certificate based security is also available. - -To put it short, - -* TomEE uses Tomcat's Security Realm - -* Extra TomEE layer adds support for JAAS JACC WS Security - -* Supports any org.apache.catalina.Realm implementation - -* E.g. add users to $CATALINA_BASE/conf/tomcat-users.xml - -* Alternatively use login.config to provide your own security module - - -####See Also: -[TomEE-and-JAAS](tomee-jaas.html) http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tomee-and-webspheremq.adoc ---------------------------------------------------------------------- diff --git a/docs/tomee-and-webspheremq.adoc b/docs/tomee-and-webspheremq.adoc new file mode 100644 index 0000000..5a543f6 --- /dev/null +++ b/docs/tomee-and-webspheremq.adoc @@ -0,0 +1,26 @@ +# TomEE and WebSphere MQ +:index-group: Unrevised +:jbake-date: 2018-12-05 +:jbake-type: page +:jbake-status: published + +NOTE: Licensed to the Apache Software Foundation +(ASF) under one or more contributor license agreements. See the NOTICE +file distributed with this work for additional information regarding +copyright ownership. The ASF licenses this file to you under the Apache +License, Version 2.0 (the "License"); you may not use this file except +in compliance with the License. You may obtain a copy of the License at +. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by +applicable law or agreed to in writing, software distributed under the +License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for +the specific language governing permissions and limitations under the +License. + +*Steps to integrate TomEE with Websphere MQ* + +[arabic] +. Unzip rar file place jars under tomee/lib +. Added the below to conf/tomee.xml + +*Code:* http://git-wip-us.apache.org/repos/asf/tomee/blob/6da75cac/docs/tomee-and-webspheremq.md ---------------------------------------------------------------------- diff --git a/docs/tomee-and-webspheremq.md b/docs/tomee-and-webspheremq.md deleted file mode 100644 index 7c8ce84..0000000 --- a/docs/tomee-and-webspheremq.md +++ /dev/null @@ -1,136 +0,0 @@ -index-group=Unrevised -type=page -status=published -title=TomEE and WebSphere MQ -~~~~~~ -Notice: Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - . - http://www.apache.org/licenses/LICENSE-2.0 - . - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - -**Steps to integrate TomEE with Websphere MQ** - -1. Unzip rar file place jars under tomee/lib - -2. Added the below to conf/tomee.xml - -<pre> - <tomee> - <Container id="wmq" type="MESSAGE"> - ResourceAdapter=wmqRA - MessageListenerInterface=javax.jms.MessageListener - ActivationSpecClass=com.ibm.mq.connector.inbound.ActivationSpecImpl - </Container> - - - <Resource id="wmqRA" type="com.ibm.mq.connector.ResourceAdapterImpl" class-name="com.ibm.mq.connector.ResourceAdapterImpl"> - connectionConcurrency=5 - maxConnections=10 - logWriterEnabled=true - reconnectionRetryCount=5 - reconnectionRetryInterval=300000 - traceEnabled=false - traceLevel=3 - </Resource> - - <Resource **id="qcf"** type="javax.jms.ConnectionFactory" class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl"> - TransactionSupport=none - ResourceAdapter=wmqRA - HostName=10.a.b.c - Port=1414 - QueueManager=QM_TIERL - Channel=SYSTEM.ADMIN.SVRCONN - TransportType=Client - UserName=xyz - Password=***** - </Resource> - - <Resource id="wmq-javax.jms.QueueConnectionFactory" type="javax.jms.QueueConnectionFactory" class-name="com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl"> - TransactionSupport=xa - ResourceAdapter=wmqRA - </Resource> - - <Resource id="wmq-javax.jms.TopicConnectionFactory" type="javax.jms.TopicConnectionFactory" class-name="com.ibm.mq.connector.outbound.ManagedTopicConnectionFactoryImpl"> - TransactionSupport=xa - ResourceAdapter=wmqRA - </Resource> - - <Resource **id="queue"** type="javax.jms.Queue" -class-name="com.ibm.mq.connector.outbound.MQQueueProxy"> - arbitraryProperties - baseQueueManagerName - baseQueueName - CCSID=1208 - encoding=NATIVE - expiry=APP - failIfQuiesce=true - persistence=APP - priority=APP - readAheadClosePolicy=ALL - targetClient=JMS - </Resource> - - <Resource id="wmq-javax.jms.Topic" type="javax.jms.Topic" class-name="com.ibm.mq.connector.outbound.MQTopicProxy"> - arbitraryProperties - baseTopicName - brokerCCDurSubQueue=SYSTEM.JMS.D.CC.SUBSCRIBER.QUEUE - brokerDurSubQueue=SYSTEM.JMS.D.SUBSCRIBER.QUEUE - brokerPubQueue - brokerPubQueueManager - brokerVersion=1 - CCSID=1208 - encoding=NATIVE - expiry=APP - failIfQuiesce=true - persistence=APP - priority=APP - readAheadClosePolicy=ALL - targetClient=JMS - </Resource> - - </tomee> - -3. In web.xml add the below to access resources - <resource-ref> - <res-ref-name>myqcf< /res-ref-name> - <res-type>javax.jms.ConnectionFactory < /res-type> - <res-auth>Container</res-auth>< /br> - <res-sharing-scope>Shareable< /res-sharing-scope> - <mapped-name>qcf< /mapped-name> - </resource-ref> - - <resource-env-ref> - <resource-env-ref-name>myqueue< /resource-env-ref-name> - <resource-env-ref-type>javax.jms.Queue< /resource-env-ref-type> - <mapped-name>queue< /mapped-name> - </resource-env-ref> -</pre> - -**Code:** -<pre> - @Resource(name = "qcf") - private ConnectionFactory connectionFactory; - @Resource(name = "queue") - private Queue queue; - Connection connection = connectionFactory.createConnection(); - Session session = connection.createSession(false, QueueSession.AUTO_ACKNOWLEDGE); - MessageProducer producer = session.createProducer(queue); - TextMessage message = session.createTextMessage(); - message.setText("Test Message"); - connection.start(); - producer.send(message); - session.close(); - connection.close(); -</pre>
