Error when using flex+seam+flamingo
sushik Jan 8, 2009 7:54 AMHi all,
when iam running a sample application iam encountering this error .
iam using jboss 4.2,flexbuilder 3,seam 2.0,flamingo 1.7.1
java.lang.IllegalStateException: Attempted to invoke a Seam component outside the an initialized application
at org.jboss.seam.contexts.Lifecycle.getApplication(Lifecycle.java:36)
at org.jboss.seam.contexts.Lifecycle.mockApplication(Lifecycle.java:111)
at org.jboss.seam.servlet.SeamResourceServlet.loadResourceProviders(SeamResourceServlet.java:42)
at org.jboss.seam.servlet.SeamResourceServlet.init(SeamResourceServlet.java:35)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Unknown Source)
ERROR :Seam Resource Servlet Allocate exception for servlet Seam Resource Servlet
File contents are displayed here:
Seam Component: import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Scope; import org.jboss.seam.annotations.remoting.WebRemote; @Scope(ScopeType.STATELESS) @Name("helloAction") @WebRemote public class HelloAction { public String hello(String name) { return "Hello, +"name; }} web.xml: <listener> <listener-class>org.jboss.seam.servlet.SeamListener</listener-class> </listener> <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> Servies-config.xml: <?xml version="1.0" encoding="UTF-8"?> <services-config> <services> <service id="hello-service" class="flex.messaging.services.RemotingService" messageTypes="flex.messaging.messages.RemotingMessage"> <destination id="helloAction"> <channels> <channel ref="seam-amf"/> </channels> </destination> </service> </services> <channels> <channel-definition id="seam-amf" class="mx.messaging.channels.AMFChannel"> <endpoint uri="http://{server.name}:{server.port}/FlexSeamIntegration/seam/resource/amf" class="flex.messaging.endpoints.AMFEndpoint"/> </channel-definition> </channels> </services-config> client.mxml: <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:word="*"> <mx:RemoteObject id="service" destination="helloAction"/> <mxanel title="Seam-Flex AMF Hello World" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"> <mx:HBox> <mx:Label text='Whom do you want to say "Hello" to?'/> <mx:TextInput id="who" maxChars="20" enter="service.hello(who.text)"/> <mx:Button label="Say Hello" click="service.hello (who.text)"/> </mx:HBox> <mx:Label text='The server said: "{service.hello.lastResult}"'/ ></mxanel> </mx:Application>
please help me in resolving this error