-
Notifications
You must be signed in to change notification settings - Fork 30
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
Easye/osgi/20211110a #412
base: master
Are you sure you want to change the base?
Easye/osgi/20211110a #412
Conversation
Try with: ----test-osgi.asd------------------------------------------ (defsystem test-osgi :defsystem-depends-on (asdf-osgi-bundle asdf-mvn-module) :components ((:mvn-module maven :dependencies ("javax.xml.bind:jaxb-api:LATEST" "net.sourceforge.owlapi/owlapi-distribution/4.2.6" "net.sourceforge.owlapi/owlexplanation/2.0.0") :managed-dependencies ("org.slf4j/slf4j-api/1.7.21" "org.apache.httpcomponents:httpcore:4.4.5" "org.apache.httpcomponents:httpclient:4.5" "net.sourceforge.owlapi:owlapi-distribution:4.2.6") :exclusions ("net.sourceforge.owlapi:owlapi-osgidistribution" "edu.stanford.protege:org.protege.editor.owl" "org.jgrapht:jgrapht-jdk1.5:0.7.3")) (:bundle "uk.ac.manchester.cs.owl.factplusplus-1.6.5")) :serial t) (pushnew (lambda () (loop for wedge in '("org.osgi.framework.system.packages.extra" "org.osgi.framework.bootdelegation") do (abcl-asdf/osgi:add-to-comma-separated-osgi-config wedge '("com.google.common.collect" "com.google.common.collect.*" "gnu.trove" "gnu.trove.*" "javax.swing" "javax.swing.*" "javax.xml.datatype" "javax.xml.datatype.*" "org.apache.log4j" "org.apache.log4j.*" "org.semanticweb.owlapi.model" "org.semanticweb.owlapi.model.*" "org.semanticweb.owlapi.reasoner" "org.semanticweb.owlapi.reasoner.*" "org.semanticweb.owlapi.reasoner.impl" "org.semanticweb.owlapi.reasoner.impl.*" "org.semanticweb.owlapi.reasoner.knowledgeexploration" "org.semanticweb.owlapi.reasoner.knowledgeexploration.*" "org.semanticweb.owlapi.util" "org.semanticweb.owlapi.util.*" "org.semanticweb.owlapi.vocab" "org.semanticweb.owlapi.vocab.*")))) abcl-asdf/osgi:*before-osgi-starting-hooks*) ----test-osgi.asd------------------------------------------
[edited as I had the comparison backwards] Regarding the exception, did you get the bundle and put it in the same directory as the sysdef? It is at https://github.com/alanruttenberg/lsw2/blob/owlapiv4/owl2/lib/uk.ac.manchester.cs.owl.factplusplus-1.6.5.jar |
That's just my convention for coding, as it makes me more aware of the package abstraction boundaries. |
Yes, I did. There seems to be something missing in the dependency graph, or maybe it is me using java17. Or maybe it is because I am running on an arm64 Mac for which there isn't a native library. Does the factplusplus thunk down to native code? |
If I had to guess, I'd blame java17. I've only tested on 8 and 11. I can't use java17 until I figure out how to get around the restrictions on reflection. I don't know what the status of OSGI in 17 is. One of the benefits of using the bundle is that it deals with packaged native libraries, unpacking the right ones for the architecture into the felix cache and arranging for them to be visible where necessary. I don't have experience with the arm machines but aren't they supposed to emulate x64? Regarding the removal of the hook, all of the bootdelegation and system-packages for all bundles have to be added to *osgi-configuration* before OSGI is initialized and the first bundle added, but after the OSGI code is loaded. Even with the hook, though, I realize that's a problem as one sysdef might load a bundle, initializing OSGI before some other sysdef gets loaded and needs to add something to the config as well. My hook doesn't work for that unless all systems that are going to use bundles are defined before any of them is loaded. Assuming abcl-asdf is loaded by the time my system definitions are means I can execute the config change immediately - the hook doesn't help. If there is more than one system with different needs then I guess the configuration needs to go into .abclrc, or all the system definitions that care need to be loaded before any of the systems are. There's one more thing I noticed that I thought I should bring to your attention, which is the OSGI cache location, which defaults to ~/abcl-felix-cache
Also just noticed that the doc mentions ensure-osgi-framework instead of ensure-osgi-initialized. Re:package abstraction boundaries. Seems a little schizo to, on the one hand go granular on package definitions, but on the other hand not take advantage of all of what the package system brings, such as imports... |
In case it matters: CLASSPATH=/Users/alanr/repos/lsw2/lib/abcl-aio.jar:/Users/alanr/repos/lsw2/lib/postgresql-9.3-1101.jdbc41.jar:/Users/alanr/repos/lsw2/lib/Access_JDBC30.jar:/Users/alanr/repos/lsw2/lib/virtjdbc3.jar:/Users/alanr/repos/lsw2/lib/script-api.jar:/Users/alanr/repos/lsw2/lib/sqlite-jdbc-3.7.2.jar:/Users/alanr/repos/lsw2/lib/mysql-connector-java-5.1.31-bin.jar:/Users/alanr/repos/lsw2/lib/httpserver.jar:/Users/alanr/repos/lsw2/lib/sqljdbc4.jar:/Users/alanr/repos/lsw2/lib/ojdbc7.jar:/Users/alanr/repos/lsw2/lib/asm-all-3.1.jar |
I have your example working better under In any advent, this branch doesn't quite work as We could just redefine these functions when asdf-osgi-bundle is loaded, but I'd rather cleanly abstract OSGI as an additional location for the JSS code to search somehow. Something like a hook I guess, but I feel like we should somehow express |
They do. Not sure what's happening on your side...
|
I'm not sure which question that you are responding to here, but there is no way this current patch works due to the absence of the |
Have a look at https://github.com/easye/abcl/blob/easye/osgi/20211110a/contrib/jss/invoke.lisp and search for `*loaded-osgi-bundles* |
I went to both the links you have in the previous messages and successfully searched for *loaded-osgi-bundles* |
Yes, but they refer to the symbol is in the |
If OSGI is loaded as part of ABCL-ASDF, then the symbols are available and should just be imported into the jss package. Yes we could write something more general, but I don't see the benefit of doing this. Maybe if we land up with a 3rd or 4th mechanism for getting handles on classes it's then worthwhile to find a general solution. |
If OSGI isn't necessarily loaded, at least define its package so the symbols can be shared, and then, if JSS is going to be used without OSGI, protect its use with a boundp check. |
Or, put the shared symbols in a neutral package like ... cl-user. |
@alanruttenberg This is my re-working of your changes for OSGI et. al. that avoids using CL-USER, and doesn't have ABCL-ASDF extend the JSS namespace.
When I try to run the test asdf definition included in the comment to the second patch I get the following bundle resolution problem. Any ideas on what this would be about?