You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by skay <it...@skay.ch> on 2013/04/07 17:14:44 UTC

Classcast execption on proxy when looking up remote interface

Hi,

I'm just trying to call a remote interface with sample code provided.


InitialContext ctx = new InitialContext(p);		
Object
ref=ctx.lookup("java:global/securitypoc-engine/HelloWorldSessionBean");
		
HelloWorldSessionBeanRemote bean=(HelloWorldSessionBeanRemote)ref;

Error caught :

GRAVE: Servlet.service() for servlet [jsp] in context with path
[/securitypoc-ui] threw exception [java.lang.ClassCastException: $Proxy59
cannot be cast to ch.skay.poc.ejb.HelloWorldSessionBeanRemote] with root
cause
java.lang.ClassCastException: $Proxy59 cannot be cast to
ch.skay.poc.ejb.HelloWorldSessionBeanRemote

If I look inside debugger, I can notice that the reference is OK with a
StatelessEjbObjectHandler

proxy=ch.skay.poc.ejb.HelloWorldSessionBeanRemote;deployment=HelloWorldSessionBean;pk=null

So everything seems Ok, except from the casting.

Any idea ???

Please note that the sample code is running on Glassfish, JBoss AS7 and
Weblogic 12c.
Only TomEE is crashing with that error.





--
View this message in context: http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Classcast execption on proxy when looking up remote interface

Posted by skay <it...@skay.ch>.
Hi Romain,

I didn't get the latest snapshot / not released yet.
But I tried your underlying idea,

I added same JSP on -engine, and the ejb call is OK
(I would surprised that it doesn't work :)

But then after this call, if I try to call from -ui, I get still the same
error.

Anyway, I'll tell you as soon as I get the latest release.

BR



--
View this message in context: http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662142.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Classcast execption on proxy when looking up remote interface

Posted by Jean-Louis MONTEIRO <je...@gmail.com>.
No worries!

Yes I know how hard it is to use WAS.
Anyway, thanks for providing us with a sample to reproduce.

It was not that hard to fix or to allow such a use case.
We are always happy to fix or to help in portability issues. Sometimes it's
harder or it has huge impacts even on performance that's why we think twice
before patching.

Long story short, I'm glad you enjoy using TomEE.
Feel free to shoot again if you have other issue or any suggestion to make
TomEE even better.

You guys are helping TomEE!
So thanks again.

JLouis




2013/4/25 skay <it...@skay.ch>

> Hi,
>
> I just tried my 'ejblookup' test on Webshere 8.5 : it works perfectly also
> on this AS. No surprise.
> Even if I took half a day in order to download (!) and take hand on this
> f**
> AS(s) :)
>
> I would like to tell you that you should get inspired on other Application
> Severs implementation.
> For example, JBoss even if they try to do always specific (e.g. JNDI
> names),
> have good ideas, that sometimes comes to standards. In JBoss 7.1, they have
> an interesting idea to force classloading policy within the MANIFEST file.
> Websphere is too compicated; but if you take a little time to go inside
> that
> machine, you'll find very intersting ideas you should consider. Example :
> admin wizards / configuration to control each module class loading policy.
>
> Now I'm sorry having been insistant about my issue, but I think that even
> if
> you consider it as 'portability' issue, you'll got it back sooner or later
> as a scalability issue on TomEE.
>
> I think that TomEE should / and anyways will/ be *the* solution for
> developping on the JEE Platform. I took less than 10 mins to separate what
> should be a bug instead of a lack of knowledge on my side.
> This is very important, and I think that I'll never have this sensitivness
> with no other AS, even with 10 days instead of 10 mins, because TomEE is so
> simple and transparent.
>
> Now, I'm looking forward installing next snapshot of TomEE in order to
> validate that I can start my development on it instead of Jboss or
> Glassfish.
>
> BR.
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662462.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>



-- 
Jean-Louis

Re: Classcast execption on proxy when looking up remote interface

Posted by Romain Manni-Bucau <rm...@gmail.com>.
well this feature has performances impact that's why i didnt want to work
on it first

that said for remote service it is acceptable (in particular for real
services where overhead is negligeable)

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/4/25 skay <it...@skay.ch>

> Hi,
>
> I just tried my 'ejblookup' test on Webshere 8.5 : it works perfectly also
> on this AS. No surprise.
> Even if I took half a day in order to download (!) and take hand on this
> f**
> AS(s) :)
>
> I would like to tell you that you should get inspired on other Application
> Severs implementation.
> For example, JBoss even if they try to do always specific (e.g. JNDI
> names),
> have good ideas, that sometimes comes to standards. In JBoss 7.1, they have
> an interesting idea to force classloading policy within the MANIFEST file.
> Websphere is too compicated; but if you take a little time to go inside
> that
> machine, you'll find very intersting ideas you should consider. Example :
> admin wizards / configuration to control each module class loading policy.
>
> Now I'm sorry having been insistant about my issue, but I think that even
> if
> you consider it as 'portability' issue, you'll got it back sooner or later
> as a scalability issue on TomEE.
>
> I think that TomEE should / and anyways will/ be *the* solution for
> developping on the JEE Platform. I took less than 10 mins to separate what
> should be a bug instead of a lack of knowledge on my side.
> This is very important, and I think that I'll never have this sensitivness
> with no other AS, even with 10 days instead of 10 mins, because TomEE is so
> simple and transparent.
>
> Now, I'm looking forward installing next snapshot of TomEE in order to
> validate that I can start my development on it instead of Jboss or
> Glassfish.
>
> BR.
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662462.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Classcast execption on proxy when looking up remote interface

Posted by skay <it...@skay.ch>.
Hi,

I just tried my 'ejblookup' test on Webshere 8.5 : it works perfectly also
on this AS. No surprise.
Even if I took half a day in order to download (!) and take hand on this f**
AS(s) :)

I would like to tell you that you should get inspired on other Application
Severs implementation.
For example, JBoss even if they try to do always specific (e.g. JNDI names),
have good ideas, that sometimes comes to standards. In JBoss 7.1, they have
an interesting idea to force classloading policy within the MANIFEST file.
Websphere is too compicated; but if you take a little time to go inside that
machine, you'll find very intersting ideas you should consider. Example :
admin wizards / configuration to control each module class loading policy.

Now I'm sorry having been insistant about my issue, but I think that even if
you consider it as 'portability' issue, you'll got it back sooner or later
as a scalability issue on TomEE.

I think that TomEE should / and anyways will/ be *the* solution for
developping on the JEE Platform. I took less than 10 mins to separate what
should be a bug instead of a lack of knowledge on my side.
This is very important, and I think that I'll never have this sensitivness
with no other AS, even with 10 days instead of 10 mins, because TomEE is so
simple and transparent.

Now, I'm looking forward installing next snapshot of TomEE in order to
validate that I can start my development on it instead of Jboss or
Glassfish.

BR.




--
View this message in context: http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662462.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Classcast execption on proxy when looking up remote interface

Posted by Romain Manni-Bucau <rm...@gmail.com>.
fixed on trunk https://issues.apache.org/jira/browse/TOMEE-910

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/4/25 skay <it...@skay.ch>

> Hi,
> The build from https://github.com/skay2k/ejblookup
>
> may be downloaded from
> http://ge.tt/5KGXOye?c
>
> ejblookup-engine.war
> ejblookup-ui.war
>
> hit
> http://localhost:8080/ejblookup-ui/
>
> and check out with different JEE6 AS.
>
> BR
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662443.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Classcast execption on proxy when looking up remote interface

Posted by skay <it...@skay.ch>.
Hi,
The build from https://github.com/skay2k/ejblookup

may be downloaded from
http://ge.tt/5KGXOye?c

ejblookup-engine.war
ejblookup-ui.war

hit
http://localhost:8080/ejblookup-ui/

and check out with different JEE6 AS.

BR




--
View this message in context: http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662443.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Classcast execption on proxy when looking up remote interface

Posted by Jean-Louis MONTEIRO <je...@gmail.com>.
Hi,

Thanks for pointing the portability issue.
Even if Java EE tends to be more and more portable there are still lots of
areas where there is misunderstanding in regards to the spec meaning.
And sometime there is also no enough information to get a feature
implemented the same way anywhere.

Long story short, do you have a war file we could use to reproduce the
issue?
We would be more than happy to fix it if possible and if it does not break
the web profile certification.

Jean-Louis



2013/4/23 skay <it...@skay.ch>

> I'm afraid this is not a 'claning-up' issue because I'm talking about
> portability on PHYSICAL artefacts.
> You should consider I'm just describing evidence-based facts.
> Lets go for some scientific experience :
>
> 1) Build the wars with Maven from the git ub repository.
>
> 2) Put them in JBoss 7.1 => OK
> 3) Put them in Glassfish 3.1 => OK
> 4) Put them in Weblogic 12c => OK
>
> OK means that Remote Interface is casted into the regular interface and
> ui.war is able to communicate with engine.war. UI is printing a regular
> message coming from the engine in any of those JEE6 AS.
> I think there would be no problem on Websphere 8.5, not tested yet.
>
> 5) NOW put them (same PHYSICAL aretefacts as 1-2-3-4)  in TomEE -> *KO*
>
> *KO* means that there is a ClassCast Exception, because OpenEJB is not able
> to rekognise the remote interface that the proxy must cast. UI is
> displaying
> the exception on TomEE.
>
> This is only science / evidence-based experimentation. Please, just
> reconsider you last post.
>
> Now my question is the following : if it is 'already working' how would you
> explain these facts ?
>
> Actually, my conclusion is that remote interfaces on OpenEJB are not
> working
> like a JEE6 'standard' AS.
> Neither on TomEE 15.2 OR 16.0
>
> My code is minimalistic. So, maybe there is something I should add in the
> code that is more specific on TomEE ? Like some stuff within ejb-jar.xml or
> web.xml // <ejb-ref> ? But I would tell you that I saw nothing in TomEE
> documentation in that sense.
>
> Kind Regards.
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662409.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>



-- 
Jean-Louis

Re: Classcast execption on proxy when looking up remote interface

Posted by Romain Manni-Bucau <rm...@gmail.com>.
i said you i made it working and i explained you how (that's scientifically
enough since you can reproduce it)

TomEE respects java classloading in this case (not other servers) so you
have to respect it too

if you don't want to respect it go with others, that's not an issue

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/4/23 skay <it...@skay.ch>

> I'm afraid this is not a 'claning-up' issue because I'm talking about
> portability on PHYSICAL artefacts.
> You should consider I'm just describing evidence-based facts.
> Lets go for some scientific experience :
>
> 1) Build the wars with Maven from the git ub repository.
>
> 2) Put them in JBoss 7.1 => OK
> 3) Put them in Glassfish 3.1 => OK
> 4) Put them in Weblogic 12c => OK
>
> OK means that Remote Interface is casted into the regular interface and
> ui.war is able to communicate with engine.war. UI is printing a regular
> message coming from the engine in any of those JEE6 AS.
> I think there would be no problem on Websphere 8.5, not tested yet.
>
> 5) NOW put them (same PHYSICAL aretefacts as 1-2-3-4)  in TomEE -> *KO*
>
> *KO* means that there is a ClassCast Exception, because OpenEJB is not able
> to rekognise the remote interface that the proxy must cast. UI is
> displaying
> the exception on TomEE.
>
> This is only science / evidence-based experimentation. Please, just
> reconsider you last post.
>
> Now my question is the following : if it is 'already working' how would you
> explain these facts ?
>
> Actually, my conclusion is that remote interfaces on OpenEJB are not
> working
> like a JEE6 'standard' AS.
> Neither on TomEE 15.2 OR 16.0
>
> My code is minimalistic. So, maybe there is something I should add in the
> code that is more specific on TomEE ? Like some stuff within ejb-jar.xml or
> web.xml // <ejb-ref> ? But I would tell you that I saw nothing in TomEE
> documentation in that sense.
>
> Kind Regards.
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662409.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Classcast execption on proxy when looking up remote interface

Posted by skay <it...@skay.ch>.
I'm afraid this is not a 'claning-up' issue because I'm talking about
portability on PHYSICAL artefacts.
You should consider I'm just describing evidence-based facts.
Lets go for some scientific experience :

1) Build the wars with Maven from the git ub repository.

2) Put them in JBoss 7.1 => OK
3) Put them in Glassfish 3.1 => OK
4) Put them in Weblogic 12c => OK

OK means that Remote Interface is casted into the regular interface and
ui.war is able to communicate with engine.war. UI is printing a regular
message coming from the engine in any of those JEE6 AS.
I think there would be no problem on Websphere 8.5, not tested yet.

5) NOW put them (same PHYSICAL aretefacts as 1-2-3-4)  in TomEE -> *KO*

*KO* means that there is a ClassCast Exception, because OpenEJB is not able
to rekognise the remote interface that the proxy must cast. UI is displaying
the exception on TomEE.

This is only science / evidence-based experimentation. Please, just
reconsider you last post.

Now my question is the following : if it is 'already working' how would you
explain these facts ?

Actually, my conclusion is that remote interfaces on OpenEJB are not working
like a JEE6 'standard' AS.
Neither on TomEE 15.2 OR 16.0

My code is minimalistic. So, maybe there is something I should add in the
code that is more specific on TomEE ? Like some stuff within ejb-jar.xml or
web.xml // <ejb-ref> ? But I would tell you that I saw nothing in TomEE
documentation in that sense.

Kind Regards.




--
View this message in context: http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662409.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Classcast execption on proxy when looking up remote interface

Posted by Romain Manni-Bucau <rm...@gmail.com>.
didnt go further since it was already working

did you clean up your wars?

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/4/15 skay <it...@skay.ch>

> Hi,
>
> I just downloaded
> apache-tomee-1.6.0-20130413.041024-48-plus.tar.gz
>
> and I'm still stuck same issue :(
>
> Tell me if you investigate further / new JIRA on this.
>
> BR
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662285.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Classcast execption on proxy when looking up remote interface

Posted by skay <it...@skay.ch>.
Hi,

I just downloaded
apache-tomee-1.6.0-20130413.041024-48-plus.tar.gz

and I'm still stuck same issue :(

Tell me if you investigate further / new JIRA on this.

BR




--
View this message in context: http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662285.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Classcast execption on proxy when looking up remote interface

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Ok,

hacked a bit on it (https://issues.apache.org/jira/browse/TOMEE-892) but
with current code it should have worked if you ensure the engine starts
before the ui (not nice but that's just a workaround). It can be achieve
using tomee.xml <Deployments> or server.xml <Context>.

That said that's maybe not really your issue. IMO your issue was you put
the api jar (bind with your vocabulary) in both webapps so each webapp uses
it own copy. Just put your bing jar in tomee/lib AND remove it from webapps
and it works.

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/4/8 skay <it...@skay.ch>

> Hi,
>
> I just pushed on github the minimal code so that you can reproduce /
> investigate further.
>
> https://github.com/skay2k/ejblookup
>
> Maven project with 3 modules / 2 artefacts
>
> ejblookup-engine.war (with stateless)
> ejblookup-ui.war (with interface lookup)
>
> you'll notice that the Remote interface annotation is set only on the
> stateless bean / not on the interface itself. This is OK according the
> specs
> and running on other targeted AS. You may change this / I didn't find any
> solution with TomEE playing with annotations.
>
> On the ui side, I tryed diffrent solution / with / without InitialContext
> properties settings. Just calling new InitialContext() is OK for the other
> target AS / nothing worked for me with TomEE.
>
> Thank you for your time !
>
>
> Thank you very much for your support !
>
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662119.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Classcast execption on proxy when looking up remote interface

Posted by skay <it...@skay.ch>.
Hi,

I just pushed on github the minimal code so that you can reproduce /
investigate further.

https://github.com/skay2k/ejblookup

Maven project with 3 modules / 2 artefacts

ejblookup-engine.war (with stateless)
ejblookup-ui.war (with interface lookup)

you'll notice that the Remote interface annotation is set only on the
stateless bean / not on the interface itself. This is OK according the specs
and running on other targeted AS. You may change this / I didn't find any
solution with TomEE playing with annotations.

On the ui side, I tryed diffrent solution / with / without InitialContext
properties settings. Just calling new InitialContext() is OK for the other
target AS / nothing worked for me with TomEE.

Thank you for your time !


Thank you very much for your support !





--
View this message in context: http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662119.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Classcast execption on proxy when looking up remote interface

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hmm, can you share your sample?
Le 8 avr. 2013 08:16, "skay" <it...@skay.ch> a écrit :

> I just tried with latest snapshot
>
> apache-tomee-1.6.0-20130406.041043-42-plus.zip
>
> I have same issue with this version :(
>
>
>
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662064.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Classcast execption on proxy when looking up remote interface

Posted by skay <it...@skay.ch>.
I just tried with latest snapshot 

apache-tomee-1.6.0-20130406.041043-42-plus.zip

I have same issue with this version :(







--
View this message in context: http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662064.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Classcast execption on proxy when looking up remote interface

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Move the api (bind) in lib folder of tomee and remove it from the wars
Le 7 avr. 2013 22:07, "skay" <it...@skay.ch> a écrit :

> Thanks for the quick (and clever) reply !
>
> It "looks like" what you are describing, but that code is currently running
> well on others JEE6 app servers.
> So I wonder either my code is not absolutely JEE6 compliant or if this is a
> bug of TomEE / OpenEjb.
>
> OK this is more precision about that issue.
>
> I have 2 wars running within the same AS / TomEE 1.5.1 with a common jar :
>
> project-bind.jar
>   -> remote interface
>
> project-core.war => dependancy on project-bind
>   -> Stateless impl
>
> project-ui.war => dependancy on project-bind
>    -> client implementation
>
> project UI is providing a JSP and connects to the project-core.war
>
> My goal is to provide a full portable EJB poc on different AS.
> And I'm really suprised that the more difficult is deploying on TomEE that
> should be a reference implementation ?!
>
> Best Regards.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662063.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Classcast execption on proxy when looking up remote interface

Posted by skay <it...@skay.ch>.
Thanks for the quick (and clever) reply !

It "looks like" what you are describing, but that code is currently running
well on others JEE6 app servers.
So I wonder either my code is not absolutely JEE6 compliant or if this is a
bug of TomEE / OpenEjb.

OK this is more precision about that issue.

I have 2 wars running within the same AS / TomEE 1.5.1 with a common jar :

project-bind.jar
  -> remote interface

project-core.war => dependancy on project-bind
  -> Stateless impl

project-ui.war => dependancy on project-bind
   -> client implementation

project UI is providing a JSP and connects to the project-core.war

My goal is to provide a full portable EJB poc on different AS.
And I'm really suprised that the more difficult is deploying on TomEE that
should be a reference implementation ?!

Best Regards.



--
View this message in context: http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060p4662063.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Classcast execption on proxy when looking up remote interface

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

did you try it with the snapshot? that can be a classloading issue, ie the
interface class shared is not the same (clearer: you lookup it from an app
in the same server the impl is deployed but the interface is not in a
shared loader)

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/4/7 skay <it...@skay.ch>

> Hi,
>
> I'm just trying to call a remote interface with sample code provided.
>
>
> InitialContext ctx = new InitialContext(p);
> Object
> ref=ctx.lookup("java:global/securitypoc-engine/HelloWorldSessionBean");
>
> HelloWorldSessionBeanRemote bean=(HelloWorldSessionBeanRemote)ref;
>
> Error caught :
>
> GRAVE: Servlet.service() for servlet [jsp] in context with path
> [/securitypoc-ui] threw exception [java.lang.ClassCastException: $Proxy59
> cannot be cast to ch.skay.poc.ejb.HelloWorldSessionBeanRemote] with root
> cause
> java.lang.ClassCastException: $Proxy59 cannot be cast to
> ch.skay.poc.ejb.HelloWorldSessionBeanRemote
>
> If I look inside debugger, I can notice that the reference is OK with a
> StatelessEjbObjectHandler
>
>
> proxy=ch.skay.poc.ejb.HelloWorldSessionBeanRemote;deployment=HelloWorldSessionBean;pk=null
>
> So everything seems Ok, except from the casting.
>
> Any idea ???
>
> Please note that the sample code is running on Glassfish, JBoss AS7 and
> Weblogic 12c.
> Only TomEE is crashing with that error.
>
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Classcast-execption-on-proxy-when-looking-up-remote-interface-tp4662060.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>