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 228187 - "Use Jersey specific features" checkbox in EE 7 project generates incorrect code
Summary: "Use Jersey specific features" checkbox in EE 7 project generates incorrect code
Status: RESOLVED DUPLICATE of bug 227712
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 7.3
Hardware: PC Mac OS X
: P2 normal (vote)
Assignee: issues@webservices
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-03 07:02 UTC by Petr Jiricka
Modified: 2013-04-04 00:43 UTC (History)
2 users (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 Petr Jiricka 2013-04-03 07:02:09 UTC
1. Create a Java EE 7 web project
2. Create entity from DB
3. Create REST service from this entity - during the wizard, check the "Use Jersey specific features" checkbox
4. Deploy the project

=> Deployment fails with this message in GF log:

SEVERE:   Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer

We are generating the code below in web.xml, and it looks like this is incorrect in GF 4, as the Jersey-specific classes changed. Cc'ing Jakub - Jakub can you please advise what is the correct code to generate in GF 4? And is this checkbox still necessary?

Another question is whether the servlet version should be 3.1 (currently we generate 3.0), but that's a separate issue.

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <servlet>
        <servlet-name>ServletAdaptor</servlet-name>
        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
        <init-param>
            <description>Multiple packages, separated by semicolon(;), can be specified in param-value</description>
            <param-name>com.sun.jersey.config.property.packages</param-name>
            <param-value>service</param-value>
        </init-param>
        <init-param>
            <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
            <param-value>true</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>ServletAdaptor</servlet-name>
        <url-pattern>/webresources/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
</web-app>
Comment 1 David Konecny 2013-04-04 00:43:09 UTC

*** This bug has been marked as a duplicate of bug 227712 ***