我有一个使用 JPA 的 JSF 项目,我这样做:从 mysql 数据库检索一些数据,然后将数据绘制在图表中。
Locally works pretty fine, as you can see 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:
这是我的 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