aino-komal / mvp4g

Automatically exported from code.google.com/p/mvp4g
0 stars 0 forks source link

GWT exporter cast exception from GWT.create; Tried to use mvp4g with GWT-Exporter but GWT.create didn't work #132

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
public interface RegisterPluginPresenter extends Exportable { ... }
@Export
@Presenter(view = RegisterPluginDisplay.class)
public class RegisterPluginPresenterImpl extends 
BasePresenter<RegisterPluginView, MyBus> implements       
RegisterPluginPresenter {
this gave me this error 
Uncaught 
java.lang.AssertionErrorcom_mvp4g_client_Mvp4gModuleImpl_com_mvp4g_client_Mvp4gM
oduleGinjector_com_mvp4g_client_Mvp4gModule…:62 
get_Key$type$com$joseph$draw4$client$presenter$RegisterPluginPresenterImpl$_anno
tation$$none$$_0_g$com_mvp4g_client_Mvp4gModuleImpl_com_mvp4g_client_Mvp4gModule
GinjectorImpl.java:34 
getcom_joseph_draw4_client_presenter_RegisterPluginPresenterImpl_0_g$Mvp4gModule
Impl.java:101 createAndStartModule_0_g$Mvp4gEntryPoint.java:35 
onModuleLoad_5_g$com_00046joseph_00046draw4_00046Draw4JUnit__EntryMethodHolder.j
ava:3 init_2_g$ModuleUtils.java:44 initializeModules_0_g$Impl.java:247 
apply_0_g$Impl.java:306 entry0_0_g$Impl.java:72 (anonymous 
function)ModuleUtils.java:55 gwtOnLoad_0_g$Map.java:29 (anonymous function)

I also created a simpler case that has the same issue and makes the problem 
clearer:
public class Person implements Exportable { .. }
Person person = GWT.create(Person.class);
I got a class cast exception because GWT.create returns an Exportable whenever 
the class implements Exportable.

The problem is that mvp4g uses GWT.create(MyPresenter.class) in order to make 
my Presenter but GWT.create(MyPresenter.class) is returning a Exporter instead 
of the Presenter it wants. 
What is the expected output? What do you see instead?

My project just started so everything is completely up to date.

Original issue reported on code.google.com by JGleo...@gmail.com on 25 Jan 2015 at 4:26

GoogleCodeExporter commented 9 years ago
Your issue is not an issue.

Regarding mvp4g the created class is not usable. The get-exporter generator 
returns something, that can not be used by mvp4g. Even, if we change it, change 
the way how classes are created in mvp4g, it won't work.

The question is, what do you want to do? Why do you need to call the presenter 
from JavaScript? Maybe there is another way that will work.

Please open a new thread in the mvp4g user group. We will discuss this in the 
group. I will close the issue, because it is one. 

Original comment by frank.hossfeld on 25 Jan 2015 at 6:00

GoogleCodeExporter commented 9 years ago
Please report this in a more appropriate place.

Original comment by frank.hossfeld on 25 Jan 2015 at 6:01

GoogleCodeExporter commented 9 years ago
I opened a new thread in the mvp4g user group like you said.

Original comment by JGleo...@gmail.com on 25 Jan 2015 at 6:21

GoogleCodeExporter commented 9 years ago
Here's the thread at the mvp4g user group: 
https://groups.google.com/forum/#!topic/mvp4g/munMlRyFtZM

Original comment by JGleo...@gmail.com on 25 Jan 2015 at 6:21