What does your persistence.xml look like? You probably need to change the JNDI name as the rules have changed since JBoss 5. Here is an unit test link that uses the feature (works on AS 7.1 but not 7.0.x). The linked Arquillian test contains the persistence.xml.
Also, make sure you change the JNDI name. "
" should work but not "java:/hibernate/SessionFactory".
Some naming rules from an earlier dev list email:
1) Unqualified relative names like "DefaultDS" or "jdbc/DefaultDS"
should be qualified relative to "java:comp/env", "java:module/env", or
"java:jboss/env", depending on the context.
2) Unqualified "absolute" names like "/jdbc/DefaultDS" should be
qualified relative to a "java:jboss/root" name.
3) Qualified "absolute" names like "java:/jdbc/DefaultDS" should be
qualified the same way as #2.
4) The special "java:jboss" namespace is shared across the entire AS
5) Any "relative" name with a "java:" lead-in must be in one of the five namespaces: "comp", "module", "app", "global", or our proprietary "jboss". Any name starting with "java:xxx" where "xxx" is a name which
is not equal to one of the above five would result in an invalid name error.
This allows us to have predictable and consistent rules for every name
bound in the AS. It also lets us define additional namespaces as specs
evolve without running into compatibility problems.