You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by "Leonardo K. Shikida" <sh...@gmail.com> on 2013/07/09 14:44:38 UTC

initial size of pool of stateless beans

Hi

I am using a stateless bean to consume from a jms queue periodically
(@Schedule). It's started with the container (@Startup). Is there any
way to configure somewhere the initial number of instances for this
specific bean?

TIA

Leo

Re: initial size of pool of stateless beans

Posted by omisaye_infotech <om...@yahoo.com>.


Hello    Romain Manni-Bucau,
 i discovered that   tomee++ works with persistence 2.0. but in my netbeans 7.3.1 persistence 2.1 is present .this has been problematice  brcause the  tomee++ can laod the libraries in persistence 2.1. so how can i fix that  ?


________________________________
 
If you reply to this email, your message will be added to the discussion below:http://openejb.979440.n4.nabble.com/initial-size-of-pool-of-stateless-beans-tp4664154p4664161.html 
To start a new topic under OpenEJB User, email ml-node+s979440n979441h85@n4.nabble.com 
To unsubscribe from OpenEJB, click here.
NAML



--
View this message in context: http://openejb.979440.n4.nabble.com/initial-size-of-pool-of-stateless-beans-tp4664154p4664186.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: initial size of pool of stateless beans

Posted by Romain Manni-Bucau <rm...@gmail.com>.
So share a sample maven project showing it ;)
Le 9 juil. 2013 20:05, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :

> yes, I've tried that
>
> nullpointers
>
> :-(
>
> []
>
> Leo
>
>
> On Tue, Jul 9, 2013 at 2:54 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
> > Delegate to another bean maybe
> > Le 9 juil. 2013 19:46, "Leonardo K. Shikida" <sh...@gmail.com> a
> écrit :
> >
> >> but still, scheduling from @PostConstruct does not work either, because
> >>
> >> @Stateless
> >> public class JmsWorkerEJB {
> >>
> >>         @Resource
> >>         TimerService timerService;
> >>
> >>         @PostConstruct
> >>         public void init() {
> >>                 System.out.println("Hello "+this);
> >>                 try {
> >>                         ScheduleExpression schedule = new
> >> ScheduleExpression();
> >>                         schedule.hour("*");
> >>                         schedule.minute("*");
> >>                         schedule.second("*");
> >>
> >>                         /*Timer timer =
> >> */timerService.createCalendarTimer(schedule);
> >>                 } catch (Exception e) {
> >>                         e.printStackTrace();
> >>                 }
> >>
> >>          }
> >>         @Timeout
> >>         public void processMessage(){...}
> >>
> >>
> >> gives me
> >>
> >> java.lang.IllegalStateException: timerMethod cannot be called in
> >> POST_CONSTRUCT
> >>
> >> oh boy
> >>
> >> []
> >>
> >> Leo
> >>
> >>
> >> On Tue, Jul 9, 2013 at 2:19 PM, Leonardo K. Shikida <sh...@gmail.com>
> >> wrote:
> >> > learning something new everyday ;-)
> >> >
> >> > []
> >> >
> >> > Leo
> >> >
> >> >
> >> > On Tue, Jul 9, 2013 at 2:06 PM, Romain Manni-Bucau
> >> > <rm...@gmail.com> wrote:
> >> >> @Startup on stateless doesnt mean anything in the spec IIRC ;)
> >> >> Le 9 juil. 2013 19:04, "Leonardo K. Shikida" <sh...@gmail.com> a
> >> écrit :
> >> >>
> >> >>> No, it's a regular @Stateless
> >> >>>
> >> >>> @Stateless
> >> >>> @Startup
> >> >>> public class JmsWorkerEJB {...}
> >> >>>
> >> >>> It has a method annotated with @Schedule that reads from a JMS
> queue.
> >> >>>
> >> >>> In the worst case, since @PostConstruct is being called, I could
> >> >>> schedule from there instead, but does not seems an elegant way to
> deal
> >> >>> with that :-)
> >> >>>
> >> >>> []
> >> >>>
> >> >>> Leo
> >> >>>
> >> >>>
> >> >>> On Tue, Jul 9, 2013 at 1:56 PM, Romain Manni-Bucau
> >> >>> <rm...@gmail.com> wrote:
> >> >>> > Found in code this time ;)
> >> >>> >
> >> >>> > Is your ejb a singleton? Did you set @lock(read)?
> >> >>> >
> >> >>> > Working thread can be done with @Asynchronous in javaee 6
> >> >>> > Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com>
> a
> >> >>> écrit :
> >> >>> >
> >> >>> >> MinSize does instantiate these :-)
> >> >>> >>
> >> >>> >> Where did you find this parameter?
> >> >>> >>
> >> >>> >> But the method annotated with @Schedule is run only for one
> instance
> >> >>> >> at a time. I thought it should run for all of them.
> >> >>> >>
> >> >>> >> How people usually implement the concept of working threads in
> EJB?
> >> >>> >> Maybe I am trying to do this in the wrong way.
> >> >>> >>
> >> >>> >> TIA
> >> >>> >>
> >> >>> >> Leo
> >> >>> >>
> >> >>> >>
> >> >>> >> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
> >> >>> >> <rm...@gmail.com> wrote:
> >> >>> >> > Did you try MinSize?
> >> >>> >> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <
> shikida@gmail.com>
> >> a
> >> >>> >> écrit :
> >> >>> >> >
> >> >>> >> >> Hi Romain
> >> >>> >> >>
> >> >>> >> >> I've added to tomee.xml
> >> >>> >> >>
> >> >>> >> >>         <Container id="foo" type="STATELESS">
> >> >>> >> >>                 PoolSize=10
> >> >>> >> >>         </Container>
> >> >>> >> >>
> >> >>> >> >> but it didn't worked as I was expecting.
> >> >>> >> >>
> >> >>> >> >> I thought it would instantiate 10 instances.
> >> >>> >> >>
> >> >>> >> >> I've also added a sysout in the
> >> >>> >> >>
> >> >>> >> >>         @PostConstruct
> >> >>> >> >>         public void init() {
> >> >>> >> >>                 System.out.println("Hello "+this);
> >> >>> >> >>
> >> >>> >> >> I thought I'd have 10 lines in the first service, but there
> was
> >> only
> >> >>> >> one.
> >> >>> >> >>
> >> >>> >> >> Do I have to set somewhere (somehow) that my bean is using
> this
> >> >>> >> >> container or tomee assumes it's the default configuration for
> all
> >> >>> >> >> stateless beans?
> >> >>> >> >>
> >> >>> >> >> TIA
> >> >>> >> >>
> >> >>> >> >> Leo
> >> >>> >> >>
> >> >>> >> >>
> >> >>> >> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
> >> >>> >> >> <rm...@gmail.com> wrote:
> >> >>> >> >> > Hi
> >> >>> >> >> >
> >> >>> >> >> > The basic conf is here
> >> >>> >> >> http://tomee.apache.org/containers-and-resources.html
> >> >>> >> >> >
> >> >>> >> >> > You can set PoolSize (MaxSize) but MinSize too
> >> >>> >> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <
> >> shikida@gmail.com> a
> >> >>> >> >> écrit :
> >> >>> >> >> >
> >> >>> >> >> >> Hi
> >> >>> >> >> >>
> >> >>> >> >> >> I am using a stateless bean to consume from a jms queue
> >> >>> periodically
> >> >>> >> >> >> (@Schedule). It's started with the container (@Startup). Is
> >> there
> >> >>> any
> >> >>> >> >> >> way to configure somewhere the initial number of instances
> for
> >> >>> this
> >> >>> >> >> >> specific bean?
> >> >>> >> >> >>
> >> >>> >> >> >> TIA
> >> >>> >> >> >>
> >> >>> >> >> >> Leo
> >> >>> >> >> >>
> >> >>> >> >>
> >> >>> >>
> >> >>>
> >>
>

Re: initial size of pool of stateless beans

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
yes, I've tried that

nullpointers

:-(

[]

Leo


On Tue, Jul 9, 2013 at 2:54 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> Delegate to another bean maybe
> Le 9 juil. 2013 19:46, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :
>
>> but still, scheduling from @PostConstruct does not work either, because
>>
>> @Stateless
>> public class JmsWorkerEJB {
>>
>>         @Resource
>>         TimerService timerService;
>>
>>         @PostConstruct
>>         public void init() {
>>                 System.out.println("Hello "+this);
>>                 try {
>>                         ScheduleExpression schedule = new
>> ScheduleExpression();
>>                         schedule.hour("*");
>>                         schedule.minute("*");
>>                         schedule.second("*");
>>
>>                         /*Timer timer =
>> */timerService.createCalendarTimer(schedule);
>>                 } catch (Exception e) {
>>                         e.printStackTrace();
>>                 }
>>
>>          }
>>         @Timeout
>>         public void processMessage(){...}
>>
>>
>> gives me
>>
>> java.lang.IllegalStateException: timerMethod cannot be called in
>> POST_CONSTRUCT
>>
>> oh boy
>>
>> []
>>
>> Leo
>>
>>
>> On Tue, Jul 9, 2013 at 2:19 PM, Leonardo K. Shikida <sh...@gmail.com>
>> wrote:
>> > learning something new everyday ;-)
>> >
>> > []
>> >
>> > Leo
>> >
>> >
>> > On Tue, Jul 9, 2013 at 2:06 PM, Romain Manni-Bucau
>> > <rm...@gmail.com> wrote:
>> >> @Startup on stateless doesnt mean anything in the spec IIRC ;)
>> >> Le 9 juil. 2013 19:04, "Leonardo K. Shikida" <sh...@gmail.com> a
>> écrit :
>> >>
>> >>> No, it's a regular @Stateless
>> >>>
>> >>> @Stateless
>> >>> @Startup
>> >>> public class JmsWorkerEJB {...}
>> >>>
>> >>> It has a method annotated with @Schedule that reads from a JMS queue.
>> >>>
>> >>> In the worst case, since @PostConstruct is being called, I could
>> >>> schedule from there instead, but does not seems an elegant way to deal
>> >>> with that :-)
>> >>>
>> >>> []
>> >>>
>> >>> Leo
>> >>>
>> >>>
>> >>> On Tue, Jul 9, 2013 at 1:56 PM, Romain Manni-Bucau
>> >>> <rm...@gmail.com> wrote:
>> >>> > Found in code this time ;)
>> >>> >
>> >>> > Is your ejb a singleton? Did you set @lock(read)?
>> >>> >
>> >>> > Working thread can be done with @Asynchronous in javaee 6
>> >>> > Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com> a
>> >>> écrit :
>> >>> >
>> >>> >> MinSize does instantiate these :-)
>> >>> >>
>> >>> >> Where did you find this parameter?
>> >>> >>
>> >>> >> But the method annotated with @Schedule is run only for one instance
>> >>> >> at a time. I thought it should run for all of them.
>> >>> >>
>> >>> >> How people usually implement the concept of working threads in EJB?
>> >>> >> Maybe I am trying to do this in the wrong way.
>> >>> >>
>> >>> >> TIA
>> >>> >>
>> >>> >> Leo
>> >>> >>
>> >>> >>
>> >>> >> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
>> >>> >> <rm...@gmail.com> wrote:
>> >>> >> > Did you try MinSize?
>> >>> >> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com>
>> a
>> >>> >> écrit :
>> >>> >> >
>> >>> >> >> Hi Romain
>> >>> >> >>
>> >>> >> >> I've added to tomee.xml
>> >>> >> >>
>> >>> >> >>         <Container id="foo" type="STATELESS">
>> >>> >> >>                 PoolSize=10
>> >>> >> >>         </Container>
>> >>> >> >>
>> >>> >> >> but it didn't worked as I was expecting.
>> >>> >> >>
>> >>> >> >> I thought it would instantiate 10 instances.
>> >>> >> >>
>> >>> >> >> I've also added a sysout in the
>> >>> >> >>
>> >>> >> >>         @PostConstruct
>> >>> >> >>         public void init() {
>> >>> >> >>                 System.out.println("Hello "+this);
>> >>> >> >>
>> >>> >> >> I thought I'd have 10 lines in the first service, but there was
>> only
>> >>> >> one.
>> >>> >> >>
>> >>> >> >> Do I have to set somewhere (somehow) that my bean is using this
>> >>> >> >> container or tomee assumes it's the default configuration for all
>> >>> >> >> stateless beans?
>> >>> >> >>
>> >>> >> >> TIA
>> >>> >> >>
>> >>> >> >> Leo
>> >>> >> >>
>> >>> >> >>
>> >>> >> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
>> >>> >> >> <rm...@gmail.com> wrote:
>> >>> >> >> > Hi
>> >>> >> >> >
>> >>> >> >> > The basic conf is here
>> >>> >> >> http://tomee.apache.org/containers-and-resources.html
>> >>> >> >> >
>> >>> >> >> > You can set PoolSize (MaxSize) but MinSize too
>> >>> >> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <
>> shikida@gmail.com> a
>> >>> >> >> écrit :
>> >>> >> >> >
>> >>> >> >> >> Hi
>> >>> >> >> >>
>> >>> >> >> >> I am using a stateless bean to consume from a jms queue
>> >>> periodically
>> >>> >> >> >> (@Schedule). It's started with the container (@Startup). Is
>> there
>> >>> any
>> >>> >> >> >> way to configure somewhere the initial number of instances for
>> >>> this
>> >>> >> >> >> specific bean?
>> >>> >> >> >>
>> >>> >> >> >> TIA
>> >>> >> >> >>
>> >>> >> >> >> Leo
>> >>> >> >> >>
>> >>> >> >>
>> >>> >>
>> >>>
>>

Re: initial size of pool of stateless beans

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Delegate to another bean maybe
Le 9 juil. 2013 19:46, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :

> but still, scheduling from @PostConstruct does not work either, because
>
> @Stateless
> public class JmsWorkerEJB {
>
>         @Resource
>         TimerService timerService;
>
>         @PostConstruct
>         public void init() {
>                 System.out.println("Hello "+this);
>                 try {
>                         ScheduleExpression schedule = new
> ScheduleExpression();
>                         schedule.hour("*");
>                         schedule.minute("*");
>                         schedule.second("*");
>
>                         /*Timer timer =
> */timerService.createCalendarTimer(schedule);
>                 } catch (Exception e) {
>                         e.printStackTrace();
>                 }
>
>          }
>         @Timeout
>         public void processMessage(){...}
>
>
> gives me
>
> java.lang.IllegalStateException: timerMethod cannot be called in
> POST_CONSTRUCT
>
> oh boy
>
> []
>
> Leo
>
>
> On Tue, Jul 9, 2013 at 2:19 PM, Leonardo K. Shikida <sh...@gmail.com>
> wrote:
> > learning something new everyday ;-)
> >
> > []
> >
> > Leo
> >
> >
> > On Tue, Jul 9, 2013 at 2:06 PM, Romain Manni-Bucau
> > <rm...@gmail.com> wrote:
> >> @Startup on stateless doesnt mean anything in the spec IIRC ;)
> >> Le 9 juil. 2013 19:04, "Leonardo K. Shikida" <sh...@gmail.com> a
> écrit :
> >>
> >>> No, it's a regular @Stateless
> >>>
> >>> @Stateless
> >>> @Startup
> >>> public class JmsWorkerEJB {...}
> >>>
> >>> It has a method annotated with @Schedule that reads from a JMS queue.
> >>>
> >>> In the worst case, since @PostConstruct is being called, I could
> >>> schedule from there instead, but does not seems an elegant way to deal
> >>> with that :-)
> >>>
> >>> []
> >>>
> >>> Leo
> >>>
> >>>
> >>> On Tue, Jul 9, 2013 at 1:56 PM, Romain Manni-Bucau
> >>> <rm...@gmail.com> wrote:
> >>> > Found in code this time ;)
> >>> >
> >>> > Is your ejb a singleton? Did you set @lock(read)?
> >>> >
> >>> > Working thread can be done with @Asynchronous in javaee 6
> >>> > Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com> a
> >>> écrit :
> >>> >
> >>> >> MinSize does instantiate these :-)
> >>> >>
> >>> >> Where did you find this parameter?
> >>> >>
> >>> >> But the method annotated with @Schedule is run only for one instance
> >>> >> at a time. I thought it should run for all of them.
> >>> >>
> >>> >> How people usually implement the concept of working threads in EJB?
> >>> >> Maybe I am trying to do this in the wrong way.
> >>> >>
> >>> >> TIA
> >>> >>
> >>> >> Leo
> >>> >>
> >>> >>
> >>> >> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
> >>> >> <rm...@gmail.com> wrote:
> >>> >> > Did you try MinSize?
> >>> >> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com>
> a
> >>> >> écrit :
> >>> >> >
> >>> >> >> Hi Romain
> >>> >> >>
> >>> >> >> I've added to tomee.xml
> >>> >> >>
> >>> >> >>         <Container id="foo" type="STATELESS">
> >>> >> >>                 PoolSize=10
> >>> >> >>         </Container>
> >>> >> >>
> >>> >> >> but it didn't worked as I was expecting.
> >>> >> >>
> >>> >> >> I thought it would instantiate 10 instances.
> >>> >> >>
> >>> >> >> I've also added a sysout in the
> >>> >> >>
> >>> >> >>         @PostConstruct
> >>> >> >>         public void init() {
> >>> >> >>                 System.out.println("Hello "+this);
> >>> >> >>
> >>> >> >> I thought I'd have 10 lines in the first service, but there was
> only
> >>> >> one.
> >>> >> >>
> >>> >> >> Do I have to set somewhere (somehow) that my bean is using this
> >>> >> >> container or tomee assumes it's the default configuration for all
> >>> >> >> stateless beans?
> >>> >> >>
> >>> >> >> TIA
> >>> >> >>
> >>> >> >> Leo
> >>> >> >>
> >>> >> >>
> >>> >> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
> >>> >> >> <rm...@gmail.com> wrote:
> >>> >> >> > Hi
> >>> >> >> >
> >>> >> >> > The basic conf is here
> >>> >> >> http://tomee.apache.org/containers-and-resources.html
> >>> >> >> >
> >>> >> >> > You can set PoolSize (MaxSize) but MinSize too
> >>> >> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <
> shikida@gmail.com> a
> >>> >> >> écrit :
> >>> >> >> >
> >>> >> >> >> Hi
> >>> >> >> >>
> >>> >> >> >> I am using a stateless bean to consume from a jms queue
> >>> periodically
> >>> >> >> >> (@Schedule). It's started with the container (@Startup). Is
> there
> >>> any
> >>> >> >> >> way to configure somewhere the initial number of instances for
> >>> this
> >>> >> >> >> specific bean?
> >>> >> >> >>
> >>> >> >> >> TIA
> >>> >> >> >>
> >>> >> >> >> Leo
> >>> >> >> >>
> >>> >> >>
> >>> >>
> >>>
>

Re: initial size of pool of stateless beans

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
but still, scheduling from @PostConstruct does not work either, because

@Stateless
public class JmsWorkerEJB {

	@Resource
	TimerService timerService;

	@PostConstruct
	public void init() {
		System.out.println("Hello "+this);
		try {
			ScheduleExpression schedule = new ScheduleExpression();
			schedule.hour("*");
			schedule.minute("*");
			schedule.second("*");
			
			/*Timer timer = */timerService.createCalendarTimer(schedule);
		} catch (Exception e) {
			e.printStackTrace();
		}

         }
	@Timeout
	public void processMessage(){...}


gives me

java.lang.IllegalStateException: timerMethod cannot be called in POST_CONSTRUCT

oh boy

[]

Leo


On Tue, Jul 9, 2013 at 2:19 PM, Leonardo K. Shikida <sh...@gmail.com> wrote:
> learning something new everyday ;-)
>
> []
>
> Leo
>
>
> On Tue, Jul 9, 2013 at 2:06 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
>> @Startup on stateless doesnt mean anything in the spec IIRC ;)
>> Le 9 juil. 2013 19:04, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :
>>
>>> No, it's a regular @Stateless
>>>
>>> @Stateless
>>> @Startup
>>> public class JmsWorkerEJB {...}
>>>
>>> It has a method annotated with @Schedule that reads from a JMS queue.
>>>
>>> In the worst case, since @PostConstruct is being called, I could
>>> schedule from there instead, but does not seems an elegant way to deal
>>> with that :-)
>>>
>>> []
>>>
>>> Leo
>>>
>>>
>>> On Tue, Jul 9, 2013 at 1:56 PM, Romain Manni-Bucau
>>> <rm...@gmail.com> wrote:
>>> > Found in code this time ;)
>>> >
>>> > Is your ejb a singleton? Did you set @lock(read)?
>>> >
>>> > Working thread can be done with @Asynchronous in javaee 6
>>> > Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com> a
>>> écrit :
>>> >
>>> >> MinSize does instantiate these :-)
>>> >>
>>> >> Where did you find this parameter?
>>> >>
>>> >> But the method annotated with @Schedule is run only for one instance
>>> >> at a time. I thought it should run for all of them.
>>> >>
>>> >> How people usually implement the concept of working threads in EJB?
>>> >> Maybe I am trying to do this in the wrong way.
>>> >>
>>> >> TIA
>>> >>
>>> >> Leo
>>> >>
>>> >>
>>> >> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
>>> >> <rm...@gmail.com> wrote:
>>> >> > Did you try MinSize?
>>> >> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com> a
>>> >> écrit :
>>> >> >
>>> >> >> Hi Romain
>>> >> >>
>>> >> >> I've added to tomee.xml
>>> >> >>
>>> >> >>         <Container id="foo" type="STATELESS">
>>> >> >>                 PoolSize=10
>>> >> >>         </Container>
>>> >> >>
>>> >> >> but it didn't worked as I was expecting.
>>> >> >>
>>> >> >> I thought it would instantiate 10 instances.
>>> >> >>
>>> >> >> I've also added a sysout in the
>>> >> >>
>>> >> >>         @PostConstruct
>>> >> >>         public void init() {
>>> >> >>                 System.out.println("Hello "+this);
>>> >> >>
>>> >> >> I thought I'd have 10 lines in the first service, but there was only
>>> >> one.
>>> >> >>
>>> >> >> Do I have to set somewhere (somehow) that my bean is using this
>>> >> >> container or tomee assumes it's the default configuration for all
>>> >> >> stateless beans?
>>> >> >>
>>> >> >> TIA
>>> >> >>
>>> >> >> Leo
>>> >> >>
>>> >> >>
>>> >> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
>>> >> >> <rm...@gmail.com> wrote:
>>> >> >> > Hi
>>> >> >> >
>>> >> >> > The basic conf is here
>>> >> >> http://tomee.apache.org/containers-and-resources.html
>>> >> >> >
>>> >> >> > You can set PoolSize (MaxSize) but MinSize too
>>> >> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <sh...@gmail.com> a
>>> >> >> écrit :
>>> >> >> >
>>> >> >> >> Hi
>>> >> >> >>
>>> >> >> >> I am using a stateless bean to consume from a jms queue
>>> periodically
>>> >> >> >> (@Schedule). It's started with the container (@Startup). Is there
>>> any
>>> >> >> >> way to configure somewhere the initial number of instances for
>>> this
>>> >> >> >> specific bean?
>>> >> >> >>
>>> >> >> >> TIA
>>> >> >> >>
>>> >> >> >> Leo
>>> >> >> >>
>>> >> >>
>>> >>
>>>

Re: error deploying web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

Do you package jaxb?
Le 19 août 2015 05:00, "Gerard H. Pille" <ge...@roularta.be> a écrit :

> Invalid schema document passed to AbstractDataBinding.addSchemaDocument,
> not in W3C schema namespace: schema
>
> is caused by a faulty WSDL, containing  "<schema>" iso. "<xs:schema>"
>
> We have the same problem with one of our webservices, when the application
> is deployed or redeployed after some of our other applications.
>
> The only work-around we found until now is making sure this application is
> deployed first on a Tomcat restart (not an easy thing, but it is possible),
> but this made a restart necessary each time this application needed a
> redeploy.
>
> We just found a workaround which is a lot handier:  static WSDL.
>
> Until now, I've no idea what it is that generates the dynamic WSDL, and
> why it makes a mistake when run after redeployment.
>
> Kind regards,
>
> Gerard
>

error deploying web service

Posted by "Gerard H. Pille" <ge...@roularta.be>.
Invalid schema document passed to AbstractDataBinding.addSchemaDocument, not in W3C schema namespace: schema

is caused by a faulty WSDL, containing  "<schema>" iso. "<xs:schema>"

We have the same problem with one of our webservices, when the application is deployed or redeployed after some of our other applications.

The only work-around we found until now is making sure this application is deployed first on a Tomcat restart (not an easy thing, but it is possible), but this made a restart necessary each time this application needed a redeploy.

We just found a workaround which is a lot handier:  static WSDL.

Until now, I've no idea what it is that generates the dynamic WSDL, and why it makes a mistake when run after redeployment.

Kind regards,

Gerard

RE: error deploying web service

Posted by "Patel, Sanjay" <Sa...@nemours.org>.
I believe everything is same. I am double checking now.

-----Original Message-----
From: Romain Manni-Bucau [mailto:rmannibucau@gmail.com] 
Sent: Tuesday, July 09, 2013 2:08 PM
To: users@tomee.apache.org
Subject: RE: error deploying web service

Same java version, no weird endorsing?
Le 9 juil. 2013 19:49, "Patel, Sanjay" <Sa...@nemours.org> a écrit :

> Sorry I forgot to mention version. Yes it is same version on both 
> machine, TomEE 1.5.2. I deploy war and start the server.
>
> -----Original Message-----
> From: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Sent: Tuesday, July 09, 2013 1:47 PM
> To: users@tomee.apache.org
> Subject: Re: error deploying web service
>
> Hi
>
> Same versions? Same way to deploy?
> Le 9 juil. 2013 19:38, "Patel, Sanjay" <Sa...@nemours.org> a 
> écrit
> :
>
> > I see below error in log for my EJB @WebService
> >
> > SEVERE: Error deploying JAX-WS Web Service for EJB DirectoryService
> > java.lang.RuntimeException: Invalid schema document passed to 
> > AbstractDataBinding.addSchemaDocument, not in W3C schema namespace:
> > schema
> >
> > It works fine in my local machine but gives above error on my 
> > development server.
> >
> > Any clue?
> >
> > Thanks.
> >
>

RE: error deploying web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Same java version, no weird endorsing?
Le 9 juil. 2013 19:49, "Patel, Sanjay" <Sa...@nemours.org> a écrit :

> Sorry I forgot to mention version. Yes it is same version on both machine,
> TomEE 1.5.2. I deploy war and start the server.
>
> -----Original Message-----
> From: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Sent: Tuesday, July 09, 2013 1:47 PM
> To: users@tomee.apache.org
> Subject: Re: error deploying web service
>
> Hi
>
> Same versions? Same way to deploy?
> Le 9 juil. 2013 19:38, "Patel, Sanjay" <Sa...@nemours.org> a écrit
> :
>
> > I see below error in log for my EJB @WebService
> >
> > SEVERE: Error deploying JAX-WS Web Service for EJB DirectoryService
> > java.lang.RuntimeException: Invalid schema document passed to
> > AbstractDataBinding.addSchemaDocument, not in W3C schema namespace:
> > schema
> >
> > It works fine in my local machine but gives above error on my
> > development server.
> >
> > Any clue?
> >
> > Thanks.
> >
>

RE: error deploying web service

Posted by "Patel, Sanjay" <Sa...@nemours.org>.
Sorry I forgot to mention version. Yes it is same version on both machine, TomEE 1.5.2. I deploy war and start the server. 

-----Original Message-----
From: Romain Manni-Bucau [mailto:rmannibucau@gmail.com] 
Sent: Tuesday, July 09, 2013 1:47 PM
To: users@tomee.apache.org
Subject: Re: error deploying web service

Hi

Same versions? Same way to deploy?
Le 9 juil. 2013 19:38, "Patel, Sanjay" <Sa...@nemours.org> a écrit :

> I see below error in log for my EJB @WebService
>
> SEVERE: Error deploying JAX-WS Web Service for EJB DirectoryService
> java.lang.RuntimeException: Invalid schema document passed to 
> AbstractDataBinding.addSchemaDocument, not in W3C schema namespace: 
> schema
>
> It works fine in my local machine but gives above error on my 
> development server.
>
> Any clue?
>
> Thanks.
>

Re: error deploying web service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

Same versions? Same way to deploy?
Le 9 juil. 2013 19:38, "Patel, Sanjay" <Sa...@nemours.org> a écrit :

> I see below error in log for my EJB @WebService
>
> SEVERE: Error deploying JAX-WS Web Service for EJB DirectoryService
> java.lang.RuntimeException: Invalid schema document passed to
> AbstractDataBinding.addSchemaDocument, not in W3C schema namespace: schema
>
> It works fine in my local machine but gives above error on my development
> server.
>
> Any clue?
>
> Thanks.
>

error deploying web service

Posted by "Patel, Sanjay" <Sa...@nemours.org>.
I see below error in log for my EJB @WebService

SEVERE: Error deploying JAX-WS Web Service for EJB DirectoryService
java.lang.RuntimeException: Invalid schema document passed to AbstractDataBinding.addSchemaDocument, not in W3C schema namespace: schema

It works fine in my local machine but gives above error on my development server.

Any clue?

Thanks.

Re: initial size of pool of stateless beans

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
Hi Howard

I appreciate that :-) thanks

TIA

Leo


On Tue, Jul 9, 2013 at 3:37 PM, Howard W. Smith, Jr.
<sm...@gmail.com> wrote:
> forgot to add... i am using TomEE/ActiveMQ to do JMS (1.0) stuff (learned
> the code via Tomee's 'simple MDB' example), and the 'stuff' works great!
>
> my app is doing simple MDB stuff, triggered by @Schedule methods on
> @Singleton @Lock(WRITE) bean, which references @ApplicationScoped CDI bean
> to update application-scope/wide properties/variables, etc...
>
> and as I learned from David Blevins, I can make the @Schedule more
> 'aggressive' (@Schedule ever 2 minutes and/or less). i have @Schedule
> running every 1 or 2 minutes, and @Schedule running every 30 seconds (I
> think) to check @ApplicationScoped or @Singleton bean; I forgot the details
> (you know how we developers forget some stuff in the app/implementation
> until we look at the code).
>
> just sharing that tidbit though...
>
>
>
> On Tue, Jul 9, 2013 at 2:29 PM, Leonardo K. Shikida <sh...@gmail.com>wrote:
>
>> Thanks Howard, I think you're right.
>>
>> I'll take that 2 cents :-)
>>
>> TIA
>>
>> Leo
>>
>>
>> On Tue, Jul 9, 2013 at 3:25 PM, Howard W. Smith, Jr.
>> <sm...@gmail.com> wrote:
>> > Leonardo, you may want to revisit Java EE 6 tutorial. almost 2 years ago
>> > (summer 2011), before I began coding Java EE, I studied Java EE 6
>> tutorial,
>> > and since I been doing (minimal) Java EE 6 ever since, by looking at your
>> > code, I will respond as follows (based on my learning):
>> >
>> > 1. I would never add @Startup on @Stateless, even though I've seen others
>> > add @startup on@Singleton, and from what I thought/learned/read,
>> @Singleton
>> > is @Stateless, but I could be wrong. :)
>> >
>> > 2. I would never add or 'assume' that @PostConstruct should be added to
>> > @Stateless. per my Java EE 6 tutorial learning-and-understanding of
>> > @PostConstruct, I should only add @PostConstruct on managed beans
>> > (@RequestScoped, @SessionScoped, etc...)
>> >
>> > my 'two' cents...
>> >
>> > Oh, I have learned from TomEE committers that I can/should use @Singleton
>> > @Lock(Read or Write), and I can add @Schedule methods to @Singleton
>> > bean(s). I am doing (all of) this in my app, using TomEE 1.6.0, and I am
>> > very satisfied with the performance of the app. But I am not using
>> > @Startup; i have an @ApplicationScoped CDI bean that is global to entire
>> > app, all sessions, the @Singleton beans, etc... when TomEE starts my app,
>> > @ApplicationScoped bean will be instantiated and I can add @PostConstruct
>> > to this CDI @ApplicationScoped bean to do whatever I want to do when my
>> app
>> > 'starts'...so why do I need @Startup? don't need it and I don't use it.
>> >
>> >
>> >
>> >
>> > On Tue, Jul 9, 2013 at 1:19 PM, Leonardo K. Shikida <shikida@gmail.com
>> >wrote:
>> >
>> >> learning something new everyday ;-)
>> >>
>> >> []
>> >>
>> >> Leo
>> >>
>> >>
>> >> On Tue, Jul 9, 2013 at 2:06 PM, Romain Manni-Bucau
>> >> <rm...@gmail.com> wrote:
>> >> > @Startup on stateless doesnt mean anything in the spec IIRC ;)
>> >> > Le 9 juil. 2013 19:04, "Leonardo K. Shikida" <sh...@gmail.com> a
>> >> écrit :
>> >> >
>> >> >> No, it's a regular @Stateless
>> >> >>
>> >> >> @Stateless
>> >> >> @Startup
>> >> >> public class JmsWorkerEJB {...}
>> >> >>
>> >> >> It has a method annotated with @Schedule that reads from a JMS queue.
>> >> >>
>> >> >> In the worst case, since @PostConstruct is being called, I could
>> >> >> schedule from there instead, but does not seems an elegant way to
>> deal
>> >> >> with that :-)
>> >> >>
>> >> >> []
>> >> >>
>> >> >> Leo
>> >> >>
>> >> >>
>> >> >> On Tue, Jul 9, 2013 at 1:56 PM, Romain Manni-Bucau
>> >> >> <rm...@gmail.com> wrote:
>> >> >> > Found in code this time ;)
>> >> >> >
>> >> >> > Is your ejb a singleton? Did you set @lock(read)?
>> >> >> >
>> >> >> > Working thread can be done with @Asynchronous in javaee 6
>> >> >> > Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com> a
>> >> >> écrit :
>> >> >> >
>> >> >> >> MinSize does instantiate these :-)
>> >> >> >>
>> >> >> >> Where did you find this parameter?
>> >> >> >>
>> >> >> >> But the method annotated with @Schedule is run only for one
>> instance
>> >> >> >> at a time. I thought it should run for all of them.
>> >> >> >>
>> >> >> >> How people usually implement the concept of working threads in
>> EJB?
>> >> >> >> Maybe I am trying to do this in the wrong way.
>> >> >> >>
>> >> >> >> TIA
>> >> >> >>
>> >> >> >> Leo
>> >> >> >>
>> >> >> >>
>> >> >> >> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
>> >> >> >> <rm...@gmail.com> wrote:
>> >> >> >> > Did you try MinSize?
>> >> >> >> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com>
>> a
>> >> >> >> écrit :
>> >> >> >> >
>> >> >> >> >> Hi Romain
>> >> >> >> >>
>> >> >> >> >> I've added to tomee.xml
>> >> >> >> >>
>> >> >> >> >>         <Container id="foo" type="STATELESS">
>> >> >> >> >>                 PoolSize=10
>> >> >> >> >>         </Container>
>> >> >> >> >>
>> >> >> >> >> but it didn't worked as I was expecting.
>> >> >> >> >>
>> >> >> >> >> I thought it would instantiate 10 instances.
>> >> >> >> >>
>> >> >> >> >> I've also added a sysout in the
>> >> >> >> >>
>> >> >> >> >>         @PostConstruct
>> >> >> >> >>         public void init() {
>> >> >> >> >>                 System.out.println("Hello "+this);
>> >> >> >> >>
>> >> >> >> >> I thought I'd have 10 lines in the first service, but there was
>> >> only
>> >> >> >> one.
>> >> >> >> >>
>> >> >> >> >> Do I have to set somewhere (somehow) that my bean is using this
>> >> >> >> >> container or tomee assumes it's the default configuration for
>> all
>> >> >> >> >> stateless beans?
>> >> >> >> >>
>> >> >> >> >> TIA
>> >> >> >> >>
>> >> >> >> >> Leo
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
>> >> >> >> >> <rm...@gmail.com> wrote:
>> >> >> >> >> > Hi
>> >> >> >> >> >
>> >> >> >> >> > The basic conf is here
>> >> >> >> >> http://tomee.apache.org/containers-and-resources.html
>> >> >> >> >> >
>> >> >> >> >> > You can set PoolSize (MaxSize) but MinSize too
>> >> >> >> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <
>> shikida@gmail.com>
>> >> a
>> >> >> >> >> écrit :
>> >> >> >> >> >
>> >> >> >> >> >> Hi
>> >> >> >> >> >>
>> >> >> >> >> >> I am using a stateless bean to consume from a jms queue
>> >> >> periodically
>> >> >> >> >> >> (@Schedule). It's started with the container (@Startup). Is
>> >> there
>> >> >> any
>> >> >> >> >> >> way to configure somewhere the initial number of instances
>> for
>> >> >> this
>> >> >> >> >> >> specific bean?
>> >> >> >> >> >>
>> >> >> >> >> >> TIA
>> >> >> >> >> >>
>> >> >> >> >> >> Leo
>> >> >> >> >> >>
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>>

Re: initial size of pool of stateless beans

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
forgot to add... i am using TomEE/ActiveMQ to do JMS (1.0) stuff (learned
the code via Tomee's 'simple MDB' example), and the 'stuff' works great!

my app is doing simple MDB stuff, triggered by @Schedule methods on
@Singleton @Lock(WRITE) bean, which references @ApplicationScoped CDI bean
to update application-scope/wide properties/variables, etc...

and as I learned from David Blevins, I can make the @Schedule more
'aggressive' (@Schedule ever 2 minutes and/or less). i have @Schedule
running every 1 or 2 minutes, and @Schedule running every 30 seconds (I
think) to check @ApplicationScoped or @Singleton bean; I forgot the details
(you know how we developers forget some stuff in the app/implementation
until we look at the code).

just sharing that tidbit though...



On Tue, Jul 9, 2013 at 2:29 PM, Leonardo K. Shikida <sh...@gmail.com>wrote:

> Thanks Howard, I think you're right.
>
> I'll take that 2 cents :-)
>
> TIA
>
> Leo
>
>
> On Tue, Jul 9, 2013 at 3:25 PM, Howard W. Smith, Jr.
> <sm...@gmail.com> wrote:
> > Leonardo, you may want to revisit Java EE 6 tutorial. almost 2 years ago
> > (summer 2011), before I began coding Java EE, I studied Java EE 6
> tutorial,
> > and since I been doing (minimal) Java EE 6 ever since, by looking at your
> > code, I will respond as follows (based on my learning):
> >
> > 1. I would never add @Startup on @Stateless, even though I've seen others
> > add @startup on@Singleton, and from what I thought/learned/read,
> @Singleton
> > is @Stateless, but I could be wrong. :)
> >
> > 2. I would never add or 'assume' that @PostConstruct should be added to
> > @Stateless. per my Java EE 6 tutorial learning-and-understanding of
> > @PostConstruct, I should only add @PostConstruct on managed beans
> > (@RequestScoped, @SessionScoped, etc...)
> >
> > my 'two' cents...
> >
> > Oh, I have learned from TomEE committers that I can/should use @Singleton
> > @Lock(Read or Write), and I can add @Schedule methods to @Singleton
> > bean(s). I am doing (all of) this in my app, using TomEE 1.6.0, and I am
> > very satisfied with the performance of the app. But I am not using
> > @Startup; i have an @ApplicationScoped CDI bean that is global to entire
> > app, all sessions, the @Singleton beans, etc... when TomEE starts my app,
> > @ApplicationScoped bean will be instantiated and I can add @PostConstruct
> > to this CDI @ApplicationScoped bean to do whatever I want to do when my
> app
> > 'starts'...so why do I need @Startup? don't need it and I don't use it.
> >
> >
> >
> >
> > On Tue, Jul 9, 2013 at 1:19 PM, Leonardo K. Shikida <shikida@gmail.com
> >wrote:
> >
> >> learning something new everyday ;-)
> >>
> >> []
> >>
> >> Leo
> >>
> >>
> >> On Tue, Jul 9, 2013 at 2:06 PM, Romain Manni-Bucau
> >> <rm...@gmail.com> wrote:
> >> > @Startup on stateless doesnt mean anything in the spec IIRC ;)
> >> > Le 9 juil. 2013 19:04, "Leonardo K. Shikida" <sh...@gmail.com> a
> >> écrit :
> >> >
> >> >> No, it's a regular @Stateless
> >> >>
> >> >> @Stateless
> >> >> @Startup
> >> >> public class JmsWorkerEJB {...}
> >> >>
> >> >> It has a method annotated with @Schedule that reads from a JMS queue.
> >> >>
> >> >> In the worst case, since @PostConstruct is being called, I could
> >> >> schedule from there instead, but does not seems an elegant way to
> deal
> >> >> with that :-)
> >> >>
> >> >> []
> >> >>
> >> >> Leo
> >> >>
> >> >>
> >> >> On Tue, Jul 9, 2013 at 1:56 PM, Romain Manni-Bucau
> >> >> <rm...@gmail.com> wrote:
> >> >> > Found in code this time ;)
> >> >> >
> >> >> > Is your ejb a singleton? Did you set @lock(read)?
> >> >> >
> >> >> > Working thread can be done with @Asynchronous in javaee 6
> >> >> > Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com> a
> >> >> écrit :
> >> >> >
> >> >> >> MinSize does instantiate these :-)
> >> >> >>
> >> >> >> Where did you find this parameter?
> >> >> >>
> >> >> >> But the method annotated with @Schedule is run only for one
> instance
> >> >> >> at a time. I thought it should run for all of them.
> >> >> >>
> >> >> >> How people usually implement the concept of working threads in
> EJB?
> >> >> >> Maybe I am trying to do this in the wrong way.
> >> >> >>
> >> >> >> TIA
> >> >> >>
> >> >> >> Leo
> >> >> >>
> >> >> >>
> >> >> >> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
> >> >> >> <rm...@gmail.com> wrote:
> >> >> >> > Did you try MinSize?
> >> >> >> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com>
> a
> >> >> >> écrit :
> >> >> >> >
> >> >> >> >> Hi Romain
> >> >> >> >>
> >> >> >> >> I've added to tomee.xml
> >> >> >> >>
> >> >> >> >>         <Container id="foo" type="STATELESS">
> >> >> >> >>                 PoolSize=10
> >> >> >> >>         </Container>
> >> >> >> >>
> >> >> >> >> but it didn't worked as I was expecting.
> >> >> >> >>
> >> >> >> >> I thought it would instantiate 10 instances.
> >> >> >> >>
> >> >> >> >> I've also added a sysout in the
> >> >> >> >>
> >> >> >> >>         @PostConstruct
> >> >> >> >>         public void init() {
> >> >> >> >>                 System.out.println("Hello "+this);
> >> >> >> >>
> >> >> >> >> I thought I'd have 10 lines in the first service, but there was
> >> only
> >> >> >> one.
> >> >> >> >>
> >> >> >> >> Do I have to set somewhere (somehow) that my bean is using this
> >> >> >> >> container or tomee assumes it's the default configuration for
> all
> >> >> >> >> stateless beans?
> >> >> >> >>
> >> >> >> >> TIA
> >> >> >> >>
> >> >> >> >> Leo
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
> >> >> >> >> <rm...@gmail.com> wrote:
> >> >> >> >> > Hi
> >> >> >> >> >
> >> >> >> >> > The basic conf is here
> >> >> >> >> http://tomee.apache.org/containers-and-resources.html
> >> >> >> >> >
> >> >> >> >> > You can set PoolSize (MaxSize) but MinSize too
> >> >> >> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <
> shikida@gmail.com>
> >> a
> >> >> >> >> écrit :
> >> >> >> >> >
> >> >> >> >> >> Hi
> >> >> >> >> >>
> >> >> >> >> >> I am using a stateless bean to consume from a jms queue
> >> >> periodically
> >> >> >> >> >> (@Schedule). It's started with the container (@Startup). Is
> >> there
> >> >> any
> >> >> >> >> >> way to configure somewhere the initial number of instances
> for
> >> >> this
> >> >> >> >> >> specific bean?
> >> >> >> >> >>
> >> >> >> >> >> TIA
> >> >> >> >> >>
> >> >> >> >> >> Leo
> >> >> >> >> >>
> >> >> >> >>
> >> >> >>
> >> >>
> >>
>

Re: initial size of pool of stateless beans

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
Thanks Howard, I think you're right.

I'll take that 2 cents :-)

TIA

Leo


On Tue, Jul 9, 2013 at 3:25 PM, Howard W. Smith, Jr.
<sm...@gmail.com> wrote:
> Leonardo, you may want to revisit Java EE 6 tutorial. almost 2 years ago
> (summer 2011), before I began coding Java EE, I studied Java EE 6 tutorial,
> and since I been doing (minimal) Java EE 6 ever since, by looking at your
> code, I will respond as follows (based on my learning):
>
> 1. I would never add @Startup on @Stateless, even though I've seen others
> add @startup on@Singleton, and from what I thought/learned/read, @Singleton
> is @Stateless, but I could be wrong. :)
>
> 2. I would never add or 'assume' that @PostConstruct should be added to
> @Stateless. per my Java EE 6 tutorial learning-and-understanding of
> @PostConstruct, I should only add @PostConstruct on managed beans
> (@RequestScoped, @SessionScoped, etc...)
>
> my 'two' cents...
>
> Oh, I have learned from TomEE committers that I can/should use @Singleton
> @Lock(Read or Write), and I can add @Schedule methods to @Singleton
> bean(s). I am doing (all of) this in my app, using TomEE 1.6.0, and I am
> very satisfied with the performance of the app. But I am not using
> @Startup; i have an @ApplicationScoped CDI bean that is global to entire
> app, all sessions, the @Singleton beans, etc... when TomEE starts my app,
> @ApplicationScoped bean will be instantiated and I can add @PostConstruct
> to this CDI @ApplicationScoped bean to do whatever I want to do when my app
> 'starts'...so why do I need @Startup? don't need it and I don't use it.
>
>
>
>
> On Tue, Jul 9, 2013 at 1:19 PM, Leonardo K. Shikida <sh...@gmail.com>wrote:
>
>> learning something new everyday ;-)
>>
>> []
>>
>> Leo
>>
>>
>> On Tue, Jul 9, 2013 at 2:06 PM, Romain Manni-Bucau
>> <rm...@gmail.com> wrote:
>> > @Startup on stateless doesnt mean anything in the spec IIRC ;)
>> > Le 9 juil. 2013 19:04, "Leonardo K. Shikida" <sh...@gmail.com> a
>> écrit :
>> >
>> >> No, it's a regular @Stateless
>> >>
>> >> @Stateless
>> >> @Startup
>> >> public class JmsWorkerEJB {...}
>> >>
>> >> It has a method annotated with @Schedule that reads from a JMS queue.
>> >>
>> >> In the worst case, since @PostConstruct is being called, I could
>> >> schedule from there instead, but does not seems an elegant way to deal
>> >> with that :-)
>> >>
>> >> []
>> >>
>> >> Leo
>> >>
>> >>
>> >> On Tue, Jul 9, 2013 at 1:56 PM, Romain Manni-Bucau
>> >> <rm...@gmail.com> wrote:
>> >> > Found in code this time ;)
>> >> >
>> >> > Is your ejb a singleton? Did you set @lock(read)?
>> >> >
>> >> > Working thread can be done with @Asynchronous in javaee 6
>> >> > Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com> a
>> >> écrit :
>> >> >
>> >> >> MinSize does instantiate these :-)
>> >> >>
>> >> >> Where did you find this parameter?
>> >> >>
>> >> >> But the method annotated with @Schedule is run only for one instance
>> >> >> at a time. I thought it should run for all of them.
>> >> >>
>> >> >> How people usually implement the concept of working threads in EJB?
>> >> >> Maybe I am trying to do this in the wrong way.
>> >> >>
>> >> >> TIA
>> >> >>
>> >> >> Leo
>> >> >>
>> >> >>
>> >> >> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
>> >> >> <rm...@gmail.com> wrote:
>> >> >> > Did you try MinSize?
>> >> >> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com> a
>> >> >> écrit :
>> >> >> >
>> >> >> >> Hi Romain
>> >> >> >>
>> >> >> >> I've added to tomee.xml
>> >> >> >>
>> >> >> >>         <Container id="foo" type="STATELESS">
>> >> >> >>                 PoolSize=10
>> >> >> >>         </Container>
>> >> >> >>
>> >> >> >> but it didn't worked as I was expecting.
>> >> >> >>
>> >> >> >> I thought it would instantiate 10 instances.
>> >> >> >>
>> >> >> >> I've also added a sysout in the
>> >> >> >>
>> >> >> >>         @PostConstruct
>> >> >> >>         public void init() {
>> >> >> >>                 System.out.println("Hello "+this);
>> >> >> >>
>> >> >> >> I thought I'd have 10 lines in the first service, but there was
>> only
>> >> >> one.
>> >> >> >>
>> >> >> >> Do I have to set somewhere (somehow) that my bean is using this
>> >> >> >> container or tomee assumes it's the default configuration for all
>> >> >> >> stateless beans?
>> >> >> >>
>> >> >> >> TIA
>> >> >> >>
>> >> >> >> Leo
>> >> >> >>
>> >> >> >>
>> >> >> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
>> >> >> >> <rm...@gmail.com> wrote:
>> >> >> >> > Hi
>> >> >> >> >
>> >> >> >> > The basic conf is here
>> >> >> >> http://tomee.apache.org/containers-and-resources.html
>> >> >> >> >
>> >> >> >> > You can set PoolSize (MaxSize) but MinSize too
>> >> >> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <sh...@gmail.com>
>> a
>> >> >> >> écrit :
>> >> >> >> >
>> >> >> >> >> Hi
>> >> >> >> >>
>> >> >> >> >> I am using a stateless bean to consume from a jms queue
>> >> periodically
>> >> >> >> >> (@Schedule). It's started with the container (@Startup). Is
>> there
>> >> any
>> >> >> >> >> way to configure somewhere the initial number of instances for
>> >> this
>> >> >> >> >> specific bean?
>> >> >> >> >>
>> >> >> >> >> TIA
>> >> >> >> >>
>> >> >> >> >> Leo
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>>

Re: initial size of pool of stateless beans

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
On Tue, Jul 9, 2013 at 4:34 PM, Leonardo K. Shikida <sh...@gmail.com>wrote:

> And now I have 5 nice MDBs consuming simultaneously from the same JMS
> and working as expected. :-)
>

glad to hear and i'm sure this is giving you more of a reason to love TOMEE
(as much as I do)! I had multiple MDBs too in my app and app is working
really really good, too. :)


>
> I don't bother with the name of the resource, since I don't use for
> anything else and it seems to be working now, but if anyone knows how
> to do this in the right way, I'd appreciate to know. :-)
>

I will let others advise on this for you.

Re: initial size of pool of stateless beans

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
Hi all

So MDBs were the solution.

Just had to tweak some things

My "worker" now is a MDB

@MessageDriven(activationConfig = {
		@ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Queue"),
		@ActivationConfigProperty(propertyName = "destination",
propertyValue = "FooQueue"),
		@ActivationConfigProperty(propertyName = "acknowledgeMode",
propertyValue = "Auto-acknowledge") })
public class JmsWorkerEJB implements MessageListener {...}

I could not find where to define the name of the
ActiveMQResourceAdapter in the MDB (it is here right?
http://activemq.apache.org/activation-spec-properties.html), so I had
to rename my resource to the "default name"

	<!-- <Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter"> -->
	<Resource id="Default JMS Resource Adapter" type="ActiveMQResourceAdapter">
		BrokerXmlConfig = broker:(tcp://localhost:61616)?persistent=true
		ServerUrl = tcp://localhost:61616
		DataSource = MyJmsDataSource
		maximumRedeliveries = -1
	</Resource>

	<Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
		ResourceAdapter = Default\ JMS\ Resource\ Adapter
	</Resource>

	<Container id="foo2" type="MESSAGE">
		InstanceLimit 5
	</Container>

And now I have 5 nice MDBs consuming simultaneously from the same JMS
and working as expected. :-)

I don't bother with the name of the resource, since I don't use for
anything else and it seems to be working now, but if anyone knows how
to do this in the right way, I'd appreciate to know. :-)

(actually I've posted other questios today that are more important than this)

thanks again

Leo


On Tue, Jul 9, 2013 at 4:12 PM, Leonardo K. Shikida <sh...@gmail.com> wrote:
> Howard and Romain,
>
> thanks for the help and advices
>
> I think it will work here if I use MDBs to consume the queue. Probably
> it's better then trying to trigger scheduled beans to do the same.
>
> And I can control the pool size using
>
>         <Container id="foo" type="MESSAGE">
>                 InstanceLimit 5
>         </Container>
>
> TIA
>
> Leo
>
>
> On Tue, Jul 9, 2013 at 3:55 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
>> Just some notes: stateless beans are thread safe not singleton beans +
>> postconstruct is fine on stateless but will be called for all instances in
>> the pool
>> Le 9 juil. 2013 20:26, "Howard W. Smith, Jr." <sm...@gmail.com> a
>> écrit :
>>
>>> Leonardo, you may want to revisit Java EE 6 tutorial. almost 2 years ago
>>> (summer 2011), before I began coding Java EE, I studied Java EE 6 tutorial,
>>> and since I been doing (minimal) Java EE 6 ever since, by looking at your
>>> code, I will respond as follows (based on my learning):
>>>
>>> 1. I would never add @Startup on @Stateless, even though I've seen others
>>> add @startup on@Singleton, and from what I thought/learned/read,
>>> @Singleton
>>> is @Stateless, but I could be wrong. :)
>>>
>>> 2. I would never add or 'assume' that @PostConstruct should be added to
>>> @Stateless. per my Java EE 6 tutorial learning-and-understanding of
>>> @PostConstruct, I should only add @PostConstruct on managed beans
>>> (@RequestScoped, @SessionScoped, etc...)
>>>
>>> my 'two' cents...
>>>
>>> Oh, I have learned from TomEE committers that I can/should use @Singleton
>>> @Lock(Read or Write), and I can add @Schedule methods to @Singleton
>>> bean(s). I am doing (all of) this in my app, using TomEE 1.6.0, and I am
>>> very satisfied with the performance of the app. But I am not using
>>> @Startup; i have an @ApplicationScoped CDI bean that is global to entire
>>> app, all sessions, the @Singleton beans, etc... when TomEE starts my app,
>>> @ApplicationScoped bean will be instantiated and I can add @PostConstruct
>>> to this CDI @ApplicationScoped bean to do whatever I want to do when my app
>>> 'starts'...so why do I need @Startup? don't need it and I don't use it.
>>>
>>>
>>>
>>>
>>> On Tue, Jul 9, 2013 at 1:19 PM, Leonardo K. Shikida <shikida@gmail.com
>>> >wrote:
>>>
>>> > learning something new everyday ;-)
>>> >
>>> > []
>>> >
>>> > Leo
>>> >
>>> >
>>> > On Tue, Jul 9, 2013 at 2:06 PM, Romain Manni-Bucau
>>> > <rm...@gmail.com> wrote:
>>> > > @Startup on stateless doesnt mean anything in the spec IIRC ;)
>>> > > Le 9 juil. 2013 19:04, "Leonardo K. Shikida" <sh...@gmail.com> a
>>> > écrit :
>>> > >
>>> > >> No, it's a regular @Stateless
>>> > >>
>>> > >> @Stateless
>>> > >> @Startup
>>> > >> public class JmsWorkerEJB {...}
>>> > >>
>>> > >> It has a method annotated with @Schedule that reads from a JMS queue.
>>> > >>
>>> > >> In the worst case, since @PostConstruct is being called, I could
>>> > >> schedule from there instead, but does not seems an elegant way to deal
>>> > >> with that :-)
>>> > >>
>>> > >> []
>>> > >>
>>> > >> Leo
>>> > >>
>>> > >>
>>> > >> On Tue, Jul 9, 2013 at 1:56 PM, Romain Manni-Bucau
>>> > >> <rm...@gmail.com> wrote:
>>> > >> > Found in code this time ;)
>>> > >> >
>>> > >> > Is your ejb a singleton? Did you set @lock(read)?
>>> > >> >
>>> > >> > Working thread can be done with @Asynchronous in javaee 6
>>> > >> > Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com> a
>>> > >> écrit :
>>> > >> >
>>> > >> >> MinSize does instantiate these :-)
>>> > >> >>
>>> > >> >> Where did you find this parameter?
>>> > >> >>
>>> > >> >> But the method annotated with @Schedule is run only for one
>>> instance
>>> > >> >> at a time. I thought it should run for all of them.
>>> > >> >>
>>> > >> >> How people usually implement the concept of working threads in EJB?
>>> > >> >> Maybe I am trying to do this in the wrong way.
>>> > >> >>
>>> > >> >> TIA
>>> > >> >>
>>> > >> >> Leo
>>> > >> >>
>>> > >> >>
>>> > >> >> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
>>> > >> >> <rm...@gmail.com> wrote:
>>> > >> >> > Did you try MinSize?
>>> > >> >> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com>
>>> a
>>> > >> >> écrit :
>>> > >> >> >
>>> > >> >> >> Hi Romain
>>> > >> >> >>
>>> > >> >> >> I've added to tomee.xml
>>> > >> >> >>
>>> > >> >> >>         <Container id="foo" type="STATELESS">
>>> > >> >> >>                 PoolSize=10
>>> > >> >> >>         </Container>
>>> > >> >> >>
>>> > >> >> >> but it didn't worked as I was expecting.
>>> > >> >> >>
>>> > >> >> >> I thought it would instantiate 10 instances.
>>> > >> >> >>
>>> > >> >> >> I've also added a sysout in the
>>> > >> >> >>
>>> > >> >> >>         @PostConstruct
>>> > >> >> >>         public void init() {
>>> > >> >> >>                 System.out.println("Hello "+this);
>>> > >> >> >>
>>> > >> >> >> I thought I'd have 10 lines in the first service, but there was
>>> > only
>>> > >> >> one.
>>> > >> >> >>
>>> > >> >> >> Do I have to set somewhere (somehow) that my bean is using this
>>> > >> >> >> container or tomee assumes it's the default configuration for
>>> all
>>> > >> >> >> stateless beans?
>>> > >> >> >>
>>> > >> >> >> TIA
>>> > >> >> >>
>>> > >> >> >> Leo
>>> > >> >> >>
>>> > >> >> >>
>>> > >> >> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
>>> > >> >> >> <rm...@gmail.com> wrote:
>>> > >> >> >> > Hi
>>> > >> >> >> >
>>> > >> >> >> > The basic conf is here
>>> > >> >> >> http://tomee.apache.org/containers-and-resources.html
>>> > >> >> >> >
>>> > >> >> >> > You can set PoolSize (MaxSize) but MinSize too
>>> > >> >> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <
>>> shikida@gmail.com>
>>> > a
>>> > >> >> >> écrit :
>>> > >> >> >> >
>>> > >> >> >> >> Hi
>>> > >> >> >> >>
>>> > >> >> >> >> I am using a stateless bean to consume from a jms queue
>>> > >> periodically
>>> > >> >> >> >> (@Schedule). It's started with the container (@Startup). Is
>>> > there
>>> > >> any
>>> > >> >> >> >> way to configure somewhere the initial number of instances
>>> for
>>> > >> this
>>> > >> >> >> >> specific bean?
>>> > >> >> >> >>
>>> > >> >> >> >> TIA
>>> > >> >> >> >>
>>> > >> >> >> >> Leo
>>> > >> >> >> >>
>>> > >> >> >>
>>> > >> >>
>>> > >>
>>> >
>>>

Re: initial size of pool of stateless beans

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
Howard and Romain,

thanks for the help and advices

I think it will work here if I use MDBs to consume the queue. Probably
it's better then trying to trigger scheduled beans to do the same.

And I can control the pool size using

	<Container id="foo" type="MESSAGE">
		InstanceLimit 5
	</Container>

TIA

Leo


On Tue, Jul 9, 2013 at 3:55 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> Just some notes: stateless beans are thread safe not singleton beans +
> postconstruct is fine on stateless but will be called for all instances in
> the pool
> Le 9 juil. 2013 20:26, "Howard W. Smith, Jr." <sm...@gmail.com> a
> écrit :
>
>> Leonardo, you may want to revisit Java EE 6 tutorial. almost 2 years ago
>> (summer 2011), before I began coding Java EE, I studied Java EE 6 tutorial,
>> and since I been doing (minimal) Java EE 6 ever since, by looking at your
>> code, I will respond as follows (based on my learning):
>>
>> 1. I would never add @Startup on @Stateless, even though I've seen others
>> add @startup on@Singleton, and from what I thought/learned/read,
>> @Singleton
>> is @Stateless, but I could be wrong. :)
>>
>> 2. I would never add or 'assume' that @PostConstruct should be added to
>> @Stateless. per my Java EE 6 tutorial learning-and-understanding of
>> @PostConstruct, I should only add @PostConstruct on managed beans
>> (@RequestScoped, @SessionScoped, etc...)
>>
>> my 'two' cents...
>>
>> Oh, I have learned from TomEE committers that I can/should use @Singleton
>> @Lock(Read or Write), and I can add @Schedule methods to @Singleton
>> bean(s). I am doing (all of) this in my app, using TomEE 1.6.0, and I am
>> very satisfied with the performance of the app. But I am not using
>> @Startup; i have an @ApplicationScoped CDI bean that is global to entire
>> app, all sessions, the @Singleton beans, etc... when TomEE starts my app,
>> @ApplicationScoped bean will be instantiated and I can add @PostConstruct
>> to this CDI @ApplicationScoped bean to do whatever I want to do when my app
>> 'starts'...so why do I need @Startup? don't need it and I don't use it.
>>
>>
>>
>>
>> On Tue, Jul 9, 2013 at 1:19 PM, Leonardo K. Shikida <shikida@gmail.com
>> >wrote:
>>
>> > learning something new everyday ;-)
>> >
>> > []
>> >
>> > Leo
>> >
>> >
>> > On Tue, Jul 9, 2013 at 2:06 PM, Romain Manni-Bucau
>> > <rm...@gmail.com> wrote:
>> > > @Startup on stateless doesnt mean anything in the spec IIRC ;)
>> > > Le 9 juil. 2013 19:04, "Leonardo K. Shikida" <sh...@gmail.com> a
>> > écrit :
>> > >
>> > >> No, it's a regular @Stateless
>> > >>
>> > >> @Stateless
>> > >> @Startup
>> > >> public class JmsWorkerEJB {...}
>> > >>
>> > >> It has a method annotated with @Schedule that reads from a JMS queue.
>> > >>
>> > >> In the worst case, since @PostConstruct is being called, I could
>> > >> schedule from there instead, but does not seems an elegant way to deal
>> > >> with that :-)
>> > >>
>> > >> []
>> > >>
>> > >> Leo
>> > >>
>> > >>
>> > >> On Tue, Jul 9, 2013 at 1:56 PM, Romain Manni-Bucau
>> > >> <rm...@gmail.com> wrote:
>> > >> > Found in code this time ;)
>> > >> >
>> > >> > Is your ejb a singleton? Did you set @lock(read)?
>> > >> >
>> > >> > Working thread can be done with @Asynchronous in javaee 6
>> > >> > Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com> a
>> > >> écrit :
>> > >> >
>> > >> >> MinSize does instantiate these :-)
>> > >> >>
>> > >> >> Where did you find this parameter?
>> > >> >>
>> > >> >> But the method annotated with @Schedule is run only for one
>> instance
>> > >> >> at a time. I thought it should run for all of them.
>> > >> >>
>> > >> >> How people usually implement the concept of working threads in EJB?
>> > >> >> Maybe I am trying to do this in the wrong way.
>> > >> >>
>> > >> >> TIA
>> > >> >>
>> > >> >> Leo
>> > >> >>
>> > >> >>
>> > >> >> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
>> > >> >> <rm...@gmail.com> wrote:
>> > >> >> > Did you try MinSize?
>> > >> >> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com>
>> a
>> > >> >> écrit :
>> > >> >> >
>> > >> >> >> Hi Romain
>> > >> >> >>
>> > >> >> >> I've added to tomee.xml
>> > >> >> >>
>> > >> >> >>         <Container id="foo" type="STATELESS">
>> > >> >> >>                 PoolSize=10
>> > >> >> >>         </Container>
>> > >> >> >>
>> > >> >> >> but it didn't worked as I was expecting.
>> > >> >> >>
>> > >> >> >> I thought it would instantiate 10 instances.
>> > >> >> >>
>> > >> >> >> I've also added a sysout in the
>> > >> >> >>
>> > >> >> >>         @PostConstruct
>> > >> >> >>         public void init() {
>> > >> >> >>                 System.out.println("Hello "+this);
>> > >> >> >>
>> > >> >> >> I thought I'd have 10 lines in the first service, but there was
>> > only
>> > >> >> one.
>> > >> >> >>
>> > >> >> >> Do I have to set somewhere (somehow) that my bean is using this
>> > >> >> >> container or tomee assumes it's the default configuration for
>> all
>> > >> >> >> stateless beans?
>> > >> >> >>
>> > >> >> >> TIA
>> > >> >> >>
>> > >> >> >> Leo
>> > >> >> >>
>> > >> >> >>
>> > >> >> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
>> > >> >> >> <rm...@gmail.com> wrote:
>> > >> >> >> > Hi
>> > >> >> >> >
>> > >> >> >> > The basic conf is here
>> > >> >> >> http://tomee.apache.org/containers-and-resources.html
>> > >> >> >> >
>> > >> >> >> > You can set PoolSize (MaxSize) but MinSize too
>> > >> >> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <
>> shikida@gmail.com>
>> > a
>> > >> >> >> écrit :
>> > >> >> >> >
>> > >> >> >> >> Hi
>> > >> >> >> >>
>> > >> >> >> >> I am using a stateless bean to consume from a jms queue
>> > >> periodically
>> > >> >> >> >> (@Schedule). It's started with the container (@Startup). Is
>> > there
>> > >> any
>> > >> >> >> >> way to configure somewhere the initial number of instances
>> for
>> > >> this
>> > >> >> >> >> specific bean?
>> > >> >> >> >>
>> > >> >> >> >> TIA
>> > >> >> >> >>
>> > >> >> >> >> Leo
>> > >> >> >> >>
>> > >> >> >>
>> > >> >>
>> > >>
>> >
>>

Re: initial size of pool of stateless beans

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Just some notes: stateless beans are thread safe not singleton beans +
postconstruct is fine on stateless but will be called for all instances in
the pool
Le 9 juil. 2013 20:26, "Howard W. Smith, Jr." <sm...@gmail.com> a
écrit :

> Leonardo, you may want to revisit Java EE 6 tutorial. almost 2 years ago
> (summer 2011), before I began coding Java EE, I studied Java EE 6 tutorial,
> and since I been doing (minimal) Java EE 6 ever since, by looking at your
> code, I will respond as follows (based on my learning):
>
> 1. I would never add @Startup on @Stateless, even though I've seen others
> add @startup on@Singleton, and from what I thought/learned/read,
> @Singleton
> is @Stateless, but I could be wrong. :)
>
> 2. I would never add or 'assume' that @PostConstruct should be added to
> @Stateless. per my Java EE 6 tutorial learning-and-understanding of
> @PostConstruct, I should only add @PostConstruct on managed beans
> (@RequestScoped, @SessionScoped, etc...)
>
> my 'two' cents...
>
> Oh, I have learned from TomEE committers that I can/should use @Singleton
> @Lock(Read or Write), and I can add @Schedule methods to @Singleton
> bean(s). I am doing (all of) this in my app, using TomEE 1.6.0, and I am
> very satisfied with the performance of the app. But I am not using
> @Startup; i have an @ApplicationScoped CDI bean that is global to entire
> app, all sessions, the @Singleton beans, etc... when TomEE starts my app,
> @ApplicationScoped bean will be instantiated and I can add @PostConstruct
> to this CDI @ApplicationScoped bean to do whatever I want to do when my app
> 'starts'...so why do I need @Startup? don't need it and I don't use it.
>
>
>
>
> On Tue, Jul 9, 2013 at 1:19 PM, Leonardo K. Shikida <shikida@gmail.com
> >wrote:
>
> > learning something new everyday ;-)
> >
> > []
> >
> > Leo
> >
> >
> > On Tue, Jul 9, 2013 at 2:06 PM, Romain Manni-Bucau
> > <rm...@gmail.com> wrote:
> > > @Startup on stateless doesnt mean anything in the spec IIRC ;)
> > > Le 9 juil. 2013 19:04, "Leonardo K. Shikida" <sh...@gmail.com> a
> > écrit :
> > >
> > >> No, it's a regular @Stateless
> > >>
> > >> @Stateless
> > >> @Startup
> > >> public class JmsWorkerEJB {...}
> > >>
> > >> It has a method annotated with @Schedule that reads from a JMS queue.
> > >>
> > >> In the worst case, since @PostConstruct is being called, I could
> > >> schedule from there instead, but does not seems an elegant way to deal
> > >> with that :-)
> > >>
> > >> []
> > >>
> > >> Leo
> > >>
> > >>
> > >> On Tue, Jul 9, 2013 at 1:56 PM, Romain Manni-Bucau
> > >> <rm...@gmail.com> wrote:
> > >> > Found in code this time ;)
> > >> >
> > >> > Is your ejb a singleton? Did you set @lock(read)?
> > >> >
> > >> > Working thread can be done with @Asynchronous in javaee 6
> > >> > Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com> a
> > >> écrit :
> > >> >
> > >> >> MinSize does instantiate these :-)
> > >> >>
> > >> >> Where did you find this parameter?
> > >> >>
> > >> >> But the method annotated with @Schedule is run only for one
> instance
> > >> >> at a time. I thought it should run for all of them.
> > >> >>
> > >> >> How people usually implement the concept of working threads in EJB?
> > >> >> Maybe I am trying to do this in the wrong way.
> > >> >>
> > >> >> TIA
> > >> >>
> > >> >> Leo
> > >> >>
> > >> >>
> > >> >> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
> > >> >> <rm...@gmail.com> wrote:
> > >> >> > Did you try MinSize?
> > >> >> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com>
> a
> > >> >> écrit :
> > >> >> >
> > >> >> >> Hi Romain
> > >> >> >>
> > >> >> >> I've added to tomee.xml
> > >> >> >>
> > >> >> >>         <Container id="foo" type="STATELESS">
> > >> >> >>                 PoolSize=10
> > >> >> >>         </Container>
> > >> >> >>
> > >> >> >> but it didn't worked as I was expecting.
> > >> >> >>
> > >> >> >> I thought it would instantiate 10 instances.
> > >> >> >>
> > >> >> >> I've also added a sysout in the
> > >> >> >>
> > >> >> >>         @PostConstruct
> > >> >> >>         public void init() {
> > >> >> >>                 System.out.println("Hello "+this);
> > >> >> >>
> > >> >> >> I thought I'd have 10 lines in the first service, but there was
> > only
> > >> >> one.
> > >> >> >>
> > >> >> >> Do I have to set somewhere (somehow) that my bean is using this
> > >> >> >> container or tomee assumes it's the default configuration for
> all
> > >> >> >> stateless beans?
> > >> >> >>
> > >> >> >> TIA
> > >> >> >>
> > >> >> >> Leo
> > >> >> >>
> > >> >> >>
> > >> >> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
> > >> >> >> <rm...@gmail.com> wrote:
> > >> >> >> > Hi
> > >> >> >> >
> > >> >> >> > The basic conf is here
> > >> >> >> http://tomee.apache.org/containers-and-resources.html
> > >> >> >> >
> > >> >> >> > You can set PoolSize (MaxSize) but MinSize too
> > >> >> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <
> shikida@gmail.com>
> > a
> > >> >> >> écrit :
> > >> >> >> >
> > >> >> >> >> Hi
> > >> >> >> >>
> > >> >> >> >> I am using a stateless bean to consume from a jms queue
> > >> periodically
> > >> >> >> >> (@Schedule). It's started with the container (@Startup). Is
> > there
> > >> any
> > >> >> >> >> way to configure somewhere the initial number of instances
> for
> > >> this
> > >> >> >> >> specific bean?
> > >> >> >> >>
> > >> >> >> >> TIA
> > >> >> >> >>
> > >> >> >> >> Leo
> > >> >> >> >>
> > >> >> >>
> > >> >>
> > >>
> >
>

Re: initial size of pool of stateless beans

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
Leonardo, you may want to revisit Java EE 6 tutorial. almost 2 years ago
(summer 2011), before I began coding Java EE, I studied Java EE 6 tutorial,
and since I been doing (minimal) Java EE 6 ever since, by looking at your
code, I will respond as follows (based on my learning):

1. I would never add @Startup on @Stateless, even though I've seen others
add @startup on@Singleton, and from what I thought/learned/read, @Singleton
is @Stateless, but I could be wrong. :)

2. I would never add or 'assume' that @PostConstruct should be added to
@Stateless. per my Java EE 6 tutorial learning-and-understanding of
@PostConstruct, I should only add @PostConstruct on managed beans
(@RequestScoped, @SessionScoped, etc...)

my 'two' cents...

Oh, I have learned from TomEE committers that I can/should use @Singleton
@Lock(Read or Write), and I can add @Schedule methods to @Singleton
bean(s). I am doing (all of) this in my app, using TomEE 1.6.0, and I am
very satisfied with the performance of the app. But I am not using
@Startup; i have an @ApplicationScoped CDI bean that is global to entire
app, all sessions, the @Singleton beans, etc... when TomEE starts my app,
@ApplicationScoped bean will be instantiated and I can add @PostConstruct
to this CDI @ApplicationScoped bean to do whatever I want to do when my app
'starts'...so why do I need @Startup? don't need it and I don't use it.




On Tue, Jul 9, 2013 at 1:19 PM, Leonardo K. Shikida <sh...@gmail.com>wrote:

> learning something new everyday ;-)
>
> []
>
> Leo
>
>
> On Tue, Jul 9, 2013 at 2:06 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
> > @Startup on stateless doesnt mean anything in the spec IIRC ;)
> > Le 9 juil. 2013 19:04, "Leonardo K. Shikida" <sh...@gmail.com> a
> écrit :
> >
> >> No, it's a regular @Stateless
> >>
> >> @Stateless
> >> @Startup
> >> public class JmsWorkerEJB {...}
> >>
> >> It has a method annotated with @Schedule that reads from a JMS queue.
> >>
> >> In the worst case, since @PostConstruct is being called, I could
> >> schedule from there instead, but does not seems an elegant way to deal
> >> with that :-)
> >>
> >> []
> >>
> >> Leo
> >>
> >>
> >> On Tue, Jul 9, 2013 at 1:56 PM, Romain Manni-Bucau
> >> <rm...@gmail.com> wrote:
> >> > Found in code this time ;)
> >> >
> >> > Is your ejb a singleton? Did you set @lock(read)?
> >> >
> >> > Working thread can be done with @Asynchronous in javaee 6
> >> > Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com> a
> >> écrit :
> >> >
> >> >> MinSize does instantiate these :-)
> >> >>
> >> >> Where did you find this parameter?
> >> >>
> >> >> But the method annotated with @Schedule is run only for one instance
> >> >> at a time. I thought it should run for all of them.
> >> >>
> >> >> How people usually implement the concept of working threads in EJB?
> >> >> Maybe I am trying to do this in the wrong way.
> >> >>
> >> >> TIA
> >> >>
> >> >> Leo
> >> >>
> >> >>
> >> >> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
> >> >> <rm...@gmail.com> wrote:
> >> >> > Did you try MinSize?
> >> >> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com> a
> >> >> écrit :
> >> >> >
> >> >> >> Hi Romain
> >> >> >>
> >> >> >> I've added to tomee.xml
> >> >> >>
> >> >> >>         <Container id="foo" type="STATELESS">
> >> >> >>                 PoolSize=10
> >> >> >>         </Container>
> >> >> >>
> >> >> >> but it didn't worked as I was expecting.
> >> >> >>
> >> >> >> I thought it would instantiate 10 instances.
> >> >> >>
> >> >> >> I've also added a sysout in the
> >> >> >>
> >> >> >>         @PostConstruct
> >> >> >>         public void init() {
> >> >> >>                 System.out.println("Hello "+this);
> >> >> >>
> >> >> >> I thought I'd have 10 lines in the first service, but there was
> only
> >> >> one.
> >> >> >>
> >> >> >> Do I have to set somewhere (somehow) that my bean is using this
> >> >> >> container or tomee assumes it's the default configuration for all
> >> >> >> stateless beans?
> >> >> >>
> >> >> >> TIA
> >> >> >>
> >> >> >> Leo
> >> >> >>
> >> >> >>
> >> >> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
> >> >> >> <rm...@gmail.com> wrote:
> >> >> >> > Hi
> >> >> >> >
> >> >> >> > The basic conf is here
> >> >> >> http://tomee.apache.org/containers-and-resources.html
> >> >> >> >
> >> >> >> > You can set PoolSize (MaxSize) but MinSize too
> >> >> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <sh...@gmail.com>
> a
> >> >> >> écrit :
> >> >> >> >
> >> >> >> >> Hi
> >> >> >> >>
> >> >> >> >> I am using a stateless bean to consume from a jms queue
> >> periodically
> >> >> >> >> (@Schedule). It's started with the container (@Startup). Is
> there
> >> any
> >> >> >> >> way to configure somewhere the initial number of instances for
> >> this
> >> >> >> >> specific bean?
> >> >> >> >>
> >> >> >> >> TIA
> >> >> >> >>
> >> >> >> >> Leo
> >> >> >> >>
> >> >> >>
> >> >>
> >>
>

Re: initial size of pool of stateless beans

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
learning something new everyday ;-)

[]

Leo


On Tue, Jul 9, 2013 at 2:06 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> @Startup on stateless doesnt mean anything in the spec IIRC ;)
> Le 9 juil. 2013 19:04, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :
>
>> No, it's a regular @Stateless
>>
>> @Stateless
>> @Startup
>> public class JmsWorkerEJB {...}
>>
>> It has a method annotated with @Schedule that reads from a JMS queue.
>>
>> In the worst case, since @PostConstruct is being called, I could
>> schedule from there instead, but does not seems an elegant way to deal
>> with that :-)
>>
>> []
>>
>> Leo
>>
>>
>> On Tue, Jul 9, 2013 at 1:56 PM, Romain Manni-Bucau
>> <rm...@gmail.com> wrote:
>> > Found in code this time ;)
>> >
>> > Is your ejb a singleton? Did you set @lock(read)?
>> >
>> > Working thread can be done with @Asynchronous in javaee 6
>> > Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com> a
>> écrit :
>> >
>> >> MinSize does instantiate these :-)
>> >>
>> >> Where did you find this parameter?
>> >>
>> >> But the method annotated with @Schedule is run only for one instance
>> >> at a time. I thought it should run for all of them.
>> >>
>> >> How people usually implement the concept of working threads in EJB?
>> >> Maybe I am trying to do this in the wrong way.
>> >>
>> >> TIA
>> >>
>> >> Leo
>> >>
>> >>
>> >> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
>> >> <rm...@gmail.com> wrote:
>> >> > Did you try MinSize?
>> >> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com> a
>> >> écrit :
>> >> >
>> >> >> Hi Romain
>> >> >>
>> >> >> I've added to tomee.xml
>> >> >>
>> >> >>         <Container id="foo" type="STATELESS">
>> >> >>                 PoolSize=10
>> >> >>         </Container>
>> >> >>
>> >> >> but it didn't worked as I was expecting.
>> >> >>
>> >> >> I thought it would instantiate 10 instances.
>> >> >>
>> >> >> I've also added a sysout in the
>> >> >>
>> >> >>         @PostConstruct
>> >> >>         public void init() {
>> >> >>                 System.out.println("Hello "+this);
>> >> >>
>> >> >> I thought I'd have 10 lines in the first service, but there was only
>> >> one.
>> >> >>
>> >> >> Do I have to set somewhere (somehow) that my bean is using this
>> >> >> container or tomee assumes it's the default configuration for all
>> >> >> stateless beans?
>> >> >>
>> >> >> TIA
>> >> >>
>> >> >> Leo
>> >> >>
>> >> >>
>> >> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
>> >> >> <rm...@gmail.com> wrote:
>> >> >> > Hi
>> >> >> >
>> >> >> > The basic conf is here
>> >> >> http://tomee.apache.org/containers-and-resources.html
>> >> >> >
>> >> >> > You can set PoolSize (MaxSize) but MinSize too
>> >> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <sh...@gmail.com> a
>> >> >> écrit :
>> >> >> >
>> >> >> >> Hi
>> >> >> >>
>> >> >> >> I am using a stateless bean to consume from a jms queue
>> periodically
>> >> >> >> (@Schedule). It's started with the container (@Startup). Is there
>> any
>> >> >> >> way to configure somewhere the initial number of instances for
>> this
>> >> >> >> specific bean?
>> >> >> >>
>> >> >> >> TIA
>> >> >> >>
>> >> >> >> Leo
>> >> >> >>
>> >> >>
>> >>
>>

Re: initial size of pool of stateless beans

Posted by Romain Manni-Bucau <rm...@gmail.com>.
@Startup on stateless doesnt mean anything in the spec IIRC ;)
Le 9 juil. 2013 19:04, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :

> No, it's a regular @Stateless
>
> @Stateless
> @Startup
> public class JmsWorkerEJB {...}
>
> It has a method annotated with @Schedule that reads from a JMS queue.
>
> In the worst case, since @PostConstruct is being called, I could
> schedule from there instead, but does not seems an elegant way to deal
> with that :-)
>
> []
>
> Leo
>
>
> On Tue, Jul 9, 2013 at 1:56 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
> > Found in code this time ;)
> >
> > Is your ejb a singleton? Did you set @lock(read)?
> >
> > Working thread can be done with @Asynchronous in javaee 6
> > Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com> a
> écrit :
> >
> >> MinSize does instantiate these :-)
> >>
> >> Where did you find this parameter?
> >>
> >> But the method annotated with @Schedule is run only for one instance
> >> at a time. I thought it should run for all of them.
> >>
> >> How people usually implement the concept of working threads in EJB?
> >> Maybe I am trying to do this in the wrong way.
> >>
> >> TIA
> >>
> >> Leo
> >>
> >>
> >> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
> >> <rm...@gmail.com> wrote:
> >> > Did you try MinSize?
> >> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com> a
> >> écrit :
> >> >
> >> >> Hi Romain
> >> >>
> >> >> I've added to tomee.xml
> >> >>
> >> >>         <Container id="foo" type="STATELESS">
> >> >>                 PoolSize=10
> >> >>         </Container>
> >> >>
> >> >> but it didn't worked as I was expecting.
> >> >>
> >> >> I thought it would instantiate 10 instances.
> >> >>
> >> >> I've also added a sysout in the
> >> >>
> >> >>         @PostConstruct
> >> >>         public void init() {
> >> >>                 System.out.println("Hello "+this);
> >> >>
> >> >> I thought I'd have 10 lines in the first service, but there was only
> >> one.
> >> >>
> >> >> Do I have to set somewhere (somehow) that my bean is using this
> >> >> container or tomee assumes it's the default configuration for all
> >> >> stateless beans?
> >> >>
> >> >> TIA
> >> >>
> >> >> Leo
> >> >>
> >> >>
> >> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
> >> >> <rm...@gmail.com> wrote:
> >> >> > Hi
> >> >> >
> >> >> > The basic conf is here
> >> >> http://tomee.apache.org/containers-and-resources.html
> >> >> >
> >> >> > You can set PoolSize (MaxSize) but MinSize too
> >> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <sh...@gmail.com> a
> >> >> écrit :
> >> >> >
> >> >> >> Hi
> >> >> >>
> >> >> >> I am using a stateless bean to consume from a jms queue
> periodically
> >> >> >> (@Schedule). It's started with the container (@Startup). Is there
> any
> >> >> >> way to configure somewhere the initial number of instances for
> this
> >> >> >> specific bean?
> >> >> >>
> >> >> >> TIA
> >> >> >>
> >> >> >> Leo
> >> >> >>
> >> >>
> >>
>

Re: initial size of pool of stateless beans

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
No, it's a regular @Stateless

@Stateless
@Startup
public class JmsWorkerEJB {...}

It has a method annotated with @Schedule that reads from a JMS queue.

In the worst case, since @PostConstruct is being called, I could
schedule from there instead, but does not seems an elegant way to deal
with that :-)

[]

Leo


On Tue, Jul 9, 2013 at 1:56 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> Found in code this time ;)
>
> Is your ejb a singleton? Did you set @lock(read)?
>
> Working thread can be done with @Asynchronous in javaee 6
> Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :
>
>> MinSize does instantiate these :-)
>>
>> Where did you find this parameter?
>>
>> But the method annotated with @Schedule is run only for one instance
>> at a time. I thought it should run for all of them.
>>
>> How people usually implement the concept of working threads in EJB?
>> Maybe I am trying to do this in the wrong way.
>>
>> TIA
>>
>> Leo
>>
>>
>> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
>> <rm...@gmail.com> wrote:
>> > Did you try MinSize?
>> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com> a
>> écrit :
>> >
>> >> Hi Romain
>> >>
>> >> I've added to tomee.xml
>> >>
>> >>         <Container id="foo" type="STATELESS">
>> >>                 PoolSize=10
>> >>         </Container>
>> >>
>> >> but it didn't worked as I was expecting.
>> >>
>> >> I thought it would instantiate 10 instances.
>> >>
>> >> I've also added a sysout in the
>> >>
>> >>         @PostConstruct
>> >>         public void init() {
>> >>                 System.out.println("Hello "+this);
>> >>
>> >> I thought I'd have 10 lines in the first service, but there was only
>> one.
>> >>
>> >> Do I have to set somewhere (somehow) that my bean is using this
>> >> container or tomee assumes it's the default configuration for all
>> >> stateless beans?
>> >>
>> >> TIA
>> >>
>> >> Leo
>> >>
>> >>
>> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
>> >> <rm...@gmail.com> wrote:
>> >> > Hi
>> >> >
>> >> > The basic conf is here
>> >> http://tomee.apache.org/containers-and-resources.html
>> >> >
>> >> > You can set PoolSize (MaxSize) but MinSize too
>> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <sh...@gmail.com> a
>> >> écrit :
>> >> >
>> >> >> Hi
>> >> >>
>> >> >> I am using a stateless bean to consume from a jms queue periodically
>> >> >> (@Schedule). It's started with the container (@Startup). Is there any
>> >> >> way to configure somewhere the initial number of instances for this
>> >> >> specific bean?
>> >> >>
>> >> >> TIA
>> >> >>
>> >> >> Leo
>> >> >>
>> >>
>>

Re: initial size of pool of stateless beans

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Found in code this time ;)

Is your ejb a singleton? Did you set @lock(read)?

Working thread can be done with @Asynchronous in javaee 6
Le 9 juil. 2013 18:52, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :

> MinSize does instantiate these :-)
>
> Where did you find this parameter?
>
> But the method annotated with @Schedule is run only for one instance
> at a time. I thought it should run for all of them.
>
> How people usually implement the concept of working threads in EJB?
> Maybe I am trying to do this in the wrong way.
>
> TIA
>
> Leo
>
>
> On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
> > Did you try MinSize?
> > Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com> a
> écrit :
> >
> >> Hi Romain
> >>
> >> I've added to tomee.xml
> >>
> >>         <Container id="foo" type="STATELESS">
> >>                 PoolSize=10
> >>         </Container>
> >>
> >> but it didn't worked as I was expecting.
> >>
> >> I thought it would instantiate 10 instances.
> >>
> >> I've also added a sysout in the
> >>
> >>         @PostConstruct
> >>         public void init() {
> >>                 System.out.println("Hello "+this);
> >>
> >> I thought I'd have 10 lines in the first service, but there was only
> one.
> >>
> >> Do I have to set somewhere (somehow) that my bean is using this
> >> container or tomee assumes it's the default configuration for all
> >> stateless beans?
> >>
> >> TIA
> >>
> >> Leo
> >>
> >>
> >> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
> >> <rm...@gmail.com> wrote:
> >> > Hi
> >> >
> >> > The basic conf is here
> >> http://tomee.apache.org/containers-and-resources.html
> >> >
> >> > You can set PoolSize (MaxSize) but MinSize too
> >> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <sh...@gmail.com> a
> >> écrit :
> >> >
> >> >> Hi
> >> >>
> >> >> I am using a stateless bean to consume from a jms queue periodically
> >> >> (@Schedule). It's started with the container (@Startup). Is there any
> >> >> way to configure somewhere the initial number of instances for this
> >> >> specific bean?
> >> >>
> >> >> TIA
> >> >>
> >> >> Leo
> >> >>
> >>
>

Re: initial size of pool of stateless beans

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
MinSize does instantiate these :-)

Where did you find this parameter?

But the method annotated with @Schedule is run only for one instance
at a time. I thought it should run for all of them.

How people usually implement the concept of working threads in EJB?
Maybe I am trying to do this in the wrong way.

TIA

Leo


On Tue, Jul 9, 2013 at 1:37 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> Did you try MinSize?
> Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :
>
>> Hi Romain
>>
>> I've added to tomee.xml
>>
>>         <Container id="foo" type="STATELESS">
>>                 PoolSize=10
>>         </Container>
>>
>> but it didn't worked as I was expecting.
>>
>> I thought it would instantiate 10 instances.
>>
>> I've also added a sysout in the
>>
>>         @PostConstruct
>>         public void init() {
>>                 System.out.println("Hello "+this);
>>
>> I thought I'd have 10 lines in the first service, but there was only one.
>>
>> Do I have to set somewhere (somehow) that my bean is using this
>> container or tomee assumes it's the default configuration for all
>> stateless beans?
>>
>> TIA
>>
>> Leo
>>
>>
>> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
>> <rm...@gmail.com> wrote:
>> > Hi
>> >
>> > The basic conf is here
>> http://tomee.apache.org/containers-and-resources.html
>> >
>> > You can set PoolSize (MaxSize) but MinSize too
>> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <sh...@gmail.com> a
>> écrit :
>> >
>> >> Hi
>> >>
>> >> I am using a stateless bean to consume from a jms queue periodically
>> >> (@Schedule). It's started with the container (@Startup). Is there any
>> >> way to configure somewhere the initial number of instances for this
>> >> specific bean?
>> >>
>> >> TIA
>> >>
>> >> Leo
>> >>
>>

Re: initial size of pool of stateless beans

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Did you try MinSize?
Le 9 juil. 2013 18:16, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :

> Hi Romain
>
> I've added to tomee.xml
>
>         <Container id="foo" type="STATELESS">
>                 PoolSize=10
>         </Container>
>
> but it didn't worked as I was expecting.
>
> I thought it would instantiate 10 instances.
>
> I've also added a sysout in the
>
>         @PostConstruct
>         public void init() {
>                 System.out.println("Hello "+this);
>
> I thought I'd have 10 lines in the first service, but there was only one.
>
> Do I have to set somewhere (somehow) that my bean is using this
> container or tomee assumes it's the default configuration for all
> stateless beans?
>
> TIA
>
> Leo
>
>
> On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
> > Hi
> >
> > The basic conf is here
> http://tomee.apache.org/containers-and-resources.html
> >
> > You can set PoolSize (MaxSize) but MinSize too
> > Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <sh...@gmail.com> a
> écrit :
> >
> >> Hi
> >>
> >> I am using a stateless bean to consume from a jms queue periodically
> >> (@Schedule). It's started with the container (@Startup). Is there any
> >> way to configure somewhere the initial number of instances for this
> >> specific bean?
> >>
> >> TIA
> >>
> >> Leo
> >>
>

Re: initial size of pool of stateless beans

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
Hi Romain

I've added to tomee.xml

	<Container id="foo" type="STATELESS">
		PoolSize=10
	</Container>

but it didn't worked as I was expecting.

I thought it would instantiate 10 instances.

I've also added a sysout in the

	@PostConstruct
	public void init() {
		System.out.println("Hello "+this);

I thought I'd have 10 lines in the first service, but there was only one.

Do I have to set somewhere (somehow) that my bean is using this
container or tomee assumes it's the default configuration for all
stateless beans?

TIA

Leo


On Tue, Jul 9, 2013 at 12:29 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> Hi
>
> The basic conf is here http://tomee.apache.org/containers-and-resources.html
>
> You can set PoolSize (MaxSize) but MinSize too
> Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :
>
>> Hi
>>
>> I am using a stateless bean to consume from a jms queue periodically
>> (@Schedule). It's started with the container (@Startup). Is there any
>> way to configure somewhere the initial number of instances for this
>> specific bean?
>>
>> TIA
>>
>> Leo
>>

Re: initial size of pool of stateless beans

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

The basic conf is here http://tomee.apache.org/containers-and-resources.html

You can set PoolSize (MaxSize) but MinSize too
Le 9 juil. 2013 14:45, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :

> Hi
>
> I am using a stateless bean to consume from a jms queue periodically
> (@Schedule). It's started with the container (@Startup). Is there any
> way to configure somewhere the initial number of instances for this
> specific bean?
>
> TIA
>
> Leo
>