Why am i getting such an error and what does it mean?----> [Connection Error] Cannot connect to null port handle

In reply to chr_sue:


`include "seq_item.sv";
`include "aes_package.sv"; 

class aes_subscriber extends uvm_subscriber#(encrypt_seq_item);
   `uvm_component_utils(aes_subscriber)
    uvm_analysis_port#(encrypt_seq_item) port_1;
   //encrypt_seq_item tx;
   aes_pkg pkg_1;

   // int KEY_LENGTH;
   // int ROUNDNO ;
   // bit valid_in;
   // bit valid_out;
   // int key_len=KEY_LENGTH;
   // int round_num;
   encrypt_seq_item tx;

   //uvm_analysis_port#()   ap_01;
   function new(string name, uvm_component parent);
      super.new(name, parent);
	  tx=new();
	  port_1 = new("port_1", this);
      $display("In the susbcriber block");
   endfunction
   function void build_phase(uvm_phase phase);
      super.build_phase(phase);
   endfunction 
   

   //bit[KEY_LENGTH - 1] key_in;
   //bit[KEY_LENGTH - 1] key_out;
   
   //write(encrypt_seq_item tx);
   // uvm_analysis_port#(uvm_sequence_item) ap;

   function void write(encrypt_seq_item t);
      int k;
      tx = t;
	  if(tx.key_width==128 | tx.key_width == 192 | tx.key_width == 256)
	  begin
	  	$display("valid key");
	  end 
	  else
	  begin
	  	$display("incorrect key length");
	  end 
	  
	  if(tx.key_width == 128)
	  begin
	     k=10;
		 key_gen_128(k,tx.key,tx.data);   
	  end 
	  else if(tx.key_width == 192)
	  begin
	     k=12;
		 //key_gen_192(k,tx.key,tx.from_file);   
	  end 
	  else if(tx.key_width ==256)
	  begin
	     k=16;
		// key_gen_256(k,tx.key,tx.from_file);   
	  end
	  else
	  begin
	     $display("not a correct key_width");
	  end 
	  
	  
	  
	  
 
      $display("From Subscriber");
      //if(tx.pkt_type == )
      //tx.print();
	//virtual task encryption;
	endfunction:write
    function key_gen_128(round_num,key_in,valid_in);
	    //const int l = key_len;
	    bit  [31 : 0] key_msb_xor_in ;
		bit  [127 : 0] key_out_int ;

	    //key_msb_xor_in = {look_up_key(int`(unsigned(key_in[23:16]),look_up_key(int`(unsigned(key_in[15:8]))),look_up_key(int(unsigned(key_in[7:0]))),look_up_key(int(unsigned(key_in[31:24])))}
	   // key_msb_xor_in = {look_up_key(int`(unsigned`(key_in[23:16])),look_up_key(int`(unsigned(key_in[15:8]))),look_up_key(int(unsigned(key_in[7:0]))),look_up_key(int(unsigned(key_in[31:24])))}
		//key_msb_xor_in = look_up_key($rtoi($bitstoreal(unsigned'(key_in)))) ;
		key_msb_xor_in = pkg_1.look_up_key[$rtoi($bitstoreal(unsigned'(key_in)))];
		$display("key_msb_xor_in is  %p", key_msb_xor_in);
		//key_out_int[key_len - 1 : key_len - 32] = key_in[key_len -1: key_len-32];
	//endtask:encryption
	endfunction:key_gen_128	
endclass


above is the code of mine …can u suggest why is no port handle is being constructed…