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 219733 - Dependencies with unknown.binary groupId added when creating a REST service in Maven project with WebLogic
Summary: Dependencies with unknown.binary groupId added when creating a REST service i...
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: WebLogic (show other bugs)
Version: 7.3
Hardware: PC All
: P2 normal (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on: 220941
Blocks: 219732
  Show dependency tree
 
Reported: 2012-10-09 02:30 UTC by Petr Jiricka
Modified: 2013-01-11 10:19 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 2012-10-09 02:30:55 UTC
Analogous to bug 216383, only for WebLogic. May need to be addressed separately in the WebLogic plugin.
Comment 1 Petr Jiricka 2012-10-11 11:30:34 UTC
P2 bug 219732 depends on this -> changing priority to P2.
Comment 2 Petr Hejl 2012-10-18 14:32:16 UTC
Denis, I've created org.netbeans.modules.j2ee.weblogic9.j2ee.JerseyLibraryHelper. You can call static getJerseyInMemoryLibrary() to get the LibraryImplementation3. It is a prototype for WL 12.1.1.0. Please test it is sufficient and let me know.

Things to solve:
- do we want to do exact match against server version?
- fill in other server versions and libraries to org/netbeans/modules/j2ee/weblogic9/resources/netbeans-jersey.xml
- unit tests

web-main 9fff4669be49
Comment 3 Denis Anisimov 2012-10-18 14:38:28 UTC
(In reply to comment #2)
> Denis, I've created
> org.netbeans.modules.j2ee.weblogic9.j2ee.JerseyLibraryHelper. You can call
> static getJerseyInMemoryLibrary() to get the LibraryImplementation3. It is a
> prototype for WL 12.1.1.0. Please test it is sufficient and let me know.

Thank you!
> 
> Things to solve:
> - do we want to do exact match against server version?
Do you mean result maven dependencies against real jar files bundled with 
JEE  server ?
That's the question which is not clear for me as well.
> - fill in other server versions and libraries to
> org/netbeans/modules/j2ee/weblogic9/resources/netbeans-jersey.xml
> - unit tests
> 
> web-main 9fff4669be49
Comment 4 Petr Hejl 2012-10-18 14:47:20 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Denis, I've created
> > org.netbeans.modules.j2ee.weblogic9.j2ee.JerseyLibraryHelper. You can call
> > static getJerseyInMemoryLibrary() to get the LibraryImplementation3. It is a
> > prototype for WL 12.1.1.0. Please test it is sufficient and let me know.
> 
> Thank you!
> > 
> > Things to solve:
> > - do we want to do exact match against server version?
> Do you mean result maven dependencies against real jar files bundled with 
> JEE  server ?
The netbeans-jersey.xml established mapping from exact server version to jersey jars/maven deps. I'm not sure whether there should be some fallback logic and possibly partial matching on server version. For example when somebody registers 12.1.2.0 in future should the logic return null library or should it try to use one specified for 12.1.1.0?

> That's the question which is not clear for me as well.
> > - fill in other server versions and libraries to
> > org/netbeans/modules/j2ee/weblogic9/resources/netbeans-jersey.xml
> > - unit tests
> > 
> > web-main 9fff4669be49
Comment 5 Petr Jiricka 2012-10-18 15:04:09 UTC
> Should the logic return null library or should it try to use one specified for 12.1.1.0?

I would say approximate mapping is better than no mapping - with approximate version, 95% of features will work. Also, in this case the libraries are added to compilation-only classpath, not packaging/deployment classpath, so it is not critical to get it 100% right.

One question Petr: I saw you didn't use the new createJavaLibraryImplementation method in org.netbeans.modules.java.api.common.util.CommonProjectUtils (see issue 217340) - why? Is it not suitable for your purpose? If not, then we may want to rethink this new method, as this bug was supposed to be the primary use case for it.
Comment 6 Petr Hejl 2012-10-18 15:12:42 UTC
(In reply to comment #5)
> One question Petr: I saw you didn't use the new createJavaLibraryImplementation
> method in org.netbeans.modules.java.api.common.util.CommonProjectUtils (see
> issue 217340) - why? Is it not suitable for your purpose? If not, then we may
> want to rethink this new method, as this bug was supposed to be the primary use
> case for it.
It's a bit strange for serverplugin to depend on project stuff ("Java Common Project API"). I believe it would be better to have it either in a more generic module (not a project related) or in j2ee.common.
Comment 7 Petr Jiricka 2012-10-18 16:09:08 UTC
WebLogic plugin already indirectly depends on java.api.common ("Java Common
Project API") via j2ee.common:

j2ee.weblogic9 -> j2ee.common -> java.api.common

Also for this reason, putting the method to j2ee.common would be even worse than java.api.common, plus there is nothing JavaEE-specific in this method.
Comment 8 Petr Hejl 2012-10-19 09:55:44 UTC
web-main ac945c6cbe10.
Use of CommonProjectUtils, better server matching, removed unused code,
Comment 9 Denis Anisimov 2012-10-19 10:20:39 UTC
Using library in the Jax-Rs stack :
web-main#096d17e11843

The resulting code doesn't work: library "is not added". There is unresolved 
reference to the WL Jersey library. I'm not sure what area is the source 
of the issue. I'm going to file a new issue.
Comment 10 Petr Hejl 2012-10-19 10:23:39 UTC
Unit test: web-main ffad9e13ecbd.
Comment 11 Denis Anisimov 2012-10-19 10:39:23 UTC
Here is the issue against project's classpath extending : issue #220408 .
Comment 12 Petr Hejl 2012-10-19 10:58:11 UTC
Denis, let me know if you need anything else on WL side. Feel free to update netbeans-jersey.xml.
Comment 13 Quality Engineering 2012-10-19 13:42:03 UTC
Integrated into 'main-golden', will be available in build *201210191216* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/9fff4669be49
User: Petr Hejl <phejl@netbeans.org>
Log: #219733 - Dependencies with unknown.binary groupId added when creating a REST service in Maven project with WebLogic
Comment 14 Quality Engineering 2012-10-20 01:30:42 UTC
Integrated into 'main-golden', will be available in build *201210200002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ac945c6cbe10
User: Petr Hejl <phejl@netbeans.org>
Log: #219733 - Dependencies with unknown.binary groupId added when creating a REST service in Maven project with WebLogic
Comment 15 Petr Jiricka 2012-10-31 14:11:55 UTC
This is now fixed after Milos fixed bug 220941. After adding the Jersey libraries (using WebLogic 12.1.2), the dependencies are:

         <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-client</artifactId>
            <version>1.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-json</artifactId>
            <version>1.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey.contribs</groupId>
            <artifactId>jersey-multipart</artifactId>
            <version>1.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-server</artifactId>
            <version>1.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <version>1.8.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-jaxrs</artifactId>
            <version>1.8.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.8.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-xc</artifactId>
            <version>1.8.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jettison</groupId>
            <artifactId>jettison</artifactId>
            <version>1.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>