Problem with 3rd party jars in repository
Tuesday, 15 December 2015 · 3 messages · last reply 22 Dec 2015
EJ
E. Wray Johnson15 Dec 2015 15:58 #
I have a 3rd party jar which is open source, which has no startup eligible classes.
The classes I need to use have class names (not package name) that are all lower case. This seems to be a problem for BaseX.
So, I tried to create a wrapper class, and the wrapper class loads but BaseX cannot load the dependent 3rd party jar no matter what I try. I have even tried putting the jar in the basex\lib folder.
I have been able to install my wrapper class and run it successfully, but when I include the 3rd party jar, I get "Module not initialized" for the classes in the 3rd party jar because they are in another package. I have tried packaging everything into one jar, but that did not help. I have added a main class to the manifest of the 3rd party jar and it loaded fine but I cannot include the namespace in my xquery. My example is similar to the FOP.jar example on the file server, however I do not see query ussage example of this example. I have not yet tried the expath-pkg.xml route.
CG
Christian Grün16 Dec 2015 08:40 #
Quoted text · E. Wray Johnson · 1 line
> I have even tried putting the jar in the basex\lib folder.
This should work – as long as you start BaseX with the start scripts.
I think we’ll need a little, ideally self-contained example of your wrapper class and XQuery code to guess what may go wrong.
Quoted text · E. Wray Johnson · 8 lines
> I have been able to install my wrapper class and run it successfully, but > when I include the 3rd party jar, I get "Module not initialized" for the > classes in the 3rd party jar because they are in another package. I have > tried packaging everything into one jar, but that did not help. I have > added a main class to the manifest of the 3rd party jar and it loaded fine > but I cannot include the namespace in my xquery. My example is similar to > the FOP.jar example on the file server, however I do not see query ussage > example of this example. I have not yet tried the expath-pkg.xml route.
CG
To the list: The problem has been fixed.
To E. Wray: I have revisited our Java bindings code: With 8.4, among other unifications, Java namespaces will not be rewritten anymore if they are prefixed with "java:" [1]. This allows you to also address Java code that does not follow the Java naming conventions.
A new snapshot is online [2].
Cheers,
Christian
[1] http://docs.basex.org/wiki/Java_Bindings
[2] http://files.basex.org/releases/latest/
Quoted text · E. Wray Johnson · 16 lines
On Tue, Dec 15, 2015 at 2:58 PM, E. Wray Johnson <wray.johnson at gmail.com> wrote: > I have a 3rd party jar which is open source, which has no startup eligible > classes. > The classes I need to use have class names (not package name) that are all > lower case. This seems to be a problem for BaseX. > So, I tried to create a wrapper class, and the wrapper class loads but BaseX > cannot load the dependent 3rd party jar no matter what I try. > I have even tried putting the jar in the basex\lib folder. > I have been able to install my wrapper class and run it successfully, but > when I include the 3rd party jar, I get "Module not initialized" for the > classes in the 3rd party jar because they are in another package. I have > tried packaging everything into one jar, but that did not help. I have > added a main class to the manifest of the 3rd party jar and it loaded fine > but I cannot include the namespace in my xquery. My example is similar to > the FOP.jar example on the file server, however I do not see query ussage > example of this example. I have not yet tried the expath-pkg.xml route.
Written for BaseX 8.3. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery