This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 229164 - Cannot debug PhoneGap applications
Summary: Cannot debug PhoneGap applications
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: Inspection (show other bugs)
Version: 7.3
Hardware: Macintosh Mac OS X
: P2 normal (vote)
Assignee: Jan Stola
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-29 13:57 UTC by Jan Becicka
Modified: 2013-04-30 12:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Becicka 2013-04-29 13:57:11 UTC
Always thrown when I start to debug on iPad 

java.lang.NullPointerException
	at org.netbeans.modules.web.inspect.webkit.WebKitPageModel$WebPaneSynchronizer.performHoverRelatedStyleSheetUpdate(WebKitPageModel.java:967)
	at org.netbeans.modules.web.inspect.webkit.WebKitPageModel$WebPaneSynchronizer.updateSelectionMode(WebKitPageModel.java:955)
	at org.netbeans.modules.web.inspect.webkit.WebKitPageModel$WebPaneSynchronizer.access$1800(WebKitPageModel.java:829)
	at org.netbeans.modules.web.inspect.webkit.WebKitPageModel$WebPaneSynchronizer$1.run(WebKitPageModel.java:855)
Caused: org.openide.util.RequestProcessor$SlowItem: task failed due to
	at org.openide.util.RequestProcessor.post(RequestProcessor.java:424)
	at org.netbeans.modules.web.inspect.webkit.WebKitPageModel$WebPaneSynchronizer.propertyChange(WebKitPageModel.java:835)
	at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
	at org.netbeans.modules.web.inspect.PageModel.firePropertyChange(PageModel.java:198)
	at org.netbeans.modules.web.inspect.webkit.WebKitPageModel.setSynchronizeSelection(WebKitPageModel.java:679)
	at org.netbeans.modules.web.inspect.PageInspectorImpl.inspectPage(PageInspectorImpl.java:162)
	at org.netbeans.modules.cordova.CordovaPerformer.startDebugging(CordovaPerformer.java:348)
	at org.netbeans.modules.cordova.CordovaPerformer$1.run(CordovaPerformer.java:159)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2042)
Comment 1 Jan Stola 2013-04-29 14:15:28 UTC
The corresponding lines are

966: StyleSheetBody body = css.getStyleSheet(styleSheetId);
967: String styleSheetText = body.getText();

Hence, the exception shows that 'body' is null. Could you, please, scan the WebKit log and check whether you find a root of this problem? It seems that we failed to receive a response for "CSS.getStyleSheet". Is this the case? Maybe the browser used by PhoneGap (Safari?) uses a different version of the protocol than we support for Chrome currently.
Comment 2 Jan Becicka 2013-04-29 15:21:41 UTC
Yes. That's it:

16:35:31:670 blocking send {"id":39,"method":"CSS.getAllStyleSheets"}
.
.
.
16:35:31:738 response {"id":39,"result":{"headers":[{"title":"","sourceURL":"file:\/\/\/var\/mobile\/Applications\/FEDFF2CD-0FD0-4694-B3EB-036DE7F5F0B1\/BackboneJQueryMobile4.app\/www\/css\/jquery.mobile-1.0.1.min.css","styleSheetId":"1","disabled":false}]}}
16:35:31:741 blocking send {"id":40,"method":"CSS.getStyleSheet","params":{"styleSheetId":"1"}}
16:35:41:742 no response for {"id":40,"method":"CSS.getStyleSheet","params":{"styleSheetId":"1"}}

Can you workaround it? It looks like stylesheet with id "1" is already loaded.
Comment 3 Jan Stola 2013-04-30 12:04:29 UTC
I have no idea why CSS.getStyleSheet fails on iPad. This method seems to be in WebKit Remote Debugging API since introduction of CSS domain.

Anyway, the code that results in the attached exception is not crucial for page inspection. It is simple to skip it when CSS.getStyleSheet fails.

Modified file: http://hg.netbeans.org/web-main/rev/e61c0d1372d4