title: call a method in a java class with jsf
body: <p>this is the bean </p>
  
  <pre><code>       package Bean;
        public class AlarmeBean {
  
  public String getOID() {
      return OID;
  }
  public void setOID(String oID) {
      OID = oID;
  }
  public String getAdrip() {
      return adrip;
  }
  public void setAdrip(String adrip) {
      this.adrip = adrip;
  }
  public String getDate() {
      return date;
  }
  public void setDate(String date) {
      this.date = date;
  }
  public String getSeverity() {
      return severity;
  }
  public void setSeverity(String severity) {
      this.severity = severity;
  }
  private String OID;
  private String adrip;
  private String date;
  private String severity;
  
  
  public void alarme(){
      Manager manager=new Manager(162);   
  System.out.println("listnning on :"+manager.trapReceiver.getPort());
  
  
  manager.trapReceiver.addTrapListener(manager);
  
     }
  </code></pre>
  
  <p>this is the class manager</p>
  
  <pre><code>          package Bean;
  
            import com.adventnet.snmp.beans.SnmpTrapReceiver;
           import com.adventnet.snmp.beans.TrapEvent;
            import com.adventnet.snmp.beans.TrapListener;
  
      public class Manager implements TrapListener {
  SnmpTrapReceiver trapReceiver =new SnmpTrapReceiver();
  
  
  
           public Manager(int port ){
  
         trapReceiver.setPort(port);
  
              }
  
  
  public void receivedTrap(TrapEvent trapEvent) {
      System.out.println("TrapEvent received." + "\n" +
           "Received a trap from:" + trapEvent.getRemoteHost () + 
             "Community is:" + trapEvent.getCommunity () + "\n" +
       "Agent Address is:" + trapEvent.getAgentAddress () + "\n" +
           "Enterprise OID:" + trapEvent.getEnterprise () + "\n" +
         "Trap Variable OID:" + trapEvent.getObjectID (0) + 
                              "\n");
                }
  
           }
  </code></pre>
  
  <p>and in the xhtml i writed a commandbutoom to call the alarme methode in the alarmeBean</p>
  
  <pre><code>   &lt;p:commandButton process="form" value="call" action={AlarmeBean.alarme}" /&gt;
  </code></pre>
  
  <p>but i have this error : <i>La classe de bean ou de propriété «Bean.Alarme» du bean géré «alarmeBean» ne peut pas être chargée à cause de l’absence de la dépendance com/adventnet/snmp/beans/TrapListener.</i></p>
  
  <p>if i execute the class manager out of this web project it works normally but (it will rturn in the console "listnning on :162") </p>