Bug 779105 (SOA-1504) - CCE when casting to a SLSB's remote interface
Summary: CCE when casting to a SLSB's remote interface
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-1504
Product: JBoss Enterprise SOA Platform 4
Classification: JBoss
Component: JBossESB, JBoss Rules, Seam
Version: 4.3 CP02
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: ---
Assignee: Jaroslaw Kijanowski
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-17 19:26 UTC by Jaroslaw Kijanowski
Modified: 2009-12-01 16:12 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
4.3 CP02 CR4
Last Closed: 2009-12-01 16:12:47 UTC
Type: Bug


Attachments (Terms of Use)
drools_intg_jbqa1185.zip (7.04 MB, application/zip)
2009-09-17 19:29 UTC, Jaroslaw Kijanowski
no flags Details
CR3 (13.72 KB, application/octet-stream)
2009-09-18 02:06 UTC, Len DiMaggio
no flags Details
CR4 (13.66 KB, application/octet-stream)
2009-09-18 02:06 UTC, Len DiMaggio
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-1504 0 Blocker Closed CCE when casting to a SLSB's remote interface 2015-06-15 15:20:21 UTC

Description Jaroslaw Kijanowski 2009-09-17 19:26:14 UTC
Date of First Response: 2009-09-17 22:06:25
project_key: SOA

Attaching a QS that works fine with CR3 and fails with CR4.

There's a Seam app (packaged as an ear) with drools libs (Drools 3). First deploy it, then deploy the QS (which invokes a method on a session bean in the ear) and send a message (ant runtest):

15:02:49,682 INFO  [STDOUT] jboss.j2ee:ear=DroolsIntCL_JBQA1185.ear,jar=DroolsIntCL_JBQA1185.jar,name=Authenticator,service=EJB3
15:02:49,682 INFO  [STDOUT] class $Proxy131
15:02:49,685 ERROR [STDERR] java.lang.ClassCastException: $Proxy131
15:02:49,685 ERROR [STDERR] 	at org.jboss.soa.esb.samples.quickstart.droolsintgjbqa1185.MyAction.playWithMessage(MyAction.java:56)
15:02:49,685 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
15:02:49,685 ERROR [STDERR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
15:02:49,686 ERROR [STDERR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
15:02:49,686 ERROR [STDERR] 	at java.lang.reflect.Method.invoke(Method.java:585)
15:02:49,686 ERROR [STDERR] 	at org.jboss.soa.esb.listeners.message.ActionProcessorMethodInfo.processMethods(ActionProcessorMethodInfo.java:102)
15:02:49,686 ERROR [STDERR] 	at org.jboss.soa.esb.listeners.message.OverriddenActionLifecycleProcessor.process(OverriddenActionLifecycleProcessor.java:74)
15:02:49,686 ERROR [STDERR] 	at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:615)
15:02:49,686 ERROR [STDERR] 	at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:574)
15:02:49,686 ERROR [STDERR] 	at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:408)
15:02:49,686 ERROR [STDERR] 	at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:540)
15:02:49,686 ERROR [STDERR] 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
15:02:49,686 ERROR [STDERR] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
15:02:49,686 ERROR [STDERR] 	at java.lang.Thread.run(Thread.java:595)
15:02:49,687 INFO  [STDOUT] java.lang.ClassCastException: $Proxy131
15:02:49,687 INFO  [STDOUT] 


Here's the action class code:

InitialContext ctx = new InitialContext();
Object o = ctx.lookup("DroolsIntCL_JBQA1185/Authenticator/remote");
System.out.println(o);
System.out.println(o.getClass());
AuthenticatorRemote client = (AuthenticatorRemote) o; <- this throws the CCE


When I have a simple ear (one SLSB) I can successfully cast to the remote interface.

Comment 1 Jaroslaw Kijanowski 2009-09-17 19:26:31 UTC
Affects Testing: Added: [Regression]


Comment 2 Jaroslaw Kijanowski 2009-09-17 19:29:09 UTC
Attachment: Added: drools_intg_jbqa1185.zip


Comment 3 Len DiMaggio 2009-09-18 02:06:25 UTC
Tom Cunningham suggest looking in JNDIView to as the QS is doing a JNDI lookup and then casting the result to AuthenticatorRemote - figuring out what is actually at that JNDI address would be helpful

See attached - it looks like the same class

 [ldimaggi@ldimaggi Desktop]$ cat  CR3 CR4 | grep AuthenticatorRemote
  |   |   +- remote (proxy: $Proxy91 implements interface org.domain.DroolsIntCL_JBQA1185.session.AuthenticatorRemote,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
  |   |   +- remote (proxy: $Proxy91 implements interface org.domain.DroolsIntCL_JBQA1185.session.AuthenticatorRemote,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)

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

Also seeing this (in output from JNDIView)

[ldimaggi@ldimaggi Desktop]$ cat  CR3 CR4 | grep 101
  |   |   +- local (proxy: $Proxy101 implements No ClassLoaders found for: org.jboss.seam.core.LocalDispatcher (no security manager: RMI class loader disabled))
  |   |   +- local (proxy: $Proxy101 implements interface org.jboss.seam.core.LocalDispatcher,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)


Comment 4 Len DiMaggio 2009-09-18 02:06:25 UTC
Attachment: Added: CR3
Attachment: Added: CR4


Comment 5 Kevin Conner 2009-09-23 14:13:53 UTC
There is definitely a difference between the two deployments as it is picking up different versions of the classes in each.

CR4 is loading the JNDI class from the EAR whereas CR3 is loading it from the ESB.

From CR4

2009-09-23 14:52:47,778 INFO  [STDOUT] jboss.j2ee:ear=DroolsIntCL_JBQA1185.ear,jar=DroolsIntCL_JBQA1185.jar,name=Authenticator,service=EJB3
2009-09-23 14:52:47,778 INFO  [STDOUT] $Proxy100
2009-09-23 14:52:47,778 INFO  [STDOUT] org.jboss.mx.loading.UnifiedClassLoader3@f25b18{ url=file:/home/kevin/soa/CR4/jboss-soa-p.4.3.0/jboss-as/server/production/tmp/deploy/tmp691630604110794368DroolsIntCL_JBQA1185.ear ,addedOrder=59}
2009-09-23 14:52:47,778 INFO  [STDOUT]   org.domain.DroolsIntCL_JBQA1185.session.AuthenticatorRemote
2009-09-23 14:52:47,778 INFO  [STDOUT]   org.jboss.mx.loading.UnifiedClassLoader3@f25b18{ url=file:/home/kevin/soa/CR4/jboss-soa-p.4.3.0/jboss-as/server/production/tmp/deploy/tmp691630604110794368DroolsIntCL_JBQA1185.ear ,addedOrder=59}
2009-09-23 14:52:47,778 INFO  [STDOUT]   org.jboss.ejb3.JBossProxy
2009-09-23 14:52:47,778 INFO  [STDOUT]   org.jboss.mx.loading.UnifiedClassLoader3@19518cc{ url=file:/home/kevin/soa/CR4/jboss-soa-p.4.3.0/jboss-as/server/production/deploy/ejb3.deployer/ ,addedOrder=3}
2009-09-23 14:52:47,778 INFO  [STDOUT]   javax.ejb.EJBObject
2009-09-23 14:52:47,778 INFO  [STDOUT]   org.jboss.mx.loading.UnifiedClassLoader3@c79809{ url=null ,addedOrder=2}
2009-09-23 14:52:47,778 INFO  [STDOUT]     java.rmi.Remote
2009-09-23 14:52:47,778 INFO  [STDOUT]     null
2009-09-23 14:52:47,778 INFO  [STDOUT]   java.lang.reflect.Proxy
2009-09-23 14:52:47,779 INFO  [STDOUT]   null
2009-09-23 14:52:47,779 INFO  [STDOUT]     java.io.Serializable
2009-09-23 14:52:47,779 INFO  [STDOUT]     null
2009-09-23 14:52:47,779 INFO  [STDOUT]     java.lang.Object
2009-09-23 14:52:47,779 INFO  [STDOUT]     null
2009-09-23 14:52:47,780 INFO  [STDOUT] org.domain.DroolsIntCL_JBQA1185.session.AuthenticatorRemote
2009-09-23 14:52:47,780 INFO  [STDOUT] org.jboss.mx.loading.UnifiedClassLoader3@f61d6a{ url=file:/home/kevin/soa/CR4/jboss-soa-p.4.3.0/jboss-as/server/production/tmp/deploy/tmp6167251334500562016Quickstart_drools_intg_JBQA1185.esb ,addedOrder=62}

From CR3

2009-09-23 14:59:57,068 INFO  [STDOUT] jboss.j2ee:ear=DroolsIntCL_JBQA1185.ear,jar=DroolsIntCL_JBQA1185.jar,name=Authenticator,service=EJB3
2009-09-23 14:59:57,068 INFO  [STDOUT] $Proxy128
2009-09-23 14:59:57,068 INFO  [STDOUT] org.jboss.mx.loading.UnifiedClassLoader3@11bbdbb{ url=file:/home/kevin/soa/CR3/jboss-soa-p.4.3.0/jboss-as/server/production/tmp/deploy/tmp4672826796657720810Quickstart_drools_intg_JBQA1185.esb ,addedOrder=60}
2009-09-23 14:59:57,068 INFO  [STDOUT]   org.domain.DroolsIntCL_JBQA1185.session.AuthenticatorRemote
2009-09-23 14:59:57,068 INFO  [STDOUT]   org.jboss.mx.loading.UnifiedClassLoader3@11bbdbb{ url=file:/home/kevin/soa/CR3/jboss-soa-p.4.3.0/jboss-as/server/production/tmp/deploy/tmp4672826796657720810Quickstart_drools_intg_JBQA1185.esb ,addedOrder=60}
2009-09-23 14:59:57,068 INFO  [STDOUT]   org.jboss.ejb3.JBossProxy
2009-09-23 14:59:57,068 INFO  [STDOUT]   org.jboss.mx.loading.UnifiedClassLoader3@278e83{ url=file:/home/kevin/soa/CR3/jboss-soa-p.4.3.0/jboss-as/server/production/deploy/ejb3.deployer/ ,addedOrder=3}
2009-09-23 14:59:57,068 INFO  [STDOUT]   javax.ejb.EJBObject
2009-09-23 14:59:57,068 INFO  [STDOUT]   org.jboss.mx.loading.UnifiedClassLoader3@c837cd{ url=null ,addedOrder=2}
2009-09-23 14:59:57,068 INFO  [STDOUT]     java.rmi.Remote
2009-09-23 14:59:57,068 INFO  [STDOUT]     null
2009-09-23 14:59:57,068 INFO  [STDOUT]   java.lang.reflect.Proxy
2009-09-23 14:59:57,068 INFO  [STDOUT]   null
2009-09-23 14:59:57,068 INFO  [STDOUT]     java.io.Serializable
2009-09-23 14:59:57,068 INFO  [STDOUT]     null
2009-09-23 14:59:57,068 INFO  [STDOUT]     java.lang.Object
2009-09-23 14:59:57,068 INFO  [STDOUT]     null
2009-09-23 14:59:57,068 INFO  [STDOUT] org.domain.DroolsIntCL_JBQA1185.session.AuthenticatorRemote
2009-09-23 14:59:57,068 INFO  [STDOUT] org.jboss.mx.loading.UnifiedClassLoader3@11bbdbb{ url=file:/home/kevin/soa/CR3/jboss-soa-p.4.3.0/jboss-as/server/production/tmp/deploy/tmp4672826796657720810Quickstart_drools_intg_JBQA1185.esb ,addedOrder=60}


Comment 6 Kevin Conner 2009-09-23 15:02:32 UTC
From CR3

2009-09-23 15:53:54,141 INFO  [STDOUT] INITIAL_CONTEXT_FACTORY org.jnp.interfaces.NamingContextFactory
2009-09-23 15:53:54,141 INFO  [STDOUT] URL_PKG_PREFIXES org.jboss.naming
2009-09-23 15:53:54,141 INFO  [STDOUT] PROVIDER_URL jnp://127.0.0.1:1099

from CR4

2009-09-23 15:57:49,955 INFO  [STDOUT] INITIAL_CONTEXT_FACTORY org.jnp.interfaces.NamingContextFactory
2009-09-23 15:57:49,956 INFO  [STDOUT] URL_PKG_PREFIXES org.jboss.naming:org.jnp.interfaces
2009-09-23 15:57:49,956 INFO  [STDOUT] PROVIDER_URL null


Comment 7 Kevin Conner 2009-09-23 15:06:52 UTC
This behaviour is as a consequence of JBESB-2819.

Prior to this change all JNDI accesses were forced over the network, as a remote client.  After this change they would refer to classes within the local JVM.

The error is really in the test in that it has two different instances of the remote interface, rather than sharing the same interface.  It is for this reason that there are two classloaders being used.

The test should be rewritten to refer to the same interface, a workaround in the meantime would be to force the PROVIDER_URL to jnp://127.0.0.1:1099.


Comment 8 Jaroslaw Kijanowski 2009-09-29 08:20:23 UTC
Testcase fixed (set provider url).


Note You need to log in before you can comment on or make changes to this bug.