This content has been marked as final.
Show 7 replies
-
1. Re: How to pass object of web tier to slsb in ejb tier
asack Mar 23, 2006 7:33 AM (in response to gus888)Post code/example and exceptoin...might want to post JNDI namespace as well..
-
2. Re: How to pass object of web tier to slsb in ejb tier
gus888 Mar 23, 2006 6:04 PM (in response to gus888)Hi Asack,
Thank you for your response. The partial codes shown as follows:[web tier] public class ManageBean implements Serializable { private Test test; public void saveTo() { Utils.getTestDAO.save(test); } ... } public class Test { private Analyte analyte; private Method method; ... } [ejb tier] @Entity @Table (name="METHODS") public class Method { ... } @Entity @Table (name="ANALYTE") public class Analyte { ... } @Stateless public class TestDAOBean{ public void saveTo(Test test) { em.persist(test.getMethod); em.persist(test.getAnalyte); } }
When I deployed the codes, I got a exception of NoClassFound for Test ...
Since I already changed the original code to pass entity reference to SLSB DAO, I could not give the detail exceptions, but I really want to know why I couldn't pass a web tier reference to ejb container. Thank you very much in advance. -
3. Re: How to pass object of web tier to slsb in ejb tier
bill.burke Mar 23, 2006 6:16 PM (in response to gus888)WARs are isolated. You need to move your utility jars outside of it.
-
4. Re: How to pass object of web tier to slsb in ejb tier
bill.burke Mar 23, 2006 6:17 PM (in response to gus888)...or, change the classloading behavior of the war with a jboss specific configuration. See the JBoss 4.0.x doco for more detail: hint its a switch in jboss-web.xml
-
5. Re: How to pass object of web tier to slsb in ejb tier
gus888 Mar 23, 2006 11:35 PM (in response to gus888)Hi Bill,
Thank you very much for your response and help. You saidYou need to move your utility jars outside of it.
It means I need to create another utility jar? I currently have one ejb jar and a web war. Should I put the utility jar into ejb jar or a independent jar.
In addition.See the JBoss 4.0.x doco for more detail: hint its a switch in jboss-web.xml
Could you please give me a little more details? in which section of Jboss server document. Sorry for many questions. I am new in ejb 3, honestly in ejb. Thanks again for your help. -
6. Re: How to pass object of web tier to slsb in ejb tier
starksm64 Mar 25, 2006 11:56 AM (in response to gus888)Just put the shared classes in the ejb jar or a jar it references.
http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoadingOverview -
7. Re: How to pass object of web tier to slsb in ejb tier
gus888 Mar 25, 2006 12:31 PM (in response to gus888)Thank you so much Scott!
GUS