[Installation, Configuration & DEPLOYMENT] - Re: Overriding universal classloader, JBoss 4.2.1GA
by jaikiran
anonymous wrote : Caused by:
| java.lang.ClassCastException: org.hibernate.search.event.FullTextIndexEventListener
I remember seeing this specific class, running into ClassCastException, in quite a number of posts. And incidentally, all those posts seem to complain that the same application works fine on 4.0.x and starts throwing exceptions on 4.2.x.
I looked for this class in the hibernate jars and found that this specific class is located in the hibernate-annotations.jar. This jar is located in the server/< serverName>/lib folder. I *think* i am some what understanding what the problem might be. I believe, you do not have this hibernate-annotations.jar in the WEB-INF/lib folder. I would recommend that you include this hibernate-annotations.jar in the WEB-INF/lib folder of your application. At this point, i cant say which version of hibernate-annotations.jar should be included in your lib folder. It will depend on the version of hibernate your application is using. Currently JBoss-4.2.x ships with Version: 3.2.1.GA of this jar.
If including the (appropriate) version of hibernate-annotations.jar works for you (i.e. the classcast for FullTextIndexEventListener goes away) and in case you run into some other hibernate related classcast exception, then even include the (appropriate) version of hibernate-entitymanager.jar (again i found this jar in the server/< serverName>/lib folder) in the WEB-INF/lib folder of your app.
Hopefully, if things go well and you are able to get the application working in 4.2.1, then i guess i will be able to explain the reason why you are running into this exception.
anonymous wrote : I guess you can reproduce this by setting up a Spring application that initializes some hibernate -related beans in it's config.xml during application startup.
I would love to try this out on my setup, but at this point i dont have a ready Spring application (actually i never have worked on Spring) which can be used. Well, i could download a sample application from somewhere but presently with other things at hand, its really hard. Maybe if you have a small app with can reproduce this problem, you can just mail it to jai_forums2005 AT yahoo DOT co DOT in
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094409#4094409
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094409
18Â years, 9Â months
[JBoss Seam] - Injecting a narrower-scoped bean into a wider-scoped bean
by adamw
Hello,
I looked through the manual, but couldn't find an answer.
Let's say I have beans with following scopes:
* A - application
* S - stateless
* C - conversation
In the examples I have often seen C-beans are injected into S-beans. As I understand, this is correct wrt to concurrent requests, that is, Seam will create enough copies of S-beans so that an S-bean serves at most one request at a time (if that wasn't true, and two requests invoked a method on an S-bean at the same time, one injected value would overwrite the other...)?
Creating additional beans isn't possible with A-beans however: Seam can create at most one A-bean. So I suppose injecting a C-bean into an A-bean should produce an error, or at least a warning, right?
--
Regards,
Adam
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094405#4094405
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094405
18Â years, 9Â months
[EJB/JBoss] - Re: javax.naming.CommunicationException while executing a cl
by mahak
Hi i am also facing same problem
/*
* CartClient.java
*
* Created on October 11, 2007, 10:31 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package ejb_stateful;
import java.util.Collection;
import java.util.Hashtable;
import java.util.Iterator;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class CartClient {
public static void main(String [] args) throws NamingException {
try {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL,"localhost");
env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
Context context = new InitialContext(env);
if(context!=null)
System.out.println("context: success");
ejb_stateful.CartRemote cart=null;
try{
cart = (ejb_stateful.CartRemote)context.lookup("CartBean");
}catch(Exception e){
System.out.println("naming ex here"+e);
}
if(cart==null)
System.out.println("cart is null");
if(cart!=null)
System.out.println("cart: success");
System.out.println("Adding items to cart");
cart.addItem("Pizza");
cart.addItem("Pasta");
cart.addItem("Noodles");
cart.addItem("Bread");
cart.addItem("Butter");
System.out.println("Listing cart contents");
Collection items = cart.getItems();
for (Iterator i = items.iterator(); i.hasNext();) {
String item = (String) i.next();
System.out.println(" " + item);
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094402#4094402
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4094402
18Â years, 9Â months