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
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'
I've been trying to decode my IR raw data but always getting unknown code. i used
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#define SHORT 600
#define LONG 300
#define MARGIN 200
#define INTRO 3500
#define INTRO2 1700
#define SEPARATOR 9880
char decode(int val1, int val2){
if (abs(val1 - INTRO) < MARGIN && abs(val2 -
INTRO2) < MARGIN)
return '[';
if (abs(val1 - SHORT) < MARGIN && abs(val2 -
SHORT) < MARGIN)
return '0';
if (abs(val1 - SHORT) < MARGIN && abs(val2 -
LONG) < MARGIN)
return '1';
if (abs(val1 - SHORT) < MARGIN && abs(val2 -
SEPARATOR) < MARGIN)
return ']';
}
int abs(int val){
if (val < 0)
return -val;
else
return val;
}
int main(int argc, char** argv){
if (argc < 3){
printf("usage = %s fileName output\n",
argv[0]);
exit(0);
}
int val1, val2;
char delims[] = " ";
char *result = NULL;
FILE* f = fopen(argv[1],"r");
FILE* out = fopen(argv[2],"w");
char line[256];
int index = 0;
char* nIndex = 0;
while (fgets(line, 256, f) != NULL){
result = strtok( line, delims );
index = 0;
while( result != NULL ) {
//printf( "result[%d] is \"%s\"\n",
index, result );
if (index & 1){
if (nIndex = strchr(result,'\n')){
//printf("New line detected in result\n");
*nIndex = '\0';
}
val2 = atoi(result);
char dec = decode(val1,val2);
fprintf(out,"%c",dec);
}else{
val1 = atoi(result);
}
result = strtok( NULL, delims );
index++;
}
//printf (line);
}
fprintf(out, "]\n");
fclose(f);
fclose(out);
}
and my Raw data are
3596 1598 574 298 574 1166
572 301 603 268 576 295
573 298 600 271 610 260
577 295 572 299 573 298
573 299 603 268 577 1164
574 298 574 296 573 299
543 329 575 295 571 301
573 298 569 1173 576 1165
546 1197 662 184 636 261
544 1198 600 271 573 299
573 297 574 297 544 328
605 266 573 299 544 326
573 298 605 266 575 296
576 296 543 327 575 296
604 268 575 297 515 356
599 272 572 298 601 271
571 299 574 301 573 295
576 295 573 279 561 329
545 325 546 325 573 300
573 297 573 1169 572 1170
574 298 544 327 575 296
547 325 511 359 603 76167
3599 1625 548 322 553 1189
552 321 523 348 550 321
551 320 517 354 574 297
551 320 551 321 577 293
547 325 550 321 521 1219
525 348 552 319 550 321
549 322 552 320 549 322
550 321 548 1193 551 1191
584 1159 518 353 549 322
580 1170 546 317 551 321
552 319 579 292 551 320
552 320 551 320 553 318
549 322 579 292 547 324
550 321 555 317 550 320
581 1160 587 286 543 1198
552 1190 552 1191 550 321
551 321 581 290 547 324
549 322 550 321 548 1193
552 1191 550 319 583 292
550 320 576 295 579 292
551 320 519 353 551 319
548 323 553 1189 522 1220
550 1192 550 1192 551 1192
523 1219 551 1191 451 1291
522 350 550 321 553 318
548 323 555 316 551 320
553 319 552 319 554 316
584 300 566 294 550 320
552 319 549 322 550 321
553 321 552 317 549 321
550 1192 523 1219 550 1192
558 314 549 322 552 319
551 321 552 318 552 320
551 320 549 322 551 320
550 1192 548 1194 550 1192
551 320 613 258 526 346
554 319 549 322 522 348
576 294 522 350 522 348
555 317 523 348 552 319
552 319 550 321 548 323
552 319 580 1161 551 322
553 318 551 320 549 322
608 263 582 289 525 1216
550 322 521 350 552 320
551 320 552 319 549 322
581 290 551 321 550 320
552 319 555 317 523 348
548 324 551 319 546 325
551 321 479 391 572 1169
551 1192 554 1188 555 1188
551 321 549 1191 557 1187
551
and i got
[1�11111111111�1111111��#11#111111111111111111111111111111��11111�[1
11111111111+1111111##�11�11111111111111�1###111111##111111111
,###+#s111111111111111111#+#111111111###1111111111111111�111111(11111111111111111�#
please help me, thank you!
I am not used to playing with IR, but ...
If you want to use lirc you should configure it : http://lirc.org/html/configuration-guide.html.
You do not need to develop a specific utility to decode data.
You can use mode2 to get output form driver http://www.lirc.org/html/mode2.html
mode2 --driver default --device /dev/lirc0
Using driver default on device /dev/lirc0
Trying device: /dev/lirc0
Using device: /dev/lirc0
pulse 2750
space 800
pulse 500
space 350
pulse 550
space 350
pulse 550
Then lircd.conf is used to map data to key http://www.lirc.org/html/lircd.conf.html and with irw you get the result :
$ irw
000000037ff07bef 00 KEY_VOLUMEUP Acer_Aspire_6530G_MCE
000000037ff07bef 01 KEY_VOLUMEUP Acer_Aspire_6530G_MCE
000000037ff07bdd 00 KEY_ENTER Acer_Aspire_6530G_MCE
000000037ff07bdd 02 KEY_ENTER Acer_Aspire_6530G_MCE
It looks like you may be reading a remote intended for a Mitsubishi air conditioning system. Unlike most remotes, which just send a short signal corresponding to the button pressed and rely on the device being controlled to remember its previous state, Mitsubishi decided to transmit the entire desired state of the machine -- all the mode, fan, vane, and other settings get sent Every Time, as an 18-byte data block with checksum (which the remote then repeats once, as insurance against optical noise).
If you websearch "Mitsubishi minisplit IR protocol", you'll find some pages where people have at least partially analyzed this protocol.
This isn't the kind of approach LIRC's higher-level tools were designed to handle. You can still use the LIRC drivers, but they have to be accessed in "raw" mode and separate tools are used to interpret incoming signal or generate outgoing signal.
Searching Github finds libraries/tools others have written to work with this protocol. I haven't found one in a language I actually like working with, though, so I'm assuming I'm going to have to access the LIRC api calls to read/write the data and interpret/generate it myself.
RELATED: If you're using the ir-ctl program to do basic "raw" reading and writing while you test your hardware, be aware that ir-ctl's transmit mode has a line-length limit which this protocol sometimes exceeds if you put it all on a single line of text. The workaround is to insert line breaks every so often, so no single line of the input exceeds that hardcoded limit. (Yes, I've filed a bug report.)
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();
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
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).