[jboss-user] [Beginners Corner] - JBoss 5.1 j2ee client jars and classloader

ms-suxx do-not-reply at jboss.com
Mon Jul 27 07:30:15 EDT 2009


Hi, guys!

The thing is that with my app i cannot rely on EJB3 client container because of two issues:

1. AFAIK, the @EJB annotation fails to inject EJB proxies into dynamic context. It works only with static one(@EJB private static MyServiceBean ...).
2. The container is too-much-clever for my app, since the app should connect to server not before but after it is started, UI is shown and user made choice which server to connect to.

I have a j2ee standalone client, developed under JBoss 5.0.1. It was successfully used without any client containers (through SecurityClientFactory.getSecurityClient().login(), InitialContext().lookup(...), etc).

When migrated from Jboss 5.0.1 to 5.1.0 i've discovered, that now the client, even re-compiled against v5.1.0, fails to start with the same set of jars(taken from 5.1.0, of course) with meaningless error "ClassCastException: javax.naming.Reference cannot be cast to cool.ib.service.UserService".
But the client starts successfully when i include the whole set of server jars into it's classpath. It seems, some more jars need to be added into classpath.

So, the question is: what are the jars i need to include into the JBoss 5.1 j2ee client classpath to start it without using the EJB3 client container?

Or even better... as i understand, EJB3 client container loads client app and all the required classes directly from server. So, how to utilize the JBoss client classloader(which provides server classes to the client container) in my app?

Thanks!

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246157#4246157

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246157



More information about the jboss-user mailing list