Bugs item #845157, was opened at 2003-11-19 12:38
Message generated for change (Comment added) made by doliveros
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=845157&group_id=22866

Category: JBossServer
Group: v3.2
Status: Open
Resolution: None
Priority: 7
Submitted By: Kevin Gilpin (kgilpin)
Assigned to: Nobody/Anonymous (nobody)
Summary: ClassCastException with PortableRemoteObject.narrow using jb

Initial Comment:
 I have 2 EJB applications which are each deployed with
a jboss-app.xml file so that they will have separate
classloader hierarchies. The reason for this is that
the two applications share some common JAR files such
as some base utilities, Hibernate beans, and 3rd party
ones such as struts.

Both applications have an EJB session bean which
implements the same home and session interfaces. These
beans register themselves in JNDI, and a common UI
finds them in a generic manner and exposes a UI for
invoking them (the session interface is IScriptRemote).

The problem occurs when the first application looks up
the IScriptRemote from the second application in the
following code. A ClassCastException occurs on the last
line you see here. Before I created the jboss-app.xml
files, no exception occurred (but I had other problems
with LinkerErrors).

InitialContext ic = J2EEUtil.getInitialContext(port,
principal, credentials);
try {
NamingEnumeration e = ic.listBindings(JNDI_SCRIPT_ROOT);
while ( e.hasMoreElements() ) {
Binding binding = (Binding)e.next();
Object obj = binding.getObject();
LOG.debug("Got object ", obj, " from binding ", binding);
try {
if ( obj instanceof EJBHome ) {
IScriptRemoteHome home =
(IScriptRemoteHome)PortableRemoteObject.narrow(obj,
IScriptRemoteHome.class);

The reported exception is:

15:24:30,609 WARN [Repository] Exception processing
binding ReloadMetadataScriptHome:
$Proxy44:ikp/script/ReloadMetadataScriptHomeHome
java.lang.ClassCastException
at
com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
at
javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
at com.ipi.script.Repository.findAll(Repository.java:102)

----------------------------------------------------------------------

Comment By: Dario Oliveros (doliveros)
Date: 2003-12-12 10:38

Message:
Logged In: YES 
user_id=927266

Hi Kevin,

Try to give different JNDI names to the EJB beans that are 
common to both EARs by editing the jboss.xml (use the ant 
task to replace the jndi-name at compile time). In that way, 
you should be able to do a lookup without a problem.
Let me know if it works.

D�rio

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=845157&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to