<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>java Archives - Software Evolutivo</title>
	<atom:link href="https://softwareevolutivo.com.ec/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>https://softwareevolutivo.com.ec/tag/java/</link>
	<description>Consultora de Software Empresarial</description>
	<lastBuildDate>Thu, 22 Feb 2024 16:15:16 +0000</lastBuildDate>
	<language>es</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://softwareevolutivo.com.ec/wp-content/uploads/2024/03/cropped-Perfil-Redes-Iso-32x32.png</url>
	<title>java Archives - Software Evolutivo</title>
	<link>https://softwareevolutivo.com.ec/tag/java/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>JBoss EAP: Configuración de la memoria</title>
		<link>https://softwareevolutivo.com.ec/jboss-eap-configuracion-de-la-memoria/</link>
					<comments>https://softwareevolutivo.com.ec/jboss-eap-configuracion-de-la-memoria/#respond</comments>
		
		<dc:creator><![CDATA[Jorge Aguilar]]></dc:creator>
		<pubDate>Thu, 13 Oct 2022 20:41:50 +0000</pubDate>
				<category><![CDATA[Desarrollo de Software]]></category>
		<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[memoria]]></category>
		<guid isPermaLink="false">https://softwareevolutivo.com.ec/?p=6509</guid>

					<description><![CDATA[<p>Una de las tareas de afinamiento más comunes luego de comenzar a operar un servidor de aplicaciones Java suele ser el ajuste de la memoria que utiliza el Java Virtual Machine (JVM). Por defecto, cierta cantidad de memoria es asignada al momento de iniciar el JVM, esta memoria es utilizada para alojar los objetos creados por las aplicaciones y para mantener otra información creada durante la ejecución de las mismas. </p>
<p>The post <a href="https://softwareevolutivo.com.ec/jboss-eap-configuracion-de-la-memoria/">JBoss EAP: Configuración de la memoria</a> appeared first on <a href="https://softwareevolutivo.com.ec">Software Evolutivo</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="6509" class="elementor elementor-6509">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-8f2d4b6 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="8f2d4b6" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-a9a3a8b" data-id="a9a3a8b" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-5aa45fb elementor-widget elementor-widget-text-editor" data-id="5aa45fb" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p><br></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="background-color: transparent; font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre-wrap;">Una de las tareas de afinamiento más comunes luego de comenzar a operar un servidor de aplicaciones Java suele ser el ajuste de la memoria que utiliza el </span><a href="https://en.wikipedia.org/wiki/Java_virtual_machine" target="_blank">Java Virtual Machine</a><span style="background-color: transparent; font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre-wrap;"> (JVM). Por defecto, cierta cantidad de memoria es asignada al momento de iniciar el JVM, esta memoria es utilizada para alojar los objetos creados por las aplicaciones y para mantener otra información creada durante la ejecución de las mismas. El valor inicial suele ser suficiente para iniciar a operar pero ciertas aplicaciones necesitarán una mayor cantidad de recursos ya sea de entrada o con el tiempo para cubrir una mayor demanda por parte de los usuarios.</span><br></p>
<p><b style="font-weight: normal;">&nbsp;</b></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Si la cantidad de memoria asignada es insuficiente para la demanda inicial de las aplicaciones o para soportar la carga que reciban éstas, entonces eventualmente se podría experimentar lentitud o la cancelación de las peticiones, llegando a la temida excepción de Java: </span><span style="font-size: 11pt; font-family: 'Courier New'; color: #000000; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">java.lang.OutOfMemoryError</span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, que se presenta cuando el JVM es incapaz de crear un objeto en memoria y en este punto será necesario reiniciar el servidor, con la correspondiente afectación a los usuarios conectado o nuevos que estén por llegar.</span></p>
<p><b style="font-weight: normal;">&nbsp;</b></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">En esta entrada se va a considerar los pasos a seguir para modificar la cantidad de memoria que es asignada al JVM del servidor de aplicaciones </span><a href="https://www.redhat.com/en/technologies/jboss-middleware/application-platform" target="_blank">JBoss Enterprise Application Platform (EAP)</a><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> en su versión 7 en modo Standalone y utilizando Java 11, aunque para Java 8 los pasos son similares.</span></p>
<p><b style="font-weight: normal;">&nbsp;</b></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">El punto de partida será que contamos con servidor JBoss EAP instalado y aplicada su configuración básica. Para llegar a este punto se puede tomar como referencia la entrega inicial de esta serie de artículos: </span><a href="https://softwareevolutivo.com.ec/jboss-eap-instalacion-y-configuracion-basica/" target="_blank" style="background-color: rgb(255, 255, 255);">JBoss EAP: Instalación y configuración básica</a></p>
<h1 dir="ltr" style="line-height: 1.38; margin-top: 20pt; margin-bottom: 6pt;"><span style="font-size: 20pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Algunos conceptos básicos</span></h1>
<h2 dir="ltr" style="line-height: 1.38; margin-top: 18pt; margin-bottom: 6pt;"><span style="font-size: 16pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Tipos de memoria</span></h2>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">En Java 11 existen dos tipos principales de memoria del JVM:</span></p>
<h3 dir="ltr" style="line-height: 1.38; margin-top: 16pt; margin-bottom: 4pt;"><span style="font-size: 13.999999999999998pt; font-family: Arial; color: #434343; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Heap</span></h3>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Corresponde al espacio donde se alojarán los objetos y arreglos que son utilizados por las aplicaciones. El tamaño del Heap varía mientras se ejecutan las aplicaciones.</span></p>
<p><b style="font-weight: normal;">&nbsp;</b></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Existen dos parámetros que podemos utilizar para modificar el espacio utilizado por el Heap, éstos son:</span></p>
<p dir="ltr" style="background-color: transparent; color: #000000; font-family: Arial; font-size: 11pt; white-space: pre; line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;" role="presentation"><span style="font-size: 11pt; font-family: Consolas, sans-serif; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre-wrap;">-Xms</span><span style="font-size: 11pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre-wrap;">: Valor inicial</span></p>
<ul>
<li><span style="font-size: 11pt; font-family: Consolas, sans-serif; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre-wrap;">-Xmx</span><span style="font-size: 11pt; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre-wrap;">: Valor máximo que podría tomar</span></li>
<li>&nbsp;</li>
<li><span style="font-size: 13.999999999999998pt; font-family: Arial; color: #434343; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Non-heap</span></li>
</ul>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">El espacio más relevante dentro de lo que no sea Heap se lo conoce como </span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Metaspace</span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> y es donde se almacena la metadata, estructura de las clases, constantes, valores de los String, entre otros.</span></p>
<p><b style="font-weight: normal;">&nbsp;</b></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Desde la versión 8 de Java encontramos los siguientes parámetros para lo que se conoce como Metaspace:</span></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="background-color: transparent; color: #000000; font-size: 11pt; font-variant-numeric: normal; font-variant-east-asian: normal; font-family: Consolas, sans-serif; vertical-align: baseline; white-space: pre-wrap;">&nbsp;</span></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="background-color: transparent; color: #000000; font-size: 11pt; font-variant-numeric: normal; font-variant-east-asian: normal; font-family: Consolas, sans-serif; vertical-align: baseline; white-space: pre-wrap;">-XX:MetaspaceSize</span><span style="background-color: transparent; color: #000000; font-family: Arial; font-size: 11pt; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre-wrap;">: Valor inicial para almacenar los elementos del Non-heap</span></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="background-color: transparent; color: #000000; font-size: 11pt; font-variant-numeric: normal; font-variant-east-asian: normal; font-family: Consolas, sans-serif; vertical-align: baseline; white-space: pre-wrap;">-XX:MaxMetaspaceSize</span><span style="background-color: transparent; color: #000000; font-family: Arial; font-size: 11pt; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre-wrap;">: Valor máximo que podría tomar el espacio de Non-heap</span></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="background-color: transparent; color: #000000; font-family: Arial; font-size: 11pt; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline; white-space: pre-wrap;">&nbsp;</span></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Nota: Antes de Java 8, se lo conoce como Permanent Gen y los parámetros eran </span><span style="font-size: 11pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-XX:PermSize</span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> y </span><span style="font-size: 11pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-XX:MaxPermSize</span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, equivalentes a los antes mencionados.</span></p>
<h2 dir="ltr" style="line-height: 1.38; margin-top: 18pt; margin-bottom: 6pt;"><span style="font-size: 16pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Gestión de la memoria</span></h2>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Es bien conocido que como desarrolladores no tenemos que liberar de manera explícita la memoria que ya no estemos utilizando, a diferencia de otros lenguajes de programación como C++. Y ésto es debido a que Java dispone del </span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Garbage Collector</span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, un componente del JVM que es el encargado de monitorear y liberar el espacio de memoria que ya no está en uso.</span></p>
<h1 dir="ltr" style="line-height: 1.38; margin-top: 20pt; margin-bottom: 6pt;"><span style="font-size: 20pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Procedimiento de ajuste de la memoria</span></h1>
<h2 dir="ltr" style="line-height: 1.38; margin-top: 18pt; margin-bottom: 6pt;"><span style="font-size: 16pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Heap</span></h2>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cuando encontremos la excepción </span><span style="font-size: 11pt; font-family: 'Courier New'; color: #000000; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">java.lang.OutOfMemoryError </span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">en el archivo de log&nbsp; (</span><span style="font-size: 11pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$EAP_HOME/standalone/server.log</span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)&nbsp; de JBoss EAP podremos tener la certeza de que se va a requerir un incremento en la memoria Heap.</span></p>
<p><b style="font-weight: normal;">&nbsp;</b></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Para el modo Standalone de JBoss EAP simplemente se deberá cambiar el archivo </span><span style="font-size: 11pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">standalone.conf</span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, el cuál está ubicado en el directorio </span><span style="font-size: 11pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$EAP_HOME/bin/</span></p>								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-96eb4d2 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="96eb4d2" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3a4eda2" data-id="3a4eda2" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-d831517 elementor-widget elementor-widget-image" data-id="d831517" data-element_type="widget" data-e-type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
															<img fetchpriority="high" decoding="async" width="1024" height="161" src="https://softwareevolutivo.com.ec/wp-content/uploads/2022/10/image1-1024x161.png" class="attachment-large size-large wp-image-6522" alt="Procedimiento de ajuste de la memoria" srcset="https://softwareevolutivo.com.ec/wp-content/uploads/2022/10/image1-1024x161.png 1024w, https://softwareevolutivo.com.ec/wp-content/uploads/2022/10/image1-300x47.png 300w, https://softwareevolutivo.com.ec/wp-content/uploads/2022/10/image1-768x120.png 768w, https://softwareevolutivo.com.ec/wp-content/uploads/2022/10/image1.png 1486w" sizes="(max-width: 1024px) 100vw, 1024px" />															</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-94014ae elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="94014ae" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-a4e2979" data-id="a4e2979" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-7884b6c elementor-widget elementor-widget-text-editor" data-id="7884b6c" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">&nbsp;</span></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Según el archivo del ejemplo, se puede ver que en línea 53 están los valores correspondientes para </span><span style="font-size: 11pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-Xms</span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> y </span><span style="font-size: 11pt; font-family: Consolas,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-Xmx</span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, en este caso ambos establecidos en 1303 MB.</span></p>
<p><b id="docs-internal-guid-d95917a6-7fff-6d15-0da0-8ec1b5858f31" style="font-weight: normal;">&nbsp;</b></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">NOTA: Para ambientes productivos se recomienda establecer -Xms y -Xmx con el mismo valor, así no se tiene que gestionar el incremento hasta el valor máximo sino que ya está establecido de antemano.</span></p>
<h2 dir="ltr" style="line-height: 1.38; margin-top: 18pt; margin-bottom: 6pt;"><span style="font-size: 16pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Metaspace</span></h2>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Usualmente no existe la necesidad de especificar un tamaño máximo para Metaspace a menos que se esté presentando una pérdida de memoria (memory leak), que resulta de la falta de liberación de la misma una vez que ya no se la necesita, afectando al rendimiento del servidor.</span></p>
<h1 dir="ltr" style="line-height: 1.38; margin-top: 20pt; margin-bottom: 6pt;"><span style="font-size: 16pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Conclusiones</span></h1>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Dentro de los ajustes que podemos hacer a un servidor de aplicaciones, como JBoss EAP, el espacio </span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Heap</span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> es el principal ya que es el más dependiente de la dinámica de nuestras aplicaciones y de la exigencia que reciba por parte de sus clientes.</span></p>
<p><b style="font-weight: normal;">&nbsp;</b></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">La modificación del tamaño del espacio </span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Heap</span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> es una tarea sencilla pero requiere el reinicio del servidor de aplicaciones, y como pudimos evidenciar son instrucciones que recibe el JVM al momento de iniciar el mismo. Estos parámetros son los mismo que aplican para cualquier servidor de aplicaciones que se ejecute sobre la máquina virtual de Java (JVM).</span></p>
<p><b style="font-weight: normal;">&nbsp;</b></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Otras modificaciones, como el cambio del </span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Metaspace</span><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> no son tan habituales, sin embargo podría ser necesarias cuando las aplicaciones mantienen un número extenso de clases o gestionan muchos valores del tipo String.</span></p>
<p><b style="font-weight: normal;">&nbsp;</b></p>
<p dir="ltr" style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Te hacemos una cordial&nbsp; invitación ya que en próximas entradas del blog habrá más contenido sobre esta </span><a style="text-decoration: none;" href="https://softwareevolutivo.com.ec/tag/jboss/"><span style="font-size: 11pt; font-family: Arial; color: #1155cc; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: underline; -webkit-text-decoration-skip: none; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;">temática</span></a><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">. Hasta pronto.</span></p>
<p></p>								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://softwareevolutivo.com.ec/jboss-eap-configuracion-de-la-memoria/">JBoss EAP: Configuración de la memoria</a> appeared first on <a href="https://softwareevolutivo.com.ec">Software Evolutivo</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://softwareevolutivo.com.ec/jboss-eap-configuracion-de-la-memoria/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>JBoss EAP: Instalación y configuración básica</title>
		<link>https://softwareevolutivo.com.ec/jboss-eap-instalacion-y-configuracion-basica/</link>
					<comments>https://softwareevolutivo.com.ec/jboss-eap-instalacion-y-configuracion-basica/#respond</comments>
		
		<dc:creator><![CDATA[Jorge Aguilar]]></dc:creator>
		<pubDate>Thu, 12 May 2022 00:59:03 +0000</pubDate>
				<category><![CDATA[Aplicaciones Web]]></category>
		<category><![CDATA[Infrarestructura de Software]]></category>
		<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[redhat]]></category>
		<guid isPermaLink="false">https://softwareevolutivo.com.ec/?p=1568</guid>

					<description><![CDATA[<p>JBoss EAP es una plataforma de código abierto que ofrece seguridad, escalabilidad y rendimiento a nivel empresarial para aplicaciones Java. Incluyen todo lo que se necesita para crear, ejecutar, implementar y administrar aplicaciones Java empresariales en cualquier entorno.</p>
<p>The post <a href="https://softwareevolutivo.com.ec/jboss-eap-instalacion-y-configuracion-basica/">JBoss EAP: Instalación y configuración básica</a> appeared first on <a href="https://softwareevolutivo.com.ec">Software Evolutivo</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="1568" class="elementor elementor-1568">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-60d3ec58 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="60d3ec58" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-49efc247" data-id="49efc247" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-5a58dcf5 elementor-widget elementor-widget-text-editor" data-id="5a58dcf5" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p>En esta primera entrega, de la serie de artículos relacionados a&nbsp;<a href="https://en.wikipedia.org/wiki/JBoss_Enterprise_Application_Platform" target="_blank">JBoss Enterprise Application Platform</a>&nbsp;(EAP), vamos a considerar la instalación y configuración inicial del producto, de tal manera que podamos contar con los servicios suficientes para un despliegue en un ambiente de pruebas o que sea el primer paso para tener una instancia candidata a producción.</p>
<p>JBoss EAP es una plataforma de código abierto que ofrece seguridad, escalabilidad y rendimiento a nivel empresarial para aplicaciones Java. Incluyen todo lo que se necesita para crear, ejecutar, implementar y administrar aplicaciones Java empresariales en cualquier entorno.</p>
<p>Si bien JBoss EAP está disponible como imagen de contenedor o como un operador de Kubernetes u Openshift, en este caso vamos a utilizar los binarios tradicionales para hacer una instalación desde cero, lo que nos permitirá tener un mayor entendimiento de los requisitos para su operación.</p>								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-0539c34 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="0539c34" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-246d713" data-id="246d713" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-725233d elementor-widget elementor-widget-heading" data-id="725233d" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h2 class="elementor-heading-title elementor-size-default">Requisitos</h2>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-037ac8c elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="037ac8c" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-23c37ca" data-id="23c37ca" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-7156934 elementor-widget elementor-widget-text-editor" data-id="7156934" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p><span style="font-size: 11pt; font-family: Arial; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Antes de iniciar, se espera que podamos contar con lo siguiente:</span></p>
<ol>
<li dir="ltr" style="line-height: 1.38;"><span style="background-color: transparent; color: #000000; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: 400; white-space: pre-wrap;">Servidor Linux: Los comandos que se presentan son compatibles con CentOS 8 o Red Hat Enterprise Linux 8</span></li>
<li dir="ltr" style="line-height: 1.38;"><span style="font-family: Arial; font-style: normal; font-weight: 400; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-size: 11pt; white-space: pre-wrap;">Disponer del utilitario </span><span style="font-family: Arial; font-style: normal; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-size: 11pt; font-weight: bold; white-space: pre-wrap;">unzip</span><span style="font-family: Arial; font-style: normal; font-weight: 400; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-size: 11pt; white-space: pre-wrap;"> para descomprimir el binario de JBoss EAP</span></li>
<li dir="ltr" style="line-height: 1.38;"><span style="font-family: Arial; font-style: normal; font-weight: 400; background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; font-size: 11pt; white-space: pre-wrap;">Tener instalado y configurado Java 1.8 u 11. El detalle de las configuraciones soportadas se pueden encontrar en la siguiente enlace: </span><a style="background-color: transparent; font-family: Arial; font-size: 11pt; white-space: pre;" href="https://access.redhat.com/articles/2026253#EAP_74" target="_blank" rel="noopener"><span style="font-size: 11pt; font-family: Arial; color: #1155cc; background-color: transparent; font-weight: 400; font-style: normal; font-variant-numeric: normal; font-variant-east-asian: normal; text-decoration-line: underline; text-decoration-skip-ink: none; white-space: pre-wrap;">https://access.redhat.com/articles/2026253#EAP_74</span></a></li>
<li dir="ltr" style="line-height: 1.38;" role="presentation"><span style="background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-variant-numeric: normal; font-variant-east-asian: normal; font-weight: 400; white-space: pre-wrap;">Archivo empaquetado de </span><span style="background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-variant-numeric: normal; font-variant-east-asian: normal; font-weight: bold; white-space: pre-wrap;">JBoss EAP 7.4</span><span style="background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-variant-numeric: normal; font-variant-east-asian: normal; font-weight: 400; white-space: pre-wrap;">: Se puede descargar el </span><span style="background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-variant-numeric: normal; font-variant-east-asian: normal; font-weight: bold; white-space: pre-wrap;">Zip File</span><span style="background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-variant-numeric: normal; font-variant-east-asian: normal; font-weight: 400; white-space: pre-wrap;"> desde la siguiente dirección: </span><a style="font-family: Arial; font-style: normal; font-weight: 400;" href="https://developers.redhat.com/products/eap/download" target="_blank" rel="noopener"><span style="font-size: 11pt; font-family: Arial; color: #1155cc; background-color: transparent; font-weight: 400; font-style: normal; font-variant-numeric: normal; font-variant-east-asian: normal; text-decoration-line: underline; text-decoration-skip-ink: none; white-space: pre-wrap;">https://developers.redhat.com/products/eap/download</span></a></li>
</ol>								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-ca27f22 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="ca27f22" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1b2b955" data-id="1b2b955" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-68fc5f0 elementor-widget elementor-widget-heading" data-id="68fc5f0" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h2 class="elementor-heading-title elementor-size-default">Configuración por defecto</h2>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-72e0b2b elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="72e0b2b" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6a8aa8f" data-id="6a8aa8f" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-5f6e3eb elementor-widget elementor-widget-text-editor" data-id="5f6e3eb" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p>JBoss EAP mantiene la siguiente configuración inicial:</p>
<ul>
<li>No existen usuarios de administración de JBoss EAP, es necesario crear al menos uno para administrar el servicio remotamente. Este usuario será creado más adelante.</li>
<li>Solamente se escucha en la interfaz 127.0.0.1 (localhost), es decir que solamente están disponibles los servicios desde el mismo servidor.</li>
<li>Los puertos de los servicios principales son:
<ul>
<li>Aplicaciones HTTP: 8080</li>
<li>Aplicaciones HTTPS: 8443</li>
<li>Administración (Web y por línea de comandos): 9990</li>
</ul>
</li>
</ul>								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-ab89ddc elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="ab89ddc" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d0259f5" data-id="d0259f5" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-acf3462 elementor-widget elementor-widget-heading" data-id="acf3462" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h2 class="elementor-heading-title elementor-size-default">Alcance de la instalación y configuración</h2>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-fbcb74c elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="fbcb74c" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-af3b35f" data-id="af3b35f" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-c2fe63c elementor-widget elementor-widget-text-editor" data-id="c2fe63c" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p>Esta guía cubre los siguientes puntos:</p>
<ul>
<li>Instalación de los binarios</li>
<li>Creación del usuario administrador de JBoss EAP</li>
<li>Apertura de las interfaces de red para el acceso remoto</li>
</ul>								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-bbac45e elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="bbac45e" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-a93fd7d" data-id="a93fd7d" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-ef99fe5 elementor-widget elementor-widget-heading" data-id="ef99fe5" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h2 class="elementor-heading-title elementor-size-default">Procedimiento de instalación y configuración</h2>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-6dc3adc elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="6dc3adc" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1591c72" data-id="1591c72" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-fe1e3cd elementor-widget elementor-widget-heading" data-id="fe1e3cd" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h3 class="elementor-heading-title elementor-size-default">Instalación de los binarios</h3>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-5e59745 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="5e59745" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1de1057" data-id="1de1057" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-93b8d0e elementor-widget elementor-widget-text-editor" data-id="93b8d0e" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<ol>
<li>
<p>Se va a necesitar un usuario de sistema operativo (En este caso eap), diferente al usuario root, para levantar los servicios. Como el usuario root ejecutamos este y los siguientes comandos:</p>
<p><code># useradd eap</code></p>
<p>NOTA: Este usuario es diferente al usuario administrador de JBoss EAP (eapadmin) que se creará en el punto 4 de esta sección.</p>
</li>
<li>
<p>Creación del directorio Home de JBoss EAP, descompresión del archivo empaquetado y asignación de permisos al usuario eap:</p>
<p><code>
# mkdir /opt/jboss/<br />
# cd /opt/jboss/<br />
# unzip /tmp/jboss-eap-7.4.0.zip<br />
# chown -R eap:eap /opt/jboss/
</code></p>
</li>
<li>
<p>Configuración de variables de ambiente para que el usuario eap disponga de los ejecutables de JBoss EAP en el PATH de su sesión:</p>
<p><code>
# echo 'export EAP_HOME=/opt/jboss/jboss-eap-7.4' &gt;&gt; ~eap/.bash_profile<br />
# echo 'export PATH=$PATH:$EAP_HOME/bin' &gt;&gt; ~eap/.bash_profile
</code></p>
</li>
<li>
<p>Crear el usuario administrador de JBoss EAP (eapadmin) con su respectiva contraseña. Hacemos el cambio al usuario eap del sistema operativo para luego ejecutar la creación del usuario:</p>
<p><code>
# su - eap<br />
$ add-user.sh -u 'eapadmin' -p '********'
</code></p>
</li>
</ol>								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-b4019b5 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="b4019b5" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-351803f" data-id="351803f" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-abd197e elementor-widget elementor-widget-heading" data-id="abd197e" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h3 class="elementor-heading-title elementor-size-default">Inicio del servicio y validación de la configuración de red</h3>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-1d20718 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="1d20718" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1bcaed5" data-id="1bcaed5" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-51cb9df elementor-widget elementor-widget-text-editor" data-id="51cb9df" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<ol>
<li>
<p>Utilizando la misma sesión del usuario eap, ejecutamos el script de inicio para subir el servicio en modo Standalone:</p>
<p><code>
$ standalone.sh
</code></p>
<p>NOTA: La terminal quedará ocupada, la dejaremos abierta para no terminar el proceso.</p>
</li>
<li>
<p>Abrimos una nueva sesión con el usuario eap para confirmar los puertos que fueron abiertos por el servicio:</p>
<p><code>
$ ss -ltn | grep -e 8080 -e 8443 -e 9990
</code></p>
<p>Como lo muestra el comando ss, por defecto JBoss EAP escucha solamente en 127.0.0.1 (localhost).</p>
<p>
<img decoding="async" style="margin-left: 0px; margin-top: 0px;" src="https://lh3.googleusercontent.com/JxRaUYd9vZQlI1L8gQjcm9zjbUpbio2vnG2vvZKeupxm3DXT61fJb2bYgp3hpud92GbZkQD3Tt3JowMxyPgQFKwSt5vAUqE6vJR5BiMoi7JiZ_viknN2e1RKLbgQFt78OXHwKAXIa-2ZnxITsQ" /></p>
</li>
</ol>								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-99529f4 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="99529f4" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6626462" data-id="6626462" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-84a0c76 elementor-widget elementor-widget-heading" data-id="84a0c76" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h3 class="elementor-heading-title elementor-size-default">Actualización de la dirección enlazada a las interfaces de red</h3>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-4f311ec elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="4f311ec" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-985568a" data-id="985568a" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-cea0b72 elementor-widget elementor-widget-text-editor" data-id="cea0b72" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<ol>
<li>
<p>Mediante la administración por línea de comandos (<a href="https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.2/html-single/management_cli_guide/index" target="_blank" rel="noopener">JBoss CLI</a>) vamos a consultar la dirección enlazada a la interfaz pública (public: donde estarán disponibles las aplicaciones, puerto 8080 y 8443) para luego cambiarla por el nombre del servidor (server.example.com en este caso) o por su dirección IP:</p>
<p><code><br />$ jboss-cli.sh --connect<br />[standalone@localhost:9990 /] /interface=public:read-attribute(name=inet-address)<br /></code></p>
<p><img decoding="async" style="margin-left: 0px; margin-top: 0px;" src="https://lh3.googleusercontent.com/amSVm3J6_JGN8ibRMJ-Tk5OdF6H__4SJX6pZNCxWFEGC5RaRdffB4ePoYBOkytTd3YPlbh33fA0XfRw9oB1DUWaVzsPCm4E3nC2WM9V_Fy-3wJV5giHamFwEX8Zxm9pz4h0BgDPdoe3thFJjdQ" /></p>
<p><code><br />[standalone@localhost:9990 /] /interface=public:write-attribute(name=inet-address,value="${jboss.bind.address:server.example.com}")<br /></code></p>
<p><img decoding="async" style="margin-left: 0px; margin-top: 0px;" src="https://lh4.googleusercontent.com/utqXny4O2mFOvxJSTnsbvot9A_eVP81LusdJ3UALLkGJEPC0SExr1mWL0mx2X0bWcu5QqazpJ_7oUGty_8k2BwSnOeV1mULvAu7l6yPUWU1sg9AFvInsSx5KZtfHKhqo5QrliD9Kkpd59ND0rw" /></p>
</li>
<li>
<p>Realizamos algo similar pero con la interfaz de administración (management: servicio de administración, puerto 9990):</p>
<p><code><br />[standalone@localhost:9990 /] /interface=management:read-attribute(name=inet-address)<br /></code></p>
<p><img decoding="async" style="margin-left: 0px; margin-top: 0px;" src="https://lh4.googleusercontent.com/9gnxqQnzm_1gJNzE9czSwv4hrwcS6N7faXypirpfHljYK1ZwoethZq46RYiha0ASMeDpVMBWLEZZ7cxDKAukS3_gwjnxnkRarx9e4AeVqN_LW0lf2OqkDBFUXFKlXtf0up1ge7Of4bAbjI9o3w" /></p>
<p><code><br />[standalone@localhost:9990 /] /interface=management:write-attribute(name=inet-address,value="${jboss.bind.address.management:server.example.com}")<br /></code></p>
<p><img decoding="async" style="margin-left: 0px; margin-top: 0px;" src="https://lh5.googleusercontent.com/hs9zPonezmp9uKmMG1CwyKr5NI91U9-bFWM76Wpi9XvJ2QxRKKyWJcaktSK5DFEKAjmorxpwpcCODsIu5CZXASxlSnoO6kApWXP63Mp8gsth1Honly--tgs9wIsFzFKIPvkiWctL4-p6C-7O_g" /></p>
</li>
<li>
<p>Procedemos a recargar la configuración del servidor ya que los cambios anteriores requieren de un reinicio del servicio de JBoss EAP. Luego de esto, la sesión de JBoss CLI terminará debido a que ya no es válida por el cambio de la interfaz de administración:</p>
<p><code><br />[standalone@localhost:9990 /] reload<br />[disconnected /] exit<br /></code></p>
<p><img decoding="async" style="margin-left: 0px; margin-top: 0px;" src="https://lh6.googleusercontent.com/0OvdRZV7CEDFfiVrzRgi41C48a378TPb1XUzU67U70EDjFZVeZkRJe_RwZnmUGeJ9js3awWj7wgxYCpQd5yqsUmZ00VKk1mmjZguSGslQjYoAZdG_ADxyHVk6Szf_p3KlYbD3j1a1AWOAijUCA" width="401" /></p>
</li>
<li>
<p>Verificamos el cambio en la configuración de red utilizando nuevamente JBoss CLI, la conexión ahora debe indicar el nombre del controller de JBoss EAP (servidor y puerto) donde está el servicio de administración:</p>
<p><code><br />$ jboss-cli.sh --connect --controller=server.example.com:9990<br /><br />[standalone@server.example.com:9990 /] /interface=public:read-attribute(name=inet-address)<br /></code></p>
<p><img decoding="async" style="margin-left: 0px; margin-top: 0px;" src="https://lh3.googleusercontent.com/ybl4awCSj_6VJpvRMaecK8IdtPDeeXVpgygAFXsF9eUKJRXC0We8s4AnrnbtNLBtS0afB64BX2iiSDsRzYKmwWfmDldaTjbKLI2wKSPmqFKgam5JdHw-rDwi-V_3KcWqAU2IH6zlr8wRbhhE8A" /></p>
<p><code><br />[standalone@server.example.com:9990 /] /interface=management:read-attribute(name=inet-address)<br /></code></p>
<p><img decoding="async" style="margin-left: 0px; margin-top: 0px;" src="https://lh5.googleusercontent.com/Ge6xAn6-LwCa4obg1IBFYE8MRGu0YH0SBEx9ngWljR55OFbLdMRYyf-04R76L1NHsBInXFGVnh98vn7cxqcrZ6GE0HbEoEN52Q_AUvsrH9c7EEesjoJOO0MPuRimw6vdi4Rwky9ycsToopbr4g" /></p>
</li>
<li>
<p>Si el servidor Linux tiene levantado el servicio de Firewall será necesario abrir los puertos que utiliza JBoss, para el caso de CentOS 8 o Red Hat Enterprise Linux 8, como usuario root, se puede utilizar lo siguiente:</p>
<p><code><br />
# firewall-cmd --list-ports<br /># firewall-cmd --add-port 8080/tcp<br /># firewall-cmd --add-port 8443/tcp<br /># firewall-cmd --add-port 9990/tcp<br /># firewall-cmd --runtime-to-permanent<br /># firewall-cmd --list-ports<br /></code></p>
<p><img decoding="async" style="margin-left: 0px; margin-top: 0px;" src="https://lh4.googleusercontent.com/e3kd35FLMsASyjOHLTwVVKxOuoxpV4_mqkUjTKVABqGV-zycVYOZqFXPahJmBjt7yYtDf2H9PtMOOZC_jelJA0xgEMD1g_ayBXbs9xSOjuoPEKemCT241x_KFDMiVNDk-_348I6IecYYsdQ68Q" width="420" /></p>
</li>
<li>
<p>Finalmente probamos el acceso a los servicios desde un navegador Web:</p>
<ul>
<li>http://server.example.com:8080/</li>
<li>https://server.example.com:8443/</li>
<li>http://server.example.com:9990/</li>
</ul>
</li>
</ol>								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-3cbf526 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="3cbf526" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-65b7bc8" data-id="65b7bc8" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-61895b3 elementor-widget elementor-widget-heading" data-id="61895b3" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h2 class="elementor-heading-title elementor-size-default">Conclusiones</h2>				</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-8198e8f elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="8198e8f" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d1c6ee6" data-id="d1c6ee6" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-69dc084 elementor-widget elementor-widget-text-editor" data-id="69dc084" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p><span style="font-weight: 400;">JBoss Enterprise Application Platform trae por defecto una configuración que es suficiente para un ambiente de desarrollo pero va a ser necesario aplicar ajustes como los que hemos visto en este artículo para poder hacer uso de sus servicios en escenarios más demandantes.</span></p>
<p><span style="font-weight: 400;">Les hacemos la invitación a estar atentos ya que en próximas entregas cubriremos otras áreas de la administración y configuración del producto. Hasta entonces.</span></p>								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://softwareevolutivo.com.ec/jboss-eap-instalacion-y-configuracion-basica/">JBoss EAP: Instalación y configuración básica</a> appeared first on <a href="https://softwareevolutivo.com.ec">Software Evolutivo</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://softwareevolutivo.com.ec/jboss-eap-instalacion-y-configuracion-basica/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SonarQube, código limpio y libre de errores, despreocúpate!</title>
		<link>https://softwareevolutivo.com.ec/sonarqube-codigo-limpio-y-libre-de-errores-despreocupate/</link>
					<comments>https://softwareevolutivo.com.ec/sonarqube-codigo-limpio-y-libre-de-errores-despreocupate/#respond</comments>
		
		<dc:creator><![CDATA[Johannes Caranqui]]></dc:creator>
		<pubDate>Mon, 16 Sep 2019 15:00:03 +0000</pubDate>
				<category><![CDATA[Desarrollo de Software]]></category>
		<category><![CDATA[Pruebas]]></category>
		<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[Tendencias]]></category>
		<category><![CDATA[Clean Code]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Sonar]]></category>
		<guid isPermaLink="false">https://softwareevolutivo.com.ec/?p=650</guid>

					<description><![CDATA[<p>¿Que es SonarQube? También conocido como “Sonar”, es una herramienta desarrollada en Java (de código abierto) para revisión de código, detección de errores y vulnerabilidades permitiendo al equipo de desarrollo gestionar, hacer seguimiento y mejorar la calidad de su código fuente.</p>
<p>The post <a href="https://softwareevolutivo.com.ec/sonarqube-codigo-limpio-y-libre-de-errores-despreocupate/">SonarQube, código limpio y libre de errores, despreocúpate!</a> appeared first on <a href="https://softwareevolutivo.com.ec">Software Evolutivo</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="650" class="elementor elementor-650">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-6c9333eb elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="6c9333eb" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-430c9740" data-id="430c9740" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-33455355 elementor-widget elementor-widget-text-editor" data-id="33455355" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p></p>
<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" src="https://softwareevolutivo.com.ec/wp-content/uploads/2019/09/image1-1.png" alt="" class="wp-image-651"></figure>
</div>
<p></p>
<p></p>
<p><strong>¿Que es SonarQube?</strong><br></p>
<p></p>
<p></p>
<p>También conocido como “Sonar”, es una herramienta desarrollada en Java (de código abierto) para revisión de código, detección de errores y vulnerabilidades permitiendo al equipo de desarrollo gestionar, hacer seguimiento y mejorar la calidad de su código fuente.<br></p>
<p></p>
<p></p>
<p>Se debe tener claro que NO solo funciona para Java, NO necesariamente necesita de Maven y se puede integrar con muchos de los más populares IDE’s.</p>
<p></p>
<p></p>
<blockquote style="text-align:center" class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><em>¨Siempre escribe tu código como si la persona que va a terminar manteniéndolo fuera un psicópata violento que sabe donde vives</em>¨</p>
</blockquote>
<p></p>
<p></p>
<p><strong>¿Porque elegir Sonar?</strong></p>
<p></p>
<p></p>
<figure class="wp-block-image"><img decoding="async" src="https://softwareevolutivo.com.ec/wp-content/uploads/2019/09/image2-1.png" alt="" class="wp-image-653"></figure>
<p></p>
<p></p>
<p>No solo por ser eficiente al momento de escribir código, sino también porque las reglas de revisión son actualizadas constantemente por la comunidad. Existe más de 400 reglas sólo en Java, más de 200 reglas para Python, cantidades que aumentan con el pasar del tiempo.<br></p>
<p></p>
<p></p>
<p>Sonar además de ofrecer su propio motor de análisis estático permite integrarlo con otras herramientas como <strong>Checkstyle</strong>, <strong>PMD</strong> o <strong>FindBugs</strong>, el beneficio es que permite obtener de forma homogénea y agrupada todas las evidencias detectadas por éstas herramientas.</p>
<p></p>
<p></p>
<blockquote style="text-align:center" class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>¨<em>Todo integrado en un único cuadro de mandos</em>¨</p>
</blockquote>
<p></p>
<p></p>
<p>La principal “desventaja” es el mantenimiento de código, al ser más costoso, también se invierte más tiempo, así como producir “falsos positivos”.<br></p>
<p></p>
<p></p>
<p><strong>¿Sonar modifica mi código?</strong><br></p>
<p></p>
<p></p>
<p>Claramente NO, Sonar nunca modifica una sola línea de código, lo que sí puede hacer es revisar el código comparándolo con ciertas convenciones mundiales de “Clean Code”.</p>
<p></p>
<p></p>
<p>Un aspecto importante es que NO solo nos indica en que linea se encuentra el potencial bug,&nbsp; warning sino que nos sugiere el “cómo” debería ser escrito nuestro código.<br></p>
<p></p>
<p></p>
<p><strong>Lenguajes soportados en Sonar</strong><br></p>
<p></p>
<p></p>
<p>Por defecto en la versión “Community” se puede analizar los lenguajes más populares de hoy en día, Java, C#, JavaScript, PHP, Python, COBOL, VB.NET, Objective-C, XML, entre otros.<br></p>
<p></p>
<p></p>
<p><strong>Mi primer análisis con SonarQube</strong><br></p>
<p></p>
<p></p>
<p>Sonar brinda la posibilidad de analizar nuestro proyecto en <a href="https://sonarcloud.io">https://sonarcloud.io</a> de manera gratuita hasta cierto número de líneas de código abierto, ingrese al link mencionado para revisar costos y beneficios.<br></p>
<p></p>
<p></p>
<p>Si eres usuario de VSCode, te encantará esta herramienta “Sonar Lint”, su repositorio oficial <a href="https://github.com/SonarSource/sonarlint-vscode">https://github.com/SonarSource/sonarlint-vscode</a><br></p>
<p></p>
<p></p>
<p>Todo el proceso de instalación y análisis se encuentra en&nbsp; <a href="https://www.sonarqube.org/">https://www.sonarqube.org/</a></p>
<p></p>
<p></p>
<p>Nuevas novedades, issues y eventos en <a href="https://blog.sonarsource.com/">https://blog.sonarsource.com/</a></p>
<p></p>
<p><br>
<!-- /wp:shortcode --></p>								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://softwareevolutivo.com.ec/sonarqube-codigo-limpio-y-libre-de-errores-despreocupate/">SonarQube, código limpio y libre de errores, despreocúpate!</a> appeared first on <a href="https://softwareevolutivo.com.ec">Software Evolutivo</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://softwareevolutivo.com.ec/sonarqube-codigo-limpio-y-libre-de-errores-despreocupate/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[:es]Desarrollo de aplicaciones Web con Spring Boot[:]</title>
		<link>https://softwareevolutivo.com.ec/espanol-desarrollo-de-aplicaciones-web-con-spring-boot/</link>
					<comments>https://softwareevolutivo.com.ec/espanol-desarrollo-de-aplicaciones-web-con-spring-boot/#respond</comments>
		
		<dc:creator><![CDATA[Jorge Aguilar]]></dc:creator>
		<pubDate>Mon, 14 Aug 2017 13:57:44 +0000</pubDate>
				<category><![CDATA[Desarrollo de Software]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[springboot]]></category>
		<guid isPermaLink="false">https://softwareevolutivo.com.ec/?p=201</guid>

					<description><![CDATA[<p>Según el sitio oficial del proyecto, se puede definir Spring Boot de la siguiente manera: «Es una solución para crear aplicaciones basadas en Spring de una manera rápida, autónoma y con características deseables para producción». Al momento, resulta de mucho interés contar con herramientas que apoyen al desarrollo rápido de aplicaciones. Y ésta es la</p>
<p>The post <a href="https://softwareevolutivo.com.ec/espanol-desarrollo-de-aplicaciones-web-con-spring-boot/">[:es]Desarrollo de aplicaciones Web con Spring Boot[:]</a> appeared first on <a href="https://softwareevolutivo.com.ec">Software Evolutivo</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="201" class="elementor elementor-201">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-522bf39f elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="522bf39f" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1913959f" data-id="1913959f" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-1df6ecf7 elementor-widget elementor-widget-text-editor" data-id="1df6ecf7" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p>[:es]<img decoding="async" class="size-medium aligncenter" src="http://assets.spring.io/wp/wp-content/uploads/2013/08/spring.png" width="379" height="369">Según el sitio oficial del proyecto, se puede definir <a href="https://projects.spring.io/spring-boot/" target="_blank" rel="noopener noreferrer">Spring Boot</a> de la siguiente manera: &#8220;Es una solución para crear aplicaciones basadas en Spring de una manera rápida, autónoma y con características deseables para producción&#8221;.</p>
<p>Al momento, resulta de mucho interés contar con herramientas que apoyen al desarrollo rápido de aplicaciones. Y ésta es la motivación principal para presentar esta primera entrada sobre el tema.</p>
<p>Entre las principales características de Spring Boot se encuentran:</p>
<ul>
<li>Contenedores Java embebidos: Tomcat o Jetty</li>
<li>Soporte para la automatización con Maven y Gradle</li>
<li>Configuración sugerida para iniciar rápidamente con un proyecto (Starters)</li>
<li>Configura automáticamente Spring, cuando sea posible</li>
<li>Características listas para producción: métricas, seguridad, verificación del estatus, externalización de configuración, etc.</li>
<li>No genera código y no requiere configuración XML</li>
</ul>
<h3>Alcance</h3>
<p>En este proyecto se creará un servicio <a href="https://en.wikipedia.org/wiki/Representational_state_transfer" target="_blank" rel="noopener noreferrer">REST</a> de consulta de productos que retorne la respuesta en formato <a href="https://en.wikipedia.org/wiki/JSON" target="_blank" rel="noopener noreferrer">JSON</a> utilizando <a href="https://maven.apache.org/" target="_blank" rel="noopener noreferrer">Maven</a> como herramienta de automatización de tareas.</p>
<h3>Herramientas Utilizadas</h3>
<p>Se requieren instaladas y disponibles las siguientes herramientas:</p>
<ul>
<li>Java 8</li>
<li>Maven 3.2 o superior</li>
</ul>
<h3>Procedimiento</h3>
<p>A continuación se detallan los pasos a seguir para conseguir el objetivo planteado. Si se desea acceder al <b>proyecto terminado</b>, ya sea para ejecutarlo directamente o para resolver alguna duda, éste está disponible en:</p>
<p><a href="https://github.com/softwareevolutivo/springboot-gs" target="_blank" rel="noopener noreferrer">https://github.com/softwareevolutivo/springboot-gs</a></p>
<h4>1. Configuración inicial del proyecto utilizando Maven</h4>
<p>Lo primero que se deberá realizar es crear el <strong>directorio del proyecto</strong>. En este caso se lo ha nombrado <b>springboot-gs</b>.<br>Dentro de este directorio crear el archivo POM (pom.xml) inicial, el cual deberá tener la siguiente definición.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;

    &lt;groupId&gt;ec.com.softwareevolutivo.demos&lt;/groupId&gt;
    &lt;artifactId&gt;springbootgs&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;springbootgs&lt;/name&gt;
    &lt;description&gt;Spring Boot Getting Started&lt;/description&gt;

    &lt;parent&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
        &lt;version&gt;1.5.2.RELEASE&lt;/version&gt;
    &lt;/parent&gt;

&lt;/project&gt;</pre>
<p>En este primer paso se ha creado la relación de nuestro proyecto con el proyecto padre <b>spring-boot-starter-parent</b> utilizando la versión <b>1.5.2.RELEASE</b>. Esta simple definición permite a nuestro proyecto hacer ya uso de algunas funcionalidades de <strong>Spring Boot</strong>.</p>
<p>Estos grupos de funcionalidades son denominados <b>Starters</b>, más adelante se incorporará al proyecto un Starter adicional.</p>
<p>Para validar que todo está correctamente configurado ejecutamos un primer empaquetado utilizando Maven dentro del directorio del proyecto:</p>
<p><code>mvn package</code></p>
<p>El resultado de esta ejecución será la creación del directorio <b>target</b>, el cual deberá contener el archivo empaquetado del proyecto: <b>springboot-gs-0.0.1-SNAPSHOT.jar</b></p>
<p>Para finalizar esta primera parte, procederemos a consultar las dependencias con las que cuenta el proyecto:</p>
<p><code>mvn dependency:tree</code></p>
<p>En la salida de este comando no se verá ninguna dependencia relacionado al proyecto:</p>
<p><code>...<br>[INFO]<br>[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ springbootgs ---<br>[INFO] ec.com.softwareevolutivo.demos:springbootgs:jar:0.0.1-SNAPSHOT<br>[INFO] ------------------------------------------------------------------------<br>[INFO] BUILD SUCCESS<br>...</code></p>
<h4>2. Dependencia Web</h4>
<p>Como el objetivo de esta demo incluye la creación de un servicio REST será necesario incorporar las dependencias Web de Spring. Esto se lo consigue adicionando al archivo POM el Starter respectivo, en este caso <b>spring-boot-starter-web</b> después de la sección <strong>parent</strong>.<b><br></b></p>
<pre class="EnlighterJSRAW" data-enlighter-language="xml">    ...
    &lt;/parent&gt;

    &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;

&lt;/project&gt;</pre>
<p>Ejecutamos nuevamente la consulta de dependencias del proyecto:</p>
<p><code class="prettyprint lang-sh" data-start-line="1" data-visibility="visible" data-highlight="" data-caption="">mvn dependency:tree</code></p>
<p>Y en esta ocasión ya podremos ver las dependencias incorporadas al proyecto por medio del <strong>Starter Web</strong>. Es importante resaltar el hecho de que las versiones de las librerías incorporadas por el Starter son resueltas de manera automática.<br><code><br>...<br>[INFO]<br>[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ springbootgs ---<br>[INFO] ec.com.softwareevolutivo.demos:springbootgs:jar:0.0.1-SNAPSHOT<br>[INFO] \- org.springframework.boot:spring-boot-starter-web:jar:1.5.2.RELEASE:compile<br>[INFO]    +- org.springframework.boot:spring-boot-starter:jar:1.5.2.RELEASE:compile<br>[INFO]    |  +- org.springframework.boot:spring-boot:jar:1.5.2.RELEASE:compile<br>[INFO]    |  +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.2.RELEASE:compile<br>[INFO]    |  +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.2.RELEASE:compile<br>[INFO]    |  |  +- ch.qos.logback:logback-classic:jar:1.1.11:compile<br>[INFO]    |  |  |  +- ch.qos.logback:logback-core:jar:1.1.11:compile<br>[INFO]    |  |  |  \- org.slf4j:slf4j-api:jar:1.7.24:compile<br>[INFO]    |  |  +- org.slf4j:jcl-over-slf4j:jar:1.7.24:compile<br>[INFO]    |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.24:compile<br>[INFO]    |  |  \- org.slf4j:log4j-over-slf4j:jar:1.7.24:compile<br>[INFO]    |  +- org.springframework:spring-core:jar:4.3.7.RELEASE:compile<br>[INFO]    |  \- org.yaml:snakeyaml:jar:1.17:runtime<br>[INFO]    +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.2.RELEASE:compile<br>[INFO]    |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.11:compile<br>[INFO]    |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.11:compile<br>[INFO]    |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.11:compile<br>[INFO]    +- org.hibernate:hibernate-validator:jar:5.3.4.Final:compile<br>[INFO]    |  +- javax.validation:validation-api:jar:1.1.0.Final:compile<br>[INFO]    |  +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile<br>[INFO]    |  \- com.fasterxml:classmate:jar:1.3.3:compile<br>[INFO]    +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.7:compile<br>[INFO]    |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile<br>[INFO]    |  \- com.fasterxml.jackson.core:jackson-core:jar:2.8.7:compile<br>[INFO]    +- org.springframework:spring-web:jar:4.3.7.RELEASE:compile<br>[INFO]    |  +- org.springframework:spring-aop:jar:4.3.7.RELEASE:compile<br>[INFO]    |  +- org.springframework:spring-beans:jar:4.3.7.RELEASE:compile<br>[INFO]    |  \- org.springframework:spring-context:jar:4.3.7.RELEASE:compile<br>[INFO]    \- org.springframework:spring-webmvc:jar:4.3.7.RELEASE:compile<br>[INFO]       \- org.springframework:spring-expression:jar:4.3.7.RELEASE:compile<br>[INFO] ------------------------------------------------------------------------<br>[INFO] BUILD SUCCESS<br></code></p>
<h4>3. La aplicación Spring Boot</h4>
<p>Para que la aplicación <strong>Spring Boot</strong> pueda ejecutarse desde la línea de comandos, se requiere la definición del conocido método <b>main</b>. Este método será utilizado por Spring Boot para iniciar la aplicación. Esto es esencial para que la aplicación se ejecute en modo stand-alone.</p>
<p>Esto se lo puede realizar creando una clase (<b>Application</b> en este caso) que implemente este método y que haga la llamada al método <b>run</b> de la clase <b>SpringApplication</b>.</p>
<p>Por convención, todas las clases Java deberán estar almacenadas en el directorio <b>src/main/java</b> dentro del directorio del proyecto. Hay que recordar que este archivo también debe residir dentro de un directorio correspondiente al paquete, en este caso <strong><span class="">ec/</span><span class="me0">com/</span><span class="me0">softwareevolutivo/</span><span class="me0">demos/</span><span class="me0">springbootgs</span></strong></p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">package ec.com.softwareevolutivo.demos.springbootgs;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
    
}</pre>
<p>En este punto ya se podrá ejecutar la aplicación a través de Maven desde el directorio principal del proyecto:</p>
<p><code>mvn spring-boot:run</code></p>
<p>Esta ejecución levanta un servidor Web que escucha en el puerto por defecto <strong>8080</strong>. Se lo puede detener utilizando la combinación de teclas <strong>Control + C</strong>.</p>
<h4>4. Clase del dominio</h4>
<p>La clase <b>Product</b> será utilizada como parte del dominio del tipo <a href="https://en.wikipedia.org/wiki/Data_transfer_object" target="_blank" rel="noopener noreferrer">DTO</a> y tendrá la información correspondiente a cada producto de la lista que se desea retornar.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">package ec.com.softwareevolutivo.demos.springbootgs.domain.dto;

public class Product {

    private Long id;
    private String name;
    private double price;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

}</pre>
<h4>5. Servicio REST</h4>
<p>En este punto se procederá a crear el servicio REST que retornará la lista de productos en formato JSON. La clase <b>ProductRest</b> será utilizada para retornar la lista de productos.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="java">package ec.com.softwareevolutivo.demos.springbootgs.web.rest;

import java.util.ArrayList;
import java.util.List;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import ec.com.softwareevolutivo.demos.springbootgs.domain.dto.Product;

@RestController
@RequestMapping("/api")
public class ProductRest {

      @GetMapping("/products")
      public List&lt;Product&gt; getAllProducts() {
        
          List&lt;Product&gt; productList = new ArrayList&lt;Product&gt;();
          
          Product product1 = new Product();
          product1.setId(1L);
          product1.setName("Product 1");
          product1.setPrice(22.99);
          productList.add(product1);
          
          Product product2 = new Product();
          product2.setId(2L);
          product2.setName("Product 2");
          product2.setPrice(3.49);
          productList.add(product2);
          
          return productList;
          
      }
}</pre>
<p>Las anotaciones <b>@RestController</b>, <b>@RequestMapping</b> y <b>@GetMapping</b> pertenecen a Spring Web MVC y son utilizadas para crear el servicio REST.</p>
<p>Ejecutar nuevamente la aplicación y validar que el servicio REST esté operativo:</p>
<p><code>mvn spring-boot:run</code></p>
<p>Según lo establecido en la clase <b>ProductRest</b> parte del URL para acceder al servicio REST sería <strong>api/products</strong> y en este caso el servicio estaría disponible en <a href="http://localhost:8080/api/products" target="_blank" rel="noopener noreferrer">http://localhost:8080/api/products</a>.</p>
<p>Utilizando un navegador Web se podrá ver la respuesta del servicio REST:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="json">[
   {
      "id": 1
      "name": "Product 1",
      "price": 22.99
   },
   {
      "id": 1,
      "name": "Product 2",
      "price": 3.49
   }
]</pre>
<h4>6. Crear el ejecutable</h4>
<p>Para facilitar la transferencia de la aplicación en un solo empaquetado se puede convertir el archivo empaquetado <b>jar</b> en ejecutable. Esto se lo realiza por medio del plugin <b>spring-boot-maven-plugin</b>, el cual deberá ser adicionado a la configuración de maven.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="xml">    ...
    &lt;/dependencies&gt;

    &lt;build&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
    &lt;/build&gt;

&lt;/project&gt;</pre>
<p>Como ya se lo hizo inicialmente, proceder con creación del empaquetado:</p>
<p><code>mvn package</code></p>
<p>En el directorio <b>target</b> deberán existir dos archivos empaquetados del proyecto:</p>
<ul>
<li>El archivo <b>springbootgs-0.0.1-SNAPSHOT.jar.original</b> solamente contiene las clases creadas para el proyecto y un par de archivos de metadata.</li>
<li>Por otro lado, el archivo <b>springbootgs-0.0.1-SNAPSHOT.jar</b>, de mayor tamaño, incluye todas las dependencias requeridas para ejecutar la aplicación en modo stand-alone.</li>
</ul>
<p>La ejecución de la aplicación <strong>stand-alone</strong> se la puede realizar utilizando Java Standard Edition (SE):</p>
<p><code>java -jar target/springboot-gs-0.0.1-SNAPSHOT.jar</code></p>
<h3>Resumen y conclusiones</h3>
<ul>
<li>Utilizando soluciones como <strong>Spring Boot</strong> se podría reducir considerablemente el tiempo de desarrollo de aplicaciones Web con servicios REST.</li>
<li>Spring Boot ha tenido un crecimiento importante en los últimos años. Generadores como <a href="https://jhipster.github.io/">JHipster</a> la están usando ampliamente.</li>
<li>En esta entrega se ha presentado Spring Boot de tal manera que el lector pueda empezar en su uso. En próximas entregas se podrá tratar otras de las ventajas que presenta la herramienta.</li>
</ul>
<h3>Referencias</h3>
<ul>
<li><a href="https://spring.io/guides/gs/spring-boot/" target="_blank" rel="noopener noreferrer">https://spring.io/guides/gs/spring-boot/</a></li>
<li><a href="https://spring.io/guides/gs/rest-service/" target="_blank" rel="noopener noreferrer">https://spring.io/guides/gs/rest-service/</a></li>
<li><a href="http://docs.spring.io/spring-boot/docs/1.5.2.RELEASE/reference/htmlsingle/" target="_blank" rel="noopener noreferrer">http://docs.spring.io/spring-boot/docs/1.5.2.RELEASE/reference/htmlsingle/</a></li>
</ul>
<p>En el caso de presentarse dudas, comentarios, erratas 🙂 los animamos a comentar. Recordar que también se puede compartir esta entrada por las redes sociales.[:]</p>
<p></p>								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://softwareevolutivo.com.ec/espanol-desarrollo-de-aplicaciones-web-con-spring-boot/">[:es]Desarrollo de aplicaciones Web con Spring Boot[:]</a> appeared first on <a href="https://softwareevolutivo.com.ec">Software Evolutivo</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://softwareevolutivo.com.ec/espanol-desarrollo-de-aplicaciones-web-con-spring-boot/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
