Kohei Nozaki's blog 

Exploded deployment for WildFly on development


Posted on Tuesday Jan 20, 2015 at 07:25PM in Technology


I used archive deployment for long time on development because of this problem: http://stackoverflow.com/questions/24725644/intellij-idea-artifact-xxxxwar-exploded-has-invalid-extension

Archive deployment needs redeploy for reflect updates of every resource even if I updated only static content such as html, css, xhtml and jsp. it’s very annoying but finally I found a solution to use exploded deployment with WildFly and IntelliJ IDEA for WAR application so I leave some notes about it. my environment is WildFly 8.2.0.Final and IntelliJ IDEA 14.0.2.

First, specify webappDirectory which ended with .war to pom.xml in your project so that make WildFly to stop complaining that there’s no suffix to application directory.

<plugin>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.4</version>
    <configuration>
        <webappDirectory>${project.build.directory}/exploded/${project.build.finalName}.war</webappDirectory>
    </configuration>
</plugin>

According to https://youtrack.jetbrains.com/issue/IDEA-86484, this should be worked for EAR deployments:

<workDirectory>${project.build.directory}/myapp.ear</workDirectory>

Set following attributes to WildFly with jboss-cli for JSP hot-deployment:

/subsystem=undertow/servlet-container=default/setting=jsp:write-attribute(name=development, value=true)
/subsystem=undertow/servlet-container=default/setting=jsp:write-attribute(name=check-interval, value=1)
/subsystem=undertow/servlet-container=default/setting=jsp:write-attribute(name=modification-test-interval, value=1)
/subsystem=undertow/servlet-container=default/setting=jsp:write-attribute(name=recompile-on-fail, value=true)
:reload

Set following parameters to web.xml for JSF(XHTML) hot-deployment:

<context-param>
    <param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name>
    <param-value>0</param-value>
</context-param>
<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>

REFRESH_PERIOD should be 2 (default) or something for production environment (filtering with maven might help). also it’s better to specify PROJECT_STAGE in JNDI.

Then configure your IDE.

for IntelliJ IDEA

  1. Click the empty drop down list on upper right then select Edit Configurations…​

    84aac7bd fd1b 4157 b840 3d2aacaf7f6b
  2. Click "+" button on upper left then select JBoss Server ⇒ Local

    74253f62 b95c 4a4d 8b00 72deac5a570b
  3. Click "Fix" on the lower right then select an artifact which ended with "exploded"

    fc2afc60 995d 4668 8840 9c3b241dd5a7
  4. Back to server tab and select desirable actions. I prefer "Update resources" for On frame deactivation because it enables that I can check modified JSP/XHTMLs with just press Command+Tab to switch to browser and reload immediately. I can trigger redeploy by hand with Command+F10 shortcut when I update some classes.

    1ff45e5f ec93 4a4c a379 7bf73ff1b138
  5. Now you can launch WildFly with the button on the upper right.

    0a5a41bc 98a8 45ab b08a db3e31e725d8

Refer http://jrebel.com for hot deployment of classes. it also offers free https://my.jrebel.com for personal, non-commercial use.


Progress of reading #packt5dollar


Posted on Monday Jan 19, 2015 at 08:48PM in Technology


I bought iPad Air 2 for reading eBooks that bought at #packt5dollar sale. it gave me better experience for eBooks reading than my MacBook Pro Retina 15". I prefer epub than PDF because epub can adjust font size freely and I like continuous scroll mode in iBooks. PDF is well-layouted but some of PDF has wider margin at around the content and fonts are too small still.

I finished these books:

  • WildFly Configuration, Deployment, and Administration - Second Edition

    Description about deployment mechanism was good for me because I did’t know how to deploy applications as exploded. the book has many description for large scale use case such as domain, clustering and load-balancing but that doesn’t make sense for me much because I used WildFly in standalone. also sections of detailed configuration are good, especially a section about web container Undertow. I would look back this book as a reference sometimes later.

  • Responsive Web Design with HTML5 and CSS3

    I’m terrible at client side web technology but the book doesn’t demand much background knowledge so I think I understand most. my knowledge level is something like that I can barely create typical multi-column website which fixed width and non responsive with struggling. I learned such things: how responsive design and fluid layout are important, and basic of HTML5/CSS3 (including media queries) and how to apply polyfill to these latest specs for older web browsers such as IE 6/7/8. at first, I would make my blog to responsive for practice.


Multiple deployment use mode is implemented to jberetweb


Posted on Thursday Jan 15, 2015 at 09:06PM in jberetweb


Now jberetweb can operate (start, stop, etc) distributed batches in multiple deployment. to enable multiple deployment use mode, suppress -DjobOperator.jndi and specify -DjobOperator.name=${facade-class-name} (e.g. JobOperatorFacade) in mvn option when you build it.

In multiple deployment use mode, "App Name" column will be added for grasp where is deployment of each job comprehensively. actions such as restart, stop will be executed through lookup of appropriate remote EJB interface in according to "App Name".

8eb794ca c389 4590 bc0a 643507e66c3a

Also in Start Job window, "App Name" can be specified. this will lookup appropriate remote interface accordingly too.

905367a9 1944 4025 bf2c 0623571313b0


Review of Apache Roller 4.0 Beginner's Guide


Posted on Wednesday Jan 14, 2015 at 11:53PM in Technology


The book seems little obsolete because it was published on 2009 and intended to use with version 4.0. but most part of the book makes sense to me because major features of Roller are unchanged till current version 5.1.1.

A instruction about weblog itself is interested and fun to read. the book has many step-by-step instruction about its function and it's very easy to read. especially, instruction of creating a new template from scratch was good for me. some contents are obsoleted surely but I can recommend this book for beginners of Roller.

But maybe you should read the official documents first than buy this book. official document can be obtained from here as PDF or ODT.

NOTE: an additional Section 9, which is not included the book and the book claims that it can be downloaded via packtpub.com but the URL returns 404 now. the support desk send me PDF after I sent an email to ask how can I get section 9. they said the link got updated after renewal of their web site. it needs to add /sites/default/ as prefix of the path now.


Roller Asciidoctorj Plugin


Posted on Tuesday Jan 13, 2015 at 09:54PM in Technology


I don’t know about Asciidoc very well yet but it works fine anyway so I pushed it to GitHub, and this is the first post with that plugin. I’ve never tried it on except WildFly yet, but it would work with Tomcat or any other application servers. report on various application server or any feedback are welcome.

Distribution, installation instruction and more can be found at: https://github.com/lbtc-xxx/roller-asciidoctorj-plugin

Information about Asciidoctorj can be found at: http://asciidoctor.org/docs/asciidoctorj/