-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Using Entity Beans inside external called classes
PostPosted: Thu Feb 12, 2009 11:50 am 
Newbie

Joined: Thu Feb 12, 2009 10:18 am
Posts: 1
Hibernate version: 3.2

Application server: jboss 4.2.2

hi everyone

my webapp loads external "plugin" classes using a xml conf file. Everything worked fine while the "plugin" classes and the rest of the webapp where on the same ear file, but i need to split them up, so i moved the plugins in a different jar i placed inside the lib directory.

now i get a NoClassDefFoundError Exception, linking to an entity bean i'm sending to the plugin class using an hashtable. Putting a jar with the Entity Beans in the lib directory changes the error to a ClassCastException

Hashtable context -> the one with the Entity Beans
Hashtable params -> info from the xml

String className, methodName -> the class name and method name


try{
Class c = Class.forName(className);
Object o = c.newInstance();

Method m = o.getClass().getMethod(methodName, new Class[]{Hashtable.class, Hashtable.class});
result = (XMLResult) m.invoke(o, new Object[] {context, params});

} catch(Exception e) {
logger.error(e.getMessage());
result = new XMLResult(3, "Errore Bloccante");
}


inside the plugin, i'm just using the entity as normal pojo objects.

how can i resolve this problem?

i hope to have made myself clear enough and i'm sorry for my bad english

Thanks for your time and help

Enrico.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.