-
1. Re: @RunAs annotations on Servlet Classes
anil.saldhana Mar 13, 2008 12:25 PM (in response to anil.saldhana)Scott says:
This should be showing up in the JBossWebMetaData after AnnotationMetaDataDeployer, however, the equivalent of the MergedJBossMetaDataDeployer for JBossWebMetaData has not been created yet.
-
2. Re: @RunAs annotations on Servlet Classes
starksm64 Mar 13, 2008 1:14 PM (in response to anil.saldhana)I added a org.jboss.web.deployers.MergedJBossWebMetaDataDeployer to the server module. It needs the http://jira.jboss.com/jira/browse/JBMETA-7 completed.
-
3. Re: @RunAs annotations on Servlet Classes
starksm64 Mar 13, 2008 2:09 PM (in response to anil.saldhana)I added a stub org.jboss.metadata.web.spec.AnnotationMergedView to metadata. I can't work on this right now so if you want to try be my guest.
-
4. Re: @RunAs annotations on Servlet Classes
anil.saldhana Mar 13, 2008 4:09 PM (in response to anil.saldhana)Sure, Scott. If that is what is needed to end the rollercoaster ride of JBCTS-593, then there will I be. :)
-
5. Re: @RunAs annotations on Servlet Classes
anil.saldhana Mar 24, 2008 12:36 PM (in response to anil.saldhana)Scott, I need some guidance here.
The servlet class defines the @RunAs annotation. Hence the web.xml servlet definition has no need for an explicit run-as element. Now the JBossWebMetaData merge fails with the following RTE.// Update the run-as indentity to use the principal name if (webXmlRunAs == null) { throw new IllegalStateException("run-as-principal: " + principalName + " found in jboss-web.xml but there was no run-as in web.xml"); }
This is because the webxml metadata is not aware of the annotation. Shouldn't Carlo's annotation deployer kick in before the webmetadata parse? -
6. Re: @RunAs annotations on Servlet Classes
anil.saldhana Mar 24, 2008 12:55 PM (in response to anil.saldhana)Maybe I need to figure out how to merge the annotation metadata and the webxml metadata before we hit the jbosswebmetadata parse/merge.
-
7. Re: @RunAs annotations on Servlet Classes
anil.saldhana Mar 24, 2008 1:18 PM (in response to anil.saldhana)The AnnotationMetaDataDeployer should be running before the web parsing deployers. It is running after. If not, we will need to create a separate deployer just to parse the web annotations.
-
8. Re: @RunAs annotations on Servlet Classes
anil.saldhana Mar 24, 2008 4:00 PM (in response to anil.saldhana)This is what I am trying.
I am reusing some code from the existing AnnotationMetaDataDeployer to create a parsing deployer that parses the web deployment for annotations and creates a web meta data (annotations view). This parsing deployer runs before the WebAppParsingDeployer. Then in the JBossWebAppParsing Deployer, I am going to create a merged spec view (AnnotationMergedView between xml and annotation). This merged spec view will be merged with the JBossWebMetaData. -
9. Re: @RunAs annotations on Servlet Classes
anil.saldhana Mar 24, 2008 4:25 PM (in response to anil.saldhana)Looks like until the PostClassloader phase, we have no classloaders. That means my current parsing deployer approach will not work.
Plan B:
In the JBossWebMetaData merge, I am going to pull out the run as processing and push that to the post classloader deployer that exists now, AnnotationMetaDataDeployer. -
10. Re: @RunAs annotations on Servlet Classes
anil.saldhana Mar 24, 2008 6:19 PM (in response to anil.saldhana)http://jira.jboss.com/jira/browse/JBMETA-10
I have made JBossWebMetaData merge to ignore the web xml runas. A final merge done by the AnnotationMetaDatadeployer is the complete merge. The metadata project test case has been updated to test this. -
11. Re: @RunAs annotations on Servlet Classes
starksm64 Mar 24, 2008 9:13 PM (in response to anil.saldhana)The annotation deployer has to run after parsing deployer as it needs the deployment class loader. We need to get rid of the old xml only based assertions to allow for web.xml, jboss-web.xml and annotations (possibly other deployers) providing metadata input.
So, you came to the right solution. -
12. Re: @RunAs annotations on Servlet Classes
anil.saldhana Mar 24, 2008 9:34 PM (in response to anil.saldhana)===================================================== Caused by: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLo ader.java:63) at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader. java:502) at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader. java:462) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseC lassLoader.java:460) at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseC lassLoader.java:437) ..... at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.jboss.wsf.container.jboss50.JAXWSDeployerHookPreJSE.getRelevantSe rvlets(JAXWSDeployerHookPreJSE.java:122) at org.jboss.wsf.container.jboss50.JAXWSDeployerHookPreJSE.isWebServiceD eployment(JAXWSDeployerHookPreJSE.java:98) at org.jboss.wsf.container.jboss50.ArchiveDeployerHook.deploy(ArchiveDep loyerHook.java:84) ===============================
Does this ring any bells, Scott?
I need to verify the ejb3 security integration code a little bit further before I commit my ejb3 project changes. -
13. Re: @RunAs annotations on Servlet Classes
starksm64 Mar 24, 2008 9:40 PM (in response to anil.saldhana)Seems familiar, but would need to validate the unit class loader. I thought I saw this when there was a destroyed class loader being used.
-
14. Re: @RunAs annotations on Servlet Classes
starksm64 Mar 25, 2008 1:19 AM (in response to anil.saldhana)I'm not seeing the AnnotationMergedView in the current jboss-metadata.jar, so the MergedJBossWebMetaDataDeployer is not compiling. I'm going to update it.