0

I've added clustering capabilities to our application, running on wildfly. Part of that application is several JSF pages. One of them contains following code:

<c:forEach var="area" items="#{MissingSearchBean.workingAreas}">
    <h:commandButton value="#{area.workingAreaName}(#{area.count})"
        action="#{MissingSearchBean.selectWorkingArea(area.workingAreaName)}"
        styleClass="commandButton" />
</c:forEach>

When I'm trying to open page, which includes that code I see following error message in logs:

12:22:52,562 WARN  [org.wildfly.clustering.web.undertow] (default task-8) javax.transaction.HeuristicMixedException: org.infinispan.commons.CacheException: javax.transaction.HeuristicMixedException
    at org.wildfly.clustering.ee.infinispan.InfinispanBatch.close(InfinispanBatch.java:74)
    at org.wildfly.clustering.web.undertow.session.DistributableSession.requestDone(DistributableSession.java:81)
    at io.undertow.servlet.spec.ServletContextImpl.updateSessionAccessTime(ServletContextImpl.java:814)
    at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:565)
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:339)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javax.transaction.HeuristicMixedException
    at org.infinispan.transaction.tm.DummyTransaction.finishResource(DummyTransaction.java:439)
    at org.infinispan.transaction.tm.DummyTransaction.commitResources(DummyTransaction.java:448)
    at org.infinispan.transaction.tm.DummyTransaction.runCommit(DummyTransaction.java:321)
    at org.infinispan.transaction.tm.DummyTransaction.commit(DummyTransaction.java:108)
    at org.wildfly.clustering.ee.infinispan.InfinispanBatch.close(InfinispanBatch.java:71)
    ... 23 more
Caused by: javax.transaction.xa.XAException
    at org.infinispan.transaction.impl.TransactionCoordinator.handleCommitFailure(TransactionCoordinator.java:213)
    at org.infinispan.transaction.impl.TransactionCoordinator.commit(TransactionCoordinator.java:159)
    at org.infinispan.transaction.xa.TransactionXaAdapter.commit(TransactionXaAdapter.java:114)
    at org.infinispan.transaction.tm.DummyTransaction.finishResource(DummyTransaction.java:401)
    ... 27 more
Caused by: org.infinispan.commons.marshall.NotSerializableException: javax.servlet.jsp.jstl.core.IteratedExpression
Caused by: an exception which occurred:
    in field iteratedExpression
    in field delegate
    in field m
    in object java.util.HashMap@debeda47
    in object org.wildfly.clustering.marshalling.jboss.SimpleMarshalledValue@debeda47
    in object org.infinispan.commands.write.PutKeyValueCommand@2fe35c91
    in object org.infinispan.commands.tx.PrepareCommand@7d0fe770

Reason for this error is pretty obvious: javax.servlet.jsp.jstl.core.IteratedExpression is not Serializable. I'll tell you more: implemets Serializable is commented out there!

Question is: what can I do about that? I there any way for this JSF to lay into infinispan for user be able to use it?

asm0dey
  • 2,387
  • 2
  • 17
  • 27
  • Hi, titles should be more explicit ('error' is to generic and otherwise it only contains tags. Tags are already explicit added to the question so superfluous in the title. And the java tag is only for things that can be reproduced in a plain jdk with a class and a main. – Kukeltje Oct 02 '18 at 13:11
  • 1
    The error btw is in JSTL (c:foreach), not JSF. You ,most likely have the same error if you remove the commandButton. Question is more why the view (with the c:foreach in it) is being serialized... – Kukeltje Oct 02 '18 at 13:15
  • @BalusC I can't see how this question duplicate those one. – asm0dey Oct 02 '18 at 14:47
  • @Kukeltje nop, I don't have this error if I remove commandButton. But if replace it with ouputLabel — then I have. – asm0dey Oct 02 '18 at 14:49
  • I'm no JSP/JSF expert, how is this a duplicate? Does fixing JSP/JSF usage fix the not serializable issue? From an Infinispan perspective, something is ending up in the session data that is not supposed to, or not expected to be in session. Anyway, seems like it's been asked again in [here](https://stackoverflow.com/questions/52629487/wildfly-10-in-cluster-tries-to-serialize-jsp-with-org-infinispan-commons-marshal) ? – Galder Zamarreño Oct 08 '18 at 06:15

0 Answers0