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 244109 - package com.sun.jersey.spi.container does not exist - in affable bean application with HTML5 front-end
Summary: package com.sun.jersey.spi.container does not exist - in affable bean applica...
Status: RESOLVED WONTFIX
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 8.0
Hardware: PC Windows 8 x64
: P2 normal (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on: 227712 227718
Blocks:
  Show dependency tree
 
Reported: 2014-04-27 15:28 UTC by darya
Modified: 2014-04-28 13:12 UTC (History)
1 user (show)

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 darya 2014-04-27 15:28:36 UTC
Compilation error in affable-bean application with HTML5 front-end ( https://bitbucket.org/dkonecny/affable-bean/wiki/Home)

The wiki says to run this application with: NetBeans IDE 7.3 and GlassFish 3.1.2.2

Now I try to run the application with: NetBeans IDE 8.0 (Build 201403101706) and GlassFish Server Open Source Edition  4.0  (build 89)

And run into same problem similar under NetBeans 7.3 and GlassFish 4 (see Bug 227718 or https://netbeans.org/bugzilla/show_bug.cgi?id=227718) 

C:\dkonecny-affable-bean\server\src\java\rest\filter\NewCrossOriginResourceSharingFilter.java:7: error: package com.sun.jersey.spi.container does not exist
import com.sun.jersey.spi.container.ContainerRequest;

C:\dkonecny-affable-bean\server\src\java\rest\filter\NewCrossOriginResourceSharingFilter.java:8: error: package com.sun.jersey.spi.container does not exist
import com.sun.jersey.spi.container.ContainerResponse;

C:\dkonecny-affable-bean\server\src\java\rest\filter\NewCrossOriginResourceSharingFilter.java:9: error: package com.sun.jersey.spi.container does not exist
import com.sun.jersey.spi.container.ContainerResponseFilter;

Does anyone know how to correct that error?
Comment 1 Milan Kuchtiak 2014-04-28 13:12:19 UTC
Please, use the JaxRs API insted. in NewCrossOriginResourceSharingFilter :

=====================================================================
package rest.filter;

import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;

/**
 *
 * @author david
 */
public class NewCrossOriginResourceSharingFilter implements ContainerResponseFilter {

    @Override
    public void filter(ContainerRequestContext request, ContainerResponseContext response) {
        response.getHeaders().putSingle("Access-Control-Allow-Origin", "*");
        response.getHeaders().putSingle("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE");
        response.getHeaders().putSingle("Access-Control-Allow-Headers", "content-type, X-Requested-With");
    }
    
}

=====================================================================

Notifying also the author of the tutorial to fix the example.
David, could you pelase fix the example ?