项目上线时Manager Bean不返回

2024-04-02

我有一个使用 JPA 的 JSF 项目,我这样做:从 mysql 数据库检索一些数据,然后将数据绘制在图表中。

Locally works pretty fine, as you can see here: enter image description here

So I deploy the project in my GlassFish 3 Open Source, which is running in a EC2 instance, then I try to make the same operation again but it seems the ManagedBean do not returns to the page correctly: enter image description here

这是我的 ManageBean :

@ManagedBean(name="reportc")
@SessionScoped
public class ReportControl implements Serializable {
    private static final long serialVersionUID = 3269125738504434502L;

    @EJB LogEAO logEAO;

    private int quantity;

    @NotNull(message="informe um intervalo")
    private String time;

    @NotNull(message="informe um ponto")
    private String point;

    private Map<String, Object> data = new HashMap<String, Object>();

    @PostConstruct
    public void init(){
        quantity = 1;
    }

    public String getDataAsJson() {
        return new Gson().toJson(data);
    }

    public String generateReport(){
        this.setTitles();
        this.getValues(getLog());

        return "/showroom/report.xhtml?faces-redirect=true";
    }
    .. methods and get's and set's

我已经查看了我的 server.log 以查看是否有问题,但似乎一切正常。

[#|2012-03-31T14:30:06.594+0000|WARNING|glassfish3.1.1|javax.enterprise.resource.webcontainer.jsf.application|_ThreadID=25;_ThreadName=Thread-2;|JSF1064: Unable to find or serve resource, image/structure/pic-1.gif.|#]

[#|2012-03-31T14:30:15.558+0000|FINE|glassfish3.1.1|org.eclipse.persistence.session.file:/home/ec2-user/usr/local/glassfish3/glassfish3/glassfish/domains/domain1/applications/BrainSet/WEB-INF/classes/_BrainSet.sql|_ThreadID=24;_ThreadName=Thread-2;ClassName=null;MethodName=null;|SELECT ID, TIME, VALUE, id_point FROM log WHERE (((id_point = ?) AND (TIME >= ?)) AND (TIME <= ?))
        bind => [3 parameters bound]|#]

[#|2012-03-31T14:30:15.585+0000|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=24;_ThreadName=Thread-2;|EXECUTION TIME:0:0|#]

[#|2012-03-31T14:30:15.585+0000|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=24;_ThreadName=Thread-2;|LOGS SIZE : 0|#]

[#|2012-03-31T14:30:16.690+0000|WARNING|glassfish3.1.1|javax.enterprise.resource.webcontainer.jsf.application|_ThreadID=24;_ThreadName=Thread-2;|JSF1064: Unable to find or serve resource, image/structure/pic-1.gif.|#]

[#|2012-03-31T14:35:53.578+0000|FINE|glassfish3.1.1|org.eclipse.persistence.session.file:/home/ec2-user/usr/local/glassfish3/glassfish3/glassfish/domains/domain1/applications/BrainSet/WEB-INF/classes/_BrainSet.sql|_ThreadID=28;_ThreadName=Thread-2;ClassName=null;MethodName=null;|SELECT ID, TIME, VALUE, id_point FROM log WHERE (((id_point = ?) AND (TIME >= ?)) AND (TIME <= ?))
        bind => [3 parameters bound]|#]

[#|2012-03-31T14:35:53.605+0000|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=28;_ThreadName=Thread-2;|EXECUTION TIME:0:0|#]

[#|2012-03-31T14:35:53.605+0000|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=28;_ThreadName=Thread-2;|LOGS SIZE : 0|#]

我真的不知道为什么会发生这种情况,而且这是我第一次尝试部署一个同时使用 JPA 和 JSF 的项目。 这可能是什么做的?

EDIT:还有一件事,在本地模式下,当我单击生成报告时,需要几秒钟的时间才能进入数据库,进行数学计算并返回我的页面,但是当它处于生产模式时,当我单击生成报告时,它只会刷新页面,为什么会发生这种情况? 我真的需要知道为什么......请帮助我。

EDIT 2:

大家可以在这里在线查看:http://50.19.242.172:8080/BrainSet/showroom/report.xhtml http://50.19.242.172:8080/BrainSet/showroom/report.xhtml


刚刚又玩了一下图表...

我确实正确地获得了图表...难道您一开始就没有在生产中收集数据...?因为现在有

我还收到警报说

serverError:类 javax.faces.el.E​​valuationException 对于输入字符串:“true”

检查与图表“下拉菜单”相关的 EL 表达式......

b.t.w here another successful screenshot : enter image description here

所以看起来像是工作...您可能需要重新定义您的问题...

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

项目上线时Manager Bean不返回 的相关文章

随机推荐