You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Lars-Fredrik Smedberg <it...@gmail.com> on 2014/09/25 16:03:15 UTC
ServletContext and MDB
Hi
I have a context-param in my web.xml file that I access using
getInitParameter in Servlet context.
For normal HTTP requests I have a ServletContextListener that fires an
event on contextInitialized and an @Application scoped bean that stores the
context so I from other places can access the context-param.
I want to be able to access this context-param also when an Message Driven
Bean, MDB, is called.
Questions:
1. Is there any guarantees that the ServletContextListener will receive an
event (containing the ServletContext) before the first MDB call if NO http
requests has been made?
2. If the answer to the above is NO should I then move this parameter out
of web.xml and place it somewhere else? Any suggestions to where?
Regards
LF
--
Med vänlig hälsning / Best regards
Lars-Fredrik Smedberg
STATEMENT OF CONFIDENTIALITY:
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at itsmeden@gmail.com, and destroy all copies of this
message and any attachments.
Re: ServletContext and MDB
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Yes
Le lundi 29 septembre 2014, Lars-Fredrik Smedberg <it...@gmail.com> a
écrit :
> I guess in my case I will either bind it in the web jndi tree or the ejb
> jndi tree (using web.xml or ejb-jar.xml)... then I guess I will be fine?
>
> If I bind it to the both trees and use the same name+value will I also be
> fine?
>
> Regards
> LF
>
> On Mon, Sep 29, 2014 at 12:11 PM, Romain Manni-Bucau <
rmannibucau@gmail.com>
> wrote:
>
>> Ejb jndi entries can be private. If you bind something different but
using
>> the same name than in the web jndi tree then you can get some surprises
>>
>> Le dimanche 28 septembre 2014, Lars-Fredrik Smedberg <it...@gmail.com>
>> a
>> écrit :
>> > What does that mean? Same name? ... I not understand exactly...
>> >
>> > On Sun, Sep 28, 2014 at 6:27 PM, Romain Manni-Bucau <
>> rmannibucau@gmail.com
>> >
>> > wrote:
>> >
>> >> to the EJB jndi tree, not the web one (means can change if you bind it
>> >> twice) but should be ok for you
>> >>
>> >>
>> >> Romain Manni-Bucau
>> >> Twitter: @rmannibucau
>> >> Blog: http://rmannibucau.wordpress.com/
>> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> >> Github: https://github.com/rmannibucau
>> >>
>> >>
>> >> 2014-09-26 20:56 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
>> >> > If I use ejb-jar.xml or web.xml, are they bound to same JNDI name?
>> That
>> >> is
>> >> > java:comp/env/<env-entry-name> ?
>> >> >
>> >> > Regards
>> >> > LF
>> >> >
>> >> > On Thu, Sep 25, 2014 at 11:14 PM, Romain Manni-Bucau <
>> >> rmannibucau@gmail.com>
>> >> > wrote:
>> >> >
>> >> >> that's why i pointed out ejb-jar.xml and/or env-entries.properties
>> >> >>
>> >> >>
>> >> >> Romain Manni-Bucau
>> >> >> Twitter: @rmannibucau
>> >> >> Blog: http://rmannibucau.wordpress.com/
>> >> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> >> >> Github: https://github.com/rmannibucau
>> >> >>
>> >> >>
>> >> >> 2014-09-25 21:49 GMT+02:00 Lars-Fredrik Smedberg <
itsmeden@gmail.com
>> >:
>> >> >> > So I guess it would be better to put the configuration somewhere
>> else
>> >> >> > then... rather than mixing the containers and their configuration
>> as
>> >> you
>> >> >> > point out.
>> >> >> >
>> >> >> > Thanks
>> >> >> > LF
>> >> >> >
>> >> >> > On Thu, Sep 25, 2014 at 5:40 PM, Romain Manni-Bucau <
>> >> >> rmannibucau@gmail.com>
>> >> >> > wrote:
>> >> >> >
>> >> >> >> 2014-09-25 17:03 GMT+02:00 Lars-Fredrik Smedberg <
>> itsmeden@gmail.com
>> >> >:
>> >> >> >> > Hi
>> >> >> >> >
>> >> >> >> > Thanks for the quick reply... a follow up below.
>> >> >> >> >
>> >> >> >> > On Thu, Sep 25, 2014 at 4:41 PM, Romain Manni-Bucau <
>> >> >> >> rmannibucau@gmail.com>
>> >> >> >> > wrote:
>> >> >> >> >
>> >> >> >> >> 2014-09-25 16:03 GMT+02:00 Lars-Fredrik Smedberg <
>> >> itsmeden@gmail.com
>> >> >> >:
>> >> >> >> >> > Hi
>> >> >> >> >> >
>> >> >> >> >> > I have a context-param in my web.xml file that I access
using
>> >> >> >> >> > getInitParameter in Servlet context.
>> >> >> >> >> >
>> >> >> >> >> > For normal HTTP requests I have a ServletContextListener
that
>> >> >> fires an
>> >> >> >> >> > event on contextInitialized and an @Application scoped bean
>> that
>> >> >> >> stores
>> >> >> >> >> the
>> >> >> >> >> > context so I from other places can access the
context-param.
>> >> >> >> >> >
>> >> >> >> >> > I want to be able to access this context-param also when an
>> >> Message
>> >> >> >> >> Driven
>> >> >> >> >> > Bean, MDB, is called.
>> >> >> >> >> >
>> >> >> >> >> > Questions:
>> >> >> >> >> >
>> >> >> >> >> > 1. Is there any guarantees that the ServletContextListener
>> will
>> >> >> >> receive
>> >> >> >> >> an
>> >> >> >> >> > event (containing the ServletContext) before the first MDB
>> call
>> >> if
>> >> >> NO
>> >> >> >> >> http
>> >> >> >> >> > requests has been made?
>> >> >> >> >>
>> >> >> >> >> MDB is started before web container is started so no but if
you
>> >> are
>> >> >> >> >> sure you can't get any message (JMS) that's fine
>> >> >> >> >>
>> >> >> >> >
>> >> >> >> > I not need the init-parameter until the first acutal JMS
message
>> >> >> arrives.
>> >> >> >> > Will the web container start before any actual http requests
>> >> arrives?
>> >> >> >> >
>> >> >> >>
>> >> >> >> depend you config (loadOnstartup for instance) but basically
here
>> you
>> >> >> >> mix MDB container (no link with web container) and servlet
>> container.
>> >> >> >>
>> >> >> >> >
>> >> >> >> >>
>> >> >> >> >> > 2. If the answer to the above is NO should I then move this
>> >> >> parameter
>> >> >> >> out
>> >> >> >> >> > of web.xml and place it somewhere else? Any suggestions to
>> >> where?
>> >> >> >> >> >
>> >> >> >> >>
>> >> >> >> >> Can be in ejb-jar.xml or env-entries.properties as MDB env
>> entry
>> >> >> >> >>
>> >> >> >> >> > Regards
>> >> >> >> >> > LF
>> >> >> >> >> >
>> >> >> >> >> > --
>> >> >> >> >> > Med vänlig hälsning / Best regards
>> >> >> >> >> >
>> >> >> >> >> > Lars-Fredrik Smedberg
>> >> >> >> >> >
>> >> >> >> >> > STATEMENT OF CONFIDENTIALITY:
>> >> >> >> >> > The information contained in this electronic message and
any
>> >> >> >> >> > attachments to this message are intended for the exclusive
>> use
>> >> of
>> >> >> the
>> >> >> >> >> > address(es) and may contain confidential or privileged
>> >> >> information. If
>> >> >> >> >> > you are not the intended recipient, please notify
>> Lars-Fredrik
>> >> >> >> Smedberg
>> >> >> >> >> > immediately at itsmeden@gmail.com, and destroy all copies
of
>> >> this
>> >> >> >> >> > message and any attachments.
>> >> >> >> >>
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > --
>> >> >> >> > Med vänlig hälsning / Best regards
>> >> >> >> >
>> >> >> >> > Lars-Fredrik Smedberg
>> >> >> >> >
>> >> >> >> > STATEMENT OF CONFIDENTIALITY:
>> >> >> >> > The information contained in this electronic message and any
>> >> >> >> > attachments to this message are intended for the exclusive use
>> of
>> >> the
>> >> >> >> > address(es) and may contain confidential or privileged
>> >> information. If
>> >> >> >> > you are not the intended recipient, please notify Lars-Fredrik
>> >> >> Smedberg
>> >> >> >> > immediately at itsmeden@gmail.com, and destroy all copies of
>> this
>> >> >> >> > message and any attachments.
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > Med vänlig hälsning / Best regards
>> >> >> >
>> >> >> > Lars-Fredrik Smedberg
>> >> >> >
>> >> >> > STATEMENT OF CONFIDENTIALITY:
>> >> >> > The information contained in this electronic message and any
>> >> >> > attachments to this message are intended for the exclusive use of
>> the
>> >> >> > address(es) and may contain confidential or privileged
information.
>> If
>> >> >> > you are not the intended recipient, please notify Lars-Fredrik
>> >> Smedberg
>> >> >> > immediately at itsmeden@gmail.com, and destroy all copies of this
>> >> >> > message and any attachments.
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Med vänlig hälsning / Best regards
>> >> >
>> >> > Lars-Fredrik Smedberg
>> >> >
>> >> > STATEMENT OF CONFIDENTIALITY:
>> >> > The information contained in this electronic message and any
>> >> > attachments to this message are intended for the exclusive use of
the
>> >> > address(es) and may contain confidential or privileged information.
If
>> >> > you are not the intended recipient, please notify Lars-Fredrik
>> Smedberg
>> >> > immediately at itsmeden@gmail.com, and destroy all copies of this
>> >> > message and any attachments.
>> >>
>> >
>> >
>> >
>> > --
>> > Med vänlig hälsning / Best regards
>> >
>> > Lars-Fredrik Smedberg
>> >
>> > STATEMENT OF CONFIDENTIALITY:
>> > The information contained in this electronic message and any
>> > attachments to this message are intended for the exclusive use of the
>> > address(es) and may contain confidential or privileged information. If
>> > you are not the intended recipient, please notify Lars-Fredrik Smedberg
>> > immediately at itsmeden@gmail.com, and destroy all copies of this
>> > message and any attachments.
>> >
>>
>> --
>>
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>
>
>
> --
> Med vänlig hälsning / Best regards
>
> Lars-Fredrik Smedberg
>
> STATEMENT OF CONFIDENTIALITY:
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> address(es) and may contain confidential or privileged information. If
> you are not the intended recipient, please notify Lars-Fredrik Smedberg
> immediately at itsmeden@gmail.com, and destroy all copies of this
> message and any attachments.
>
--
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
Re: ServletContext and MDB
Posted by Lars-Fredrik Smedberg <it...@gmail.com>.
I guess in my case I will either bind it in the web jndi tree or the ejb
jndi tree (using web.xml or ejb-jar.xml)... then I guess I will be fine?
If I bind it to the both trees and use the same name+value will I also be
fine?
Regards
LF
On Mon, Sep 29, 2014 at 12:11 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:
> Ejb jndi entries can be private. If you bind something different but using
> the same name than in the web jndi tree then you can get some surprises
>
> Le dimanche 28 septembre 2014, Lars-Fredrik Smedberg <it...@gmail.com>
> a
> écrit :
> > What does that mean? Same name? ... I not understand exactly...
> >
> > On Sun, Sep 28, 2014 at 6:27 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com
> >
> > wrote:
> >
> >> to the EJB jndi tree, not the web one (means can change if you bind it
> >> twice) but should be ok for you
> >>
> >>
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >> 2014-09-26 20:56 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> >> > If I use ejb-jar.xml or web.xml, are they bound to same JNDI name?
> That
> >> is
> >> > java:comp/env/<env-entry-name> ?
> >> >
> >> > Regards
> >> > LF
> >> >
> >> > On Thu, Sep 25, 2014 at 11:14 PM, Romain Manni-Bucau <
> >> rmannibucau@gmail.com>
> >> > wrote:
> >> >
> >> >> that's why i pointed out ejb-jar.xml and/or env-entries.properties
> >> >>
> >> >>
> >> >> Romain Manni-Bucau
> >> >> Twitter: @rmannibucau
> >> >> Blog: http://rmannibucau.wordpress.com/
> >> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> >> Github: https://github.com/rmannibucau
> >> >>
> >> >>
> >> >> 2014-09-25 21:49 GMT+02:00 Lars-Fredrik Smedberg <itsmeden@gmail.com
> >:
> >> >> > So I guess it would be better to put the configuration somewhere
> else
> >> >> > then... rather than mixing the containers and their configuration
> as
> >> you
> >> >> > point out.
> >> >> >
> >> >> > Thanks
> >> >> > LF
> >> >> >
> >> >> > On Thu, Sep 25, 2014 at 5:40 PM, Romain Manni-Bucau <
> >> >> rmannibucau@gmail.com>
> >> >> > wrote:
> >> >> >
> >> >> >> 2014-09-25 17:03 GMT+02:00 Lars-Fredrik Smedberg <
> itsmeden@gmail.com
> >> >:
> >> >> >> > Hi
> >> >> >> >
> >> >> >> > Thanks for the quick reply... a follow up below.
> >> >> >> >
> >> >> >> > On Thu, Sep 25, 2014 at 4:41 PM, Romain Manni-Bucau <
> >> >> >> rmannibucau@gmail.com>
> >> >> >> > wrote:
> >> >> >> >
> >> >> >> >> 2014-09-25 16:03 GMT+02:00 Lars-Fredrik Smedberg <
> >> itsmeden@gmail.com
> >> >> >:
> >> >> >> >> > Hi
> >> >> >> >> >
> >> >> >> >> > I have a context-param in my web.xml file that I access using
> >> >> >> >> > getInitParameter in Servlet context.
> >> >> >> >> >
> >> >> >> >> > For normal HTTP requests I have a ServletContextListener that
> >> >> fires an
> >> >> >> >> > event on contextInitialized and an @Application scoped bean
> that
> >> >> >> stores
> >> >> >> >> the
> >> >> >> >> > context so I from other places can access the context-param.
> >> >> >> >> >
> >> >> >> >> > I want to be able to access this context-param also when an
> >> Message
> >> >> >> >> Driven
> >> >> >> >> > Bean, MDB, is called.
> >> >> >> >> >
> >> >> >> >> > Questions:
> >> >> >> >> >
> >> >> >> >> > 1. Is there any guarantees that the ServletContextListener
> will
> >> >> >> receive
> >> >> >> >> an
> >> >> >> >> > event (containing the ServletContext) before the first MDB
> call
> >> if
> >> >> NO
> >> >> >> >> http
> >> >> >> >> > requests has been made?
> >> >> >> >>
> >> >> >> >> MDB is started before web container is started so no but if you
> >> are
> >> >> >> >> sure you can't get any message (JMS) that's fine
> >> >> >> >>
> >> >> >> >
> >> >> >> > I not need the init-parameter until the first acutal JMS message
> >> >> arrives.
> >> >> >> > Will the web container start before any actual http requests
> >> arrives?
> >> >> >> >
> >> >> >>
> >> >> >> depend you config (loadOnstartup for instance) but basically here
> you
> >> >> >> mix MDB container (no link with web container) and servlet
> container.
> >> >> >>
> >> >> >> >
> >> >> >> >>
> >> >> >> >> > 2. If the answer to the above is NO should I then move this
> >> >> parameter
> >> >> >> out
> >> >> >> >> > of web.xml and place it somewhere else? Any suggestions to
> >> where?
> >> >> >> >> >
> >> >> >> >>
> >> >> >> >> Can be in ejb-jar.xml or env-entries.properties as MDB env
> entry
> >> >> >> >>
> >> >> >> >> > Regards
> >> >> >> >> > LF
> >> >> >> >> >
> >> >> >> >> > --
> >> >> >> >> > Med vänlig hälsning / Best regards
> >> >> >> >> >
> >> >> >> >> > Lars-Fredrik Smedberg
> >> >> >> >> >
> >> >> >> >> > STATEMENT OF CONFIDENTIALITY:
> >> >> >> >> > The information contained in this electronic message and any
> >> >> >> >> > attachments to this message are intended for the exclusive
> use
> >> of
> >> >> the
> >> >> >> >> > address(es) and may contain confidential or privileged
> >> >> information. If
> >> >> >> >> > you are not the intended recipient, please notify
> Lars-Fredrik
> >> >> >> Smedberg
> >> >> >> >> > immediately at itsmeden@gmail.com, and destroy all copies of
> >> this
> >> >> >> >> > message and any attachments.
> >> >> >> >>
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> > --
> >> >> >> > Med vänlig hälsning / Best regards
> >> >> >> >
> >> >> >> > Lars-Fredrik Smedberg
> >> >> >> >
> >> >> >> > STATEMENT OF CONFIDENTIALITY:
> >> >> >> > The information contained in this electronic message and any
> >> >> >> > attachments to this message are intended for the exclusive use
> of
> >> the
> >> >> >> > address(es) and may contain confidential or privileged
> >> information. If
> >> >> >> > you are not the intended recipient, please notify Lars-Fredrik
> >> >> Smedberg
> >> >> >> > immediately at itsmeden@gmail.com, and destroy all copies of
> this
> >> >> >> > message and any attachments.
> >> >> >>
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > Med vänlig hälsning / Best regards
> >> >> >
> >> >> > Lars-Fredrik Smedberg
> >> >> >
> >> >> > STATEMENT OF CONFIDENTIALITY:
> >> >> > The information contained in this electronic message and any
> >> >> > attachments to this message are intended for the exclusive use of
> the
> >> >> > address(es) and may contain confidential or privileged information.
> If
> >> >> > you are not the intended recipient, please notify Lars-Fredrik
> >> Smedberg
> >> >> > immediately at itsmeden@gmail.com, and destroy all copies of this
> >> >> > message and any attachments.
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Med vänlig hälsning / Best regards
> >> >
> >> > Lars-Fredrik Smedberg
> >> >
> >> > STATEMENT OF CONFIDENTIALITY:
> >> > The information contained in this electronic message and any
> >> > attachments to this message are intended for the exclusive use of the
> >> > address(es) and may contain confidential or privileged information. If
> >> > you are not the intended recipient, please notify Lars-Fredrik
> Smedberg
> >> > immediately at itsmeden@gmail.com, and destroy all copies of this
> >> > message and any attachments.
> >>
> >
> >
> >
> > --
> > Med vänlig hälsning / Best regards
> >
> > Lars-Fredrik Smedberg
> >
> > STATEMENT OF CONFIDENTIALITY:
> > The information contained in this electronic message and any
> > attachments to this message are intended for the exclusive use of the
> > address(es) and may contain confidential or privileged information. If
> > you are not the intended recipient, please notify Lars-Fredrik Smedberg
> > immediately at itsmeden@gmail.com, and destroy all copies of this
> > message and any attachments.
> >
>
> --
>
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
--
Med vänlig hälsning / Best regards
Lars-Fredrik Smedberg
STATEMENT OF CONFIDENTIALITY:
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at itsmeden@gmail.com, and destroy all copies of this
message and any attachments.
Re: ServletContext and MDB
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Ejb jndi entries can be private. If you bind something different but using
the same name than in the web jndi tree then you can get some surprises
Le dimanche 28 septembre 2014, Lars-Fredrik Smedberg <it...@gmail.com> a
écrit :
> What does that mean? Same name? ... I not understand exactly...
>
> On Sun, Sep 28, 2014 at 6:27 PM, Romain Manni-Bucau <rmannibucau@gmail.com
>
> wrote:
>
>> to the EJB jndi tree, not the web one (means can change if you bind it
>> twice) but should be ok for you
>>
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>> 2014-09-26 20:56 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
>> > If I use ejb-jar.xml or web.xml, are they bound to same JNDI name? That
>> is
>> > java:comp/env/<env-entry-name> ?
>> >
>> > Regards
>> > LF
>> >
>> > On Thu, Sep 25, 2014 at 11:14 PM, Romain Manni-Bucau <
>> rmannibucau@gmail.com>
>> > wrote:
>> >
>> >> that's why i pointed out ejb-jar.xml and/or env-entries.properties
>> >>
>> >>
>> >> Romain Manni-Bucau
>> >> Twitter: @rmannibucau
>> >> Blog: http://rmannibucau.wordpress.com/
>> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> >> Github: https://github.com/rmannibucau
>> >>
>> >>
>> >> 2014-09-25 21:49 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
>> >> > So I guess it would be better to put the configuration somewhere
else
>> >> > then... rather than mixing the containers and their configuration as
>> you
>> >> > point out.
>> >> >
>> >> > Thanks
>> >> > LF
>> >> >
>> >> > On Thu, Sep 25, 2014 at 5:40 PM, Romain Manni-Bucau <
>> >> rmannibucau@gmail.com>
>> >> > wrote:
>> >> >
>> >> >> 2014-09-25 17:03 GMT+02:00 Lars-Fredrik Smedberg <
itsmeden@gmail.com
>> >:
>> >> >> > Hi
>> >> >> >
>> >> >> > Thanks for the quick reply... a follow up below.
>> >> >> >
>> >> >> > On Thu, Sep 25, 2014 at 4:41 PM, Romain Manni-Bucau <
>> >> >> rmannibucau@gmail.com>
>> >> >> > wrote:
>> >> >> >
>> >> >> >> 2014-09-25 16:03 GMT+02:00 Lars-Fredrik Smedberg <
>> itsmeden@gmail.com
>> >> >:
>> >> >> >> > Hi
>> >> >> >> >
>> >> >> >> > I have a context-param in my web.xml file that I access using
>> >> >> >> > getInitParameter in Servlet context.
>> >> >> >> >
>> >> >> >> > For normal HTTP requests I have a ServletContextListener that
>> >> fires an
>> >> >> >> > event on contextInitialized and an @Application scoped bean
that
>> >> >> stores
>> >> >> >> the
>> >> >> >> > context so I from other places can access the context-param.
>> >> >> >> >
>> >> >> >> > I want to be able to access this context-param also when an
>> Message
>> >> >> >> Driven
>> >> >> >> > Bean, MDB, is called.
>> >> >> >> >
>> >> >> >> > Questions:
>> >> >> >> >
>> >> >> >> > 1. Is there any guarantees that the ServletContextListener
will
>> >> >> receive
>> >> >> >> an
>> >> >> >> > event (containing the ServletContext) before the first MDB
call
>> if
>> >> NO
>> >> >> >> http
>> >> >> >> > requests has been made?
>> >> >> >>
>> >> >> >> MDB is started before web container is started so no but if you
>> are
>> >> >> >> sure you can't get any message (JMS) that's fine
>> >> >> >>
>> >> >> >
>> >> >> > I not need the init-parameter until the first acutal JMS message
>> >> arrives.
>> >> >> > Will the web container start before any actual http requests
>> arrives?
>> >> >> >
>> >> >>
>> >> >> depend you config (loadOnstartup for instance) but basically here
you
>> >> >> mix MDB container (no link with web container) and servlet
container.
>> >> >>
>> >> >> >
>> >> >> >>
>> >> >> >> > 2. If the answer to the above is NO should I then move this
>> >> parameter
>> >> >> out
>> >> >> >> > of web.xml and place it somewhere else? Any suggestions to
>> where?
>> >> >> >> >
>> >> >> >>
>> >> >> >> Can be in ejb-jar.xml or env-entries.properties as MDB env entry
>> >> >> >>
>> >> >> >> > Regards
>> >> >> >> > LF
>> >> >> >> >
>> >> >> >> > --
>> >> >> >> > Med vänlig hälsning / Best regards
>> >> >> >> >
>> >> >> >> > Lars-Fredrik Smedberg
>> >> >> >> >
>> >> >> >> > STATEMENT OF CONFIDENTIALITY:
>> >> >> >> > The information contained in this electronic message and any
>> >> >> >> > attachments to this message are intended for the exclusive use
>> of
>> >> the
>> >> >> >> > address(es) and may contain confidential or privileged
>> >> information. If
>> >> >> >> > you are not the intended recipient, please notify Lars-Fredrik
>> >> >> Smedberg
>> >> >> >> > immediately at itsmeden@gmail.com, and destroy all copies of
>> this
>> >> >> >> > message and any attachments.
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > Med vänlig hälsning / Best regards
>> >> >> >
>> >> >> > Lars-Fredrik Smedberg
>> >> >> >
>> >> >> > STATEMENT OF CONFIDENTIALITY:
>> >> >> > The information contained in this electronic message and any
>> >> >> > attachments to this message are intended for the exclusive use of
>> the
>> >> >> > address(es) and may contain confidential or privileged
>> information. If
>> >> >> > you are not the intended recipient, please notify Lars-Fredrik
>> >> Smedberg
>> >> >> > immediately at itsmeden@gmail.com, and destroy all copies of this
>> >> >> > message and any attachments.
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Med vänlig hälsning / Best regards
>> >> >
>> >> > Lars-Fredrik Smedberg
>> >> >
>> >> > STATEMENT OF CONFIDENTIALITY:
>> >> > The information contained in this electronic message and any
>> >> > attachments to this message are intended for the exclusive use of
the
>> >> > address(es) and may contain confidential or privileged information.
If
>> >> > you are not the intended recipient, please notify Lars-Fredrik
>> Smedberg
>> >> > immediately at itsmeden@gmail.com, and destroy all copies of this
>> >> > message and any attachments.
>> >>
>> >
>> >
>> >
>> > --
>> > Med vänlig hälsning / Best regards
>> >
>> > Lars-Fredrik Smedberg
>> >
>> > STATEMENT OF CONFIDENTIALITY:
>> > The information contained in this electronic message and any
>> > attachments to this message are intended for the exclusive use of the
>> > address(es) and may contain confidential or privileged information. If
>> > you are not the intended recipient, please notify Lars-Fredrik Smedberg
>> > immediately at itsmeden@gmail.com, and destroy all copies of this
>> > message and any attachments.
>>
>
>
>
> --
> Med vänlig hälsning / Best regards
>
> Lars-Fredrik Smedberg
>
> STATEMENT OF CONFIDENTIALITY:
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> address(es) and may contain confidential or privileged information. If
> you are not the intended recipient, please notify Lars-Fredrik Smedberg
> immediately at itsmeden@gmail.com, and destroy all copies of this
> message and any attachments.
>
--
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
Re: ServletContext and MDB
Posted by Lars-Fredrik Smedberg <it...@gmail.com>.
What does that mean? Same name? ... I not understand exactly...
On Sun, Sep 28, 2014 at 6:27 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:
> to the EJB jndi tree, not the web one (means can change if you bind it
> twice) but should be ok for you
>
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
> 2014-09-26 20:56 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> > If I use ejb-jar.xml or web.xml, are they bound to same JNDI name? That
> is
> > java:comp/env/<env-entry-name> ?
> >
> > Regards
> > LF
> >
> > On Thu, Sep 25, 2014 at 11:14 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> > wrote:
> >
> >> that's why i pointed out ejb-jar.xml and/or env-entries.properties
> >>
> >>
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >> 2014-09-25 21:49 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> >> > So I guess it would be better to put the configuration somewhere else
> >> > then... rather than mixing the containers and their configuration as
> you
> >> > point out.
> >> >
> >> > Thanks
> >> > LF
> >> >
> >> > On Thu, Sep 25, 2014 at 5:40 PM, Romain Manni-Bucau <
> >> rmannibucau@gmail.com>
> >> > wrote:
> >> >
> >> >> 2014-09-25 17:03 GMT+02:00 Lars-Fredrik Smedberg <itsmeden@gmail.com
> >:
> >> >> > Hi
> >> >> >
> >> >> > Thanks for the quick reply... a follow up below.
> >> >> >
> >> >> > On Thu, Sep 25, 2014 at 4:41 PM, Romain Manni-Bucau <
> >> >> rmannibucau@gmail.com>
> >> >> > wrote:
> >> >> >
> >> >> >> 2014-09-25 16:03 GMT+02:00 Lars-Fredrik Smedberg <
> itsmeden@gmail.com
> >> >:
> >> >> >> > Hi
> >> >> >> >
> >> >> >> > I have a context-param in my web.xml file that I access using
> >> >> >> > getInitParameter in Servlet context.
> >> >> >> >
> >> >> >> > For normal HTTP requests I have a ServletContextListener that
> >> fires an
> >> >> >> > event on contextInitialized and an @Application scoped bean that
> >> >> stores
> >> >> >> the
> >> >> >> > context so I from other places can access the context-param.
> >> >> >> >
> >> >> >> > I want to be able to access this context-param also when an
> Message
> >> >> >> Driven
> >> >> >> > Bean, MDB, is called.
> >> >> >> >
> >> >> >> > Questions:
> >> >> >> >
> >> >> >> > 1. Is there any guarantees that the ServletContextListener will
> >> >> receive
> >> >> >> an
> >> >> >> > event (containing the ServletContext) before the first MDB call
> if
> >> NO
> >> >> >> http
> >> >> >> > requests has been made?
> >> >> >>
> >> >> >> MDB is started before web container is started so no but if you
> are
> >> >> >> sure you can't get any message (JMS) that's fine
> >> >> >>
> >> >> >
> >> >> > I not need the init-parameter until the first acutal JMS message
> >> arrives.
> >> >> > Will the web container start before any actual http requests
> arrives?
> >> >> >
> >> >>
> >> >> depend you config (loadOnstartup for instance) but basically here you
> >> >> mix MDB container (no link with web container) and servlet container.
> >> >>
> >> >> >
> >> >> >>
> >> >> >> > 2. If the answer to the above is NO should I then move this
> >> parameter
> >> >> out
> >> >> >> > of web.xml and place it somewhere else? Any suggestions to
> where?
> >> >> >> >
> >> >> >>
> >> >> >> Can be in ejb-jar.xml or env-entries.properties as MDB env entry
> >> >> >>
> >> >> >> > Regards
> >> >> >> > LF
> >> >> >> >
> >> >> >> > --
> >> >> >> > Med vänlig hälsning / Best regards
> >> >> >> >
> >> >> >> > Lars-Fredrik Smedberg
> >> >> >> >
> >> >> >> > STATEMENT OF CONFIDENTIALITY:
> >> >> >> > The information contained in this electronic message and any
> >> >> >> > attachments to this message are intended for the exclusive use
> of
> >> the
> >> >> >> > address(es) and may contain confidential or privileged
> >> information. If
> >> >> >> > you are not the intended recipient, please notify Lars-Fredrik
> >> >> Smedberg
> >> >> >> > immediately at itsmeden@gmail.com, and destroy all copies of
> this
> >> >> >> > message and any attachments.
> >> >> >>
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > Med vänlig hälsning / Best regards
> >> >> >
> >> >> > Lars-Fredrik Smedberg
> >> >> >
> >> >> > STATEMENT OF CONFIDENTIALITY:
> >> >> > The information contained in this electronic message and any
> >> >> > attachments to this message are intended for the exclusive use of
> the
> >> >> > address(es) and may contain confidential or privileged
> information. If
> >> >> > you are not the intended recipient, please notify Lars-Fredrik
> >> Smedberg
> >> >> > immediately at itsmeden@gmail.com, and destroy all copies of this
> >> >> > message and any attachments.
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Med vänlig hälsning / Best regards
> >> >
> >> > Lars-Fredrik Smedberg
> >> >
> >> > STATEMENT OF CONFIDENTIALITY:
> >> > The information contained in this electronic message and any
> >> > attachments to this message are intended for the exclusive use of the
> >> > address(es) and may contain confidential or privileged information. If
> >> > you are not the intended recipient, please notify Lars-Fredrik
> Smedberg
> >> > immediately at itsmeden@gmail.com, and destroy all copies of this
> >> > message and any attachments.
> >>
> >
> >
> >
> > --
> > Med vänlig hälsning / Best regards
> >
> > Lars-Fredrik Smedberg
> >
> > STATEMENT OF CONFIDENTIALITY:
> > The information contained in this electronic message and any
> > attachments to this message are intended for the exclusive use of the
> > address(es) and may contain confidential or privileged information. If
> > you are not the intended recipient, please notify Lars-Fredrik Smedberg
> > immediately at itsmeden@gmail.com, and destroy all copies of this
> > message and any attachments.
>
--
Med vänlig hälsning / Best regards
Lars-Fredrik Smedberg
STATEMENT OF CONFIDENTIALITY:
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at itsmeden@gmail.com, and destroy all copies of this
message and any attachments.
Re: ServletContext and MDB
Posted by Romain Manni-Bucau <rm...@gmail.com>.
to the EJB jndi tree, not the web one (means can change if you bind it
twice) but should be ok for you
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2014-09-26 20:56 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> If I use ejb-jar.xml or web.xml, are they bound to same JNDI name? That is
> java:comp/env/<env-entry-name> ?
>
> Regards
> LF
>
> On Thu, Sep 25, 2014 at 11:14 PM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
>> that's why i pointed out ejb-jar.xml and/or env-entries.properties
>>
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>> 2014-09-25 21:49 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
>> > So I guess it would be better to put the configuration somewhere else
>> > then... rather than mixing the containers and their configuration as you
>> > point out.
>> >
>> > Thanks
>> > LF
>> >
>> > On Thu, Sep 25, 2014 at 5:40 PM, Romain Manni-Bucau <
>> rmannibucau@gmail.com>
>> > wrote:
>> >
>> >> 2014-09-25 17:03 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
>> >> > Hi
>> >> >
>> >> > Thanks for the quick reply... a follow up below.
>> >> >
>> >> > On Thu, Sep 25, 2014 at 4:41 PM, Romain Manni-Bucau <
>> >> rmannibucau@gmail.com>
>> >> > wrote:
>> >> >
>> >> >> 2014-09-25 16:03 GMT+02:00 Lars-Fredrik Smedberg <itsmeden@gmail.com
>> >:
>> >> >> > Hi
>> >> >> >
>> >> >> > I have a context-param in my web.xml file that I access using
>> >> >> > getInitParameter in Servlet context.
>> >> >> >
>> >> >> > For normal HTTP requests I have a ServletContextListener that
>> fires an
>> >> >> > event on contextInitialized and an @Application scoped bean that
>> >> stores
>> >> >> the
>> >> >> > context so I from other places can access the context-param.
>> >> >> >
>> >> >> > I want to be able to access this context-param also when an Message
>> >> >> Driven
>> >> >> > Bean, MDB, is called.
>> >> >> >
>> >> >> > Questions:
>> >> >> >
>> >> >> > 1. Is there any guarantees that the ServletContextListener will
>> >> receive
>> >> >> an
>> >> >> > event (containing the ServletContext) before the first MDB call if
>> NO
>> >> >> http
>> >> >> > requests has been made?
>> >> >>
>> >> >> MDB is started before web container is started so no but if you are
>> >> >> sure you can't get any message (JMS) that's fine
>> >> >>
>> >> >
>> >> > I not need the init-parameter until the first acutal JMS message
>> arrives.
>> >> > Will the web container start before any actual http requests arrives?
>> >> >
>> >>
>> >> depend you config (loadOnstartup for instance) but basically here you
>> >> mix MDB container (no link with web container) and servlet container.
>> >>
>> >> >
>> >> >>
>> >> >> > 2. If the answer to the above is NO should I then move this
>> parameter
>> >> out
>> >> >> > of web.xml and place it somewhere else? Any suggestions to where?
>> >> >> >
>> >> >>
>> >> >> Can be in ejb-jar.xml or env-entries.properties as MDB env entry
>> >> >>
>> >> >> > Regards
>> >> >> > LF
>> >> >> >
>> >> >> > --
>> >> >> > Med vänlig hälsning / Best regards
>> >> >> >
>> >> >> > Lars-Fredrik Smedberg
>> >> >> >
>> >> >> > STATEMENT OF CONFIDENTIALITY:
>> >> >> > The information contained in this electronic message and any
>> >> >> > attachments to this message are intended for the exclusive use of
>> the
>> >> >> > address(es) and may contain confidential or privileged
>> information. If
>> >> >> > you are not the intended recipient, please notify Lars-Fredrik
>> >> Smedberg
>> >> >> > immediately at itsmeden@gmail.com, and destroy all copies of this
>> >> >> > message and any attachments.
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Med vänlig hälsning / Best regards
>> >> >
>> >> > Lars-Fredrik Smedberg
>> >> >
>> >> > STATEMENT OF CONFIDENTIALITY:
>> >> > The information contained in this electronic message and any
>> >> > attachments to this message are intended for the exclusive use of the
>> >> > address(es) and may contain confidential or privileged information. If
>> >> > you are not the intended recipient, please notify Lars-Fredrik
>> Smedberg
>> >> > immediately at itsmeden@gmail.com, and destroy all copies of this
>> >> > message and any attachments.
>> >>
>> >
>> >
>> >
>> > --
>> > Med vänlig hälsning / Best regards
>> >
>> > Lars-Fredrik Smedberg
>> >
>> > STATEMENT OF CONFIDENTIALITY:
>> > The information contained in this electronic message and any
>> > attachments to this message are intended for the exclusive use of the
>> > address(es) and may contain confidential or privileged information. If
>> > you are not the intended recipient, please notify Lars-Fredrik Smedberg
>> > immediately at itsmeden@gmail.com, and destroy all copies of this
>> > message and any attachments.
>>
>
>
>
> --
> Med vänlig hälsning / Best regards
>
> Lars-Fredrik Smedberg
>
> STATEMENT OF CONFIDENTIALITY:
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> address(es) and may contain confidential or privileged information. If
> you are not the intended recipient, please notify Lars-Fredrik Smedberg
> immediately at itsmeden@gmail.com, and destroy all copies of this
> message and any attachments.
Re: ServletContext and MDB
Posted by Lars-Fredrik Smedberg <it...@gmail.com>.
If I use ejb-jar.xml or web.xml, are they bound to same JNDI name? That is
java:comp/env/<env-entry-name> ?
Regards
LF
On Thu, Sep 25, 2014 at 11:14 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:
> that's why i pointed out ejb-jar.xml and/or env-entries.properties
>
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
> 2014-09-25 21:49 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> > So I guess it would be better to put the configuration somewhere else
> > then... rather than mixing the containers and their configuration as you
> > point out.
> >
> > Thanks
> > LF
> >
> > On Thu, Sep 25, 2014 at 5:40 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> > wrote:
> >
> >> 2014-09-25 17:03 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> >> > Hi
> >> >
> >> > Thanks for the quick reply... a follow up below.
> >> >
> >> > On Thu, Sep 25, 2014 at 4:41 PM, Romain Manni-Bucau <
> >> rmannibucau@gmail.com>
> >> > wrote:
> >> >
> >> >> 2014-09-25 16:03 GMT+02:00 Lars-Fredrik Smedberg <itsmeden@gmail.com
> >:
> >> >> > Hi
> >> >> >
> >> >> > I have a context-param in my web.xml file that I access using
> >> >> > getInitParameter in Servlet context.
> >> >> >
> >> >> > For normal HTTP requests I have a ServletContextListener that
> fires an
> >> >> > event on contextInitialized and an @Application scoped bean that
> >> stores
> >> >> the
> >> >> > context so I from other places can access the context-param.
> >> >> >
> >> >> > I want to be able to access this context-param also when an Message
> >> >> Driven
> >> >> > Bean, MDB, is called.
> >> >> >
> >> >> > Questions:
> >> >> >
> >> >> > 1. Is there any guarantees that the ServletContextListener will
> >> receive
> >> >> an
> >> >> > event (containing the ServletContext) before the first MDB call if
> NO
> >> >> http
> >> >> > requests has been made?
> >> >>
> >> >> MDB is started before web container is started so no but if you are
> >> >> sure you can't get any message (JMS) that's fine
> >> >>
> >> >
> >> > I not need the init-parameter until the first acutal JMS message
> arrives.
> >> > Will the web container start before any actual http requests arrives?
> >> >
> >>
> >> depend you config (loadOnstartup for instance) but basically here you
> >> mix MDB container (no link with web container) and servlet container.
> >>
> >> >
> >> >>
> >> >> > 2. If the answer to the above is NO should I then move this
> parameter
> >> out
> >> >> > of web.xml and place it somewhere else? Any suggestions to where?
> >> >> >
> >> >>
> >> >> Can be in ejb-jar.xml or env-entries.properties as MDB env entry
> >> >>
> >> >> > Regards
> >> >> > LF
> >> >> >
> >> >> > --
> >> >> > Med vänlig hälsning / Best regards
> >> >> >
> >> >> > Lars-Fredrik Smedberg
> >> >> >
> >> >> > STATEMENT OF CONFIDENTIALITY:
> >> >> > The information contained in this electronic message and any
> >> >> > attachments to this message are intended for the exclusive use of
> the
> >> >> > address(es) and may contain confidential or privileged
> information. If
> >> >> > you are not the intended recipient, please notify Lars-Fredrik
> >> Smedberg
> >> >> > immediately at itsmeden@gmail.com, and destroy all copies of this
> >> >> > message and any attachments.
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Med vänlig hälsning / Best regards
> >> >
> >> > Lars-Fredrik Smedberg
> >> >
> >> > STATEMENT OF CONFIDENTIALITY:
> >> > The information contained in this electronic message and any
> >> > attachments to this message are intended for the exclusive use of the
> >> > address(es) and may contain confidential or privileged information. If
> >> > you are not the intended recipient, please notify Lars-Fredrik
> Smedberg
> >> > immediately at itsmeden@gmail.com, and destroy all copies of this
> >> > message and any attachments.
> >>
> >
> >
> >
> > --
> > Med vänlig hälsning / Best regards
> >
> > Lars-Fredrik Smedberg
> >
> > STATEMENT OF CONFIDENTIALITY:
> > The information contained in this electronic message and any
> > attachments to this message are intended for the exclusive use of the
> > address(es) and may contain confidential or privileged information. If
> > you are not the intended recipient, please notify Lars-Fredrik Smedberg
> > immediately at itsmeden@gmail.com, and destroy all copies of this
> > message and any attachments.
>
--
Med vänlig hälsning / Best regards
Lars-Fredrik Smedberg
STATEMENT OF CONFIDENTIALITY:
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at itsmeden@gmail.com, and destroy all copies of this
message and any attachments.
Re: ServletContext and MDB
Posted by Romain Manni-Bucau <rm...@gmail.com>.
that's why i pointed out ejb-jar.xml and/or env-entries.properties
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau
2014-09-25 21:49 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> So I guess it would be better to put the configuration somewhere else
> then... rather than mixing the containers and their configuration as you
> point out.
>
> Thanks
> LF
>
> On Thu, Sep 25, 2014 at 5:40 PM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
>> 2014-09-25 17:03 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
>> > Hi
>> >
>> > Thanks for the quick reply... a follow up below.
>> >
>> > On Thu, Sep 25, 2014 at 4:41 PM, Romain Manni-Bucau <
>> rmannibucau@gmail.com>
>> > wrote:
>> >
>> >> 2014-09-25 16:03 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
>> >> > Hi
>> >> >
>> >> > I have a context-param in my web.xml file that I access using
>> >> > getInitParameter in Servlet context.
>> >> >
>> >> > For normal HTTP requests I have a ServletContextListener that fires an
>> >> > event on contextInitialized and an @Application scoped bean that
>> stores
>> >> the
>> >> > context so I from other places can access the context-param.
>> >> >
>> >> > I want to be able to access this context-param also when an Message
>> >> Driven
>> >> > Bean, MDB, is called.
>> >> >
>> >> > Questions:
>> >> >
>> >> > 1. Is there any guarantees that the ServletContextListener will
>> receive
>> >> an
>> >> > event (containing the ServletContext) before the first MDB call if NO
>> >> http
>> >> > requests has been made?
>> >>
>> >> MDB is started before web container is started so no but if you are
>> >> sure you can't get any message (JMS) that's fine
>> >>
>> >
>> > I not need the init-parameter until the first acutal JMS message arrives.
>> > Will the web container start before any actual http requests arrives?
>> >
>>
>> depend you config (loadOnstartup for instance) but basically here you
>> mix MDB container (no link with web container) and servlet container.
>>
>> >
>> >>
>> >> > 2. If the answer to the above is NO should I then move this parameter
>> out
>> >> > of web.xml and place it somewhere else? Any suggestions to where?
>> >> >
>> >>
>> >> Can be in ejb-jar.xml or env-entries.properties as MDB env entry
>> >>
>> >> > Regards
>> >> > LF
>> >> >
>> >> > --
>> >> > Med vänlig hälsning / Best regards
>> >> >
>> >> > Lars-Fredrik Smedberg
>> >> >
>> >> > STATEMENT OF CONFIDENTIALITY:
>> >> > The information contained in this electronic message and any
>> >> > attachments to this message are intended for the exclusive use of the
>> >> > address(es) and may contain confidential or privileged information. If
>> >> > you are not the intended recipient, please notify Lars-Fredrik
>> Smedberg
>> >> > immediately at itsmeden@gmail.com, and destroy all copies of this
>> >> > message and any attachments.
>> >>
>> >
>> >
>> >
>> > --
>> > Med vänlig hälsning / Best regards
>> >
>> > Lars-Fredrik Smedberg
>> >
>> > STATEMENT OF CONFIDENTIALITY:
>> > The information contained in this electronic message and any
>> > attachments to this message are intended for the exclusive use of the
>> > address(es) and may contain confidential or privileged information. If
>> > you are not the intended recipient, please notify Lars-Fredrik Smedberg
>> > immediately at itsmeden@gmail.com, and destroy all copies of this
>> > message and any attachments.
>>
>
>
>
> --
> Med vänlig hälsning / Best regards
>
> Lars-Fredrik Smedberg
>
> STATEMENT OF CONFIDENTIALITY:
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> address(es) and may contain confidential or privileged information. If
> you are not the intended recipient, please notify Lars-Fredrik Smedberg
> immediately at itsmeden@gmail.com, and destroy all copies of this
> message and any attachments.
Re: ServletContext and MDB
Posted by Lars-Fredrik Smedberg <it...@gmail.com>.
So I guess it would be better to put the configuration somewhere else
then... rather than mixing the containers and their configuration as you
point out.
Thanks
LF
On Thu, Sep 25, 2014 at 5:40 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:
> 2014-09-25 17:03 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> > Hi
> >
> > Thanks for the quick reply... a follow up below.
> >
> > On Thu, Sep 25, 2014 at 4:41 PM, Romain Manni-Bucau <
> rmannibucau@gmail.com>
> > wrote:
> >
> >> 2014-09-25 16:03 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> >> > Hi
> >> >
> >> > I have a context-param in my web.xml file that I access using
> >> > getInitParameter in Servlet context.
> >> >
> >> > For normal HTTP requests I have a ServletContextListener that fires an
> >> > event on contextInitialized and an @Application scoped bean that
> stores
> >> the
> >> > context so I from other places can access the context-param.
> >> >
> >> > I want to be able to access this context-param also when an Message
> >> Driven
> >> > Bean, MDB, is called.
> >> >
> >> > Questions:
> >> >
> >> > 1. Is there any guarantees that the ServletContextListener will
> receive
> >> an
> >> > event (containing the ServletContext) before the first MDB call if NO
> >> http
> >> > requests has been made?
> >>
> >> MDB is started before web container is started so no but if you are
> >> sure you can't get any message (JMS) that's fine
> >>
> >
> > I not need the init-parameter until the first acutal JMS message arrives.
> > Will the web container start before any actual http requests arrives?
> >
>
> depend you config (loadOnstartup for instance) but basically here you
> mix MDB container (no link with web container) and servlet container.
>
> >
> >>
> >> > 2. If the answer to the above is NO should I then move this parameter
> out
> >> > of web.xml and place it somewhere else? Any suggestions to where?
> >> >
> >>
> >> Can be in ejb-jar.xml or env-entries.properties as MDB env entry
> >>
> >> > Regards
> >> > LF
> >> >
> >> > --
> >> > Med vänlig hälsning / Best regards
> >> >
> >> > Lars-Fredrik Smedberg
> >> >
> >> > STATEMENT OF CONFIDENTIALITY:
> >> > The information contained in this electronic message and any
> >> > attachments to this message are intended for the exclusive use of the
> >> > address(es) and may contain confidential or privileged information. If
> >> > you are not the intended recipient, please notify Lars-Fredrik
> Smedberg
> >> > immediately at itsmeden@gmail.com, and destroy all copies of this
> >> > message and any attachments.
> >>
> >
> >
> >
> > --
> > Med vänlig hälsning / Best regards
> >
> > Lars-Fredrik Smedberg
> >
> > STATEMENT OF CONFIDENTIALITY:
> > The information contained in this electronic message and any
> > attachments to this message are intended for the exclusive use of the
> > address(es) and may contain confidential or privileged information. If
> > you are not the intended recipient, please notify Lars-Fredrik Smedberg
> > immediately at itsmeden@gmail.com, and destroy all copies of this
> > message and any attachments.
>
--
Med vänlig hälsning / Best regards
Lars-Fredrik Smedberg
STATEMENT OF CONFIDENTIALITY:
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at itsmeden@gmail.com, and destroy all copies of this
message and any attachments.
Re: ServletContext and MDB
Posted by Romain Manni-Bucau <rm...@gmail.com>.
2014-09-25 17:03 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> Hi
>
> Thanks for the quick reply... a follow up below.
>
> On Thu, Sep 25, 2014 at 4:41 PM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
>> 2014-09-25 16:03 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
>> > Hi
>> >
>> > I have a context-param in my web.xml file that I access using
>> > getInitParameter in Servlet context.
>> >
>> > For normal HTTP requests I have a ServletContextListener that fires an
>> > event on contextInitialized and an @Application scoped bean that stores
>> the
>> > context so I from other places can access the context-param.
>> >
>> > I want to be able to access this context-param also when an Message
>> Driven
>> > Bean, MDB, is called.
>> >
>> > Questions:
>> >
>> > 1. Is there any guarantees that the ServletContextListener will receive
>> an
>> > event (containing the ServletContext) before the first MDB call if NO
>> http
>> > requests has been made?
>>
>> MDB is started before web container is started so no but if you are
>> sure you can't get any message (JMS) that's fine
>>
>
> I not need the init-parameter until the first acutal JMS message arrives.
> Will the web container start before any actual http requests arrives?
>
depend you config (loadOnstartup for instance) but basically here you
mix MDB container (no link with web container) and servlet container.
>
>>
>> > 2. If the answer to the above is NO should I then move this parameter out
>> > of web.xml and place it somewhere else? Any suggestions to where?
>> >
>>
>> Can be in ejb-jar.xml or env-entries.properties as MDB env entry
>>
>> > Regards
>> > LF
>> >
>> > --
>> > Med vänlig hälsning / Best regards
>> >
>> > Lars-Fredrik Smedberg
>> >
>> > STATEMENT OF CONFIDENTIALITY:
>> > The information contained in this electronic message and any
>> > attachments to this message are intended for the exclusive use of the
>> > address(es) and may contain confidential or privileged information. If
>> > you are not the intended recipient, please notify Lars-Fredrik Smedberg
>> > immediately at itsmeden@gmail.com, and destroy all copies of this
>> > message and any attachments.
>>
>
>
>
> --
> Med vänlig hälsning / Best regards
>
> Lars-Fredrik Smedberg
>
> STATEMENT OF CONFIDENTIALITY:
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> address(es) and may contain confidential or privileged information. If
> you are not the intended recipient, please notify Lars-Fredrik Smedberg
> immediately at itsmeden@gmail.com, and destroy all copies of this
> message and any attachments.
Re: ServletContext and MDB
Posted by Lars-Fredrik Smedberg <it...@gmail.com>.
Hi
Thanks for the quick reply... a follow up below.
On Thu, Sep 25, 2014 at 4:41 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:
> 2014-09-25 16:03 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> > Hi
> >
> > I have a context-param in my web.xml file that I access using
> > getInitParameter in Servlet context.
> >
> > For normal HTTP requests I have a ServletContextListener that fires an
> > event on contextInitialized and an @Application scoped bean that stores
> the
> > context so I from other places can access the context-param.
> >
> > I want to be able to access this context-param also when an Message
> Driven
> > Bean, MDB, is called.
> >
> > Questions:
> >
> > 1. Is there any guarantees that the ServletContextListener will receive
> an
> > event (containing the ServletContext) before the first MDB call if NO
> http
> > requests has been made?
>
> MDB is started before web container is started so no but if you are
> sure you can't get any message (JMS) that's fine
>
I not need the init-parameter until the first acutal JMS message arrives.
Will the web container start before any actual http requests arrives?
>
> > 2. If the answer to the above is NO should I then move this parameter out
> > of web.xml and place it somewhere else? Any suggestions to where?
> >
>
> Can be in ejb-jar.xml or env-entries.properties as MDB env entry
>
> > Regards
> > LF
> >
> > --
> > Med vänlig hälsning / Best regards
> >
> > Lars-Fredrik Smedberg
> >
> > STATEMENT OF CONFIDENTIALITY:
> > The information contained in this electronic message and any
> > attachments to this message are intended for the exclusive use of the
> > address(es) and may contain confidential or privileged information. If
> > you are not the intended recipient, please notify Lars-Fredrik Smedberg
> > immediately at itsmeden@gmail.com, and destroy all copies of this
> > message and any attachments.
>
--
Med vänlig hälsning / Best regards
Lars-Fredrik Smedberg
STATEMENT OF CONFIDENTIALITY:
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at itsmeden@gmail.com, and destroy all copies of this
message and any attachments.
Re: ServletContext and MDB
Posted by Romain Manni-Bucau <rm...@gmail.com>.
2014-09-25 16:03 GMT+02:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> Hi
>
> I have a context-param in my web.xml file that I access using
> getInitParameter in Servlet context.
>
> For normal HTTP requests I have a ServletContextListener that fires an
> event on contextInitialized and an @Application scoped bean that stores the
> context so I from other places can access the context-param.
>
> I want to be able to access this context-param also when an Message Driven
> Bean, MDB, is called.
>
> Questions:
>
> 1. Is there any guarantees that the ServletContextListener will receive an
> event (containing the ServletContext) before the first MDB call if NO http
> requests has been made?
MDB is started before web container is started so no but if you are
sure you can't get any message (JMS) that's fine
> 2. If the answer to the above is NO should I then move this parameter out
> of web.xml and place it somewhere else? Any suggestions to where?
>
Can be in ejb-jar.xml or env-entries.properties as MDB env entry
> Regards
> LF
>
> --
> Med vänlig hälsning / Best regards
>
> Lars-Fredrik Smedberg
>
> STATEMENT OF CONFIDENTIALITY:
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> address(es) and may contain confidential or privileged information. If
> you are not the intended recipient, please notify Lars-Fredrik Smedberg
> immediately at itsmeden@gmail.com, and destroy all copies of this
> message and any attachments.