You need make sure your code which creates the HtmlTab and the richfaces-ui.jar (in this case) are on the same classpath. If you have an ear with an ejb, and are trying to do this in the EJB they won't be.
Yes, my session bean is the one trying to do it. How should I package richfaces? Or I shouldn´t be doing this?