the exception is::
java.lang.ClassCastException
at Unknown.com_google_gwt_core_client_impl_StackTraceCreator
$Collector_
$fillInStackTrace__Lcom_google_gwt_core_client_impl_StackTraceCreator
$Collector_2Ljava_lang_Throwable_2V(Unknown Source)
at
Unknown.java_lang_ClassCastException_ClassCastException__V(Unknown
Source)
at
Unknown.com_google_gwt_lang_Cast_dynamicCast__Ljava_lang_Object_2ILjava_lang_Object_2(Unknown
Source)
at
Unknown.net_vz_common_widgets_client_listitem_renderer_MinUserRenderer_render__Ljava_lang_Object_2ZLnet_vz_common_widgets_client_listitem_GenericList
$ImageSize_2Lnet_vz_common_widgets_client_bundles_UnifiedResources_2Lcom_google_gwt_user_client_ui_Widget_2(Unknown
Source)
at Unknown.net_vz_common_widgets_client_listitem_GenericList_
$addToList__Lnet_vz_common_widgets_client_listitem_GenericList_2Ljava_util_Collection_2Ljava_util_List_2(Unknown
Source)
at Unknown.anonymous(Unknown Source)
at
Unknown.net_vz_common_widgets_client_profile_lastvisitors_ProfileLastVisitorsActivity
$1_
$onSuccess__Lnet_vz_common_widgets_client_profile_lastvisitors_ProfileLastVisitorsActivity
$1_2Lorg_fusesource_restygwt_client_Method_2Lnet_vz_common_services_client_restdto_GenericListDto_2V(Unknown
Source)
at
Unknown.net_vz_common_widgets_client_profile_lastvisitors_ProfileLastVisitorsActivity
$1_onSuccess__Lorg_fusesource_restygwt_client_Method_2Ljava_lang_Object_2V(Unknown
Source)
at
Unknown.org_fusesource_restygwt_client_AbstractRequestCallback_onResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown
Source)
at
Unknown.org_fusesource_restygwt_client_callback_FilterawareRetryingCallback_onResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown
Source)
at Unknown.com_google_gwt_http_client_Request_
$fireOnResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V(Unknown
Source)
at Unknown.com_google_gwt_http_client_RequestBuilder
$1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(Unknown
Source)
at Unknown.anonymous(Unknown Source)
at
Unknown.com_google_gwt_core_client_impl_Impl_apply__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown
Source)
at
Unknown.com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown
Source)
at Unknown.anonymous(Unknown Source)
at Unknown.anonymous(Unknown Source)
at Unknown.anonymous(Unknown Source)
On 14 Jun., 15:47, pansen <[email protected]> wrote:
> hey guys,
>
> i think we have a massive problem with the generated js sources for
> production. we built a larger app and since now all worked like a
> charm, we had not a single stopper.
>
> at the moment there is a strange issue. when i use the static app it
> seems like there is a confusion about the generic-type or the content
> of it. let me first show you the gwttest i wrote to let you see what
> happens::
>
> package net.vz.common.widgets.client.profile.lastvisitors;
>
> import java.util.List;
> import java.util.logging.Logger;
>
> import net.vz.common.services.client.registry.Registry;
> import net.vz.common.services.client.restdto.GenericListDto;
> import net.vz.common.services.client.restdto.MinUserDto;
> import net.vz.common.services.client.restservice.UserService;
> import
> net.vz.common.services.client.resty.vzcore.SimpleMethodCallback;
> import net.vz.common.widgets.client.bundles.UnifiedResources;
> import net.vz.common.widgets.client.i18n.LocalMessages;
> import net.vz.common.widgets.client.listitem.GenericImageSlider;
> import net.vz.common.widgets.client.listitem.GenericList;
> import net.vz.common.widgets.client.listitem.renderer.MinUserRenderer;
> import
> net.vz.common.widgets.client.simpleItem.inject.SimpleItemModule;
> import net.vz.common.widgets.client.toolbox.custompanels.ListPanel;
> import net.vz.common.widgets.client.toolbox.slideBar.SlideBarActivity;
> import net.vz.common.widgets.client.toolbox.slideBar.SlideBarView;
> import net.vz.common.widgets.client.toolbox.slideBar.SlideBarViewImpl;
>
> import org.fusesource.restygwt.client.Method;
>
> import com.google.gwt.core.client.GWT;
> import com.google.gwt.event.shared.SimpleEventBus;
> import com.google.gwt.junit.client.GWTTestCase;
> import com.google.gwt.user.client.ui.AcceptsOneWidget;
> import com.google.gwt.user.client.ui.SimplePanel;
>
> /**
> * try to reconstruct a production bug which seems to be caused by
> wrong typing
> * from gwt??!
> *
> * @author abalke
> */
> public class ProfileLastVisitorsActivityTestGwt extends GWTTestCase {
>
> private static final String userKey = "U:test_user";
>
> @Override
> public String getModuleName() {
> return SimpleItemModule.MODULE_NAME;
> }
>
> public void testDo() {
> LocalMessages localMessages = GWT.create(LocalMessages.class);
> UnifiedResources unifiedResources = new UnifiedResources();
>
> ListPanel ul = GWT.create(ListPanel.class);
> SlideBarView sidebarView = GWT.create(SlideBarViewImpl.class);
> SlideBarActivity slideBarActivity = new
> SlideBarActivity(sidebarView);
> GenericList<MinUserDto> genericLinkList = new
> GenericList<MinUserDto>(unifiedResources);
> GenericImageSlider<MinUserDto> slider = new
> GenericImageSlider<MinUserDto>(
> ul, slideBarActivity, genericLinkList,
> unifiedResources);
>
> ProfileLastVisitorsViewImpl__ view =
> new ProfileLastVisitorsViewImpl__(localMessages);
> UserService userService = GWT.create(UserService.class);
> MinUserRenderer renderer = new MinUserRenderer();
>
> AcceptsOneWidget panel = new SimplePanel();
> SimpleEventBus eventBus = new SimpleEventBus();
> ProfileLastVisitorsActivity a = new
> ProfileLastVisitorsActivity(
> view, userService, slider, renderer) {
> protected void loadLastVisitors(String userId) {
> userService.getLastVisitors(userId, new
> SimpleMethodCallback<GenericListDto<MinUserDto>>() {
> @Override
> public void onSuccess(Method method,
> GenericListDto<MinUserDto> response) {
> List<MinUserDto> items = response.getItems();
> if (Registry.canLog()) {
>
> Logger.getLogger(ProfileLastVisitorsActivity.class.getName())
> .info("got a list of " +
> MinUserDto.class + ": " );
>
> Logger.getLogger(ProfileLastVisitorsActivity.class.getName())
> .info("... " + items.get(0));
> }
> slider.render(items);
>
> view.setLastVisitorsOverallCount(response.getCount());
> view.show(true);
>
> // in production, here is a wrong type
> assertEquals(MinUserDto.class,
> items.get(0).getClass());
> assertEquals(true,
> ((ProfileLastVisitorsViewImpl__)view).getShowState());
> finishTest();
> }
> });
> }
> };
>
> a.start(panel, eventBus);
>
> // the widget wants only to be loaded when this is my user
> Registry.MY_USER_ID = userKey;
>
> assertEquals(false, view.getShowState());
> a.update(userKey);
>
> delayTestFinish(5 * 1000);
> }
>
> class ProfileLastVisitorsViewImpl__ extends
> ProfileLastVisitorsViewImpl {
>
> private boolean isShown = false;
>
> public ProfileLastVisitorsViewImpl__(LocalMessages
> localMessages) {
> super(localMessages);
> }
>
> @Override
> public void show(boolean b) {
> isShown = b;
> super.show(b);
> }
>
> public boolean getShowState() {
> return isShown;
> }
> }
>
> }
>
> in production mode (static compile) i see in the logs that there is a
> list of type ``A`` containing the first element of type ``B`` on this
> place, which is overridden in the test above::
>
> protected void loadLastVisitors(String userId) {
> userService.getLastVisitors(userId, new
> SimpleMethodCallback<GenericListDto<MinUserDto>>() {
> @Override
> public void onSuccess(Method method,
> GenericListDto<MinUserDto> response) {
> List<MinUserDto> items = response.getItems();
> if (Registry.canLog()) {
>
> Logger.getLogger(ProfileLastVisitorsActivity.class.getName())
> .info("should have a list of " +
> MinUserDto.class + ", first element is a: " +items.get(0));
> }
> slider.render(items);
> view.setLastVisitorsOverallCount(response.getCount());
> view.show(true);
> }
> });
> }
>
> in result of that i get a classcastexception - but only in compiled
> production code. neither the integration-test, nor the hosted mode
> with exactly the same backend-responses fails.
>
> my question is now: have you ever seen an issue with type-confusion in
> a bigger context? what should i do to come to a result with this
> issue. if you tell me where to look in the compiled code i can try to
> reduce the setup.
>
> as a last option i only see to reduce my project to a minimum size
> where the error still occurs to send it to you and file a bug.
>
> any hints are greatly appreciated.
>
> andi
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.