Useful Maven links + stuff

On August 31, 2011, in Arquillian, Maven, Seam 2, Servlet 3.0, by lucasterdev

Artifact search engine:

Another artifact search engine:

Maven Central Repository Browser

Repository that contains prehistoric dependencies such as apache-httpclient:commons-httpclient. Despite being deprecated, project such as Arquillian depend on jars contained in that repository! Go figure…

	<id>JBoss deprecated</id>
	<name>JBoss deprecated repository</name>

When importing existing Maven projects into eclipse, be sure the following snippet is present in the pom.xml. Specially if you import projects that use Servlet 3.0!


he Problem is related to Weld:

It is fixed in the current version of weld, however the JBoss AS 6 doesn’t come with that by default.

The most trivial way, to upgrade weld is to go into your


and delete the weld-core-no-jsf.jar

Then download the current weld-jar ( and throw it into the weld.deployers directory.

At least it worked for me…

Good luck


I wrote a .xhtml page to test the compatibility of some components:

  • h:commandButton
  • p:commandButton
  • a4j:commandButton
  • h:message
  • h:messages
  • rich:message
  • rich:messages
  • p:growl
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns=""



 Messages: <h:panelGroup id="pgMessages"><h:messages id="messages"/></h:panelGroup>
 RichMessages: <rich:messages id="richMessages"/>
 <a4j:outputPanel ajaxRendered="true">
 <p:growl id="growl" showDetail="true" showSummary="true" sticky="false" rendered="true"/>

 <h:form id="form">

 <h:outputText value="Enter Name: " />
 <h:inputText id="name" value="#{}" required="true"/><br/>
 Message: <h:panelGroup id="pgMessage"><h:message id="message" for="name"/></h:panelGroup><br/>
 RichMessage: <rich:message id="richMessage" for="name"/><br/>

 With h:commandButton everything is updated automatically.<br/>
 <h:commandButton value="Test" action="#{growlTestBean.testGrowl}"/>

 With p:commandButton, nothing is updated automatically.<br/>
 You must specify the components to update by listing their id's in the 'update' attribute.<br/>
 It doesn't update h:messages, even if you list its id in the 'update' attribute. <br/>
 To update h:messages, you must put a 'h:panelGroup' element around it and list the id of the panelGroup.<br/>
 It doesn't update h:message, even if you list its id in the 'update' attribute. <br/>
 To update h:message, you must put a 'h:panelGroup' element around it and list the id of the panelGroup.<br/>
 <p:commandButton value="Test" action="#{growlTestBean.testGrowl}" update="pgMessages,pgMessage,richMessage,richMessages,growl"/>

 With a4j:commandButton, only 'rich:messages' and 'rich:message' will be updated automatically.<br/>
 To update h:messages, you must list its id in the 'reRender' attribute.<br/>
 To update h:message, you must list its id in the 'reRender' attribute.<br/>
 To update p:growl, you must put it in an 'a4j:outputPanel' with ajaxRendered="true".<br/>
 <a4j:commandButton value="Test" action="#{growlTestBean.testGrowl}" reRender="pgMessages,pgMessage,growl"/>


How to install Seam Forge plugin

On August 12, 2011, in Seam, Seam 3, Seam Forge, by lucasterdev

forge git-plugin git://
forge git-plugin git://
forge git-plugin git://
forge git-plugin git://


These are some caveats you must consider if you decide to work with Seam 2 with Tomcat (and sometimes also with JBoss AS 5):

Issue #1:

Starting a conversation through annotations does not work. It’s broken. Use page descriptors or components.xml instead.

This does NOT work:

@Begin(join = true, flushMode = org.jboss.seam.annotations.FlushModeType.MANUAL)

This works:

<page view-id="/Facility.xhtml">
	<navigation from-action="#{courseWizard.addCourse}">
		<begin-conversation join="true" flush-mode="manual"/>
		<redirect view-id="/coursewizard/basicCourseInfo.xhtml"/>

This works:

<page view-id="/Facility.xhtml">
	<begin-conversation join="true" flush-mode="manual"/>

This works:

<h:commandButton action="#{courseWizard.addCourse(_facility)}" value="Add course...">
	<s:conversationPropagation type="begin"/>

I found some explanation for the manual flush not working. If the entity identifier is generated during an insertion (i.e., auto-increment column), then even with manual flushing, a flush occurs after a call to persist(). This is necessary since each managed entity in the persistence context must be assigned an identifier. To avoid the flush, you need to set the id-generation strategy to sequence (not identity).
@Id @GeneratedValue(strategy=GenerationType.SEQUENCE)

Issue #2:

Seam works only with an old and obviously bugged version of Hibernate (core 3.3.1, annotations 3.4.0.GA). Here is an example: if you use @JoinTable to implement an association between a JOINED subclass and another class, the schema creation will fail and throw an exception:

[org.hibernate.AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: Table JOIN_TABLE_NAME not found

Workaround: use the TABLE_PER_CLASS inheritance strategy instead? That doesn’t work either!!

During inserts, Hibernate will “forget” that the x-to-one association is realized with a join table, and will think it’s implemented through a @JoinColumn instead. It will throw a “Unknown column” exception. Precisely, the unknown column is the inexistent join column.
A possible workaround is to use always SINGLE_TABLE, but that forces you to specify explicitly the structure of all join tables, otherwise other exceptions will be thrown!!

Issue #3:

Again, the Hibernate version doesn’t implement JPA 2.0′s orphanRemoval attribute. Instead, you have to use Hibernate’s special annotation:

Issue #4:

Seam 2 works with RichFaces 3.3.3.Final and, guess what? There are bugs in RichFaces too! An a4j:commandButton won’t reRender if it’s inside a ui:repeat or an a4j:repeat. Fortunately, there’s a workaround: Inseart an a4j:outputPanel with ajaxRendered="true" around the element you want to reRender.

Issue #5:

Hibernate validator’s @NotNull annotation is ignored and entities are persisted regardless of it. From Seam’s reference guide:

Note: specifying @NotNull on the model does not eliminate the requirement for required="true" to appear on the control! This is due to a limitation of the JSF validation architecture.

A more detailed explanation of that can be found here.

Managed bean elements represented as a JavaServer Faces text component such as inputText are initialized with the value of the empty string by the JavaServer Faces implementation.



But it works only in JSF 2.0, not with JSF1.2!!!! And Seam only works with JSF 1.2!!! This context param is added by JBossfucking Tools themselves!!!!!!!!!!!!!!!

Issue #6:

There is a problem with binding view components to a conversation scoped component properti. Read here to find out more.

Issue #7:

Seam’s EntityHome and HibernateEntityHome look very appealing, but are not suitable for complec classes that have associations.


The Home component is not really suited for managing complex trees, especially when you have relations between objects which are lazily loaded. The Instance of a Class is retrieved with a entitymanager.find method which is not able toe retrieve the whole tree. A solution is using your own component which is a subclass of EntityHome, but at the end you will decide to make a better version using a standard bean.

In short: EntityHome is great for simple classes with eagerly loaded associations.


Issue #8

TestNG tests can run only on Java 1.5 Containers such as JBoss up-to 5.1, or Tomcat 6 with Embedded JBoss. TestNG tests do NOT run on JBoss AS 6 or JBoss AS 7.

Issue #9 (also with JBoss AS 5)

Conversation doesn’t get started when adding @Begin to the @PostConstruct method of a stateful session bean.

This will NOT start the conversation:

public void postConstruct() {

This will start the conversation:

public void postConstruct() {
	Conversation.instance().begin(); // you have to add this line

Issue #10 (also with JBoss AS 5)

Injection does not occur before the @PostConstruct method.

This will throw a NullPointerException:

Conversation conversation;

public void postConstruct() {
	conversation.begin(); // will throw NullPointerException

This will work:

Conversation conversation;

public void postConstruct() {
	conversation = Conversation.instance(); // you have to add this line

Isue #11 (Also in JBoss AS 5)

If your application is going to contain EJBs, then it MUST be packaged as an EAR. So, be careful when you choose the packaging type in JBoss Tools’ Seam 2 Project creation wizard.
After all, Seam 2 is a Java EE 5 framework, and Java EE 5 supports EJB 3.0, which can not be deployed inside a WAR.

If you choose WAR packaging and you application has EJBs in it, you’ll get the following stack trace:

javax.el.ELException: /SomeEJB3Bean.xhtml: Could not instantiate Seam component: someEJB3
	at com.sun.facelets.compiler.TextInstruction.write(
	at com.sun.facelets.compiler.UIInstructions.encodeBegin(
	at com.sun.facelets.compiler.UILeaf.encodeAll(
	at javax.faces.component.UIComponent.encodeAll(
	at com.sun.facelets.FaceletViewHandler.renderView(
	at org.ajax4jsf.application.ViewHandlerWrapper.renderView(
	at org.ajax4jsf.application.AjaxViewHandler.renderView(
	at com.sun.faces.lifecycle.RenderResponsePhase.execute(
	at com.sun.faces.lifecycle.Phase.doPhase(
	at com.sun.faces.lifecycle.LifecycleImpl.render(
	at javax.faces.webapp.FacesServlet.service(
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(
	at org.jboss.seam.web.IdentityFilter.doFilter(
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(
	at org.jboss.seam.web.MultipartFilter.doFilter(
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(
	at org.jboss.seam.web.ExceptionFilter.doFilter(
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(
	at org.jboss.seam.web.RedirectFilter.doFilter(
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(
	at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(
	at org.ajax4jsf.webapp.BaseFilter.handleRequest(
	at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(
	at org.ajax4jsf.webapp.BaseFilter.doFilter(
	at org.jboss.seam.web.Ajax4jsfFilter.doFilter(
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(
	at org.jboss.seam.web.LoggingFilter.doFilter(
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(
	at org.jboss.seam.web.HotDeployFilter.doFilter(
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(
	at org.jboss.seam.servlet.SeamFilter.doFilter(
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
	at org.apache.catalina.core.StandardWrapperValve.invoke(
	at org.apache.catalina.core.StandardContextValve.invoke(
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
	at org.apache.catalina.core.StandardHostValve.invoke(
	at org.apache.catalina.valves.ErrorReportValve.invoke(
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(
	at org.apache.catalina.core.StandardEngineValve.invoke(
	at org.apache.catalina.connector.CoyoteAdapter.service(
	at org.apache.coyote.http11.Http11Processor.process(
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: someEJB3
	at org.jboss.seam.Component.newInstance(
	at org.jboss.seam.Component.getInstance(
	at org.jboss.seam.Component.getInstance(
	at org.jboss.seam.Component.getInstance(
	at org.jboss.seam.Namespace.getComponentInstance(
	at org.jboss.seam.Namespace.getComponentInstance(
	at org.jboss.seam.el.SeamELResolver.resolveBase(
	at org.jboss.seam.el.SeamELResolver.getValue(
	at javax.el.CompositeELResolver.getValue(
	at com.sun.faces.el.FacesCompositeELResolver.getValue(
	at org.jboss.el.parser.AstIdentifier.getValue(
	at org.jboss.el.parser.AstValue.getValue(
	at org.jboss.el.ValueExpressionImpl.getValue(
	at com.sun.facelets.el.ELText$ELTextVariable.writeText(
	at com.sun.facelets.el.ELText$ELTextComposite.writeText(
	at com.sun.facelets.compiler.TextInstruction.write(
	... 53 more
Caused by: javax.naming.NameNotFoundException: SomeEJB3Bean not bound
	at org.jnp.server.NamingServer.getBinding(
	at org.jnp.server.NamingServer.getBinding(
	at org.jnp.server.NamingServer.getObject(
	at org.jnp.server.NamingServer.lookup(
	at org.jnp.interfaces.NamingContext.lookup(
	at org.jnp.interfaces.NamingContext.lookup(
	at javax.naming.InitialContext.lookup(
	at org.jboss.seam.Component.instantiateSessionBean(
	at org.jboss.seam.Component.instantiate(
	at org.jboss.seam.Component.newInstance(
	... 68 more

[Solved] PermGen space

On August 9, 2011, in Eclipse, JBoss, by lucasterdev

Add the following arguments to the server’s Arguments in the Launch Configuration window:

-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled



Hi ,my dear friend !
after i remove dependy of annotation-3.5.6-Final ,it’s works
when i open core3.6.2.Final i had found it contains all of the classes of annotation-3.5.6-Final !!!

I had found the confiliction , just between annotation-3.5.6-Final and core-3.6.2.Final ,did annotation-3.5.6-Final never needed later!!!