Answering myself for the records...

Yes, you can use shiro 1.2 with any OSGi environment that uses the org.osgi.service.http, with each container specific extended(Felix and Equinox has one), but ONLY if you use the deprecated Filter org.apache.shiro.web.servlet.IniShiroFilter

If you try to use the new recomended filter org.apache.shiro.web.servlet.ShiroFilter you will receive this error:

ERROR org.eclipse.equinox.cm - javax.servlet.ServletException: java.lang.IllegalStateException: No WebEnvironment found: no EnvironmentLoaderListener registered? java.lang.RuntimeException: javax.servlet.ServletException: java.lang.IllegalStateException: No WebEnvironment found: no EnvironmentLoaderListener registered?

To use IniShiroFilter you MUST create a Bundle-Fragment and include the shiro.ini inside it and export it.

regards


On 18/01/12 13:55, Cristiano Gavião wrote:
Hi,

I have one web application that is running inside a equinox osgi container and it don't use web.xml.

Now I'm trying to figure out how could I use Shiro in such environment.

I already could figure out how to setup the Filter using equinox ExtendedHttpService. But I couldn't find in Equinox a defined API to register listeners.

So, would be possible to use Shiro without registering the org.apache.shiro.web.env.EnvironmentLoaderListener ?

thanks for any tip.

regards,

Cristiano





Reply via email to