Re: [JBoss-user] constraining session bean pool

2003-07-09 Thread Erik Price


Brian Wallis wrote:
On Wed, 9 Jul 2003 10:44, Bill Burke wrote:

there is a strict max size setting.  Forget the config name.


I think it is StrictMaxSizetrue/StrictMaxSize
Thanks everyone, I do appreciate the help.  However, it doesn't seem to 
have the effect I was hoping for:

When I couldn't find StrictMaxSize in the DTD, I figured it must be in 
JBoss 3.2.x (I was using 3.0.x) and sure enough there is 
strictMaximumSize.  I upgraded to 3.2.x and changed my jboss.xml file 
appropriately.

I've put some simple System.out.println statements in the ejbCreate(), 
ejbRemove(), ejbActivate(), and ejbPassivate() methods so that I can 
watch as each of these methods is called by the container.  Then I run a 
simple client that creates 3 EJB objects (each corresponds to a stateful 
SessionBean).  By using

MaximumSize2/MaximumSize
strictMaximumSizeTrue/strictMaximumSize
I had hoped that this would limit the pool of available Session beans to 
2, so that the container would be forced to passivate and then activate 
one of the beans to service the third EJB object.  The ejbCreate() and 
ejbDestroy() methods output log messages as expected, but the 
ejbPassivate() and ejbActivate() methods don't appear to be getting 
called by the container.  Does anyone know if I am misusing the 
container-pool-conf or misunderstanding something?

Thanks,

Erik



---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing  more.
Download  eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


Re: [JBoss-user] constraining session bean pool

2003-07-09 Thread Scott M Stark
This is only working for stateless beans and mdbs currently. Its
a known issue as there is a unit test which fails because of this.
Its on my todo to fix for the 3.2.2RC2 release.
--

Scott Stark
Chief Technology Officer
JBoss Group, LLC

Erik Price wrote:



Brian Wallis wrote:

On Wed, 9 Jul 2003 10:44, Bill Burke wrote:

there is a strict max size setting.  Forget the config name.


I think it is StrictMaxSizetrue/StrictMaxSize


Thanks everyone, I do appreciate the help.  However, it doesn't seem to 
have the effect I was hoping for:

When I couldn't find StrictMaxSize in the DTD, I figured it must be in 
JBoss 3.2.x (I was using 3.0.x) and sure enough there is 
strictMaximumSize.  I upgraded to 3.2.x and changed my jboss.xml file 
appropriately.

I've put some simple System.out.println statements in the ejbCreate(), 
ejbRemove(), ejbActivate(), and ejbPassivate() methods so that I can 
watch as each of these methods is called by the container.  Then I run a 
simple client that creates 3 EJB objects (each corresponds to a stateful 
SessionBean).  By using

MaximumSize2/MaximumSize
strictMaximumSizeTrue/strictMaximumSize
I had hoped that this would limit the pool of available Session beans to 
2, so that the container would be forced to passivate and then activate 
one of the beans to service the third EJB object.  The ejbCreate() and 
ejbDestroy() methods output log messages as expected, but the 
ejbPassivate() and ejbActivate() methods don't appear to be getting 
called by the container.  Does anyone know if I am misusing the 
container-pool-conf or misunderstanding something?

Thanks,

Erik




---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing  more.
Download  eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


Re: [JBoss-user] constraining session bean pool

2003-07-09 Thread Erik Price


Scott M Stark wrote:
This is only working for stateless beans and mdbs currently. Its
a known issue as there is a unit test which fails because of this.
Its on my todo to fix for the 3.2.2RC2 release.
No problem!  It's just a learning exercise.  Thanks for sparing me a bug 
hunt, Scott.

Nevertheless, I learned quite a bit about JBoss bean pool configuration 
from this thread.  Thanks to everyone who helped.



Erik



---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing  more.
Download  eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


Re: [JBoss-user] constraining session bean pool

2003-07-08 Thread Scott M Stark
You can't define such a minimal container configuration without extending an
existing one. Use:
jboss
container-configurations
container-configuration extends=Standard Stateful SessionBean
container-nameStateful Session Bean MasteringEJB/container-name
...
--

Scott Stark
Chief Technology Officer
JBoss Group, LLC

Erik Price wrote:

I've read the jboss.xml DTD 
(http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd) and constructed my 
jboss.xml per its requirements (I think), but I still get errors when I 
deploy the JAR file.  Here are the contents of my jboss.xml, can anyone 
tell me what is wrong with it?  I wasn't sure what to use as the value 
for the required element feeder-policy, so I just used the one 
suggested in the DTD's comments.

?xml version=1.0 encoding=UTF-8?
!DOCTYPE jboss PUBLIC
-//JBoss//DTD JBOSS 3.0//EN
http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd;
jboss
container-configurations
container-configuration
container-nameStateful Session Bean 
MasteringEJB/container-name
container-pool-conf
MaximumSize2/MaximumSize

feeder-policyorg.jboss.ejb.plugins.TimedInstancePoolFeeder/feeder-policy 

feeder-policy-conf
increment0/increment
period0/period
/feeder-policy-conf
/container-pool-conf
/container-configuration
/container-configurations
/jboss
The error messages I get are appended below.

Thanks,

Erik



19:14:07,468 INFO  [MainDeployer] Starting deployment of package: 
file:/C:/jboss
/jboss-3.0.7_jakarta-tomcat-4.1.24/server/default/deploy/Count.jar
19:14:07,796 ERROR [MainDeployer] could not create deployment: 
file:/C:/jboss/jb
oss-3.0.7_jakarta-tomcat-4.1.24/server/default/deploy/Count.jar
org.jboss.deployment.DeploymentException: Failed to load metadata; - 
nested thro
wable: (java.lang.NullPointerException)
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:326)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:766)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:626)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at 
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
nDispatcher.java:284)
at 
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
at $Proxy3.deploy(Unknown Source)
at 
org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
tScanner.java:435)
at 
org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDe
ploymentScanner.java:656)
at 
org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
canner.java:507)
at 
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
doScan(AbstractDeploymentScanner.java:217)
at 
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
loop(AbstractDeploymentScanner.java:230)
at 
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
run(AbstractDeploymentScanner.java:207)
Caused by: java.lang.NullPointerException
at 
org.jboss.metadata.ConfigurationMetaData.importJbossXml(Configuration
MetaData.java:236)
at 
org.jboss.metadata.ApplicationMetaData.importJbossXml(ApplicationMeta
Data.java:524)
at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:184)
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:321)
... 16 more
19:14:07,890 ERROR [URLDeploymentScanner] Failed to deploy: 
org.jboss.deployment
[EMAIL PROTECTED] 
url=file:/C:/jboss/jboss-3.0
.7_jakarta-tomcat-4.1.24/server/default/deploy/Count.jar, 
deployedLastModified=0
 }
org.jboss.deployment.DeploymentException: Failed to load metadata; - 
nested thro
wable: (java.lang.NullPointerException)
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:326)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:766)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:626)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at 
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
nDispatcher.java:284)
at 
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
at 

Re: [JBoss-user] constraining session bean pool

2003-07-08 Thread Erik Price


Scott M Stark wrote:
You can't define such a minimal container configuration without 
extending an
existing one. Use:
jboss
container-configurations
container-configuration extends=Standard Stateful SessionBean
container-nameStateful Session Bean 
MasteringEJB/container-name
Great, my JAR deployed successfully when I copied it into 
$JBOSS_HOME/server/default/deploy.

I was then able to run a simple client application which uses 3 separate 
EJB objects (each of which is a simple stateful session bean) and does a 
simple task.  However, what I was trying to do is limit the pool of 
available stateful session beans to 2, so that the ejbPassivate() and 
ejbActivate() methods would be called.

I also adjusted my jboss.xml to include an enterprise-beans element 
with a session element whose ejb-name is the same as the ejb-name 
I have in my ejb-jar.xml, and whose configuration-name is the same as 
the container-name element in my container-configuration.  I have 
appended the updated contents of the jboss.xml file to the end of this 
email in case it is of any use.

I am guessing that this is what Brian Wallis was referring to when he 
said that setting a container-pool-conf MaximumSize is not a hard 
limit.  Does anyone know of another way to constrain the number of 
session beans?  I don't have to do this, but I wanted to see this in 
action (self-education).  Thanks again Brian and Scott for pointing me 
in the right direction on this.

Erik



(my jboss.xml:)

?xml version=1.0 encoding=UTF-8?
!DOCTYPE jboss PUBLIC
-//JBoss//DTD JBOSS 3.0//EN
http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd;
jboss
enterprise-beans
session
ejb-nameCount/ejb-name
configuration-name
Stateful Session Bean MasteringEJB
/configuration-name
/session
/enterprise-beans
container-configurations
container-configuration
extends=Standard Stateful SessionBean
container-name
Stateful Session Bean MasteringEJB
/container-name
container-pool-conf
MaximumSize2/MaximumSize
feeder-policy
org.jboss.ejb.plugins.TimedInstancePoolFeeder
/feeder-policy
feeder-policy-conf
increment0/increment
period0/period
/feeder-policy-conf
/container-pool-conf
/container-configuration
/container-configurations
/jboss


---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing  more.
Download  eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


RE: [JBoss-user] constraining session bean pool

2003-07-08 Thread Bill Burke
there is a strict max size setting.  Forget the config name.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Erik Price
 Sent: Tuesday, July 08, 2003 2:00 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [JBoss-user] constraining session bean pool
 
 
 
 
 Scott M Stark wrote:
  You can't define such a minimal container configuration without 
  extending an
  existing one. Use:
  jboss
  container-configurations
  container-configuration extends=Standard Stateful 
 SessionBean
  container-nameStateful Session Bean 
  MasteringEJB/container-name
 
 Great, my JAR deployed successfully when I copied it into 
 $JBOSS_HOME/server/default/deploy.
 
 I was then able to run a simple client application which uses 3 separate 
 EJB objects (each of which is a simple stateful session bean) and does a 
 simple task.  However, what I was trying to do is limit the pool of 
 available stateful session beans to 2, so that the ejbPassivate() and 
 ejbActivate() methods would be called.
 
 I also adjusted my jboss.xml to include an enterprise-beans element 
 with a session element whose ejb-name is the same as the ejb-name 
 I have in my ejb-jar.xml, and whose configuration-name is the same as 
 the container-name element in my container-configuration.  I have 
 appended the updated contents of the jboss.xml file to the end of this 
 email in case it is of any use.
 
 I am guessing that this is what Brian Wallis was referring to when he 
 said that setting a container-pool-conf MaximumSize is not a hard 
 limit.  Does anyone know of another way to constrain the number of 
 session beans?  I don't have to do this, but I wanted to see this in 
 action (self-education).  Thanks again Brian and Scott for pointing me 
 in the right direction on this.
 
 
 Erik
 
 
 
 
 (my jboss.xml:)
 
 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE jboss PUBLIC
  -//JBoss//DTD JBOSS 3.0//EN
  http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd;
 jboss
  enterprise-beans
  session
  ejb-nameCount/ejb-name
  configuration-name
  Stateful Session Bean MasteringEJB
  /configuration-name
  /session
  /enterprise-beans
 
  container-configurations
  container-configuration
  extends=Standard Stateful SessionBean
 
  container-name
  Stateful Session Bean MasteringEJB
  /container-name
  container-pool-conf
  MaximumSize2/MaximumSize
  feeder-policy
  org.jboss.ejb.plugins.TimedInstancePoolFeeder
  /feeder-policy
  feeder-policy-conf
  increment0/increment
  period0/period
  /feeder-policy-conf
  /container-pool-conf
  /container-configuration
  /container-configurations
 /jboss
 
 
 
 ---
 This SF.Net email sponsored by: Parasoft
 Error proof Web apps, automate testing  more.
 Download  eval WebKing and get a free book.
 www.parasoft.com/bulletproofapps
 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/jboss-user


---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing  more.
Download  eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


Re: [JBoss-user] constraining session bean pool

2003-07-08 Thread Brian Wallis
On Wed, 9 Jul 2003 10:44, Bill Burke wrote:
 there is a strict max size setting.  Forget the config name.

I think it is StrictMaxSizetrue/StrictMaxSize

brian...



---
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing  more.
Download  eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


Re: [JBoss-user] constraining session bean pool

2003-07-07 Thread Erik Price


Brian Wallis wrote:
On Fri, 4 Jul 2003 07:40, Erik Price wrote:

How to configure JBoss 3.0 to constrain the session bean pool to only a
certain number of session beans?  (For stateful beans.)
I wish to test ejbPassivate() and ejbActivate() in action.


You will need to define your own session bean container configuration.

The default ones are in conf/standardjboss.xml and you are probably currently 
using the Standard Stateful SessionBean one from that file which has a max 
pool size of 100.

You can copy this configuration from there into your bean's jboss.xml file 
into the container-configuration section (see the jboss_3_0.dtd file for 
details) then adapt it to your needs. 

Change the container-pool-confMaximumSize from 100 to whatever you need.
I've read the jboss.xml DTD 
(http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd) and constructed my 
jboss.xml per its requirements (I think), but I still get errors when I 
deploy the JAR file.  Here are the contents of my jboss.xml, can anyone 
tell me what is wrong with it?  I wasn't sure what to use as the value 
for the required element feeder-policy, so I just used the one 
suggested in the DTD's comments.

?xml version=1.0 encoding=UTF-8?
!DOCTYPE jboss PUBLIC
-//JBoss//DTD JBOSS 3.0//EN
http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd;
jboss
container-configurations
container-configuration
container-nameStateful Session Bean 
MasteringEJB/container-name
container-pool-conf
MaximumSize2/MaximumSize

feeder-policyorg.jboss.ejb.plugins.TimedInstancePoolFeeder/feeder-policy
feeder-policy-conf
increment0/increment
period0/period
/feeder-policy-conf
/container-pool-conf
/container-configuration
/container-configurations
/jboss
The error messages I get are appended below.

Thanks,

Erik



19:14:07,468 INFO  [MainDeployer] Starting deployment of package: 
file:/C:/jboss
/jboss-3.0.7_jakarta-tomcat-4.1.24/server/default/deploy/Count.jar
19:14:07,796 ERROR [MainDeployer] could not create deployment: 
file:/C:/jboss/jb
oss-3.0.7_jakarta-tomcat-4.1.24/server/default/deploy/Count.jar
org.jboss.deployment.DeploymentException: Failed to load metadata; - 
nested thro
wable: (java.lang.NullPointerException)
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:326)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:766)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:626)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at 
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
nDispatcher.java:284)
at 
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
at $Proxy3.deploy(Unknown Source)
at 
org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
tScanner.java:435)
at 
org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDe
ploymentScanner.java:656)
at 
org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
canner.java:507)
at 
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
doScan(AbstractDeploymentScanner.java:217)
at 
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
loop(AbstractDeploymentScanner.java:230)
at 
org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
run(AbstractDeploymentScanner.java:207)
Caused by: java.lang.NullPointerException
at 
org.jboss.metadata.ConfigurationMetaData.importJbossXml(Configuration
MetaData.java:236)
at 
org.jboss.metadata.ApplicationMetaData.importJbossXml(ApplicationMeta
Data.java:524)
at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:184)
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:321)
... 16 more
19:14:07,890 ERROR [URLDeploymentScanner] Failed to deploy: 
org.jboss.deployment
[EMAIL PROTECTED] 
url=file:/C:/jboss/jboss-3.0
.7_jakarta-tomcat-4.1.24/server/default/deploy/Count.jar, 
deployedLastModified=0
 }
org.jboss.deployment.DeploymentException: Failed to load metadata; - 
nested thro
wable: (java.lang.NullPointerException)
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:326)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:766)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:626)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at 

[JBoss-user] constraining session bean pool

2003-07-03 Thread Erik Price
How to configure JBoss 3.0 to constrain the session bean pool to only a 
certain number of session beans?  (For stateful beans.)

I wish to test ejbPassivate() and ejbActivate() in action.

Thanks and regards,

Erik



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


Re: [JBoss-user] constraining session bean pool

2003-07-03 Thread Brian Wallis
On Fri, 4 Jul 2003 07:40, Erik Price wrote:
 How to configure JBoss 3.0 to constrain the session bean pool to only a
 certain number of session beans?  (For stateful beans.)

 I wish to test ejbPassivate() and ejbActivate() in action.

You will need to define your own session bean container configuration.

The default ones are in conf/standardjboss.xml and you are probably currently 
using the Standard Stateful SessionBean one from that file which has a max 
pool size of 100.

You can copy this configuration from there into your bean's jboss.xml file 
into the container-configuration section (see the jboss_3_0.dtd file for 
details) then adapt it to your needs. 

Change the container-pool-confMaximumSize from 100 to whatever you need.

Then you just need to get your bean to use this new configuration. With 
xdoclet you just define @jboss.container-configuration name=My Stateful 
Configuration (or whatever you called it) otherwise you need to add the 
configuration-name tag to your session bean descriptor in jboss.xml to 
point to the new configuration.

But, this is not a hard limit. I think there is another option to enforce 
the limit but I'm not sure what that is.

brian...



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0016ave/direct;at.asp_061203_01/01
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user