Permalink
Browse files

Fixing looking up BeanManager

  • Loading branch information...
1 parent 5c1036f commit 5dad9650291f5643c28e3c3fd0dc54cd7d42dffe @adamw committed Jul 28, 2010
Showing with 7 additions and 2 deletions.
  1. +7 −2 cdi/src/main/java/pl/softwaremill/cdiext/util/BeanInject.java
@@ -48,9 +48,14 @@
private static BeanManager getBeanManager() {
try {
- return (BeanManager) new InitialContext().lookup("java:app/BeanManager");
+ return (BeanManager) new InitialContext().lookup("java:comp/BeanManager");
} catch (NamingException e) {
- throw new RuntimeException(e);
+ try {
+ return (BeanManager) new InitialContext().lookup("java:app/BeanManager");
+ } catch (NamingException e1) {
+ throw new RuntimeException(e1);
+ }
+
}
}
}

0 comments on commit 5dad965

Please sign in to comment.