Quoting Henning Sprang <[EMAIL PROTECTED]>:

> Hi,
> I want to use the JMSAppender class in a simple environment, where we
> don't have a jndi service running. Because I have not so much
> knowledge about JNDI and we simply don't need it.
>

You should look into Spring's Mock classes.  Specifically...

org.springframework.mock.jndi.SimpleNamingContextBuilder

It will set up a JNDI environment for you.  It is meant to be used for testing
or for simple environments where an App Server is not available, but you'd like
to write code as if you are running under an App Server.

For instance...

static {
    SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder();
    DataSource ds = new DriverManagerDataSource(driver, url, user, pass);
    builder.bind("java:comp/env/jdbc/MyDS", ds);
}

later on, code that looks up "java:comp/env/jdbc/MyDS" will obtain the
datasource that was set up by the SimpleNamingContextBuilder.  You should be
able to apply this to your JMS problem.


Jake

> I tried a lot and searched the docs for hours now, but could not find
> how this can simply be accomplished - any documentation and example of
> JMSAppender usage seems to assume that I have a JNDI Service running.
>
> The exception I am getting can be seen here: http://pastebin.com/795565
>
> The code leading to this exception is here: http://pastebin.com/795571
>
> Thanks in advance,
> Henning
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to