Greetings JBoss EJB3 community,
I've got a JSF/EJB3 based project underway. As I've been developing I've been deploying into a JBoss AS that I put together by downloading the 4.0.3SP1 package, unpacking, and adding the EJB3_RC3 files to the "all" server per the instructions. Everything has been working as expected. As I've said before, this stuff is truly a joy to work with.
But I stumbled onto a problem last night. It looks like a configuration issue, but I'm not sure how to solve it.
I set up another AS instance by using the JBoss AS installer: I chose the EJB3 option and took all the defaults which set up a "default" server with EJB3 support. But when I drop the same EAR that works in my all+ejb3 into this new AS and start up the "default" server, the EAR appears to deploy correctly, but when I try to interact with the app I get a java.lang.ClassCastException when it tries to look up a stateless session bean:
10:00:58,287 INFO [STDOUT] java.lang.ClassCastException: $Proxy66 10:00:58,289 INFO [STDOUT] at com.saynow.mediamanager.web.Utils.getAudioFileManager(Utils.java:11) 10:00:58,289 INFO [STDOUT] at com.saynow.mediamanager.web.MediaManagerBean.<init>(MediaManagerBean.java:10) 10:00:58,290 INFO [STDOUT] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 10:00:58,290 INFO [STDOUT] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 10:00:58,291 INFO [STDOUT] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 10:00:58,291 INFO [STDOUT] at java.lang.reflect.Constructor.newInstance(Constructor.java:494) 10:00:58,292 INFO [STDOUT] at java.lang.Class.newInstance0(Class.java:350) 10:00:58,292 INFO [STDOUT] at java.lang.Class.newInstance(Class.java:303)...etc.
Line 10 & 11 of Utils being:
InitialContext ctx = new InitialContext(); return (AudioFileManager) ctx.lookup(AudioFileManager.class.getName());
The only thing I notice as unexpectedly different in the server start-up console output are these two lines, which show up in the installer default+ejb3 but not in the manually installed all+ejb3:
09:58:26,421 INFO [NamingService] Started jndi bootstrap jnpPort=1099, rmiPort=1098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076 09:58:26,852 WARN [NamingService] Context.PROVIDER_URL in server jndi.properties, url=localhost:1099
Has anyone encountered anything like this before? Or know what I am doing wrong? I do not have copies of the session beans in WEB-INF/lib or WEB-INF/classes. I am loading the datasource and connector jar, along with tomahawk and some other commonly used libs via a sar, but it does not include any of the session or entity beans either.
Any help greatly appreciated,