No long-running conversations - IllegalArgumentException: Stack must not be null - java
I have a very simple application with just 2 pages on WebLogic 10.3.2 (11g), Seam 2.2.0.GA. I have a command button in each, which makes a redirect-after-post to the other. This works well, as I see the URL of the current page I am seeing in the address bar.
BUT, even though I have no long-running conversations defined, after a random number of clicks, and - I think - after a random number of seconds (~10s - 60s) I get the lovely exception at the end of this post.
Now, if I have understood how temporary conversations work when redirecting this happens:
When I first see my application, the url is http://localhost:7001/myapp
When I click the button in pageA.xhtml, I end up in "pageB.xhtml?cid=26". This is normal because Seam extends the temporary conversation of the first request to last until the renderResponse phase of the redirect. So, it uses the cid (Conversation Id) of the extended temporary conversation to find any propagated parameters.
When I click the button in pageB.xhtml, I end up in pageA.xhtml?cid=26
The same cid was given to the new extended temporary conversation. This is normal because the conversation ended at the end of the previous redirect-after-post, and not the number 26 is free to use as a cid.
Is this all correct? If yes, why does this happen: If I re-type the applications home address (showing pageA) and re-click, I end up in pageB.xhtml?cid=29, which is a different number than 26. But 26 has ended after the previous RenderResponse phase, befire I re-types the url. Why is it not used instead of 29?
So, to sup up, 2 questions:
Why do I get the exception, even though I have not started any long-running conversations?
What happens exactly with the cid? On what basis does it change?
Cheers,
UPDATE:
Additional information: I use h:commandButtons like this in page A:
<h:commandButton action="showPageB" value="Show page B" />
and in page B
<h:commandButton action="showPageA" value="Show page A" />
navigation pageA.page.xml:
<page view-id="/pageA.xhtml">
<navigation>
<rule if-outcome="showPageB">
<redirect view-id="/pageB.xhtml" />
</rule>
</navigation>
</page>
and a very similar for pageB.
As for the conversation timeout, I have set it to 1h. Note that it is irrelevant, because as I read here, it is only meant for background conversations. The stacktrace follows:
Error 500--Internal Server Error
java.lang.IllegalArgumentException: Stack must not be null
at org.jboss.seam.core.ConversationEntry.(ConversationEntry.java:45)
at org.jboss.seam.core.ConversationEntries.createConversationEntry(ConversationEntries.java:53)
at org.jboss.seam.core.Manager.createConversationEntry(Manager.java:664)
at org.jboss.seam.core.Manager.beforeRedirect(Manager.java:836)
at org.jboss.seam.faces.FacesManager.beforeRedirect(FacesManager.java:66)
at org.jboss.seam.faces.FacesManager.redirect(FacesManager.java:182)
at org.jboss.seam.faces.Navigator.redirect(Navigator.java:55)
at org.jboss.seam.navigation.RedirectNavigationHandler.navigate(RedirectNavigationHandler.java:61)
at org.jboss.seam.navigation.Rule.execute(Rule.java:101)
at org.jboss.seam.navigation.Navigation.navigate(Navigation.java:58)
at org.jboss.seam.navigation.Pages.navigate(Pages.java:203)
at org.jboss.seam.jsf.SeamNavigationHandler.handleNavigation(SeamNavigationHandler.java:42)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:130)
at javax.faces.component.UICommand.broadcast(UICommand.java:387)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:324)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:299)
at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:256)
at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:469)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:530)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
First of all, it is always helpful to see the relevant code and stacktrace when trying to debug a problem.
Thus I cannot give an answer to your first question. However, I will try to explain how the conversation model works.
This is from the Seam in Action book:
#ScopeType.EVENT = Goes from Restore View to Render Response, but not redirect
#ScopeType.CONVERSATION = Goes from Restore VIew to Render Response, and redirect. If long-running conversation, then it spans multiple JSF life cycles.
So imagine you are in a.xhtml you push a button that will take ComponentA and fill some data in it. This component you want to inject and use in b.xhtml
ie:
Push commandbutton in a.xhtml performing post, putting some data in ComponentA
Now you redirect to next page (b.xhtml)which uses the ComponentA
#Name("componentB")
#Scope(ScopeType.CONVERSATION)
public class ComponentB {
#In(create=true)
ComponentA componentA; //OK
}
So if you now push another button from b.xhtml expecting to be able to inject ComponentA again, that will fail.
ie:
#Name("componentC")
#Scope(ScopeType.CONVERSATION)
public class ComponentC {
#In(create=true)
ComponentA componentA; //Injection of the component you really want fails (you will get default component)
}
So in the background now, seam has created a new cid for you, ending the previous cid because a conversation scoped component can only live one request.
After seeing your StackTrace and your Use case (after a random number of clicks)
Let's see FacesManages.beforeRedirect (as shown by your StackTrace) documentation
Temporarily promote a temporary conversation to a long running conversation for the duration of a browser redirect
Now, let's see some piece of code of beforeRedirect method
if (isDifferentConversationId(currentPage, targetPage))
updateCurrentConversationId(targetPage.getConversationId());
...
updateCurrentConversationId is responsible for creating the Stack which must be not null See again your StackTrace
public void updateCurrentConversationId(String id) {
if (id != null && id.equals(currentConversationId)) {
// The conversation id has not changed, do nothing
return;
}
After code shown above, your Stack will be created. So i suppose The conversation id has not changed because of The duration of a browser redirect (caused by a random number of clicks) or even a Seam bug when dealing with a navigation with redirect from one page to another and vice-versa
Try the following one for each Page rule (see timeout="0")
<page view-id="/pageA.xhtml" timeout="0">
<navigation>
<rule if-outcome="showPageB">
<redirect view-id="/pageB.xhtml" />
</rule>
</navigation>
</page>
I expect now it works fine! But, if not, now, you know why you get your exception
UPDATE
Try <end-conversation/> as a workaround (for each page)
<page view-id="/pageA.xhtml">
<navigation>
<rule if-outcome="showPageB">
<end-conversation/>
<redirect view-id="/pageB.xhtml" />
</rule>
</navigation>
</page>
or (see before-redirect)
<page view-id="/pageA.xhtml">
<navigation>
<rule if-outcome="showPageB">
<end-conversation before-redirect="true"/>
<redirect view-id="/pageB.xhtml" />
</rule>
</navigation>
</page>
Now i hope it works fine!
EDIT
As said by beforeRedirect method
Temporarily promote a temporary conversation to a long running conversation for the duration of a browser redirect. After the redirect, the conversation will be demoted back to a temporary conversation.
1° It explains why #{conversation.longRunning} outputs true when you go to pageB. Your "long running conversation" caused by your redirect should be destroyed after the Render Response phase.
When using a redirect, Seam appends conversation id paratemer to URL.
Seam in Action book says
At the beginning of the Seam life cycle, Seam looks for the conversation id in a URL parameter
But because when you are back to pageA, you see again the same conversation id parameter, I suppose Seam just create a new one when the url does not contain anyone. And because each long running conversation has it own Timeout period, your long running conversation is keeped alive.
To verify whether what i said is true, do as follows
reduce global Timeout period to five seconds (5000 milliseconds)
...
<core:manager conversation-timeout="5000"/>
For each Page, see what #{conversation.timeout} outputs. I expect to see something like Either 5 seconds or 5000 miliseconds. Wait for more than 5 seconds (about 10s) and press button to redirect again. And see whether conversation id parameter has been changed.
You should have provided that information long ago. Now it is much more clear what the problem is.
First of all you shouldn't use a commandButton with an empty action like that. When you in pages.xml write the following:
<page view-id="/pageA.xhtml">
<navigation>
<rule if-outcome="showPageB">
<redirect view-id="/pageB.xhtml" />
</rule>
</navigation>
</page>
It means normally that you have some action that returns showPageB like this:
public String someAction() {
//Do something complex
return "showPageB";
}
Anyhow, back to your problem.
Do your self a favor and create a Seam component.
#Name("myComponent")
public Class MyComponent {
public String showPageB() {
return "showPageB";
}
public String showPageA() {
return "showPageA";
}
}
Change your pages.xml to this:
<page view-id="/pageA.xhtml">
<navigation from action="#{myComponent.showPageB}">
<redirect view-id="/pageB.xhtml" />
</navigation>
<navigation from action="#{myComponent.showPageA}">
<redirect view-id="/pageA.xhtml" />
</navigation>
<!-- OR you can do like this -->
<navigation from action="#{myComponent.showPageB}">
<rule if-outcome="showPageA">
<redirect view-id="/pageA.xhtml" />
</rule>
<rule if-outcome="showPageB">
<redirect view-id="/pageA.xhtml" />
</rule>
</navigation>
</page>
Then change xhtml h:commandButton to
<h:commandButton action="#{myComponent.showPageA}" value="showA"/>
<h:commandButton action="#{myComponent.showPageB}" value="showB"/>
Related
Cluster instability with TCPPING protocol
I have 8 different processes distributed across 6 different servers with the following TCP/TCPPING protocol configuration: <config xmlns="urn:org:jgroups" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups.xsd"> <TCP bind_port="${jgroups.tcp.bind_port:16484}" bind_addr="${jgroups.tcp.bind_addr:127.0.0.1}" recv_buf_size="20M" send_buf_size="20M" max_bundle_size="64K" sock_conn_timeout="300" use_fork_join_pool="true" thread_pool.min_threads="10" thread_pool.max_threads="100" thread_pool.keep_alive_time="30000" /> <TCPPING async_discovery="true" initial_hosts="${jgroups.tcpping.initial_hosts:127.0.0.1[16484]}" port_range="5" #/> <MERGE3 min_interval="10000" max_interval="30000" /> <FD_SOCK get_cache_timeout="10000" cache_max_elements="300" cache_max_age="60000" suspect_msg_interval="10000" num_tries="10" sock_conn_timeout="10000"/> <FD timeout="10000" max_tries="10" /> <VERIFY_SUSPECT timeout="10000" num_msgs="5"/> <BARRIER /> <pbcast.NAKACK2 max_rebroadcast_timeout="5000" use_mcast_xmit="false" discard_delivered_msgs="true" /> <UNICAST3 /> <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="4M" /> <AUTH auth_class="com.qfs.distribution.security.impl.CustomAuthToken" auth_value="distribution_password" token_hash="SHA" /> <pbcast.GMS print_local_addr="true" join_timeout="10000" leave_timeout="10000" merge_timeout="10000" num_prev_mbrs="200" view_ack_collection_timeout="10000"/> </config> The cluster keeps splitting in subgroups, then merges again and again which results in high memory usages. I can also see in the logs a lot of "suspect" warning resulting from the periodic heartbeats sent by all other cluster members. Am I missing something ? EDIT After enabling gc logs, nothing suspect appeared to me. On the other hand, I've noticed this jgroups logs appearing a lot: WARN: lonlx21440_FrtbQueryCube_QUERY_29302: I was suspected by woklxp00330_Sba-master_DATA_36219; ignoring the SUSPECT message and sending back a HEARTBEAT_ACK DEBUG: lonlx21440_FrtbQueryCube_QUERY_29302: closing expired connection for redlxp00599_Sba-master_DATA_18899 (121206 ms old) in send_table DEBUG: I (redlxp00599_Sba-master_DATA_18899) will be the merge leader DEBUG: redlxp00599_Sba-master_DATA_18899: heartbeat missing from lonlx21503_Sba-master_DATA_2175 (number=1) DEBUG: redlxp00599_Sba-master_DATA_18899: suspecting [lonlx21440_FrtbQueryCube_QUERY_29302] DEBUG: lonlx21440_FrtbQueryCube_QUERY_29302: removed woklxp00330_Sba-master_DATA_36219 from xmit_table (not member anymore)enter code here and this one 2020-08-31 16:35:34.715 [ForkJoinPool-3-worker-11] org.jgroups.protocols.pbcast.GMS:116 WARN: lonlx21440_FrtbQueryCube_QUERY_29302: failed to collect all ACKs (expected=6) for view [redlxp00599_Sba-master_DATA_18899|104] after 2000ms, missing 6 ACKs from (6) lonlx21503_Sba-master_DATA_2175, lonlx11179_DRC-master_DATA_15999, lonlx11184_Rrao-master_DATA_31760, lonlx11179_Rrao-master_DATA_25194, woklxp00330_Sba-master_DATA_36219, lonlx11184_DRC-master_DATA_49264 I still can;'t figure out where the instability comes from. Thanks
Any instability is not due to TCPPING protocol - this belongs to the Discovery protocol family and its purpose is to find new members, not kick them out of the cluster. You use both FD_SOCK and FD to find if members left, and then VERIFY_SUSPECT to confirm that the node is not reachable. The setting seems pretty normal. First thing to check is your GC logs. If you experience STW pauses longer than, say, 15 seconds, chances are that the cluster disconnect because of unresponsiviness due to GC. If your GC logs are fine, increase logging level for FD, FD_SOCK and VERIFY_SUSPECT to TRACE and see what's going on.
NPE while trying to render a View in Spring Webflow
When trying to use a webflow, I keep getting the following error: { "failure":"true", "exception.message":"org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing org.springframework.webflow.action.ViewFactoryActionAdapter#200a5beb in state 'accountCannotLogInView' of flow 'login' -- action execution attributes were 'map[[empty]]'", "exception.stacktrace":"org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing org.springframework.webflow.action.ViewFactoryActionAdapter#200a5beb in state 'accountCannotLogInView' of flow 'login' -- action execution attributes were 'map[[empty]]' ... Caused by: java.lang.IllegalStateException: Exception occurred rendering view null at org.springframework.webflow.mvc.view.AbstractMvcView.render(AbstractMvcView.java:191) at org.springframework.webflow.action.ViewFactoryActionAdapter.doExecute(ViewFactoryActionAdapter.java:40) at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188) at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51) ... 66 more Caused by: java.lang.NullPointerException at org.springframework.webflow.mvc.servlet.ServletMvcView.doRender(ServletMvcView.java:50) at org.springframework.webflow.mvc.view.AbstractMvcView.render(AbstractMvcView.java:187) ... 69 more " } Does anybody have any idea what the cause of this might be? From my login-webflow.xml: <action-state id="checkAccountType"> <evaluate expression="lookupAccountTypeAction.lookup(flowScope.principal)" /> <transition on="EMAIL" to="accountCannotLogInView" /> <transition on="Login" to="checkAccountStatus" /> <transition on="CONTACT" to="accountCannotLogInView" /> </action-state> <end-state id="accountCannotLogInView" view="myAccountCannotLogInView"/> From default_views.properties: myAccountCannotLogInView.(class)=org.springframework.web.servlet.view.JstlView myAccountCannotLogInView.url=/WEB-INF/view/jsp/default/ui/myAccountCannotLogInView.jsp From my log file: 2013-09-09 08:29:25,645 DEBUG [org.springframework.webflow.engine.EndState] - Entering state 'accountCannotLogInView' of flow 'login' 2013-09-09 08:29:25,645 DEBUG [org.springframework.webflow.execution.ActionExecutor] - Executing org.springframework.webflow.action.ViewFactoryActionAdapter#359d136a 2013-09-09 08:29:25,645 DEBUG [org.springframework.webflow.mvc.view.AbstractMvcView] - Rendering MVC [null] with model map [{flowRequestContext=[RequestControlContextImpl#55bf756b externalContext = org.springframework.webflow.mvc.servlet.MvcExternalContext#2bb4d74, currentEvent = EMAIL, requestScope = map['ticketGrantingTicketId' -> 'TGT-1-GxALVR7PEtbagbnRlStOTbHoRHlb61YVm1m2hvWx3pgWCEXgPb-cas01.example.org'], attributes = map[[empty]], messageContext = [DefaultMessageContext#cb5efc8 sourceMessages = map[[null] -> list[[empty]]]], flowExecution = [FlowExecutionImpl#3f5c0d33 flow = 'login', flowSessions = list[[FlowSessionImpl#419d87bc flow = 'login', state = 'accountCannotLogInView', scope = map['principal' -> sso_test_user, 'userInfoBean' -> com.mycompany.authentication.UserInfoBean#54394557[username=<null>,firstName=<null>,lastName=<null>,emailAddress=<null>,streetAddress=<null>,city=<null>,state=<null>,zip=<null>,country=<null>], 'changePasswordBean' -> com.mycompany.authentication.ChangePasswordBean(username=null, newPassword=null, confirmNewPassword=null), 'service' -> https://my.server.com:443/casauth/facade/norenew?idp=https://my.server.com/idp/externalAuthnCallback, 'credentials' -> [username: sso_test_user], 'warnCookieValue' -> false, 'ticketGrantingTicketId' -> 'TGT-1-GxALVR7PEtbagbnRlStOTbHoRHlb61YVm1m2hvWx3pgWCEXgPb-cas01.example.org']]]]], flashScope=map[[empty]], principal=sso_test_user, currentUser=null, userInfoBean=com.mycompany.authentication.UserInfoBean#54394557[username=<null>,firstName=<null>,lastName=<null>,emailAddress=<null>,streetAddress=<null>,city=<null>,state=<null>,zip=<null>,country=<null>], changePasswordBean=com.mycompany.authentication.ChangePasswordBean(username=null, newPassword=null, confirmNewPassword=null), service=https://my.server.com:443/casauth/facade/norenew?idp=https://my.server.com/idp/externalAuthnCallback, credentials=[username: sso_test_user], flowExecutionKey=e1s1, warnCookieValue=false, flowExecutionUrl=/authentication/login?username=%5BLjava.lang.String%3B%405b65afa5&submit=%5BLjava.lang.String%3B%4070eea883&_eventId=%5BLjava.lang.String%3B%4044796a61&service=%5BLjava.lang.String%3B%407f372965<=%5BLjava.lang.String%3B%407e7ee722&password=%5BLjava.lang.String%3B%403d78aa0f&execution=%5BLjava.lang.String%3B%403ce4de50, ticketGrantingTicketId=TGT-1-GxALVR7PEtbagbnRlStOTbHoRHlb61YVm1m2hvWx3pgWCEXgPb-cas01.example.org}] 2013-09-09 08:29:25,645 DEBUG [org.springframework.webflow.engine.impl.FlowExecutionImpl] - Attempting to handle [org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing org.springframework.webflow.action.ViewFactoryActionAdapter#359d136a in state 'accountCannotLogInView' of flow 'login' -- action execution attributes were 'map[[empty]]'] with root cause [java.lang.NullPointerException] 2013-09-09 08:29:25,645 DEBUG [org.springframework.webflow.engine.impl.FlowExecutionImpl] - Rethrowing unhandled flow execution exception And yes, the file does exist in that location. I've been banging on this for a few days, so if anybody has any insight, I'd really appreciate it.
And the correct answer is "user error". I'm building CAS via maven. I created profiles to hold logging, and then incorrectly configured it so that the default_views.properties file wasn't in the profiles. As a result, when CAS did its overlay as part of the maven build, it included the baseline default_views.properties instead of my copy.
it seems like your property is not parsed to your flow.xml. defining your view hardcoded should work. see here: Specifying view identifiers
The reason for this issue is: The JSP view is not found. In cas-servlet.xml, mention the properties file which has the basename of the custom JSP view inside the "viewResolver" bean as below: <bean id="viewResolver" class="org.springframework.web.servlet.view.ResourceBundleViewResolver" p:order="0"> <property name="basenames"> <util:list> <value>${cas.viewResolver.basename}</value> <value>custom_view</value> <value>protocol_views</value> </util:list> </property> </bean> And in the custom_view.properties, mention the following: casRegisterView.(class)=org.springframework.web.servlet.view.JstlView casRegisterView.url=/WEB-INF/view/jsp/default/ui/casRegisterView.jsp Here the JSP view is "casRegisterView.jsp". Place custom_view.properties in /src/main/resources.
Extracting exception thrown by unsuccessful message-processors in FirstSuccessful routing message processor
I am addressing a fail-safe scenario as below. But in the recoveryflow I am not able to get the exception or exceptionPayload that occurred due to the failure of the subflow1 or subflow2. Is there any way I can get the exception thrown by the unsuccessful message processors in the First-sucessful routing processor. I have looked into the Mule FirstSuccessful class code. From the loop in it, I can see the exception is caught but not saved. Is there a way I can extend and have my own first-successful which can provide me the exception as well? <flow name="main_flow" > .... .... <first-successful> <flow-ref name="subflow_1" /> <flow-ref name="recoveryFlow1" /> </first-successful> .... .... <first-successful> <flow-ref name="subflow_2" /> <flow-ref name="recoveryFlow2" /> </first-successful> .... .... </flow> <sub-flow name="subflow_1"> .... .... <out-bound call to web-service /> .... .... </sub-flow> <sub-flow name="subflow_2"> .... .... <out-bound call to web-service /> .... .... </sub-flow> <sub-flow name="revoceryFlow1" > <process communication based on the exception thrown by previous unsuccessful sub-flow 1> <some more processing so that the remaining main flow is not impacted because of the failue of the subflow 1 > </sub-flow> <sub-flow name="revoceryFlow2" > <process communication based on the exception thrown by previous unsuccessful sub-flow 2> <some more processing so that the remaining main flow is not impacted because of the failue of the subflow 2 > </sub-flow> Please advise if I am going in wrong direction. Is there any better approach than mine?
I got the solution. There is not straight solution from the Mule. I have overwriten the FirstSuccessful behaviour and added properties with the exception details. These properties are then accessed in the next message processors inside the first-successful. catch (Exception ex) { event.getMessage().setProperty("prevError", ex.getMessage() , PropertyScope.INVOCATION); event.getMessage().setProperty("prevErrorClass", ex.getClass() , PropertyScope.INVOCATION); failed = true; }
How to configure 2.6 spring: Failed to create route route2 at:
I'm trying to upgrade from Camel 2.0 to 2.6 I have this in my applicationContext-camel.xml file... <camel:route > <camel:from uri="transactionSaleBuffer" /> <camel:policy ref="routeTransactionPolicy"/> <camel:transacted ref="transactionManagerETL" /> <camel:to uri="detailFactProcessor" /> </camel:route> by adding in the two lines in the middle (policy and transacted) I get the exception... Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route2 at: >>> From[transactionSaleBuffer] <<< in route: Route[[From[transactionSaleBuffer]] -> [Tr ansacted[ref:trans... because of Route route2 has no output processors. You need to add outputs to the route such as to("log:foo"). I can see this is because the Camel class RouteDefinition.java makes a call to ProcessorDefinitionHelper.hasOutputs(outputs, true). This passes in an array of one Object ([Transacted[ref:transactionManagerETL]]) This one object has one two children [Transacted[ref:transactionManagerETL]] CHILD-[Policy[ref:routeTransactionPolicy], CHILD-To[detailFactProcessor] The Policy child has no outputs, so the exception is thrown. Yet I don't know how to add a child, my XML above matches the schema. Maybe I'm missing something else? My setup matches the example...Apache Camel: Book in One Page (See section: Camel 1.x - JMS Sample) Can anyone please help me out. Thanks! Jeff Porter
Try as follows <camel:route> <camel:from uri="transactionSaleBuffer" /> <camel:transacted ref="transactionManagerETL" /> <camel:policy ref="routeTransactionPolicy"> <camel:to uri="detailFactProcessor" /> </camel:policy> </camel:route>
Can you guess where this exception is coming from?
I've deployed a GWT app and have set up an exception reporter so that I get log entries on the server when a client throws an exception. Usually this is very helpful and I've killed a lot of bugs with this information. However, this stack trace has me stumped: com.allen_sauer.gwt.log.server.ServerLogImplJDK14 log: Uncaught Exception: com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, see full set in UmbrellaException#getCauses at Unknown.EJb(StackTraceCreator.java:147) at Unknown.SAb(StackTraceCreator.java:387) at Unknown.eHb(Throwable.java:46) at Unknown.KXb(com.google.gwt.dev.jjs.ast.JProgram:0) at Unknown.AM(SimpleEventBus.java:214) at Unknown.EM(SimpleEventBus.java:103) at Unknown.bXb(HandlerManager.java:96) at Unknown.ux(Widget.java:107) at Unknown.USb(DomEvent.java:116) at Unknown.xx(UIObject.java:529) at Unknown.Mx(Widget.java:141) at Unknown.ixc(DOM.java:1264) at Unknown.anonymous(DOMImplStandard.java:187) at Unknown.HIb(Impl.java:214) at Unknown.anonymous(Impl.java:57) at .(:0) at ==================Caused by==================.(:0) at Unknown.EJb(StackTraceCreator.java:147) at Unknown.SAb(StackTraceCreator.java:387) at Unknown.y0c(Throwable.java:46) at Unknown.KZc(Number.java:192) at Unknown.Y$c(Float.java:60) at Unknown.wV(TextBoxBase.java:106) at Unknown.yTb(ClickEvent.java:53) at Unknown.AM(SimpleEventBus.java:204) at Unknown.EM(SimpleEventBus.java:103) at Unknown.bXb(HandlerManager.java:96) at Unknown.ux(Widget.java:107) at Unknown.USb(DomEvent.java:116) at Unknown.xx(UIObject.java:529) at Unknown.Mx(Widget.java:141) at Unknown.ixc(DOM.java:1264) at Unknown.anonymous(DOMImplStandard.java:187) at Unknown.HIb(Impl.java:214) at Unknown.anonymous(Impl.java:57) These are all GWT files, except StackTraceCreator, which is part of gwt-log, the program reporting these exceptions to me. I've never seen this exception on a development machine, and I don't have even the beginnings of reproduction steps. How can I start to track this down?
GWT apps are by default compiled with obfuscation turned on. So you can either turn obfuscation off, or try to re-symbolize your stack traces, as explained in this issue report of gwt-log: http://code.google.com/p/gwt-log/issues/detail?id=38 This should probably be used best together with these options in your .gwt.xml file (I assume, you already did that): <set-property name="compiler.emulatedStack" value="true" /> <set-configuration-property name="compiler.emulatedStack.recordLineNumbers" value="true"/> <set-configuration-property name="compiler.emulatedStack.recordFileNames" value="true"/> (see http://code.google.com/p/gwt-log/wiki/GettingStarted)