Archive

Posts Tagged ‘Seam’

JBoss Seam Debug Page.

January 13, 2010 Leave a comment

Hi
If you are working on project that it use seam framework, This page can help you for better understanding of your project.

Step 1 :

You should put the Jboss-seam-debug.jar library in your WEB-INF/lib  directory.

Step 2:

in Component.xml file you should write this code :
<
core:init debug=“true”/>

Step 3:

When your application deployed,Open your browser and enter this url:
http://localhost:8080/<your application>/debug.seam

[screen shot]

Bye

Categories: Java, Seam Tags: ,

Run Seam projects in eclipse on Tomcat

December 10, 2009 Leave a comment

Hi
I found one of the best solution for creating and running seam projects in eclipse on Tomcat so quickly :
http://techieexchange.wordpress.com/2007/11/11/rad-seam-development-with-eclipse-and-tomcat-step-by-step-tutorial-screencast/

bye

Categories: Eclipse, Java, Seam Tags: , , , ,

Seam injection in threads.

November 25, 2009 1 comment

Hi
In seam, when you want to inject some components such as EntityManager,POJOs,or … to threads, Probably you will  see all your objects is NULL.
The reason of this scenario is SeamApplicationContext missing in your threads, OK what is the solution?

You should use Lifecycle.begin() and Lifecycle.end() methods before and after your codes :

….
…….
Lifecycle.begin()
EntityManager em = (EntityManager)Component.getInstance(“em”,true);
Lifecycle.End()
……

So when you write your codes between these two methods, You will be in the SeamApplicationContext and you will not see any exceptions for EntityManager too like :

EntityManager is closed
no Transaction is in progress
….
..

bye.

@In attribute requires non-null value: sampleAction.sample

November 22, 2009 5 comments

Hi
If you are new to Seam framework and you get this stupid exception,You should read Seam annotation reference as well. OK this is my code :

[Sample class] …

@Name(“sample”)
public Class Sample ..
..
..

and next class is :

@Name(“sampleAction”)
public Class SampleAction …
….
..
@In
private Sample sample

public void someMethod(){
System.out.println(“I love Seam ….”);
}

….

And probably you get this exception :

javax.faces.FacesException: #{sampleAction.sample}: org.jboss.seam.
RequiredException: @In attribute requires non-null value: sampleAction.sample
	com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
	javax.faces.component.UICommand.broadcast(UICommand.java:387)
	org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
	org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
	org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
	org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
	com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
	com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)

OK, You should modify @In annotation :

@In(create=true)

enjoy it …
bye

Categories: Java, Seam Tags: ,
Design a site like this with WordPress.com
Get started