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 245075 - Adding Websocket onOpen and onClose methods produces wrong code
Summary: Adding Websocket onOpen and onClose methods produces wrong code
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: WebSocket (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-16 08:28 UTC by Maksim Khramov
Modified: 2015-06-24 02:26 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 Maksim Khramov 2014-06-16 08:28:29 UTC
Product Version: NetBeans IDE Dev (Build 201406040001)
Java: 1.7.0_65; Java HotSpot(TM) 64-Bit Server VM 24.65-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_65-b13
Glassfish 4 as target server

Steps to reproduce:
Create Web Project and add websocket endpoint class
Invoke add onOpen method command on this class. 
The IDE produces:
>>     @OnOpen public void onOpen(Throwable t) {}
deploying this code produces Exceptions on server:
>> javax.websocket.DeploymentException: Method:  onOpen::class java.lang.Throwable  is not allowed as parameter type for method annotated with @OnOpen.

expected function signature as described in javadoc:

The method may only take the following parameters:-
optional Session parameter
optional EndpointConfig parameter
Zero to n String parameters annotated with the PathParam annotation.

for onClose function generated code also wrong. expected:
optional Session parameter
optional CloseReason parameter
Zero to n String parameters annotated with the PathParam annotation.
Comment 1 Petr Hejl 2015-06-23 15:32:07 UTC
Fixed in web-main db45a0b62775.
Comment 2 Quality Engineering 2015-06-24 02:26:31 UTC
Integrated into 'main-silver', will be available in build *201506240001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/db45a0b62775
User: Petr Hejl <phejl@netbeans.org>
Log: #245075 - Adding Websocket onOpen and onClose methods produces wrong code