[JBoss-user] [EJB/JBoss] - Re: ClassCastException with LocalHome casting
Thanks Scott. I just wanted to rephrase what you said to clarify. It is imperative that you do not include classes in both a war and jar in the same ear as they will be loaded by two different class loaders, thus causing the ClassCastException. If they are present only once in the ear, they will be loaded and available in the unified loader repository and the war will grab the loaded references when an attempt to load them from the war fails. You do not need to modify the jboss-service.xml file. Now that I understand how JBoss class loading works, I find it preferrable to the Sun implementation, which required you to put the file in both the jar and war in order for it to work. Thanks for the help and the great product. Raj View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3881102#3881102 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3881102 --- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB/JBoss] - Re: ClassCastException with LocalHome casting
"[EMAIL PROTECTED]" wrote : And everyone asking this question has read: | http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossClassLoadingUseCases | Scott, I read the article, and it was very helpful. However, it doesn't yet cover UCL3 and EARs with embedded JARs and WARs (the second TO-DO), which is the situation I'm dealing with. So, extrapolating from what you wrote in the use cases wiki page, I would need to somehow make the EAR load the session bean's interface classes. That way they would be available to both the JAR and WAR. Is this correct? If so, how do I do that? If not, what should I do? Thanks. Raj View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3880326#3880326 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3880326 --- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB/JBoss] - Re: ClassCastException with LocalHome casting
A stateless session bean can be called from a web module. I had in fact done this with Sun prior to trying JBoss. Also, my jar and war were even in the same ear. The issue is just that JBoss changed the default behavior of their web container to follow the servlet spec by default, which is why the settings you mentioned changing previously removed the ClassCastException. You basically set JBoss back to 4.0.1 settings. I did have the same problem as you, and that's why I posted the response to your question. I just wasn't convinced that the solution that I chose (to use the JBoss unified class loader for Tomcat) was appropriate. The JBoss developers changed it for a reason, after all. Incidentally, I tried adding the packages of the classes present in my session bean interface in a comma seperated list to the filtered packages list in the tomcat jboss-service.xml file and setting the class loader properties back to false, and that works as well. Actually, I'd really appreciate it if a JBoss developer would comment on this issue, and what is an appropriate course of action to deal with this issue (other than pass by value, because that's CPU intensive). Thanks, Raj View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3879838#3879838 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3879838 --- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB/JBoss] - Re: ClassCastException with LocalHome casting
"movzx" wrote : | This is a class loader issue of Java2. Not really, this is an artifact of the Servlet 2.3 spec, which calls for a web container first class loading. I haven't tried it yet, but upon rereading the JIRA issue discussion I mentioned earlier, I believe that the more appropriate way to solve my problem is to instead add the session bean interface packages to the Filtered packages list in the file that movzx referenced earlier. Anyone try this yet? Thanks Raj View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3879754#3879754 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3879754 --- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB/JBoss] - Re: ClassCastException with LocalHome casting
There is no need to narrow on a LocalHome, only with a RemoteHome. The problem is probably that JBoss, as of 4.0.2, uses the Tomcat class loader for anything hosted by Tomcat, including web services and JSPs. Prior to this, they used the JBoss Class Loader by default. You have a few different options with regards to how to handle this, so here's the wiki page that should help: http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration and JIRA issue page: http://jira.jboss.com/jira/browse/JBAS-1691 Personally, I just set Tomcat to use the JBoss class loader, but this is probably just a stopgap fix. I think I understand why it was changed, but am not sure I'm happy with the call-by-value method of dealing with this. Does anybody have any other solutions that might work. I'm currently publicly exposing a JAX-RPC web service, which in turn calls a stateless session bean. I need the web service for .NET client integration. Thanks in advance for any help that anyone can offer. Raj View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3879604#3879604 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3879604 --- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user