Skip to content

Commit

Permalink
WELD-633 Set Precedence to 101 so this Provider can be loaded first. …
Browse files Browse the repository at this point in the history
…Having the default provided JNDI based providers load first result in a NoClassDefFoundError in Google App Engine. InitialContext is not allowed in this environment
  • Loading branch information
aslakknutsen authored and pmuir committed Aug 26, 2010
1 parent 0ecbdc0 commit eead975
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@

/**
* Implements the Weld Extensions {@link BeanManagerProvider} SPI. Used to get {@link BeanManager}
* from outside a Servlet context.
*
* from outside a Servlet context.<br/>
* <br/>
* This Provider has a Precedence of 101, it needs to be loaded before any other in a Google App Engine Environment. The default provided
* JNDI based providers will fail in Google App Engine with a NoClassDefFoundError, reference to InitialContext is not allowed:<br/>
* java.lang.NoClassDefFoundError: javax.naming.InitialContext is a restricted class. Please see the Google App Engine developer's guide for more details.
* <br/>
* @author <a href="mailto:aslak@redhat.com">Aslak Knutsen</a>
* @version $Revision: $
* @see BeanManagerAccessor
Expand All @@ -38,7 +42,7 @@ public class WeldServletBeanManagerProvider implements BeanManagerProvider, Exte

public int getPrecedence()
{
return 50;
return 101;
}

public BeanManager getBeanManager()
Expand Down

0 comments on commit eead975

Please sign in to comment.