Posts filed under ‘Uncategorized’

Seam 3 – What’s going on

Hi all!

I’ve been blogging about Seam and specially Seam 3 since a few months ago. Recently, new [and big] changes were proposed and commented at IRC channels and at this post (by Shane).

Well, I really didn’t have time to absorb everything, but I’m writing this post to report some thoughts from Seam user’s community who have showed me their opinions.


Seam 3 – The Good points

Seam 3 is pretty different from Seam 2. First, the idea of MODULE is pretty awesome, it allows flexibility, freedom for developing new ideas, Maven integration (yes, was pretty hard with Seam 2); also allows new contributors have more space for implementing their ideas and so on.

Seam 3 – the main problems

I’ve been saying this since I started using Seam 3 – it has several problems. There are few examples (and the existing ones are too simple – and part of that is my fault, I really should have published more posts and tutorials), there are no books about it. Another big problem – Seam is not that simple to use – you need a big skill set to start (JEE – CDI, JSF; Maven; controlling an app server and so on); it’s not like Rails (even if you don’t know Ruby or Active record pattern, or MVC, it IS possible to get something working with Rails, even if your code gets really bad). This not happens to Seam.

Another problem reported by community – what’s Seam goal? I mean, look at Hibernate – it has a main propose – ORM. And Seam 3? Is it CDI? People ask me “Ok, I like Seam 3 modules, but what’s the main goal? For example, I use Seam Social module, but is it really related to CDI?”

These problems have created an awkward situation for developers. Lots of ppl don’t feel comfortable to adopt Seam 3 for production; this scenery¬† prints an image of unstable or immature framework, which I can say that is completely FALSE. Seam 3 has lots of nice features and solves several problems in an easy way. Unfortunately, I think it’s pretty hard to use; so it scares new JEE users.

Seam 3 – the new proposals

In Shane’s words, due to Seam 3 focus problem – “instead of Seam trying to capture all of the CDI extensions in one place, like Pokemon, we should be trying to propagate them throughout the greater developer community instead.” – and them were presented some changes, like moving Seam persistence, REST and faces modules to other Jboss projects.

Well, community showed their concerns about it (sending me some emails and tweets). Next, a little summary about what ppl said: (ATTENTION – THIS IS NOT MY PERSONAL OPINION)
1. Why did the guys decided it? It was a big change from Seam 2 to 3, and community is not ready for a change like that yet.
2. Ppl don’t believe in compatibility. Some developers already have Seam 3 in production systems and they are really worried about it.
4. “HIBERNATE??” – same guy above
5. “bad shot. The impression that I get is that you are tired of Seam, module leaders are disperse and you are giving up of the project, fitting it into other JBos products”
6. “Seam is gonna die. ok, I’ll start my new project with PlayFMK”
7. “Come on, Red hat should hire more ppl to work with Seam and to write more docs for it, instead killing the project” .
8. “F2F == RIP Seam”
9. Modules created in a not centralized environment, so this generates communication problems and it gets difficult for creating documentation and examples.
10. “WTF??” – Seam new users and ppl that are not directly involved with community contributors or IRC channels.

In my opinion, Seam 3 has some problems (that deserve their own post), but I see good and bad things with the new changes. First, I just think that this approach caused wrong impressions, leading ppl to think the project will die or everyone lost the interest for keeping the project.
I really don’t think Shane, Dan, Pmuir (Pete), Lightguard (Jason), Gastaldi or Lincoln would abort Seam, I mean, I see these guys at IRC channels and I see their passion for the project.
But be careful – how many Open Source projects have you seen that died suddenly? There are lots of dead projects, specially at Ruby Community. Death reasons – LOST their focus, got too complex, few documentation, absence of new features. Unfortunately, Seam 3 has some common problems.
Maybe these new proposed changes help to change this situation, focusing on CDI implementations and joining some correlated modules. But IMHO, it would also weaken Seam identity by merging some parts of it with other projects. I really don’t have a clear idea about the final effects – as I said, there are good and bad parts.


– Seam is not gonna die.
– Everyone who talked to me got a bad impression about these changes. It clearly wasn’t a good approach.
– These changes have good and bad points.
– Seam 3 need more focus and solid examples.

Seam 3 has an absurd potential and more, wonderful contributors building the framework. The only thing I’d like to ask – no panic. Community, keep using Seam 3! It IS nice and powerful. Contributors – that was not the best approach, but move on and keep showing your passion and tech skills by taking care of the framework.

I feel responsible too, I’ll try to do my best to help with examples and tutorials.

I’ll keep blogging about Seam ūüôā

Feel free to contact me if you have doubts ūüôā



Due to the all this misunderstood, feeling hurts, opposite opinions, doubts and so on, there’s a new post from Shane trying to explain the situation in a better way. As you can see, there’s a thread at Jboss Foum where you can show your opinion about it. Would be nice if you take a few minutes to read, understand the situation and write what you think.

Also, @antoine_sd blogged about it here – very nice post.



September 28, 2011 at 9:07 pm 5 comments

The call4all app – Call 4 papers app – Seam 3 example

[Note РBefore reading this tutorial, would be nice if you read this post before РIt tells you that these Seam posts are under incremental builds and are modified everyday]

Henry is a Computer Science student and he is also an Open Source enthusiastic. He decided to share his knowledge by speaking into some conferences.

Henry checks the Confbuzz app to see the dates of the conferences, and he finds out that there are lots of conferences he would like to speak at. All of them have their our own Call4Papers/talk submission process.

“Crap! I have to copy-paste lots of information…. Bio, email, phone number, Twitter, Facebook… And wth, some of these sites are horrible…. All these technical conferences should have a unified submission process…. would save me lots of time and would ensure that the talk submission process is friendly…. Wait a minute…”

So probably you and Henry got a perfect idea. Create a Call4Papers website example.

But Henry decided he would like to do more. “I’ll talk about it into a conference!”.

Henry started studying Seam 3 few weeks ago and he thinks he’s able to create de Call4All app using it. He starts to fill the form:

So let’s help Henry to create his app. He is a Maven lover, so he prefers to create the app without using Seam Forge. *(check this post for more information about creating a Seam 3 project, with or without Seam Forge)

Creating the project

Henry opens his Eclipse Indigo and install JBoss Tools *. Also he decided to use JBoss AS 7 as it is his favorite Application Server (in fact Henry is in love with that, he still cannot believe AS7 starts in less than 3 seconds). He creates a new Maven project, fills artifactId, groupId, version and package info about the project. Then, he just adds Seam dependencies, getting a pom.xml like this.

So let’s take an overview about these Maven dependencies: [Note: If you are a Maven beginner, you might skip this session and just truste me that this pom.xml really works. Otherwise, if you are ok with maven, take a look at this brief explanation]

< properties >  stuff helps us to control some dependencies version.

< dependencyManagement >  is used to import Seam and RichFaces dependencies.

Then, we add Seam modules (the ones whose groupId is org.jboss.seam ), joda time, prettyfaces (required dependencies for some modules) , richfaces, and adjust some other dependencies (like hibernate validator, we must exclude it from seam-validation and add another version for that, otherwise we will have some trouble with AS 7.

Then Henry runs a mvn clean install – and TA-DA! BUILD SUCCESSFUL!

Maybe you have some questions like “WTH is…. Arquillian?” Take a look here. [I’m also writing a short tutorial about it].

*current version for Indigo – 3.3.0 M2

So what’s next? Henry thinks about the Call4All app… “When i access this webpage, I want to login, auto-fill my personal data and just type the talk title and a brief description. I will forget about page layout for while, and just live h:”.

Good way to start. “But also” – thinks Henry – “I want that conferences may be able to register and access the call4all app via Rest… and then get the proposals, reports and statistics about submission themes, speakers profiles… And oh, would be nice integrate it to Twitter, so as soon as you submit a proposal you can tweet about it…. Or share into facebook… Or even more crazy, go to a voting page for community choose the best keynothes that will be presented….” And then Henry starts to have crazy ideas.

Now let’s see how to implement them using Seam 3 modules. In the next posts Henry will show:

  • Faces module – the base
  • Seam Security and the login page
  • The Brazilian speaker and the international module

August 6, 2011 at 3:23 pm Leave a comment

Seam 3 – creating a new project – with and without Seam Forge

Hi all!

[Note – Before reading this tutorial, would be nice if you read this post before – It tells you that these Seam posts are under incremental builds and are modified everyday]

This is the first post about Seam 3 examples!

The main point here is not to show a simple ‘Hello World’ app, but a more complex example, showing resources from 2 or more more modules.

So, let me tell you a short story…

Ben is a computer science student and he’s having some java classes. The subject now is web apps using Java.

– So – the teacher starts to talk – creating a java web app is pretty simple. As you can see, the only thing you have to do is open Eclipse, select ‘Dynamic web module’….. – and then he starts to say lots of things that should be done BEFORE start writing code.

[After 15 min talking, the teacher still explaining how to create a project] – And this is web.xml. And this one is faces-config.xml, and this is context.xml. Using Jboss AS 5 has some more extra confs, and with JEE 5, you just have to…


And Ben is right, developing apps in that way is pretty boring, painful, and creates a false idea that “Java is a DSL for taking large XML files and converting them to stack traces“.

“I will never use this thing called ‘Java’ to develop my web apps. Ruby on Rails is much more simple and fast”, Ben says leaving the classroom after the class.

“The problem is that the teacher did not mention anything about JEE 6” – replied his classmate Susan.

– JEE 6? What does it do, take large JSON files and convert then to stack traces? haha.

– No, JEE gives you the power of CDI! – says Susan.

– I’ll just consider using it if you tell me that I can build Java web apps in a way as simple as Rails. Otherwise…

– Yes, YOU CAN DO IT! Let me introduce you to Seam Forge!

Ben still thinks that Susan is mocking him, but then she takes her MacBook and starts a little and fast class about Seam Forge.

– Let me introduce you to Seam Forge. Believe me, the only sad part of Java story is Maven downloading the internet for you if your .m2/repository is empty. There’s any other boring thing.


Seam Forge – Fast tutorial

“Ok”, you might be thinking after reading this story. “Show me what do I need to have Seam Forge up and running here on my computer.

Obviously you need JDK (6+). You can download Seam Forge here – go to the “artifact information” and download the zip file. After that, unzip it, and add $FORGE_HOME/bin to your path.

If you are into a UNIX based system (Linux or Mac), basically just add this to your .bash_profile or .basrc:

export FORGE=$FORGE_HOME/bin

change {YOUR_LOCATION} to the right path of seam-forge directory.

So now type forge into your terminal. You might see Seam Forge up and running, like this:

Explore some commands by typing list-commands -all. Remember that TAB key works pretty fine here ūüôā

So now what about some ‘rails style’ development? Let’s do some scaffolding.

Be sure to have JBoss AS 6 or JBoss AS 7 downloaded. You should also have Maven and Git installed.

  1. Let’s create new sample project. Type¬†new-project –named damnPonies –topLevelPackage com.ponies.damn –projectFolder /{YOUR_PATH_HERE/ ¬†
  2. Now let’s do scaffold setup. type scaffold setup. Forge will ask you some questions, answer yes.
  3. Choose the last version of Metawidget, and also choose the latest version of Seam persistence. Done!
  4. Now create an index – scaffold indexes –overwrite
  5. Setup your persistence – type ¬†– You can change provider and container – Just use TAB to see other options ūüôā
  6. Now let’s create an entity. Type¬†entity –named Pony. Check that Forge creates an Entity called Pony for you (Very similar to Rails =] )
  7. Let’s add some fields – type field string –named color
  8. Type ls and examine the class 
  9. Type scaffold from-entity to generate a scaffold for Pony entity.
  10. Then, type build to make maven build the project for you. 
  11. Done! Take a look at the project structure 

If you ever used Seam 2, maybe Forge reminds you a seam-gen enhanced version.

[Break time – You might be wondering why did I call this project ‘DamnPonies. Its related to a Brazilian tv commercial which has an annoying song that involves ‘Damn Ponies’. You can check it ¬†here ¬†– CAUTION – Really annoying song]

More information about Seam Forge:


Now let’s go back to our story. While Ben is learning about Seam Forge, his classmate Henry is at the library doing some research work. Henry is a Java enthusiastic boy, who really likes Maven world. He gets mad when people make fun of Maven saying it downloads the whole internet. Last week he read a tweet from Susan saying “Maaaaavvveeennn IIIII hhhaaaattteee yyyooouuuuu!”, and then he tweeted back – “go back to Ant then!”. Susan provoked back – “You keep saying you love Maven, but I never see you configure a new project from the beginning. You always use a tool or a stable Maven Archetype. Loser”.

Henry got really disappointed by hearing this from a girl, so he decided to turn the tide. He wants to prove her that HE CAN CREATE A SEAM 3 PROJECT WITHOUT SEAM FORGE. “I’ll curse her with Maven. She’ll see that I am the Maven guy.”

So let’s help Henry on his adventure to create a Seam 3 project without using Seam Forge.

[TODO – write about seam 3 architecture + module brief]

I will assume that you already know about Seam 3 modular architecture. If not, take a look here. Also, you will need Maven 3 and JDK 6+.

So, first step – start with weld archetype – Open your Terminal and type

mvn archetype:generate -DarchetypeArtifactId=jboss-javaee6-webapp -DarchetypeGroupId=org.jboss.weld.archetypes -DarchetypeVersion=1.0.1.CR1 -DarchetypeRepository=central

[TODO – write a better tutorial for this]

August 6, 2011 at 3:19 pm 14 comments

Seam 3 tutorials and examples – up and running

Hi all!

I know that you have been looking for Seam 3 tutorials, examples, and it’s a little hard to find it yet. But Seam 3 team is working hard and soon there will be lots of thing for the community. I will help them with some tutorials and exmaples.

I am going to publish lots of posts and update them [almost] everyday. So, if Google shows you a page of this blog one day, probably in the next 2 or 3 days there will be new content at the same page. Be sure to remember that, otherwise you will think “OMG, its missing lots of things in this post. It’s a crap”. It’s Aug 06 today – I really expect to finish solid information and very cool tutorials until the end of the month.

I also would like to thank all of you who send me feedbacks about this blog – it’s very important to me to always try to write better and useful things. So, if you get a free time, write a little review and send it to hannelita @ gmail, or just leave a comment here ūüôā Believe me, it’s very important to me.

Also, I’d like to ask you to be patient. I know all of you want information, tutorials, easy-to-read and lots of other things. But be aware this is community work – I also have to do lots of other things. I’m really glad to help and share knowledge, but sometimes its really hard to create content in one night. I sleep (sometimes). ūüôā Not only me, but Red Hat guys and all of the other Seam contributors have tons of things to do! Think about that before saying bad things. But we really welcome to suggestions, questions, and specially new contributors! Remember – you can access the forum anytime and post your questions, or join us at IRC – – #seam and #seam-dev channel. There’s [almost] always someone online there that might help you!

Feel free to email me anytime – hannelita @ gmail, or send me a Tweet @hannelita. Thanks for reading!

August 6, 2011 at 2:42 pm 1 comment

Dev Chronicles #1

A cr√īnica a seguir √© uma fic√ß√£o proveniente da minha imagina√ß√£o f√©rtil, mas sua moral √© baseada em fatos verdadeiros =)

Hope you enjoy it =)

“Aquele 17 de janeiro mudou minha vida para sempre. Tinha acabado de sair da faculdade; estava livre, cheio de conhecimento e dono da verdade. Havia estagiado por 10 meses em uma pquena empresa onde em pouco tempo me tornei o ‘core’ do grupo por conseguir desenvolver minhas aplica√ß√Ķes muito, muito r√°pido.

Eis que então estava eu a caminho de desafios maiores, empresas maiores e clientes maiores. Mandei currículo para algumas dezenas de empresas em São Paulo e minha agenda estava lotada de entrevistas e testes de seleção. E por falar em testes, todos eram relativamente fáceis; conseguia codar e acabar tudo muito rápido. Parecia que eu me estabeleceria em um bom emprego logo.

Entretanto, naquele 17 de janeiro eu tinha uma din√Ęmica marcada em uma rec√©m inaugurada empresa na zona Sul da capital paulista. A primeira etapa consistia em uma prova contendo algumas tarefas simples. O respons√°vel anunciou: “Voc√™s t√™m 1h para codar uma aplica√ß√£o simulando uma rede social. Gostaria que na p√°gina apare√ßam nome, apelido, local de trabalho, relacionamento, interesses, vis√£o pol√≠tica, op√ß√£o sexual e uma lista de amigos, etc. Codem na linguagem que acharem melhor. Usem o que quiserem”

“F√°cil”, pensei, e sa√≠ codando como habitual. Em 45 minutos, tudo rodava no meu Tomcat perfeitamente. “Essa foi moleza… To Dentro”. E eu queria estar, porque o sal√°rio era bom.

E foi ent√£o que descobri que n√£o era f√°cil.

Assim que entreguei, fu encaminhado a um pequeno grupo de desenvolvedores. Sentamos em uma mesa, e eles então começaram a avaliar o pequeno sistema que eu havia desenvolvido.

“Muito bem, voc√™ come√ßou mal com alguns NullPointerException, hem, amigo?” Assustei: “Como?” indaguei √† equipe.

“Sua alica√ß√£o quebra t√£o f√°cil que parece¬† ta√ßa de cristal na m√£o de crian√ßa…”

Aqueles caras nã podiam estar falando sério. Mas sim, estavam. Do jeito que eu havia codado as coisas, se o sujeito logado rejeitasse um amigo e depois tentasse adiciona-lo, minha aplicação quebrava. Se mudasse o status de relacionamento, minha aplicação quebrava. Havia um bug com o apelido; se o apelido fosse alterado os amigos que clicassem sobre o perfil tomariam um NPE. E por aí vai uma cascata de erros.

Ainda indignado, disse: “Ok, admito que h√° muitos erros, mas tive pouco tempo”. Foi ent√£o que obtive uma resposta sensata e que me fez refletir sobre cada linha de c√≥digo que eu havia escritona vida: “N√£o pagamos pra voc√™ desenvolver qualquer coisa. Mesmo que voc√™ n√£o tivesse terminado toda a proposta, n√£o faria mal se o qe voc√™ tivesse feito n√£o quebrasse assim facilmente. Em uma equipe, cada um desenvolve um peda√ßo do software. Se todos os peda√ßos s√£o firmes, o software ser√° firme como um todo. N√£o adianta produzir r√°pido se voc√™ produz de qualquer jeito. Pense em um engenheiro civil que constr√≥i um pr√©dio. N√£o adianta nada ele construir tudo em 2 meses sendo que no momento em que pisarem na constru√ß√£o ela ruir√°. Software, meu amigo, √© a mesma coisa. Software √© a empreitada do seu cliente. No caso, dos nossos clientes. N√£o queremos que pr√©dios desabem. N√£o queremos que c√≥digo quebre do jeito que o seu quebrou. N√£o importa muito se tivermos um desenvolvedor um pouco mais lento que fa√ßa as coisas com QUALIDADE. Com o tempo esse dev adquire experi√™ncia e vai codar com flu√™ncia. Ele n√£o vai codar de qualquer jeito. Demos um limite para testar o bom senso dos candidatos, claro. Sinto muito, voc√™ est√° fora.”

E foi ent√£o que o que se quebrou foi minha build. Naquela hora descobri que eu n√£o sabia… absolutamente nada sobre desenvolvimnento de software. Todas aquelas coisas de waterfall e afins que vi na faculdade estavam… legadas.

Sou muito grato √†quela pequena empresa. Gra√ßas a eles hoje sei o que √© TDD, o que √© BDD e acima de tudo aprendi a dar valor √†s metodologias √°geis. Antes eu achava que agile era coisa de programador que n√£o sabia codar e queria ficar enrolando a hist√≥ria. Antes eu achava que TDD era coisa de desenvolvedor que n√£o confiava no pr√≥prio c√≥digo e precisava ver uma barrinha verde pra ter certeza que meia d√ļzia de linhas de c√≥digo fariam o que ele esperava que de fato fizesse. Antes eu achava que pair progamming era um desped√≠cio de funcion√°rios, e que Kanban era coisa de man√≠acos por post-its que n√£o sabiam escrever c√≥digo. Refatora√ß√£o era apenas renomear uma ou outra vari√°vel que estava com um nome muito esquisito.

E hoje vi o quanto eu estava errado. Estou aqui com um quadro branco na minha frente com v√°rios cart√Ķezinhos pregados. Passei o dia todo pareando com um ex-colega de faculdade e rodamos cerca de 355 testes na nossa nova app; todos com barrinha verde e c√≥digo devidamente refatorado. J√° at√© colcoamos todas as altera√ß√Ķes de hoje em produ√ß√£o. E pode acreditar, nunca gostei tando de codar e nunca confiei tanto no meu c√≥digo quanto confio hoje. E tudo gra√ßas √†quele 17 de janeiro onde definitivamente abandnei os horses*”

Nota Р* Menção ao XGH Рextreme Go Horse РMetodologia de desenvolvimento de software.

January 9, 2011 at 6:56 am 1 comment


November 2017
« Mar    

Posts by Month

Posts by Category