[JBoss Seam] - No application context active
by cingram
I am in the process of trying to build a bridge between Flex and Seam. In my factory for creating the remote object I have it delegating to Seam for this.
| new Initialization(flex.messaging.FlexContext.getServletConfig().getServletContext()).init();
|
| try {
| return Component.getInstance(compName);
| } catch (Exception ex) {
| ex.printStackTrace();
| ServiceException e = new ServiceException();
| String msg = "Seam Component named '" + compName+ "' does not exist.";
| e.setMessage(msg);
| e.setRootCause(ex);
| e.setDetails(msg);
| e.setCode("Server.Processing");
| throw e;
| }
|
|
When I call getInstance I am getting java.lang.IllegalStateException: No application context active from Seam. Any thoughts on how to get an active application context?
| 13:37:40,693 ERROR [STDERR] java.lang.IllegalStateException: No application context active
| 13:37:40,693 ERROR [STDERR] at org.jboss.seam.Component.forName(Component.java:1577)
| 13:37:40,693 ERROR [STDERR] at org.jboss.seam.Component.getInstance(Component.java:1627)
| 13:37:40,693 ERROR [STDERR] at org.jboss.seam.Component.getInstance(Component.java:1610)
| 13:37:40,693 ERROR [STDERR] at org.jboss.seam.Component.getInstance(Component.java:1604)
| 13:37:40,693 ERROR [STDERR] at com.pscufs.flex.factories.SeamFactory$SeamFactoryInstance.lookup(SeamFactory.java:100)
| 13:37:40,693 ERROR [STDERR] at flex.messaging.services.remoting.adapters.JavaAdapter.createInstance(JavaAdapter.java:237)
| 13:37:40,693 ERROR [STDERR] at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:157)
| 13:37:40,693 ERROR [STDERR] at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:173)
| 13:37:40,693 ERROR [STDERR] at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1165)
| 13:37:40,693 ERROR [STDERR] at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:727)
| 13:37:40,693 ERROR [STDERR] at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:99)
| 13:37:40,693 ERROR [STDERR] at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
| 13:37:40,693 ERROR [STDERR] at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:48)
| 13:37:40,693 ERROR [STDERR] at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
| 13:37:40,693 ERROR [STDERR] at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:124)
| 13:37:40,693 ERROR [STDERR] at flex.messaging.endpoints.AMFEndpoint.service(AMFEndpoint.java:117)
| 13:37:40,693 ERROR [STDERR] at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:424)
| 13:37:40,693 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| 13:37:40,693 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| 13:37:40,693 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 13:37:40,693 ERROR [STDERR] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
| 13:37:40,693 ERROR [STDERR] at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
| 13:37:40,693 ERROR [STDERR] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| 13:37:40,693 ERROR [STDERR] at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
| 13:37:40,693 ERROR [STDERR] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| 13:37:40,693 ERROR [STDERR] at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
| 13:37:40,693 ERROR [STDERR] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| 13:37:40,693 ERROR [STDERR] at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
| 13:37:40,693 ERROR [STDERR] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
| 13:37:40,693 ERROR [STDERR] at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
| 13:37:40,693 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| 13:37:40,693 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 13:37:40,693 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| 13:37:40,693 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| 13:37:40,693 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 13:37:40,693 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| 13:37:40,693 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| 13:37:40,693 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| 13:37:40,693 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
| 13:37:40,693 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| 13:37:40,693 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| 13:37:40,771 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| 13:37:40,771 ERROR [STDERR] at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| 13:37:40,771 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| 13:37:40,771 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| 13:37:40,771 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| 13:37:40,771 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| 13:37:40,771 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| 13:37:40,771 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| 13:37:40,771 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065506#4065506
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065506
18Â years, 11Â months
[JBoss Seam] - seam-gen plus arhitecture questions
by trouby
Hey,
I was wondering about few issues that I'll be glad if you guys can make them clear to me,
Since actions can be implemented on any bean without much limitations, I'm kinda confused how to design my beans correctly.
Usually actions needs access to resources such as database, transactions, etc... and since EJBs are not so expensive (performance/system resources, etc...), then I understand the concept and suggestions of making most of the beans as EJBs,
but I'm still confused of how to divide my business code correctly,
1st question:
It seems that part of the applications implements an EJB per action(lets say searching a specific type of entities), sometimes there is an EJB per entity(all CRUD operations + some other actions related to that specific entity), etc...
In very big applications, for example, having an EJB per entity search might end with about 40-50 ejbs, and this is only about search, but sometimes consolidating all actions related to a specific entity to one EJB grows and grows and my ejbs looks too big and hard to manage.
and if all methods related to one entity are implemented within the same EJB, it is more confusing where to implement methods that are related to more than one entity.
Are there any standards and suggestions how to divide the business code correctly/best way?
2nd question:
Also, are you guys suggesting the structure that seam-gen creates? are all the application samples of SEAM are generated by seam-gen? or having the same project structures? or there are suggestions and standards of project structure(I mean the structure of the view/web resources/ejbs/etc...) depends on the project size and needs?
3rd question:
Since it became easier with EJB3 to create the entities and their relations than creating the tables and managing the foreign keys manually (at least I see it that way), it would be very nice if seam-gen could generate all the CRUD view/ejbs based on the created entities and not by tables,
I only found the 'generate-entities' command that generates the entities/view/ejbs based on tables but couldn't find a way to generate all SEAM code based on ready made entities.
Any way of doing this?
As always - many thanks,
Asaf.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065504#4065504
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065504
18Â years, 11Â months
[JBoss Seam] - Re: Please help: problem integrating Trinidad, Richfaces and
by kingcu
I found the problem. I had
<core:manager concurrent-request-timeout="500"
| conversation-timeout="120000"
| conversation-id-parameter="cid"
| conversation-is-long-running-parameter="clr"/>
|
in my components.xml and apparently Seam 2.0 doesn't like the conversation-is-long-running-parameter. Once I remove that, it gets pass that.
But then, I got another exception on a component that uses Richfaces API (I am using rich:tree and need to build the tree data model in the Java code):
Caused by: java.lang.NoClassDefFoundError: org/richfaces/component/TreeNode
| at java.lang.Class.getDeclaredMethods0(Native Method)
| at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
| at java.lang.Class.getDeclaredMethods(Unknown Source)
| at org.jboss.seam.Component.initMembers(Component.java:492)
| at org.jboss.seam.Component.<init>(Component.java:247)
| at org.jboss.seam.Component.<init>(Component.java:207)
| at org.jboss.seam.init.Initialization.addComponent(Initialization.java:894)
| ... 93 more
but I do have richfaces-3.0.1.jar packaged under WEB-INF/lib.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065493#4065493
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065493
18Â years, 11Â months