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 241662 - Class defined in OSGi bundle cannot be found - testcase needs update?
Summary: Class defined in OSGi bundle cannot be found - testcase needs update?
Status: RESOLVED INVALID
Alias: None
Product: projects
Classification: Unclassified
Component: Maven OSGi bundles (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-10 20:45 UTC by markiewb
Modified: 2014-04-15 11:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample projects (5.83 KB, application/octet-stream)
2014-02-17 19:51 UTC, markiewb
Details
Shows the issue (82.76 KB, image/png)
2014-02-17 19:51 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2014-02-10 20:45:58 UTC
See test suite
http://services.netbeans.org/synergy/client/app/#/suite/1496/v/1
and the testcase http://services.netbeans.org/synergy/client/app/#/case/3913/suite/1496/v/1

A class from an OSGi bundle cannot be referenced. Only if I export the package in the OSGi bundle. I guess the test spec needs an update?

Product Version: NetBeans IDE Dev (Build 201402090001)
Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b69
Runtime: Java(TM) SE Runtime Environment 1.8.0-b127
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 Milos Kleint 2014-02-11 09:34:39 UTC
I'm not sure I follow what the test is supposed to do.

"A class from an OSGi bundle cannot be referenced" means that there's an error in editor? is it missing from code completion?

it appears that by default we now put <exportPackage/> element in the archetype pom to prevent the default behaviour and make all packages explicitly private until the user selects otherwise.

I've seen some error marks in my dev IDE, but when I tried to debug it in the testing instance I could not reproduce. 
AFAIK we don't have white-listing for osgi bundles (as we do for netbeans modules) so you should not even be notified that the class referenced comes from a private package
Comment 2 Milos Kleint 2014-02-14 10:55:28 UTC
I've tried again in latest dev build (custom built) and I still cannot reproduce.
I'm able to add an osgi project with private packages as dependency of a j2se (jar) project and use it's classes.

please provide a sample project demonstrating the problem or more detailed steps to reproduce and reopen, closing as incomplete for now.
Comment 3 markiewb 2014-02-17 19:51:31 UTC
Created attachment 145327 [details]
Sample projects

* Open the two attached projects
* Clean and build TestOSGIBundle module
* Clean and build mavenproject3

-> ACTUAL: 
* compile error "osgistuff.OSGISharedClass cannot be found" in foo.main
* second strange thing: try to "import osgistuff.OSGiSharedClass" -> still compile error, BUT there is no error about the invalid import - see screenshot

Product Version: NetBeans IDE Dev (Build 201402170649)
Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b69
Runtime: Java(TM) SE Runtime Environment 1.8.0-b127
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\markiewb\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\markiewb\AppData\Local\NetBeans\Cache\dev
Comment 4 markiewb 2014-02-17 19:51:48 UTC
Created attachment 145328 [details]
Shows the issue
Comment 5 markiewb 2014-02-17 19:52:44 UTC
(In reply to Milos Kleint from comment #2)
> please provide a sample project demonstrating the problem or more detailed
> steps to reproduce and reopen, closing as incomplete for now.

Sample projects, steps (https://netbeans.org/bugzilla/show_bug.cgi?id=241662#c3) and screenshot attached -> REOPEN
Comment 6 Milos Kleint 2014-04-15 11:53:45 UTC
right. the problem here is a typo.

while the osgi class defines class: osgistuff.OSGiSharedClass
the project uses: osgistuff.OSGISharedClass

please note the capital I in OSGI

after I've changed the capital I to i, I didn't get any errors anymore