-
1. Re: SessionFactory in Jboss AS7
smarlow Feb 17, 2012 6:53 AM (in response to wichkabashir)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.
Scott
-
2. Re: SessionFactory in Jboss AS7
jaikiran Feb 17, 2012 6:57 AM (in response to wichkabashir)I just updated the https://docs.jboss.org/author/display/AS71/JPA+Reference+Guide to include the "Binding EntityManagerFactory to JNDI" section. Take a look at that.
-
3. Re: SessionFactory in Jboss AS7
smarlow Feb 17, 2012 7:12 AM (in response to jaikiran)Also, make sure you change the JNDI name. "
java:jboss/
SessionFactory" 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
server instance.
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.
Scott