Here's the SCCE I've written. I'm completely new to java web application programming which means it's completely possible that I'm missing something. So any advice for a newbie moving forward is really appreciated. I've tried referencing the package name as well with no luck. Is there anything I should be referencing for the Session bean in web.xml? because these files are in the WAR file inside the deployed EAR file. I should note that I'm using java server faces, and EE7.
GlassFish4 error
/index.xhtml @10,78 binding="#{serverSessionBean.time}": Target Unreachable, identifier 'ServerSessionBean'
Index Welcome file
<?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></title>
</h:head>
<h:body>
The current server time is:
<h:outputText binding="#{serverSessionBean.time}"/>
</h:body>
</html>
ServerSessionBean
package com.incredibleifs;
import java.util.Calendar;
import javax.ejb.Stateless;
import javax.inject.Named;
@Stateless(description = "A stateless session bean to hold server generic business methods such as getting the date and time")
@Named()
public class ServerSessionBean implements ServerSessionBeanLocal {
@Override
public int getTime() {
return Calendar.getInstance().get(Calendar.SECOND);
}
}