users@glassfish.java.net

Re: Embedded Glassfish and security questions

From: <forums_at_java.net>
Date: Thu, 21 Apr 2011 07:14:01 -0500 (CDT)

[quote]It is possible to test secure EJB3s with GF embedded server as well.
Dynamic creation of file users can then be done using the CommandRunner
API.[/quote]

Yes, I know. I'm using it. In my original post the link to a test project
didn't get through but here it is proper:

  * Project:

http://users.telenet.be/nicks_auditorium/test/gf-3.0/arquillian.tests-3.0.zip
    [1]
  * Maven output log:
    http://users.telenet.be/nicks_auditorium/test/gf-3.0/maven.log [2]
  * Maven test log:
    http://users.telenet.be/nicks_auditorium/test/gf-3.0/test.ejb.TestCase.txt
    [3]

This is a test with *Glassfish Embedded 3.0*.

If I run the test I get a *java.lang.IllegalStateException: No mapping
available for role reference role1* although I provided an *ejb-jar.xml* and
a *sun-ejb-jar.xml* with the necessary mappings.

I also tried with *Glassfish Embedded 3.1* but here I get the error I
mentioned in my original post: a *java.lang.IndexOutOfBoundsException* here:

final List<String> serverNames = Server.getServerNames(); // Empty list!!
final Server server = Server.getServer(serverNames.get(0));
I noticed that for my code to compile with GF 3.1 I had to import
*org.glassfish./internal/.embedded.Server* instead of
*org.glassfish./api/.embedded.Server* for GF 3.0. Both seem to have the same
methods.

  * Project:

http://users.telenet.be/nicks_auditorium/test/gf-3.1/arquillian.tests-3.1.zip
    [4]
  * Maven output log:
    http://users.telenet.be/nicks_auditorium/test/gf-3.1/maven.log [5]
  * Maven test log:
    http://users.telenet.be/nicks_auditorium/test/gf-3.0/test.ejb.TestCase.txt
    [6]

Can you shed some light on these issues?


[1]
http://users.telenet.be/nicks_auditorium/test/gf-3.0/arquillian.tests-3.0.zip
[2] http://users.telenet.be/nicks_auditorium/test/gf-3.0/maven.log
[3]
http://users.telenet.be/nicks_auditorium/test/gf-3.0/test.ejb.TestCase.txt
[4]
http://users.telenet.be/nicks_auditorium/test/gf-3.1/arquillian.tests-3.1.zip
[5] http://users.telenet.be/nicks_auditorium/test/gf-3.1/maven.log
[6]
http://users.telenet.be/nicks_auditorium/test/gf-3.1/test.ejb.TestCase.txt

--
[Message sent by forum member 'nickdegraeve']
View Post: http://forums.java.net/node/793586