reverting to not break again links user can have bookmarked, we need to fake the navigation (+ documentation is not a useful level)
git-svn-id: https://svn.apache.org/repos/asf/tomee/site/trunk/generators/site-tomee-ng@1800092 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/tomee/website/Contributors.java b/src/main/java/org/apache/tomee/website/Contributors.java
index 955c5b2..cac779a 100755
--- a/src/main/java/org/apache/tomee/website/Contributors.java
+++ b/src/main/java/org/apache/tomee/website/Contributors.java
@@ -31,7 +31,10 @@
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
@@ -51,8 +54,8 @@
public static Contributor singleLoad(final WebTarget target, final String input) throws IOException {
try {
return ofNullable(loadGravatar(target, input)).orElse(loadStatic(input));
- } catch (Throwable e) {
- System.out.println("Failed to get Contributor for " + input + " : " + e.getMessage());
+ } catch (Exception e) {
+ e.printStackTrace();
return loadStatic(input);
}
}
@@ -80,8 +83,6 @@
if (gravatar.getStatus() != HttpsURLConnection.HTTP_OK) {
System.err.println("[ERROR] No gravatar for " + mail);
return null;
- }else {
- System.out.println("Found gravatar for " + mail);
}
final Contributor contributor = ofNullable(gravatar.readEntity(Gravatar.class).getEntry())
.map(e -> e[0])
@@ -105,7 +106,7 @@
.build())
.orElse(Contributor.builder().name(mail).id(mail).build());
contributor.setCommitter(committer);
- ofNullable(contributor.getLink()).ifPresent(l -> l.sort(Comparator.comparing(Link::getName)));
+ ofNullable(contributor.getLink()).ifPresent(l -> Collections.sort(l, (o1, o2) -> o1.getName().compareTo(o2.getName())));
return contributor;
}
diff --git a/src/main/jbake/content/documentation/admin/cluster/index.adoc b/src/main/jbake/content/admin/cluster/index.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/admin/cluster/index.adoc
rename to src/main/jbake/content/admin/cluster/index.adoc
index 19ab053..a3eba39
--- a/src/main/jbake/content/documentation/admin/cluster/index.adoc
+++ b/src/main/jbake/content/admin/cluster/index.adoc
@@ -1,226 +1,226 @@
-= Clustering
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-
-=== Session clustering
-
-TomEE fully relies on Tomcat clustering: https://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html[Tomcat Clustering].
-
-The configuration is mainly in `conf/server.xml` and since TomEE 7 CDI `@SessionScoped` is transparently clustered
-through the session.
-
-=== Hazelcast as session provider
-
-Hazelcast did a post on this topic on https://hazelcast.com/use-cases/web-session-clustering/session-clustering-tomee/[Session Clustering With TomEE].
-
-Tomitribe also demonstrated you can distributed `@Stateful` beans easily relying on hazelcast: https://github.com/tomitribe/hazelcast-tomee-poc[Hazelcast TomEE PoC].
-
-=== Load balancing
-
-TomEE being a HTTP server all HTTP load balancer such as HTTPd (a.k.a. Apache2), ngnix, F5 etc... will work.
-
-More documentation on HTTPd link can be found on https://tomcat.apache.org/connectors-doc/webserver_howto/apache.html[Tomcat] website.
-
-=== EJBd
-
-If you use the EJBd protocol (`@Remote` EJB proprietary protocol of TomEE) you can get cluster features on the client
-part.
-
-==== Multicast
-
-Multicast is the preferred way to broadcast the heartbeat on the network. The simple technique of broadcasting a non-changing service URI on the network has specific advantages to multicast. The URI itself is essentially stateless and there is no "i'm alive" URI or an "i'm dead" URI.
-
-In this way the issues with UDP being unordered and unreliable melt away as state is no longer a concern and packet sizes are always small. Complicated libraries that ride atop UDP and attempt to offer reliability (retransmission) and ordering on UDP can be avoided. As well the advantages UDP has over TCP are retained as there are no java layers attempting to force UDP communication to be more TCP-like. The simple design means UDP/Multicast is only used for discovery and from there on out critical information is transmitted over TCP/IP which is obviously going to do a better job at ensuring reliability and ordering.
-
-===== Server Configuration
-
-When you boot the server there should be a conf/multicast.properties file containing:
-
-[source,bash]
-----
-server = org.apache.openejb.server.discovery.MulticastDiscoveryAgent
-bind = 239.255.2.3
-port = 6142
-disabled = true
-group = default
-----
-
-Just need to enable that by setting disabled=false. All of the above settings except server can be changed. The port and bind must be valid for general multicast/udp network communication.
-
-The group setting can be changed to further group servers that may use the same multicast channel. As shown below the client also has a group setting which can be used to select an appropriate server from the multicast channel.
-
-IMPORTANT: for multicast to work you need to have ejbd activated as a normal service. This can be done setting in `conf/system.properties` the entry: `openejb.service.manager.class = org.apache.openejb.server.SimpleServiceManager`.
-
-===== Multicast Client
-
-The multicast functionality is not just for servers to find each other in a cluster, it can also be used for EJB clients to discover a server. A special multicast:// URL can be used in the InitialContext properties to signify that multicast should be used to seed the connection process. Such as:
-
-[source,java]
-----
-Properties p = new Properties();
-p.put(Context.INITIAL_CONTEXT_FACTORY,
-"org.apache.openejb.client.RemoteInitialContextFactory");
-p.put(Context.PROVIDER_URL, "multicast://239.255.2.3:6142?group=default");
-InitialContext remoteContext = new InitialContext(p);
-----
-
-The URL has optional query parameters such as schemes and group and timeout which allow you to zero in on a particular type of service of a particular cluster group as well as set how long you are willing to wait in the discovery process till finally giving up. The first matching service that it sees "flowing" around on the UDP stream is the one it picks and sticks to for that and subsequent requests, ensuring UDP is only used when there are no other servers to talk to.
-
-Note that EJB clients do not need to use multicast to find a server. If the client knows the URL of a server in the cluster, it may use it and connect directly to that server, at which point that server will share the full list of its peers.
-
-===== Multicast Servers with TCP Clients
-
-Note that clients do not need to use multicast to communicate with servers. Servers can use multicast to discover each other, but clients are still free to connect to servers in the network using the server's TCP address.
-
-[source,java]
-----
-Properties p = new Properties();
-p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
-p.put(Context.PROVIDER_URL, "ejbd://192.168.1.30:4201");
-InitialContext remoteContext = new InitialContext(p);
-When the client connects, the server will send the URLs of all the servers in the group and failover will take place normally.
-----
-
-==== Multipulse
-
-MultiPulse is an alternative multicast lookup that does not use a regular heartbeat. Instead, servers listen for a multicast request packet (a pulse) to which a response is then sent. Multicast network traffic is effectively reduced to an absolute minimum.
-
-MultiPulse is only useful in network scenarios where both client and server can be configured to send multicast UDP packets.
-
-===== Server Configuration
-
-After you boot the server for the first time the default configuration will create the file conf/conf.d/multipulse.properties containing:
-
-[source,bash]
-----
-server = org.apache.openejb.server.discovery.MulticastPulseAgent
-bind = 239.255.2.3
-port = 6142
-disabled = true
-group = default
-----
-
-You just need to enable the agent by setting disabled = false. It is advisable to disable multicast in the multicast.properties file, or at least to use a different bind address or port should you wish to use both.
-
-All of the above settings except server can be modified as required. The port and bind must be valid for general multicast/udp network communication.
-
-The group setting can be changed to further group/cluster servers that may use the same multicast channel. As shown below the client also has an optional group setting which can be used to select an appropriate server cluster from the multicast channel (See MultiPulse Client).
-
-The next step is to ensure that the advertised services are configured for discovery. Edit the ejbd.properties file (and any other enabled services such as http, etc.) and ensure that the discovery option is set to a value that remote clients will be able to resolve.
-
-[source,bash]
-----
-server = org.apache.openejb.server.ejbd.EjbServer
-bind = 0.0.0.0
-port = 4201
-disabled = false
-threads = 20
-discovery = ejb:ejbd://{bind}:{port}
-----
-
-NOTE: If either 0.0.0.0 (IPv4) or [::] (IPv6) wildcard bind addresses are used then the server will actually broadcast all of it's known public hosts to clients. Clients will then cycle though and attempt to connect to the provided hosts until successful.
-
-If localhost is used then only clients on the same physical machine will actually 'see' the server response.
-
-===== MultiPulse Client
-
-The multipulse functionality is not just for servers to find each other in a cluster, it can also be used for EJB clients to discover a server. A special multipulse:// URL can be used in the InitialContext properties to signify that multipulse should be used to seed the connection process. Such as:
-
-[source,java]
-----
-Properties p = new Properties();
-p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
-p.put(Context.PROVIDER_URL, "multipulse://239.255.2.3:6142?group=default&timeout=250");
-InitialContext remoteContext = new InitialContext(p);
-----
-
-The URL has optional query parameters such as schemes and group and timeout which allow you to zero in on a particular type of service of a particular cluster group as well as set how long you are willing to wait in the discovery process till finally giving up. The first matching service that it sees "flowing" around on the UDP stream is the one it picks and sticks to for that and subsequent requests, ensuring UDP is only used when there are no other servers to talk to.
-
-Note that EJB clients do not need to use multipulse to find a server. If the client knows the URL of a server in the cluster, it may use it and connect directly to that server, at which point that server will share the full list of its peers.
-
-Multicast Servers with TCP Clients
-
-Note that clients do not need to use multipulse to communicate with servers. Servers can use multicast to discover each other, but clients are still free to connect to servers in the network using the server's TCP address.
-[source,java]
-----
-Properties p = new Properties();
-p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
-p.put(Context.PROVIDER_URL, "ejbd://192.168.1.30:4201");
-InitialContext remoteContext = new InitialContext(p);
-----
-
-When the client connects, the server will send the URLs of all the servers in the group and failover will take place normally.
-
-==== Multipoint
-
-As TCP has no real broadcast functionality to speak of, communication of who is in the network is achieved by each server having a physical connection to each other server in the network.
-
-To join the network, the server must be configured to know the address of at least one server in the network and connect to it. When it does both servers will exchange the full list of all the other servers each knows about. Each server will then connect to any new servers they've just learned about and repeat the processes with those new servers. The end result is that everyone has a direct connection to everyone 100% of the time, hence the made-up term "multipoint" to describe this situation of each server having multiple point-to-point connections which create a fully connected graph.
-
-On the client side things are similar. It needs to know the address of at least one server in the network and be able to connect to it. When it does it will get the full (and dynamically maintained) list of every server in the network. The client doesn't connect to each of those servers immediately, but rather consults the list in the event of a failover, using it to decide who to connect to next.
-
-The entire process is essentially the art of using a statically maintained list to bootstrap getting the more valuable dynamically maintained list.
-
-===== Server Configuration
-
-In the server this list can be specified via the conf/multipoint.properties file like so:
-
-[source,bash]
-----
-server = org.apache.openejb.server.discovery.MultipointDiscoveryAgent
-bind = 127.0.0.1
-port = 4212
-disabled = false
-initialServers = 192.168.1.20:4212, 192.168.1.30:4212, 192.168.1.40:4212
-----
-
-The above configuration shows the server has an port 4212 open for connections by other servers for multipoint communication. The initialServers list should be a comma separated list of other similar servers on the network. Only one of the servers listed is required to be running when this server starts up -- it is not required to list all servers in the network.
-
-===== Client Configuration
-
-Configuration in the client is similar, but note that EJB clients do not participate directly in multipoint communication and do not connect to the multipoint port. The server list is simply a list of the regular ejbd:// urls that a client normally uses to connect to a server.
-
-[source,java]
-----
-Properties p = new Properties();
-p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
-p.put(Context.PROVIDER_URL, "failover:ejbd://192.168.1.20:4201,ejbd://192.168.1.30:4201");
-InitialContext remoteContext = new InitialContext(p);
-----
-
-Failover can work entirely driven by the server, the client does not need to be configured to participate. A client can connect as usual to the server.
-
-[source,java]
-----
-Properties p = new Properties();
-p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
-p.put(Context.PROVIDER_URL, "ejbd://192.168.1.20:4201");
-InitialContext remoteContext = new InitialContext(p);
-----
-
-If the server at 192.168.1.20:4201 supports failover, so will the client.
-
-In this scenario the list of servers used for failover is supplied entirely by the server at 192.168.1.20:4201. The server could have aquired the list via multicast or multipoint (or both), but this detail is not visible to the client.
-
-===== Considerations
-
-====== Network size
-
-The general disadvantage of this topology is the number of connections required. The number of connections for the network of servers is equal to (n * n - n) / 2, where n is the number of servers. For example, with 5 servers you need 10 connections, with 10 servers you need 45 connections, and with 50 servers you need 1225 connections. This is of course the number of connections across the entire network, each individual server only needs n - 1 connections.
-
-The handling of these sockets is all asynchronous Java NIO code which allows the server to handle many connections (all of them) with one thread. From a pure threading perspective, the option is extremely efficient with just one thread to listen and broadcast to many peers.
-
-====== Double connect
-
-It is possible in this process that two servers learn of each other at the same time and each attempts to connect to the other simultaneously, resulting in two connections between the same two servers. When this happens both servers will detect the extra connection and one of the connections will be dropped and one will be kept. In practice this race condition rarely happens and can be avoided almost entirely by fanning out server startup by as little as 100 milliseconds.
-
-===== Recommandation
-
-As mentioned the initialServers is only used for bootstrapping the multipoint network. Once running, all servers will dynamically establish direct connections with each other and there is no single point of failure.
-
-However to ensure that the bootstrapping process can occur successfully, the initialServers property of the conf/multipoint.properties file must be set carefully and with a specific server start order in mind. Each server consults its initialServers list exactly once in the bootstrapping phase at startup, after that time connections are made dynamically.
-
-This means that at least one of the servers listed in initialServers must already be running when the server starts or the server might never become introduced and connected to all the other servers in the network.
+= Clustering
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+
+=== Session clustering
+
+TomEE fully relies on Tomcat clustering: https://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html[Tomcat Clustering].
+
+The configuration is mainly in `conf/server.xml` and since TomEE 7 CDI `@SessionScoped` is transparently clustered
+through the session.
+
+=== Hazelcast as session provider
+
+Hazelcast did a post on this topic on https://hazelcast.com/use-cases/web-session-clustering/session-clustering-tomee/[Session Clustering With TomEE].
+
+Tomitribe also demonstrated you can distributed `@Stateful` beans easily relying on hazelcast: https://github.com/tomitribe/hazelcast-tomee-poc[Hazelcast TomEE PoC].
+
+=== Load balancing
+
+TomEE being a HTTP server all HTTP load balancer such as HTTPd (a.k.a. Apache2), ngnix, F5 etc... will work.
+
+More documentation on HTTPd link can be found on https://tomcat.apache.org/connectors-doc/webserver_howto/apache.html[Tomcat] website.
+
+=== EJBd
+
+If you use the EJBd protocol (`@Remote` EJB proprietary protocol of TomEE) you can get cluster features on the client
+part.
+
+==== Multicast
+
+Multicast is the preferred way to broadcast the heartbeat on the network. The simple technique of broadcasting a non-changing service URI on the network has specific advantages to multicast. The URI itself is essentially stateless and there is no "i'm alive" URI or an "i'm dead" URI.
+
+In this way the issues with UDP being unordered and unreliable melt away as state is no longer a concern and packet sizes are always small. Complicated libraries that ride atop UDP and attempt to offer reliability (retransmission) and ordering on UDP can be avoided. As well the advantages UDP has over TCP are retained as there are no java layers attempting to force UDP communication to be more TCP-like. The simple design means UDP/Multicast is only used for discovery and from there on out critical information is transmitted over TCP/IP which is obviously going to do a better job at ensuring reliability and ordering.
+
+===== Server Configuration
+
+When you boot the server there should be a conf/multicast.properties file containing:
+
+[source,bash]
+----
+server = org.apache.openejb.server.discovery.MulticastDiscoveryAgent
+bind = 239.255.2.3
+port = 6142
+disabled = true
+group = default
+----
+
+Just need to enable that by setting disabled=false. All of the above settings except server can be changed. The port and bind must be valid for general multicast/udp network communication.
+
+The group setting can be changed to further group servers that may use the same multicast channel. As shown below the client also has a group setting which can be used to select an appropriate server from the multicast channel.
+
+IMPORTANT: for multicast to work you need to have ejbd activated as a normal service. This can be done setting in `conf/system.properties` the entry: `openejb.service.manager.class = org.apache.openejb.server.SimpleServiceManager`.
+
+===== Multicast Client
+
+The multicast functionality is not just for servers to find each other in a cluster, it can also be used for EJB clients to discover a server. A special multicast:// URL can be used in the InitialContext properties to signify that multicast should be used to seed the connection process. Such as:
+
+[source,java]
+----
+Properties p = new Properties();
+p.put(Context.INITIAL_CONTEXT_FACTORY,
+"org.apache.openejb.client.RemoteInitialContextFactory");
+p.put(Context.PROVIDER_URL, "multicast://239.255.2.3:6142?group=default");
+InitialContext remoteContext = new InitialContext(p);
+----
+
+The URL has optional query parameters such as schemes and group and timeout which allow you to zero in on a particular type of service of a particular cluster group as well as set how long you are willing to wait in the discovery process till finally giving up. The first matching service that it sees "flowing" around on the UDP stream is the one it picks and sticks to for that and subsequent requests, ensuring UDP is only used when there are no other servers to talk to.
+
+Note that EJB clients do not need to use multicast to find a server. If the client knows the URL of a server in the cluster, it may use it and connect directly to that server, at which point that server will share the full list of its peers.
+
+===== Multicast Servers with TCP Clients
+
+Note that clients do not need to use multicast to communicate with servers. Servers can use multicast to discover each other, but clients are still free to connect to servers in the network using the server's TCP address.
+
+[source,java]
+----
+Properties p = new Properties();
+p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
+p.put(Context.PROVIDER_URL, "ejbd://192.168.1.30:4201");
+InitialContext remoteContext = new InitialContext(p);
+When the client connects, the server will send the URLs of all the servers in the group and failover will take place normally.
+----
+
+==== Multipulse
+
+MultiPulse is an alternative multicast lookup that does not use a regular heartbeat. Instead, servers listen for a multicast request packet (a pulse) to which a response is then sent. Multicast network traffic is effectively reduced to an absolute minimum.
+
+MultiPulse is only useful in network scenarios where both client and server can be configured to send multicast UDP packets.
+
+===== Server Configuration
+
+After you boot the server for the first time the default configuration will create the file conf/conf.d/multipulse.properties containing:
+
+[source,bash]
+----
+server = org.apache.openejb.server.discovery.MulticastPulseAgent
+bind = 239.255.2.3
+port = 6142
+disabled = true
+group = default
+----
+
+You just need to enable the agent by setting disabled = false. It is advisable to disable multicast in the multicast.properties file, or at least to use a different bind address or port should you wish to use both.
+
+All of the above settings except server can be modified as required. The port and bind must be valid for general multicast/udp network communication.
+
+The group setting can be changed to further group/cluster servers that may use the same multicast channel. As shown below the client also has an optional group setting which can be used to select an appropriate server cluster from the multicast channel (See MultiPulse Client).
+
+The next step is to ensure that the advertised services are configured for discovery. Edit the ejbd.properties file (and any other enabled services such as http, etc.) and ensure that the discovery option is set to a value that remote clients will be able to resolve.
+
+[source,bash]
+----
+server = org.apache.openejb.server.ejbd.EjbServer
+bind = 0.0.0.0
+port = 4201
+disabled = false
+threads = 20
+discovery = ejb:ejbd://{bind}:{port}
+----
+
+NOTE: If either 0.0.0.0 (IPv4) or [::] (IPv6) wildcard bind addresses are used then the server will actually broadcast all of it's known public hosts to clients. Clients will then cycle though and attempt to connect to the provided hosts until successful.
+
+If localhost is used then only clients on the same physical machine will actually 'see' the server response.
+
+===== MultiPulse Client
+
+The multipulse functionality is not just for servers to find each other in a cluster, it can also be used for EJB clients to discover a server. A special multipulse:// URL can be used in the InitialContext properties to signify that multipulse should be used to seed the connection process. Such as:
+
+[source,java]
+----
+Properties p = new Properties();
+p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
+p.put(Context.PROVIDER_URL, "multipulse://239.255.2.3:6142?group=default&timeout=250");
+InitialContext remoteContext = new InitialContext(p);
+----
+
+The URL has optional query parameters such as schemes and group and timeout which allow you to zero in on a particular type of service of a particular cluster group as well as set how long you are willing to wait in the discovery process till finally giving up. The first matching service that it sees "flowing" around on the UDP stream is the one it picks and sticks to for that and subsequent requests, ensuring UDP is only used when there are no other servers to talk to.
+
+Note that EJB clients do not need to use multipulse to find a server. If the client knows the URL of a server in the cluster, it may use it and connect directly to that server, at which point that server will share the full list of its peers.
+
+Multicast Servers with TCP Clients
+
+Note that clients do not need to use multipulse to communicate with servers. Servers can use multicast to discover each other, but clients are still free to connect to servers in the network using the server's TCP address.
+[source,java]
+----
+Properties p = new Properties();
+p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
+p.put(Context.PROVIDER_URL, "ejbd://192.168.1.30:4201");
+InitialContext remoteContext = new InitialContext(p);
+----
+
+When the client connects, the server will send the URLs of all the servers in the group and failover will take place normally.
+
+==== Multipoint
+
+As TCP has no real broadcast functionality to speak of, communication of who is in the network is achieved by each server having a physical connection to each other server in the network.
+
+To join the network, the server must be configured to know the address of at least one server in the network and connect to it. When it does both servers will exchange the full list of all the other servers each knows about. Each server will then connect to any new servers they've just learned about and repeat the processes with those new servers. The end result is that everyone has a direct connection to everyone 100% of the time, hence the made-up term "multipoint" to describe this situation of each server having multiple point-to-point connections which create a fully connected graph.
+
+On the client side things are similar. It needs to know the address of at least one server in the network and be able to connect to it. When it does it will get the full (and dynamically maintained) list of every server in the network. The client doesn't connect to each of those servers immediately, but rather consults the list in the event of a failover, using it to decide who to connect to next.
+
+The entire process is essentially the art of using a statically maintained list to bootstrap getting the more valuable dynamically maintained list.
+
+===== Server Configuration
+
+In the server this list can be specified via the conf/multipoint.properties file like so:
+
+[source,bash]
+----
+server = org.apache.openejb.server.discovery.MultipointDiscoveryAgent
+bind = 127.0.0.1
+port = 4212
+disabled = false
+initialServers = 192.168.1.20:4212, 192.168.1.30:4212, 192.168.1.40:4212
+----
+
+The above configuration shows the server has an port 4212 open for connections by other servers for multipoint communication. The initialServers list should be a comma separated list of other similar servers on the network. Only one of the servers listed is required to be running when this server starts up -- it is not required to list all servers in the network.
+
+===== Client Configuration
+
+Configuration in the client is similar, but note that EJB clients do not participate directly in multipoint communication and do not connect to the multipoint port. The server list is simply a list of the regular ejbd:// urls that a client normally uses to connect to a server.
+
+[source,java]
+----
+Properties p = new Properties();
+p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
+p.put(Context.PROVIDER_URL, "failover:ejbd://192.168.1.20:4201,ejbd://192.168.1.30:4201");
+InitialContext remoteContext = new InitialContext(p);
+----
+
+Failover can work entirely driven by the server, the client does not need to be configured to participate. A client can connect as usual to the server.
+
+[source,java]
+----
+Properties p = new Properties();
+p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
+p.put(Context.PROVIDER_URL, "ejbd://192.168.1.20:4201");
+InitialContext remoteContext = new InitialContext(p);
+----
+
+If the server at 192.168.1.20:4201 supports failover, so will the client.
+
+In this scenario the list of servers used for failover is supplied entirely by the server at 192.168.1.20:4201. The server could have aquired the list via multicast or multipoint (or both), but this detail is not visible to the client.
+
+===== Considerations
+
+====== Network size
+
+The general disadvantage of this topology is the number of connections required. The number of connections for the network of servers is equal to (n * n - n) / 2, where n is the number of servers. For example, with 5 servers you need 10 connections, with 10 servers you need 45 connections, and with 50 servers you need 1225 connections. This is of course the number of connections across the entire network, each individual server only needs n - 1 connections.
+
+The handling of these sockets is all asynchronous Java NIO code which allows the server to handle many connections (all of them) with one thread. From a pure threading perspective, the option is extremely efficient with just one thread to listen and broadcast to many peers.
+
+====== Double connect
+
+It is possible in this process that two servers learn of each other at the same time and each attempts to connect to the other simultaneously, resulting in two connections between the same two servers. When this happens both servers will detect the extra connection and one of the connections will be dropped and one will be kept. In practice this race condition rarely happens and can be avoided almost entirely by fanning out server startup by as little as 100 milliseconds.
+
+===== Recommandation
+
+As mentioned the initialServers is only used for bootstrapping the multipoint network. Once running, all servers will dynamically establish direct connections with each other and there is no single point of failure.
+
+However to ensure that the bootstrapping process can occur successfully, the initialServers property of the conf/multipoint.properties file must be set carefully and with a specific server start order in mind. Each server consults its initialServers list exactly once in the bootstrapping phase at startup, after that time connections are made dynamically.
+
+This means that at least one of the servers listed in initialServers must already be running when the server starts or the server might never become introduced and connected to all the other servers in the network.
diff --git a/src/main/jbake/content/documentation/admin/configuration/application.adoc b/src/main/jbake/content/admin/configuration/application.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/admin/configuration/application.adoc
rename to src/main/jbake/content/admin/configuration/application.adoc
index be43cd2..5fe8d27
--- a/src/main/jbake/content/documentation/admin/configuration/application.adoc
+++ b/src/main/jbake/content/admin/configuration/application.adoc
@@ -1,100 +1,100 @@
-= Application Configuration
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-=== `application.properties`
-
-This file is located in `WEB-INF` for a war and `META-INF` for an ear.
-
-==== `@Asynchronous` configuration
-
-Default pool size for `@Asynchronous` is 5. It can be very small for some applications highly relying on
-asynchronism or reactive patterns. Therefore it is possible to customize it adding these entries in `application.properties`:
-
-[.table.table-bordered,options="header"]
-|===
-| Name | Default| Description
-| AsynchronousPool.Size | 5 | Core size of the pool
-| AsynchronousPool.CorePoolSize | 5 | Core size of the pool (inherit its default from .Size alias)
-| AsynchronousPool.MaximumPoolSize | 5 | Maximum size of the pool
-| AsynchronousPool.QueueSize | 5 | Maximum size of the pool
-| AsynchronousPool.KeepAliveTime | 1 minute | Thread keep alive duration
-| AsynchronousPool.AllowCoreThreadTimeOut | true | Should thread timeout
-| AsynchronousPool.QueueType | LINKED (or SYNCHRONOUS if size == 0) | The type of queue of the pool in ARRAY, LINKED, PRIORITY or SYNCHRONOUS (same behavior as java implementations of the same name)
-| AsynchronousPool.ShutdownWaitDuration | 1 minute | How many time to wait for the pool to shutdown when undeploying the application
-| AsynchronousPool.RejectedExecutionHandlerClass | - | A fully qualified name of a `java.util.concurrent.RejectedExecutionHandler`
-|===
-
-==== TimerService and `@Scheduled`
-
-`timerStore.class` allows to switch from the in memory (`org.apache.openejb.core.timer.MemoryTimerStore`) timer storage
-for quartz tasks to a custom implementation (using a database or anything for instance). Constructor can take a `TransactionManager`
-or nothing.
-
-All quartz properties prefixed with `org.apache.openejb.quartz.` (instead of `org.quartz.`) are passthrough to quartz.
-
-==== CDI
-
-The boolean `openejb.cdi.skip-resource-validation` allows to not validate resources ie `@EJB` and `@Resource` usages in CDI beans.
-
-All properties understood by OpenWebBeans will also be passthrough to OpenWebBeans from this location, see http://openwebbeans.apache.org/owbconfig.html[OWB config] for more details.
-
-==== `@WebServiceRef`
-
-[.table.table-bordered,options="header"]
-|===
-| Name | Description
-| cxf.jaxws.client.wsFeatures | Allows to set WSFeature on the client injection. Values is a list (comma separated) of resource id in resources.xml or fully qualified names.
-|===
-
-==== `@Stateless`
-
-[.table.table-bordered,options="header"]
-|===
-| Name | Description
-| AccessTimeout or Timeout | container timeout
-| CloseTimeout | container timeout
-| BackgroundStartup | Don't create instances in parallel if minimum count is > 0, default to false
-|===
-
-=== `resources.xml`
-
-`resources.xml` is a tomee.xml using application classloader.
-
-As `tomee.xml` it supports filtering so you can use environment variables and system properties, for instance
-to use a MySQL database on OpenShift you can do:
-
-[source,xml]
-----
-<?xml version="1.0" encoding="UTF-8"?>
-<resources>
- <Resource id="MySQL" aliases="myAppDataSourceName" type="DataSource">
- JdbcDriver = com.mysql.jdbc.Driver
- JdbcUrl = jdbc:mysql://${OPENSHIFT_MYSQL_DB_HOST}:${OPENSHIFT_MYSQL_DB_PORT}/rmannibucau?tcpKeepAlive=true
- UserName = ${OPENSHIFT_MYSQL_DB_USERNAME}
- Password = ${OPENSHIFT_MYSQL_DB_PASSWORD}
- ValidationQuery = SELECT 1
- ValidationInterval = 30000
- NumTestsPerEvictionRun = 5
- TimeBetweenEvictionRuns = 30 seconds
- TestWhileIdle = true
- MaxActive = 200
- </Resource>
-</resources>
-----
-
-`resources.xml` supports `Resource`, `Service` and `Container`.
-
-==== `resources.xml` mecanism
-
-`resources.xml` resources are still available globally like any `tomee.xml` resource.
-
-The actual resource is bound in an application subtree called with the application name and a resource facade is bound
-in the global naming tree to be able to route the requests depending the application.
-
-Typically if your application is named `myapp` and your resource id is `myresource` then instead of being registered
-as `myresource`, it will get registered as `myapp/myresource`.
-
-If you get any ambiguity in resource name matching try to fully qualified your resource prefixing it with the application name.
+= Application Configuration
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+=== `application.properties`
+
+This file is located in `WEB-INF` for a war and `META-INF` for an ear.
+
+==== `@Asynchronous` configuration
+
+Default pool size for `@Asynchronous` is 5. It can be very small for some applications highly relying on
+asynchronism or reactive patterns. Therefore it is possible to customize it adding these entries in `application.properties`:
+
+[.table.table-bordered,options="header"]
+|===
+| Name | Default| Description
+| AsynchronousPool.Size | 5 | Core size of the pool
+| AsynchronousPool.CorePoolSize | 5 | Core size of the pool (inherit its default from .Size alias)
+| AsynchronousPool.MaximumPoolSize | 5 | Maximum size of the pool
+| AsynchronousPool.QueueSize | 5 | Maximum size of the pool
+| AsynchronousPool.KeepAliveTime | 1 minute | Thread keep alive duration
+| AsynchronousPool.AllowCoreThreadTimeOut | true | Should thread timeout
+| AsynchronousPool.QueueType | LINKED (or SYNCHRONOUS if size == 0) | The type of queue of the pool in ARRAY, LINKED, PRIORITY or SYNCHRONOUS (same behavior as java implementations of the same name)
+| AsynchronousPool.ShutdownWaitDuration | 1 minute | How many time to wait for the pool to shutdown when undeploying the application
+| AsynchronousPool.RejectedExecutionHandlerClass | - | A fully qualified name of a `java.util.concurrent.RejectedExecutionHandler`
+|===
+
+==== TimerService and `@Scheduled`
+
+`timerStore.class` allows to switch from the in memory (`org.apache.openejb.core.timer.MemoryTimerStore`) timer storage
+for quartz tasks to a custom implementation (using a database or anything for instance). Constructor can take a `TransactionManager`
+or nothing.
+
+All quartz properties prefixed with `org.apache.openejb.quartz.` (instead of `org.quartz.`) are passthrough to quartz.
+
+==== CDI
+
+The boolean `openejb.cdi.skip-resource-validation` allows to not validate resources ie `@EJB` and `@Resource` usages in CDI beans.
+
+All properties understood by OpenWebBeans will also be passthrough to OpenWebBeans from this location, see http://openwebbeans.apache.org/owbconfig.html[OWB config] for more details.
+
+==== `@WebServiceRef`
+
+[.table.table-bordered,options="header"]
+|===
+| Name | Description
+| cxf.jaxws.client.wsFeatures | Allows to set WSFeature on the client injection. Values is a list (comma separated) of resource id in resources.xml or fully qualified names.
+|===
+
+==== `@Stateless`
+
+[.table.table-bordered,options="header"]
+|===
+| Name | Description
+| AccessTimeout or Timeout | container timeout
+| CloseTimeout | container timeout
+| BackgroundStartup | Don't create instances in parallel if minimum count is > 0, default to false
+|===
+
+=== `resources.xml`
+
+`resources.xml` is a tomee.xml using application classloader.
+
+As `tomee.xml` it supports filtering so you can use environment variables and system properties, for instance
+to use a MySQL database on OpenShift you can do:
+
+[source,xml]
+----
+<?xml version="1.0" encoding="UTF-8"?>
+<resources>
+ <Resource id="MySQL" aliases="myAppDataSourceName" type="DataSource">
+ JdbcDriver = com.mysql.jdbc.Driver
+ JdbcUrl = jdbc:mysql://${OPENSHIFT_MYSQL_DB_HOST}:${OPENSHIFT_MYSQL_DB_PORT}/rmannibucau?tcpKeepAlive=true
+ UserName = ${OPENSHIFT_MYSQL_DB_USERNAME}
+ Password = ${OPENSHIFT_MYSQL_DB_PASSWORD}
+ ValidationQuery = SELECT 1
+ ValidationInterval = 30000
+ NumTestsPerEvictionRun = 5
+ TimeBetweenEvictionRuns = 30 seconds
+ TestWhileIdle = true
+ MaxActive = 200
+ </Resource>
+</resources>
+----
+
+`resources.xml` supports `Resource`, `Service` and `Container`.
+
+==== `resources.xml` mecanism
+
+`resources.xml` resources are still available globally like any `tomee.xml` resource.
+
+The actual resource is bound in an application subtree called with the application name and a resource facade is bound
+in the global naming tree to be able to route the requests depending the application.
+
+Typically if your application is named `myapp` and your resource id is `myresource` then instead of being registered
+as `myresource`, it will get registered as `myapp/myresource`.
+
+If you get any ambiguity in resource name matching try to fully qualified your resource prefixing it with the application name.
diff --git a/src/main/jbake/content/documentation/admin/configuration/containers.adoc b/src/main/jbake/content/admin/configuration/containers.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/admin/configuration/containers.adoc
rename to src/main/jbake/content/admin/configuration/containers.adoc
index 3d86272..d316bbe
--- a/src/main/jbake/content/documentation/admin/configuration/containers.adoc
+++ b/src/main/jbake/content/admin/configuration/containers.adoc
@@ -1,585 +1,585 @@
-= Resources
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-All containers will be created automatically - which means you don't need to define them
-if you don't need to tune their configuration - when a bean of their type if found.
-
-To avoid that use `openejb.offline` property and set it to `true`. See link:server.html[Server Configuration] for more detail.
-
-=== @Stateless
-
-A `@Stateless` container.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Container id="Foo" type="STATELESS">
- AccessTimeout = 30 seconds
- MaxSize = 10
- MinSize = 0
- StrictPooling = true
- MaxAge = 0 hours
- ReplaceAged = true
- ReplaceFlushed = false
- MaxAgeOffset = -1
- IdleTimeout = 0 minutes
- GarbageCollection = false
- SweepInterval = 5 minutes
- CallbackThreads = 5
- CloseTimeout = 5 minutes
- UseOneSchedulerThreadByBean = false
- EvictionThreads = 1
-</Container>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Container?type=STATELESS
-Foo.AccessTimeout = 30 seconds
-Foo.MaxSize = 10
-Foo.MinSize = 0
-Foo.StrictPooling = true
-Foo.MaxAge = 0 hours
-Foo.ReplaceAged = true
-Foo.ReplaceFlushed = false
-Foo.MaxAgeOffset = -1
-Foo.IdleTimeout = 0 minutes
-Foo.GarbageCollection = false
-Foo.SweepInterval = 5 minutes
-Foo.CallbackThreads = 5
-Foo.CloseTimeout = 5 minutes
-Foo.UseOneSchedulerThreadByBean = false
-Foo.EvictionThreads = 1
-----
-
-==== Configuration
-
-===== AccessTimeout
-
-Specifies the time an invokation should wait for an instance
-of the pool to become available.
-
-After the timeout is reached, if an instance in the pool cannot
-be obtained, the method invocation will fail.
-
-Usable time units: nanoseconds, microsecons, milliseconds,
-seconds, minutes, hours, days. Or any combination such as
-"1 hour and 27 minutes and 10 seconds"
-
-Any usage of the `javax.ejb.AccessTimeout` annotation will
-override this setting for the bean or method where the
-annotation is used.
-
-===== MaxSize
-
-Specifies the size of the bean pools for this stateless
-SessionBean container. If StrictPooling is not used, instances
-will still be created beyond this number if there is demand, but
-they will not be returned to the pool and instead will be
-immediately destroyed.
-
-===== MinSize
-
-Specifies the minimum number of bean instances that should be in
-the pool for each bean. Pools are prefilled to the minimum on
-startup. Note this will create start order dependencies between
-other beans that also eagerly start, such as other `@Stateless`
-beans with a minimum or `@Singleton` beans using `@Startup`. The
-start order.
-
-The minimum pool size is rigidly maintained. Instances in the
-minimum side of the pool are not eligible for `IdleTimeout` or
-`GarbageCollection`, but are subject to `MaxAge` and flushing.
-
-If the pool is flushed it is immediately refilled to the minimum
-size with `MaxAgeOffset` applied. If an instance from the minimum
-side of the pool reaches its `MaxAge`, it is also immediately
-replaced. Replacement is done in a background queue using the
-number of threads specified by `CallbackThreads`.
-
-===== StrictPooling
-
-StrictPooling tells the container what to do when the pool
-reaches it's maximum size and there are incoming requests that
-need instances.
-
-With strict pooling, requests will have to wait for instances to
-become available. The pool size will never grow beyond the the
-set `MaxSize` value. The maximum amount of time a request should
-wait is specified via the `AccessTimeout` setting.
-
-Without strict pooling, the container will create temporary
-instances to meet demand. The instances will last for just one
-method invocation and then are removed.
-
-Setting `StrictPooling` to `false` and `MaxSize` to `0` will result in
-no pooling. Instead instances will be created on demand and live
-for exactly one method call before being removed.
-
-===== MaxAge
-
-Specifies the maximum time that an instance should live before
-it should be retired and removed from use. This will happen
-gracefully. Useful for situations where bean instances are
-designed to hold potentially expensive resources such as memory
-or file handles and need to be periodically cleared out.
-
-Usable time units: nanoseconds, microsecons, milliseconds,
-seconds, minutes, hours, days. Or any combination such as
-`1 hour and 27 minutes and 10 seconds`
-
-===== ReplaceAged
-
-When `ReplaceAged` is enabled, any instances in the pool that
-expire due to reaching their `MaxAge` will be replaced immediately
-so that the pool will remain at its current size. Replacement
-is done in a background queue so that incoming threads will not
-have to wait for instance creation.
-
-The aim of his option is to prevent user requests from paying
-the instance creation cost as `MaxAge` is enforced, potentially
-while under heavy load at peak hours.
-
-Instances from the minimum side of the pool are always replaced
-when they reach their `MaxAge`, this setting dictates the
-treatment of non-minimum instances.
-
-===== ReplaceFlushed
-
-When `ReplaceFlushed` is enabled, any instances in the pool that
-are flushed will be replaced immediately so that the pool will
-remain at its current size. Replacement is done in a background
-queue so that incoming threads will not have to wait for
-instance creation.
-
-The aim of his option is to prevent user requests from paying
-the instance creation cost if a flush performed while under
-heavy load at peak hours.
-
-Instances from the minimum side of the pool are always replaced
-when they are flushed, this setting dictates the treatment of
-non-minimum instances.
-
-A bean may flush its pool by casting the `SessionContext` to
-`Flushable` and calling `flush()`. See `SweepInterval` for details on
-how flush is performed.
-
-[source,java]
-----
-import javax.annotation.Resource;
-import javax.ejb.SessionContext;
-import javax.ejb.Stateless;
-import java.io.Flushable;
-import java.io.IOException;
-
-public class MyBean {
-
- private SessionContext sessionContext;
-
- public void flush() throws IOException {
-
- ((Flushable) sessionContext).flush();
- }
-}
-----
-
-===== MaxAgeOffset
-
-Applies to MaxAge usage and would rarely be changed, but is a
-nice feature to understand.
-
-When the container first starts and the pool is filled to the
-minimum size, all those "minimum" instances will have the same
-creation time and therefore all expire at the same time dictated
-by the `MaxAge` setting. To protect against this sudden drop
-scenario and provide a more gradual expiration from the start
-the container will spread out the age of the instances that fill
-the pool to the minimum using an offset.
-
-The `MaxAgeOffset` is not the final value of the offset, but
-rather it is used in creating the offset and allows the
-spreading to push the initial ages into the future or into the
-past. The pool is filled at startup as follows:
-
-[source,java]
-----
-for (int i = 0; i < poolMin; i++) {
- long ageOffset = (maxAge / poolMin * i * maxAgeOffset) % maxAge;
- pool.add(new Bean(), ageOffset));
-}
-----
-
-The default `MaxAgeOffset` is -1 which causes the initial
-instances in the pool to live a bit longer before expiring. As
-a concrete example, let's say the MinSize is 4 and the MaxAge is
-100 years. The generated offsets for the four instances created
-at startup would be 0, -25, -50, -75. So the first instance
-would be "born" at age 0, die at 100, living 100 years. The
-second instance would be born at -25, die at 100, living a total
-of 125 years. The third would live 150 years. The fourth 175
-years.
-
-A `MaxAgeOffset` of 1 would cause instances to be "born" older
-and therefore die sooner. Using the same example `MinSize` of 4
-and `MaxAge` of `100 years`, the life spans of these initial four
-instances would be 100, 75, 50, and 25 years respectively.
-
-A `MaxAgeOffset` of 0 will cause no "spreading" of the age of the
-first instances used to fill the pool to the minimum and these
-instances will of course reach their MaxAge at the same time.
-It is possible to set to decimal values such as -0.5, 0.5, -1.2,
-or 1.2.
-
-===== IdleTimeout
-
-Specifies the maximum time that an instance should be allowed to
-sit idly in the pool without use before it should be retired and
-removed.
-
-Usable time units: nanoseconds, microsecons, milliseconds,
-seconds, minutes, hours, days. Or any combination such as
-"1 hour and 27 minutes and 10 seconds"
-
-===== GarbageCollection
-
-Allows Garbage Collection to be used as a mechanism for shrinking
-the pool. When set to true all instances in the pool, excluding
-the minimum, are eligible for garbage collection by the virtual
-machine as per the rules of `java.lang.ref.SoftReference` and can be
-claimed by the JVM to free memory. Instances garbage collected
-will have their `@PreDestroy` methods called during finalization.
-
-In the OpenJDK VM the `-XX:SoftRefLRUPolicyMSPerMB` flag can adjust
-how aggressively SoftReferences are collected. The default
-OpenJDK setting is 1000, resulting in inactive pooled instances
-living one second of lifetime per free megabyte in the heap, which
-is very aggressive. The setting should be increased to get the
-most out of the `GarbageCollection` feature of the pool. Much
-higher settings are safe. Even a setting as high as 3600000 (1
-hour per free MB in the heap) does not affect the ability for the
-VM to garbage collect SoftReferences in the event that memory is
-needed to avoid an `OutOfMemoryException`.
-
-===== SweepInterval
-
-The frequency in which the container will sweep the pool and
-evict expired instances. Eviction is how the `IdleTimeout`,
-`MaxAge`, and pool "flush" functionality is enforced. Higher
-intervals are better.
-
-Instances in use are excluded from sweeping. Should an instance
-expire while in use it will be evicted immediately upon return
-to the pool. Effectively `MaxAge` and flushes will be enforced as
-a part of normal activity or sweeping, while IdleTimeout is only
-enforcable via sweeping. This makes aggressive sweeping less
-important for a pool under moderate load.
-
-Usable time units: nanoseconds, microsecons, milliseconds,
-seconds, minutes, hours, days. Or any combination such as
-`1 hour and 27 minutes and 10 seconds`
-
-===== CallbackThreads
-
-When sweeping the pool for expired instances a thread pool is
-used to process calling `@PreDestroy` on expired instances as well
-as creating new instances as might be required to fill the pool
-to the minimum after a Flush or `MaxAge` expiration. The
-`CallbackThreads` setting dictates the size of the thread pool and
-is shared by all beans deployed in the container.
-
-===== CloseTimeout
-
-PostConstruct methods are invoked on all instances in the pool
-when the bean is undeployed and its pool is closed. The
-`CloseTimeout` specifies the maximum time to wait for the pool to
-close and `PostConstruct` methods to be invoked.
-
-Usable time units: nanoseconds, microsecons, milliseconds,
-seconds, minutes, hours, days. Or any combination such as
-`1 hour and 27 minutes and 10 seconds`
-
-===== UseOneSchedulerThreadByBean
-
-back to previous behavior (TomEE 1.x) where 1 scheduler thread was used for stateless eviction
-by bean (ie for 500 stateless beans you get 500 eviction threads)
-
-===== EvictionThreads
-
-number of threads to associate to eviction threads (1 is not bad for most applications)
-
-
-=== @Stateful
-
-A `@Stateful` container.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Container id="Foo" type="STATEFUL">
- AccessTimeout = 30 seconds
- Cache = org.apache.openejb.core.stateful.SimpleCache
- Passivator = org.apache.openejb.core.stateful.SimplePassivater
- TimeOut = 20
- Frequency = 60
- Capacity = 1000
- BulkPassivate = 100
-</Container>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Container?type=STATEFUL
-Foo.AccessTimeout = 30 seconds
-Foo.Cache = org.apache.openejb.core.stateful.SimpleCache
-Foo.Passivator = org.apache.openejb.core.stateful.SimplePassivater
-Foo.TimeOut = 20
-Foo.Frequency = 60
-Foo.Capacity = 1000
-Foo.BulkPassivate = 100
-----
-
-==== Configuration
-
-===== AccessTimeout
-
-Specifies the maximum time an invocation could wait for the
-`@Stateful` bean instance to become available before giving up.
-
-After the timeout is reached a `javax.ejb.ConcurrentAccessTimeoutException`
-will be thrown.
-
-Usable time units: nanoseconds, microsecons, milliseconds,
-seconds, minutes, hours, days. Or any combination such as
-"1 hour and 27 minutes and 10 seconds"
-
-Any usage of the `javax.ejb.AccessTimeout` annotation will
-override this setting for the bean or method where the
-annotation is used.
-
-===== Cache
-
-The cache is responsible for managing stateful bean
-instances. The cache can page instances to disk as memory
-is filled and can destroy abandoned instances. A different
-cache implementation can be used by setting this property
-to the fully qualified class name of the Cache implementation.
-
-===== Passivator
-
-The passivator is responsible for writing beans to disk
-at passivation time. Different passivators can be used
-by setting this property to the fully qualified class name
-of the `PassivationStrategy` implementation. The passivator
-is not responsible for invoking any callbacks or other
-processing, its only responsibly is to write the bean state
-to disk.
-
-Known implementations:
-
-- org.apache.openejb.core.stateful.RAFPassivater
-- org.apache.openejb.core.stateful.SimplePassivater
-
-===== TimeOut
-
-Specifies the time a bean can be idle before it is removed by the container.
-
-This value is measured in minutes. A value of 5 would
-result in a time-out of 5 minutes between invocations.
-A value of -1 would mean no timeout.
-A value of 0 would mean a bean can be immediately removed by the container.
-
-Any usage of the `javax.ejb.StatefulTimeout` annotation will
-override this setting for the bean where the annotation is used.
-
-===== Frequency
-
-Specifies the frequency (in seconds) at which the bean cache is checked for
-idle beans.
-
-===== Capacity
-
-Specifies the size of the bean pools for this
-stateful SessionBean container.
-
-===== BulkPassivate
-
-Property name that specifies the number of instances
-to passivate at one time when doing bulk passivation.
-
-
-=== @Singleton
-
-A `@Singleton` container.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Container id="Foo" type="SINGLETON">
- AccessTimeout = 30 seconds
-</Container>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Container?type=SINGLETON
-Foo.AccessTimeout = 30 seconds
-----
-
-==== Configuration
-
-===== AccessTimeout
-
-Specifies the maximum time an invocation could wait for the
-`@Singleton` bean instance to become available before giving up.
-
-After the timeout is reached a `javax.ejb.ConcurrentAccessTimeoutException`
-will be thrown.
-
-Usable time units: nanoseconds, microsecons, milliseconds,
-seconds, minutes, hours, days. Or any combination such as
-`1 hour and 27 minutes and 10 seconds`
-
-Any usage of the `javax.ejb.AccessTimeout` annotation will
-override this setting for the bean or method where the
-annotation is used.
-
-
-=== @MessageDriven
-
-A MDB container.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Container id="Foo" type="MESSAGE">
- ResourceAdapter = Default JMS Resource Adapter
- MessageListenerInterface = javax.jms.MessageListener
- ActivationSpecClass = org.apache.activemq.ra.ActiveMQActivationSpec
- InstanceLimit = 10
- FailOnUnknowActivationSpec = true
-</Container>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Container?type=MESSAGE
-Foo.ResourceAdapter = Default JMS Resource Adapter
-Foo.MessageListenerInterface = javax.jms.MessageListener
-Foo.ActivationSpecClass = org.apache.activemq.ra.ActiveMQActivationSpec
-Foo.InstanceLimit = 10
-Foo.FailOnUnknowActivationSpec = true
-----
-
-==== Configuration
-
-===== ResourceAdapter
-
-The resource adapter delivers messages to the container
-
-===== MessageListenerInterface
-
-Specifies the message listener interface handled by this container
-
-===== ActivationSpecClass
-
-Specifies the activation spec class
-
-===== InstanceLimit
-
-Specifies the maximum number of bean instances that are
-allowed to exist for each MDB deployment.
-
-===== FailOnUnknowActivationSpec
-
-Log a warning if true or throw an exception if false is an activation spec can't be respected
-
-
-=== @Managed
-
-A managed bean container.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Container id="Foo" type="MANAGED" />
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Container?type=MANAGED
-----
-
-
-=== CMP entity
-
-A CMP bean container.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Container id="Foo" type="CMP_ENTITY">
- CmpEngineFactory = org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory
-</Container>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Container?type=CMP_ENTITY
-Foo.CmpEngineFactory = org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory
-----
-
-==== Configuration
-
-===== CmpEngineFactory
-
-The engine to use for this container. By default TomEE only provides the JPA implementation.
-
-
-=== BMP entity
-
-A BMP entity container.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Container id="Foo" type="BMP_ENTITY">
- PoolSize = 10
-</Container>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Container?type=BMP_ENTITY
-Foo.PoolSize = 10
-----
-
-==== Configuration
-
-===== PoolSize
-
-Specifies the size of the bean pools for this
-bmp entity container.
+= Resources
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+All containers will be created automatically - which means you don't need to define them
+if you don't need to tune their configuration - when a bean of their type if found.
+
+To avoid that use `openejb.offline` property and set it to `true`. See link:server.html[Server Configuration] for more detail.
+
+=== @Stateless
+
+A `@Stateless` container.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Container id="Foo" type="STATELESS">
+ AccessTimeout = 30 seconds
+ MaxSize = 10
+ MinSize = 0
+ StrictPooling = true
+ MaxAge = 0 hours
+ ReplaceAged = true
+ ReplaceFlushed = false
+ MaxAgeOffset = -1
+ IdleTimeout = 0 minutes
+ GarbageCollection = false
+ SweepInterval = 5 minutes
+ CallbackThreads = 5
+ CloseTimeout = 5 minutes
+ UseOneSchedulerThreadByBean = false
+ EvictionThreads = 1
+</Container>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Container?type=STATELESS
+Foo.AccessTimeout = 30 seconds
+Foo.MaxSize = 10
+Foo.MinSize = 0
+Foo.StrictPooling = true
+Foo.MaxAge = 0 hours
+Foo.ReplaceAged = true
+Foo.ReplaceFlushed = false
+Foo.MaxAgeOffset = -1
+Foo.IdleTimeout = 0 minutes
+Foo.GarbageCollection = false
+Foo.SweepInterval = 5 minutes
+Foo.CallbackThreads = 5
+Foo.CloseTimeout = 5 minutes
+Foo.UseOneSchedulerThreadByBean = false
+Foo.EvictionThreads = 1
+----
+
+==== Configuration
+
+===== AccessTimeout
+
+Specifies the time an invokation should wait for an instance
+of the pool to become available.
+
+After the timeout is reached, if an instance in the pool cannot
+be obtained, the method invocation will fail.
+
+Usable time units: nanoseconds, microsecons, milliseconds,
+seconds, minutes, hours, days. Or any combination such as
+"1 hour and 27 minutes and 10 seconds"
+
+Any usage of the `javax.ejb.AccessTimeout` annotation will
+override this setting for the bean or method where the
+annotation is used.
+
+===== MaxSize
+
+Specifies the size of the bean pools for this stateless
+SessionBean container. If StrictPooling is not used, instances
+will still be created beyond this number if there is demand, but
+they will not be returned to the pool and instead will be
+immediately destroyed.
+
+===== MinSize
+
+Specifies the minimum number of bean instances that should be in
+the pool for each bean. Pools are prefilled to the minimum on
+startup. Note this will create start order dependencies between
+other beans that also eagerly start, such as other `@Stateless`
+beans with a minimum or `@Singleton` beans using `@Startup`. The
+start order.
+
+The minimum pool size is rigidly maintained. Instances in the
+minimum side of the pool are not eligible for `IdleTimeout` or
+`GarbageCollection`, but are subject to `MaxAge` and flushing.
+
+If the pool is flushed it is immediately refilled to the minimum
+size with `MaxAgeOffset` applied. If an instance from the minimum
+side of the pool reaches its `MaxAge`, it is also immediately
+replaced. Replacement is done in a background queue using the
+number of threads specified by `CallbackThreads`.
+
+===== StrictPooling
+
+StrictPooling tells the container what to do when the pool
+reaches it's maximum size and there are incoming requests that
+need instances.
+
+With strict pooling, requests will have to wait for instances to
+become available. The pool size will never grow beyond the the
+set `MaxSize` value. The maximum amount of time a request should
+wait is specified via the `AccessTimeout` setting.
+
+Without strict pooling, the container will create temporary
+instances to meet demand. The instances will last for just one
+method invocation and then are removed.
+
+Setting `StrictPooling` to `false` and `MaxSize` to `0` will result in
+no pooling. Instead instances will be created on demand and live
+for exactly one method call before being removed.
+
+===== MaxAge
+
+Specifies the maximum time that an instance should live before
+it should be retired and removed from use. This will happen
+gracefully. Useful for situations where bean instances are
+designed to hold potentially expensive resources such as memory
+or file handles and need to be periodically cleared out.
+
+Usable time units: nanoseconds, microsecons, milliseconds,
+seconds, minutes, hours, days. Or any combination such as
+`1 hour and 27 minutes and 10 seconds`
+
+===== ReplaceAged
+
+When `ReplaceAged` is enabled, any instances in the pool that
+expire due to reaching their `MaxAge` will be replaced immediately
+so that the pool will remain at its current size. Replacement
+is done in a background queue so that incoming threads will not
+have to wait for instance creation.
+
+The aim of his option is to prevent user requests from paying
+the instance creation cost as `MaxAge` is enforced, potentially
+while under heavy load at peak hours.
+
+Instances from the minimum side of the pool are always replaced
+when they reach their `MaxAge`, this setting dictates the
+treatment of non-minimum instances.
+
+===== ReplaceFlushed
+
+When `ReplaceFlushed` is enabled, any instances in the pool that
+are flushed will be replaced immediately so that the pool will
+remain at its current size. Replacement is done in a background
+queue so that incoming threads will not have to wait for
+instance creation.
+
+The aim of his option is to prevent user requests from paying
+the instance creation cost if a flush performed while under
+heavy load at peak hours.
+
+Instances from the minimum side of the pool are always replaced
+when they are flushed, this setting dictates the treatment of
+non-minimum instances.
+
+A bean may flush its pool by casting the `SessionContext` to
+`Flushable` and calling `flush()`. See `SweepInterval` for details on
+how flush is performed.
+
+[source,java]
+----
+import javax.annotation.Resource;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
+import java.io.Flushable;
+import java.io.IOException;
+
+public class MyBean {
+
+ private SessionContext sessionContext;
+
+ public void flush() throws IOException {
+
+ ((Flushable) sessionContext).flush();
+ }
+}
+----
+
+===== MaxAgeOffset
+
+Applies to MaxAge usage and would rarely be changed, but is a
+nice feature to understand.
+
+When the container first starts and the pool is filled to the
+minimum size, all those "minimum" instances will have the same
+creation time and therefore all expire at the same time dictated
+by the `MaxAge` setting. To protect against this sudden drop
+scenario and provide a more gradual expiration from the start
+the container will spread out the age of the instances that fill
+the pool to the minimum using an offset.
+
+The `MaxAgeOffset` is not the final value of the offset, but
+rather it is used in creating the offset and allows the
+spreading to push the initial ages into the future or into the
+past. The pool is filled at startup as follows:
+
+[source,java]
+----
+for (int i = 0; i < poolMin; i++) {
+ long ageOffset = (maxAge / poolMin * i * maxAgeOffset) % maxAge;
+ pool.add(new Bean(), ageOffset));
+}
+----
+
+The default `MaxAgeOffset` is -1 which causes the initial
+instances in the pool to live a bit longer before expiring. As
+a concrete example, let's say the MinSize is 4 and the MaxAge is
+100 years. The generated offsets for the four instances created
+at startup would be 0, -25, -50, -75. So the first instance
+would be "born" at age 0, die at 100, living 100 years. The
+second instance would be born at -25, die at 100, living a total
+of 125 years. The third would live 150 years. The fourth 175
+years.
+
+A `MaxAgeOffset` of 1 would cause instances to be "born" older
+and therefore die sooner. Using the same example `MinSize` of 4
+and `MaxAge` of `100 years`, the life spans of these initial four
+instances would be 100, 75, 50, and 25 years respectively.
+
+A `MaxAgeOffset` of 0 will cause no "spreading" of the age of the
+first instances used to fill the pool to the minimum and these
+instances will of course reach their MaxAge at the same time.
+It is possible to set to decimal values such as -0.5, 0.5, -1.2,
+or 1.2.
+
+===== IdleTimeout
+
+Specifies the maximum time that an instance should be allowed to
+sit idly in the pool without use before it should be retired and
+removed.
+
+Usable time units: nanoseconds, microsecons, milliseconds,
+seconds, minutes, hours, days. Or any combination such as
+"1 hour and 27 minutes and 10 seconds"
+
+===== GarbageCollection
+
+Allows Garbage Collection to be used as a mechanism for shrinking
+the pool. When set to true all instances in the pool, excluding
+the minimum, are eligible for garbage collection by the virtual
+machine as per the rules of `java.lang.ref.SoftReference` and can be
+claimed by the JVM to free memory. Instances garbage collected
+will have their `@PreDestroy` methods called during finalization.
+
+In the OpenJDK VM the `-XX:SoftRefLRUPolicyMSPerMB` flag can adjust
+how aggressively SoftReferences are collected. The default
+OpenJDK setting is 1000, resulting in inactive pooled instances
+living one second of lifetime per free megabyte in the heap, which
+is very aggressive. The setting should be increased to get the
+most out of the `GarbageCollection` feature of the pool. Much
+higher settings are safe. Even a setting as high as 3600000 (1
+hour per free MB in the heap) does not affect the ability for the
+VM to garbage collect SoftReferences in the event that memory is
+needed to avoid an `OutOfMemoryException`.
+
+===== SweepInterval
+
+The frequency in which the container will sweep the pool and
+evict expired instances. Eviction is how the `IdleTimeout`,
+`MaxAge`, and pool "flush" functionality is enforced. Higher
+intervals are better.
+
+Instances in use are excluded from sweeping. Should an instance
+expire while in use it will be evicted immediately upon return
+to the pool. Effectively `MaxAge` and flushes will be enforced as
+a part of normal activity or sweeping, while IdleTimeout is only
+enforcable via sweeping. This makes aggressive sweeping less
+important for a pool under moderate load.
+
+Usable time units: nanoseconds, microsecons, milliseconds,
+seconds, minutes, hours, days. Or any combination such as
+`1 hour and 27 minutes and 10 seconds`
+
+===== CallbackThreads
+
+When sweeping the pool for expired instances a thread pool is
+used to process calling `@PreDestroy` on expired instances as well
+as creating new instances as might be required to fill the pool
+to the minimum after a Flush or `MaxAge` expiration. The
+`CallbackThreads` setting dictates the size of the thread pool and
+is shared by all beans deployed in the container.
+
+===== CloseTimeout
+
+PostConstruct methods are invoked on all instances in the pool
+when the bean is undeployed and its pool is closed. The
+`CloseTimeout` specifies the maximum time to wait for the pool to
+close and `PostConstruct` methods to be invoked.
+
+Usable time units: nanoseconds, microsecons, milliseconds,
+seconds, minutes, hours, days. Or any combination such as
+`1 hour and 27 minutes and 10 seconds`
+
+===== UseOneSchedulerThreadByBean
+
+back to previous behavior (TomEE 1.x) where 1 scheduler thread was used for stateless eviction
+by bean (ie for 500 stateless beans you get 500 eviction threads)
+
+===== EvictionThreads
+
+number of threads to associate to eviction threads (1 is not bad for most applications)
+
+
+=== @Stateful
+
+A `@Stateful` container.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Container id="Foo" type="STATEFUL">
+ AccessTimeout = 30 seconds
+ Cache = org.apache.openejb.core.stateful.SimpleCache
+ Passivator = org.apache.openejb.core.stateful.SimplePassivater
+ TimeOut = 20
+ Frequency = 60
+ Capacity = 1000
+ BulkPassivate = 100
+</Container>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Container?type=STATEFUL
+Foo.AccessTimeout = 30 seconds
+Foo.Cache = org.apache.openejb.core.stateful.SimpleCache
+Foo.Passivator = org.apache.openejb.core.stateful.SimplePassivater
+Foo.TimeOut = 20
+Foo.Frequency = 60
+Foo.Capacity = 1000
+Foo.BulkPassivate = 100
+----
+
+==== Configuration
+
+===== AccessTimeout
+
+Specifies the maximum time an invocation could wait for the
+`@Stateful` bean instance to become available before giving up.
+
+After the timeout is reached a `javax.ejb.ConcurrentAccessTimeoutException`
+will be thrown.
+
+Usable time units: nanoseconds, microsecons, milliseconds,
+seconds, minutes, hours, days. Or any combination such as
+"1 hour and 27 minutes and 10 seconds"
+
+Any usage of the `javax.ejb.AccessTimeout` annotation will
+override this setting for the bean or method where the
+annotation is used.
+
+===== Cache
+
+The cache is responsible for managing stateful bean
+instances. The cache can page instances to disk as memory
+is filled and can destroy abandoned instances. A different
+cache implementation can be used by setting this property
+to the fully qualified class name of the Cache implementation.
+
+===== Passivator
+
+The passivator is responsible for writing beans to disk
+at passivation time. Different passivators can be used
+by setting this property to the fully qualified class name
+of the `PassivationStrategy` implementation. The passivator
+is not responsible for invoking any callbacks or other
+processing, its only responsibly is to write the bean state
+to disk.
+
+Known implementations:
+
+- org.apache.openejb.core.stateful.RAFPassivater
+- org.apache.openejb.core.stateful.SimplePassivater
+
+===== TimeOut
+
+Specifies the time a bean can be idle before it is removed by the container.
+
+This value is measured in minutes. A value of 5 would
+result in a time-out of 5 minutes between invocations.
+A value of -1 would mean no timeout.
+A value of 0 would mean a bean can be immediately removed by the container.
+
+Any usage of the `javax.ejb.StatefulTimeout` annotation will
+override this setting for the bean where the annotation is used.
+
+===== Frequency
+
+Specifies the frequency (in seconds) at which the bean cache is checked for
+idle beans.
+
+===== Capacity
+
+Specifies the size of the bean pools for this
+stateful SessionBean container.
+
+===== BulkPassivate
+
+Property name that specifies the number of instances
+to passivate at one time when doing bulk passivation.
+
+
+=== @Singleton
+
+A `@Singleton` container.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Container id="Foo" type="SINGLETON">
+ AccessTimeout = 30 seconds
+</Container>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Container?type=SINGLETON
+Foo.AccessTimeout = 30 seconds
+----
+
+==== Configuration
+
+===== AccessTimeout
+
+Specifies the maximum time an invocation could wait for the
+`@Singleton` bean instance to become available before giving up.
+
+After the timeout is reached a `javax.ejb.ConcurrentAccessTimeoutException`
+will be thrown.
+
+Usable time units: nanoseconds, microsecons, milliseconds,
+seconds, minutes, hours, days. Or any combination such as
+`1 hour and 27 minutes and 10 seconds`
+
+Any usage of the `javax.ejb.AccessTimeout` annotation will
+override this setting for the bean or method where the
+annotation is used.
+
+
+=== @MessageDriven
+
+A MDB container.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Container id="Foo" type="MESSAGE">
+ ResourceAdapter = Default JMS Resource Adapter
+ MessageListenerInterface = javax.jms.MessageListener
+ ActivationSpecClass = org.apache.activemq.ra.ActiveMQActivationSpec
+ InstanceLimit = 10
+ FailOnUnknowActivationSpec = true
+</Container>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Container?type=MESSAGE
+Foo.ResourceAdapter = Default JMS Resource Adapter
+Foo.MessageListenerInterface = javax.jms.MessageListener
+Foo.ActivationSpecClass = org.apache.activemq.ra.ActiveMQActivationSpec
+Foo.InstanceLimit = 10
+Foo.FailOnUnknowActivationSpec = true
+----
+
+==== Configuration
+
+===== ResourceAdapter
+
+The resource adapter delivers messages to the container
+
+===== MessageListenerInterface
+
+Specifies the message listener interface handled by this container
+
+===== ActivationSpecClass
+
+Specifies the activation spec class
+
+===== InstanceLimit
+
+Specifies the maximum number of bean instances that are
+allowed to exist for each MDB deployment.
+
+===== FailOnUnknowActivationSpec
+
+Log a warning if true or throw an exception if false is an activation spec can't be respected
+
+
+=== @Managed
+
+A managed bean container.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Container id="Foo" type="MANAGED" />
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Container?type=MANAGED
+----
+
+
+=== CMP entity
+
+A CMP bean container.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Container id="Foo" type="CMP_ENTITY">
+ CmpEngineFactory = org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory
+</Container>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Container?type=CMP_ENTITY
+Foo.CmpEngineFactory = org.apache.openejb.core.cmp.jpa.JpaCmpEngineFactory
+----
+
+==== Configuration
+
+===== CmpEngineFactory
+
+The engine to use for this container. By default TomEE only provides the JPA implementation.
+
+
+=== BMP entity
+
+A BMP entity container.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Container id="Foo" type="BMP_ENTITY">
+ PoolSize = 10
+</Container>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Container?type=BMP_ENTITY
+Foo.PoolSize = 10
+----
+
+==== Configuration
+
+===== PoolSize
+
+Specifies the size of the bean pools for this
+bmp entity container.
diff --git a/src/main/jbake/content/documentation/admin/configuration/index.adoc b/src/main/jbake/content/admin/configuration/index.adoc
old mode 100644
new mode 100755
similarity index 97%
rename from src/main/jbake/content/documentation/admin/configuration/index.adoc
rename to src/main/jbake/content/admin/configuration/index.adoc
index a483971..a0964aa
--- a/src/main/jbake/content/documentation/admin/configuration/index.adoc
+++ b/src/main/jbake/content/admin/configuration/index.adoc
@@ -1,24 +1,24 @@
-= How to configure
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-=== Container
-
-TomEE specific configuration (ie not inherited one from Tomcat) is based on properties. Therefore
-you can fully configure TomEE using properties in `conf/system.properties`.
-However for convenience it also provides a hybrid XML alternative a.k.a. `conf/tomee.xml`.
-
-- link:server.html[Server Configuration: Properties].
-- link:resources.html[Resources]
-- link:containers.html[Containers]
-
-=== Application
-
-Some settings can be specific to applications, these ones are also properties based and
-are read in `WEB-INF/application.properties`. When you can't use `tomee.xml` to configure
-resources you can use `WEB-INF/resources.xml` which inherit from `tomee.xml` its syntax
-but binds the resources to the application and reuses the application classloader.
-
-More about link:application.html[Container Configuration].
+= Configuration
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+=== Container
+
+TomEE specific configuration (ie not inherited one from Tomcat) is based on properties. Therefore
+you can fully configure TomEE using properties in `conf/system.properties`.
+However for convenience it also provides a hybrid XML alternative a.k.a. `conf/tomee.xml`.
+
+- link:server.html[Server Configuration: Properties].
+- link:resources.html[Resources]
+- link:containers.html[Containers]
+
+=== Application
+
+Some settings can be specific to applications, these ones are also properties based and
+are read in `WEB-INF/application.properties`. When you can't use `tomee.xml` to configure
+resources you can use `WEB-INF/resources.xml` which inherit from `tomee.xml` its syntax
+but binds the resources to the application and reuses the application classloader.
+
+More about link:application.html[Container Configuration].
diff --git a/src/main/jbake/content/documentation/admin/configuration/resources.adoc b/src/main/jbake/content/admin/configuration/resources.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/admin/configuration/resources.adoc
rename to src/main/jbake/content/admin/configuration/resources.adoc
index dc8d84a..4c256b8
--- a/src/main/jbake/content/documentation/admin/configuration/resources.adoc
+++ b/src/main/jbake/content/admin/configuration/resources.adoc
@@ -1,572 +1,572 @@
-= Resources
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-In TomEE resources are mainly "singleton" (understood as defined once per server or application). Technically
-it can be anything but you will probably meet more Datasources than other type of resources.
-
-
-Most resources will be created automatically if there is no matching resources - by name and type -
-when an injection will be found. To avoid that use `openejb.offline` property and set it to `true`.
-See link:server.html[Server Configuration] for more detail.
-
-=== Definition a resource: how does it work?
-
-Before all let see how properties syntax is equivalent to XML one (system.properties and tomee.xml typically).
-
-Properties syntax uses dot notation to represent setters/properties which are plain properties in XML syntax
-and a URL syntax with query parameters to define the resource where it is directly the resource and tag attributes in XML.
-Finally the id is an attribute in XML and the key of the resource definition in properties.
-
-Let see it with a sample, both delcarations are the same:
-
-[source,bash]
-----
-myDataSource = new://Resource?type=DataSource
-myDataSource.JdbcUrl = jdbc:hsqldb:mem:site
-myDataSource.UserName = sa
-----
-
-[source,xml]
-----
-<Resource id="myDataSource" type="DataSource">
- JdbcUrl = jdbc:hsqldb:mem:site
- UserName = sa
-</Resource>
-----
-
-One started you can get injected any resource using `@Resource`:
-
-[source,java]
-----
-@Resource(name = "myDataSource")
-private DataSource dataSource;
-----
-
-=== Factory syntax
-
-Here are the attributes of a resource:
-
-[.table.table-bordered,options="header"]
-|===
-| Name | Optional |Description
-| id | false | name of the resource, will match `openejb:Resource/id` in JNDI tree.
-| provider | true | define a default resource definition using service-jar.xml
-| class-name | true |specify which class to instantiate
-| factory-name | true |specify which method to invoke on the class-name when specified to create the resource
-| properties-provider | true |a class responsible to provide to tomee the properties to use, it can have a property `serviceId` to know which resource it is.
-| classpath | true | a classpath to use to create the resource. Note: if not implementing an interface the resource will be isolated from the applications.
-| aliases | true | other names for the resource, allows for instance to share the same pool for a datasource used with multiple names in applications.
-| post-construct/pre-destroy | true | methods called when creating/destroying the resources.
-| Lazy | true | for resources set them to be created when first accessed and not when deployed
-|===
-
-TomEE supports some implicit properties for resources but sometimes you just want to fully control the
-resource and not use implicit properties which can be affected to a property which doesn't expect such a value (typically the case
-if you create a custom Oracle datasource). For such case you can set `SkipImplicitAttributes` property to `true` and your resource
-will ignore implicit properties.
-
-Implicit properties are:
-
-[.table.table-bordered,options="header"]
-|===
-| Name | Description
-| transactionManager | The JTA transaction manager
-| ServiceId | the "id" of the resource (its name)
-|===
-
-In the same spirit you can skip properties fallback using `SkipPropertiesFallback` and setting it to `true`. It typically avoids to
-fallback all unset properties (no matching property found) to a `Properties` instance and set it if one matching property is found.
-In Oracle case for instance it matches the connection properties which can have side effects.
-
-===== Value ciphering
-
-The propertie values support ciphering using the syntax `cipher:{algorithm}:{cipheredValue}`, for instance `cipher:Static3DES:xMH5uM1V9vQzVUv5LG7YLA==` will
-be read as `Passw0rd`. Ciphers can be computed using `tomee.sh` script: `${tomee.home}/bin/tomee.sh cipher Passw0rd`.
-
-=== Common Resources
-
-==== DataSources
-
-DataSources have defaults for all values and a default datasource can be provided automatically but if you want to
-configure it here are the common properties:
-
-You can set the boolean `JtaManaged` to false if you don't want your datasource to be using JTA - if you manage transactions yourself.
-
-Then other configurations are linked the pool the datasource is using. By default TomEE uses https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html[tomcat-jdbc] but we also provide
-https://commons.apache.org/proper/commons-dbcp/configuration.html[commons-dbcp] (2 for TomEE 7.x and 1 for TomEE 1.x).
-The properties are then the related configurations with these particular
-entries we try to keep in sync for both:
-
-[.table.table-bordered,options="header"]
-|===
-| Name|Description
-| JdbcDriver | the jdbc driver of the datasource
-| JdbcUrl | the jdbc url of the datasource
-| Username | the user to use
-| Password | the password of the user
-|===
-
-===== Password and ciphering
-
-DataSource were the first resource to support password ciphering. Originally it was another property which is still supported.
-It is called `PasswordCipher`. Its value is the ciphering algorithm and it affects the password value. However `cipher:xxx`
-is still supported on `Password` value. Default `PasswordCipher` being `PlainText` it behaves as no ciphering is in place by default.
-
-Sample:
-
-[source,bash]
-----
-ds = new://Resource?type=javax.sql.DataSource
-# our password is "Passw0rd"
-ds.Password = xMH5uM1V9vQzVUv5LG7YLA==
-ds.PasswordCipher = Static3DES
-----
-
-===== Advanced DataSource configuration
-
-TomEE also provides few utilities you can add in DataSource properties:
-
-[.table.table-bordered,options="header"]
-|===
-| Name | Description
-| LogSql | Should SQL be logged (using TomEE logger)
-| LogSqlPackages | if set the logging will show the matching packages (separated by comma) inline when logging the query, allows to know where a query comes from
-| Flushable| if true the datasource can be casted as a Flushable to recreate the pool
-| ResetOnError | if a `SQLException` happens the pool is automatically recreated. Configuration is either "true" to do it each time an exception occurs, `x` or `retry(x)` to do it and retry until maximum `x` times
-| ResetOnErrorMethods | which methods are handled by ResetOnError
-| TomEEProxyHandler | Custom `InvocationHandler` wrapping the datasource calls
-| DataSourceCreator | which pool to use, `dbcp`, `tomcat`, `dbcp-alternative` (DBCP and TomEE proxying instead of DBCP JTA integration), `simple` (no pooling)
-|===
-
-===== DataSource and JTA
-
-`JtaManaged` determines wether or not this data source should be JTA managed
-or user managed. If set to 'true' it will automatically be enrolled
-in any ongoing transactions. Calling begin/commit/rollback or setAutoCommit
-on the datasource or connection will not be allowed. If you need to perform
-these functions yourself, set `JtaManaged` to `false`
-
-===== DataSource and JPA
-
-In terms of JPA persistence.xml:
-
-- `JtaManaged=true` can be used as a 'jta-data-source'
-- `JtaManaged=false` can be used as a 'non-jta-data-source'
-
-=== ActiveMQResourceAdapter
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Resource id="Foo" type="ActiveMQResourceAdapter">
- BrokerXmlConfig = broker:(tcp://localhost:61616)?useJmx=false
- ServerUrl = vm://localhost?waitForStart=20000&async=true
- DataSource = Default Unmanaged JDBC Database
- StartupTimeout = 10 seconds
-</Resource>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Resource?type=ActiveMQResourceAdapter
-Foo.BrokerXmlConfig = broker:(tcp://localhost:61616)?useJmx=false
-Foo.ServerUrl = vm://localhost?waitForStart=20000&async=true
-Foo.DataSource = Default Unmanaged JDBC Database
-Foo.StartupTimeout = 10 seconds
-----
-
-==== Configuration
-
-===== BrokerXmlConfig
-
-Broker configuration URI as defined by ActiveMQ
-see http://activemq.apache.org/broker-configuration-uri.html
-BrokerXmlConfig xbean:file:conf/activemq.xml - Requires xbean-spring.jar and dependencies
-
-===== ServerUrl
-
-Broker address
-
-===== DataSource
-
-DataSource for persistence messages
-
-===== StartupTimeout
-
-How long to wait for broker startup
-
-
-=== javax.jms.ConnectionFactory
-
-An ActiveMQ (JMS) connection factory.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Resource id="Foo" type="javax.jms.ConnectionFactory">
- ResourceAdapter = Default JMS Resource Adapter
- TransactionSupport = xa
- PoolMaxSize = 10
- PoolMinSize = 0
- ConnectionMaxWaitTime = 5 seconds
- ConnectionMaxIdleTime = 15 Minutes
-</Resource>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Resource?type=javax.jms.ConnectionFactory
-Foo.ResourceAdapter = Default JMS Resource Adapter
-Foo.TransactionSupport = xa
-Foo.PoolMaxSize = 10
-Foo.PoolMinSize = 0
-Foo.ConnectionMaxWaitTime = 5 seconds
-Foo.ConnectionMaxIdleTime = 15 Minutes
-----
-
-==== Configuration
-
-===== ResourceAdapter
-
-An ActiveMQ (JMS) resource adapter.
-
-===== TransactionSupport
-
-Specifies if the connection is enrolled in global transaction
-allowed values: `xa`, `local` or `none`. Default to `xa`.
-
-===== PoolMaxSize
-
-Maximum number of physical connection to the ActiveMQ broker.
-
-===== PoolMinSize
-
-Minimum number of physical connection to the ActiveMQ broker.
-
-===== ConnectionMaxWaitTime
-
-Maximum amount of time to wait for a connection.
-
-===== ConnectionMaxIdleTime
-
-Maximum amount of time a connection can be idle before being reclaimed.
-
-
-=== javax.jms.Queue
-
-An ActiveMQ (JMS) queue.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Resource id="Foo" type="javax.jms.Queue">
- # not set means id
- destination =
-</Resource>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Resource?type=javax.jms.Queue
-# not set means id
-Foo.destination =
-----
-
-==== Configuration
-
-===== destination
-
-Specifies the name of the queue
-
-
-=== javax.jms.Topic
-
-An ActiveMQ (JMS) topic.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Resource id="Foo" type="javax.jms.Topic">
- # not set means id
- destination =
-</Resource>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Resource?type=javax.jms.Topic
-# not set means id
-Foo.destination =
-----
-
-==== Configuration
-
-===== destination
-
-Specifies the name of the topic
-
-
-=== org.omg.CORBA.ORB
-
-NOTE: to use it you need to add an implementation of corba.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Resource id="Foo" type="org.omg.CORBA.ORB" />
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Resource?type=org.omg.CORBA.ORB
-----
-
-
-=== javax.mail.Session
-
-A mail session.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Resource id="mail/mysession" type="javax.mail.Session">
- mail.transport.protocol = smtp
- mail.smtp.host = smtp.provider.com
- mail.smtp.auth = true
- mail.smtp.starttls.enable = true
- mail.smtp.port = 587
- mail.smtp.user = user@provider.com
- password = abcdefghij
-</Resource>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-mail/mysession = new://Resource?type=javax.mail.Session
-mail/mysession.mail.transport.protocol = smtp
-mail/mysession.mail.smtp.host = smtp.provider.com
-mail/mysession.mail.smtp.auth = true
-mail/mysession.mail.smtp.starttls.enable = true
-mail/mysession.mail.smtp.port = 587
-mail/mysession.mail.smtp.user = user@provider.com
-mail/mysession.password = abcdefghij
-----
-
-The properties are `javax.mail.Session` ones with the addition of `useDefault` which specifies if `getDefaultInstance()`
-or `getInstance` is used to create the session. `getDefaultInstance()` will ensure that several calls are done with the
-same configuration and return the same instance. For tomee it is likely better to rely on `getInstance()`(ie keep `useDefault` to false)
-and use `aliases` option of the resource to define an alias if you need to share the same instance accross multiple names.
-
-
-=== ManagedExecutorService
-
-A concurrency utility for EE executor service.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Resource id="Foo" type="ManagedExecutorService">
- Core = 5
- Max = 25
- KeepAlive = 5 s
- Queue = 15
- ThreadFactory = org.apache.openejb.threads.impl.ManagedThreadFactoryImpl
- Lazy = true
-</Resource>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Resource?type=ManagedExecutorService
-Foo.Core = 5
-Foo.Max = 25
-Foo.KeepAlive = 5 s
-Foo.Queue = 15
-Foo.ThreadFactory = org.apache.openejb.threads.impl.ManagedThreadFactoryImpl
-Foo.Lazy = true
-----
-
-==== Configuration
-
-===== Core
-
-The pool core size.
-
-===== Max
-
-The pool max size.
-
-===== KeepAlive
-
-The thread keep alive time (in duration format)
-
-===== Queue
-
-The queue type size.
-
-===== ThreadFactory
-
-The thread factory implementation class.
-
-===== Lazy
-
-If set to true the pool is created when first accessed otherwise it is created at startup.
-
-
-=== ManagedScheduledExecutorService
-
-Inherit from `ManagedExecutorService` and adds scheduling abilities.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Resource id="Foo" type="ManagedScheduledExecutorService">
- Core = 5
- ThreadFactory = org.apache.openejb.threads.impl.ManagedThreadFactoryImpl
- Lazy = true
-</Resource>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Resource?type=ManagedScheduledExecutorService
-Foo.Core = 5
-Foo.ThreadFactory = org.apache.openejb.threads.impl.ManagedThreadFactoryImpl
-Foo.Lazy = true
-----
-
-==== Configuration
-
-See `ManagedExecutorService`.
-
-
-=== ManagedThreadFactory
-
-A thread factory for a `ManagedExecutorService`.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Resource id="Foo" type="ManagedThreadFactory">
- Prefix = openejb-managed-thread-
- Lazy = true
-</Resource>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Resource?type=ManagedThreadFactory
-Foo.Prefix = openejb-managed-thread-
-Foo.Lazy = true
-----
-
-==== Configuration
-
-===== Prefix
-
-The thread prefix (suffixed with thread id).
-
-
-
-=== ContextService
-
-A concurrency utilities for JavaEE context service. It allows to create
-contextual proxies (inheriting from security, classloader...contexts).
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Resource id="Foo" type="ContextService" />
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Resource?type=ContextService
-----
-
-
-=== JndiProvider: inject remote clients
-
-A thread factory for a `ManagedExecutorService`.
-Default implementation is `org.apache.openejb.threads.impl.ManagedThreadFactoryImpl`.
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Resource id="Foo" type="ManagedThreadFactory">
- Prefix = openejb-managed-thread-
- Lazy = true
-</Resource>
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Resource?type=ManagedThreadFactory
-Foo.Prefix = openejb-managed-thread-
-Foo.Lazy = true
-----
-
-==== Configuration
-
-===== Prefix
-
-The thread prefix (suffixed with thread id).
-
-
-
-=== ContextService
-
-A concurrency utilities for JavaEE context service. It allows to create
-contextual proxies (inheriting from security, classloader...contexts).
-
-Declarable in tomee.xml via
-
-[source,xml]
-----
-<Resource id="Foo" type="ContextService" />
-----
-
-Declarable in properties via
-
-[source,bash]
-----
-Foo = new://Resource?type=ContextService
-----
-
-
+= Resources
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+In TomEE resources are mainly "singleton" (understood as defined once per server or application). Technically
+it can be anything but you will probably meet more Datasources than other type of resources.
+
+
+Most resources will be created automatically if there is no matching resources - by name and type -
+when an injection will be found. To avoid that use `openejb.offline` property and set it to `true`.
+See link:server.html[Server Configuration] for more detail.
+
+=== Definition a resource: how does it work?
+
+Before all let see how properties syntax is equivalent to XML one (system.properties and tomee.xml typically).
+
+Properties syntax uses dot notation to represent setters/properties which are plain properties in XML syntax
+and a URL syntax with query parameters to define the resource where it is directly the resource and tag attributes in XML.
+Finally the id is an attribute in XML and the key of the resource definition in properties.
+
+Let see it with a sample, both delcarations are the same:
+
+[source,bash]
+----
+myDataSource = new://Resource?type=DataSource
+myDataSource.JdbcUrl = jdbc:hsqldb:mem:site
+myDataSource.UserName = sa
+----
+
+[source,xml]
+----
+<Resource id="myDataSource" type="DataSource">
+ JdbcUrl = jdbc:hsqldb:mem:site
+ UserName = sa
+</Resource>
+----
+
+One started you can get injected any resource using `@Resource`:
+
+[source,java]
+----
+@Resource(name = "myDataSource")
+private DataSource dataSource;
+----
+
+=== Factory syntax
+
+Here are the attributes of a resource:
+
+[.table.table-bordered,options="header"]
+|===
+| Name | Optional |Description
+| id | false | name of the resource, will match `openejb:Resource/id` in JNDI tree.
+| provider | true | define a default resource definition using service-jar.xml
+| class-name | true |specify which class to instantiate
+| factory-name | true |specify which method to invoke on the class-name when specified to create the resource
+| properties-provider | true |a class responsible to provide to tomee the properties to use, it can have a property `serviceId` to know which resource it is.
+| classpath | true | a classpath to use to create the resource. Note: if not implementing an interface the resource will be isolated from the applications.
+| aliases | true | other names for the resource, allows for instance to share the same pool for a datasource used with multiple names in applications.
+| post-construct/pre-destroy | true | methods called when creating/destroying the resources.
+| Lazy | true | for resources set them to be created when first accessed and not when deployed
+|===
+
+TomEE supports some implicit properties for resources but sometimes you just want to fully control the
+resource and not use implicit properties which can be affected to a property which doesn't expect such a value (typically the case
+if you create a custom Oracle datasource). For such case you can set `SkipImplicitAttributes` property to `true` and your resource
+will ignore implicit properties.
+
+Implicit properties are:
+
+[.table.table-bordered,options="header"]
+|===
+| Name | Description
+| transactionManager | The JTA transaction manager
+| ServiceId | the "id" of the resource (its name)
+|===
+
+In the same spirit you can skip properties fallback using `SkipPropertiesFallback` and setting it to `true`. It typically avoids to
+fallback all unset properties (no matching property found) to a `Properties` instance and set it if one matching property is found.
+In Oracle case for instance it matches the connection properties which can have side effects.
+
+===== Value ciphering
+
+The propertie values support ciphering using the syntax `cipher:{algorithm}:{cipheredValue}`, for instance `cipher:Static3DES:xMH5uM1V9vQzVUv5LG7YLA==` will
+be read as `Passw0rd`. Ciphers can be computed using `tomee.sh` script: `${tomee.home}/bin/tomee.sh cipher Passw0rd`.
+
+=== Common Resources
+
+==== DataSources
+
+DataSources have defaults for all values and a default datasource can be provided automatically but if you want to
+configure it here are the common properties:
+
+You can set the boolean `JtaManaged` to false if you don't want your datasource to be using JTA - if you manage transactions yourself.
+
+Then other configurations are linked the pool the datasource is using. By default TomEE uses https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html[tomcat-jdbc] but we also provide
+https://commons.apache.org/proper/commons-dbcp/configuration.html[commons-dbcp] (2 for TomEE 7.x and 1 for TomEE 1.x).
+The properties are then the related configurations with these particular
+entries we try to keep in sync for both:
+
+[.table.table-bordered,options="header"]
+|===
+| Name|Description
+| JdbcDriver | the jdbc driver of the datasource
+| JdbcUrl | the jdbc url of the datasource
+| Username | the user to use
+| Password | the password of the user
+|===
+
+===== Password and ciphering
+
+DataSource were the first resource to support password ciphering. Originally it was another property which is still supported.
+It is called `PasswordCipher`. Its value is the ciphering algorithm and it affects the password value. However `cipher:xxx`
+is still supported on `Password` value. Default `PasswordCipher` being `PlainText` it behaves as no ciphering is in place by default.
+
+Sample:
+
+[source,bash]
+----
+ds = new://Resource?type=javax.sql.DataSource
+# our password is "Passw0rd"
+ds.Password = xMH5uM1V9vQzVUv5LG7YLA==
+ds.PasswordCipher = Static3DES
+----
+
+===== Advanced DataSource configuration
+
+TomEE also provides few utilities you can add in DataSource properties:
+
+[.table.table-bordered,options="header"]
+|===
+| Name | Description
+| LogSql | Should SQL be logged (using TomEE logger)
+| LogSqlPackages | if set the logging will show the matching packages (separated by comma) inline when logging the query, allows to know where a query comes from
+| Flushable| if true the datasource can be casted as a Flushable to recreate the pool
+| ResetOnError | if a `SQLException` happens the pool is automatically recreated. Configuration is either "true" to do it each time an exception occurs, `x` or `retry(x)` to do it and retry until maximum `x` times
+| ResetOnErrorMethods | which methods are handled by ResetOnError
+| TomEEProxyHandler | Custom `InvocationHandler` wrapping the datasource calls
+| DataSourceCreator | which pool to use, `dbcp`, `tomcat`, `dbcp-alternative` (DBCP and TomEE proxying instead of DBCP JTA integration), `simple` (no pooling)
+|===
+
+===== DataSource and JTA
+
+`JtaManaged` determines wether or not this data source should be JTA managed
+or user managed. If set to 'true' it will automatically be enrolled
+in any ongoing transactions. Calling begin/commit/rollback or setAutoCommit
+on the datasource or connection will not be allowed. If you need to perform
+these functions yourself, set `JtaManaged` to `false`
+
+===== DataSource and JPA
+
+In terms of JPA persistence.xml:
+
+- `JtaManaged=true` can be used as a 'jta-data-source'
+- `JtaManaged=false` can be used as a 'non-jta-data-source'
+
+=== ActiveMQResourceAdapter
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Resource id="Foo" type="ActiveMQResourceAdapter">
+ BrokerXmlConfig = broker:(tcp://localhost:61616)?useJmx=false
+ ServerUrl = vm://localhost?waitForStart=20000&async=true
+ DataSource = Default Unmanaged JDBC Database
+ StartupTimeout = 10 seconds
+</Resource>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Resource?type=ActiveMQResourceAdapter
+Foo.BrokerXmlConfig = broker:(tcp://localhost:61616)?useJmx=false
+Foo.ServerUrl = vm://localhost?waitForStart=20000&async=true
+Foo.DataSource = Default Unmanaged JDBC Database
+Foo.StartupTimeout = 10 seconds
+----
+
+==== Configuration
+
+===== BrokerXmlConfig
+
+Broker configuration URI as defined by ActiveMQ
+see http://activemq.apache.org/broker-configuration-uri.html
+BrokerXmlConfig xbean:file:conf/activemq.xml - Requires xbean-spring.jar and dependencies
+
+===== ServerUrl
+
+Broker address
+
+===== DataSource
+
+DataSource for persistence messages
+
+===== StartupTimeout
+
+How long to wait for broker startup
+
+
+=== javax.jms.ConnectionFactory
+
+An ActiveMQ (JMS) connection factory.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Resource id="Foo" type="javax.jms.ConnectionFactory">
+ ResourceAdapter = Default JMS Resource Adapter
+ TransactionSupport = xa
+ PoolMaxSize = 10
+ PoolMinSize = 0
+ ConnectionMaxWaitTime = 5 seconds
+ ConnectionMaxIdleTime = 15 Minutes
+</Resource>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Resource?type=javax.jms.ConnectionFactory
+Foo.ResourceAdapter = Default JMS Resource Adapter
+Foo.TransactionSupport = xa
+Foo.PoolMaxSize = 10
+Foo.PoolMinSize = 0
+Foo.ConnectionMaxWaitTime = 5 seconds
+Foo.ConnectionMaxIdleTime = 15 Minutes
+----
+
+==== Configuration
+
+===== ResourceAdapter
+
+An ActiveMQ (JMS) resource adapter.
+
+===== TransactionSupport
+
+Specifies if the connection is enrolled in global transaction
+allowed values: `xa`, `local` or `none`. Default to `xa`.
+
+===== PoolMaxSize
+
+Maximum number of physical connection to the ActiveMQ broker.
+
+===== PoolMinSize
+
+Minimum number of physical connection to the ActiveMQ broker.
+
+===== ConnectionMaxWaitTime
+
+Maximum amount of time to wait for a connection.
+
+===== ConnectionMaxIdleTime
+
+Maximum amount of time a connection can be idle before being reclaimed.
+
+
+=== javax.jms.Queue
+
+An ActiveMQ (JMS) queue.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Resource id="Foo" type="javax.jms.Queue">
+ # not set means id
+ destination =
+</Resource>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Resource?type=javax.jms.Queue
+# not set means id
+Foo.destination =
+----
+
+==== Configuration
+
+===== destination
+
+Specifies the name of the queue
+
+
+=== javax.jms.Topic
+
+An ActiveMQ (JMS) topic.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Resource id="Foo" type="javax.jms.Topic">
+ # not set means id
+ destination =
+</Resource>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Resource?type=javax.jms.Topic
+# not set means id
+Foo.destination =
+----
+
+==== Configuration
+
+===== destination
+
+Specifies the name of the topic
+
+
+=== org.omg.CORBA.ORB
+
+NOTE: to use it you need to add an implementation of corba.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Resource id="Foo" type="org.omg.CORBA.ORB" />
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Resource?type=org.omg.CORBA.ORB
+----
+
+
+=== javax.mail.Session
+
+A mail session.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Resource id="mail/mysession" type="javax.mail.Session">
+ mail.transport.protocol = smtp
+ mail.smtp.host = smtp.provider.com
+ mail.smtp.auth = true
+ mail.smtp.starttls.enable = true
+ mail.smtp.port = 587
+ mail.smtp.user = user@provider.com
+ password = abcdefghij
+</Resource>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+mail/mysession = new://Resource?type=javax.mail.Session
+mail/mysession.mail.transport.protocol = smtp
+mail/mysession.mail.smtp.host = smtp.provider.com
+mail/mysession.mail.smtp.auth = true
+mail/mysession.mail.smtp.starttls.enable = true
+mail/mysession.mail.smtp.port = 587
+mail/mysession.mail.smtp.user = user@provider.com
+mail/mysession.password = abcdefghij
+----
+
+The properties are `javax.mail.Session` ones with the addition of `useDefault` which specifies if `getDefaultInstance()`
+or `getInstance` is used to create the session. `getDefaultInstance()` will ensure that several calls are done with the
+same configuration and return the same instance. For tomee it is likely better to rely on `getInstance()`(ie keep `useDefault` to false)
+and use `aliases` option of the resource to define an alias if you need to share the same instance accross multiple names.
+
+
+=== ManagedExecutorService
+
+A concurrency utility for EE executor service.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Resource id="Foo" type="ManagedExecutorService">
+ Core = 5
+ Max = 25
+ KeepAlive = 5 s
+ Queue = 15
+ ThreadFactory = org.apache.openejb.threads.impl.ManagedThreadFactoryImpl
+ Lazy = true
+</Resource>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Resource?type=ManagedExecutorService
+Foo.Core = 5
+Foo.Max = 25
+Foo.KeepAlive = 5 s
+Foo.Queue = 15
+Foo.ThreadFactory = org.apache.openejb.threads.impl.ManagedThreadFactoryImpl
+Foo.Lazy = true
+----
+
+==== Configuration
+
+===== Core
+
+The pool core size.
+
+===== Max
+
+The pool max size.
+
+===== KeepAlive
+
+The thread keep alive time (in duration format)
+
+===== Queue
+
+The queue type size.
+
+===== ThreadFactory
+
+The thread factory implementation class.
+
+===== Lazy
+
+If set to true the pool is created when first accessed otherwise it is created at startup.
+
+
+=== ManagedScheduledExecutorService
+
+Inherit from `ManagedExecutorService` and adds scheduling abilities.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Resource id="Foo" type="ManagedScheduledExecutorService">
+ Core = 5
+ ThreadFactory = org.apache.openejb.threads.impl.ManagedThreadFactoryImpl
+ Lazy = true
+</Resource>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Resource?type=ManagedScheduledExecutorService
+Foo.Core = 5
+Foo.ThreadFactory = org.apache.openejb.threads.impl.ManagedThreadFactoryImpl
+Foo.Lazy = true
+----
+
+==== Configuration
+
+See `ManagedExecutorService`.
+
+
+=== ManagedThreadFactory
+
+A thread factory for a `ManagedExecutorService`.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Resource id="Foo" type="ManagedThreadFactory">
+ Prefix = openejb-managed-thread-
+ Lazy = true
+</Resource>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Resource?type=ManagedThreadFactory
+Foo.Prefix = openejb-managed-thread-
+Foo.Lazy = true
+----
+
+==== Configuration
+
+===== Prefix
+
+The thread prefix (suffixed with thread id).
+
+
+
+=== ContextService
+
+A concurrency utilities for JavaEE context service. It allows to create
+contextual proxies (inheriting from security, classloader...contexts).
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Resource id="Foo" type="ContextService" />
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Resource?type=ContextService
+----
+
+
+=== JndiProvider: inject remote clients
+
+A thread factory for a `ManagedExecutorService`.
+Default implementation is `org.apache.openejb.threads.impl.ManagedThreadFactoryImpl`.
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Resource id="Foo" type="ManagedThreadFactory">
+ Prefix = openejb-managed-thread-
+ Lazy = true
+</Resource>
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Resource?type=ManagedThreadFactory
+Foo.Prefix = openejb-managed-thread-
+Foo.Lazy = true
+----
+
+==== Configuration
+
+===== Prefix
+
+The thread prefix (suffixed with thread id).
+
+
+
+=== ContextService
+
+A concurrency utilities for JavaEE context service. It allows to create
+contextual proxies (inheriting from security, classloader...contexts).
+
+Declarable in tomee.xml via
+
+[source,xml]
+----
+<Resource id="Foo" type="ContextService" />
+----
+
+Declarable in properties via
+
+[source,bash]
+----
+Foo = new://Resource?type=ContextService
+----
+
+
diff --git a/src/main/jbake/content/documentation/admin/configuration/server.adoc b/src/main/jbake/content/admin/configuration/server.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/admin/configuration/server.adoc
rename to src/main/jbake/content/admin/configuration/server.adoc
index db2ff19..9f6f1c4
--- a/src/main/jbake/content/documentation/admin/configuration/server.adoc
+++ b/src/main/jbake/content/admin/configuration/server.adoc
@@ -1,86 +1,86 @@
-= Container Configuration
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-=== Server
-
-[.table.table-bordered,options="header"]
-|===
-|Name |Value| Description
-|openejb.embedded.remotable| bool| activate or not the remote services when available
-|.bind, <service prefix>.port, <service prefix>.disabled, <service prefix>.threads | host or IP, port, bool|override the host. Available for ejbd and httpejbd services (used by jaxws and jaxrs), number of thread to manage requests
-|openejb.embedded.initialcontext.close |LOGOUT or DESTROY| configure the hook called when closing the initial context. Useful when starting OpenEJB from a new InitialContext([properties]) instantiation. By default it simply logs out the logged user if it exists. DESTROY means clean the container.
-|javax.persistence.provider |string| override the JPA provider value
-|javax.persistence.transactionType |string| override the transaction type for persistence contexts
-|javax.persistence.jtaDataSource |string| override the JTA datasource value for persistence contexts
-|javax.persistence.nonJtaDataSource| string |override the non JTA datasource value for persistence contexts
-|openejb.descriptors.output |bool| dump memory deployment descriptors. Can be used to set complete metadata to true and avoid scanning when starting the container or to check the used configuration.
-|openejb.deployments.classpath.require.descriptor |CLIENT or EJB| can allow to filter what you want to scan (client modules or ejb modules)
-|openejb.descriptors.output.folder| path| where to dump deployement descriptors if activated.
-|openejb.strict.interface.declaration |bool| add some validations on session beans (spec validations in particular). false by default.
-|openejb.conf.file or openejb.configuration| string| OpenEJB configuration file path
-|openejb.debuggable-vm-hackery |bool| remove JMS informations from deployment
-|openejb.validation.skip |bool |skip the validations done when OpenEJB deploys beans
-|openejb.deployments.classpath.ear |bool| deploy the classpath as an ear
-|openejb.webservices.enabled| bool |activate or not webservices
-|openejb.validation.output.level| TERSE or MEDIUM or VERBOSE| level of the logs used to report validation errors
-|openejb.user.mbeans.list * or a list of classes separated by ,| list of mbeans to deploy automatically
-|openejb.deploymentId.format composition (+string) of {ejbName} {ejbType} {ejbClass} and {ejbClass.simpleName} default {ejbName}. The format to use to deploy ejbs.
-|openejb.deployments.classpath |bool| whether or not deploy from classpath
-|openejb.deployments.classpath.include and openejb.deployments.classpath.exclude |regex| regex to filter the scanned classpath (when you are in this case)
-|openejb.deployments.package.include and openejb.deployments.package.exclude| regex| regex to filter scanned packages
-|openejb.autocreate.jta-datasource-from-non-jta-one| bool| whether or not auto create the jta datasource if it doesn't exist but a non jta datasource exists. Useful when using hibernate to be able to get a real non jta datasource.
-|openejb.altdd.prefix |string| prefix use for altDD (example test to use a test.ejb-jar.xml).
-|org.apache.openejb.default.system.interceptors |class names|list of interceptor (qualified names) separated by a comma or a space add these interceptor on all beans
-|openejb.jndiname.strategy.class |class name| an implementation of org.apache.openejb.assembler.classic.JndiBuilder.JndiNameStrategy
-|openejb.jndiname.failoncollision| bool| if a NameAlreadyBoundException is thrown or not when 2 EJBs have the same name
-|openejb.jndiname.format |string|composition of these properties: ejbType, ejbClass, ejbClass.simpleName, ejbClass.packageName, ejbName, deploymentId, interfaceType, interfaceType.annotationName, interfaceType.annotationNameLC, interfaceType.xmlName, interfaceType.xmlNameCc, interfaceType.openejbLegacyName, interfaceClass, interfaceClass.simpleName, interfaceClass.packageName default {deploymentId}{interfaceType.annotationName}. Change the name used for the ejb.
-|openejb.org.quartz.threadPool.class |class| qualified name which implements org.quartz.spi.ThreadPool the thread pool used by quartz (used to manage ejb timers)
-|openejb.localcopy |bool| default true. whether or not copy EJB arguments[/method/interface] for remote invocations.
-|openejb.cxf.jax-rs.providers |string|the list of the qualified name of the JAX-RS providers separated by comma or space. Note: to specify a provider for a specific service suffix its class qualified name by ".providers", the value follow the same rules. Note 2: default is a shortcut for jaxb and json providers.
-|openejb.wsAddress.format |string| composition of {ejbJarId}, ejbDeploymentId, ejbType, ejbClass, ejbClass.simpleName, ejbName, portComponentName, wsdlPort, wsdlService default /{ejbDeploymentId}. The WS name format.
-|org.apache.openejb.server.webservices.saaj.provider| axis2, sun or null |specified the saaj configuration
-|[<uppercase service name>.]<service id>.<name> or [<uppercase service name>.]<service id> |whatever is supported (generally string, int ...)| set this value to the corresponding service. example: [EnterpriseBean.]<ejb-name>.activation.<property>, [PERSISTENCEUNIT.]<persistence unit name>.<property>, [RESOURCE.]<name>
-|log4j.category.OpenEJB.options| DEBUG, INFO, ... |active one OpenEJB log level. need log4j in the classpath
-|openejb.jmx.active| bool| activate (by default) or not the OpenEJB JMX MBeans
-|openejb.nobanner |bool| activate or not the OpenEJB banner (activated by default)
-|openejb.check.classloader |bool| if true print some information about duplicated classes
-|openejb.check.classloader.verbose| bool| if true print classes intersections
-|openejb.additional.exclude |string separated by comma| list of prefixes you want to exclude and are not in the default list of exclusion
-|openejb.additional.include |string separated by comma| list of prefixes you want to remove from thedefault list of exclusion
-|openejb.offline |bool| if true can create datasources and containers automatically
-|openejb.exclude-include.order| include-exclude or exclude-include| if the inclusion/exclusion should win on conflicts (intersection)
-|openejb.log.color |bool| activate or not the color in the console in embedded mode
-|openejb.log.color.<level in lowercase> |color in uppercase |set a color for a particular level. Color are BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, DEFAULT.
-|tomee.serialization.class.blacklist| string |default list of packages/classnames excluded for EJBd deserialization (needs to be set on server and client sides). Please see the description of Ejbd Transport for details.
-|tomee.serialization.class.whitelist| string| default list of packages/classnames allowed for EJBd deserialization (blacklist wins over whitelist, needs to be set on server and client sides). Please see the description of Ejbd Transport for details.
-|tomee.remote.support |boolean |if true /tomee webapp is auto-deployed and EJBd is active (true by default for 1.x, false for 7.x excepted for tomee maven plugin and arquillian)
-|openejb.crosscontext |bool| set the cross context property on tomcat context (can be done in the traditionnal way if the deployment is don through the webapp discovery and not the OpenEJB Deployer EJB)
-|openejb.jsessionid-support |bool| remove URL from session tracking modes for this context (see javax.servlet.SessionTrackingMode)
-|openejb.myfaces.disable-default-values |bool| by default TomEE will initialize myfaces with some its default values to avoid useless logging
-|openejb.web.xml.major |int| major version of web.xml. Can be useful to force tomcat to scan servlet 3 annotatino when deploying with a servlet 2.x web.xml
-|tomee.jaxws.subcontext |string| sub context used to bind jaxws web services, default is webservices
-|openejb.servicemanager.enabled |bool| run all services detected or only known available services (WS and RS
-|tomee.jaxws.oldsubcontext |bool| wether or not activate old way to bind jaxws webservices directly on root context
-|openejb.modulename.useHash |bool| add a hash after the module name of the webmodule if it is generated from the webmodule location, it avoids conflicts between multiple deployment (through ear) of the same webapp. Note: it disactivated by default since names are less nice this way.
-|openejb.session.manager |qualified name (string)| configure a session managaer to use for all contexts
-|tomee.tomcat.resource.wrap |bool|wrap tomcat resources (context.xml) as tomee resources if possible (true by default)
-|tomee.tomcat.datasource.wrap |bool|same as tomee.tomcat.resource.wrap for datasource (false by default). Note that setting it to true will create tomee datasources but can have the side effect to create twice singleton resources
-|openejb.environment.default |bool|should default JMS resources be created or not, default to false to ensure no port is bound or multiple resources are created and completely uncontrolled (doesn't apply to datasources etc for compatibility). For tests only!
-|===
-
-=== Client
-
-[.table.table-bordered,options="header"]
-|===
-|Name| Value |Description
-|openejb.client.identityResolver |implementation of org.apache.openejb.client.IdentityResolver| default org.apache.openejb.client.JaasIdentityResolver. The class to get the client identity.
-|openejb.client.connection.pool.timeout or openejb.client.connectionpool.timeout |int (ms)| the timeout of the client
-|openejb.client.connection.pool.size or openejb.client.connectionpool.size |int| size of the socket pool
-|openejb.client.keepalive |int (ms)| the keepalive duration
-|openejb.client.protocol.version |string| Optional legacy server protocol compatibility level. Allows 4.6.x clients to potentially communicate with older servers. OpenEJB 4.5.2 and older use version "3.1", and 4.6.x currently uses version "4.6" (Default). This does not allow old clients to communicate with new servers prior to 4.6.0
-|tomee.serialization.class.blacklist| string |default list of packages/classnames excluded for EJBd deserialization (needs to be set on server and client sides). Please see the description of Ejbd Transport for details.
-|tomee.serialization.class.whitelist| string| default list of packages/classnames allowed for EJBd deserialization (blacklist wins over whitelist, needs to be set on server and client sides). Please see the description of Ejbd Transport for details.
-|===
+= Container Configuration
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+=== Server
+
+[.table.table-bordered,options="header"]
+|===
+|Name |Value| Description
+|openejb.embedded.remotable| bool| activate or not the remote services when available
+|.bind, <service prefix>.port, <service prefix>.disabled, <service prefix>.threads | host or IP, port, bool|override the host. Available for ejbd and httpejbd services (used by jaxws and jaxrs), number of thread to manage requests
+|openejb.embedded.initialcontext.close |LOGOUT or DESTROY| configure the hook called when closing the initial context. Useful when starting OpenEJB from a new InitialContext([properties]) instantiation. By default it simply logs out the logged user if it exists. DESTROY means clean the container.
+|javax.persistence.provider |string| override the JPA provider value
+|javax.persistence.transactionType |string| override the transaction type for persistence contexts
+|javax.persistence.jtaDataSource |string| override the JTA datasource value for persistence contexts
+|javax.persistence.nonJtaDataSource| string |override the non JTA datasource value for persistence contexts
+|openejb.descriptors.output |bool| dump memory deployment descriptors. Can be used to set complete metadata to true and avoid scanning when starting the container or to check the used configuration.
+|openejb.deployments.classpath.require.descriptor |CLIENT or EJB| can allow to filter what you want to scan (client modules or ejb modules)
+|openejb.descriptors.output.folder| path| where to dump deployement descriptors if activated.
+|openejb.strict.interface.declaration |bool| add some validations on session beans (spec validations in particular). false by default.
+|openejb.conf.file or openejb.configuration| string| OpenEJB configuration file path
+|openejb.debuggable-vm-hackery |bool| remove JMS informations from deployment
+|openejb.validation.skip |bool |skip the validations done when OpenEJB deploys beans
+|openejb.deployments.classpath.ear |bool| deploy the classpath as an ear
+|openejb.webservices.enabled| bool |activate or not webservices
+|openejb.validation.output.level| TERSE or MEDIUM or VERBOSE| level of the logs used to report validation errors
+|openejb.user.mbeans.list * or a list of classes separated by ,| list of mbeans to deploy automatically
+|openejb.deploymentId.format composition (+string) of {ejbName} {ejbType} {ejbClass} and {ejbClass.simpleName} default {ejbName}. The format to use to deploy ejbs.
+|openejb.deployments.classpath |bool| whether or not deploy from classpath
+|openejb.deployments.classpath.include and openejb.deployments.classpath.exclude |regex| regex to filter the scanned classpath (when you are in this case)
+|openejb.deployments.package.include and openejb.deployments.package.exclude| regex| regex to filter scanned packages
+|openejb.autocreate.jta-datasource-from-non-jta-one| bool| whether or not auto create the jta datasource if it doesn't exist but a non jta datasource exists. Useful when using hibernate to be able to get a real non jta datasource.
+|openejb.altdd.prefix |string| prefix use for altDD (example test to use a test.ejb-jar.xml).
+|org.apache.openejb.default.system.interceptors |class names|list of interceptor (qualified names) separated by a comma or a space add these interceptor on all beans
+|openejb.jndiname.strategy.class |class name| an implementation of org.apache.openejb.assembler.classic.JndiBuilder.JndiNameStrategy
+|openejb.jndiname.failoncollision| bool| if a NameAlreadyBoundException is thrown or not when 2 EJBs have the same name
+|openejb.jndiname.format |string|composition of these properties: ejbType, ejbClass, ejbClass.simpleName, ejbClass.packageName, ejbName, deploymentId, interfaceType, interfaceType.annotationName, interfaceType.annotationNameLC, interfaceType.xmlName, interfaceType.xmlNameCc, interfaceType.openejbLegacyName, interfaceClass, interfaceClass.simpleName, interfaceClass.packageName default {deploymentId}{interfaceType.annotationName}. Change the name used for the ejb.
+|openejb.org.quartz.threadPool.class |class| qualified name which implements org.quartz.spi.ThreadPool the thread pool used by quartz (used to manage ejb timers)
+|openejb.localcopy |bool| default true. whether or not copy EJB arguments[/method/interface] for remote invocations.
+|openejb.cxf.jax-rs.providers |string|the list of the qualified name of the JAX-RS providers separated by comma or space. Note: to specify a provider for a specific service suffix its class qualified name by ".providers", the value follow the same rules. Note 2: default is a shortcut for jaxb and json providers.
+|openejb.wsAddress.format |string| composition of {ejbJarId}, ejbDeploymentId, ejbType, ejbClass, ejbClass.simpleName, ejbName, portComponentName, wsdlPort, wsdlService default /{ejbDeploymentId}. The WS name format.
+|org.apache.openejb.server.webservices.saaj.provider| axis2, sun or null |specified the saaj configuration
+|[<uppercase service name>.]<service id>.<name> or [<uppercase service name>.]<service id> |whatever is supported (generally string, int ...)| set this value to the corresponding service. example: [EnterpriseBean.]<ejb-name>.activation.<property>, [PERSISTENCEUNIT.]<persistence unit name>.<property>, [RESOURCE.]<name>
+|log4j.category.OpenEJB.options| DEBUG, INFO, ... |active one OpenEJB log level. need log4j in the classpath
+|openejb.jmx.active| bool| activate (by default) or not the OpenEJB JMX MBeans
+|openejb.nobanner |bool| activate or not the OpenEJB banner (activated by default)
+|openejb.check.classloader |bool| if true print some information about duplicated classes
+|openejb.check.classloader.verbose| bool| if true print classes intersections
+|openejb.additional.exclude |string separated by comma| list of prefixes you want to exclude and are not in the default list of exclusion
+|openejb.additional.include |string separated by comma| list of prefixes you want to remove from thedefault list of exclusion
+|openejb.offline |bool| if true can create datasources and containers automatically
+|openejb.exclude-include.order| include-exclude or exclude-include| if the inclusion/exclusion should win on conflicts (intersection)
+|openejb.log.color |bool| activate or not the color in the console in embedded mode
+|openejb.log.color.<level in lowercase> |color in uppercase |set a color for a particular level. Color are BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, DEFAULT.
+|tomee.serialization.class.blacklist| string |default list of packages/classnames excluded for EJBd deserialization (needs to be set on server and client sides). Please see the description of Ejbd Transport for details.
+|tomee.serialization.class.whitelist| string| default list of packages/classnames allowed for EJBd deserialization (blacklist wins over whitelist, needs to be set on server and client sides). Please see the description of Ejbd Transport for details.
+|tomee.remote.support |boolean |if true /tomee webapp is auto-deployed and EJBd is active (true by default for 1.x, false for 7.x excepted for tomee maven plugin and arquillian)
+|openejb.crosscontext |bool| set the cross context property on tomcat context (can be done in the traditionnal way if the deployment is don through the webapp discovery and not the OpenEJB Deployer EJB)
+|openejb.jsessionid-support |bool| remove URL from session tracking modes for this context (see javax.servlet.SessionTrackingMode)
+|openejb.myfaces.disable-default-values |bool| by default TomEE will initialize myfaces with some its default values to avoid useless logging
+|openejb.web.xml.major |int| major version of web.xml. Can be useful to force tomcat to scan servlet 3 annotatino when deploying with a servlet 2.x web.xml
+|tomee.jaxws.subcontext |string| sub context used to bind jaxws web services, default is webservices
+|openejb.servicemanager.enabled |bool| run all services detected or only known available services (WS and RS
+|tomee.jaxws.oldsubcontext |bool| wether or not activate old way to bind jaxws webservices directly on root context
+|openejb.modulename.useHash |bool| add a hash after the module name of the webmodule if it is generated from the webmodule location, it avoids conflicts between multiple deployment (through ear) of the same webapp. Note: it disactivated by default since names are less nice this way.
+|openejb.session.manager |qualified name (string)| configure a session managaer to use for all contexts
+|tomee.tomcat.resource.wrap |bool|wrap tomcat resources (context.xml) as tomee resources if possible (true by default)
+|tomee.tomcat.datasource.wrap |bool|same as tomee.tomcat.resource.wrap for datasource (false by default). Note that setting it to true will create tomee datasources but can have the side effect to create twice singleton resources
+|openejb.environment.default |bool|should default JMS resources be created or not, default to false to ensure no port is bound or multiple resources are created and completely uncontrolled (doesn't apply to datasources etc for compatibility). For tests only!
+|===
+
+=== Client
+
+[.table.table-bordered,options="header"]
+|===
+|Name| Value |Description
+|openejb.client.identityResolver |implementation of org.apache.openejb.client.IdentityResolver| default org.apache.openejb.client.JaasIdentityResolver. The class to get the client identity.
+|openejb.client.connection.pool.timeout or openejb.client.connectionpool.timeout |int (ms)| the timeout of the client
+|openejb.client.connection.pool.size or openejb.client.connectionpool.size |int| size of the socket pool
+|openejb.client.keepalive |int (ms)| the keepalive duration
+|openejb.client.protocol.version |string| Optional legacy server protocol compatibility level. Allows 4.6.x clients to potentially communicate with older servers. OpenEJB 4.5.2 and older use version "3.1", and 4.6.x currently uses version "4.6" (Default). This does not allow old clients to communicate with new servers prior to 4.6.0
+|tomee.serialization.class.blacklist| string |default list of packages/classnames excluded for EJBd deserialization (needs to be set on server and client sides). Please see the description of Ejbd Transport for details.
+|tomee.serialization.class.whitelist| string| default list of packages/classnames allowed for EJBd deserialization (blacklist wins over whitelist, needs to be set on server and client sides). Please see the description of Ejbd Transport for details.
+|===
diff --git a/src/main/jbake/content/documentation/admin/directory-structure.adoc b/src/main/jbake/content/admin/file-layout.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/admin/directory-structure.adoc
rename to src/main/jbake/content/admin/file-layout.adoc
index 433fea3..9376ebf
--- a/src/main/jbake/content/documentation/admin/directory-structure.adoc
+++ b/src/main/jbake/content/admin/file-layout.adoc
@@ -1,144 +1,144 @@
-= Directory Structure
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-ifndef::backend-pdf[]
-
-[#filetree.col-md-4]
-[
- {
- label: 'apps',
- description: 'A common but optional folder containing the applications (war, ear, jar). Note: this folder needs to be activated in tomee.xml for instance and is not there by default.',
- children: [
- {label:'module1.jar',description:'An ejbmodule'},
- {label:'myapp',description:'An exploded war or ear'},
- {label:'anotherapp.war',description:'A war'},
- {label:'anotherapp',description:'By default TomEE will explode the war next to the .war file, this is customizable.'},
- {label:'anotherapp2.ear',description:'An ear'},
- {label:'anotherapp2',description:'By default TomEE will explode the ear next to the .ear file, this is customizable.'}
- ]
- },
- {
- label: 'bin',
- description: 'The executable and boot related files',
- children: [
- {label:'bootstrap.jar',description:'The jar allowing Tomcat to start'},
- {label:'catalina.bat',description:'The windows main Tomcat script'},
- {label:'catalina.bat.original',description:'The original catalina.bat from Tomcat. TomEE customizes it.'},
- {label:'catalina.sh',description:'The UNIx main Tomcat script'},
- {label:'catalina.sh.original',description:'The original catalina.sh from Tomcat. TomEE customizes it.'},
- {label:'catalina-tasks.xml',description:'Some Ant tasks Tomcat provides to work with JMX'},
- {label:'commons-daemon.jar',description:'When setting up TomEE as a service you need this jar.'},
- {label:'commons-daemon-native.tar.gz',description:'The native needed by commons-daemon'},
- {label:'configtest.bat',description:'A windows script to validate the server.xml'},
- {label:'configtest.sh',description:'A UNIx script to validate the server.xml'},
- {label:'daemon.sh',description:'A script which can be used as init.d script'},
- {label:'digest.bat',description:'A windows script to compute a digest'},
- {label:'digest.sh',description:'A UNIx script to compute a digest'},
- {label:'service.bat',description:'The windows service script'},
- {label:'service.install.as.admin.bat',description:'Install TomEE as a service on windows'},
- {label:'service.readme.txt',description:'The explanations on how to setup TomEE as a windows service'},
- {label:'service.remove.as.admin.bat',description:'Uninstall TomEE service on windows'},
- {label:'setclasspath.bat',description:'The script called by catalina.bat to initialize Tomcat classpath'},
- {label:'setclasspath.sh',description:'The script called by catalina.bat to initialize TomEE classpath'},
- {label:'setenv.sh',description:'A UNIx user script (optional) where you can specify some JVM options like CATALINA_OPTS environment variable'},
- {label:'setenv.bat',description:'A windows user script (optional) where you can specify some JVM options like CATALINA_OPTS environment variable'},
- {label:'shutdown.bat',description:'Stop the server on windows, it is commonly used with -force and a timeout as options'},
- {label:'shutdown.sh',description:'Stop the server on UNIx, it is commonly used with -force and a timeout as options'},
- {label:'startup.bat',description:'Start (and forget) TomEE on windows'},
- {label:'startup.sh',description:'Start (and forget) TomEE on UNIx'},
- {label:'tomcat-juli.jar',description:'The Tomcat Java Util Logging extensions which allow for instance to configure the logging per application'},
- {label:'tomcat-native.tar.gz',description:'The Tomcat native used by some connectors'},
- {label:'TomEE....exe',description:'TomEE windows executables when setup as a service for amd64 architectures'},
- {label:'tomee.bat',description:'TomEE utility script for windows, allows to compute ciphers for instance'},
- {label:'tomee.sh',description:'TomEE utility script for UNIx, allows to compute ciphers for instance'},
- {label:'tool-wrapper.bat',description:'Windows script calling Tomcat Tool utility. It executes a command line with Tomcat classloader.'},
- {label:'tool-wrapper.sh',description:'UNIx script calling Tomcat Tool utility. It executes a command line with Tomcat classloader.'},
- {label:'version.bat',description:'Print Tomcat version (for windows)'},
- {label:'version.sh',description:'Print Tomcat version (for UNIx)'}
- ]
- },
- {
- label: 'conf',
- description: 'Folder containing the configuration of TomEE',
- children: [
- {label:'Catalina',description:'A folder where Tomcat can copy web application configuration (typically context.xml can be overriden from there)'},
- {label:'catalina.policy',description:'The server security policy rules'},
- {label:'catalina.properties',description:'The server boot configuration (classloader etc...)'},
- {label:'conf.d',description:'A TomEE folder where services can pick configuration'},
- {label:'context.xml',description:'The default context.xml configuration'},
- {label:'logging.properties',description:'The logging configuration for the server and applications (overridable)'},
- {label:'server.xml',description:'The server configuration (Host, Context, Valves, ...)'},
- {label:'server.xml.original',description:'The original server.xml, TomEE updates it to add its lifecycle manager.'},
- {label:'system.properties',description:'TomEE global configuration'},
- {label:'tomcat-users.xml',description:'The default location where tomcat stores users.'},
- {label:'tomcat-users.xml.original',description:'The Tomcat tomcat-users.xml (TomEE add comments)'},
- {label:'tomcat-users.xsd',description:'The XSD for tomcat-users.xml'},
- {label:'tomee.xml',description:'The TomEE configuration file, syntax is hybrid between XML and Properties and it is fully replaceable with system.properties but users generally prefer this file.'},
- {label:'web.xml',description:'The default web.xml'}
- ]
- },
- {
- label: 'lib',
- description: 'Folder containing TomEE binaries',
- children: [
- {label:'*.jar',description:'Tomcat + TomEE libraries'}
- ]
- },
- {
- label: 'logs',
- description: 'Default location of log files',
- children: [
- {label:'catalina.$day.log',description:'By default container logs go there'},
- {label:'xxx.2016-03-16.log',description:'By default application xxx logs go there (when using servlet API)'},
- {label:'localhost.$day.log',description:'By default host related logs go there'},
- {label:'localhost_access_log.$day.txt',description:'By default access logs (request the container processed) go there'}
- ]
- },
- {
- label: 'temp',
- description: 'Java temporary directory is redirected by default to this folder',
- children: [
- {label:'OpenEJB-dejlzdbhjzbfrzeofrh',description:'A temporary file TomEE can create (suffix depends the startup) to check the instance'}
- ]
- },
- {
- label: 'webapps',
- description: 'Folder containing the web applications',
- children: [
- {label:'myapp',description:'An exploded war'},
- {label:'anotherapp.war',description:'A war'},
- {label:'anotherapp',description:'By default TomEE will explode the war next to the .war file, this is customizable.'}
- ]
- },
- {
- label: 'work',
- description: 'Folder where Tomcat and TomEE can work',
- children: [
- {
- label:'Catalina',description:'By default Tomcat Engine is called Catalina. This folder matches engine name.',
- children: [
- {
- label:'localhost',description:'A folder by host by engine to seggregate data of each ones',
- children: [
- {
- label:'myapp',description:'An application deployed on the previous level host',
- children: [
- { label:'org.apache.jsp.index_jsp.java',description:'The generated JSP source (index.jsp there)' },
- { label:'org.apache.jsp.index_jsp.class',description:'The compiled JSP binary' }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
-]
-
-[#filetreedetail.col-md-8.bs-callout.bs-callout-primary]
-Click on a tree node or open a folder to see the detail there.
-
-endif::[]
+= TomEE File Layout
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+ifndef::backend-pdf[]
+
+[#filetree.col-md-4]
+[
+ {
+ label: 'apps',
+ description: 'A common but optional folder containing the applications (war, ear, jar). Note: this folder needs to be activated in tomee.xml for instance and is not there by default.',
+ children: [
+ {label:'module1.jar',description:'An ejbmodule'},
+ {label:'myapp',description:'An exploded war or ear'},
+ {label:'anotherapp.war',description:'A war'},
+ {label:'anotherapp',description:'By default TomEE will explode the war next to the .war file, this is customizable.'},
+ {label:'anotherapp2.ear',description:'An ear'},
+ {label:'anotherapp2',description:'By default TomEE will explode the ear next to the .ear file, this is customizable.'}
+ ]
+ },
+ {
+ label: 'bin',
+ description: 'The executable and boot related files',
+ children: [
+ {label:'bootstrap.jar',description:'The jar allowing Tomcat to start'},
+ {label:'catalina.bat',description:'The windows main Tomcat script'},
+ {label:'catalina.bat.original',description:'The original catalina.bat from Tomcat. TomEE customizes it.'},
+ {label:'catalina.sh',description:'The UNIx main Tomcat script'},
+ {label:'catalina.sh.original',description:'The original catalina.sh from Tomcat. TomEE customizes it.'},
+ {label:'catalina-tasks.xml',description:'Some Ant tasks Tomcat provides to work with JMX'},
+ {label:'commons-daemon.jar',description:'When setting up TomEE as a service you need this jar.'},
+ {label:'commons-daemon-native.tar.gz',description:'The native needed by commons-daemon'},
+ {label:'configtest.bat',description:'A windows script to validate the server.xml'},
+ {label:'configtest.sh',description:'A UNIx script to validate the server.xml'},
+ {label:'daemon.sh',description:'A script which can be used as init.d script'},
+ {label:'digest.bat',description:'A windows script to compute a digest'},
+ {label:'digest.sh',description:'A UNIx script to compute a digest'},
+ {label:'service.bat',description:'The windows service script'},
+ {label:'service.install.as.admin.bat',description:'Install TomEE as a service on windows'},
+ {label:'service.readme.txt',description:'The explanations on how to setup TomEE as a windows service'},
+ {label:'service.remove.as.admin.bat',description:'Uninstall TomEE service on windows'},
+ {label:'setclasspath.bat',description:'The script called by catalina.bat to initialize Tomcat classpath'},
+ {label:'setclasspath.sh',description:'The script called by catalina.bat to initialize TomEE classpath'},
+ {label:'setenv.sh',description:'A UNIx user script (optional) where you can specify some JVM options like CATALINA_OPTS environment variable'},
+ {label:'setenv.bat',description:'A windows user script (optional) where you can specify some JVM options like CATALINA_OPTS environment variable'},
+ {label:'shutdown.bat',description:'Stop the server on windows, it is commonly used with -force and a timeout as options'},
+ {label:'shutdown.sh',description:'Stop the server on UNIx, it is commonly used with -force and a timeout as options'},
+ {label:'startup.bat',description:'Start (and forget) TomEE on windows'},
+ {label:'startup.sh',description:'Start (and forget) TomEE on UNIx'},
+ {label:'tomcat-juli.jar',description:'The Tomcat Java Util Logging extensions which allow for instance to configure the logging per application'},
+ {label:'tomcat-native.tar.gz',description:'The Tomcat native used by some connectors'},
+ {label:'TomEE....exe',description:'TomEE windows executables when setup as a service for amd64 architectures'},
+ {label:'tomee.bat',description:'TomEE utility script for windows, allows to compute ciphers for instance'},
+ {label:'tomee.sh',description:'TomEE utility script for UNIx, allows to compute ciphers for instance'},
+ {label:'tool-wrapper.bat',description:'Windows script calling Tomcat Tool utility. It executes a command line with Tomcat classloader.'},
+ {label:'tool-wrapper.sh',description:'UNIx script calling Tomcat Tool utility. It executes a command line with Tomcat classloader.'},
+ {label:'version.bat',description:'Print Tomcat version (for windows)'},
+ {label:'version.sh',description:'Print Tomcat version (for UNIx)'}
+ ]
+ },
+ {
+ label: 'conf',
+ description: 'Folder containing the configuration of TomEE',
+ children: [
+ {label:'Catalina',description:'A folder where Tomcat can copy web application configuration (typically context.xml can be overriden from there)'},
+ {label:'catalina.policy',description:'The server security policy rules'},
+ {label:'catalina.properties',description:'The server boot configuration (classloader etc...)'},
+ {label:'conf.d',description:'A TomEE folder where services can pick configuration'},
+ {label:'context.xml',description:'The default context.xml configuration'},
+ {label:'logging.properties',description:'The logging configuration for the server and applications (overridable)'},
+ {label:'server.xml',description:'The server configuration (Host, Context, Valves, ...)'},
+ {label:'server.xml.original',description:'The original server.xml, TomEE updates it to add its lifecycle manager.'},
+ {label:'system.properties',description:'TomEE global configuration'},
+ {label:'tomcat-users.xml',description:'The default location where tomcat stores users.'},
+ {label:'tomcat-users.xml.original',description:'The Tomcat tomcat-users.xml (TomEE add comments)'},
+ {label:'tomcat-users.xsd',description:'The XSD for tomcat-users.xml'},
+ {label:'tomee.xml',description:'The TomEE configuration file, syntax is hybrid between XML and Properties and it is fully replaceable with system.properties but users generally prefer this file.'},
+ {label:'web.xml',description:'The default web.xml'}
+ ]
+ },
+ {
+ label: 'lib',
+ description: 'Folder containing TomEE binaries',
+ children: [
+ {label:'*.jar',description:'Tomcat + TomEE libraries'}
+ ]
+ },
+ {
+ label: 'logs',
+ description: 'Default location of log files',
+ children: [
+ {label:'catalina.$day.log',description:'By default container logs go there'},
+ {label:'xxx.2016-03-16.log',description:'By default application xxx logs go there (when using servlet API)'},
+ {label:'localhost.$day.log',description:'By default host related logs go there'},
+ {label:'localhost_access_log.$day.txt',description:'By default access logs (request the container processed) go there'}
+ ]
+ },
+ {
+ label: 'temp',
+ description: 'Java temporary directory is redirected by default to this folder',
+ children: [
+ {label:'OpenEJB-dejlzdbhjzbfrzeofrh',description:'A temporary file TomEE can create (suffix depends the startup) to check the instance'}
+ ]
+ },
+ {
+ label: 'webapps',
+ description: 'Folder containing the web applications',
+ children: [
+ {label:'myapp',description:'An exploded war'},
+ {label:'anotherapp.war',description:'A war'},
+ {label:'anotherapp',description:'By default TomEE will explode the war next to the .war file, this is customizable.'}
+ ]
+ },
+ {
+ label: 'work',
+ description: 'Folder where Tomcat and TomEE can work',
+ children: [
+ {
+ label:'Catalina',description:'By default Tomcat Engine is called Catalina. This folder matches engine name.',
+ children: [
+ {
+ label:'localhost',description:'A folder by host by engine to seggregate data of each ones',
+ children: [
+ {
+ label:'myapp',description:'An application deployed on the previous level host',
+ children: [
+ { label:'org.apache.jsp.index_jsp.java',description:'The generated JSP source (index.jsp there)' },
+ { label:'org.apache.jsp.index_jsp.class',description:'The compiled JSP binary' }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+]
+
+[#filetreedetail.col-md-8.bs-callout.bs-callout-primary]
+Click on a tree node or open a folder to see the detail there.
+
+endif::[]
diff --git a/src/main/jbake/content/admin/index.adoc b/src/main/jbake/content/admin/index.adoc
new file mode 100755
index 0000000..f263b55
--- /dev/null
+++ b/src/main/jbake/content/admin/index.adoc
@@ -0,0 +1,9 @@
+= TomEE Administration
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+- link:file-layout.html[TomEE File Layout]
+- link:configuration/index.html[Configuration Reference]
+- link:cluster/index.html[Clustering]
diff --git a/src/main/jbake/content/documentation/advanced/applicationcomposer/index.adoc b/src/main/jbake/content/advanced/applicationcomposer/index.adoc
old mode 100644
new mode 100755
similarity index 98%
rename from src/main/jbake/content/documentation/advanced/applicationcomposer/index.adoc
rename to src/main/jbake/content/advanced/applicationcomposer/index.adoc
index 50390cc..8c22e14
--- a/src/main/jbake/content/documentation/advanced/applicationcomposer/index.adoc
+++ b/src/main/jbake/content/advanced/applicationcomposer/index.adoc
@@ -1,76 +1,76 @@
-= ApplicationComposer with JBatch
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-ApplicationComposer can be a way to run a JBatch not needing any HTTP connector.
-
-Here is an example making batch integration easy - note you can extract the generic part in a library very easily:
-
-TIP: if you didn't check yet BatchEE provides some standalone utilities for JBatch but the idea of this page can be reused for a lot of applications.
-
-[source,java]
-----
-// helper class reusable for any batch
-abstract class BatchApplication {
- private static final DateTimeFormatter DATE = DateTimeFormatter.ofPattern("YYYYMMddHHmmss");
-
- protected Report runBatch(final String batchName, final Properties config) {
- final JobOperator operator = BatchRuntime.getJobOperator();
- final long id = operator.start(batchName, config);
- Batches.waitForEnd(operator, id);
- return new Report(operator.getJobExecution(id), operator.getParameters(id));
- }
-
- @Module // we enforce BatchEE to be initialized as an EJB context to get JNDI for JTA init, needed for TomEE 1
- public EjbModule ensureBatchEESetupIsDoneInTheRightContext() {
- final EjbJar ejbJar = new EjbJar().enterpriseBean(new SingletonBean(BatchEEBeanManagerInitializer.class));
-
- final Beans beans = new Beans();
- beans.addManagedClass(BatchEEBeanManagerInitializer.Init.class);
-
- final EjbModule ejbModule = new EjbModule(ejbJar);
- ejbModule.setModuleId("batchee-shared-components");
- ejbModule.setBeans(beans);
- return ejbModule;
- }
-
- public static class Report {
- private final JobExecution execution;
- private final Properties properties;
-
- public Report(final JobExecution execution, final Properties properties) {
- this.execution = execution;
- this.properties = properties;
- }
-
- public JobExecution getExecution() {
- return execution;
- }
-
- public Properties getProperties() {
- return properties;
- }
- }
-}
-
-@Classes(cdi = true, value = { MyFilter.class, MoveFile.class, InputFile.class, MyReader.class, LoggingListener.class })
-public class MyBatch extends BatchApplication {
- private final Properties config;
-
- public Mybatch(final String[] args) { // main args
- this.config = new Properties() {{ // create the batch config
- setProperty("input-directory", args[0]);
- }};
- }
-
- public Report execute(final String inputDirectory) {
- return runBatch("sunstone", config);
- }
-
- public static void main(final String[] args) throws Exception {
- ApplicationComposers.run(MyBatch.class, args);
- }
-}
-----
+= Application Composer Advanced Usage
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+ApplicationComposer can be a way to run a JBatch not needing any HTTP connector.
+
+Here is an example making batch integration easy - note you can extract the generic part in a library very easily:
+
+TIP: if you didn't check yet BatchEE provides some standalone utilities for JBatch but the idea of this page can be reused for a lot of applications.
+
+[source,java]
+----
+// helper class reusable for any batch
+abstract class BatchApplication {
+ private static final DateTimeFormatter DATE = DateTimeFormatter.ofPattern("YYYYMMddHHmmss");
+
+ protected Report runBatch(final String batchName, final Properties config) {
+ final JobOperator operator = BatchRuntime.getJobOperator();
+ final long id = operator.start(batchName, config);
+ Batches.waitForEnd(operator, id);
+ return new Report(operator.getJobExecution(id), operator.getParameters(id));
+ }
+
+ @Module // we enforce BatchEE to be initialized as an EJB context to get JNDI for JTA init, needed for TomEE 1
+ public EjbModule ensureBatchEESetupIsDoneInTheRightContext() {
+ final EjbJar ejbJar = new EjbJar().enterpriseBean(new SingletonBean(BatchEEBeanManagerInitializer.class));
+
+ final Beans beans = new Beans();
+ beans.addManagedClass(BatchEEBeanManagerInitializer.Init.class);
+
+ final EjbModule ejbModule = new EjbModule(ejbJar);
+ ejbModule.setModuleId("batchee-shared-components");
+ ejbModule.setBeans(beans);
+ return ejbModule;
+ }
+
+ public static class Report {
+ private final JobExecution execution;
+ private final Properties properties;
+
+ public Report(final JobExecution execution, final Properties properties) {
+ this.execution = execution;
+ this.properties = properties;
+ }
+
+ public JobExecution getExecution() {
+ return execution;
+ }
+
+ public Properties getProperties() {
+ return properties;
+ }
+ }
+}
+
+@Classes(cdi = true, value = { MyFilter.class, MoveFile.class, InputFile.class, MyReader.class, LoggingListener.class })
+public class MyBatch extends BatchApplication {
+ private final Properties config;
+
+ public Mybatch(final String[] args) { // main args
+ this.config = new Properties() {{ // create the batch config
+ setProperty("input-directory", args[0]);
+ }};
+ }
+
+ public Report execute(final String inputDirectory) {
+ return runBatch("sunstone", config);
+ }
+
+ public static void main(final String[] args) throws Exception {
+ ApplicationComposers.run(MyBatch.class, args);
+ }
+}
+----
diff --git a/src/main/jbake/content/advanced/client/index.adoc b/src/main/jbake/content/advanced/client/index.adoc
new file mode 100644
index 0000000..3e78b33
--- /dev/null
+++ b/src/main/jbake/content/advanced/client/index.adoc
@@ -0,0 +1,7 @@
+= Advanced
+:jbake-date: 2016-10-14
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+- link:jndi.html[JNDI clients]
diff --git a/src/main/jbake/content/documentation/advanced/client/jndi.adoc b/src/main/jbake/content/advanced/client/jndi.adoc
similarity index 99%
rename from src/main/jbake/content/documentation/advanced/client/jndi.adoc
rename to src/main/jbake/content/advanced/client/jndi.adoc
index e1c5d2f..7a42782 100644
--- a/src/main/jbake/content/documentation/advanced/client/jndi.adoc
+++ b/src/main/jbake/content/advanced/client/jndi.adoc
@@ -1,4 +1,4 @@
-= JNDI
+= Advanced
:jbake-date: 2016-10-14
:jbake-type: page
:jbake-status: published
diff --git a/src/main/jbake/content/advanced/index.adoc b/src/main/jbake/content/advanced/index.adoc
new file mode 100755
index 0000000..9ec8222
--- /dev/null
+++ b/src/main/jbake/content/advanced/index.adoc
@@ -0,0 +1,11 @@
+= Advanced
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+- link:applicationcomposer/index.html[Use `ApplicationComposer` to write mains]
+- link:setup/index.html[How to install TomEE properly]
+- link:shading/index.html[Simple deployable: fat/uber jars]
+- link:client/index.html[Clients (JNDI)]
+- link:jms/jms-configuration.html[JMS Configuration Tips]
diff --git a/src/main/jbake/content/advanced/jms/jms-configuration.adoc b/src/main/jbake/content/advanced/jms/jms-configuration.adoc
new file mode 100644
index 0000000..bd2fe16
--- /dev/null
+++ b/src/main/jbake/content/advanced/jms/jms-configuration.adoc
@@ -0,0 +1,67 @@
+= JMS Configuration Tips
+:jbake-date: 2017-02-22
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+== Why my ActiveMQ/JMS MDB is not scaling as expected?
+
+There are multiple configurations points to ensure you scale as much as you want.
+
+Here some common configuration to validate (note that when possible the sample value is the default):
+
+- The resource adapter thread pool ("worker threads" or `WorkManager`) limits the number of max work threads:
+
+[source,xml]
+----
+<Resource id="my resource adapter" ....>
+ # using -1 will make the server using cached threads (unbounded)
+ # min recommanded: maxSessions + 1 (for connect())
+ threadPoolSize = 30
+</Resource>
+----
+
+- Then the MDB container itself has a upper bound through `InstanceLimit` which controls the max MDB instance count:
+
+[source,xml]
+----
+<Container id="my mdb container" type="MESSAGE">
+ # -1 will disable it
+ # min recommanded = maxSessions
+ InstanceLimit = 10
+</Container>
+----
+
+- ActiveMQ `maxSessions` controls how many sessions a MDB can use:
+
+[source,java]
+----
+@MessageDriven(activationConfig = {
+ @javax.ejb.ActivationConfigProperty(propertyName = "maxSessions", propertyValue = "1"),
+ @javax.ejb.ActivationConfigProperty(propertyName = "destination", propertyValue = "target-queue")
+})
+public static class MyMdb implements MessageListener {
+ @Override
+ public void onMessage(final Message message) {
+ // ...
+ }
+}
+----
+
+- The ConnectionFactory has also an instance pool through geronimo-connector logic, configuration
+ can make the behavior changing but this is controlled through pool related variables (the pool and resource properties are merged in the definition):
+
+[source,xml]
+----
+<Resource id="my connection factory" type="ConnectionFactory">
+ # recommanded to be aligned on maxSessions
+ PoolMaxSize = 10
+ # for 100% MDB (no client) you can evaluate to turn it off/false, for client it can still be useful depending what you do
+ Pooling = true
+</Resource>
+----
+
+== Slow consumption
+
+If you find you have a slow consumption of messages there are several options to have a look (activemq website explains it very well)
+but one very impacting option can be the prefetch size.
diff --git a/src/main/jbake/content/documentation/advanced/setup/index.adoc b/src/main/jbake/content/advanced/setup/index.adoc
old mode 100644
new mode 100755
similarity index 97%
rename from src/main/jbake/content/documentation/advanced/setup/index.adoc
rename to src/main/jbake/content/advanced/setup/index.adoc
index 4fe684d..efea726
--- a/src/main/jbake/content/documentation/advanced/setup/index.adoc
+++ b/src/main/jbake/content/advanced/setup/index.adoc
@@ -1,142 +1,142 @@
-= How to Setup TomEE in production
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-
-
-You can use TomEE as described on link:../../admin/directory-structure.html[Directory Structure] page but in production it is better to
-split TomEE and application binaries and configuration.
-
-Idea is to have this kind of layout (the root is the one you prefer):
-
-ifndef::backend-pdf[]
-
-[#filetree.col-md-4]
-[{
- label: '/some/path',
- description: 'any location on your file system',
- children: [
- {
- label: 'tomee',
- description: 'all tomee binaries will be there, note: you often do the same for the JVM versions you have',
- children: [
- {
- label: 'tomee-1.7.1',
- description: 'a particular tomee version (just unzip it there)',
- children: [
- { label: 'bin', description: 'the startup binaries/scripts' },
- { label: 'conf', description: 'default shared configuration for this version, can be overwritten by instance' },
- { label: 'lib', description: 'the binaries' }
- ]
- },
- {
- label: 'tomee-1.7.2',
- description: 'a particular tomee version (just unzip it there)',
- children: [
- { label: 'bin', description: 'the startup binaries/scripts' },
- { label: 'conf', description: 'default shared configuration for this version, can be overwritten by instance' },
- { label: 'lib', description: 'the binaries' }
- ]
- },
- {
- label: 'tomee-7.0.0-M3',
- description: 'a particular tomee version (just unzip it there)',
- children: [
- { label: 'bin', description: 'the startup binaries/scripts' },
- { label: 'conf', description: 'default shared configuration for this version, can be overwritten by instance' },
- { label: 'lib', description: 'the binaries' }
- ]
- }
- ]
- },
- {
- label: 'applications',
- description: 'all applications',
- children: [
- {
- label: 'application1',
- description: 'any application instance (ie configuration + binaries)',
- children: [
- { label: 'bin', description: 'provide scripts for this instance (see under that file layout)' },
- { label: 'conf', description: 'the instance configuration, typically what is in tomee/conf when used in standalone' },
- { label: 'lib', description: 'some additional binaries like JDBC drivers' },
- { label: 'logs', description: 'instances logs location' },
- { label: 'work', description: 'dedicated work directory' },
- { label: 'temp', description: 'instance temporary folder' },
- { label: 'webapps', description: 'instance webapp folder' }
- ]
- },
- {
- label: 'application2',
- description: 'any application instance (ie configuration + binaries)',
- children: [
- { label: 'bin', description: 'provide scripts for this instance (see under that file layout)' },
- { label: 'conf', description: 'the instance configuration, typically what is in tomee/conf when used in standalone' },
- { label: 'lib', description: 'some additional binaries like JDBC drivers' },
- { label: 'logs', description: 'instances logs location' },
- { label: 'work', description: 'dedicated work directory' },
- { label: 'temp', description: 'instance temporary folder' },
- { label: 'webapps', description: 'instance webapp folder' }
- ]
- }
- ]
- }
- ]
-}]
-
-
-[#filetreedetail.col-md-8.bs-callout.bs-callout-primary]
-Click on a tree node or open a folder to see the detail there.
-
-[.clearfix]
-
-
-endif::[]
-
-=== Instance scripts
-
-The idea for instances (applications) scripts is to simply delegate to tomcat ones but customizing the JVM and TomEE versions.
-
-Customizing the version (and locations) is done in `bin/setenv.sh` of instances.
-
-Here are an example for the common scripts (of course you can write helper version like restart etc).
-
-==== setenv.sh
-
-[source,bash]
-----
-#! /bin/sh
-
-# which java
-export JAVA_HOME="/some/path/java/jdk-8u60"
-# which tomee
-export CATALINA_HOME="/some/path/tomee/tomee-7.0.0-M3"
-# where is the application - to let tomcat/tomee finds the configuration
-export CATALINA_BASE="/some/path/application1/"
-# to let tomee be able to kill the instance if shutdown doesn't work (see shutdown script)
-export CATALINA_PID="/some/path/application1/work/tomee.pid"
-----
-
-==== startup
-
-[source,bash]
-----
-#! /bin/bash
-
-proc_script_base="`cd $(dirname $0) && cd .. && pwd`"
-source "$proc_script_base/bin/setenv.sh"
-nohup "$CATALINA_HOME/bin/startup.sh" "$@" > $proc_script_base/logs/nohup.log &
-----
-
-==== shutdown
-
-[source,bash]
-----
-#! /bin/bash
-
-proc_script_base="`cd $(dirname $0) && cd .. && pwd`"
-source "$proc_script_base/bin/setenv.sh"
-# we support parameters like timeout and force, typically we would call it this way: ./shutdown 1200 -force
-"$CATALINA_HOME/bin/shutdown.sh" "$@"
-----
-
+= How to Setup TomEE in production
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+
+
+You can use TomEE as described on link:../../admin/file-layout.html[File Layout] page but in production it is better to
+split TomEE and application binaries and configuration.
+
+Idea is to have this kind of layout (the root is the one you prefer):
+
+ifndef::backend-pdf[]
+
+[#filetree.col-md-4]
+[{
+ label: '/some/path',
+ description: 'any location on your file system',
+ children: [
+ {
+ label: 'tomee',
+ description: 'all tomee binaries will be there, note: you often do the same for the JVM versions you have',
+ children: [
+ {
+ label: 'tomee-1.7.1',
+ description: 'a particular tomee version (just unzip it there)',
+ children: [
+ { label: 'bin', description: 'the startup binaries/scripts' },
+ { label: 'conf', description: 'default shared configuration for this version, can be overwritten by instance' },
+ { label: 'lib', description: 'the binaries' }
+ ]
+ },
+ {
+ label: 'tomee-1.7.2',
+ description: 'a particular tomee version (just unzip it there)',
+ children: [
+ { label: 'bin', description: 'the startup binaries/scripts' },
+ { label: 'conf', description: 'default shared configuration for this version, can be overwritten by instance' },
+ { label: 'lib', description: 'the binaries' }
+ ]
+ },
+ {
+ label: 'tomee-7.0.0-M3',
+ description: 'a particular tomee version (just unzip it there)',
+ children: [
+ { label: 'bin', description: 'the startup binaries/scripts' },
+ { label: 'conf', description: 'default shared configuration for this version, can be overwritten by instance' },
+ { label: 'lib', description: 'the binaries' }
+ ]
+ }
+ ]
+ },
+ {
+ label: 'applications',
+ description: 'all applications',
+ children: [
+ {
+ label: 'application1',
+ description: 'any application instance (ie configuration + binaries)',
+ children: [
+ { label: 'bin', description: 'provide scripts for this instance (see under that file layout)' },
+ { label: 'conf', description: 'the instance configuration, typically what is in tomee/conf when used in standalone' },
+ { label: 'lib', description: 'some additional binaries like JDBC drivers' },
+ { label: 'logs', description: 'instances logs location' },
+ { label: 'work', description: 'dedicated work directory' },
+ { label: 'temp', description: 'instance temporary folder' },
+ { label: 'webapps', description: 'instance webapp folder' }
+ ]
+ },
+ {
+ label: 'application2',
+ description: 'any application instance (ie configuration + binaries)',
+ children: [
+ { label: 'bin', description: 'provide scripts for this instance (see under that file layout)' },
+ { label: 'conf', description: 'the instance configuration, typically what is in tomee/conf when used in standalone' },
+ { label: 'lib', description: 'some additional binaries like JDBC drivers' },
+ { label: 'logs', description: 'instances logs location' },
+ { label: 'work', description: 'dedicated work directory' },
+ { label: 'temp', description: 'instance temporary folder' },
+ { label: 'webapps', description: 'instance webapp folder' }
+ ]
+ }
+ ]
+ }
+ ]
+}]
+
+
+[#filetreedetail.col-md-8.bs-callout.bs-callout-primary]
+Click on a tree node or open a folder to see the detail there.
+
+[.clearfix]
+
+
+endif::[]
+
+=== Instance scripts
+
+The idea for instances (applications) scripts is to simply delegate to tomcat ones but customizing the JVM and TomEE versions.
+
+Customizing the version (and locations) is done in `bin/setenv.sh` of instances.
+
+Here are an example for the common scripts (of course you can write helper version like restart etc).
+
+==== setenv.sh
+
+[source,bash]
+----
+#! /bin/sh
+
+# which java
+export JAVA_HOME="/some/path/java/jdk-8u60"
+# which tomee
+export CATALINA_HOME="/some/path/tomee/tomee-7.0.0-M3"
+# where is the application - to let tomcat/tomee finds the configuration
+export CATALINA_BASE="/some/path/application1/"
+# to let tomee be able to kill the instance if shutdown doesn't work (see shutdown script)
+export CATALINA_PID="/some/path/application1/work/tomee.pid"
+----
+
+==== startup
+
+[source,bash]
+----
+#! /bin/bash
+
+proc_script_base="`cd $(dirname $0) && cd .. && pwd`"
+source "$proc_script_base/bin/setenv.sh"
+nohup "$CATALINA_HOME/bin/startup.sh" "$@" > $proc_script_base/logs/nohup.log &
+----
+
+==== shutdown
+
+[source,bash]
+----
+#! /bin/bash
+
+proc_script_base="`cd $(dirname $0) && cd .. && pwd`"
+source "$proc_script_base/bin/setenv.sh"
+# we support parameters like timeout and force, typically we would call it this way: ./shutdown 1200 -force
+"$CATALINA_HOME/bin/shutdown.sh" "$@"
+----
+
diff --git a/src/main/jbake/content/documentation/advanced/shading/index.adoc b/src/main/jbake/content/advanced/shading/index.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/advanced/shading/index.adoc
rename to src/main/jbake/content/advanced/shading/index.adoc
index 329bc39..e1d25a9
--- a/src/main/jbake/content/documentation/advanced/shading/index.adoc
+++ b/src/main/jbake/content/advanced/shading/index.adoc
@@ -1,276 +1,278 @@
-= Fat / Uber jars - Shade Plugin
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-Shading the container and the application has some challenges like merging correctly resources (`META-INF/services/` typically).
-
-Here is a maven shade plugin configuration working for most cases:
-
-[source,xml]
-----
-<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>2.3</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <dependencyReducedPomLocation>${project.build.directory}/reduced-pom.xml</dependencyReducedPomLocation>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
- <mainClass>org.apache.tomee.embedded.FatApp</mainClass>
- </transformer>
- <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
- <resource>META-INF/cxf/bus-extensions.txt</resource>
- </transformer>
- <transformer implementation="org.apache.openwebbeans.maven.shade.OpenWebBeansPropertiesTransformer" />
- </transformers>
- <filters>
- <filter> <!-- we don't want JSF to be activated -->
- <artifact>*:*</artifact>
- <excludes>
- <exclude>META-INF/faces-config.xml</exclude>
- </excludes>
- </filter>
- </filters>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.apache.openwebbeans</groupId>
- <artifactId>openwebbeans-maven</artifactId>
- <version>1.7.0/version>
- </dependency>
- </dependencies>
-</plugin>
-----
-
-NOTE: see link:../tomee-embedded/index.html[TomEE Embedded] page for more information about tomee embedded options.
-
-IMPORTANT: this shade uses TomEE Embedded but you can do the same with an link:../applicationcomposer/index.html[Application Composer] application.
-
-TIP: if you have `META-INF/web-fragment.xml` in your application you will need to merge them in a single one in the shade. Note that tomcat provides one
-which can be skipped in this operation since it is there only as a marker for jasper detection.
-
-Then just build the jar:
-
-[source,bash]
-----
-mvn clean package
-----
-
-And you can run it:
-
-[source,bash]
-----
-java -jar myapp-1.0-SNAPSHOT.jar
-----
-
-== Fat Jars with Gradle
-
-With gradle you can rely on either jar plugin, fatjar plugin or shadowjar plugin. Last one is likely the closer to maven shade plugin
-so that's the one used for next sample:
-
-[source,groovy]
-----
-// run $ gradle clean shadowJar
-import org.apache.openwebbeans.gradle.shadow.OpenWebBeansPropertiesTransformer
-
-buildscript {
- repositories {
- mavenLocal()
- jcenter()
- }
- dependencies {
- classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
- classpath 'org.apache.openwebbeans:openwebbeans-gradle:1.7.0'
- }
-}
-
-apply plugin: 'com.github.johnrengelman.shadow'
-
-group 'org.apache.tomee.demo.gradle'
-version '1.0-SNAPSHOT'
-
-apply plugin: 'idea'
-apply plugin: 'java'
-
-sourceCompatibility = 1.8
-
-repositories {
- mavenLocal()
- mavenCentral()
-}
-
-dependencies {
- compileOnly 'org.projectlombok:lombok:1.16.10'
- compile 'org.apache.tomee:tomee-embedded:7.0.2-SNAPSHOT'
-}
-
-// customize exclusions depending your app
-
-// first the not used dependencies like JSF, JAXWS, JMS ones
-def excludedDependenciesGroups = [
- // gradle is buggy with poms, scope provided and optional I think
- 'com.google.code.findbugs',
- 'com.google.guava',
- 'javax.annotation',
- 'javax.ws.rs',
- 'net.sf.ehcache',
- 'org.apache.httpcomponents',
- 'org.ow2.asm',
- // tomee jaxws, jms, etc...
- 'commons-codec',
- 'com.sun.xml.messaging.saaj',
- 'joda-time',
- 'junit',
- 'net.shibboleth.utilities',
- 'org.apache.activemq',
- 'org.apache.activemq.protobuf',
- 'org.apache.myfaces.core',
- 'org.apache.neethi',
- 'org.apache.santuario',
- 'org.apache.ws.xmlschema',
- 'org.apache.wss4j',
- 'org.bouncycastle',
- 'org.cryptacular',
- 'org.fusesource.hawtbuf',
- 'org.jasypt',
- 'org.jvnet.mimepull',
- 'org.opensaml',
- 'wsdl4j',
- 'xml-resolver'
-]
-
-// then cxf+tomee specific dependencies so we need to be more precise than the group
-// to not exclude everything
-def excludedDependenciesArtifacts = [
- 'cxf-rt-bindings-soap',
- 'cxf-rt-bindings-xml',
- 'cxf-rt-databinding-jaxb',
- 'cxf-rt-frontend-jaxws',
- 'cxf-rt-frontend-simple',
- 'cxf-rt-security-saml',
- 'cxf-rt-ws-addr',
- 'cxf-rt-wsdl',
- 'cxf-rt-ws-policy',
- 'cxf-rt-ws-security',
- 'openejb-cxf',
- 'openejb-webservices',
- 'tomee-webservices',
- 'geronimo-connector',
- 'geronimo-javamail_1.4_mail'
-]
-shadowJar {
- classifier = 'bundle'
-
- // merge SPI descriptors
- mergeServiceFiles()
- append 'META-INF/cxf/bus-extensions.txt'
- transform(OpenWebBeansPropertiesTransformer.class)
-
- // switch off JSF + JMS + JAXWS
- exclude 'META-INF/faces-config.xml'
- dependencies {
- exclude(dependency {
- excludedDependenciesGroups.contains(it.moduleGroup) ||
- excludedDependenciesArtifacts.contains(it.moduleName)
- })
- }
-
- // ensure we define the expected Main (if you wrap tomee main use your own class)
- manifest {
- attributes 'Main-Class': 'org.apache.tomee.embedded.FatApp'
- }
-}
-----
-
-Then run:
-
-[source]
-----
-gradle clean build shadowJar
-----
-
-and you'll get `build/libs/demo-gradle-tomee-embedded-shade-1.0-SNAPSHOT-bundle.jar` ready to run with:
-
-[source]
-----
-java -jar build/libs/demo-gradle-tomee-embedded-shade-1.0-SNAPSHOT-bundle.jar --as-war --simple-log=true
-----
-
-== Fat Wars
-
-Fat Wars are executable wars. Note they can be fancy for demos but they have the drawback to put the server in web resources
-at packaging time (to ensure the war is actually an executable jar) so adding a filter preventing these files to be read
-can be needed if you don't already use a web technology doing it (a servlet bound to /*).
-
-Here how to do a fat war:
-
-[source,xml]
-----
-<properties>
- <!-- can be uber (for all), jaxrs, jaxws for lighter ones -->
- <tomee.flavor>uber</tomee.flavor>
-</properties>
-
-<dependencies>
- <!-- ...your dependencies as usual... -->
- <dependency>
- <groupId>org.apache.tomee</groupId>
- <artifactId>tomee-embedded</artifactId>
- <classifier>${tomee.flavor}</classifier>
- <version>7.0.0</version>
- <scope>provided</scope>
- </dependency>
-</dependencies>
-
-<build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.6</version>
- <configuration>
- <failOnMissingWebXml>false</failOnMissingWebXml>
- <archive>
- <manifest>
- <mainClass>org.apache.tomee.embedded.Main</mainClass>
- </manifest>
- </archive>
- <dependentWarExcludes />
- <overlays>
- <overlay>
- <groupId>org.apache.tomee</groupId>
- <artifactId>tomee-embedded</artifactId>
- <classifier>${tomee.flavor}</classifier>
- <type>jar</type>
- <excludes />
- </overlay>
- </overlays>
- </configuration>
- </plugin>
- </plugins>
-</build>
-----
-
-Then just build the war:
-
-[source,bash]
-----
-mvn clean package
-----
-
-And you can run it:
-
-[source,bash]
-----
-java -jar myapp-1.0-SNAPSHOT.war
-----
+= TomEE Shading
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+== Fat Jars with Maven
+
+Shading the container and the application has some challenges like merging correctly resources (`META-INF/services/` typically).
+
+Here is a maven shade plugin configuration working for most cases:
+
+[source,xml]
+----
+<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>2.3</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <dependencyReducedPomLocation>${project.build.directory}/reduced-pom.xml</dependencyReducedPomLocation>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+ <mainClass>org.apache.tomee.embedded.FatApp</mainClass>
+ </transformer>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
+ <resource>META-INF/cxf/bus-extensions.txt</resource>
+ </transformer>
+ <transformer implementation="org.apache.openwebbeans.maven.shade.OpenWebBeansPropertiesTransformer" />
+ </transformers>
+ <filters>
+ <filter> <!-- we don't want JSF to be activated -->
+ <artifact>*:*</artifact>
+ <excludes>
+ <exclude>META-INF/faces-config.xml</exclude>
+ </excludes>
+ </filter>
+ </filters>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-maven</artifactId>
+ <version>1.7.0/version>
+ </dependency>
+ </dependencies>
+</plugin>
+----
+
+NOTE: see link:../tomee-embedded/index.html[TomEE Embedded] page for more information about tomee embedded options.
+
+IMPORTANT: this shade uses TomEE Embedded but you can do the same with an link:../applicationcomposer/index.html[Application Composer] application.
+
+TIP: if you have `META-INF/web-fragment.xml` in your application you will need to merge them in a single one in the shade. Note that tomcat provides one
+which can be skipped in this operation since it is there only as a marker for jasper detection.
+
+Then just build the jar:
+
+[source,bash]
+----
+mvn clean package
+----
+
+And you can run it:
+
+[source,bash]
+----
+java -jar myapp-1.0-SNAPSHOT.jar
+----
+
+== Fat Jars with Gradle
+
+With gradle you can rely on either jar plugin, fatjar plugin or shadowjar plugin. Last one is likely the closer to maven shade plugin
+so that's the one used for next sample:
+
+[source,groovy]
+----
+// run $ gradle clean shadowJar
+import org.apache.openwebbeans.gradle.shadow.OpenWebBeansPropertiesTransformer
+
+buildscript {
+ repositories {
+ mavenLocal()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
+ classpath 'org.apache.openwebbeans:openwebbeans-gradle:1.7.0'
+ }
+}
+
+apply plugin: 'com.github.johnrengelman.shadow'
+
+group 'org.apache.tomee.demo.gradle'
+version '1.0-SNAPSHOT'
+
+apply plugin: 'idea'
+apply plugin: 'java'
+
+sourceCompatibility = 1.8
+
+repositories {
+ mavenLocal()
+ mavenCentral()
+}
+
+dependencies {
+ compileOnly 'org.projectlombok:lombok:1.16.10'
+ compile 'org.apache.tomee:tomee-embedded:7.0.2-SNAPSHOT'
+}
+
+// customize exclusions depending your app
+
+// first the not used dependencies like JSF, JAXWS, JMS ones
+def excludedDependenciesGroups = [
+ // gradle is buggy with poms, scope provided and optional I think
+ 'com.google.code.findbugs',
+ 'com.google.guava',
+ 'javax.annotation',
+ 'javax.ws.rs',
+ 'net.sf.ehcache',
+ 'org.apache.httpcomponents',
+ 'org.ow2.asm',
+ // tomee jaxws, jms, etc...
+ 'commons-codec',
+ 'com.sun.xml.messaging.saaj',
+ 'joda-time',
+ 'junit',
+ 'net.shibboleth.utilities',
+ 'org.apache.activemq',
+ 'org.apache.activemq.protobuf',
+ 'org.apache.myfaces.core',
+ 'org.apache.neethi',
+ 'org.apache.santuario',
+ 'org.apache.ws.xmlschema',
+ 'org.apache.wss4j',
+ 'org.bouncycastle',
+ 'org.cryptacular',
+ 'org.fusesource.hawtbuf',
+ 'org.jasypt',
+ 'org.jvnet.mimepull',
+ 'org.opensaml',
+ 'wsdl4j',
+ 'xml-resolver'
+]
+
+// then cxf+tomee specific dependencies so we need to be more precise than the group
+// to not exclude everything
+def excludedDependenciesArtifacts = [
+ 'cxf-rt-bindings-soap',
+ 'cxf-rt-bindings-xml',
+ 'cxf-rt-databinding-jaxb',
+ 'cxf-rt-frontend-jaxws',
+ 'cxf-rt-frontend-simple',
+ 'cxf-rt-security-saml',
+ 'cxf-rt-ws-addr',
+ 'cxf-rt-wsdl',
+ 'cxf-rt-ws-policy',
+ 'cxf-rt-ws-security',
+ 'openejb-cxf',
+ 'openejb-webservices',
+ 'tomee-webservices',
+ 'geronimo-connector',
+ 'geronimo-javamail_1.4_mail'
+]
+shadowJar {
+ classifier = 'bundle'
+
+ // merge SPI descriptors
+ mergeServiceFiles()
+ append 'META-INF/cxf/bus-extensions.txt'
+ transform(OpenWebBeansPropertiesTransformer.class)
+
+ // switch off JSF + JMS + JAXWS
+ exclude 'META-INF/faces-config.xml'
+ dependencies {
+ exclude(dependency {
+ excludedDependenciesGroups.contains(it.moduleGroup) ||
+ excludedDependenciesArtifacts.contains(it.moduleName)
+ })
+ }
+
+ // ensure we define the expected Main (if you wrap tomee main use your own class)
+ manifest {
+ attributes 'Main-Class': 'org.apache.tomee.embedded.FatApp'
+ }
+}
+----
+
+Then run:
+
+[source]
+----
+gradle clean build shadowJar
+----
+
+and you'll get `build/libs/demo-gradle-tomee-embedded-shade-1.0-SNAPSHOT-bundle.jar` ready to run with:
+
+[source]
+----
+java -jar build/libs/demo-gradle-tomee-embedded-shade-1.0-SNAPSHOT-bundle.jar --as-war --simple-log=true
+----
+
+== Fat Wars
+
+Fat Wars are executable wars. Note they can be fancy for demos but they have the drawback to put the server in web resources
+at packaging time (to ensure the war is actually an executable jar) so adding a filter preventing these files to be read
+can be needed if you don't already use a web technology doing it (a servlet bound to /*).
+
+Here how to do a fat war:
+
+[source,xml]
+----
+<properties>
+ <!-- can be uber (for all), jaxrs, jaxws for lighter ones -->
+ <tomee.flavor>uber</tomee.flavor>
+</properties>
+
+<dependencies>
+ <!-- ...your dependencies as usual... -->
+ <dependency>
+ <groupId>org.apache.tomee</groupId>
+ <artifactId>tomee-embedded</artifactId>
+ <classifier>${tomee.flavor}</classifier>
+ <version>7.0.0</version>
+ <scope>provided</scope>
+ </dependency>
+</dependencies>
+
+<build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.6</version>
+ <configuration>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ <archive>
+ <manifest>
+ <mainClass>org.apache.tomee.embedded.Main</mainClass>
+ </manifest>
+ </archive>
+ <dependentWarExcludes />
+ <overlays>
+ <overlay>
+ <groupId>org.apache.tomee</groupId>
+ <artifactId>tomee-embedded</artifactId>
+ <classifier>${tomee.flavor}</classifier>
+ <type>jar</type>
+ <excludes />
+ </overlay>
+ </overlays>
+ </configuration>
+ </plugin>
+ </plugins>
+</build>
+----
+
+Then just build the war:
+
+[source,bash]
+----
+mvn clean package
+----
+
+And you can run it:
+
+[source,bash]
+----
+java -jar myapp-1.0-SNAPSHOT.war
+----
diff --git a/src/main/jbake/content/documentation/advanced/tomee-embedded/index.adoc b/src/main/jbake/content/advanced/tomee-embedded/index.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/advanced/tomee-embedded/index.adoc
rename to src/main/jbake/content/advanced/tomee-embedded/index.adoc
index 8664ade..f84703b
--- a/src/main/jbake/content/documentation/advanced/tomee-embedded/index.adoc
+++ b/src/main/jbake/content/advanced/tomee-embedded/index.adoc
@@ -1,223 +1,223 @@
-= TomEE Embedded
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-TomEE Embedded is based on Tomcat embedded and starts a real TomEE in the launching JVM. It is also
-able to deploy the classpath as a webapp and to use either `META-INF/resources` or a folder as web resources.
-
-Here is a basic programmatic usage based on `org.apache.tomee.embedded.Container` class:
-
-[source,java]
-----
-try (final Container container = new Container(new Configuration()).deployClasspathAsWebApp()) {
- System.out.println("Started on http://localhost:" + container.getConfiguration().getHttpPort());
-
- // do something or wait until the end of the application
-}
-----
-
-All EE features are then accessible directly in the same JVM.
-
-== TomEE Embedded Configuration
-
-The default configuration allows to start tomee without issue but you can desire to customize some of them.
-
-[.table.table-bordered,options="header"]
-|===
-| Name | Default | Description
-|httpPort | 8080| http port
-|stopPort | 8005| shutdown port
-|host |localhost| host
-|dir|-|where to create a file hierarchy for tomee (conf, temp, ...)
-|serverXml|-|which server.xml to use
-|keepServerXmlAsThis|false|don't adjust ports/host from the configuration and keep the ones in server.xml
-|properties|-|container properties
-|quickSession | true|use Random instead of SecureRandom (for dev)
-|skipHttp|false|don't use the http connector
-|httpsPort | 8443|https potr
-|ssl|false| activate https
-|withEjbRemote|false|use EJBd
-|keystoreFile|-|https keystore location
-|keystorePass|-|https keystore password
-|keystoreType |JKS|https keystore type
-|clientAuth|-|https client auth
-|keyAlias|-|https alias
-|sslProtocol|-|SSL protocol for https connector
-|webXml|-|default web.xml to use
-|loginConfig|-|which LoginConfig to use, relies on `org.apache.tomee.embedded.LoginConfigBuilder` to create it
-|securityConstraints|-|add some security constraints, use `org.apache.tomee.embedded.SecurityConstaintBuilder` to build them
-|realm|-|which realm to use (useful to switch to `JAASRealm` for instance) without modifying the application
-|deployOpenEjbApp|false|should internal openejb application be delpoyed
-|users|-|a map of user/password
-|roles|-|a map of role/users
-|tempDir|${java.io.tmpdir}/tomee-embedded_${timestamp}|tomcat needs a docBase, in case you don't provide one one will be created there
-|webResourceCached |true|should web resources be cached by tomcat (set false in frontend dev)
-|configuration-location|-|location (classpath or file) to a .properties to configure the server
-[pre-task|-|Runnable or org.apache.tomee.embedded.LifecycleTask implementations to execute before the container starts
-|classes-filter|-|implementation of a custom xbean Filter to ignore not desired classes during scanning
-|basic|-|set /* under BASIC authentication for the realm "Security", authentication role being "*"
-|===
-
-Note: passing to `Container` constructor a `Configuration` it will start the container automatically but using `setup(Configuration)`
-to initialize the configuration you will need to call `start()`.
-
-You can also pass through the properties `connector.xxx` and `connector.attributes.xxx` to customize connector(s)
-configuration directly.
-
-== Standalone applications or TomEE Embedded provided main(String[])
-
-Deploying an application in a server is very nice cause the application is generally small and it allows to update the
-container without touching the application (typically insanely important in case of security issues for instance).
-
-However sometimes you don't have the choice so TomEE Embedded provides a built-in `main(String[])`. Here are its options:
-
-NOTE: this is still a TomEE so all system properties work (for instance to create a resource).
-
-[.table.table-bordered,options="header"]
-|===
-|Name|Default|Description
-|--path|-|location of application(s) to deploy
-|--context|-|Context name for applications (same order than paths)
-|-p or --port|8080|http port
-|-s or --shutdown|8005|shutdown port
-|-d or --directory|./.apache-tomee|tomee work directory
-|-c or --as-war|-|deploy classpath as a war
-|-b or --doc-base|-|where web resources are for classpath deployment
-|--renaming|-|for fat war only, is renaming of the context supported
-|--serverxml|-|the server.xml location
-|--tomeexml|-|the server.xml location
-|--property|-|a list of container properties (values follow the format x=y)
-|===
-
-Note that since 7.0.0 TomEE provides 3 flavors (qualifier) of tomee-embedded as fat jars:
-
-- uber (where we put all request features by users, this is likely the most complete and the biggest)
-- jaxrs: webprofile minus JSF
-- jaxws: webprofile plus JAX-WS
-
-These different uber jars are interesting in mainly 2 cases:
-
-- you do a war shade (it avoids to list a bunch of dependencies but still get a customized version)
-- you run your application using `--path` option
-
-NOTE: if you already do a custom shade/fatjar this is not really impacting since you can depend on `tomee-embedded` and exclude/include what you want.
-
-== FatApp a shortcut main
-
-`FatApp` main (same package as tomee embedded `Main`) just wraps the default main ensuring:
-
-- ̀`--as-war` is used
-- ̀`--single-classloader` is used
-- `--configuration-location=tomee-embedded.properties` is set if `tomee-embedded.properties` is found in the classpath
-
-== configuration-location
-
-`--configuration-location` option allows to simplify the configuration of tomee embedded through properties.
-
-Here are the recognized entries (they match the configuration, see org.apache.tomee.embedded.Configuration for the detail):
-
-|===
-|Name|
-|http|
-|https|
-|stop|
-|host|
-|dir|
-|serverXml|
-|keepServerXmlAsThis|
-|quickSession|
-|skipHttp|
-|ssl|
-|http2|
-|webResourceCached|
-|withEjbRemote|
-|deployOpenEjbApp|
-|keystoreFile|
-|keystorePass|
-|keystoreType|
-|clientAuth|
-|keyAlias|
-|sslProtocol|
-|webXml|
-|tempDir|
-|classesFilter|
-|conf|
-|properties.x (set container properties x with the associated value)|
-|users.x (for default in memory realm add the user x with its password - the value)|
-|roles.x (for default in memory realm add the role x with its comma separated users - the value)|
-|connector.x (set the property x on the connector)|
-|realm=fullyqualifiedname,realm.prop=xxx (define a custom realm with its configuration)|
-|login=,login.prop=xxx (define a org.apache.tomee.embedded.LoginConfigBuilder == define a LoginConfig)|
-|securityConstraint=,securityConstraint.prop=xxx (define a org.apache.tomee.embedded.SecurityConstaintBuilder == define webapp security)|
-|configurationCustomizer.alias=,configurationCustomizer.alias.class=class,configurationCustomizer.alias.prop=xxx (define a ConfigurationCustomizer)|
-|===
-
-Here is a sample to add BASIC security on `/api/*`:
-
-[source]
-----
-# security configuration
-securityConstraint =
-securityConstraint.authConstraint = true
-securityConstraint.authRole = **
-securityConstraint.collection = api:/api/*
-
-login =
-login.realmName = app
-login.authMethod = BASIC
-
-realm = org.apache.catalina.realm.JAASRealm
-realm.appName = app
-
-properties.java.security.auth.login.config = configuration/login.jaas
-----
-
-And here a configuration to exclude jackson packages from scanning and use log4j2 as main logger (needs it as dependency):
-
-[source]
-----
-properties.openejb.log.factory = log4j2
-properties.openejb.container.additional.include = com.fasterxml.jackson,org.apache.logging.log4j
-----
-
-== Application Runner
-
-SInce TomEE 7.0.2, TomEE provide a light ApplicationComposer integration for TomEE Embedded (all features are not yet supported but the main ones are):
-`org.apache.tomee.embedded.TomEEEmbeddedApplicationRunner`. It relies on the definition of an `@Application`:
-
-[source,java]
-----
-@Application
-@Classes(context = "app")
-@ContainerProperties(@ContainerProperties.Property(name = "t", value = "set"))
-@TomEEEmbeddedApplicationRunner.LifecycleTasks(MyTask.class) // can start a ftp/sftp/elasticsearch/mongo/... server before tomee
-@TomEEEmbeddedApplicationRunner.Configurers(SetMyProperty.class)
-public class TheApp {
- @RandomPort("http")
- private int port;
-
- @RandomPort("http")
- private URL base;
-
- @org.apache.openejb.testing.Configuration
- public Properties add() {
- return new PropertiesBuilder().p("programmatic", "property").build();
- }
-
- @PostConstruct
- public void appStarted() {
- // ...
- }
-}
-----
-
-Then just start it with:
-
-[source,java]
-----
-TomEEEmbeddedApplicationRunner.run(TheApp.class, "some arg1", "other arg");
-----
-
-TIP: `@Classes(values)` and `@Jars` are supported too which can avoid a huge scanning if you run with a lot of not CDI dependencies which would boost the startup of your application.
+= TomEE Embedded
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+TomEE Embedded is based on Tomcat embedded and starts a real TomEE in the launching JVM. It is also
+able to deploy the classpath as a webapp and to use either `META-INF/resources` or a folder as web resources.
+
+Here is a basic programmatic usage based on `org.apache.tomee.embedded.Container` class:
+
+[source,java]
+----
+try (final Container container = new Container(new Configuration()).deployClasspathAsWebApp()) {
+ System.out.println("Started on http://localhost:" + container.getConfiguration().getHttpPort());
+
+ // do something or wait until the end of the application
+}
+----
+
+All EE features are then accessible directly in the same JVM.
+
+== TomEE Embedded Configuration
+
+The default configuration allows to start tomee without issue but you can desire to customize some of them.
+
+[.table.table-bordered,options="header"]
+|===
+| Name | Default | Description
+|httpPort | 8080| http port
+|stopPort | 8005| shutdown port
+|host |localhost| host
+|dir|-|where to create a file hierarchy for tomee (conf, temp, ...)
+|serverXml|-|which server.xml to use
+|keepServerXmlAsThis|false|don't adjust ports/host from the configuration and keep the ones in server.xml
+|properties|-|container properties
+|quickSession | true|use Random instead of SecureRandom (for dev)
+|skipHttp|false|don't use the http connector
+|httpsPort | 8443|https potr
+|ssl|false| activate https
+|withEjbRemote|false|use EJBd
+|keystoreFile|-|https keystore location
+|keystorePass|-|https keystore password
+|keystoreType |JKS|https keystore type
+|clientAuth|-|https client auth
+|keyAlias|-|https alias
+|sslProtocol|-|SSL protocol for https connector
+|webXml|-|default web.xml to use
+|loginConfig|-|which LoginConfig to use, relies on `org.apache.tomee.embedded.LoginConfigBuilder` to create it
+|securityConstraints|-|add some security constraints, use `org.apache.tomee.embedded.SecurityConstaintBuilder` to build them
+|realm|-|which realm to use (useful to switch to `JAASRealm` for instance) without modifying the application
+|deployOpenEjbApp|false|should internal openejb application be delpoyed
+|users|-|a map of user/password
+|roles|-|a map of role/users
+|tempDir|${java.io.tmpdir}/tomee-embedded_${timestamp}|tomcat needs a docBase, in case you don't provide one one will be created there
+|webResourceCached |true|should web resources be cached by tomcat (set false in frontend dev)
+|configuration-location|-|location (classpath or file) to a .properties to configure the server
+[pre-task|-|Runnable or org.apache.tomee.embedded.LifecycleTask implementations to execute before the container starts
+|classes-filter|-|implementation of a custom xbean Filter to ignore not desired classes during scanning
+|basic|-|set /* under BASIC authentication for the realm "Security", authentication role being "*"
+|===
+
+Note: passing to `Container` constructor a `Configuration` it will start the container automatically but using `setup(Configuration)`
+to initialize the configuration you will need to call `start()`.
+
+You can also pass through the properties `connector.xxx` and `connector.attributes.xxx` to customize connector(s)
+configuration directly.
+
+== Standalone applications or TomEE Embedded provided main(String[])
+
+Deploying an application in a server is very nice cause the application is generally small and it allows to update the
+container without touching the application (typically insanely important in case of security issues for instance).
+
+However sometimes you don't have the choice so TomEE Embedded provides a built-in `main(String[])`. Here are its options:
+
+NOTE: this is still a TomEE so all system properties work (for instance to create a resource).
+
+[.table.table-bordered,options="header"]
+|===
+|Name|Default|Description
+|--path|-|location of application(s) to deploy
+|--context|-|Context name for applications (same order than paths)
+|-p or --port|8080|http port
+|-s or --shutdown|8005|shutdown port
+|-d or --directory|./.apache-tomee|tomee work directory
+|-c or --as-war|-|deploy classpath as a war
+|-b or --doc-base|-|where web resources are for classpath deployment
+|--renaming|-|for fat war only, is renaming of the context supported
+|--serverxml|-|the server.xml location
+|--tomeexml|-|the server.xml location
+|--property|-|a list of container properties (values follow the format x=y)
+|===
+
+Note that since 7.0.0 TomEE provides 3 flavors (qualifier) of tomee-embedded as fat jars:
+
+- uber (where we put all request features by users, this is likely the most complete and the biggest)
+- jaxrs: webprofile minus JSF
+- jaxws: webprofile plus JAX-WS
+
+These different uber jars are interesting in mainly 2 cases:
+
+- you do a war shade (it avoids to list a bunch of dependencies but still get a customized version)
+- you run your application using `--path` option
+
+NOTE: if you already do a custom shade/fatjar this is not really impacting since you can depend on `tomee-embedded` and exclude/include what you want.
+
+== FatApp a shortcut main
+
+`FatApp` main (same package as tomee embedded `Main`) just wraps the default main ensuring:
+
+- ̀`--as-war` is used
+- ̀`--single-classloader` is used
+- `--configuration-location=tomee-embedded.properties` is set if `tomee-embedded.properties` is found in the classpath
+
+== configuration-location
+
+`--configuration-location` option allows to simplify the configuration of tomee embedded through properties.
+
+Here are the recognized entries (they match the configuration, see org.apache.tomee.embedded.Configuration for the detail):
+
+|===
+|Name|
+|http|
+|https|
+|stop|
+|host|
+|dir|
+|serverXml|
+|keepServerXmlAsThis|
+|quickSession|
+|skipHttp|
+|ssl|
+|http2|
+|webResourceCached|
+|withEjbRemote|
+|deployOpenEjbApp|
+|keystoreFile|
+|keystorePass|
+|keystoreType|
+|clientAuth|
+|keyAlias|
+|sslProtocol|
+|webXml|
+|tempDir|
+|classesFilter|
+|conf|
+|properties.x (set container properties x with the associated value)|
+|users.x (for default in memory realm add the user x with its password - the value)|
+|roles.x (for default in memory realm add the role x with its comma separated users - the value)|
+|connector.x (set the property x on the connector)|
+|realm=fullyqualifiedname,realm.prop=xxx (define a custom realm with its configuration)|
+|login=,login.prop=xxx (define a org.apache.tomee.embedded.LoginConfigBuilder == define a LoginConfig)|
+|securityConstraint=,securityConstraint.prop=xxx (define a org.apache.tomee.embedded.SecurityConstaintBuilder == define webapp security)|
+|configurationCustomizer.alias=,configurationCustomizer.alias.class=class,configurationCustomizer.alias.prop=xxx (define a ConfigurationCustomizer)|
+|===
+
+Here is a sample to add BASIC security on `/api/*`:
+
+[source]
+----
+# security configuration
+securityConstraint =
+securityConstraint.authConstraint = true
+securityConstraint.authRole = **
+securityConstraint.collection = api:/api/*
+
+login =
+login.realmName = app
+login.authMethod = BASIC
+
+realm = org.apache.catalina.realm.JAASRealm
+realm.appName = app
+
+properties.java.security.auth.login.config = configuration/login.jaas
+----
+
+And here a configuration to exclude jackson packages from scanning and use log4j2 as main logger (needs it as dependency):
+
+[source]
+----
+properties.openejb.log.factory = log4j2
+properties.openejb.container.additional.include = com.fasterxml.jackson,org.apache.logging.log4j
+----
+
+== Application Runner
+
+SInce TomEE 7.0.2, TomEE provide a light ApplicationComposer integration for TomEE Embedded (all features are not yet supported but the main ones are):
+`org.apache.tomee.embedded.TomEEEmbeddedApplicationRunner`. It relies on the definition of an `@Application`:
+
+[source,java]
+----
+@Application
+@Classes(context = "app")
+@ContainerProperties(@ContainerProperties.Property(name = "t", value = "set"))
+@TomEEEmbeddedApplicationRunner.LifecycleTasks(MyTask.class) // can start a ftp/sftp/elasticsearch/mongo/... server before tomee
+@TomEEEmbeddedApplicationRunner.Configurers(SetMyProperty.class)
+public class TheApp {
+ @RandomPort("http")
+ private int port;
+
+ @RandomPort("http")
+ private URL base;
+
+ @org.apache.openejb.testing.Configuration
+ public Properties add() {
+ return new PropertiesBuilder().p("programmatic", "property").build();
+ }
+
+ @PostConstruct
+ public void appStarted() {
+ // ...
+ }
+}
+----
+
+Then just start it with:
+
+[source,java]
+----
+TomEEEmbeddedApplicationRunner.run(TheApp.class, "some arg1", "other arg");
+----
+
+TIP: `@Classes(values)` and `@Jars` are supported too which can avoid a huge scanning if you run with a lot of not CDI dependencies which would boost the startup of your application.
diff --git a/src/main/jbake/content/community/index.adoc b/src/main/jbake/content/community/index.adoc
index aa4244a..44144ca 100755
--- a/src/main/jbake/content/community/index.adoc
+++ b/src/main/jbake/content/community/index.adoc
@@ -3,7 +3,7 @@
:jbake-type: page
:jbake-status: published
-=== Source Code
+=== In code veritas est
Want to grab TomEE source code and hack it? Nothing simpler, just go link:sources.html[there].
@@ -19,7 +19,7 @@
For more information about available support for TomEE please have a look on link:../security/support.html[Support] page.
-=== Contribute to this website
+=== Contribute the this website
This website is a simple JBake project you can find at http://svn.apache.org/repos/asf/tomee/site/trunk/generators/site-tomee-ng/.
diff --git a/src/main/jbake/content/documentation/developer/classloading/index.adoc b/src/main/jbake/content/developer/classloading/index.adoc
old mode 100644
new mode 100755
similarity index 98%
rename from src/main/jbake/content/documentation/developer/classloading/index.adoc
rename to src/main/jbake/content/developer/classloading/index.adoc
index 4b2cdd9..6f1f64e
--- a/src/main/jbake/content/documentation/developer/classloading/index.adoc
+++ b/src/main/jbake/content/developer/classloading/index.adoc
@@ -1,59 +1,59 @@
-= TomEE Classloading
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-TomEE ClassLoading is directly mapped to Tomcat one.
-
-ifndef::backend-pdf[]
-
-[#filetree.col-md-3]
-[
- {
- label: 'JVM',
- description: 'The JVM classloader launching tomcat main(String[])',
- children: [
- {
- label:'common.loader',
- description:'Customizable in conf/catalina.properties, the common loader is the Tomcat classloader',
- children: [
- {
- label:'shared.loader',
- description:'Optional layer where you can add libraries for the web applications not seen by Tomcat. It is generally not used and not encouraged since Tomcat 6',
- children: [
- {
- label:'webapp1',
- description:'loader of one of your wars, it container WEB-INF/classes, WEB-INF/lib/*.jar'
- },
- {
- label:'webapp2',
- description:'loader of another one of your wars, it container WEB-INF/classes, WEB-INF/lib/*.jar'
- },
- {
- label:'application1',
- description:'loader of another application, it can be an ear, it contains lib and ejbmodules of the ear',
- children: [
- {
- label:'earwebapp1',
- description:'loader of one of the wars of the ear'
- },
- {
- label:'earwebapp2',
- description:'loader of the other webapp of the ear'
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
-]
-
-[#filetreedetail.col-md-8.bs-callout.bs-callout-primary]
-Click on the tree (JVM) on the left to see the detail there.
-
-endif::[]
-
+= TomEE ClassLoading
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+TomEE ClassLoading is directly mapped to Tomcat one.
+
+ifndef::backend-pdf[]
+
+[#filetree.col-md-3]
+[
+ {
+ label: 'JVM',
+ description: 'The JVM classloader launching tomcat main(String[])',
+ children: [
+ {
+ label:'common.loader',
+ description:'Customizable in conf/catalina.properties, the common loader is the Tomcat classloader',
+ children: [
+ {
+ label:'shared.loader',
+ description:'Optional layer where you can add libraries for the web applications not seen by Tomcat. It is generally not used and not encouraged since Tomcat 6',
+ children: [
+ {
+ label:'webapp1',
+ description:'loader of one of your wars, it container WEB-INF/classes, WEB-INF/lib/*.jar'
+ },
+ {
+ label:'webapp2',
+ description:'loader of another one of your wars, it container WEB-INF/classes, WEB-INF/lib/*.jar'
+ },
+ {
+ label:'application1',
+ description:'loader of another application, it can be an ear, it contains lib and ejbmodules of the ear',
+ children: [
+ {
+ label:'earwebapp1',
+ description:'loader of one of the wars of the ear'
+ },
+ {
+ label:'earwebapp2',
+ description:'loader of the other webapp of the ear'
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+]
+
+[#filetreedetail.col-md-8.bs-callout.bs-callout-primary]
+Click on the tree (JVM) on the left to see the detail there.
+
+endif::[]
+
diff --git a/src/main/jbake/content/documentation/developer/configuration/cxf.adoc b/src/main/jbake/content/developer/configuration/cxf.adoc
old mode 100644
new mode 100755
similarity index 95%
rename from src/main/jbake/content/documentation/developer/configuration/cxf.adoc
rename to src/main/jbake/content/developer/configuration/cxf.adoc
index db9db80..6289f28
--- a/src/main/jbake/content/documentation/developer/configuration/cxf.adoc
+++ b/src/main/jbake/content/developer/configuration/cxf.adoc
@@ -1,94 +1,94 @@
-= CXF Configuration - JAX-RS and JAX-WS
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-TomEE relies on Apache CXF for JAX-RS and JAX-WS, it doesn't provides all CXF modules but most common
-ones for both specifications (JAX-RS is part of all distributions but JAX-WS is only part of plus one).
-
-== Configuration
-
-CXF API is reusable but you can also configure the interceptors through `openejb-jar.xml` (located in WEB-INF).
-
-If you want to configure JAX-RS you will use the prefix `cxf.jaxrs` and if you configure JAX-WS you use `cxf.jaxws` prefix.
-
-TIP: to configure directly the bus use `org.apache.openejb.cxf.bus.` prefix and configure it in `conf/system.properties`.
-
-To configure JAX-RS you need to add in `openejb-jar.xml` a `pojo-deployment`:
-
-[source,xml]
-----
-<?xml version="1.0" encoding="UTF-8"?>
-<openejb-jar>
- <pojo-deployment class-name="jaxrs-application">
- <properties>
- # here will go the config
- </properties>
- </pojo-deployment>
-</openejb-jar>
-----
-
-For JAX-WS you will use a `pojo-deployment` matching the webservice class name for POJO webservices
-or an `ejb-deployment` instead of a `pojo-deployment` for EJB webservices:
-
-
-[source,xml]
-----
-<?xml version="1.0" encoding="UTF-8"?>
-<openejb-jar>
- <ejb-deployment ejb-name="MyEJBWebService">
- <properties>
- # here will go the config
- </properties>
- </ejb-deployment>
-</openejb-jar>
-----
-
-Then once you selected your prefix and know where to write the config just use the following entries:
-
-- properties: server factory properties
-- features: CXF features
-- in-interceptors: CXF in interceptors
-- out-interceptors: CXF out interceptors
-- in-fault-interceptors: CXF in interceptors for fault handling
-- out-fault-interceptors: CXF out interceptors for fault handling
-- databinding: server databinding
-- providers (only for JAX-RS endpoint): list of JAX-RS providers
-- skip-provider-scanning (only for JAX-RS): is provider scanning on or not (default true)
-
-For features and interceptors the rule is the same: value is a list comma separated. Each value of the list is either a qualified class name or an id of a service in resources.xml.
-
-Databinding is simply either a qualified name or a service id in resources.xml (located in WEB-INF).
-
-== Sample for JAX-WS
-
-To configure WSS4J on the EJB `CalculatorBean` for instance add in openejb-jar.xml:
-
-[source,xml]
-----
-<openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
- <ejb-deployment ejb-name="CalculatorBean">
- <properties>
- cxf.jaxws.in-interceptors = wss4j
- </properties>
- </ejb-deployment>
-</openejb-jar>
-----
-
-With associated resources.xml which will define precisely the `wss4j` configuration:
-
-[source,xml]
-----
-<resources>
- <Service id="wss4j" class-name="org.apache.openejb.server.cxf.config.WSS4JInInterceptorFactory" factory-name="create">
- action = UsernameToken
- passwordType = PasswordText
- passwordCallbackClass = org.superbiz.ws.security.PasswordCallbackHandler
- </Service>
-</resources>
-----
-
-== Sample for JAX-RS
-
-link:../json/index.html[JAX-RS JSON] page shows a sample dedicated to JAX-RS.
+= TomEE and CXF Configuration
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+TomEE relies on Apache CXF for JAX-WS and JAX-RS, it doesn't provides all CXF modules but most comomn
+ones for both specifications (JAX-RS is part of all distributions but JAX-WS is only part of plus one).
+
+== Configuration
+
+CXF API is reusable but you can also configure the interceptors through `openejb-jar.xml` (located in WEB-INF).
+
+If you want to configure JAX-RS you will use the prefix `cxf.jaxrs` and if you configure JAX-WS you use `cxf.jaxws` prefix.
+
+TIP: to configure directly the bus use `org.apache.openejb.cxf.bus.` prefix and configure it in `conf/system.properties`.
+
+To configure JAX-RS you need to add in `openejb-jar.xml` a `pojo-deployment`:
+
+[source,xml]
+----
+<?xml version="1.0" encoding="UTF-8"?>
+<openejb-jar>
+ <pojo-deployment class-name="jaxrs-application">
+ <properties>
+ # here will go the config
+ </properties>
+ </pojo-deployment>
+</openejb-jar>
+----
+
+For JAX-WS you will use a `pojo-deployment` matching the webservice class name for POJO webservices
+or an `ejb-deployment` instead of a `pojo-deployment` for EJB webservices:
+
+
+[source,xml]
+----
+<?xml version="1.0" encoding="UTF-8"?>
+<openejb-jar>
+ <ejb-deployment ejb-name="MyEJBWebService">
+ <properties>
+ # here will go the config
+ </properties>
+ </ejb-deployment>
+</openejb-jar>
+----
+
+Then once you selected your prefix and know where to write the config just use the following entries:
+
+- properties: server factory properties
+- features: CXF features
+- in-interceptors: CXF in interceptors
+- out-interceptors: CXF out interceptors
+- in-fault-interceptors: CXF in interceptors for fault handling
+- out-fault-interceptors: CXF out interceptors for fault handling
+- databinding: server databinding
+- providers (only for JAX-RS endpoint): list of JAX-RS providers
+- skip-provider-scanning (only for JAX-RS): is provider scanning on or not (default true)
+
+For features and interceptors the rule is the same: value is a list comma separated. Each value of the list is either a qualified class name or an id of a service in resources.xml.
+
+Databinding is simply either a qualified name or a service id in resources.xml (located in WEB-INF).
+
+== Sample for JAX-WS
+
+To configure WSS4J on the EJB `CalculatorBean` for instance add in openejb-jar.xml:
+
+[source,xml]
+----
+<openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
+ <ejb-deployment ejb-name="CalculatorBean">
+ <properties>
+ cxf.jaxws.in-interceptors = wss4j
+ </properties>
+ </ejb-deployment>
+</openejb-jar>
+----
+
+With associated resources.xml which will define precisely the `wss4j` configuration:
+
+[source,xml]
+----
+<resources>
+ <Service id="wss4j" class-name="org.apache.openejb.server.cxf.config.WSS4JInInterceptorFactory" factory-name="create">
+ action = UsernameToken
+ passwordType = PasswordText
+ passwordCallbackClass = org.superbiz.ws.security.PasswordCallbackHandler
+ </Service>
+</resources>
+----
+
+== Sample for JAX-RS
+
+link:../json/index.html[JAX-RS JSON] page shows a sample dedicated to JAX-RS.
diff --git a/src/main/jbake/content/documentation/developer/ide/index.adoc b/src/main/jbake/content/developer/ide/index.adoc
old mode 100644
new mode 100755
similarity index 85%
rename from src/main/jbake/content/documentation/developer/ide/index.adoc
rename to src/main/jbake/content/developer/ide/index.adoc
index f389993..9b3dd5f
--- a/src/main/jbake/content/documentation/developer/ide/index.adoc
+++ b/src/main/jbake/content/developer/ide/index.adoc
@@ -1,25 +1,25 @@
-= IDEs
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-TomEE is supported by the main IDEs in the market:
-
-- https://eclipse.org/downloads/[Eclipse]
-- https://www.jetbrains.com/idea/download/[Intellij Idea]
-- https://netbeans.org/downloads/[Netbeans]
-
-=== Eclipse
-
-Be the first to write this part!
-
-=== Idea
-
-Be the first to write this part!
-
-=== Netbeans
-
-Be the first to write this part!
-
-
+= TomEE and IDE
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+TomEE is supported by main IDE of the marker:
+
+- https://eclipse.org/downloads/[Eclipse]
+- https://www.jetbrains.com/idea/download/[Intellij Idea]
+- https://netbeans.org/downloads/[Netbeans]
+
+=== Eclipse
+
+Be the first to write this part!
+
+=== Idea
+
+Be the first to write this part!
+
+=== Netbeans
+
+Be the first to write this part!
+
+
diff --git a/src/main/jbake/content/developer/index.adoc b/src/main/jbake/content/developer/index.adoc
new file mode 100755
index 0000000..181b700
--- /dev/null
+++ b/src/main/jbake/content/developer/index.adoc
@@ -0,0 +1,13 @@
+= TomEE for Developers
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+- link:classloading/index.html[All you need to know about TomEE classloading]
+- link:ide/index.html[Eclipse, Intellij Idea, Netbeans]: TomEE in and IDE
+- link:testing/index.html[TomEE and Testing]
+- link:tools/index.html[TomEE and Tools]
+- link:json/index.html[TomEE and JSON]
+- link:configuration/cxf.html[TomEE CXF Configuration]
+- link:migration/tomee-1-to-7.html[Migrating from TomEE 1 to 7]
diff --git a/src/main/jbake/content/documentation/developer/json/index.adoc b/src/main/jbake/content/developer/json/index.adoc
old mode 100644
new mode 100755
similarity index 97%
rename from src/main/jbake/content/documentation/developer/json/index.adoc
rename to src/main/jbake/content/developer/json/index.adoc
index d71fb5b..cd33e8a
--- a/src/main/jbake/content/documentation/developer/json/index.adoc
+++ b/src/main/jbake/content/developer/json/index.adoc
@@ -1,206 +1,206 @@
-= TomEE 7 and Apache Johnzon
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-Since TomEE 7.0, TomEE comes with Apache Johnzon.
-It means you can use JSON-P out of the box but also Johnzon Mapper
-which is the default JAX-RS provider for JSON.
-
-*IMPORTANT* - this is a breaking change with 1.x which was using jettison.
-This last one was relying on JAXB model to generate JSON which often led
-to unexpected JSON tree and some unexpected escaping too.
-
-== Getting started with Johnzon Mapper
-
-http://johnzon.apache.org/ will get more informations than this quick
-getting started but here are the basics of the mapping with Johnzon.
-
-The mapper uses a direct java to json representation.
-
-For instance this java bean:
-
-[source,java]
-----
-public class MyModel {
- private int id;
- private String name;
-
- // getters/setters
-}
-----
-
-will be mapped to:
-
-[source,java]
-----
-{
- "id": 1234,
- "name": "Johnzon doc"
-}
-----
-
-Note that Johnzon supports several customization either directly on the MapperBuilder of through annotations.
-
-=== @JohnzonIgnore
-
-@JohnzonIgnore is used to ignore a field. You can optionally say you ignore the field until some version
-if the mapper has a version:
-
-[source,java]
-----
-public class MyModel {
- @JohnzonIgnore
- private String name;
-
- // getters/setters
-}
-----
-
-Or to support name for version 3, 4, ... but ignore it for 1 and 2:
-
-
-[source,java]
-----
-public class MyModel {
- @JohnzonIgnore(minVersion = 3)
- private String name;
-
- // getters/setters
-}
-----
-
-=== @JohnzonConverter
-
-Converters are used for advanced mapping between java and json.
-
-There are several converter types:
-
-1. Converter: map java to json and the opposite based on the string representation
-2. Adapter: a converter not limited to String
-3. ObjectConverter.Reader: to converter from json to java at low level
-4. ObjectConverter.Writer: to converter from java to json at low level
-4. ObjectConverter.Codec: a Reader and Writer
-
-The most common is to customize date format but they all take. For that simple case we often use a Converter:
-
-[source,java]
-----
-public class LocalDateConverter implements Converter<LocalDate> {
- @Override
- public String toString(final LocalDate instance) {
- return instance.toString();
- }
-
- @Override
- public LocalDate fromString(final String text) {
- return LocalDate.parse(text);
- }
-}
-----
-
-If you need a more advanced use case and modify the structure of the json (wrapping the value for instance)
-you will likely need Reader/Writer or a Codec.
-
-Then once your converter developed you can either register globally on the MapperBuilder or simply decorate
-the field you want to convert with @JohnzonConverter:
-
-[source,java]
-----
-public class MyModel {
- @JohnzonConverter(LocalDateConverter.class)
- private LocalDate date;
-
- // getters/setters
-}
-----
-
-=== @JohnzonProperty
-
-Sometimes the json name is not java friendly (_foo or foo-bar or even 200 for instance). For that cases
-@JohnzonProperty allows to customize the name used:
-
-[source,java]
-----
-public class MyModel {
- @JohnzonProperty("__date")
- private LocalDate date;
-
- // getters/setters
-}
-----
-
-=== AccessMode
-
-On MapperBuilder you have several AccessMode available by default but you can also create your own one.
-
-The default available names are:
-
-* field: to use fields model and ignore getters/setters
-* method: use getters/setters (means if you have a getter but no setter you will serialize the property but not read it)
-* strict-method (default based on Pojo convention): same as method but getters for collections are not used to write
-
-You can use these names with setAccessModeName().
-
-=== Your own mapper
-
-Since johnzon is in tomee libraries you can use it yourself (if you use maven/gradle set johnzon-mapper as provided):
-
-[source,java]
-----
-final MySuperObject object = createObject();
-
-final Mapper mapper = new MapperBuilder().build();
-mapper.writeObject(object, outputStream);
-
-final MySuperObject otherObject = mapper.readObject(inputStream, MySuperObject.class);
-----
-
-== Johnzon and JAX-RS
-
-TomEE uses by default Johnzon as JAX-RS provider for versions 7.x. If you want however to customize it you need to follow this procedure:
-
-1. Create a WEB-INF/openejb-jar.xml:
-
-[source,xml]
-----
-<?xml version="1.0" encoding="UTF-8"?>
-<openejb-jar>
- <pojo-deployment class-name="jaxrs-application">
- <properties>
- # optional but requires to skip scanned providers if set to true
- cxf.jaxrs.skip-provider-scanning = true
- # list of providers we want
- cxf.jaxrs.providers = johnzon,org.apache.openejb.server.cxf.rs.EJBAccessExceptionMapper
- </properties>
- </pojo-deployment>
-</openejb-jar>
-----
-
-2. Create a WEB-INF/resources.xml to define johnzon service which will be use to instantiate the provider
-
-[source,xml]
-----
-<?xml version="1.0" encoding="UTF-8"?>
-<resources>
- <Service id="johnzon" class-name="org.apache.johnzon.jaxrs.ConfigurableJohnzonProvider">
- # 1M
- maxSize = 1048576
- bufferSize = 1048576
-
- # ordered attributes
- attributeOrder = $order
-
- # Additional types to ignore
- ignores = org.apache.cxf.jaxrs.ext.multipart.MultipartBody
- </Service>
-
- <Service id="order" class-name="com.company.MyAttributeSorter" />
-
-</resources>
-----
-
-Note: as you can see you mainly just need to define a service with the id johnzon (same as in openejb-jar.xml)
-and you can reference other instances using $id for services and @id for resources.
-
+= TomEE and JSON
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+Since TomEE 7.0, TomEE comes with Apache Johnzon.
+It means you can use JSON-P out of the box but also Johnzon Mapper
+which is the default JAX-RS provider for JSON.
+
+IMPORTANT: this is a breaking change with 1.x which was using jettison.
+This last one was relying on JAXB model to generate JSON which often led
+to unexpected JSON tree and some unexpected escaping too.
+
+== Getting started with Johnzon Mapper
+
+http://johnzon.apache.org/ will get more informations than this quick
+getting started but here are the basics of the mapping with Johnzon.
+
+The mapper uses a direct java to json representation.
+
+For instance this java bean:
+
+[source,java]
+----
+public class MyModel {
+ private int id;
+ private String name;
+
+ // getters/setters
+}
+----
+
+will be mapped to:
+
+[source,java]
+----
+{
+ "id": 1234,
+ "name": "Johnzon doc"
+}
+----
+
+Note that Johnzon supports several customization either directly on the MapperBuilder of through annotations.
+
+=== @JohnzonIgnore
+
+@JohnzonIgnore is used to ignore a field. You can optionally say you ignore the field until some version
+if the mapper has a version:
+
+[source,java]
+----
+public class MyModel {
+ @JohnzonIgnore
+ private String name;
+
+ // getters/setters
+}
+----
+
+Or to support name for version 3, 4, ... but ignore it for 1 and 2:
+
+
+[source,java]
+----
+public class MyModel {
+ @JohnzonIgnore(minVersion = 3)
+ private String name;
+
+ // getters/setters
+}
+----
+
+=== @JohnzonConverter
+
+Converters are used for advanced mapping between java and json.
+
+There are several converter types:
+
+1. Converter: map java to json and the opposite based on the string representation
+2. Adapter: a converter not limited to String
+3. ObjectConverter.Reader: to converter from json to java at low level
+4. ObjectConverter.Writer: to converter from java to json at low level
+4. ObjectConverter.Codec: a Reader and Writer
+
+The most common is to customize date format but they all take. For that simple case we often use a Converter:
+
+[source,java]
+----
+public class LocalDateConverter implements Converter<LocalDate> {
+ @Override
+ public String toString(final LocalDate instance) {
+ return instance.toString();
+ }
+
+ @Override
+ public LocalDate fromString(final String text) {
+ return LocalDate.parse(text);
+ }
+}
+----
+
+If you need a more advanced use case and modify the structure of the json (wrapping the value for instance)
+you will likely need Reader/Writer or a Codec.
+
+Then once your converter developed you can either register globally on the MapperBuilder or simply decorate
+the field you want to convert with @JohnzonConverter:
+
+[source,java]
+----
+public class MyModel {
+ @JohnzonConverter(LocalDateConverter.class)
+ private LocalDate date;
+
+ // getters/setters
+}
+----
+
+=== @JohnzonProperty
+
+Sometimes the json name is not java friendly (_foo or foo-bar or even 200 for instance). For that cases
+@JohnzonProperty allows to customize the name used:
+
+[source,java]
+----
+public class MyModel {
+ @JohnzonProperty("__date")
+ private LocalDate date;
+
+ // getters/setters
+}
+----
+
+=== AccessMode
+
+On MapperBuilder you have several AccessMode available by default but you can also create your own one.
+
+The default available names are:
+
+* field: to use fields model and ignore getters/setters
+* method: use getters/setters (means if you have a getter but no setter you will serialize the property but not read it)
+* strict-method (default based on Pojo convention): same as method but getters for collections are not used to write
+
+You can use these names with setAccessModeName().
+
+=== Your own mapper
+
+Since johnzon is in tomee libraries you can use it yourself (if you use maven/gradle set johnzon-mapper as provided):
+
+[source,java]
+----
+final MySuperObject object = createObject();
+
+final Mapper mapper = new MapperBuilder().build();
+mapper.writeObject(object, outputStream);
+
+final MySuperObject otherObject = mapper.readObject(inputStream, MySuperObject.class);
+----
+
+== Johnzon and JAX-RS
+
+TomEE uses by default Johnzon as JAX-RS provider for versions 7.x. If you want however to customize it you need to follow this procedure:
+
+1. Create a WEB-INF/openejb-jar.xml:
+
+[source,xml]
+----
+<?xml version="1.0" encoding="UTF-8"?>
+<openejb-jar>
+ <pojo-deployment class-name="jaxrs-application">
+ <properties>
+ # optional but requires to skip scanned providers if set to true
+ cxf.jaxrs.skip-provider-scanning = true
+ # list of providers we want
+ cxf.jaxrs.providers = johnzon,org.apache.openejb.server.cxf.rs.EJBAccessExceptionMapper
+ </properties>
+ </pojo-deployment>
+</openejb-jar>
+----
+
+2. Create a WEB-INF/resources.xml to define johnzon service which will be use to instantiate the provider
+
+[source,xml]
+----
+<?xml version="1.0" encoding="UTF-8"?>
+<resources>
+ <Service id="johnzon" class-name="org.apache.johnzon.jaxrs.ConfigurableJohnzonProvider">
+ # 1M
+ maxSize = 1048576
+ bufferSize = 1048576
+
+ # ordered attributes
+ attributeOrder = $order
+
+ # Additional types to ignore
+ ignores = org.apache.cxf.jaxrs.ext.multipart.MultipartBody
+ </Service>
+
+ <Service id="order" class-name="com.company.MyAttributeSorter" />
+
+</resources>
+----
+
+Note: as you can see you mainly just need to define a service with the id johnzon (same as in openejb-jar.xml)
+and you can reference other instances using $id for services and @id for resources.
+
diff --git a/src/main/jbake/content/developer/migration/tomee-1-to-7.adoc b/src/main/jbake/content/developer/migration/tomee-1-to-7.adoc
new file mode 100644
index 0000000..5bf7153
--- /dev/null
+++ b/src/main/jbake/content/developer/migration/tomee-1-to-7.adoc
@@ -0,0 +1,33 @@
+= Migrate from TomEE 1 to TomEE 7
+:jbake-date: 2017-06-17
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+== Breaking changes
+
+- Artifact coordinates changes
+
+GroupId changed from `org.apache.openejb` to `org.apache.tomee`.
+It includes maven plugins which use now `org.apache.tomee.maven` and the `javaee-api`.
+
+Versions of openejb and tomee are now aligned on 7.x and you don't need to use
+4.x and 1.x (or any variant) for openejb and tomee.
+
+- JAX-RS 2 specification refined the sorting of providers. It can have side effects for message body
+readers/writers which don't define their target mediatype properly like Jackson which uses wildcard instead of
+a json related mediatype. To solve it register a custom provider redefining the media type.
+
+Can be as easy as:
+
+[source,java]
+----
+@Provider
+@Consumes("application/json")
+@Produces("application/json")
+public class MyAppJsonProvider extends JacksonJsonProvider {
+}
+----
+
+- JPA and CDI are linked now, enabling JPA to use CDI for its components but CDI can use JPA too...
+to solve issues with hibernate you need to add either as system property or persistence unit `tomee.jpa.factory.lazy = true`.
diff --git a/src/main/jbake/content/documentation/developer/testing/applicationcomposer/index.adoc b/src/main/jbake/content/developer/testing/applicationcomposer/index.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/developer/testing/applicationcomposer/index.adoc
rename to src/main/jbake/content/developer/testing/applicationcomposer/index.adoc
index d5bf455..5b740f2
--- a/src/main/jbake/content/documentation/developer/testing/applicationcomposer/index.adoc
+++ b/src/main/jbake/content/developer/testing/applicationcomposer/index.adoc
@@ -1,335 +1,335 @@
-= ApplicationComposer: the swiss knife of TomEE
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-ApplicationComposer API is mainly contained in org.apache.openejb.testing package (historically, today we would have called the package org.apache.tomee.applicationcomposer).
-
-=== Dependencies
-
-To start using ApplicationComposer you need to add some dependencies.
-
-The minimum required one is openejb-core:
-
-[source,xml]
-----
-<dependency>
- <groupId>org.apache.tomee</groupId>
- <artifactId>openejb-core</artifactId>
- <version>${openejb.version></version>
-</dependency>
-----
-
-If you need JAXRS services you'll add (or replace thanks to transitivity of maven) openejb-cxf-rs:
-
-[source,xml]
-----
-<dependency>
- <groupId>org.apache.tomee</groupId>
- <artifactId>openejb-cxf-rs</artifactId>
- <version>${openejb.version></version>
-</dependency>
-----
-
-If you need JAXWS services you'll add (or replace thanks to transitivity of maven) openejb-cxf:
-
-[source,xml]
-----
-<dependency>
- <groupId>org.apache.tomee</groupId>
- <artifactId>openejb-cxf</artifactId>
- <version>${openejb.version></version>
-</dependency>
-----
-
-=== ApplicationComposer Components
-
-==== @Module
-An ApplicationComposer needs at minimum a module (the application you need to deploy).
-
-To do so you have two cases:
-
-before TomEE 7.x: you can only write method(s) decorated with @Module
-since TomEE 7.x: you can skip it and use @Classes directly on the ApplicationComposer class as a shortcut for:
-
-[source,java]
-----
-@Module public WebApp app() { return new WebApp(); }
-----
-
-The expected returned type of these methods are in org.apache.openejb.jee package:
-
-- Application: entry point to create an ear
-- WebApp: a web application
-- EjbJar: an ejb module
-- EnterpriseBean children: a simple EJB
-- Persistence: a persistence module with multiple units
-- PersistenceUnit: a simple unit (automatically wrapped in a Persistence)
-- Connector: a JCA connector module
-- Beans: a CDI module,
-- Class[] or Class: a set of classes scanned to discover annotations
-
-Note that for easiness @Classes was added to be able to describe a module and some scanned classes. For instance the following snippet will create a web application with classes C1, C2 as CDI beans and E1 as an EJB automatically:
-
-[source,java]
-----
-@Module
-@Classes(cdi = true, value = { C1.class, C2.class, E1.class })
-public WebApp app() {
- return new WebApp();
-}
-----
-
-==== @Configuration
-Often you need to customize a bit the container or at least create some resources like test databases. To do so you can create a method returning Properties which will be the container properties.
-
-Note: to simplify writing properties you can use PropertiesBuilder util class which is just a fluent API to write properties.
-
-In these properties you can reuse OpenEJB/TomEE property syntax for resources.
-
-Here is a sample:
-
-[source,java]
-----
-@Configuration
-public Properties configuration() {
- return new PropertiesBuilder()
- .p("db", "new://Resource?type=DataSource")
- .p("db.JdbcUrld", "jdbc:hsqldb:mem:test")
- .build();
-}
-----
-
-Since TomEE 7.x you can also put properties on ApplicationComposer class using @ContainerProperties API:
-
-[source,java]
-----
-@ContainerProperties({
- @ContainerProperties.Property(name = "db", value = "new://Resource?type=DataSource"),
- @ContainerProperties.Property(name = "db.JdbcUrl", value = "jdbc:hsqldb:mem:test")
-})
-public class MyAppComposer() {
- // ...
-}
-----
-
-==== @Component
-Sometimes you need to customize a container component. The most common use case is the security service to mock a little bit authorization if you don't care in your test.
-
-To do so just write a method decorated with @Component returning the instance you desire.
-
-Components in TomEE are stored in a container Map and the key needs to be a Class. This one is deduced from the returned type of the @Component method:
-
-[source,java]
-----
-@Component
-public SecurityService mockSecurity() {
- return new MySecurityService();
-}
-----
-
-==== @Descriptors
-You can reuse existing file descriptors using @Descriptors. The name is the file name and the path either a classpath path or a file path:
-
-[source,java]
-----
-// runner if needed etc...
-@Descriptors(@Descriptor(name = "persistence.xml", path = "META-INF/persistence.xml"))
-public class MyTest {
- //...
-}
-----
-
-Note: this can be put in a @Module method as well.
-
-==== Services
-If you want to test a JAXRS or JAXWS service you need to activate these services.
-
-To do so just add the needed dependency and use @EnableServices:
-
-[source,java]
-----
-// runner if needed etc...
-@EnableService("jaxrs") // jaxws supported as well
-public class MyTest {
- //...
-}
-----
-
-==== Random port
-Services like JAXRS and JAXWS relies on HTTP. Often it is nice to have a random port to be able to deploy multiple tests/projects on the same CI platform at the same time.
-
-To shortcut all the needed logic you can use @RandomPort. It is simply an injection giving you either the port (int) or the root context (URL):
-
-[source,java]
-----
-// runner, services if needed etc...
-public class MyTest {
- @RandomPort("http")
- private int port;
-}
-----
-
-Note: you can generate this way multiple ports. The value is the name of the service it will apply on (being said http is an alias for httpejbd which is our embedded http layer).
-
-==== Nice logs
-@SimpleLog annotation allows you to have one liner logs
-
-==== @JaxrsProvider
-@JaxrsProvider allows you to specify on a @Module method the list of JAXRS provider you want to use.
-
-==== Dependencies without hacky code
-@Jars allows you to add dependencies (scanned) to your application automatically (like CDI libraries):
-
-[source,java]
-----
-@Module
-@Classes(cdi = true, value = { C1.class, C2.class, E1.class })
-@Jars("deltaspike-")
-public WebApp app() {
- return new WebApp();
-}
-----
-
-==== @Default
-@Default (openejb one not CDI one) automatically adds in the application target/classes as binaries and src/main/webapp as resources for maven projects.
-
-==== @CdiExtensions
-This annotation allows you to control which extensions are activated during the test.
-
-==== @AppResource
-This annotation allows injection of few particular test resources like:
-
-the test AppModule (application meta)
-the test Context (JNDI)
-the test ApplicationComposers (underlying runner)
-ContextProvider: allow to mock JAXRS contexts
-
-==== @MockInjector
-Allows to mock EJB injections. It decorates a dedicated method returning an instance (or Class) implementing FallbackPropertyInjector.
-
-==== @WebResource
-Allow for web application to add folders containing web resources.
-
-
-=== How to run it?
-==== JUnit
-If you use JUnit you have mainly 2 solutions to run you "model" using the ApplicationComposer:
-
-using ApplicationComposer runner:
-
-[source,java]
-----
-@RunWith(ApplicationComposer.class) public class MyTest { // ... }
-----
-
-using ApplicationComposerRule rule:
-public class MyTest { @Rule // or @ClassRule if you want the container/application lifecycle be bound to the class and not test methods public final ApplicationComposerRule rule = new ApplicationComposerRule(this); }
-
-Tip: since TomEE 7.x ApplicationComposerRule is decomposed in 2 rules if you need: ContainerRule and DeployApplication. Using JUnit RuleChain you can chain them to get the samebehavior as ApplicationComposerRule or better deploy multiple ApplicationComposer models and controlling their deployment ordering (to mock a remote service for instance).
-
-Finally just write `@Test` method using test class injections as if the test class was a managed bean!
-
-==== TestNG
-TestNG integration is quite simple today and mainly ApplicationComposerListener class you can configure as a listener to get ApplicationComposer features.
-
-Finally just write TestNG @Test method using test class injections as if the test class was a managed bean!
-
-==== Standalone
-Since TomEE 7.x you can also use ApplicationComposers to directly run you ApplicationComposer model as a standalone application:
-
-[source,java]
-----
-public class MyApp {
- public static void main(String[] args) {
- ApplicationComposers.run(MyApp.class, args);
- }
-
- // @Module, @Configuration etc...
-}
-----
-
-Tip: if MyApp has `@PostConstruct` methods they will be respected and if MyApp has a constructor taking an array of String it will be instantiated getting the second parameter as argument (ie you can propagate your main parameter to your model to modify your application depending it!)
-
-=== JUnit Sample
-
-[source,java]
-----
-@Classes(cdi = true, value = { MyService.class, MyOtherService.class })
-@ContainerProperties(@ContainerProperties.Property(name = "myDb", value = "new://Resource?type=DataSource"))
-@RunWith(ApplicationComposer.class)
-public class MyTest {
- @Resource(name = "myDb")
- private DataSource ds;
-
- @Inject
- private MyService service;
-
- @Test
- public void myTest() {
- // do test using injections
- }
-}
-----
-
-=== Start and Deploy once
-
-When having a huge suite of test it can be long to start/deploy/undeploy/shutdown he container/application for each method.
-
-That's why `SingleApplicationComposerRunner` allows to just reuse the same instance accross several test.
-
-The first test will start and deploy the application and then other tests will reuse this instance until the JVM is destroyed
-where the server/application will be undeployed/shutdown.
-
-
-Here a simple usage:
-
-[source,java]
-----
-import org.apache.openejb.testing.SingleApplicationComposerRunner;
-// other imports
-
-@RunWith(SingleApplicationComposerRunner.class)
-public class MyTest {
- @Inject
- private ACdiBean bean;
-
- @Application
- private TheModel model;
-
- @Test
- public void aTest() {
- // ...
- }
-}
-----
-
-TIP: if you need a real TomEE container then you can have a look to `TomEEEmbeddedSingleRunner` which does deploys the classpath
-using tomee-embedded.
-
-==== Configure what to deploy
-
-As all tests will reuse the same application the model (the class declaring the application with `@Classes`, `@Module` etc...) needs to be extracted from the test class itself.
-
-The application lookup uses this strategy (ordered):
-
-- the fully qualified name is read from the system property `tomee.application-composer.application`
-- a *single* class decorated with `@Application` is looked in the jar/folder containing the test class
-
-If you have several "groups" you can use JUnit `@Category` to differentiate them and write one application class by category. Then
-in `surefire` plugin you declare two `executions` enforcing the system property `tomee.application-composer.application` for each of them
-and the associated `@Category`.
-
-==== Available injections
-
-- If the application model class uses `@RandomPort` then the test classes can get it as well
-- CDI injections are supported
-- `@Application` on a field allows to get the application model to get injected
-
-Compared to a standalone usage it misses all other EE injections (`@PersistenceContext`, `@Resource` etc... but you can inject them in the application model
-and just expose them or wrap them in your tests thanks to the `@Application` field.
-
-
-=== Going further
-If you want to learn more about ApplicationComposer see link:../../../advanced/applicationcomposer/index.html[ApplicationComposer Advanced] page.
+= ApplicationComposer: The TomEE Swiss Knife
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+ApplicationComposer API is mainly contained in org.apache.openejb.testing package (historically, today we would have called the package org.apache.tomee.applicationcomposer).
+
+=== Dependencies
+
+To start using ApplicationComposer you need to add some dependencies.
+
+The minimum required one is openejb-core:
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.tomee</groupId>
+ <artifactId>openejb-core</artifactId>
+ <version>${openejb.version></version>
+</dependency>
+----
+
+If you need JAXRS services you'll add (or replace thanks to transitivity of maven) openejb-cxf-rs:
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.tomee</groupId>
+ <artifactId>openejb-cxf-rs</artifactId>
+ <version>${openejb.version></version>
+</dependency>
+----
+
+If you need JAXWS services you'll add (or replace thanks to transitivity of maven) openejb-cxf:
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.tomee</groupId>
+ <artifactId>openejb-cxf</artifactId>
+ <version>${openejb.version></version>
+</dependency>
+----
+
+=== ApplicationComposer Components
+
+==== @Module
+An ApplicationComposer needs at minimum a module (the application you need to deploy).
+
+To do so you have two cases:
+
+before TomEE 7.x: you can only write method(s) decorated with @Module
+since TomEE 7.x: you can skip it and use @Classes directly on the ApplicationComposer class as a shortcut for:
+
+[source,java]
+----
+@Module public WebApp app() { return new WebApp(); }
+----
+
+The expected returned type of these methods are in org.apache.openejb.jee package:
+
+- Application: entry point to create an ear
+- WebApp: a web application
+- EjbJar: an ejb module
+- EnterpriseBean children: a simple EJB
+- Persistence: a persistence module with multiple units
+- PersistenceUnit: a simple unit (automatically wrapped in a Persistence)
+- Connector: a JCA connector module
+- Beans: a CDI module,
+- Class[] or Class: a set of classes scanned to discover annotations
+
+Note that for easiness @Classes was added to be able to describe a module and some scanned classes. For instance the following snippet will create a web application with classes C1, C2 as CDI beans and E1 as an EJB automatically:
+
+[source,java]
+----
+@Module
+@Classes(cdi = true, value = { C1.class, C2.class, E1.class })
+public WebApp app() {
+ return new WebApp();
+}
+----
+
+==== @Configuration
+Often you need to customize a bit the container or at least create some resources like test databases. To do so you can create a method returning Properties which will be the container properties.
+
+Note: to simplify writing properties you can use PropertiesBuilder util class which is just a fluent API to write properties.
+
+In these properties you can reuse OpenEJB/TomEE property syntax for resources.
+
+Here is a sample:
+
+[source,java]
+----
+@Configuration
+public Properties configuration() {
+ return new PropertiesBuilder()
+ .p("db", "new://Resource?type=DataSource")
+ .p("db.JdbcUrld", "jdbc:hsqldb:mem:test")
+ .build();
+}
+----
+
+Since TomEE 7.x you can also put properties on ApplicationComposer class using @ContainerProperties API:
+
+[source,java]
+----
+@ContainerProperties({
+ @ContainerProperties.Property(name = "db", value = "new://Resource?type=DataSource"),
+ @ContainerProperties.Property(name = "db.JdbcUrl", value = "jdbc:hsqldb:mem:test")
+})
+public class MyAppComposer() {
+ // ...
+}
+----
+
+==== @Component
+Sometimes you need to customize a container component. The most common use case is the security service to mock a little bit authorization if you don't care in your test.
+
+To do so just write a method decorated with @Component returning the instance you desire.
+
+Components in TomEE are stored in a container Map and the key needs to be a Class. This one is deduced from the returned type of the @Component method:
+
+[source,java]
+----
+@Component
+public SecurityService mockSecurity() {
+ return new MySecurityService();
+}
+----
+
+==== @Descriptors
+You can reuse existing file descriptors using @Descriptors. The name is the file name and the path either a classpath path or a file path:
+
+[source,java]
+----
+// runner if needed etc...
+@Descriptors(@Descriptor(name = "persistence.xml", path = "META-INF/persistence.xml"))
+public class MyTest {
+ //...
+}
+----
+
+Note: this can be put in a @Module method as well.
+
+==== Services
+If you want to test a JAXRS or JAXWS service you need to activate these services.
+
+To do so just add the needed dependency and use @EnableServices:
+
+[source,java]
+----
+// runner if needed etc...
+@EnableService("jaxrs") // jaxws supported as well
+public class MyTest {
+ //...
+}
+----
+
+==== Random port
+Services like JAXRS and JAXWS relies on HTTP. Often it is nice to have a random port to be able to deploy multiple tests/projects on the same CI platform at the same time.
+
+To shortcut all the needed logic you can use @RandomPort. It is simply an injection giving you either the port (int) or the root context (URL):
+
+[source,java]
+----
+// runner, services if needed etc...
+public class MyTest {
+ @RandomPort("http")
+ private int port;
+}
+----
+
+Note: you can generate this way multiple ports. The value is the name of the service it will apply on (being said http is an alias for httpejbd which is our embedded http layer).
+
+==== Nice logs
+@SimpleLog annotation allows you to have one liner logs
+
+==== @JaxrsProvider
+@JaxrsProvider allows you to specify on a @Module method the list of JAXRS provider you want to use.
+
+==== Dependencies without hacky code
+@Jars allows you to add dependencies (scanned) to your application automatically (like CDI libraries):
+
+[source,java]
+----
+@Module
+@Classes(cdi = true, value = { C1.class, C2.class, E1.class })
+@Jars("deltaspike-")
+public WebApp app() {
+ return new WebApp();
+}
+----
+
+==== @Default
+@Default (openejb one not CDI one) automatically adds in the application target/classes as binaries and src/main/webapp as resources for maven projects.
+
+==== @CdiExtensions
+This annotation allows you to control which extensions are activated during the test.
+
+==== @AppResource
+This annotation allows injection of few particular test resources like:
+
+the test AppModule (application meta)
+the test Context (JNDI)
+the test ApplicationComposers (underlying runner)
+ContextProvider: allow to mock JAXRS contexts
+
+==== @MockInjector
+Allows to mock EJB injections. It decorates a dedicated method returning an instance (or Class) implementing FallbackPropertyInjector.
+
+==== @WebResource
+Allow for web application to add folders containing web resources.
+
+
+=== How to run it?
+==== JUnit
+If you use JUnit you have mainly 2 solutions to run you "model" using the ApplicationComposer:
+
+using ApplicationComposer runner:
+
+[source,java]
+----
+@RunWith(ApplicationComposer.class) public class MyTest { // ... }
+----
+
+using ApplicationComposerRule rule:
+public class MyTest { @Rule // or @ClassRule if you want the container/application lifecycle be bound to the class and not test methods public final ApplicationComposerRule rule = new ApplicationComposerRule(this); }
+
+Tip: since TomEE 7.x ApplicationComposerRule is decomposed in 2 rules if you need: ContainerRule and DeployApplication. Using JUnit RuleChain you can chain them to get the samebehavior as ApplicationComposerRule or better deploy multiple ApplicationComposer models and controlling their deployment ordering (to mock a remote service for instance).
+
+Finally just write `@Test` method using test class injections as if the test class was a managed bean!
+
+==== TestNG
+TestNG integration is quite simple today and mainly ApplicationComposerListener class you can configure as a listener to get ApplicationComposer features.
+
+Finally just write TestNG @Test method using test class injections as if the test class was a managed bean!
+
+==== Standalone
+Since TomEE 7.x you can also use ApplicationComposers to directly run you ApplicationComposer model as a standalone application:
+
+[source,java]
+----
+public class MyApp {
+ public static void main(String[] args) {
+ ApplicationComposers.run(MyApp.class, args);
+ }
+
+ // @Module, @Configuration etc...
+}
+----
+
+Tip: if MyApp has `@PostConstruct` methods they will be respected and if MyApp has a constructor taking an array of String it will be instantiated getting the second parameter as argument (ie you can propagate your main parameter to your model to modify your application depending it!)
+
+=== JUnit Sample
+
+[source,java]
+----
+@Classes(cdi = true, value = { MyService.class, MyOtherService.class })
+@ContainerProperties(@ContainerProperties.Property(name = "myDb", value = "new://Resource?type=DataSource"))
+@RunWith(ApplicationComposer.class)
+public class MyTest {
+ @Resource(name = "myDb")
+ private DataSource ds;
+
+ @Inject
+ private MyService service;
+
+ @Test
+ public void myTest() {
+ // do test using injections
+ }
+}
+----
+
+=== Start and Deploy once
+
+When having a huge suite of test it can be long to start/deploy/undeploy/shutdown he container/application for each method.
+
+That's why `SingleApplicationComposerRunner` allows to just reuse the same instance accross several test.
+
+The first test will start and deploy the application and then other tests will reuse this instance until the JVM is destroyed
+where the server/application will be undeployed/shutdown.
+
+
+Here a simple usage:
+
+[source,java]
+----
+import org.apache.openejb.testing.SingleApplicationComposerRunner;
+// other imports
+
+@RunWith(SingleApplicationComposerRunner.class)
+public class MyTest {
+ @Inject
+ private ACdiBean bean;
+
+ @Application
+ private TheModel model;
+
+ @Test
+ public void aTest() {
+ // ...
+ }
+}
+----
+
+TIP: if you need a real TomEE container then you can have a look to `TomEEEmbeddedSingleRunner` which does deploys the classpath
+using tomee-embedded.
+
+==== Configure what to deploy
+
+As all tests will reuse the same application the model (the class declaring the application with `@Classes`, `@Module` etc...) needs to be extracted from the test class itself.
+
+The application lookup uses this strategy (ordered):
+
+- the fully qualified name is read from the system property `tomee.application-composer.application`
+- a *single* class decorated with `@Application` is looked in the jar/folder containing the test class
+
+If you have several "groups" you can use JUnit `@Category` to differentiate them and write one application class by category. Then
+in `surefire` plugin you declare two `executions` enforcing the system property `tomee.application-composer.application` for each of them
+and the associated `@Category`.
+
+==== Available injections
+
+- If the application model class uses `@RandomPort` then the test classes can get it as well
+- CDI injections are supported
+- `@Application` on a field allows to get the application model to get injected
+
+Compared to a standalone usage it misses all other EE injections (`@PersistenceContext`, `@Resource` etc... but you can inject them in the application model
+and just expose them or wrap them in your tests thanks to the `@Application` field.
+
+
+=== Going further
+If you want to learn more about ApplicationComposer see link:../../../advanced/applicationcomposer/index.html[ApplicationComposer Advanced] page.
diff --git a/src/main/jbake/content/documentation/developer/testing/arquillian/index.adoc b/src/main/jbake/content/developer/testing/arquillian/index.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/developer/testing/arquillian/index.adoc
rename to src/main/jbake/content/developer/testing/arquillian/index.adoc
index 16f0538..1eb34ee
--- a/src/main/jbake/content/documentation/developer/testing/arquillian/index.adoc
+++ b/src/main/jbake/content/developer/testing/arquillian/index.adoc
@@ -1,421 +1,421 @@
-= TomEE and Arquillian
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-TomEE has several arquillian adapter flavors:
-
-- openejb-embedded: a plain embedded OpenEJB supporting most of EE features
-- tomee-embedded: a full TomEE running in the same JVM
-- tomee-remote: a standard TomEE running in its own process as in production
-- tomee-webapp (not recommanded): an adapter starting from a Tomcat and installing tomee-webapp
-
-=== Embedded or Remote?
-
-Big advantage of embedded adapters is to be able to debug as usual. However it has few drawbacks which can make you
-rething this choice:
-
-- JVM resources are available where it will likely not be the case in war mode (src/main/resources typically)
-- You can mix server and client side features when writing a test
-- Classloading is a bit different by design and less isolated (test dependencies) so you can get runtime surprises when really deploying
-
-To summarize: the choice is the trade off you choose between easiness and reality of the simulation.
-
-TIP: in TomEE build we build the same tests against all tomee adapters in the same build/module, this means you can use embedded adapter in dev
-and activate remote tomee too (not only cause then if there is a failure you don't know if you missed it locally or if it is due
-to the switch of adapter) on your continuous integration platform.
-
-NOTE: all configurations have defaults
-
-=== OpenEJB Embedded
-
-==== Coordinates
-
-[source,xml]
-----
-<dependency>
- <groupId>org.apache.tomee</groupId>
- <artifactId>arquillian-openejb-embedded</artifactId>
- <version>${tomee7.version}
-</dependency>
-----
-
-==== arquillian.xml
-
-|===
-|Name|Description
-|properties|container properties, as in conf/system.properties (not in xml format)
-|preloadClasses|some class to load (ie enforce static block initialization)
-|startDefaultScopes|should CDI default scopes be started (includes @RequestScoped)
-|singleDeploymentByArchiveName |names of archives (or true for all) to dploy a single time
-|===
-
-Sample:
-
-[source,xml]
-----
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<arquillian
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
- <container qualifier="openejb" default="true">
- <configuration>
- <property name="properties">
- # used to not have a single DataSource and be able to test the resource resolution
- db1 = new://Resource?type=DataSource
- db1.JdbcUrl = jdbc:hsqldb:mem:db1
-
- # will preload both classes, simple comma separated qualified names work too
- openejb.arquillian.predeploy-archives = org.company.openejb.arquillian.openejb.archive.[SimpleArchive|SimpleArchive2]
- </property>
- </configuration>
- </container>
-</arquillian>
-----
-
-=== TomEE Embedded
-
-==== Coordinates
-
-[source,xml]
-----
-<dependency>
- <groupId>org.apache.tomee</groupId>
- <artifactId>arquillian-tomee-embedded</artifactId>
- <version>${tomee7.version}
-</dependency>
-----
-
-==== Configuration
-
-|===
-|Name|Description
-| exportConfAsSystemProperty|export system properties with adapter prefix(es) (ex: httpPort will be set as tomee.httpPort)
-| httpsPort | the HTTPS port
-| httpPort | the HTTP port
-| stopPort | the shutdown port
-| dir | where to create the TomEE work dir (a fake file layout is created for Tomcat needs)
-| appWorkingDir | where to dump applications (`@Deployment`)
-| host | which host to use
-| stopHost | which port to use to shutdown TomEE (port on Server configuration)
-| stopCommand | which command to use to shutdown TomEE
-| serverXml | where is the provided server.xml
-| portRange | when port are set to -1 TomEE adapter will generate an available port, if specified the range will be used
-| preloadClasses | which classes to initialize during container startup
-| quickSession | should the session use a Random instead of SecureRandom (useful when the machine doesn't have a lot of entropy)
-| unsafeEjbd | should EJB allow all classes
-| unpackWars | unpackWARs value in server.xml
-| properties | container properties
-| webContextToUseWithEars |sometimes you can need this to adjust which context the adapter uses to find the ArquillianServletRunner
-| keepServerXmlAsThis |don't replace ports etc in server.xml and use it like it has been provided when serverXml is set
-| singleDumpByArchiveName | dump only once `@Deployment` archives using the name as key
-| singleDeploymentByArchiveName |deploy only once `@Deployment` archives using the name as key
-|ssl| should https be activated
-|withEjbRemote| should EJBd remote be activated
-|keystoreFile | if ssl is set to true the keystore location
-|keystorePass | if ssl is set to true the keystore password
-|keystoreType | if ssl is set to true the keystore type
-|clientAuth |should SSL connector use clientAuth
-|keyAlias | if ssl is set to true the key to use
-|sslProtocol | if ssl is set to true the protocol to use
-|users |a map of users (properties syntax)
-|roles |user roles (properties syntax)
-|webResourcesCached |should resources be cached or not (`DefaultServlet` caching)
-|===
-
-
-Sample:
-
-[source,xml]
-----
-<?xml version="1.0" encoding="UTF-8"?>
-<arquillian
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://jboss.org/schema/arquillian
- http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
- <container qualifier="tomee" default="true">
- <configuration>
- <property name="serverXml">conf/server.xml</property>
-
- <!-- port = -1 means random -->
- <property name="httpPort">-1</property>
- <property name="stopPort">-1</property>
-
- <!-- ssl -->
- <property name="httpsPort">-1</property>
- <property name="ssl">false</property>
- <property name="keystoreFile">keystore-path</property>
- <property name="keystorePass">changeit</property>
- <property name="keystoreType">JKS</property>
- <property name="clientAuth">false</property>
- <property name="keyAlias">alias</property>
- <property name="sslProtocol">protocol</property>
-
- <!-- where to create TomEE files -->
- <property name="dir">target/tomee-embedded</property>
-
- <!-- where to dump on disk applications to deploy -->
- <property name="appWorkingDir">target/working-dir</property>
-
- <!-- optional - limit the port allowed when random -->
- <property name="portRange">20001-30000</property>
-
- <!-- container config -->
- <property name="properties">
- # same as embedded case
- </property>
-
- <!-- Deployer config -->
- <property name="deployerProperties">
- # openejb.deployer.binaries.use=true
- # openejb.deployer.forced.appId=[name]
- # openejb.deployer.save-deployments=false
- </property>
- </configuration>
- </container>
-</arquillian>
-----
-
-=== TomEE Remote
-
-IMPORTANT: if a server is already started on host:port then it will be used instead of starting the configured TomEE type.
-
-To use a custom instance with arquillian ensure to have ejbd and tomee webapp activated. A way is to have in `conf/system.properties` these entries:
-
-[source]
-----
-tomee.remote.support=true
-openejb.system.apps=true
-
-# you can customize it depending the security level you need on the instance
-tomee.serialization.class.whitelist =
-tomee.serialization.class.blacklist = org.codehaus.groovy.runtime.,org.apache.commons.collections.functors.,org.apache.xalan,java.lang.Process
-----
-
-For really remote instances (= not on localhost) you need the `deployerProperties` of previous snippet too:
-
-[source,xml]
-----
-<?xml version="1.0" encoding="UTF-8"?>
-<arquillian
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://jboss.org/schema/arquillian
- http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
- <container qualifier="tomee" default="true">
- <configuration>
- <!-- ... -->
- <property name="deployerProperties">
- openejb.deployer.binaries.use=true
- openejb.deployer.save-deployments=false
- </property>
- </configuration>
- </container>
-</arquillian>
-----
-
-==== Coordinates
-
-[source,xml]
-----
-<dependency>
- <groupId>org.apache.tomee</groupId>
- <artifactId>arquillian-tomee-remote</artifactId>
- <version>${tomee7.version}
-</dependency>
-----
-
-==== Configuration
-
-|===
-|Name|Description
-| exportConfAsSystemProperty|export system properties with adapter prefix(es) (ex: httpPort will be set as tomee.httpPort)
-| httpsPort | the HTTPS port
-| httpPort | the HTTP port
-| stopPort | the shutdown port
-| dir | where to create the TomEE work dir (a fake file layout is created for Tomcat needs)
-| appWorkingDir | where to dump applications (`@Deployment`)
-| host | which host to use
-| stopHost | which port to use to shutdown TomEE (port on Server configuration)
-| stopCommand | which command to use to shutdown TomEE
-| serverXml | where is the provided server.xml
-| portRange | when port are set to -1 TomEE adapter will generate an available port, if specified the range will be used
-| preloadClasses | which classes to initialize during container startup
-| quickSession | should the session use a Random instead of SecureRandom (useful when the machine doesn't have a lot of entropy)
-| unsafeEjbd | should EJB allow all classes
-| unpackWars | unpackWARs value in server.xml
-| properties | container properties
-| webContextToUseWithEars |sometimes you can need this to adjust which context the adapter uses to find the ArquillianServletRunner
-| keepServerXmlAsThis |don't replace ports etc in server.xml and use it like it has been provided when serverXml is set
-| singleDumpByArchiveName | dump only once `@Deployment` archives using the name as key
-| singleDeploymentByArchiveName |deploy only once `@Deployment` archives using the name as key
-|groupId|the maven groupId of the TomEE (or not) artifact
-|artifactId|the maven artifactId of the TomEE (or not) artifact
-|version |the maven version of the TomEE (or not) artifact
-|classifier |the maven classifier of the TomEE (or not) artifact
-|type |the maven type of the TomEE (or not) artifact (should be zip)
-|removeUnusedWebapps |should default webapps (ROOT, manager, ...) be removed
-|ajpPort |the ajp port if used
-|conf |a folder to synchronize with TomEE conf folder
-|bin |a folder to synchronize with TomEE bin folder
-|lib |a folder to synchronize with TomEE lib folder
-|endorsed |a folder to synchronize with TomEE endorsed folder
-|javaagent |a list (flat format) of javaagent to add when launching tomee, can use maven coordinates if prefixed with `mvn:`
-|additionalLibs |a list (flat format) of library to add to TomEE libraries, can use paths of maven coordinates when prefixed with `mvn:`
-|cleanOnStartUp |should TomEE folder be deleted on startup if exists
-|debug |should the container run in debug mode (`-Dopenejb.server.debug=true` activates it without touching the configuration)
-|debugPort |if activated which port to use to debug
-|catalina_opts |equivalent to `CATALINA_OPTS` environment variable
-|simple_log |should logs be inline
-|deployerProperties |deployer properties, useful when not deploying on an instance managed by the build (remote instance typically)
-|===
-
-
-Sample:
-
-[source,xml]
-----
-<?xml version="1.0" encoding="UTF-8"?>
-<arquillian
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://jboss.org/schema/arquillian
- http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
- <container qualifier="tomee" default="true">
- <configuration>
- <property name="serverXml">conf/server.xml</property>
-
- <!-- tomee zip to use -->
- <property name="groupId">org.apache.tomee</property>
- <property name="artifactId">apache-tomee</property>
- <property name="version">LATEST</property>
- <property name="type">zip</property>
-
- <!-- tomee provided files, ignored by default -->
- <property name="bin">src/test/tomee/bin</property>
- <property name="conf">src/test/tomee/conf</property>
- <property name="lib">src/test/tomee/lib</property>
-
- <!--
- remote debugging,
- -Dopenejb.server.debug can activate it too
- -->
- <property name="debug">false</property>
- <property name="debugPort">5005</property>
-
- <!-- nice one line logging -->
- <property name="simpleLog">true</property>
-
- <!-- jvm config -->
- <property name="catalina_opts">-XX:-UseParallelGC</property>
-
- <!-- remove if exist -->
- <property name="cleanOnStartUp">true</property>
-
- <!-- remove default webapps -->
- <property name="removeunusedWebapps">true</property>
-
- <!-- port = -1 means random -->
- <property name="httpPort">-1</property>
- <property name="stopPort">-1</property>
-
- <!-- where to create TomEE -->
- <property name="dir">target/apache-tomee</property>
-
- <!-- where to dump on disk applications to deploy -->
- <property name="appWorkingDir">target/working-dir</property>
-
- <!-- optional - limit the port allowed when random -->
- <property name="portRange">20001-30000</property>
-
- <!-- container config -->
- <property name="properties">
- # same as embedded case
- </property>
-
- <!-- we monitor the test with sirona -->
- <property name="javaagent">
- mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
- </property>
-
- <!-- Deployer config -->
- <property name="deployerProperties">
- # openejb.deployer.binaries.use=true
- # openejb.deployer.forced.appId=[name]
- # openejb.deployer.save-deployments=false
- </property>
-
- </configuration>
- </container>
-</arquillian>
-----
-
-=== Multiple instances
-
-With arquillian you can create cluster or isolated instances. Here is a sample `arquillian.xml`:
-
-[source,xml]
-----
-<?xml version="1.0" encoding="UTF-8"?>
-<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://jboss.org/schema/arquillian
- http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
- <group qualifier="tomee-cluster">
- <container qualifier="tomee-1">
- <configuration>
- <property name="httpPort">-1</property>
- <property name="stopPort">-1</property>
- <property name="ajpPort">-1</property>
- <property name="dir">target/tomee1</property>
- <property name="appWorkingDir">target/wd1</property>
- </configuration>
- </container>
- <container qualifier="tomee-2">
- <configuration>
- <property name="httpPort">-1</property>
- <property name="stopPort">-1</property>
- <property name="ajpPort">-1</property>
- <property name="dir">target/tomee2</property>
- <property name="appWorkingDir">target/wd2</property>
- </configuration>
- </container>
- </group>
-</arquillian>
-----
-
-Then in your test just specify the container you are testing against:
-
-[source,java]
-----
-@RunWith(Arquillian.class)
-public class MultipleTomEETest {
- @Deployment(name = "war1", testable = false)
- @TargetsContainer("tomee-1")
- public static WebArchive war1() {
- return /* ... */;
- }
-
- @Deployment(name = "war2", testable = false)
- @TargetsContainer("tomee-2")
- public static WebArchive war2() {
- return /* ... */;
- }
-
- @Test
- @OperateOnDeployment("war1")
- public void testRunningInDep1(
- @ArquillianResource URL url) {
- // test on tomee 1, url is contextual
- }
-
- @Test
- @OperateOnDeployment("war2")
- public void testRunningInDep1(
- @ArquillianResource URL url) {
- // test on tomee 1, url is contextual
- }
-}
-----
+= TomEE and Arquillian
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+TomEE has several arquillian adapter flavors:
+
+- openejb-embedded: a plain embedded OpenEJB supporting most of EE features
+- tomee-embedded: a full TomEE running in the same JVM
+- tomee-remote: a standard TomEE running in its own process as in production
+- tomee-webapp (not recommanded): an adapter starting from a Tomcat and installing tomee-webapp
+
+=== Embedded or Remote?
+
+Big advantage of embedded adapters is to be able to debug as usual. However it has few drawbacks which can make you
+rething this choice:
+
+- JVM resources are available where it will likely not be the case in war mode (src/main/resources typically)
+- You can mix server and client side features when writing a test
+- Classloading is a bit different by design and less isolated (test dependencies) so you can get runtime surprises when really deploying
+
+To summarize: the choice is the trade off you choose between easiness and reality of the simulation.
+
+TIP: in TomEE build we build the same tests against all tomee adapters in the same build/module, this means you can use embedded adapter in dev
+and activate remote tomee too (not only cause then if there is a failure you don't know if you missed it locally or if it is due
+to the switch of adapter) on your continuous integration platform.
+
+NOTE: all configurations have defaults
+
+=== OpenEJB Embedded
+
+==== Coordinates
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.tomee</groupId>
+ <artifactId>arquillian-openejb-embedded</artifactId>
+ <version>${tomee7.version}
+</dependency>
+----
+
+==== arquillian.xml
+
+|===
+|Name|Description
+|properties|container properties, as in conf/system.properties (not in xml format)
+|preloadClasses|some class to load (ie enforce static block initialization)
+|startDefaultScopes|should CDI default scopes be started (includes @RequestScoped)
+|singleDeploymentByArchiveName |names of archives (or true for all) to dploy a single time
+|===
+
+Sample:
+
+[source,xml]
+----
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<arquillian
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+ <container qualifier="openejb" default="true">
+ <configuration>
+ <property name="properties">
+ # used to not have a single DataSource and be able to test the resource resolution
+ db1 = new://Resource?type=DataSource
+ db1.JdbcUrl = jdbc:hsqldb:mem:db1
+
+ # will preload both classes, simple comma separated qualified names work too
+ openejb.arquillian.predeploy-archives = org.company.openejb.arquillian.openejb.archive.[SimpleArchive|SimpleArchive2]
+ </property>
+ </configuration>
+ </container>
+</arquillian>
+----
+
+=== TomEE Embedded
+
+==== Coordinates
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.tomee</groupId>
+ <artifactId>arquillian-tomee-embedded</artifactId>
+ <version>${tomee7.version}
+</dependency>
+----
+
+==== Configuration
+
+|===
+|Name|Description
+| exportConfAsSystemProperty|export system properties with adapter prefix(es) (ex: httpPort will be set as tomee.httpPort)
+| httpsPort | the HTTPS port
+| httpPort | the HTTP port
+| stopPort | the shutdown port
+| dir | where to create the TomEE work dir (a fake file layout is created for Tomcat needs)
+| appWorkingDir | where to dump applications (`@Deployment`)
+| host | which host to use
+| stopHost | which port to use to shutdown TomEE (port on Server configuration)
+| stopCommand | which command to use to shutdown TomEE
+| serverXml | where is the provided server.xml
+| portRange | when port are set to -1 TomEE adapter will generate an available port, if specified the range will be used
+| preloadClasses | which classes to initialize during container startup
+| quickSession | should the session use a Random instead of SecureRandom (useful when the machine doesn't have a lot of entropy)
+| unsafeEjbd | should EJB allow all classes
+| unpackWars | unpackWARs value in server.xml
+| properties | container properties
+| webContextToUseWithEars |sometimes you can need this to adjust which context the adapter uses to find the ArquillianServletRunner
+| keepServerXmlAsThis |don't replace ports etc in server.xml and use it like it has been provided when serverXml is set
+| singleDumpByArchiveName | dump only once `@Deployment` archives using the name as key
+| singleDeploymentByArchiveName |deploy only once `@Deployment` archives using the name as key
+|ssl| should https be activated
+|withEjbRemote| should EJBd remote be activated
+|keystoreFile | if ssl is set to true the keystore location
+|keystorePass | if ssl is set to true the keystore password
+|keystoreType | if ssl is set to true the keystore type
+|clientAuth |should SSL connector use clientAuth
+|keyAlias | if ssl is set to true the key to use
+|sslProtocol | if ssl is set to true the protocol to use
+|users |a map of users (properties syntax)
+|roles |user roles (properties syntax)
+|webResourcesCached |should resources be cached or not (`DefaultServlet` caching)
+|===
+
+
+Sample:
+
+[source,xml]
+----
+<?xml version="1.0" encoding="UTF-8"?>
+<arquillian
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://jboss.org/schema/arquillian
+ http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+ <container qualifier="tomee" default="true">
+ <configuration>
+ <property name="serverXml">conf/server.xml</property>
+
+ <!-- port = -1 means random -->
+ <property name="httpPort">-1</property>
+ <property name="stopPort">-1</property>
+
+ <!-- ssl -->
+ <property name="httpsPort">-1</property>
+ <property name="ssl">false</property>
+ <property name="keystoreFile">keystore-path</property>
+ <property name="keystorePass">changeit</property>
+ <property name="keystoreType">JKS</property>
+ <property name="clientAuth">false</property>
+ <property name="keyAlias">alias</property>
+ <property name="sslProtocol">protocol</property>
+
+ <!-- where to create TomEE files -->
+ <property name="dir">target/tomee-embedded</property>
+
+ <!-- where to dump on disk applications to deploy -->
+ <property name="appWorkingDir">target/working-dir</property>
+
+ <!-- optional - limit the port allowed when random -->
+ <property name="portRange">20001-30000</property>
+
+ <!-- container config -->
+ <property name="properties">
+ # same as embedded case
+ </property>
+
+ <!-- Deployer config -->
+ <property name="deployerProperties">
+ # openejb.deployer.binaries.use=true
+ # openejb.deployer.forced.appId=[name]
+ # openejb.deployer.save-deployments=false
+ </property>
+ </configuration>
+ </container>
+</arquillian>
+----
+
+=== TomEE Remote
+
+IMPORTANT: if a server is already started on host:port then it will be used instead of starting the configured TomEE type.
+
+To use a custom instance with arquillian ensure to have ejbd and tomee webapp activated. A way is to have in `conf/system.properties` these entries:
+
+[source]
+----
+tomee.remote.support=true
+openejb.system.apps=true
+
+# you can customize it depending the security level you need on the instance
+tomee.serialization.class.whitelist =
+tomee.serialization.class.blacklist = org.codehaus.groovy.runtime.,org.apache.commons.collections.functors.,org.apache.xalan,java.lang.Process
+----
+
+For really remote instances (= not on localhost) you need the `deployerProperties` of previous snippet too:
+
+[source,xml]
+----
+<?xml version="1.0" encoding="UTF-8"?>
+<arquillian
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://jboss.org/schema/arquillian
+ http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+ <container qualifier="tomee" default="true">
+ <configuration>
+ <!-- ... -->
+ <property name="deployerProperties">
+ openejb.deployer.binaries.use=true
+ openejb.deployer.save-deployments=false
+ </property>
+ </configuration>
+ </container>
+</arquillian>
+----
+
+==== Coordinates
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.tomee</groupId>
+ <artifactId>arquillian-tomee-remote</artifactId>
+ <version>${tomee7.version}
+</dependency>
+----
+
+==== Configuration
+
+|===
+|Name|Description
+| exportConfAsSystemProperty|export system properties with adapter prefix(es) (ex: httpPort will be set as tomee.httpPort)
+| httpsPort | the HTTPS port
+| httpPort | the HTTP port
+| stopPort | the shutdown port
+| dir | where to create the TomEE work dir (a fake file layout is created for Tomcat needs)
+| appWorkingDir | where to dump applications (`@Deployment`)
+| host | which host to use
+| stopHost | which port to use to shutdown TomEE (port on Server configuration)
+| stopCommand | which command to use to shutdown TomEE
+| serverXml | where is the provided server.xml
+| portRange | when port are set to -1 TomEE adapter will generate an available port, if specified the range will be used
+| preloadClasses | which classes to initialize during container startup
+| quickSession | should the session use a Random instead of SecureRandom (useful when the machine doesn't have a lot of entropy)
+| unsafeEjbd | should EJB allow all classes
+| unpackWars | unpackWARs value in server.xml
+| properties | container properties
+| webContextToUseWithEars |sometimes you can need this to adjust which context the adapter uses to find the ArquillianServletRunner
+| keepServerXmlAsThis |don't replace ports etc in server.xml and use it like it has been provided when serverXml is set
+| singleDumpByArchiveName | dump only once `@Deployment` archives using the name as key
+| singleDeploymentByArchiveName |deploy only once `@Deployment` archives using the name as key
+|groupId|the maven groupId of the TomEE (or not) artifact
+|artifactId|the maven artifactId of the TomEE (or not) artifact
+|version |the maven version of the TomEE (or not) artifact
+|classifier |the maven classifier of the TomEE (or not) artifact
+|type |the maven type of the TomEE (or not) artifact (should be zip)
+|removeUnusedWebapps |should default webapps (ROOT, manager, ...) be removed
+|ajpPort |the ajp port if used
+|conf |a folder to synchronize with TomEE conf folder
+|bin |a folder to synchronize with TomEE bin folder
+|lib |a folder to synchronize with TomEE lib folder
+|endorsed |a folder to synchronize with TomEE endorsed folder
+|javaagent |a list (flat format) of javaagent to add when launching tomee, can use maven coordinates if prefixed with `mvn:`
+|additionalLibs |a list (flat format) of library to add to TomEE libraries, can use paths of maven coordinates when prefixed with `mvn:`
+|cleanOnStartUp |should TomEE folder be deleted on startup if exists
+|debug |should the container run in debug mode (`-Dopenejb.server.debug=true` activates it without touching the configuration)
+|debugPort |if activated which port to use to debug
+|catalina_opts |equivalent to `CATALINA_OPTS` environment variable
+|simple_log |should logs be inline
+|deployerProperties |deployer properties, useful when not deploying on an instance managed by the build (remote instance typically)
+|===
+
+
+Sample:
+
+[source,xml]
+----
+<?xml version="1.0" encoding="UTF-8"?>
+<arquillian
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://jboss.org/schema/arquillian
+ http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+ <container qualifier="tomee" default="true">
+ <configuration>
+ <property name="serverXml">conf/server.xml</property>
+
+ <!-- tomee zip to use -->
+ <property name="groupId">org.apache.tomee</property>
+ <property name="artifactId">apache-tomee</property>
+ <property name="version">LATEST</property>
+ <property name="type">zip</property>
+
+ <!-- tomee provided files, ignored by default -->
+ <property name="bin">src/test/tomee/bin</property>
+ <property name="conf">src/test/tomee/conf</property>
+ <property name="lib">src/test/tomee/lib</property>
+
+ <!--
+ remote debugging,
+ -Dopenejb.server.debug can activate it too
+ -->
+ <property name="debug">false</property>
+ <property name="debugPort">5005</property>
+
+ <!-- nice one line logging -->
+ <property name="simpleLog">true</property>
+
+ <!-- jvm config -->
+ <property name="catalina_opts">-XX:-UseParallelGC</property>
+
+ <!-- remove if exist -->
+ <property name="cleanOnStartUp">true</property>
+
+ <!-- remove default webapps -->
+ <property name="removeunusedWebapps">true</property>
+
+ <!-- port = -1 means random -->
+ <property name="httpPort">-1</property>
+ <property name="stopPort">-1</property>
+
+ <!-- where to create TomEE -->
+ <property name="dir">target/apache-tomee</property>
+
+ <!-- where to dump on disk applications to deploy -->
+ <property name="appWorkingDir">target/working-dir</property>
+
+ <!-- optional - limit the port allowed when random -->
+ <property name="portRange">20001-30000</property>
+
+ <!-- container config -->
+ <property name="properties">
+ # same as embedded case
+ </property>
+
+ <!-- we monitor the test with sirona -->
+ <property name="javaagent">
+ mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
+ </property>
+
+ <!-- Deployer config -->
+ <property name="deployerProperties">
+ # openejb.deployer.binaries.use=true
+ # openejb.deployer.forced.appId=[name]
+ # openejb.deployer.save-deployments=false
+ </property>
+
+ </configuration>
+ </container>
+</arquillian>
+----
+
+=== Multiple instances
+
+With arquillian you can create cluster or isolated instances. Here is a sample `arquillian.xml`:
+
+[source,xml]
+----
+<?xml version="1.0" encoding="UTF-8"?>
+<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://jboss.org/schema/arquillian
+ http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+ <group qualifier="tomee-cluster">
+ <container qualifier="tomee-1">
+ <configuration>
+ <property name="httpPort">-1</property>
+ <property name="stopPort">-1</property>
+ <property name="ajpPort">-1</property>
+ <property name="dir">target/tomee1</property>
+ <property name="appWorkingDir">target/wd1</property>
+ </configuration>
+ </container>
+ <container qualifier="tomee-2">
+ <configuration>
+ <property name="httpPort">-1</property>
+ <property name="stopPort">-1</property>
+ <property name="ajpPort">-1</property>
+ <property name="dir">target/tomee2</property>
+ <property name="appWorkingDir">target/wd2</property>
+ </configuration>
+ </container>
+ </group>
+</arquillian>
+----
+
+Then in your test just specify the container you are testing against:
+
+[source,java]
+----
+@RunWith(Arquillian.class)
+public class MultipleTomEETest {
+ @Deployment(name = "war1", testable = false)
+ @TargetsContainer("tomee-1")
+ public static WebArchive war1() {
+ return /* ... */;
+ }
+
+ @Deployment(name = "war2", testable = false)
+ @TargetsContainer("tomee-2")
+ public static WebArchive war2() {
+ return /* ... */;
+ }
+
+ @Test
+ @OperateOnDeployment("war1")
+ public void testRunningInDep1(
+ @ArquillianResource URL url) {
+ // test on tomee 1, url is contextual
+ }
+
+ @Test
+ @OperateOnDeployment("war2")
+ public void testRunningInDep1(
+ @ArquillianResource URL url) {
+ // test on tomee 1, url is contextual
+ }
+}
+----
diff --git a/src/main/jbake/content/documentation/developer/testing/index.adoc b/src/main/jbake/content/developer/testing/index.adoc
old mode 100644
new mode 100755
similarity index 93%
rename from src/main/jbake/content/documentation/developer/testing/index.adoc
rename to src/main/jbake/content/developer/testing/index.adoc
index 5ab39a7..83c6155
--- a/src/main/jbake/content/documentation/developer/testing/index.adoc
+++ b/src/main/jbake/content/developer/testing/index.adoc
@@ -1,9 +1,9 @@
-= Testing
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-- link:applicationcomposer/index.html[`ApplicationComposer`]: lightweight tests
-- link:arquillian/index.html[Arquillian]: the de facto standard for EE tests
-- link:other/index.html[Going futher]: OpenEJB JUnit, TomEE Embedded...
+= TomEE and Testing
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+- link:applicationcomposer/index.html[`ApplicationComposer`]: lightweight tests
+- link:arquillian/index.html[Arquillian]: the de facto standard for EE tests
+- link:other/index.html[Going futher]: OpenEJB JUnit, TomEE Embedded...
diff --git a/src/main/jbake/content/documentation/developer/testing/other/index.adoc b/src/main/jbake/content/developer/testing/other/index.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/developer/testing/other/index.adoc
rename to src/main/jbake/content/developer/testing/other/index.adoc
index b1d41b1..41d7c44
--- a/src/main/jbake/content/documentation/developer/testing/other/index.adoc
+++ b/src/main/jbake/content/developer/testing/other/index.adoc
@@ -1,134 +1,134 @@
-= Other Testing Techniques
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-=== EJBContainer
-
-The `EJBContainer` API is a JavaEE API enriched by some OpenEJB features to make the testing easier.
-
-It starts a container (embedded for case we are interested in) scanning the classpath. This operation can be
-slow and if you go with this solution maybe think to start it only once for all tests.
-
-==== Sample
-
-[source,java]
-----
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.ejb.embeddable.EJBContainer;
-import javax.inject.Inject;
-import javax.naming.NamingException;
-
-import static org.junit.Assert.assertTrue;
-
-public class ATest {
- @Inject
- private MyCDIBean aBean;
-
- @PersistenceContext
- private EntityManager em;
-
- @Resource
- private DataSource ds;
-
- @BeforeClass
- public static void start() throws NamingException {
- container = EJBContainer.createEJBContainer();
- }
-
- @AfterClass
- public static void shutdown() {
- if (container != null) {
- container.close();
- }
- }
-
- @Before
- public void inject() throws NamingException {
- container.getContext().bind("inject", this);
- }
-
- @After
- public void reset() throws NamingException {
- container.getContext().unbind("inject");
- }
-
- @Test
- public void aTest() {
- // ...
- }
-}
-----
-
-It will use `createEJBContainer()` method to start the container and application, and `close()` to shutdown it.
-
-OpenEJB provides the `bind("inject")` hack to be able to get injection in the test class.
-
-=== OpenEJB JUnit
-
-`openejb-junit` is another artifact providing some facilities for testing.
-
-==== EJBContainer Rule
-
-[source,java]
-----
-@Properties({
- @Property(key = DeploymentFilterable.CLASSPATH_EXCLUDE, value = "jar:.*"),
- @Property(key = DeploymentFilterable.CLASSPATH_INCLUDE, value = ".*openejb-junit.*")
-})
-public class TestEJBContainerDefaultConfig {
- @Rule
- public final EJBContainerRule containerRule = new EJBContainerRule(this);
-
- @org.apache.openejb.junit.jee.resources.TestResource
- private Context ctx;
-
- @org.apache.openejb.junit.jee.resources.TestResource
- private java.util.Properties props;
-
- @org.apache.openejb.junit.jee.resources.TestResource
- private EJBContainer container;
-
-
- @Test
- public void configIsHere() {
- // ...
- }
-}
-
-----
-
-TIP: there is the equivalent runner: `@RunWith(EJBContainerRunner.class)`
-
-==== InjectRule: injections for EJBContainerRule
-
-[source,java]
-----
-@Properties({
- @Property(key = DeploymentFilterable.CLASSPATH_EXCLUDE, value = "jar:.*"),
- @Property(key = DeploymentFilterable.CLASSPATH_INCLUDE, value = ".*myjar.*")
-})
-public class TestEJBContainerRule {
- @ClassRule
- public static final EJBContainerRule CONTAINER_RULE = new EJBContainerRule();
-
- @Rule
- public final InjectRule injectRule = new InjectRule(this, CONTAINER_RULE);
-
- @EJB
- private BasicEjbLocal ejb;
-
- @Test
- public void aTest() {
- // ...
- }
-}
-----
-
-TIP: an alternative in `openejb-core` is to use `org.apache.openejb.Injector.inject(instance)`
+= Other Testing Techniques
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+=== EJBContainer
+
+The `EJBContainer` API is a JavaEE API enriched by some OpenEJB features to make the testing easier.
+
+It starts a container (embedded for case we are interested in) scanning the classpath. This operation can be
+slow and if you go with this solution maybe think to start it only once for all tests.
+
+==== Sample
+
+[source,java]
+----
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.ejb.embeddable.EJBContainer;
+import javax.inject.Inject;
+import javax.naming.NamingException;
+
+import static org.junit.Assert.assertTrue;
+
+public class ATest {
+ @Inject
+ private MyCDIBean aBean;
+
+ @PersistenceContext
+ private EntityManager em;
+
+ @Resource
+ private DataSource ds;
+
+ @BeforeClass
+ public static void start() throws NamingException {
+ container = EJBContainer.createEJBContainer();
+ }
+
+ @AfterClass
+ public static void shutdown() {
+ if (container != null) {
+ container.close();
+ }
+ }
+
+ @Before
+ public void inject() throws NamingException {
+ container.getContext().bind("inject", this);
+ }
+
+ @After
+ public void reset() throws NamingException {
+ container.getContext().unbind("inject");
+ }
+
+ @Test
+ public void aTest() {
+ // ...
+ }
+}
+----
+
+It will use `createEJBContainer()` method to start the container and application, and `close()` to shutdown it.
+
+OpenEJB provides the `bind("inject")` hack to be able to get injection in the test class.
+
+=== OpenEJB JUnit
+
+`openejb-junit` is another artifact providing some facilities for testing.
+
+==== EJBContainer Rule
+
+[source,java]
+----
+@Properties({
+ @Property(key = DeploymentFilterable.CLASSPATH_EXCLUDE, value = "jar:.*"),
+ @Property(key = DeploymentFilterable.CLASSPATH_INCLUDE, value = ".*openejb-junit.*")
+})
+public class TestEJBContainerDefaultConfig {
+ @Rule
+ public final EJBContainerRule containerRule = new EJBContainerRule(this);
+
+ @org.apache.openejb.junit.jee.resources.TestResource
+ private Context ctx;
+
+ @org.apache.openejb.junit.jee.resources.TestResource
+ private java.util.Properties props;
+
+ @org.apache.openejb.junit.jee.resources.TestResource
+ private EJBContainer container;
+
+
+ @Test
+ public void configIsHere() {
+ // ...
+ }
+}
+
+----
+
+TIP: there is the equivalent runner: `@RunWith(EJBContainerRunner.class)`
+
+==== InjectRule: injections for EJBContainerRule
+
+[source,java]
+----
+@Properties({
+ @Property(key = DeploymentFilterable.CLASSPATH_EXCLUDE, value = "jar:.*"),
+ @Property(key = DeploymentFilterable.CLASSPATH_INCLUDE, value = ".*myjar.*")
+})
+public class TestEJBContainerRule {
+ @ClassRule
+ public static final EJBContainerRule CONTAINER_RULE = new EJBContainerRule();
+
+ @Rule
+ public final InjectRule injectRule = new InjectRule(this, CONTAINER_RULE);
+
+ @EJB
+ private BasicEjbLocal ejb;
+
+ @Test
+ public void aTest() {
+ // ...
+ }
+}
+----
+
+TIP: an alternative in `openejb-core` is to use `org.apache.openejb.Injector.inject(instance)`
diff --git a/src/main/jbake/content/documentation/developer/tools/gradle-plugins.adoc b/src/main/jbake/content/developer/tools/gradle-plugins.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/developer/tools/gradle-plugins.adoc
rename to src/main/jbake/content/developer/tools/gradle-plugins.adoc
index fe43434..5c47df2
--- a/src/main/jbake/content/documentation/developer/tools/gradle-plugins.adoc
+++ b/src/main/jbake/content/developer/tools/gradle-plugins.adoc
@@ -1,50 +1,50 @@
-= TomEE Gradle Plugin
-:jbake-date: 2016-05-31
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-TomEE provides a gradle plugin for tomee-embedded "à la Jetty".
-
-[source,java]
-----
-buildscript {
- repositories {
- mavenCentral()
- }
-
- dependencies {
- classpath 'org.apache.tomee.gradle:tomee-embedded:7.0.0'
- }
-}
-
-apply plugin: 'org.apache.tomee.tomee-embedded'
-
-// ...
-----
-
-Then just start tomee with:
-
-[source]
-----
-gradle tomee-embedded -i
-----
-
-== Configuration
-
-All the configuration is optional.
-
-[source,java]
-----
-// plugin setup
-def tomeeEmbedded = extensions.getByName('tomee-embedded')
-tomeeEmbedded.tomeeVersion = 'other version'
-tomeeEmbedded.skipDefaultRepository = true // don't use central to retrieve tomee
-
-// container dependencies
-def tomeeEmbeddedDeps = configurations.getByName('tomee-embedded')
-// add dependencies you need to this configuration
-----
-
-tomee-embedded task has several more advanced configuration like tomee properties, modules to deploy etc...
-Its configuration is pretty close to link:maven/embedded.html[Embedded Maven Plugin].
+= TomEE Gradle Plugin
+:jbake-date: 2016-05-31
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+TomEE provides a gradle plugin for tomee-embedded "à la Jetty".
+
+[source,java]
+----
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+
+ dependencies {
+ classpath 'org.apache.tomee.gradle:tomee-embedded:7.0.0'
+ }
+}
+
+apply plugin: 'org.apache.tomee.tomee-embedded'
+
+// ...
+----
+
+Then just start tomee with:
+
+[source]
+----
+gradle tomee-embedded -i
+----
+
+== Configuration
+
+All the configuration is optional.
+
+[source,java]
+----
+// plugin setup
+def tomeeEmbedded = extensions.getByName('tomee-embedded')
+tomeeEmbedded.tomeeVersion = 'other version'
+tomeeEmbedded.skipDefaultRepository = true // don't use central to retrieve tomee
+
+// container dependencies
+def tomeeEmbeddedDeps = configurations.getByName('tomee-embedded')
+// add dependencies you need to this configuration
+----
+
+tomee-embedded task has several more advanced configuration like tomee properties, modules to deploy etc...
+Its configuration is pretty close to link:maven/embedded.html[Embedded Maven Plugin].
diff --git a/src/main/jbake/content/documentation/developer/tools/index.adoc b/src/main/jbake/content/developer/tools/index.adoc
old mode 100644
new mode 100755
similarity index 87%
rename from src/main/jbake/content/documentation/developer/tools/index.adoc
rename to src/main/jbake/content/developer/tools/index.adoc
index 3d59740..b69b453
--- a/src/main/jbake/content/documentation/developer/tools/index.adoc
+++ b/src/main/jbake/content/developer/tools/index.adoc
@@ -1,8 +1,8 @@
-= Build tools
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-- link:maven-plugins.html[Maven Plugins]
-- link:gradle-plugins.html[Gradle Plugin]
+= TomEE developer tools
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+- link:maven-plugins.html[Maven Plugins]
+- link:gradle-plugins.html[Gradle Plugin]
diff --git a/src/main/jbake/content/documentation/developer/tools/maven-plugins.adoc b/src/main/jbake/content/developer/tools/maven-plugins.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/developer/tools/maven-plugins.adoc
rename to src/main/jbake/content/developer/tools/maven-plugins.adoc
index 3f335d2..f7f462f
--- a/src/main/jbake/content/documentation/developer/tools/maven-plugins.adoc
+++ b/src/main/jbake/content/developer/tools/maven-plugins.adoc
@@ -1,12 +1,12 @@
-= TomEE Maven Plugins
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-TomEE provides several maven plugins:
-
-- one for a link:maven/tomee.html[standalone TomEE]
-- one for link:maven/embedded.html[TomEE embedded]
-- one for link:maven/applicationcomposer.html[application composer] based applications
-- Note: there is one for `EJBContainer` but this one is easily replaced by one of the previous in general
+= TomEE Maven Plugins
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+TomEE provides several maven plugins:
+
+- one for a link:maven/tomee.html[standalone TomEE]
+- one for link:maven/embedded.html[TomEE embedded]
+- one for link:maven/applicationcomposer.html[application composer] based applications
+- Note: there is one for `EJBContainer` but this one is easily replaced by one of the previous in general
diff --git a/src/main/jbake/content/documentation/developer/tools/maven/applicationcomposer.adoc b/src/main/jbake/content/developer/tools/maven/applicationcomposer.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/developer/tools/maven/applicationcomposer.adoc
rename to src/main/jbake/content/developer/tools/maven/applicationcomposer.adoc
index 8694c37..9eb71ee
--- a/src/main/jbake/content/documentation/developer/tools/maven/applicationcomposer.adoc
+++ b/src/main/jbake/content/developer/tools/maven/applicationcomposer.adoc
@@ -1,47 +1,47 @@
-= Application Composer Maven Plugin
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-This plugin has two goal:
-
-- `applicationcomposer:run`: to start the application from mvn command line
-- `applicationcomposer:zip`: to package a zip with dependencies and start scripts
-
-IMPORTANT: the dependencies are retrieved with `MavenProject.getArtifacts()` which means you artifacts should be a `war`
-- maven doesn't populate it with a `jar` - and the compile phase - at least - should be passed to ensure it is populated.
-
-=== Run goal configuration
-
-[source]
-----
-mvn process-classes applicationcomposer:run -DskipTests
-----
-
-[.table.table-bordered,options="header"]
-|===
-| Name | Default | Description
-| args | - | a list of application arguments
-|application|-|application qualified name
-|binaries|${project.build.outputDirectory}|where is your module code (target/classes)
-|mavenLog|true|force to use maven logging in openejb
-|===
-
-=== Zip goal configuration
-
-[source]
-----
-mvn process-classes applicationcomposer:zip -DskipTests
-----
-
-[.table.table-bordered,options="header"]
-|===
-| Name | Default | Description
-|workDir|${project.build.directory}/${project.build.finalName}-applicationcomposer| where the container can "work" and create temp files
-|zip|${project.build.directory}/${project.build.finalName}-applicationcomposer.zip| where to create the zip
-|attach|true|attach the created artifact
-|classifier|-|artifact classifier if needed
-|application|-|application qualified name
-|binaries|${project.build.outputDirectory}|where is your module code (target/classes)
-|===
+= Application Composer Maven Plugin
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+This plugin has two goal:
+
+- `applicationcomposer:run`: to start the application from mvn command line
+- `applicationcomposer:zip`: to package a zip with dependencies and start scripts
+
+IMPORTANT: the dependencies are retrieved with `MavenProject.getArtifacts()` which means you artifacts should be a `war`
+- maven doesn't populate it with a `jar` - and the compile phase - at least - should be passed to ensure it is populated.
+
+=== Run goal configuration
+
+[source]
+----
+mvn process-classes applicationcomposer:run -DskipTests
+----
+
+[.table.table-bordered,options="header"]
+|===
+| Name | Default | Description
+| args | - | a list of application arguments
+|application|-|application qualified name
+|binaries|${project.build.outputDirectory}|where is your module code (target/classes)
+|mavenLog|true|force to use maven logging in openejb
+|===
+
+=== Zip goal configuration
+
+[source]
+----
+mvn process-classes applicationcomposer:zip -DskipTests
+----
+
+[.table.table-bordered,options="header"]
+|===
+| Name | Default | Description
+|workDir|${project.build.directory}/${project.build.finalName}-applicationcomposer| where the container can "work" and create temp files
+|zip|${project.build.directory}/${project.build.finalName}-applicationcomposer.zip| where to create the zip
+|attach|true|attach the created artifact
+|classifier|-|artifact classifier if needed
+|application|-|application qualified name
+|binaries|${project.build.outputDirectory}|where is your module code (target/classes)
+|===
diff --git a/src/main/jbake/content/documentation/developer/tools/maven/embedded.adoc b/src/main/jbake/content/developer/tools/maven/embedded.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/developer/tools/maven/embedded.adoc
rename to src/main/jbake/content/developer/tools/maven/embedded.adoc
index 6e27054..368a0b4
--- a/src/main/jbake/content/documentation/developer/tools/maven/embedded.adoc
+++ b/src/main/jbake/content/developer/tools/maven/embedded.adoc
@@ -1,53 +1,53 @@
-= TomEE Embedded Maven Plugin
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-TomEE Embedded Maven plugin has a single goal: `tomee-embedded:run`.
-
-=== Configuration
-
-[.table.table-bordered,options="header"]
-|===
-| Name | Default | Description
-| warFile | ${project.build.directory}/${project.build.finalName} | where is the binary
-| httpPort | 8080 | HTTP port
-| httpsPort | 8443 | HTTPS port
-| ajpPort | 8009 | AJP port
-| stopPort | 8005 | shutdown port
-| host | localhost | the server host
-| dir | ${project.build.directory}/apache-tomee-embedded | the work directory
-| keystoreFile | - | the keystore file for the HTTPS connector
-| keystorePass | - | the keystore password for the HTTPS connector
-| keystoreType | JKS | the keystore type for the HTTPS connector
-| clientAuth | - | should HTTPS use client authentication
-| keyAlias | - | the key to use for HTTPS
-| sslProtocol | - | the protocol to use for SSL/HTTPS
-| serverXml | - | a custom server.xml
-| ssl | false | is HTTPS active
-| withEjbRemote |false | is EJBd active
-| quickSession | true | is sessions using Random instead of SecureRandom to generate id (faster but less secure, good for dev purposes)
-| skipHttp | false | don't activate HTTP connector (allow to have only HTTPS for instance)
-| classpathAsWar | false | deploy the classpath instead of the binary/war
-| useProjectClasspath | true | in previous case use the project classpath and not plugin one
-| webResourceCached | true | should web resources be cached
-| modules | ${project.build.outputDirectory} | list of module to add to the classpath of the application
-| docBase | ${project.basedir}/src/main/webapp | where is the docBase in classpath deployment mode (where are web resources)
-| context | - | which context to use for the main artifact/deployment
-| containerProperties | - | map of container properties
-| mavenLog | true | should the plugin use maven logger instead of JUL
-| keepServerXmlAsThis | false | don't apply port/host configuration to the server.xml if provided
-| users | - | map of user/password
-| roles | - | map of role/users
-| forceJspDevelopment | true | ensure JSP are in development mode (updated)
-| applications | - | list of applications to deploy
-| applicationScopes | - | scope of the artifact to take into account for the classpath (ignore PROVIDED for instance)
-| skipCurrentProject | - | don't deploy current project but only configured applications
-| applicationCopyFolder | - | a folder containing applications
-| workDir | - | tomee embedded work dir
-| inlinedServerXml | - | server.xml content directly in the pom
-| inlinedTomEEXml | - | tomee.xml content directly in the pom
-| liveReload | - | livereload configuration if activated. This is an object containing these options: {watchedFolder: 'src/main/webapp', path: '/', port: 35729}
-| withLiveReload | false | activate livereload for web resources
-|===
+= TomEE Embedded Maven Plugin
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+TomEE Embedded Maven plugin has a single goal: `tomee-embedded:run`.
+
+=== Configuration
+
+[.table.table-bordered,options="header"]
+|===
+| Name | Default | Description
+| warFile | ${project.build.directory}/${project.build.finalName} | where is the binary
+| httpPort | 8080 | HTTP port
+| httpsPort | 8443 | HTTPS port
+| ajpPort | 8009 | AJP port
+| stopPort | 8005 | shutdown port
+| host | localhost | the server host
+| dir | ${project.build.directory}/apache-tomee-embedded | the work directory
+| keystoreFile | - | the keystore file for the HTTPS connector
+| keystorePass | - | the keystore password for the HTTPS connector
+| keystoreType | JKS | the keystore type for the HTTPS connector
+| clientAuth | - | should HTTPS use client authentication
+| keyAlias | - | the key to use for HTTPS
+| sslProtocol | - | the protocol to use for SSL/HTTPS
+| serverXml | - | a custom server.xml
+| ssl | false | is HTTPS active
+| withEjbRemote |false | is EJBd active
+| quickSession | true | is sessions using Random instead of SecureRandom to generate id (faster but less secure, good for dev purposes)
+| skipHttp | false | don't activate HTTP connector (allow to have only HTTPS for instance)
+| classpathAsWar | false | deploy the classpath instead of the binary/war
+| useProjectClasspath | true | in previous case use the project classpath and not plugin one
+| webResourceCached | true | should web resources be cached
+| modules | ${project.build.outputDirectory} | list of module to add to the classpath of the application
+| docBase | ${project.basedir}/src/main/webapp | where is the docBase in classpath deployment mode (where are web resources)
+| context | - | which context to use for the main artifact/deployment
+| containerProperties | - | map of container properties
+| mavenLog | true | should the plugin use maven logger instead of JUL
+| keepServerXmlAsThis | false | don't apply port/host configuration to the server.xml if provided
+| users | - | map of user/password
+| roles | - | map of role/users
+| forceJspDevelopment | true | ensure JSP are in development mode (updated)
+| applications | - | list of applications to deploy
+| applicationScopes | - | scope of the artifact to take into account for the classpath (ignore PROVIDED for instance)
+| skipCurrentProject | - | don't deploy current project but only configured applications
+| applicationCopyFolder | - | a folder containing applications
+| workDir | - | tomee embedded work dir
+| inlinedServerXml | - | server.xml content directly in the pom
+| inlinedTomEEXml | - | tomee.xml content directly in the pom
+| liveReload | - | livereload configuration if activated. This is an object containing these options: {watchedFolder: 'src/main/webapp', path: '/', port: 35729}
+| withLiveReload | false | activate livereload for web resources
+|===
diff --git a/src/main/jbake/content/documentation/developer/tools/maven/tomee.adoc b/src/main/jbake/content/developer/tools/maven/tomee.adoc
old mode 100644
new mode 100755
similarity index 99%
rename from src/main/jbake/content/documentation/developer/tools/maven/tomee.adoc
rename to src/main/jbake/content/developer/tools/maven/tomee.adoc
index e4f5896..0904ba9
--- a/src/main/jbake/content/documentation/developer/tools/maven/tomee.adoc
+++ b/src/main/jbake/content/developer/tools/maven/tomee.adoc
@@ -1,183 +1,183 @@
-= TomEE Maven Plugin
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-TomEE Maven Plugin is a set of goals for the development and to prepare to go in production:
-
-- `tomee:build`
-- `tomee:exec`
-- `tomee:configtest`
-- `tomee:debug`
-- `tomee:deploy`
-- `tomee:exec`
-- `tomee:list`
-- `tomee:run`
-- `tomee:start`
-- `tomee:stop`
-- `tomee:undeploy`
-
-=== Run
-
-The most commonly used goal, it allows to start a tomee with applications. Here is its configuration:
-
-[.table.table-bordered,options="header"]
-|===
-|Name|Default|Description
-
-|synchronization|-|a synchronization (see after the table)
-|synchronizations|-|list of synchronizations
-|reloadOnUpdate|-|should the application be redeployed when a synchronization is triggered
-
-|skipCurrentProject|false|should current project not be considered as a deployable even if its packaging is compatible (war typically)
-|tomeeVersion|auto, plugin one|which version of TomEE to use
-|tomeeGroupId|org.apache.tomee|TomEE artifact groupId
-|tomeeArtifactId|apache-tomee|TomEE artifact artifactId
-|tomeeType|zip| the type of the TomEE artifact , only zip supported at the moment
-|tomeeClassifier|webprofile|which flavor of TomEE to use (classifier)
-|tomeeShutdownPort|read from server.xml|the shutdown port
-|tomeeShutdownAttempts|60|how many times to wait for startup/shutdown (waits 1s in between)
-|tomeeShutdownCommand|SHUTDOWN|the shutdown command
-|tomeeAjpPort|read from the pom|the AJP port if needed
-|tomeeHttpsPort|read from the pom|the HTTPS port if needed
-|args|-|command line arguments (system properties, javaagent, JVM options ...)
-|debug|-|start and wait for a remote debugger to connect
-|debugPort|5005|used when debug to change the default port
-|simpleLog|false|use one line logs
-|extractWars|false|explode wars before starting
-|stripWarVersion|true|remove the version from the war name
-|stripVersion|false|remove the version from the artifact name whatever it is (even jar)
-|webappResources|${project.basedir}/src/main/webapp|where web resources are
-|webappClasses and classes|${project.build.outputDirectory}|where artifact binaries are
-|catalinaBase|${project.build.directory}/apache-tomee|where to create the tomee instance
-|context|-|name of the current artifact (rename the war from the maven name to this one)
-|webappDir|webapps|path to webapps folder from tomee.base
-|appDir|apps|path to apps folder from tomee.base
-|libDir|lib|where is lib folder
-|mainDir|${project.basedir}/src/main|used in openejb mode to change default config of conf/lib/bin folders to openejb instead of tomee
-|config|${project.basedir}/src/main/tomee/conf|a conf folder synchronized with TomEE one
-|bin|${project.basedir}/src/main/tomee/bin|a bin folder synchronized with TomEE one
-|lib|${project.basedir}/src/main/tomee/lib|a lib folder synchronized with TomEE one
-|systemVariables|-|a map of system properties
-|classpaths|-|a list of additional entries for the startup classpath
-|customizers|-|a list of customizers
-|jsCustomizers|-|a list of js customizers (js scripts)
-|groovyCustomizers|-|a list of groovy customizers (groovy scripts)
-|webappDefaultConfig|false|auto config war oriented
-|quickSession|true|session generation will use `Random` instead of `SecureRandom` (for dev)
-|forceReloadable|false|ensure TomEE supports reloading/redeployment
-|forceJspDevelopment|true|JSP will be auto-recompiled on changes
-|libs|-|dependencies to add in lib, see after this table for advanced usage
-|endorsedLibs|-|dependencies to add in endorsed, see after this table for advanced usage
-|javaagents|-|javaagents to add on the JVM, supports maven coordinates
-|persistJavaagents|false|should javaagent be saved or just use for this plugin run
-|webapps|-|additional applicatinos to deploy
-|warFile|${project.build.directory}/${project.build.finalName}.${project.packaging}|the war to deploy
-|workWarFile|${project.build.directory}/${project.build.finalName}"|the exploded war to deploy
-|removeDefaultWebapps|true| should default webapps (ROOT, docs, ...) be deleted
-|deployOpenEjbApplication|false|should openejb internal application be deployed
-|removeTomeeWebapp|true|should tomee webapp (with EJBd adapter) be deployed
-|tomeeAlreadyInstalled|false|skip all the setup configuration
-|ejbRemote|true|should EJBd be activated
-|checkStarted|false|should the plugin check the server is up (useful when used with `pre-integration` phase
-|useConsole|true|wait for the end of the execution reading inputs from the console (like `quit` command)
-|useOpenEJB|false|use openejb-standalone instead of tomee
-|inlinedServerXml|-|a server.xml content in pom.xml directly
-|inlinedTomEEXml|-|a tomee.xml content in pom.xml directly
-|overrideOnUnzip|true|if when unzipping tomee a file is already there should it be overriden
-|skipRootFolderOnUnzip|true|ignore root folder of the zip
-|keystore|-|path to keystore for HTTPS connector
-|===
-
-
-Synchronization are blocks defining a source and target folder and both are synchronized. It typically copy
-`src/main/webapp` resources in `target/apache-tomee/webapps/myapp/`.
-
-
-==== Customizers
-
-Customizers are java classes loadable by the plugin and with a main or implementing `Runnable` and taking optionally
-as constructor parameter a `File` representing `tomee.base` or no arguments.
-
-They are executed when creating the TomEE instance.
-
-There are two scripting flavors of that: js and groovy. Both will have some contextual variables:
-
-- catalinaBase: tomee base path
-- resolver: a maven resolver to get a dependency using maven. For instance: `resolver.resolve('group', 'artfact', 'version', 'type')`
-
-==== Dependencies (libs)
-
-The format can be:
-
-- a maven dependency:
-
-[source]
-----
-groupId:artifactId:version
-----
-
-- a zip dependency and extracted in lib folder:
-
-[source]
-----
-unzip:groupId:artifactId:version
-----
-
-- a matching prefix to remove:
-
-[source]
-----
-remove:prefix
-----
-
-==== Example
-
-[source,xml]
-----
-<plugin>
- <groupId>org.apache.tomee.maven</groupId>
- <artifactId>tomee-maven-plugin</artifactId>
- <version>${tomee7.version}</version>
- <configuration>
- <tomeeClassifier>plus</tomeeClassifier>
- <debug>false</debug>
- <debugPort>5005</debugPort>
- <args>-Dfoo=bar</args>
- <config>${project.basedir}/src/test/tomee/conf</config>
- <libs>
- <lib>mysql:mysql-connector-java:5.1.20</lib>
- </libs>
- <webapps>
- <webapp>org.superbiz:myapp:4.3?name=ROOT</webapp>
- <webapp>org.superbiz:api:1.1</webapp>
- </webapps>
- <apps>
- <app>org.superbiz:mybugapp:3.2:ear</app>
- </apps>
- <libs>
- <lib>mysql:mysql-connector-java:5.1.21</lib>
- <lib>unzip:org.superbiz:hibernate-bundle:4.1.0.Final:zip</lib>
- <lib>remove:openjpa-</lib>
- </libs>
- </configuration>
-</plugin>
-----
-
-=== Build
-
-Excepted synchronization, build plugin inherit from `run` Mojo its configuration. It just adds the following:
-
-[.table.table-bordered,options="header"]
-|===
-|Name|Default|Description
-|formats|-|map of configuration, keys are format (zip, tar.gz) and value the target location
-|zip|true|create a zip from the configured instance
-|attach|true|attach created artifacts
-|skipArchiveRootFolder|false|don't add a root folder in the zip
-|===
-
-=== Tomcat like goals
-
-`configtest`, `start` and `stop` just execute these commands on the server (like on `catalina.sh`).
+= TomEE Maven Plugin
+:jbake-date: 2016-03-16
+:jbake-type: page
+:jbake-status: published
+:jbake-tomeepdf:
+
+TomEE Maven Plugin is a set of goals for the development and to prepare to go in production:
+
+- `tomee:build`
+- `tomee:exec`
+- `tomee:configtest`
+- `tomee:debug`
+- `tomee:deploy`
+- `tomee:exec`
+- `tomee:list`
+- `tomee:run`
+- `tomee:start`
+- `tomee:stop`
+- `tomee:undeploy`
+
+=== Run
+
+The most commonly used goal, it allows to start a tomee with applications. Here is its configuration:
+
+[.table.table-bordered,options="header"]
+|===
+|Name|Default|Description
+
+|synchronization|-|a synchronization (see after the table)
+|synchronizations|-|list of synchronizations
+|reloadOnUpdate|-|should the application be redeployed when a synchronization is triggered
+
+|skipCurrentProject|false|should current project not be considered as a deployable even if its packaging is compatible (war typically)
+|tomeeVersion|auto, plugin one|which version of TomEE to use
+|tomeeGroupId|org.apache.tomee|TomEE artifact groupId
+|tomeeArtifactId|apache-tomee|TomEE artifact artifactId
+|tomeeType|zip| the type of the TomEE artifact , only zip supported at the moment
+|tomeeClassifier|webprofile|which flavor of TomEE to use (classifier)
+|tomeeShutdownPort|read from server.xml|the shutdown port
+|tomeeShutdownAttempts|60|how many times to wait for startup/shutdown (waits 1s in between)
+|tomeeShutdownCommand|SHUTDOWN|the shutdown command
+|tomeeAjpPort|read from the pom|the AJP port if needed
+|tomeeHttpsPort|read from the pom|the HTTPS port if needed
+|args|-|command line arguments (system properties, javaagent, JVM options ...)
+|debug|-|start and wait for a remote debugger to connect
+|debugPort|5005|used when debug to change the default port
+|simpleLog|false|use one line logs
+|extractWars|false|explode wars before starting
+|stripWarVersion|true|remove the version from the war name
+|stripVersion|false|remove the version from the artifact name whatever it is (even jar)
+|webappResources|${project.basedir}/src/main/webapp|where web resources are
+|webappClasses and classes|${project.build.outputDirectory}|where artifact binaries are
+|catalinaBase|${project.build.directory}/apache-tomee|where to create the tomee instance
+|context|-|name of the current artifact (rename the war from the maven name to this one)
+|webappDir|webapps|path to webapps folder from tomee.base
+|appDir|apps|path to apps folder from tomee.base
+|libDir|lib|where is lib folder
+|mainDir|${project.basedir}/src/main|used in openejb mode to change default config of conf/lib/bin folders to openejb instead of tomee
+|config|${project.basedir}/src/main/tomee/conf|a conf folder synchronized with TomEE one
+|bin|${project.basedir}/src/main/tomee/bin|a bin folder synchronized with TomEE one
+|lib|${project.basedir}/src/main/tomee/lib|a lib folder synchronized with TomEE one
+|systemVariables|-|a map of system properties
+|classpaths|-|a list of additional entries for the startup classpath
+|customizers|-|a list of customizers
+|jsCustomizers|-|a list of js customizers (js scripts)
+|groovyCustomizers|-|a list of groovy customizers (groovy scripts)
+|webappDefaultConfig|false|auto config war oriented
+|quickSession|true|session generation will use `Random` instead of `SecureRandom` (for dev)
+|forceReloadable|false|ensure TomEE supports reloading/redeployment
+|forceJspDevelopment|true|JSP will be auto-recompiled on changes
+|libs|-|dependencies to add in lib, see after this table for advanced usage
+|endorsedLibs|-|dependencies to add in endorsed, see after this table for advanced usage
+|javaagents|-|javaagents to add on the JVM, supports maven coordinates
+|persistJavaagents|false|should javaagent be saved or just use for this plugin run
+|webapps|-|additional applicatinos to deploy
+|warFile|${project.build.directory}/${project.build.finalName}.${project.packaging}|the war to deploy
+|workWarFile|${project.build.directory}/${project.build.finalName}"|the exploded war to deploy
+|removeDefaultWebapps|true| should default webapps (ROOT, docs, ...) be deleted
+|deployOpenEjbApplication|false|should openejb internal application be deployed
+|removeTomeeWebapp|true|should tomee webapp (with EJBd adapter) be deployed
+|tomeeAlreadyInstalled|false|skip all the setup configuration
+|ejbRemote|true|should EJBd be activated
+|checkStarted|false|should the plugin check the server is up (useful when used with `pre-integration` phase
+|useConsole|true|wait for the end of the execution reading inputs from the console (like `quit` command)
+|useOpenEJB|false|use openejb-standalone instead of tomee
+|inlinedServerXml|-|a server.xml content in pom.xml directly
+|inlinedTomEEXml|-|a tomee.xml content in pom.xml directly
+|overrideOnUnzip|true|if when unzipping tomee a file is already there should it be overriden
+|skipRootFolderOnUnzip|true|ignore root folder of the zip
+|keystore|-|path to keystore for HTTPS connector
+|===
+
+
+Synchronization are blocks defining a source and target folder and both are synchronized. It typically copy
+`src/main/webapp` resources in `target/apache-tomee/webapps/myapp/`.
+
+
+==== Customizers
+
+Customizers are java classes loadable by the plugin and with a main or implementing `Runnable` and taking optionally
+as constructor parameter a `File` representing `tomee.base` or no arguments.
+
+They are executed when creating the TomEE instance.
+
+There are two scripting flavors of that: js and groovy. Both will have some contextual variables:
+
+- catalinaBase: tomee base path
+- resolver: a maven resolver to get a dependency using maven. For instance: `resolver.resolve('group', 'artfact', 'version', 'type')`
+
+==== Dependencies (libs)
+
+The format can be:
+
+- a maven dependency:
+
+[source]
+----
+groupId:artifactId:version
+----
+
+- a zip dependency and extracted in lib folder:
+
+[source]
+----
+unzip:groupId:artifactId:version
+----
+
+- a matching prefix to remove:
+
+[source]
+----
+remove:prefix
+----
+
+==== Example
+
+[source,xml]
+----
+<plugin>
+ <groupId>org.apache.tomee.maven</groupId>
+ <artifactId>tomee-maven-plugin</artifactId>
+ <version>${tomee7.version}</version>
+ <configuration>
+ <tomeeClassifier>plus</tomeeClassifier>
+ <debug>false</debug>
+ <debugPort>5005</debugPort>
+ <args>-Dfoo=bar</args>
+ <config>${project.basedir}/src/test/tomee/conf</config>
+ <libs>
+ <lib>mysql:mysql-connector-java:5.1.20</lib>
+ </libs>
+ <webapps>
+ <webapp>org.superbiz:myapp:4.3?name=ROOT</webapp>
+ <webapp>org.superbiz:api:1.1</webapp>
+ </webapps>
+ <apps>
+ <app>org.superbiz:mybugapp:3.2:ear</app>
+ </apps>
+ <libs>
+ <lib>mysql:mysql-connector-java:5.1.21</lib>
+ <lib>unzip:org.superbiz:hibernate-bundle:4.1.0.Final:zip</lib>
+ <lib>remove:openjpa-</lib>
+ </libs>
+ </configuration>
+</plugin>
+----
+
+=== Build
+
+Excepted synchronization, build plugin inherit from `run` Mojo its configuration. It just adds the following:
+
+[.table.table-bordered,options="header"]
+|===
+|Name|Default|Description
+|formats|-|map of configuration, keys are format (zip, tar.gz) and value the target location
+|zip|true|create a zip from the configured instance
+|attach|true|attach created artifacts
+|skipArchiveRootFolder|false|don't add a root folder in the zip
+|===
+
+=== Tomcat like goals
+
+`configtest`, `start` and `stop` just execute these commands on the server (like on `catalina.sh`).
diff --git a/src/main/jbake/content/documentation/index.adoc b/src/main/jbake/content/documentation/index.adoc
deleted file mode 100644
index 3f033d3..0000000
--- a/src/main/jbake/content/documentation/index.adoc
+++ /dev/null
@@ -1,24 +0,0 @@
-= TomEE Documentation
-:jbake-date: 2016-03-16
-:jbake-type: page
-:jbake-status: published
-:jbake-tomeepdf:
-
-=== Administration
-- link:admin/configuration/index.html[How to configure]
-- link:admin/directory-structure.html[Directory Structure]
-- link:admin/cluster/index.html[Clustering]
-
-=== Developers
-- link:developer/ide/index.html[IDEs - Eclipse, Intellij Idea and Netbeans]
-- link:developer/testing/index.html[Testing - Arquillian, OpenEJB JUnit, TomEE Embedded and ApplicationComposer]
-- link:developer/tools/index.html[Build Tools - Maven and Gradle]
-- link:developer/json/index.html[TomEE 7 and Apache Johnzon (JSON Mapper)]
-- link:developer/configuration/cxf.html[Apache CXF Configuration - JAX-RS and JAX-WS]
-- link:developer/classloading/index.html[TomEE Classloading]
-
-=== Advanced
-- link:advanced/applicationcomposer/index.html[`ApplicationComposer` with JBatch]
-- link:advanced/setup/index.html[How to setup TomEE in production]
-- link:advanced/shading/index.html[Fat / Uber jars - Shade Plugin]
-- link:advanced/client/jndi.html[JNDI]
diff --git a/src/main/jbake/content/downloads/download-ng.adoc b/src/main/jbake/content/download-ng.adoc
similarity index 99%
rename from src/main/jbake/content/downloads/download-ng.adoc
rename to src/main/jbake/content/download-ng.adoc
index 438ec6f..0610a06 100755
--- a/src/main/jbake/content/downloads/download-ng.adoc
+++ b/src/main/jbake/content/download-ng.adoc
@@ -5,7 +5,7 @@
:jbake-tomeepdf:
:icons: font
-IMPORTANT: Only TomEE 1.x WebProfile and JAX-RS distributions are certified.
+IMPORTANT: only TomEE 1.x WebProfile and JAX-RS distributions are certified.
[.table.table-bordered,options="header"]
|===
diff --git a/src/main/jbake/templates/footer.gsp b/src/main/jbake/templates/footer.gsp
index 9392f84..2c24dc9 100755
--- a/src/main/jbake/templates/footer.gsp
+++ b/src/main/jbake/templates/footer.gsp
@@ -13,21 +13,28 @@
<div class="col-sm-6 text-center-mobile">
<div class="row opening-hours">
<div class="col-sm-3 text-center-mobile">
- <h5><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>documentation/index.html" class="white">Documentation</a></h5>
+ <h5><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>admin/index.html" class="white">Administration</a></h5>
<ul class="list-unstyled">
- <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>documentation/admin/configuration/index.html" class="regular light-white">How to configure</a></li>
- <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>documentation/admin/directory-structure.html" class="regular light-white">Dir. Structure</a></li>
- <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>documentation/developer/testing/index.html" class="regular light-white">Testing</a></li>
- <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>documentation/admin/cluster/index.html" class="regular light-white">Clustering</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>admin/cluster/index.html" class="regular light-white">Cluster</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>admin/configuration/index.html" class="regular light-white">Configuration</a></li>
</ul>
</div>
<div class="col-sm-3 text-center-mobile">
- <h5><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>examples.html" class="white">Examples</a></h5>
+ <h5><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>developer/index.html" class="white">Developer</a></h5>
<ul class="list-unstyled">
- <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>examples/simple-cdi-interceptor.html" class="regular light-white">CDI Interceptor</a></li>
- <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>examples/rest-cdi.html" class="regular light-white">REST with CDI</a></li>
- <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>examples/ejb-examples.html" class="regular light-white">EJB</a></li>
- <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>examples/jsf-managedBean-and-ejb.html" class="regular light-white">JSF</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>developer/classloading/index.html" class="regular light-white">Classloading</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>developer/ide/index.html" class="regular light-white">IDE</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>developer/testing/index.html" class="regular light-white">Testing</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>developer/tools/index.html" class="regular light-white">Tools</a></li>
+ </ul>
+ </div>
+ <div class="col-sm-3 text-center-mobile">
+ <h5><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>advanced/index.html" class="white">Advanced</a></h5>
+ <ul class="list-unstyled">
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>advanced/applicationcomposer/index.html" class="regular light-white">Application Composer</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>advanced/setup/index.html" class="regular light-white">Setup</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>advanced/shading/index.html" class="regular light-white">Shading</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>advanced/tomee-embedded/index.html" class="regular light-white">TomEE Embedded</a></li>
</ul>
</div>
<div class="col-sm-3 text-center-mobile">
@@ -38,14 +45,6 @@
<li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>community/sources.html" class="regular light-white">Sources</a></li>
</ul>
</div>
- <div class="col-sm-3 text-center-mobile">
- <h5><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>security/index.html" class="white">Security</a></h5>
- <ul class="list-unstyled">
- <li><a href="http://apache.org/security" target="_blank" class="regular light-white">Apache Security</a></li>
- <li><a href="http://apache.org/security/projects.html" target="_blank" class="regular light-white">Security Projects</a></li>
- <li><a href="http://cve.mitre.org" target="_blank" class="regular light-white">CVE</a></li>
- </ul>
- </div>
</div>
</div>
</div>
diff --git a/src/main/jbake/templates/index.gsp b/src/main/jbake/templates/index.gsp
index 19a4491..3933987 100755
--- a/src/main/jbake/templates/index.gsp
+++ b/src/main/jbake/templates/index.gsp
@@ -25,28 +25,28 @@
<div class="row intro-tables animated fadeInUp" style="opacity: 0;">
<div class="col-md-4">
<div class="intro-table intro-table1 intro-table-hover1 intro-table-hover">
- <h5 class="white heading hide-hover">Learn more about TomEE</h5>
+ <h5 class="white heading hide-hover">TomEE for administrators</h5>
<div class="bottom">
- <h4 class="white heading small-heading no-margin regular">Documentation</h4>
- <a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>/documentation/index.html" class="btn btn-white-fill expand">Learn more...</a>
+ <h4 class="white heading small-heading no-margin regular">I'm an admin</h4>
+ <a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>admin/index.html" class="btn btn-white-fill expand">Learn more...</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="intro-table intro-table2 intro-table-hover2 intro-table-hover">
- <h5 class="white heading hide-hover">How can I contribute to TomEE?</h5>
+ <h5 class="white heading hide-hover">TomEE for developers</h5>
<div class="bottom">
- <h4 class="white heading small-heading no-margin regular">Community</h4>
- <a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>/community/index.html" class="btn btn-white-fill expand">Learn more...</a>
+ <h4 class="white heading small-heading no-margin regular">I'm a developer</h4>
+ <a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>developer/index.html" class="btn btn-white-fill expand">Learn more...</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="intro-table intro-table3 intro-table-hover3 intro-table-hover">
- <h5 class="white heading hide-hover">How can I download TomEE?</h5>
+ <h5 class="white heading hide-hover">Advanced usages</h5>
<div class="bottom">
- <h4 class="white heading small-heading no-margin regular">Downloads</h4>
- <a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>/downloads/download-ng.html" class="btn btn-white-fill expand">Learn more...</a>
+ <h4 class="white heading small-heading no-margin regular">Too easy, let's go further</h4>
+ <a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>advanced/index.html" class="btn btn-white-fill expand">Learn more...</a>
</div>
</div>
</div>
diff --git a/src/main/jbake/templates/menu.gsp b/src/main/jbake/templates/menu.gsp
index 2cf88cb..0fe2ae3 100755
--- a/src/main/jbake/templates/menu.gsp
+++ b/src/main/jbake/templates/menu.gsp
@@ -8,7 +8,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
- <a class="navbar-brand" href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>">
+ <a class="navbar-brand" href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>/#">
<span>
<% if (content.uri && content.uri == '/index.html') { %>
@@ -26,11 +26,14 @@
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right main-nav">
- <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>documentation/index.html">Documentation</a></li>
- <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>examples/index.html">Examples</a></li>
- <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>community/index.html">Community</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>developer/index.html">Developer</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>admin/index.html">Admin</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>advanced/index.html">Advanced</a></li>
<li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>security/index.html">Security</a></li>
- <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>downloads/download-ng.html">Downloads</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>examples/index-ng.html">Examples</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>blog/index.html">Blog</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>community/index.html">Community</a></li>
+ <li><a href="<%if (content.rootpath) {%>${content.rootpath}<% } else { %><% }%>download-ng.html">Downloads</a></li>
</ul>
</div>
<!-- /.navbar-collapse -->