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.
7.4 beta adds the following dependencies: <dependency> <groupId>org.glassfish.jersey.containers</groupId> <artifactId>jersey-container-servlet</artifactId> <version>2.0</version> </dependency> <dependency> <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-client</artifactId> <version>2.0</version> </dependency> <dependency> <groupId>org.glassfish.jersey.media</groupId> <artifactId>jersey-media-multipart</artifactId> <version>2.0</version> </dependency> to pom.xml to valid Java EE 7 application with: <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>7.0</version> <scope>provided</scope> </dependency> This is creepy and should be avoided. I don't know how NetBeans calculates these dependencies need to be added.
This breaks the application deployment with the following error: org.glassfish.deployment.common.DeploymentException: CDI deployment failure:WELD-001408 Unsatisfied dependencies for type [Providers] with qualifiers [@Default] at injection point [[BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject public org.glassfish.jersey.media.multipart.internal.MultiPartReaderServerSide(@Context Providers, Provider<CloseableService>)] at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:225) at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131) at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328) I had to remove these dependencies to get the application working.
Must be some recent regression as this used to work - no Jersey should be needed in EE7.
Fixed. The intention of previous behavior was to add missing Jersey 2.0 dependencies in case, user is working either on project with non-selected server, or with server that contains no Jersey on classpath. Now, Jersey 2.0 artifacts(dependencies) are not added any more, for Java EE6 and Java EE7 project types. It's expected, user is able to add Jersey dependencies manually when needed (e.g. for Tomcat server). See: https://hg.netbeans.org/web-main/rev/b738ea5932a0
Was this issue result of Maven project not having a server associated? If so then it is a good idea Arun to always select a server first - NetBeans will use that information in many wizards to give you better results. The fix could have distinguish case when Maven has no server selected. If selected server does not have Jersey on classpath then Jersey should probably be still added.
Integrated into 'main-silver', will be available in build *201307232300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/b738ea5932a0 User: Milan Kuchtiak <mkuchtiak@netbeans.org> Log: #232922: don't add Jersey 2.0 dependencies in maven Java EE6, Java EE7 project types
I know that in some areas (JPA, JSF) we display an inline warning in the wizard if the server is not set, which recommends the user to set the target server before proceeding with the wizard. It may be a good idea to have this warning also in the JAX-RS/Jersey case.
*** Bug 233551 has been marked as a duplicate of this bug. ***