- This topic has 4 replies, 3 voices, and was last updated 19 years, 8 months ago by Jason Price.
-
AuthorPosts
-
Jason PriceMemberHi
Nothing to do with myeclipseide but more of a jboss/j2ee thang.We have a EJB project that contains lots of EJBs that are common to most of our web and client applications. As the EJB are generic so to speak this is packaged and deployed outside of any ear file. Everything works fine except for when we need to change any of these EJBs and redeploy. When we do everything appears to redeploy properly but the webapps then start generating class cast exceptions and the only way to fix it is to restart jboss.
Is this expected behaviour?
What is standard practice for this sort of common code. I am toying with the idea of splitting out the ejbs into different packages but I not sure that this will make any difference.BTW all the EJBs are stateless session beans that just provide glue between web apps/clients and the Business Classes (using Data Factory pattern).
Riyad KallaMemberAnybody have ideas? I’m curious about this as well now 🙂
Tom MaloneMemberWhat os are you running, as for me on windows when i redeploy I get can’t remove foo.jar, as its in use, is it possible its something like that.
Tom
Jason PriceMembertomjmalone, I know what you mean I get the same when testing but I think thats to do with the JDK locking the file either while sessions are still active or hotspot debugging. The servers are running gentoo 2004.3 but I get the same behaviour on windows. What I think is happending is that because several web apps satellite the EJB project JBOSS is cacheing the classes for each webapp. When the webapps gets a newer version of a class handed back to it its version no doesn’t match so I get Class Cast Exception. Obviously restarting JBOSS clears out the cache and everything runs fine again. However after tikering at the weekend I think the best solution is to use EAR files for each web app and bundle a copy of the ejb within the ear. If I change the xdoclet commad to local instead of both I think it will work as intended. I will post back if and when I get it working!
Jason PriceMemberThat didn’t work. I wasn’t thinking properly earlier (never post before tea/coffee!). The ejbs can only be deployed once on the server; if I just include the EJB jar in each project, then each project will try to deploy the ejbs with same jndi names, etc.
I could go through and rename the jndi names for each app but if I am doing that I might as well ditch j2ee and just use servlets/jsps.
The whole point of me using EJBs was we have a comon core of code that provides all the standard functions.
How does everyone else do this? -
AuthorPosts