I'm consuming a Weather.com web service which takes a "latitude,longitude" value (e.g. "40.87601089477539,-87.43512725830078") and using Netty to handle the network communication.
The service responds with an error, which is caused by my parameter value's comma being escaped (i.e. "40.87601089477539%2C-87.43512725830078").
# works (when a confidential API key is added)
http://api.weather.com/v2//location?geocode=40.87601089477539,-87.43512725830078
# doesn't work
http://api.weather.com/v2//location?geocode=40.87601089477539%2C-87.43512725830078
The escaping is done in in com.ning.http.client.RequestBuilderBase.toUrl(boolean encode). If I was able to pass false to it then my problem would be solved but it is the Netty library that makes a callout to this method rather than me, and the option is hard-coded.
1) Is there a workaround for Netty consumers? 2) What's the right way to fix this?
EDIT Additional details
Stack trace:
RequestBuilderBase$RequestImpl.toUrl(boolean) line: 166
RequestBuilderBase$RequestImpl.getUrl() line: 118
RequestBuilderBase$RequestImpl.<init>(Request) line: 78
RequestBuilder(RequestBuilderBase<T>).<init>(Class<T>, Request) line: 323
RequestBuilder.<init>(Request) line: 42
NettyAsyncHttpProvider$HttpProtocol.handle(ChannelHandlerContext, MessageEvent) line: 2115
NettyAsyncHttpProvider.messageReceived(ChannelHandlerContext, MessageEvent) line: 1128
NettyAsyncHttpProvider(SimpleChannelUpstreamHandler).handleUpstream(ChannelHandlerContext, ChannelEvent) line: 75
DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline$DefaultChannelHandlerContext, ChannelEvent) line: 564
DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(ChannelEvent) line: 792
ChunkedWriteHandler.handleUpstream(ChannelHandlerContext, ChannelEvent) line: 141
DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline$DefaultChannelHandlerContext, ChannelEvent) line: 564
DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(ChannelEvent) line: 792
HttpContentDecompressor(HttpContentDecoder).messageReceived(ChannelHandlerContext, MessageEvent) line: 100
HttpContentDecompressor(SimpleChannelUpstreamHandler).handleUpstream(ChannelHandlerContext, ChannelEvent) line: 75
DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline$DefaultChannelHandlerContext, ChannelEvent) line: 564
DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(ChannelEvent) line: 792
Channels.fireMessageReceived(ChannelHandlerContext, Object, SocketAddress) line: 296
HttpClientCodec$Decoder(ReplayingDecoder<T>).unfoldAndFireMessageReceived(ChannelHandlerContext, Object, SocketAddress) line: 600
HttpClientCodec$Decoder(ReplayingDecoder<T>).callDecode(ChannelHandlerContext, Channel, ChannelBuffer, ChannelBuffer, SocketAddress) line: 584
HttpClientCodec$Decoder(ReplayingDecoder<T>).messageReceived(ChannelHandlerContext, MessageEvent) line: 445
HttpClientCodec$Decoder(SimpleChannelUpstreamHandler).handleUpstream(ChannelHandlerContext, ChannelEvent) line: 75
HttpClientCodec.handleUpstream(ChannelHandlerContext, ChannelEvent) line: 92
DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline$DefaultChannelHandlerContext, ChannelEvent) line: 564
DefaultChannelPipeline.sendUpstream(ChannelEvent) line: 559
Channels.fireMessageReceived(Channel, Object, SocketAddress) line: 268
Channels.fireMessageReceived(Channel, Object) line: 255
NioWorker.read(SelectionKey) line: 94
NioWorker(AbstractNioWorker).processSelectedKeys(Set<SelectionKey>) line: 372
NioWorker(AbstractNioWorker).run() line: 246
NioWorker.run() line: 38
ThreadRenamingRunnable.run() line: 102
DeadLockProofWorker$1.run() line: 42
ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1142
ThreadPoolExecutor$Worker.run() line: 617 [local variables unavailable]
Thread.run() line: 745 [local variables unavailable]
To answer my own question, none of the public libraries are to blame here. There is a flag you can set to prevent the encoding (setUseRawUrl(true)):
AsyncHttpClient asyncHttpClient = new AsyncHttpClient(
new AsyncHttpClientConfig.Builder()
.setUseRawUrl(true)
.build());
Future<Response> f = asyncHttpClient.prepareGet(url).execute();
Response r = f.get();
Related
I am attempting to connect to an Amazon EMR cluster using Livy 0.7 and Spark from an Amazon Sagemaker Notebook running Amazon Linux 2. Can anyone help me understand this error and how I might go about fixing it?
When I go to run the following command on a SageMaker Notebook running Amazon Linux 2:
%reload_ext sparkmagic.magics %spark add -s sparksession -l python -u $LIVY_ENDPOINT -t None
This results in the following error message:
AttributeError Traceback (most recent call last)
in
1 get_ipython().run_line_magic('reload_ext', 'sparkmagic.magics')
2 get_ipython().run_line_magic('spark', 'add -s jsmith -l python -u $LIVY_ENDPOINT -t None')
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
2415 kwargs['local_ns'] = self.get_local_scope(stack_depth)
2416 with self.builtin_trap:
2417 result = fn(*args, **kwargs)
2418 return result
2419
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/decorator.py in fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
232 return caller(func, *(extras + args), **kw)
233 fun.name = func.name
234 fun.doc = func.doc
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/IPython/core/magic.py in (f, *a, **k)
185 # but it's overkill for just that one bit of state.
186 def magic_deco(arg):
187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/IPython/core/magics/extension.py in reload_ext(self, module_str)
61 if not module_str:
62 raise UsageError('Missing module name.')
63 self.shell.extension_manager.reload_extension(module_str)
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/IPython/core/extensions.py in reload_extension(self, module_str)
128 self.loaded.add(module_str)
129 else:
130 self.load_extension(module_str)
131
132 def _call_load_ipython_extension(self, mod):
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/IPython/core/extensions.py in load_extension(self, module_str)
85 dir=compress_user(self.ipython_extension_dir)))
86 mod = sys.modules[module_str]
87 if self._call_load_ipython_extension(mod):
88 self.loaded.add(module_str)
89 else:
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/IPython/core/extensions.py in _call_load_ipython_extension(self, mod)
132 def _call_load_ipython_extension(self, mod):
133 if hasattr(mod, 'load_ipython_extension'):
134 mod.load_ipython_extension(self.shell)
135 return True
136
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/sparkmagic/magics/remotesparkmagics.py in load_ipython_extension(ip)
322
323 def load_ipython_extension(ip):
324 ip.register_magics(RemoteSparkMagics)
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/IPython/core/magic.py in register(self, *magic_objects)
449 if isinstance(m, type):
450 # If we're given an uninstantiated class
451 m = m(shell=self.shell)
452
453 # Now that we have an instance, we can register it and update the
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/sparkmagic/magics/remotesparkmagics.py in init(self, shell, data, widget)
40 if widget is None:
41 widget = MagicsControllerWidget(
42 self.spark_controller, IpyWidgetFactory(), self.ipython_display
43 )
44 self.manage_widget = widget
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/sparkmagic/controllerwidget/magicscontrollerwidget.py in init(self, spark_controller, ipywidget_factory, ipython_display, endpoints)
26 self.endpoints = endpoints
27
28 self._refresh()
29
30 def run(self):
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/sparkmagic/controllerwidget/magicscontrollerwidget.py in _refresh(self)
85 self.endpoints,
86 self.endpoints_dropdown_widget,
87 self._refresh,
88 )
89 self.manage_endpoint = ManageEndpointWidget(
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/sparkmagic/controllerwidget/addendpointwidget.py in init(self, spark_controller, ipywidget_factory, ipython_display, endpoints, endpoints_dropdown_widget, refresh_method)
32 events_handler_module = importlib.import_module(module)
33 auth_class = getattr(events_handler_module, class_name)
34 self.auth_instances[auth] = auth_class()
35
36 self.auth_type = self.ipywidget_factory.get_dropdown(
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/sparkmagic/auth/basic.py in init(self, parsed_attributes)
33 self.password = "password"
34 HTTPBasicAuth.init(self, self.username, self.password)
35 Authenticator.init(self, parsed_attributes)
36
37 def get_widgets(self, widget_width):
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/sparkmagic/auth/customauth.py in init(self, parsed_attributes)
22 else:
23 self.url = "http://example.com/livy"
24 self.widgets = self.get_widgets(WIDGET_WIDTH)
25
26 def get_widgets(self, widget_width):
~/anaconda3/envs/JupyterSystemEnv/lib/python3.7/site-packages/sparkmagic/auth/basic.py in get_widgets(self, widget_width)
50 )
51
52 self.password_widget = ipywidget_factory.get_password(
53 description="Password:", value=self.password, width=widget_width
54 )
AttributeError: 'IpyWidgetFactory' object has no attribute 'get_password'
sf['age'].show(view='Numeric')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-19-0d0158b5e1d5> in <module>()
----> 1 sf['age'].show(view='Numeric')
/home/anurag/gl-env/local/lib/python2.7/site-packages/graphlab/data_structures/sarray.pyc in show(self, view)
2853 """
2854 from ..visualization.show import show
-> 2855 show(self, view=view)
2856
2857 def item_length(self):
/home/anurag/gl-env/local/lib/python2.7/site-packages/multipledispatch/dispatcher.pyc in __call__(self, *args, **kwargs)
162 self._cache[types] = func
163 try:
--> 164 return func(*args, **kwargs)
165
166 except MDNotImplementedError:
/home/anurag/gl-env/local/lib/python2.7/site-packages/graphlab/canvas/glc_display_dispatch.pyc in show(obj, **kwargs)
19
20 graphlab.canvas.inspect.find_vars(obj)
---> 21 return graphlab.canvas.show(graphlab.canvas.views.sarray.SArrayView(obj, params=kwargs))
22
23
/home/anurag/gl-env/local/lib/python2.7/site-packages/graphlab/canvas/utils.pyc in show(variable)
129 get_target().state.set_selected_variable(variable)
130 variable.validate_js_component_name(variable.get_js_component())
--> 131 return get_target().show()
132
133 def _get_id(ref):
/home/anurag/gl-env/local/lib/python2.7/site-packages/graphlab/canvas/target.pyc in show(self, variable)
175 IPython.core.display.Javascript(
176 data=self.__makeJS(_to_json(data), view.get_js_file(), view.get_js_component()),
--> 177 css=['//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css', self.get_asset_url() + 'css/canvas.css']
178 )
179 )
/home/anurag/gl-env/local/lib/python2.7/site-packages/IPython/core/display.pyc in display_javascript(*objs, **kwargs)
328 Metadata to be associated with the specific mimetype output.
329 """
--> 330 _display_mimetype('application/javascript', objs, **kwargs)
331
332
/home/anurag/gl-env/local/lib/python2.7/site-packages/IPython/core/display.pyc in _display_mimetype(mimetype, objs, raw, metadata)
74 # turn list of pngdata into list of { 'image/png': pngdata }
75 objs = [ {mimetype: obj} for obj in objs ]
---> 76 display(*objs, raw=raw, metadata=metadata, include=[mimetype])
77
78 #-----------------------------------------------------------------------------
/home/anurag/gl-env/local/lib/python2.7/site-packages/IPython/core/display.pyc in display(*objs, **kwargs)
169 # kwarg-specified metadata gets precedence
170 _merge(md_dict, metadata)
--> 171 publish_display_data(data=format_dict, metadata=md_dict)
172
173
/home/anurag/gl-env/local/lib/python2.7/site-packages/IPython/core/display.pyc in publish_display_data(data, metadata, source)
119 InteractiveShell.instance().display_pub.publish(
120 data=data,
--> 121 metadata=metadata,
122 )
123
/home/anurag/gl-env/local/lib/python2.7/site-packages/ipykernel/zmqshell.pyc in publish(self, data, metadata, source)
109 # message or None. If None is returned,
110 # the message has been 'used' and we return.
--> 111 for hook in self.thread_local.hooks:
112 msg = hook(msg)
113 if msg is None:
AttributeError: 'thread._local' object has no attribute 'hooks'
Why I am facing this?
Just make sure to upgrade ipykernel to the latest version (you need at least 4.5.0, which was released on September 2, 2016). This pull request fixed that issue:
pip install --upgrade ipykernel
There was an issue as well in GitHub reporting the problem, which was closed after the pull request was merged and 4.5.0 was released.
I was having the same issue -- if you're still having this problem, downgrading the ipykernel to version 4.3.0 seemed to work for me as a temporary workaround:
pip uninstall ipykernel
pip install ipykernel=4.3.0
I have imported facebooksdk.jar in "Referenced libraries" section of Eclipse project. When an instance of Facebook is created, am running into the below exception. Facebook SDK is 3.15.0.
Any pointers to resolve the below is appreciated.
Thread [<1> main] (Suspended (exception NoClassDefFoundError))
<VM does not provide monitor information>
WebDialog.onCreate(Bundle) line: 208
WebDialog(Dialog).dispatchOnCreate(Bundle) line: 361
WebDialog(Dialog).show() line: 262
AuthorizationClient$WebViewAuthHandler.tryAuthorize(AuthorizationClient$AuthorizationRequest) line: 628
AuthorizationClient.tryCurrentHandler() line: 264
AuthorizationClient.tryNextHandler() line: 230
AuthorizationClient.authorize(AuthorizationClient$AuthorizationRequest) line: 154
AuthorizationClient.startOrContinueAuth(AuthorizationClient$AuthorizationRequest) line: 135
Session.tryLegacyAuth(Session$AuthorizationRequest) line: 1450
Session.authorize(Session$AuthorizationRequest) line: 1165
Session.open(Session$OpenRequest, SessionAuthorizationType) line: 1234
Session.openForPublish(Session$OpenRequest) line: 503
Facebook.openSession(Session, Session$OpenRequest, boolean) line: 319
Facebook.authorize(Activity, String[], int, SessionLoginBehavior, Facebook$DialogListener) line: 313
Facebook.authorize(Activity, String[], Facebook$DialogListener) line: 149
FacebookConnector.login() line: 49
AndroidFacebook.postMessage() line: 116
AndroidFacebook.onCreate(Bundle) line: 57
AndroidFacebook(Activity).performCreate(Bundle) line: 5231
Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1087
ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2159
ActivityThread.handleLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2245
ActivityThread.access$800(ActivityThread, ActivityThread$ActivityClientRecord, Intent) line: 135
ActivityThread$H.handleMessage(Message) line: 1196
ActivityThread$H(Handler).dispatchMessage(Message) line: 102
Looper.loop() line: 136
ActivityThread.main(String[]) line: 5017
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 515
ZygoteInit$MethodAndArgsCaller.run() line: 779
ZygoteInit.main(String[]) line: 595
NativeStart.main(String[]) line: not available [native method]
After proceeding to run with the above breakpoint, another exception "InvocationTargetException" is observed with cause being "NoClassDefFoundError".
cause/target in Eclipse Variables window is as below
java.lang.NoClassDefFoundError: com.facebook.android.R$string
The entry in R.txt when facebook SDK jar was generated is not being found.
android.content.res.Resources$NotFoundException: String resource ID #0x7f070011, where the ID resolves to the below
int string com_facebook_loading 0x7f070011
Also have the below jar files included - android-support-v4, bolts.jar, android-support-v7-appcompat,appcompat_v7
How to have an Eclipse RCP application always have a clean workbench at startup?
I just want the ViewParts to be hidden, not unrestored, so the switch to clear workbench data is not what I need.
I try to hide all views on postWindowCreate in the WorkbenchWindowsAdvisor and it works good for all views but one, it is as if I can't hide them all at this stage of the workbench creation.
Code for hiding views (latest attempt):
IWorkbenchWindow[] windows = PlatformUI.getWorkbench()
.getWorkbenchWindows();
for (IWorkbenchWindow workbenchWindow : windows) {
IWorkbenchPage[] pages = workbenchWindow.getPages();
for (IWorkbenchPage iWorkbenchPage : pages) {
IViewReference[] viewReferences = iWorkbenchPage
.getViewReferences();
for (IViewReference iViewReference : viewReferences) {
IWorkbenchPart part = iViewReference.getPart(true);
if (part instanceof ISaveablePart2) {
iWorkbenchPage.hideView((IViewPart) part);
}
}
}
}
Update:
The view in question gets its createPartControl called even though no other of my views have their createPartControl called. It is called after postWindowCreate and postWindowOpen, stack trace:
CreativeAssistantView.createPartControl(Composite) line: 106
CompatibilityView(CompatibilityPart).createPartControl(IWorkbenchPart, Composite) line: 142
CompatibilityView.createPartControl(IWorkbenchPart, Composite) line: 174
CompatibilityView(CompatibilityPart).create() line: 323
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 606
MethodRequestor.execute() line: 56
InjectorImpl.processAnnotated(Class<Annotation>, Object, Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier, ArrayList<Class<?>>) line: 877
InjectorImpl.processAnnotated(Class<Annotation>, Object, Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier, ArrayList<Class<?>>) line: 857
InjectorImpl.inject(Object, PrimaryObjectSupplier, PrimaryObjectSupplier) line: 119
InjectorImpl.internalMake(Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier) line: 333
InjectorImpl.make(Class<T>, PrimaryObjectSupplier) line: 254
ContextInjectionFactory.make(Class<T>, IEclipseContext) line: 162
ReflectionContributionFactory.createFromBundle(Bundle, IEclipseContext, IEclipseContext, URI) line: 102
ReflectionContributionFactory.doCreate(String, IEclipseContext, IEclipseContext) line: 71
ReflectionContributionFactory.create(String, IEclipseContext) line: 53
ContributedPartRenderer.createWidget(MUIElement, Object) line: 129
PartRenderingEngine.createWidget(MUIElement, Object) line: 949
PartRenderingEngine.safeCreateGui(MUIElement, Object, IEclipseContext) line: 633
PartRenderingEngine$6.run() line: 526
SafeRunner.run(ISafeRunnable) line: 42
PartRenderingEngine.createGui(MUIElement, Object, IEclipseContext) line: 511
ElementReferenceRenderer.createWidget(MUIElement, Object) line: 61
PartRenderingEngine.createWidget(MUIElement, Object) line: 949
PartRenderingEngine.safeCreateGui(MUIElement, Object, IEclipseContext) line: 633
PartRenderingEngine.safeCreateGui(MUIElement) line: 735
PartRenderingEngine.access$2(PartRenderingEngine, MUIElement) line: 706
PartRenderingEngine$7.run() line: 700
SafeRunner.run(ISafeRunnable) line: 42
PartRenderingEngine.createGui(MUIElement) line: 685
PartRenderingEngine$1.handleEvent(Event) line: 134
UIEventHandler$1.run() line: 41
UISynchronizer(Synchronizer).syncExec(Runnable) line: 180
UISynchronizer.syncExec(Runnable) line: 150
Display.syncExec(Runnable) line: 4688
E4Application$1.syncExec(Runnable) line: 205
UIEventHandler.handleEvent(Event) line: 38
EventHandlerWrapper.handleEvent(Event, Permission) line: 197
EventHandlerTracker.dispatchEvent(EventHandlerWrapper, Permission, int, Event) line: 197
EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 1
EventManager.dispatchEvent(Set<Entry<K,V>>, EventDispatcher<K,V,E>, int, E) line: 230
ListenerQueue<K,V,E>.dispatchEventSynchronous(int, E) line: 148
EventAdminImpl.dispatchEvent(Event, boolean) line: 135
EventAdminImpl.sendEvent(Event) line: 78
EventComponent.sendEvent(Event) line: 39
EventBroker.send(String, Object) line: 80
UIEventPublisher.notifyChanged(Notification) line: 58
PlaceholderImpl(BasicNotifierImpl).eNotify(Notification) line: 374
PlaceholderImpl(UIElementImpl).setToBeRendered(boolean) line: 290
ModelServiceImpl.showElementInWindow(MWindow, MUIElement) line: 574
ModelServiceImpl.bringToTop(MUIElement) line: 543
PartServiceImpl.switchPerspective(MPerspective) line: 504
PerspectiveStackRenderer.showTab(MUIElement) line: 124
PerspectiveStackRenderer(LazyStackRenderer).postProcess(MUIElement) line: 97
PerspectiveStackRenderer.postProcess(MUIElement) line: 77
PartRenderingEngine.safeCreateGui(MUIElement, Object, IEclipseContext) line: 649
PartRenderingEngine.safeCreateGui(MUIElement) line: 735
PartRenderingEngine.access$2(PartRenderingEngine, MUIElement) line: 706
PartRenderingEngine$7.run() line: 700
SafeRunner.run(ISafeRunnable) line: 42
PartRenderingEngine.createGui(MUIElement) line: 685
SashRenderer(SWTPartRenderer).processContents(MElementContainer<MUIElement>) line: 61
PartRenderingEngine.safeCreateGui(MUIElement, Object, IEclipseContext) line: 645
PartRenderingEngine.safeCreateGui(MUIElement) line: 735
PartRenderingEngine.access$2(PartRenderingEngine, MUIElement) line: 706
PartRenderingEngine$7.run() line: 700
SafeRunner.run(ISafeRunnable) line: 42
PartRenderingEngine.createGui(MUIElement) line: 685
WBWRenderer(SWTPartRenderer).processContents(MElementContainer<MUIElement>) line: 61
WBWRenderer.processContents(MElementContainer<MUIElement>) line: 676
PartRenderingEngine.safeCreateGui(MUIElement, Object, IEclipseContext) line: 645
PartRenderingEngine.safeCreateGui(MUIElement) line: 735
PartRenderingEngine.access$2(PartRenderingEngine, MUIElement) line: 706
PartRenderingEngine$7.run() line: 700
SafeRunner.run(ISafeRunnable) line: 42
PartRenderingEngine.createGui(MUIElement) line: 685
PartRenderingEngine$9.run() line: 1042
Realm.runWithDefault(Realm, Runnable) line: 332
PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 997
E4Workbench.createAndRunUI(MApplicationElement) line: 138
Workbench$5.run() line: 610
Realm.runWithDefault(Realm, Runnable) line: 332
Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 567
PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 150
Application.start(IApplicationContext) line: 32
EclipseAppHandle.run(Object) line: 196
EclipseAppLauncher.runApplication(Object) line: 110
EclipseAppLauncher.start(Object) line: 79
EclipseStarter.run(Object) line: 354
EclipseStarter.run(String[], Runnable) line: 181
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 57
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 606
Main.invokeFramework(String[], URL[]) line: 636
Main.basicRun(String[]) line: 591
Main.run(String[]) line: 1450
Main.main(String[]) line: 1426
I am using GWT-RPC to populate Ext-GWT TreeGrids with data from a server. I am using 4 callbacks to populate 6 TreeGrids. As the callback onSuccess function modifies the TreeGrid by inserting rows, the TreeGridView needs to render the rows. The callback class is called MainPnlSummaryTablesAsyncCallback.
For some reason, when it needs to determine the TreeGridView's scroller's offsetHeight via JSNI, onSuccess or onFailure is called on another instance of the callback in the stack trace. A copy of the stack trace I encountered is below.
Isn't this really weird? Why is this happening?
FYI I am using Ext-GWT 2.0.1 and GWT 1.7.0 and I am using hosted mode browser to debug this, although I am pretty sure that this is an issue for web mode.
PnlSummaryClientDebug_as10node6 [Java Application]
com.google.gwt.dev.HostedMode at localhost:3595
Thread [main] (Suspended (breakpoint at line 403 in MainPage$MainPnlSummaryTablesAsyncCallback))
MainPage$8(MainPage$MainPnlSummaryTablesAsyncCallback).onSuccess(GWTPair<AggregateStringGWTTable,AggregateStringGWTTable>) line: 403
MainPage$8(MainPage$MainPnlSummaryTablesAsyncCallback).onSuccess(Object) line: 1
RequestCallbackAdapter<T>.onResponseReceived(Request, Response) line: 215
Request.fireOnResponseReceivedImpl(RequestCallback) line: 264
Request.fireOnResponseReceivedAndCatch(GWT$UncaughtExceptionHandler, RequestCallback) line: 236
Request.fireOnResponseReceived(RequestCallback) line: 227
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] [local variables unavailable]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
MethodAdaptor.invoke(Object, Object...) line: 103
IDispatchImpl.callMethod(CompilingClassLoader, Object, Variant[], MethodAdaptor) line: 126
IDispatchProxy.invoke(int, int, Variant[]) line: 155
IDispatchProxy(IDispatchImpl).Invoke(int, int, int, int, int, int, int, int) line: 294
IDispatchProxy(IDispatchImpl).method6(int[]) line: 194
COMObject.callback6(int[]) line: 117
COM.VtblCall(int, int, int, GUID, int, int, DISPPARAMS, int, EXCEPINFO, int[]) line: not available [native method]
IDispatch.Invoke(int, GUID, int, int, DISPPARAMS, int, EXCEPINFO, int[]) line: 64
OleAutomation.invoke(int, int, Variant[], int[], Variant) line: 493
OleAutomation.invoke(int, Variant[]) line: 417
ModuleSpaceIE6.doInvokeOnWindow(OleAutomation, String, Variant[]) line: 68
ModuleSpaceIE6.doInvoke(String, Object, Class<?>[], Object[]) line: 153
ModuleSpaceIE6(ModuleSpace).invokeNative(String, Object, Class<?>[], Object[]) line: 453
ModuleSpaceIE6(ModuleSpace).invokeNativeInt(String, Object, Class<?>[], Object[]) line: 207
JavaScriptHost.invokeNativeInt(String, Object, Class<?>[], Object[]) line: 75
Element$.getOffsetHeight$(Element) line: not available
El.getHeight(boolean) line: 984
TreeGridView(BufferView).getVisibleRowCount() line: 313
TreeGridView(BufferView).doRender(List<ColumnData>, List<ModelData>, int, int, boolean, boolean) line: 189
TreeGridView(BufferView).doRender(List<ColumnData>, List<ModelData>, int, int, boolean) line: 181
TreeGridView(GridView).renderRows(int, int) line: 1559
TreeGridView(GridView).insertRows(ListStore<ModelData>, int, int, boolean) line: 1242
TreeGridView(GridView).onAdd(ListStore<ModelData>, List<ModelData>, int) line: 1293
GridView$5.storeAdd(StoreEvent<ModelData>) line: 1179
GridView$5(StoreListener<M>).handleEvent(StoreEvent<M>) line: 22
GridView$5(StoreListener<M>).handleEvent(BaseEvent) line: 1
TreeGrid$2(BaseObservable).callListener(Listener<BaseEvent>, BaseEvent) line: 176
TreeGrid$2(BaseObservable).fireEvent(EventType, BaseEvent) line: 96
TreeGrid$2(ListStore<M>).insert(List<? extends M>, int, boolean) line: 467
TreeGrid$2(ListStore<M>).insert(List<? extends M>, int) line: 266
TreeGrid<M>.onAdd(TreeStoreEvent<M>) line: 430
TreeGrid$1.storeAdd(StoreEvent<M>) line: 123
TreeGrid$1(StoreListener<M>).handleEvent(StoreEvent<M>) line: 22
TreeGrid$1(StoreListener<M>).handleEvent(BaseEvent) line: 1
TreeStore<M>(BaseObservable).callListener(Listener<BaseEvent>, BaseEvent) line: 176
TreeStore<M>(BaseObservable).fireEvent(EventType, BaseEvent) line: 96
TreeStore<M>.doInsert(TreeModel, List<TreeModel>, int, boolean, boolean) line: 799
TreeStore<M>.insert(List<M>, int, boolean) line: 493
TreeStore<M>.add(List<M>, boolean) line: 163
TreeStore<M>.add(M, boolean) line: 174
PnlClientFactory.populatePnlDataTreeStore(AggregateStringGWTTable, TreeStore<BaseModel>) line: 42
MainPage$9(MainPage$MainPnlSummaryTablesAsyncCallback).onSuccess(GWTPair<AggregateStringGWTTable,AggregateStringGWTTable>) line: 403
MainPage$9(MainPage$MainPnlSummaryTablesAsyncCallback).onSuccess(Object) line: 1
RequestCallbackAdapter<T>.onResponseReceived(Request, Response) line: 215
Request.fireOnResponseReceivedImpl(RequestCallback) line: 264
Request.fireOnResponseReceivedAndCatch(GWT$UncaughtExceptionHandler, RequestCallback) line: 236
Request.fireOnResponseReceived(RequestCallback) line: 227
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
MethodAdaptor.invoke(Object, Object...) line: 103
IDispatchImpl.callMethod(CompilingClassLoader, Object, Variant[], MethodAdaptor) line: 126
IDispatchProxy.invoke(int, int, Variant[]) line: 155
IDispatchProxy(IDispatchImpl).Invoke(int, int, int, int, int, int, int, int) line: 294
IDispatchProxy(IDispatchImpl).method6(int[]) line: 194
COMObject.callback6(int[]) line: 117
OS.DispatchMessageW(MSG) line: not available [native method]
OS.DispatchMessage(MSG) line: 1925
Display.readAndDispatch() line: 2966
HostedMode(SwtHostedModeBase).processEvents() line: 235
HostedMode(HostedModeBase).pumpEventLoop() line: 558
HostedMode(HostedModeBase).run() line: 405
HostedMode.main(String[]) line: 232
C:\Program Files\Java\jdk1.6.0_06\bin\javaw.exe (Jul 29, 2009 2:11:16 PM)
Ok, it seems that the server was throwing some NullPointerExceptions when the RPC calls were being made... still, I don't understand why the client-side stack trace looked like this (looks kind of misleading, as if two stack traces bled into each other).