I have the exact same problem as as the one described above! Anyone that has any suggestions to what can be the reason for this and how to get around it?
This is an annoying problem!
You said that this will be fixed in Jboss 4.03. Do you know when this version will be available? Could you provide us a patch (or tell how to implement this fix in the Jboss 4.0.2 source code) that solves this problem in the meantime?
There will be a patch out at the end of the week.
I tried both the patch and version 4.0.3RC1. Both end up with the same "No matching username found in Principals".
Just as if the code responsible for pushing the credentials from Tomcat to the EJB container was pushing null instead of the corect value. Amazingly enough, version 4.0.3RC1 works fine when I replace Tomcat 5.5 sar by Tomcat 5.0.
Of course, when you declare a run-as element for you EJBs, the caller identity will be that one instead of the one that was authenticated by the web container.
This can produce different error messages, but imho these are due to the same problem in Tomcat5.5 sar.
Works fine with JBAS 4.0.1SP1 as well as version 3.2.3.
Me too, I've tried several times without success. If I run Tomcat sepparately out of Jboss everything is fine, but as soon as I deploy my frontend application from within the Embedded Tomcat instance the Jboss DatabaseServerLoginModule gets "null" as the username and this will throw the "username/password" exception. The exception is usually thrown after several lookup calls to some ejbs, but never after the first lookup to a bean (the first few calls are always fine).
I'll write a simple testcase and post it asap.
Crepidany, where can I get a version of Tomcat5.0.sar?
Download and extract version 4.0.1SP1.
Under %JBOSS_HOME%\server\default\deploy\ there is a directory called jbossweb-tomcat50.sar which contains a lot of jars as well as the root web application for your server. Replace jbossweb-tomcat55.sar from JBOSS 4.0.3 RC1 by jbossweb-tomcat50.sar from version 4.0.1SP1.
This is an ugly hack but it works. But unfortunatedly 4.0.1SP1 contains another annoyance: when a default page contains tags, tomcat translates the values of the src attributes incorrectly, so no images display in the welcome page.
Hope this will help you.
At the moment I'm using jboss 4.0.5 an when I call an Ejb 2.1 staleless method from a stateful one, in the latter one I get:
principal = [roles=[internalRole],principal=anonymous]
It seems an info propagation error from stateful to stateless EJB. I don't understand if the bug has been solved or it hasn't solved since the version 4.0.3 (as you has previously said in anather post).
I have a similar problem with jboss-4.0.5.GA: Calling stateless session bean 2 from stateless session bean 1 using 'runAs' makes me loose the caller principal. It changes to 'anonymous'.
I filed the follwing bug report http://jira.jboss.com/jira/browse/JBAS-3945 which contains a test case to re-produce the error.