shiro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe Sousa <>
Subject Re: Guice + Shiro + GWT
Date Fri, 05 Aug 2011 11:32:02 GMT

I didn't know there was a guice module being developed for shiro

I'm trying the examples on the documentation but I'm getting a warning

Aug 5, 2011 12:28:49 PM$BackwardsCompatibleServletContextProvider
WARNING: You are attempting to use a deprecated API (specifically,
attempting to @Inject ServletContext inside an eagerly created
singleton. While we allow this for backwards compatibility, be warned
that this MAY have unexpected behavior if you have more than one
injector (with ServletModule) running in the same JVM. Please consult
the Guice documentation at for more

public class GuiceListener extends GuiceServletContextListener {
	private ServletContext servletContext;

	protected Injector getInjector() {
		return Guice.createInjector(DEVELOPMENT, new
MyShiroWebModule(servletContext), new MyApplicationModule());

	public void contextInitialized(ServletContextEvent servletContextEvent) {
		servletContext = servletContextEvent.getServletContext();

public class MyShiroWebModule extends ShiroWebModule {
	public MyShiroWebModule(ServletContext servletContext) {

	protected void configureShiroWeb() {
		addFilterChain("/**", AUTHC_BASIC);

public class MyApplicationModule extends ServletModule {
	protected void configureServlets() {
		bind(DataSource.class).toProvider(fromJndi(DataSource.class, "jdbc/rad"));

On Thu, Aug 4, 2011 at 11:38 PM, Jared Bunting
<> wrote:
> I don't know much about GWT, but I can help you with basic Guice
> integration.
> The current release of Shiro (1.1.0) doesn't have Guice support, but the
> trunk codebase does (1.2.0-SNAPSHOT).  To get started, have a look at the
> documentation here:
> Once you've done that, I'd be happy to answer any more specific questions
> that you may have.
> -Jared
> On 08/04/2011 05:15 PM, Fabricio Pizzichillo wrote:
> hello friends.
> I am a beginner with shiro. I'm trying to integrate with an
> application developed with GWT + Guice + Postgresql. Can be oriented on how
> to configure the servlet Guice as authenticating users database?
> Thank you very much and greetings

Filipe Sousa

View raw message