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.
When using htmlui api, the @OnReceive annotation doesn't work correctly. I have created an application using the DukeScript Wizard that connects to the bitbucket REST API. It works correctly in the normal client, but doesn't work when running in the "Client for NetBeans". Debugging showed that with KOTransfer in LoadJSON the XMLHttpRequest returns status code "0", and never gets past a request.readyState of "1". Similar bugs (XMLHttpRequest returns status code "0") on Stackoverflow almost always are problems with CORS. Apparently it doesn't work when WebView is running inside NetBeans. I tried setting a system property for WebView as a workaround as indicated here, but without success: http://stackoverflow.com/questions/23692746/webview-does-not-really-support-cors-in-javafx-2-2 Workaround: Using Tyrus (ko-ws-tyrus) instead of KOTransfer the application works correctly. To use it I added a dependency on Tyrus: <dependency> <groupId>org.netbeans.html</groupId> <artifactId>ko-ws-tyrus</artifactId> <version>1.2.3</version> <type>jar</type> </dependency> In addition to the dependency you need to register Tyrus on a position lower than 100 (otherwise KOTransfer has preference): import org.netbeans.html.context.spi.Contexts; import org.netbeans.html.json.spi.Transfer; import org.openide.util.lookup.ServiceProvider; @ServiceProvider(service = Contexts.Provider.class) public class RegisterTransfer implements Contexts.Provider { @Override public void fillContext(Contexts.Builder context, Class<?> requestor) { context.register(Transfer.class, new KOTransfer(), 10); } } That is a bit cumbersome, so I would suggest to make it easier to use Tyrus. It should probably be the default when running in NetBeans.
Here's the project with the workaround: https://bitbucket.org/DukeScript/bitbucket-plugin To test without tyrus just comment out the registration of Provider: // @ServiceProvider(service = Contexts.Provider.class)
The best way to simplify this is to provide new xhr4j module that will handle the @OnReceive request with higher priority: http://source.apidesign.org/hg/html~html4j/rev/b547f8f663f5 I plan to add the module for HTML/Java 1.3 - e.g. NetBeans 8.2
The bits for HTML/Java 1.3 are staged at https://maven.java.net/content/repositories/orgapidesign-1046/ Please give them a bit of testing.
2nd attempt to release HTML/Java @ 1.3 bits: https://maven.java.net/content/repositories/orgapidesign-1049
I plan to release the bits of HTML/Java @ 1.3 in 24h.
Ready to merge: http://hg.netbeans.org/ergonomics/rev/4640e3706d9e http://hg.netbeans.org/ergonomics/rev/1d079cc9c4a6
http://hg.netbeans.org/ergonomics/rev/f528a73f5374
Integrated into 'main-silver', will be available in build *201603180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/4640e3706d9e User: Jaroslav Tulach <jtulach@netbeans.org> Log: #257849: Switching existing HTML/Java modules to version 1.3