[Design of EJB 3.0] - Status of annotation based configuration
by scott.stark@jboss.org
I'm seeing an NPE currently due to a lookup of an annotation not returning a value in the ejb3 container:
| 07:44:30,645 ERROR [AbstractKernelController] Error installing to Start: name=jboss.j2ee:ear=appclient_dep_compat14_50.ear,jar=appclient_dep_compat14_50_ejb.jar,name=TestBean,service=EJB3 state=Create
| java.lang.NullPointerException
| at org.jboss.ejb3.EJBContainer.initializePool(EJBContainer.java:804)
| at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:740)
| at org.jboss.ejb3.session.SessionContainer.start(SessionContainer.java:208)
| at org.jboss.ejb3.stateless.StatelessContainer.start(StatelessContainer.java:124)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| ...
|
| protected void initializePool() throws Exception
| {
| org.jboss.annotation.ejb.Pool poolAnnotation = getAnnotation(org.jboss.annotation.ejb.Pool.class);
| String registeredPoolName = poolAnnotation.value(); // line 804
| int maxSize = poolAnnotation.maxSize();
| long timeout = poolAnnotation.timeout();
| Ejb3Deployer deployer = deployment.getDeployer();
| PoolFactoryRegistry registry = deployer.getPoolFactoryRegistry();
| PoolFactory factory = registry.getPoolFactory(registeredPoolName);
| pool = factory.createPool();
| pool.initialize(this, maxSize, timeout);
| ...
|
What are we expecting to do with this type of code?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105529#4105529
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105529
18 years, 4 months
[Design the new POJO MicroContainer] - Re: MainDeployerImpl.deploy and checkComplete
by adrian@jboss.org
"alesj" wrote : With the full impl of JBMICROCONT-187 (which is done :-)), this needs changing in MainDeployerImpl.deploy:
|
| | public void deploy(Deployment deployment) throws DeploymentException
| | {
| | addDeployment(deployment);
| | process();
| | // FIXME don't check contexts
| | checkComplete(deployment);
| | }
| |
|
| Since it's completely legit to have not yet fully installed contexts - depending beans, OSGi deployments, ...
|
| Adding 'checkStructureComplete(Deployment)' in DeployerClient --> only checking if deployment is in error or missing deployer?
No that's not the purpose of the single deployment api.
It is a short hand way of doing:
| deployerClient.addDeployment(deployment);
| deployerClient.process();
| deployerClient.checkComplete();
|
Except in a thread safe way. In fact the code should be:
| public void deploy(Deployment deployment) throws DeploymentException
| {
| addDeployment(deployment);
| process(deployment);
| try
| {
| checkComplete(deployment);
| }
| catch (DeploymentException e)
| {
| // Didn't work, roll it back
| removeDeployment(deployment);
| process(deployment);
| }
| }
|
Where process(deployment) only processes the passed deployment,
not other deployments that may have been added on other threads.
But more importantly, it should really be an atomic operation.
i.e. the deployment is either fully working or it is not deployed at all.
If you want to add a less strict convience api that is fine,
but it is a 5% use case not the normal 95% use case of this method.
It's not related to this issue.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105514#4105514
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105514
18 years, 4 months