My server is showed but if i trz to join it says connection failed!

i tried it one time and did all things and my server shows up n the server list but if i try to join it says connection failed. also my friend tryed it too but he has the same problem plsss help