Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jrubycomplete - OSGi DynamicImport-Package breaks Adobe AEM #1977

Closed
ghost opened this Issue Sep 16, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@ghost
Copy link

ghost commented Sep 16, 2014

I've built a bundle for Adobe AEM to compile SASS files on-the-fly, as part of the process I create a resource containing the sass gem using gems-in-a-jar approach which is then added to the bundle classpath. When a user requests a specific resource, the bundle creates an osgi scripting container and runs a small ruby script to generate the compiled css.

container = new OSGiScriptingContainer(...)
container.put("content", source);
container.runScriptlet(bundle, "scripts/compile.rb");
engine = Sass::Engine.new(content, {
    :style => :compressed,
    :cache => false,
    :syntax => :scss
})

result = engine.render()

When the compilation phase takes place, the compilation will fail when sass attempts to include the date/datetime library as the dynamic import attempts to bring in joda-time.

Do we really need the DynamicImport-Package in the MANIFEST.MF?

@ghost ghost changed the title OSGi DynamicImport-Package breaks Adobe AEM jrubycomplete - OSGi DynamicImport-Package breaks Adobe AEM Sep 16, 2014

@mkristian

This comment has been minimized.

Copy link
Member

mkristian commented Sep 16, 2014

the DynamicImport-Package came in when I setup the following test cases

https://github.com/jruby/jruby/tree/jruby-1_7/maven/jruby-complete/src/it/osgi_many_bundles_with_embedded_gems

https://github.com/jruby/jruby/tree/jruby-1_7/maven/jruby/src/it/osgi_all_inclusive

I will check if it is possible to remove it. but joda-time is needed for date/datetime implementation of JRuby. are you saying the dynamic import finds joda-time somewhere else ?

but be aware that the osgi scripting container is an orphaned piece of code and the more "LoadService" refactoring takes place the less is working, which was the case since jruby-1.7.12. the above test-cases are not using the osgi scripting container and my local branch can run those test-cases with the regular scripting container.

I will see if it is possible to reduce DynamicImport-Package to the crypto packages which caused the problems earlier.

@mkristian mkristian closed this Sep 16, 2014

@ghost

This comment has been minimized.

Copy link
Author

ghost commented Sep 16, 2014

Yes, joda-time is automatically deployed to the OSGI container when you run Adobe AEM via a bundle wrapper. When I previously looked at the Felix console, it was linking against this version when DynamicImport-Package was present. The bundled version by Adobe is relatively old as well so I suspect it wasn't very compatible (joda-time-1.6.jar).

If the "LoadService" is being heavily refactored, is the OSGi Scripting Container going to become deprecated, or is it just a case of catching up after the changes?

@mkristian mkristian reopened this Sep 16, 2014

@mkristian

This comment has been minimized.

Copy link
Member

mkristian commented Sep 16, 2014

sorry I never indented to close the issue, I still want to give it trial to improve things.

yes, joda-time-1.6 will not work for jruby.

IMO I would deprecate it and remove it for jruby-9000. there is basically nobody to take care of it. there are no test-cases which could help keeping it alive, etc. and I focus on getting the regular ScriptingContainer to work out of the box OSGi, the current playground for this is the IsolatedScriptingContainer

mkristian added a commit that referenced this issue Sep 16, 2014

@mkristian

This comment has been minimized.

Copy link
Member

mkristian commented Sep 16, 2014

reducing the DynamicImport did work, leaving it out produced error with openssl. so please feel free to report any issues regarding OSGi

@mkristian mkristian closed this Sep 16, 2014

@enebo enebo added this to the JRuby 1.7.16 milestone Sep 25, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.