Issue Details (XML | Word | Printable)

Key: OSGI-411
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Costin Leau
Reporter: Björn Voß
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring OSGi

Spring-osgi loads Classes not visible for bundle

Created: 14/Mar/08 05:24 AM   Updated: 24/Apr/08 01:05 PM
Component/s: EXTENDER
Affects Version/s: 1.0
Fix Version/s: 1.1 M2

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive example.zip (14 kB)
2. Text File log.txt (4 kB)
3. Zip Archive test.zip (2.69 MB)

Environment: equinox 3.3.1.1
Issue Links:
Related
 


 Description  « Hide
I have tow bundles A, B. Bundle B exports a package 'my.package.b'. Bundle A did NOT import this package but in the spring-context a beans of classes in the package 'my.package.b' can be instantiated.
I think, this shouldn't be possible as 3.8.4 of the OSGi core spec says. If I didn't use spring and try to load classes for example in the bundle activator I get a ClassNotFoundException as expected.

 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Costin Leau added a comment - 17/Mar/08 03:31 AM
Hi Björn,

I've read this thread and the JIRA issue but I cannot reproduce your problem. In fact, in our test suite we have plenty of 'test' bundles in which a missing import triggers a test failure.
I assume you case is a bit different and I'd like to know more about it to see whether there is a problem with Spring DM or not.

Can you create a simple test case or explain your environment better?

Thanks.

Björn Voß added a comment - 17/Mar/08 10:01 AM
Hi Costin

In the zip, you find two example bundles and the start.sh and config.ini (under configuration) I use.

Here a ls of equinox-root dir:
configuration
epl-v10.html
features
notice.html
org.eclipse.equinox.common_3.3.0.v20070426.jar
org.eclipse.osgi_3.3.1.R33x_v20070828.jar
org.eclipse.update.configurator_3.2.101.R33x_v20070810.jar
plugins
start.sh

And a ls of plugins dir:
aopalliance.osgi-1.0-SNAPSHOT.jar
asm.osgi-2.2.3-SNAPSHOT.jar
bundle-a-1.0.0.jar
bundle-b1-1.0.0.jar
javax.servlet.jsp_2.0.0.v200706191603.jar
javax.servlet_2.4.0.v200706111738.jar
jcl104-over-slf4j-1.4.3.jar
log4j.osgi-1.2.15-SNAPSHOT.jar
org.apache.commons.el_1.0.0.v200706111724.jar
org.apache.jasper_5.5.17.v200706111724.jar
org.eclipse.equinox.app_1.0.1.R33x_v20070828.jar
org.eclipse.equinox.common_3.3.0.v20070426.jar
org.eclipse.equinox.device_1.0.0.v20070226.jar
org.eclipse.equinox.event_1.0.100.v20070516.jar
org.eclipse.equinox.http.jetty_1.0.1.R33x_v20070816.jar
org.eclipse.equinox.http.registry_1.0.0.v20070608.jar
org.eclipse.equinox.http.servlet_1.0.1.R33x_v20070816.jar
org.eclipse.equinox.http.servletbridge_1.0.0.v20070523.jar
org.eclipse.equinox.http_1.0.100.v20070423.jar
org.eclipse.equinox.jsp.jasper.registry_1.0.0.v20070607.jar
org.eclipse.equinox.jsp.jasper_1.0.1.R33x_v20070816.jar
org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar
org.eclipse.equinox.log_1.0.100.v20070226.jar
org.eclipse.equinox.metatype_1.0.0.v20070226.jar
org.eclipse.equinox.preferences_3.2.100.v20070522.jar
org.eclipse.equinox.registry_3.3.1.R33x_v20070802.jar
org.eclipse.equinox.servletbridge_1.0.1.R33x_v20070816.jar
org.eclipse.equinox.useradmin_1.0.0.v20070226.jar
org.eclipse.osgi.services_3.1.200.v20070605.jar
org.eclipse.osgi.util_3.1.200.v20070605.jar
org.eclipse.osgi_3.3.1.R33x_v20070828.jar
org.eclipse.update.configurator_3.2.101.R33x_v20070810.jar
org.mortbay.jetty_5.1.11.v200706111724.jar
slf4j-api-1.4.3.jar
slf4j-log4j12-1.4.3.jar
spring-aop-2.5.1.jar
spring-beans-2.5.1.jar
spring-context-2.5.1.jar
spring-core-2.5.1.jar
spring-osgi-annotation-1.0.1.jar
spring-osgi-core-1.0.1.jar
spring-osgi-extender-1.0.1.jar
spring-osgi-io-1.0.1.jar

I hope this helps. If you need any additional information just let me know.

regards
Björn

Björn Voß added a comment - 03/Apr/08 04:11 AM
Hi Costin

I just want ask: Can you now reproduce the problem, or do you need any additional information?

regards
Björn

Costin Leau added a comment - 08/Apr/08 10:48 AM
Sorry for the delay Björn - I haven't managed to look at it but I'll try to for M2. Thanks.

Costin Leau added a comment - 10/Apr/08 10:36 AM
Bjorn, I've downloaded the bundles, created a local configuration (the one your provided seems to be wrong since there is nothing started in there) and deployed the bundles but nothing happens. The bundles are installed and resolved but not started.
At what exactly should I look at?

Björn Voß added a comment - 11/Apr/08 02:19 AM
Hi Costin

Don't worry about the delay has really great new features. :-)

I'm sorry, I forgot to add the spring-osgi-extender-1.0.1.jar and bundle-b1-1.0.0.jar in the config to start automatically. Please start them by hand.
And bundle b1 will start without a problem although a class of bundle a is instantiated but not imported in the maifest.

regards
Björn

Costin Leau added a comment - 11/Apr/08 02:48 AM
Right - I added the extender and tried to start the bundles but they don't seem to move out of the resolved state.
I've attached log.txt for more information.

Björn Voß added a comment - 11/Apr/08 03:09 AM
ok it goes stranger ...
I have done exact the same as you and you're right both bundles stay in the resolve state. But if you just start the extender and bundle b then you'll see what I mean.

Costin Leau added a comment - 11/Apr/08 03:23 AM
I've stopped all bundles and then tries to start just the extender and bundle b but only the extender starts. I'll create an integration test with your bundles - maybe that one will behave differently.

Björn Voß added a comment - 11/Apr/08 05:54 AM
Here is my osgi-runtime. If you start it (start.sh), do a "ss" and start bundle b than you'll get the following output which indicates that bundle b is started although class "my.company.a.impl.ServiceA" is not imported.
>init A
>init B
>after properties my.company.a.impl.ServiceA@1d49247

Costin Leau added a comment - 11/Apr/08 06:31 AM
I've ran the zip you sent and it's working this time. I'll investigate and problem and report back though it might take some time.

Cheers,
  Costin