Error in JSF after Pressing Action Button

Asked 2 years ago, Updated 2 years ago, 119 views

In JSF, we implemented the following action buttons in xhtml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"
     xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:head>
    <title>Sample</title>
</h:head>
    <h:body>
        <h2>test</h2>
        <h:form>
            <h:commandButton value="Read" action="#{personalInformationStatefulBean.load()}"/>
        </h:form>
    </h:body>
</html>

Run this program and press the
Load button. I'd like to call the loading method for the PersonalInformationStatefulBean class.
In fact, there is a 60% chance that stackTrace will be printed as follows.

javax.servlet.ServletException: java.lang.RuntimeException: Unable to locate a business interface decoding public void BusinessLogic.PersonalInformationStatefulBean.load()
javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
io.undertow.servlet.handlers.ServletHandler.handleRequest (ServletHandler.java:85)
io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest (ServletSecurityRoleHandler.java:61)
io.undertow.servlet.handlers.ServletDispatchedHandler.handleRequest (ServletDispatchedHandler.java:36)
org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest (SecurityContextAssociationHandler.java:78)
io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43)
io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest (SSLInformationAssociationHandler.java:131)
io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest (ServletAuthenticationCallHandler.java:56)
io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43)
io.undertow.security.handlers.AbstractConfidentityHandler.handleRequest (AbstractConfidentityHandler.java:45)
io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest (ServletConfidentialityConstraintHandler.java:63)
io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest (AuthenticationMechanismsHandler.java:58)
io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest (CachedAuthenticatedSessionHandler.java:70)
io.undertow.security.handlers.SecurityInitialHandler.handleRequest (SecurityInitialHandler.java:76)
io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43)
org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest (JACCContextIdHandler.java:61)
io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43)
io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43)
io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest (ServletInitialHandler.java:261)
io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest (ServletInitialHandler.java:247)
io.undertow.servlet.handlers.ServletInitialHandler.access$000 (ServletInitialHandler.java:76)
io.undertow.servlet.handlers.ServletInitialHandler $1.handleRequest (ServletInitialHandler.java:166)
io.undertow.server.Connectors.executeRootHandler (Connectors.java:197)
io.undertow.server.HttpServerExchange$1.run (HttpServerExchange.java:759)
java.util.current.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.current.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)

However, there are cases where it can be executed normally with a probability of about 40%, so it is a situation that worries me.
What are the possible causes?

java xhtml jsf

2022-09-30 19:11

1 Answers

The definition of View itself does not appear to be a problem.What is the definition of PersonalInformationStatefulBean?I guess it's just a name, but it looks like you're calling EJB directly.

Are you using CDI Management Bean (@Named)?


2022-09-30 19:11

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.