Use the JBoss Messaging forum for JBoss5
I did not know if I have MQ or Messaging till I posted this thread.
I solved the problem. The reason for the error was a wrong version of the jboss-j2ee.jar in my library. Especally the ConnectionFactory Interface in it.
So I changed it with the jboss-j2ee.jar of the current jboss-j2ee.jar of the Server.