tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Secure EJBs testing with Arquillian
Date Thu, 10 Jan 2013 21:36:09 GMT
typically you should look a bit upper in the logs to find the real reason,
it is logged in warning or severe level.


*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/1/10 Luca Merolla <luca.merolla@gmail.com>

> Yes I have added users.properties and groups.properties and now the
> authorization is working.
>
> I have still problems with "sub-dependencies". For example, if I create a
> CountryBeanTest with arquillian and CountryBean looks like that:
>
> public class CountryBean implements CountryBeanLocal {
> @EJB
> private CountryEAOLocal countryEAO;
>
> public List<Country> getAllCountries() {
> return countryEAO.getAllCountries();
> }
> }
>
> Arquillian test inject countryBean, but I get NPE
> on countryEAO.getAllCountries() because the CountryEAOLocal is not
> injected.
>
> In the ShrinkWrap of my CountryBeanTest I
> have .addClasses(CountryBean.class, CountryBeanLocal.class), but if I
> add .addClasses(CountryBean.class,
> CountryBeanLocal.class, CountryEAO.class, CountryEAOLocal.class) I get:
>
> SEVERE: Unable to deploy collapsed ear in war
>
> StandardEngine[Tomcat].StandardHost[localhost].StandardContext[/application2]
> org.apache.openejb.config.ValidationFailedException: Module failed
> validation. AppModule(name=application2)
>
>
>
> On Thu, Jan 10, 2013 at 1:55 AM, Romain Manni-Bucau
> <rmannibucau@gmail.com>wrote:
>
> > yep, did you set the jaas system property?
> >
> > *Romain Manni-Bucau*
> > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > *Blog: **http://rmannibucau.wordpress.com/*<
> > http://rmannibucau.wordpress.com/>
> > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > *Github: https://github.com/rmannibucau*
> >
> >
> >
> > 2013/1/10 Luca Merolla <luca.merolla@gmail.com>
> >
> > > I have added INITIAL_CONTEXT_FACTORY and now I get:
> > >
> > > javax.security.auth.login.FailedLoginException: User does not exist
> > >
> > > while before I was getting : javax.ejb.EJBAccessException: Unauthorized
> > > Access by Principal Denied
> > >
> > > I guess now I need to configure some sort of users.properties file with
> > > users and password.
> > >
> > >
> > > On Thu, Jan 10, 2013 at 1:12 AM, Romain Manni-Bucau
> > > <rmannibucau@gmail.com>wrote:
> > >
> > > > it basically does the same
> > > >
> > > > maybe you'll need to specify Context.INITAL_CONTEXT_FACTORY (normally
> > no
> > > > but depend how you run the test)
> > > >
> > > > *Romain Manni-Bucau*
> > > > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > > > *Blog: **http://rmannibucau.wordpress.com/*<
> > > > http://rmannibucau.wordpress.com/>
> > > > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > > > *Github: https://github.com/rmannibucau*
> > > >
> > > >
> > > >
> > > > 2013/1/10 Luca Merolla <luca.merolla@gmail.com>
> > > >
> > > > > I was actually trying something similar already, basically the
> > previous
> > > > > "login" method  was the following
> > > > >
> > > > > Properties properties = new Properties();
> > > > > properties.put(Context.SECURITY_PRINCIPAL, username);
> > > > > properties.put(Context.SECURITY_CREDENTIALS, password);
> > > > >
> > > > > final Context context = new InitialContext(properties);
> > > > >
> > > > > but the access was not authorized, then I found the previous
> example
> > > and
> > > > I
> > > > > thought there was a need of having this ArquillianContext class
> > > > >
> > > > > On Thu, Jan 10, 2013 at 12:44 AM, Romain Manni-Bucau
> > > > > <rmannibucau@gmail.com>wrote:
> > > > >
> > > > > > new InitialContext
> > > > >
> > > >
> > >
> > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message