Hallo,
I am trying to test Seam Remoting in Seam 2.1. Basically i followed documentation, but i am getting a xxx is not a Function
-error in my browser.
I found this topic: http://seamframework.org/Community/NotAFunctionErrorInSEAMRemoting
This is exactly my problem. The interface for my Seam Component doesnt have any methods at all (i checked interface.js?myComponent).
web.xml
<servlet>
<servlet-name>Seam Resource Servlet</servlet-name>
<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Seam Resource Servlet</servlet-name>
<url-pattern>/seam/resource/*</url-pattern>
</servlet-mapping>
Seam Component:
@Stateful
@Name("draw")
public class DrawBean implements Draw
{
private int value = 50;
@WebRemote
public int getValue()
{
return value;
}
@WebRemote
public void setValue(int value)
{
this.value = value;
}
}
Interface:
@Local
public interface Draw
{
@WebRemote
public int getValue();
@WebRemote
public void setValue(int value);
public void destroy();
}
.xhtml:
<s:remote include="draw"/>
I even set:
Seam.Remoting.resourcePath = "http://localhost:8080/myApp/seam/resource
/remoting";
(found it in some topic here)
Anyway i get:
Seam.Component.getInstance("draw").getValue() is not a Function
The guy in the topic i found solved it by putting additional libs (jboss-seam-remoting.jar,jsf-facelets.jar) into EAR scope
. I am new to Seam/Java, so i just copied the jars to the EarContent folder of my (Eclipse)JBossTools generated project. It didnt help. Any help is really appreciated!