After posting, I tried creating a new bean and it worked fine. I had been noticing startup errors for InstanceAlreadyExistsException, so I wondered if I had been using a cached version of the original bean instead of the latest. So I edited my new bean by adding another method, redeployed it, and it now fails the same way.
So I'm thinking that my JSP is wanting to use one definition of my class, and JBoss is supplying a different version of it, thus the ClassCastException (I have a vague recollection that Java is smart enough to see that two classes that coincidentally have the same name can't be cast to one another).
So, if that is the case, how do I flush out the old bean definitions? (I already tried deleting everything in the server\default\tmp\deploy directory, but that didn't help)
Looks like the class is being packaged in more than one archive. Have a look at:
Use the jmx-console method described in the link above, to try and figure out if that's the case.
Thanks, that helped me resolve the issue (I believe).
It turns out that with NetBeans you have to be careful not to deploy the indiviual projects that make up an enterprise application. You must only deploy the entire app. Otherwise you end up with multiple copies of the beans.
The jmx-console method described in the page you mentioned showed me that I had three instances of the bean, one from the web module war, one from the EJB module jar, and one from the enterprise application ear. So I went to the deploy directory and deleted the war and jar, leaving only the ear file.
After that, the bean I added later works now. For some reason, I can't get the original bean to work, but that I can resolve later.