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 246103 - Support JAX-RS 2.0 with WebLogic 12.1.3
Summary: Support JAX-RS 2.0 with WebLogic 12.1.3
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 8.0
Hardware: All All
: P2 normal (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-29 14:12 UTC by Petr Jiricka
Modified: 2014-08-08 11:38 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Dialog asking user to allow the project configuration to use JAX-RS 2.0 (39.49 KB, image/png)
2014-08-01 09:07 UTC, Milan Kuchtiak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2014-07-29 14:12:14 UTC
WebLogic 12.1.3 supports JAX-RS 2.0 via a deployable library, located in wlserver/common/deployable-libraries/jax-rs-2.0.war.

NetBeans should support developing with JAX-RS 2.0 in Java EE 6 projects with WebLogic 12.1.3 target.

Not sure what the workflow would be - would the user choose the JAX-RS version? And when? I recall we did something similar for JSF, what was the workflow in that case? Thanks.
Comment 1 Petr Hejl 2014-07-30 12:58:22 UTC
Everything seems to be ready (server library, API to use them) just WS wizards don't have a place where one would select RS version (as opposed to JSF) afaik.
Comment 2 Milan Kuchtiak 2014-07-31 09:49:07 UTC
I found, to use a specific WLS deployable library (e.g. jax-rs 2.0), from the (web) project, you have to:

1. install/deploy the library on the server
2. configure the usage of that library in project's weblogic.xml, e.g.:
  ---------------------------------------
  <weblogic-web-app ...>
    ...
    <library-ref>
      <library-name>jax-rs</library-name>
      <specification-version>2.0</specification-version>
      <implementation-version>2.5.1</implementation-version>
    </library-ref>
    ...
  </weblogic-web-app>
  ----------------------------------------

If this is done, on the project site, the jar files from the library are added to project classpath. The REST wizard then recognizes JAX-RS 2.0 and generates REST resources properly.

However, there is one issue in REST Services wizard - the "Use Jersey Specific Feature" checkbox, providing Jersey 1 style configuration is available in the wizard panel. Checking this option would generate incorrect stuff in web.xml.

Problem is also, in our case, that original Jersey_1 libraries are overlapped by Jersey 2.0 libraries, but there are still Jersey_1 libraries wisible in project's view (this is probably unrealistic to fix)

Will try to fix the wizard issue.

I don't think it is good to provide the steps 1/ and 2/ from Netbeans Wizard.
The advanced users are hopefully able to do that - from the server console and by manual editing of WEB-INF/weblogic.xml.
Comment 3 Milan Kuchtiak 2014-07-31 11:42:31 UTC
Fixed the issue with "Use Jersey Specific Feature" checkbox panel - the panel doesn't appear when JAX-RS 2.0 is present on classpath:
http://hg.netbeans.org/web-main/rev/14c3b4ee15b6

Talked to P.Hejl. It would be useful when Netbeans is able to recognize that JAX-RS 2.0 deployable library is installed and in that case, JAX-RS 2.0 will be registerred in project's weblogic.xml - if not registerred yet, and if user accepts this option.

So the issue is still open.
Comment 4 Quality Engineering 2014-08-01 02:10:01 UTC
Integrated into 'main-silver', will be available in build *201408010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/14c3b4ee15b6
User: Milan Kuchtiak <mkuchtiak@netbeans.org>
Log: #246103: don't display 'Use Jersey Specific Feature' checkbox when JAX-RS 2.0 is on classpath
Comment 5 Milan Kuchtiak 2014-08-01 09:04:03 UTC
Implemented a confirmation dialog (see the attachment) where user is asked whether to configure the (web) project to use JAX-RS 2.0 library.

This way, the modification of weblogic.xml is done automatically by Netbeans, using specific j2eeserver API (step 2).

Nevertheless, the step 1 - JAX-RS 2.0 library installation requires to be done manually by user (e.g. in WebLogic consolle). 

See the changeset:
http://hg.netbeans.org/web-main/rev/4e7393e683e8

After an agreement, increasing priority to P2, as Netbeans should facilitate the project configuration, to use JAX-RS 2.0, as much as possible on WL server.
Comment 6 Milan Kuchtiak 2014-08-01 09:07:25 UTC
Created attachment 148465 [details]
Dialog asking user to allow the project configuration to use JAX-RS 2.0
Comment 7 Petr Jiricka 2014-08-01 13:17:49 UTC
Sounds good, thanks.

BTW, here is a relevant blog: http://buttso.blogspot.cz/2014/07/developing-with-jax-rs-20-for-weblogic.html

One question, does everything also work with Maven web projects as expected?
Comment 8 Quality Engineering 2014-08-02 05:07:49 UTC
Integrated into 'main-silver', will be available in build *201408020001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/4e7393e683e8
User: Milan Kuchtiak <mkuchtiak@netbeans.org>
Log: #246103: Give user an option to configure the project to use JAX-RS 2.0 library if it is installed on the server (especally useful for WebLogic, where the JAX-RS 2.0 library is optionally installable
Comment 9 Milan Kuchtiak 2014-08-04 08:38:59 UTC
> One question, does everything also work with Maven web projects as expected?

Maven (web) projects don't use server libraries at compilation time, there is no such a contract between project and server. It's up to user to configure project properly to use JAX-RS 2.0 (Step 2).
Comment 10 Milan Kuchtiak 2014-08-04 13:47:05 UTC
Vlada, could you plese verify the fix in trunk ?
Petr, could you please review the fix in java code ?
Comment 11 Vladimir Riha 2014-08-05 07:50:26 UTC
Verified, the dialog appears, weblogic.xml is being updated

Product Version: NetBeans IDE Dev (Build 201408050001)
Java: 1.8.0_11; Java HotSpot(TM) Client VM 25.11-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12
System: Linux version 3.13.0-32-generic running on i386; UTF-8; en_US (nb)
Comment 12 Petr Hejl 2014-08-05 08:52:00 UTC
The fix looks good.
Comment 13 Milan Kuchtiak 2014-08-05 11:53:27 UTC
Thanks for the review.
Changesets transplanted to 8.0.1:

http://hg.netbeans.org/releases/rev/bcd60a55c437
http://hg.netbeans.org/releases/rev/e78da5855cf0
Comment 14 Quality Engineering 2014-08-07 14:47:59 UTC
Integrated into 'releases/release801', will be available in build *201408071314* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/bcd60a55c437
User: Milan Kuchtiak <mkuchtiak@netbeans.org>
Log: #246103: don't display 'Use Jersey Specific Feature' checkbox when JAX-RS 2.0 is on classpath
Comment 15 Vladimir Riha 2014-08-08 11:38:48 UTC
Verified in 8.0.1

Product Version: NetBeans IDE 8.0.1 RC1 (Build 201408072300)
Java: 1.8.0_11; Java HotSpot(TM) Client VM 25.11-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12
System: Linux version 3.13.0-32-generic running on i386; UTF-8; en_US (nb)