Using the users.properties and groups.properties should work - I just tried
our webservice-security example and added a test case like this to it:

    protected void setUp() throws Exception {
        Properties properties = new Properties();
        properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory");
        properties.setProperty(Context.SECURITY_PRINCIPAL, "jane");
        properties.setProperty(Context.SECURITY_CREDENTIALS, "waterfall");

        properties.setProperty("openejb.embedded.remotable", "true");

        initialContext = new InitialContext(properties);
    }
    //END SNIPPET: setup

    public void testMyTest() throws Exception {
        CalculatorRemote calc = (CalculatorRemote)
initialContext.lookup("CalculatorImplRemote");
        assertEquals(4, calc.multiply(2, 2));
    }

and it worked. I'm sure we have another example demonstrating this, but I
can put my finger on it at the moment.

I also deployed this example to my standalone server in Eclipse using the
OpenEJB plugin, and started the server in debug mode and my breakpoints were
hit - are you able to provide any more information, or the steps you took?

Regards

Jon

On Tue, Jun 16, 2009 at 2:47 PM, recursion <[email protected]> wrote:

>
> Hi all,
>
> When using OpenEJB as an embedded library, is there a way to configure
> users
> and groups ? Seems to me that OpenEJB does not read at all users.properties
> and groups.properties files, when used in embedded mode. So there must be
> some other way to specify user credentials ?
>
> Thank you in advance!
>
>
> P.S. Actually i am doing a completely different thing! I want to debug in
> Eclipse, my EJB code running in OpenEJB. When using OpenEJB as a remote
> server, i couldn't manage to attach the EJB sources to the debug
> configuration ! (actually i did it, but couldn't manage to get Eclipse stop
> into my breakpoints, don't know why).
> With pleasure i found out that when using OpenEJB as an embedded library,
> the debug stops successfully in my EJB breakpoints.
>
>
>
>
> recursion
> --
> View this message in context:
> http://www.nabble.com/Security-in-embedded-mode-tp24054743p24054743.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>

Reply via email to