[Design the new POJO MicroContainer] - Re: The deployers project is a mess
by adrian@jboss.org
Adding a bit more logging shows this output;
| 365 TRACE [VFSStructuralDeployersImpl] Determining structure for ejbs.jar deployers=[org.jboss.deployers.vfs.plugins.structure.war.WARStruct
| ure@1ea0252, org.jboss.test.deployers.vfs.structure.ear.support.MockEarStructureDeployer@1c695a6, org.jboss.deployers.vfs.plugins.structure.
| jar.JARStructure@3e89c3, org.jboss.deployers.vfs.plugins.structure.file.FileStructure@1a52fdf]
| 366 TRACE [WARStructure] ... no - doesn't look like a war and no WEB-INF subdirectory.
| 366 TRACE [WARStructure] Not recognised: ejbs.jar
| 366 TRACE [JARStructure] ... ok - its an archive or at least pretending to be
| 375 TRACE [JARStructure] ... candidate annotations returned false
| 375 TRACE [JARStructure] Not recognised: ejbs.jar
| 375 TRACE [FileStructure] ... no - not a file.
| 375 TRACE [FileStructure] Not recognised: ejbs.jar
| 376 TRACE [VFSStructuralDeployersImpl] ejbs.jar not recognised
|
So its not finding the annotations in JARStructure.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211852#4211852
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211852
17 years, 1 month
[Design the new POJO MicroContainer] - Re: The deployers project is a mess
by adrian@jboss.org
anonymous wrote :
| Can you check now, with exact versions, if this EAR stuff still fails?
|
| adrian(a)jboss.org wrote:
| > A lot of the tests are failing when I use eclipse again.
| > Including the EAR annotation tests which I think you've already fixed twice before?
|
Can't you just download a copy of eclipse and try it yourself?
For example in deployers trunk if I run
org.jboss.test.deployers.DeployersVFSTestSuite.java
I get four failures, the EAR one gives the error
| junit.framework.AssertionFailedError: Expected [appc.jar, ejbs.jar, web.jar, services.jar] got [] expected:<4> but was:<0>
| at junit.framework.Assert.fail(Assert.java:47)
| at junit.framework.Assert.failNotEquals(Assert.java:277)
| at junit.framework.Assert.assertEquals(Assert.java:64)
| at junit.framework.Assert.assertEquals(Assert.java:195)
| at org.jboss.test.deployers.vfs.structure.AbstractStructureTest.assertChildContexts(AbstractStructureTest.java:80)
| at org.jboss.test.deployers.vfs.structure.ear.test.EARStructureUnitTestCase.testEARAnnotationScanning(EARStructureUnitTestCase.java:143)
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211851#4211851
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211851
17 years, 1 month
[Design the new POJO MicroContainer] - Re: Locks on MainDeployerImpl
by alesj
What about if I just simply do this:
| public void process()
| {
| if (deployers == null)
| throw new IllegalStateException("No deployers");
|
| lockRead();
| try
| {
| if (shutdown.get())
| throw new IllegalStateException("The main deployer is shutdown");
|
| Map<String, Deployment> copy = new LinkedHashMap<String, Deployment>(toRedeploy);
| toRedeploy.clear();
|
| try
| {
| processToUndeploy(copy.keySet());
| }
| catch (DeploymentException e)
| {
| throw new RuntimeException("Error while removing re-deployments", e);
| }
|
| List<DeploymentContext> undeployContexts = null;
| if (undeploy.isEmpty() == false)
| {
| // Undeploy in reverse order (subdeployments first)
| undeployContexts = new ArrayList<DeploymentContext>(undeploy.size());
| for (int i = undeploy.size() - 1; i >= 0; --i)
| undeployContexts.add(undeploy.get(i));
| if (reverted != null)
| Collections.sort(undeployContexts, reverted);
| undeploy.clear();
| }
|
| if (undeployContexts != null)
| {
| deployers.process(null, undeployContexts);
| }
|
| try
| {
| processToDeploy(copy.values());
| }
| catch (DeploymentException e)
| {
| throw new RuntimeException("Error while adding -redeployments", e);
| }
|
| List<DeploymentContext> deployContexts = null;
| if (deploy.isEmpty() == false)
| {
| deployContexts = new ArrayList<DeploymentContext>(deploy);
| if (comparator != null)
| Collections.sort(deployContexts, comparator);
| deploy.clear();
| }
|
| if (deployContexts != null)
| {
| deployers.process(deployContexts, null);
| }
| }
| finally
| {
| unlockRead();
| }
| }
|
Where I make a copy of currently existing re-deployments.
Then I don't care if some come in between.
Or am I missing something?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211818#4211818
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211818
17 years, 1 month
[Design the new POJO MicroContainer] - Re: Locks on MainDeployerImpl
by adrian@jboss.org
"alesj" wrote : "adrian(a)jboss.org" wrote :
| | then they might end up processing each other's stuff but they won't miss one.
| I wasn't thinking about missing one.
| I had this in mind (#t = #thread):
|
| 1t - addDeployment
| 1t - process
|
| While 1t is just done with process' undeploy part, but before it enters processTopDeploy, 2t does addDeployment, but it's really re-deploy.
| Meaning it will add its previous context to undeploy, which wouldn't be
| processed until 2t calls process, but itself would be picked-up by 1t's processToDeploy.
| In this case the 2t's re-deploy's undeploy wouldn't happen, only deploy,
| which can lead to whatever. :-)
Ok, I see your point, but that's not a reason to use the write lock which is for a different purpose.
I can see two possible fixes:
1) Have a seperate toRedeploy list you can snapshot where "processUndeploy()"
adds those to the "toUndeploy" snapshot and creates an entry in the real "toDeploy" list.
2) Don't move a "toDeploy' request into the snapshot while it exists in the
real "toUndeploy" list.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211796#4211796
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211796
17 years, 1 month