The run-as has no affect on the servlet request itself, so these results are correct. Retry the ejb results with the 4.0.3SP1 release and if that is still showing this behavior, create a bug report with the full ejb-jar.xml/jboss.xml descriptors.
I'm facing a similar issue,
I'm trying to set a run-as role in the web.xml and run-as-principal in jboss-web.xml
It seems that EJB called from the web servlet is using the principal in the jndi.properties file under jboss conf dir.
I'd be greatly appreciate if you'll guide me, how to propagate the user from the run-as-principal (jboss-web.xml) to the EJB call.
attached, xml files
** all this is done to solve this issue: http://community.jboss.org/message/558922#558922 , if you have some words of wisdom on that as well, it will be great.