-
1. Re: Security Deployer assuming VFSDeploymentUnit
anil.saldhana Jan 28, 2009 11:25 AM (in response to anil.saldhana)There is some discussion that is related to this:
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4123146#4123146 -
2. Re: Security Deployer assuming VFSDeploymentUnit
anil.saldhana Jan 28, 2009 11:38 AM (in response to anil.saldhana)Thomas is creating a DU which is in memory and of type AbstractDeploymentUnit. The sec deployer is not happy as it expects a vfs DU. Maybe thomas needs to look at the vfs memory Du (something, like "vfsmemory://"
A possibility is to create a deployer that goes before security deployer on demand and converts into a vfs DU. The other option is use vfs in-memory deployment. -
3. Re: Security Deployer assuming VFSDeploymentUnit
thomas.diesler Jan 28, 2009 11:38 AM (in response to anil.saldhana)The background is that I am trying to implement an OSGi HttpService that dynamically deploys an JbossWebMetaData attached to an AbstractDeploymentUnit
AbstractDeployment deployment = new AbstractDeployment(alias); //factory.addContext(deployment, ""); ClassLoader classLoader = servlet.getClass().getClassLoader(); MutableAttachments mutableAttachments = (MutableAttachments)deployment.getPredeterminedManagedObjects(); mutableAttachments.addAttachment(ClassLoaderFactory.class, new ContextClassLoaderFactory(classLoader)); mutableAttachments.addAttachment(JBossWebMetaData.class, jbwmd); mainDeployer.deploy(deployment);
should it be possible to deploy an AbstractDeployment or is VFSDeploymentUnit the only valid option? -
4. Re: Security Deployer assuming VFSDeploymentUnit
alesj Jan 28, 2009 11:46 AM (in response to anil.saldhana)Why does AbstractSecurityDeployer assume VFSDeploymentUnit?
Thomas, perhaps some VFS im-memory usage will get you past it.
I'll look into details tomorrow. -
5. Re: Security Deployer assuming VFSDeploymentUnit
thomas.diesler Jan 28, 2009 1:11 PM (in response to anil.saldhana)After fixing the bug in AbstractSecurityDeployer there seems to be more
19:04:56,160 INFO [STDOUT] Caused by: org.jboss.deployers.spi.DeploymentException: Structure can only be determined for VFSDeployments org.jboss.deployers.client.plugins.deployment.AbstractDeployment@6145c5 19:04:56,160 INFO [STDOUT] at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.determineStructure(VFSStructuralDeployersImpl.java:213) 19:04:56,160 INFO [STDOUT] at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers.determineStructure(AbstractStructuralDeployers.java:77) 19:04:56,160 INFO [STDOUT] at org.jboss.deployers.plugins.main.MainDeployerImpl.determineStructure(MainDeployerImpl.java:853) 19:04:56,160 INFO [STDOUT] at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainDeployerImpl.java:303) 19:04:56,160 INFO [STDOUT] at org.jboss.deployers.plugins.main.MainDeployerImpl.deploy(MainDeployerImpl.java:413) 19:04:56,203 INFO [STDOUT] at org.jboss.osgi.service.http.beans.WebAppGeneratorService.registerServlet(WebAppGeneratorService.java:79)
Should the StructuralDeployers even kick in if a deployment is not a VFS deployment? -
6. Re: Security Deployer assuming VFSDeploymentUnit
alesj Jan 28, 2009 3:18 PM (in response to anil.saldhana)Deja vu? ;-)
We've been over this already.
- http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4132130#4132130 -
7. Re: Security Deployer assuming VFSDeploymentUnit
thomas.diesler Jan 29, 2009 1:04 AM (in response to anil.saldhana)Yes, and I believe we got it to work in AS42. However, I confirmed with Alessio tht the WS Endpoint API probably never worked in AS50. The related tests in JBossWS are disabled.
Perhaps we can revisit this now and cut through it for AS50
Here is how I currently try to do thisAbstractDeployment deployment = new AbstractDeployment(alias); factory.addContext(deployment, ""); ClassLoader classLoader = servlet.getClass().getClassLoader(); MutableAttachments mutableAttachments = (MutableAttachments)deployment.getPredeterminedManagedObjects(); mutableAttachments.addAttachment(ClassLoaderFactory.class, new ContextClassLoaderFactory(classLoader)); mutableAttachments.addAttachment(JBossWebMetaData.class, jbwmd); mainDeployer.deploy(deployment);
https://svn.jboss.org/repos/jbossas/projects/jboss-felix/trunk/modules/service/http-beans/src/main/java/org/jboss/osgi/service/http/beans/WebAppGeneratorService.java -
8. Re: Security Deployer assuming VFSDeploymentUnit
alesj Jan 29, 2009 3:47 AM (in response to anil.saldhana)This should work, as there is a StructureMD check before you demand VFSDeployment:
AbstractStructuralDeployers.javaAttachments attachments = deployment.getPredeterminedManagedObjects(); StructureMetaData structureMetaData = attachments.getAttachment(StructureMetaData.class); if (structureMetaData == null) { structureMetaData = StructureMetaDataFactory.createStructureMetaData(); try { determineStructure(deployment, structureMetaData);
where determineStructure() is only impled for VFS based deployments.
But since you already have StructureMD,
you should be by-passing that VFSD check. -
9. Re: Security Deployer assuming VFSDeploymentUnit
adrian.brock Jan 29, 2009 9:48 AM (in response to anil.saldhana)Thomas shouldn't have to make his deployment a dummy VFSDeployment for this to work.
If the SecurityDeployer (and other deployers) don't work without a VFS file then there
is something wrong with them.
Either they shouldn't be looking at the deployment at all or they need to be
to fixed such that Thomas can pass in whatever metadata the SecurityDeployer is trying
to determine from the VFS.
If the fix is the latter then it shows the Security integration with the deployers is incomplete.
I doubt the Tomcat deployer works without a VFS file either currently since it will want to use
that to get the content for the web context. -
10. Re: Security Deployer assuming VFSDeploymentUnit
dimitris Feb 2, 2009 3:59 AM (in response to anil.saldhana)I believe the changes break some tests:
http://hudson.qa.jboss.com/hudson/view/JBoss%20AS/job/JBoss-AS-5.0.x-testSuite-jrockit16/134/testReport/
org.jboss.test.jacc.test.FormAuthUnitTestCase(JACC).testFormAuthException
org.jboss.test.security.test.WebJASPIFormUnitTestCase(tests-security-basic-unit).unknown
org.jboss.test.web.security.GenericHeaderAuthUnitTestCase.testGenericHeaderBaseAuth
org.jboss.test.web.test.FormAuthUnitTestCase.testFormAuthException -
11. Re: Security Deployer assuming VFSDeploymentUnit
alesj Feb 2, 2009 4:27 AM (in response to anil.saldhana)They also break the api. ;-)