[jboss-user] [Testimonials] - Re: Migration from Weblogic to JBoss 4.0.5

dward do-not-reply at jboss.com
Thu Mar 22 15:53:18 EDT 2007


So your ClassCastException is different from your original NameNotFoundException.

The NameNotFoundException was caused by looking up a jndi name that was not bound.  It seems like a common thing for people who are used to weblogic to bind beans into jndi with the fully qualified package name of a class.  You are also depending upon the global jndi namespace.  I would suggest you:
1) look into using local interfaces to your ejbs rather than remote interfaces wherever possible
2) change your jndi names to path-like structures
3) make use of ejb references (<ejb-ref> or <ejb-local-ref>) to bind your beans from the global jndi namespace into a local jndi namespace (so you could lookup "java:comp/env/ejb/UserService" - the standard way of doing it)
How to do the above is in the standard ejb documentation and jboss documentation.

You ClassCastException was caused by your second narrow.  You only have to narrow the remote home interface.  After that you can just call create() and use the remote interface you get back directly.  (If you decide to move to local interfaces rather than remote remember that the narrow would then be unnecessary.)

Last, I know you are just trying to migrate an existing application, but remember if you move to EJB3 and JEE 5, explicit jndi lookups can become a thing of the past as you can use annotations to instruct the container to inject resources into your managed componets.

Hope this helps.

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

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



More information about the jboss-user mailing list