Loading different versions of Linux native libraries - question

I need to package libXm.so, libXm.so.2 and libXm.so.2.1 for a JWS application.
Q: How do I use System.loadLibrary() to load libXm.so.2 and libXm.so.2.1 from within a JWS application?
System.loadLibrary("Xm"); // loads libXm.so from root of JAR file.
�yvind

I dont like this either - its a last resort really :)The whole System.loadLibrary()/nativelib business is a bit ...
I'm loading a library that might pull in libXm.so, libXm.so.2 or libXm.so.2.1. I don't have a way of telling which.
AFAICT, I need to load all three of them. Thats 2MB/library.
Hopefully loading libXm.so.* that are not used is at least harmless.
I'm left with the feeling that although this might work, it is not the way it is intended to be done.
�yvind

Similar Messages

  • Load different versions of Help depending on user's OS?

    Is it possible to have different versions of Help load depending on the user's OS?
    For example, if a user is accessing from a PC then they would load the AIR Help version, but if they were accessing from a Mac then they would load the HTML version.
    Is this something that is handled on our database end, or would it be a feature of Adobe RoboHelp Server?

    Try this link if you want to see how browser based help will look on MACs and Apple hardware.
    http://www.grainge.org/demos/bbair/
    Your developers would need to create a sniffer to ascertain the OS of the user's device and then route to the required help. That is not built into RoboHelp and RoboHelp Server will not assist with this one.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Dynamically load different versions of client jar

    Hello,
    My application needs to simultaneously support different versions of an RMI app. How to dynamically load the proper version of the client jar to connect with the same version of the server. Say Server versions are sv1.0, sv 1.1, sv 2.0 and clients are cl1.0, cl1.1, cl2.0. How to dyncamically load cl1.0 in my application so as to connect with sv1.0, similarly cl1.1 with sv1.1
    Will having a different classloader for each of the client jars, solve the problem?
    Can someone direct me/suggest on how to handle this.
    I appreciate your help and thanks for your time.

    Try this link if you want to see how browser based help will look on MACs and Apple hardware.
    http://www.grainge.org/demos/bbair/
    Your developers would need to create a sniffer to ascertain the OS of the user's device and then route to the required help. That is not built into RoboHelp and RoboHelp Server will not assist with this one.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Confusion about third-party-libraries in different versions in CE 71.

    Hi
    After some research on the use of different versions of third-party-libraries in SAP netweaver CE 7.1, I am actually quite confused and would be happy if someone could shed a light on that subject....
    1. Is there a way to tell netweaver CE 7.1 to use a library in my WEB-INFlib-folder by simple configuration?
    E.g. we would like to use a third-party-lib in a newer version than the one which is loaded by CE 7.1. Many application server provide a simple configuration option (e.g inside META-INFapplication.xml) where the web as can be forced to use the library inside WEB-INFlib for this application.
    2.Is the concept of "heavy loading" described in a blog by Georgi Danov(Using Hibernate in SAP NetWeaver Composition Environment) the answer to question 1.?
    Does it also work for other third-party-libraries than hibernate? Does it work at all?
    3. In the blog mentioned in question 2, Mr. Danov is talking about "shared libraries". Does this mean, that I have to forget everything about "bundled" and "standard" libraries explained in help.sap.com/CE, if I want to create a heavy loader?
    He is referencing another blog (Applications and shared libraries) which is two years old? Can I still apply the information there to CE?
    4. Are "Bundled libraries" applicable when using different versions of third-party-libraries in CE 7.1?
    In "Working with libraries" (http://help.sap.com/saphelp_nwce10/helpdata/en/44/f4e00e56ec0486e10000000a155369/frameset.htm) it says:
    "Bundled libraries: These provide resources only to a single enterprise application, and are packed inside the application's EAR file."
    =>As I want to provide the lib only to my enterprise application, I will probably have to create a bundled library, right? Does this also work if netweaver CE 7.1 uses a different version of the same library?
    5. Do I need Netweaver Developer Studio for creating "bundled" libraries?
    Or can I copy the binaries in the WEB-INFlib-folder of my application, deploy it and use it?
    6. Is configuration of application-j2ee-engine.xml the right place to reference a third-party-library in a specific version which exists in WEB-INF/lib-folder in my application even if it exists also in another version on netweaver?
    => In the document "Troubleshooting: Finding Missing Parent-Child Relations" it says: "To implement the chain of parent-child relations in the deployment descriptor of the component, use either application-j2ee-engine.xml (for applications) or provider.xml (for libraries and services)."
    => "Creating standard libraries" (http://help.sap.com/saphelp_nwce10/helpdata/en/44/f447a8d62b0484e10000000a155369/frameset.htm9 tells me, that I have to configure the file application-j2ee-engine.xml, too.
    => But in "Working with libraries" (http://help.sap.com/saphelp_nwce10/helpdata/en/44/f4e00e56ec0486e10000000a155369/frameset.htm) it says:
    "Standard libraries: These provide resources to all enterprise applications deployed on the server. They are packed in EAR files like the enterprise applications."
    => Does this mean, that I have to force Netweaver CE 7.1 to use a higher version of a certain third-party-library? Does this even work? Do all applications deployed on Netweaver 7.1 have to use this library in the higher version?
    It is really confusing to read through the documentation!!! Sorry for that avalanche of questions, but I really hope it will make the issue of using libraries (especially if they exist in different versions on the CE 7.1) a little clearer!
    Best regards
    Bettina

    Hi Bettina,
    I'll try to answer your questions:
    >
    > Hi
    >
    > After some research on the use of different versions of third-party-libraries in SAP netweaver CE 7.1, I am actually quite confused and would be happy if someone could shed a light on that subject....
    >
    > 1. Is there a way to tell netweaver CE 7.1 to use a library in my WEB-INFlib-folder by simple configuration?
    >
    > E.g. we would like to use a third-party-lib in a newer version than the one which is loaded by CE 7.1. Many application server provide a simple configuration option (e.g inside META-INFapplication.xml) where the web as can be forced to use the library inside WEB-INFlib for this application.
    >
    First of all, the appropriate docs are here: [http://help.sap.com/saphelp_nwce10/helpdata/en/44/f4e00e56ec0486e10000000a155369/frameset.htm|http://help.sap.com/saphelp_nwce10/helpdata/en/44/f4e00e56ec0486e10000000a155369/frameset.htm].
    Basically what you do is define a lib project in the studio and deploy it do the server. This may be less comfortable then just configuring manually, therefore it work better in larger environments because the server checks that libs are available in all running instances - which it could not do if you manipulate diretories manually  (an approach you should never attempt in any SAP envrionment)
    > 2.Is the concept of "heavy loading" described in a blog by Georgi Danov(Using Hibernate in SAP NetWeaver Composition Environment) the answer to question 1.?
    >
    > Does it also work for other third-party-libraries than hibernate? Does it work at all?
    >
    If Georgi describes it, I hope so, as he is one of our developers who knows best.
    > 3. In the blog mentioned in question 2, Mr. Danov is talking about "shared libraries". Does this mean, that I have to forget everything about "bundled" and "standard" libraries explained in help.sap.com/CE, if I want to create a heavy loader?
    >
    "shared" are all of theses libs, as otherwise they would be specific to an application.
    > He is referencing another blog (Applications and shared libraries) which is two years old? Can I still apply the information there to CE?
    >
    This was about anearly version of CE and even Georgi updated the blog this year to talk about slight differences. So yes, this still applies.
    > 4. Are "Bundled libraries" applicable when using different versions of third-party-libraries in CE 7.1?
    >
    > In "Working with libraries" (http://help.sap.com/saphelp_nwce10/helpdata/en/44/f4e00e56ec0486e10000000a155369/frameset.htm) it says:
    >
    > "Bundled libraries: These provide resources only to a single enterprise application, and are packed inside the application's EAR file."
    >
    > =>As I want to provide the lib only to my enterprise application, I will probably have to create a bundled library, right? Does this also work if netweaver CE 7.1 uses a different version of the same library?
    >
    That depends... Your application uses it's own classloader which means it should only use your libs in case there is another version available on the server. But if you're trying to deploy a lib that is used by a service of the server (int that case loaded by the server not your classloader!) I'm not so sure.
    > 5. Do I need Netweaver Developer Studio for creating "bundled" libraries?
    >
    > Or can I copy the binaries in the WEB-INFlib-folder of my application, deploy it and use it?
    >
    You need the Studio. No way around that. [Edit:] Sorry, misunderstood you here: I thought you want to copy something into the deployed directory on the server! - Of course, any deployment method would do it and though copying binaries seems to be valid. However,  I'm checking this currently with development in detail.
    > 6. Is configuration of application-j2ee-engine.xml the right place to reference a third-party-library in a specific version which exists in WEB-INF/lib-folder in my application even if it exists also in another version on netweaver?
    >
    > => In the document "Troubleshooting: Finding Missing Parent-Child Relations" it says: "To implement the chain of parent-child relations in the deployment descriptor of the component, use either application-j2ee-engine.xml (for applications) or provider.xml (for libraries and services)."
    >
    > => "Creating standard libraries" (http://help.sap.com/saphelp_nwce10/helpdata/en/44/f447a8d62b0484e10000000a155369/frameset.htm9 tells me, that I have to configure the file application-j2ee-engine.xml, too.
    >
    > => But in "Working with libraries" (http://help.sap.com/saphelp_nwce10/helpdata/en/44/f4e00e56ec0486e10000000a155369/frameset.htm) it says:
    >
    > "Standard libraries: These provide resources to all enterprise applications deployed on the server. They are packed in EAR files like the enterprise applications."
    >
    > => Does this mean, that I have to force Netweaver CE 7.1 to use a higher version of a certain third-party-library? Does this even work? Do all applications deployed on Netweaver 7.1 have to use this library in the higher version?
    >
    >
    >
    > It is really confusing to read through the documentation!!! Sorry for that avalanche of questions, but I really hope it will make the issue of using libraries (especially if they exist in different versions on the CE 7.1) a little clearer!
    >
    > Best regards
    > Bettina
    Could you tell me what you're trying to deploy? I'll try to get Georgi on this....
    Regards,
    Benny
    Edited by: Benny Schaich-Lebek on Nov 5, 2008 1:40 PM

  • Running executables that have been compiled with different versions of a same vi

    I am writing a LabVIEW 7 program on Windwos (NT 4.0 up through XP) that will have to simultaneously call and run at least two executable modules. Both of these modules will be written using some of the same utility vis from my user libraries. How can I run the two modules if they have each been compiled using different versions of the utility libraries (i.e. the two executables will have vis with the same name but with slightly different code)?
    I know i could dynamically call each vi by reference node, but that can get a bit cumbersome with dozens of vis...

    Hi meludwig,
    Unfortunately, LabVIEW keeps track of the different VIs in memory using the VI's name. Therefore, if you want to load multiple executables that use the same VIs but with different code, you will want to rename those VIs. LabVIEW cannot distinguish between 2 VIs with the same name but with different code. Dynamically calling the VIs using VI Server, like you mentioned, will also potentially cause problems because the executables might try to load same VI name into LabVIEW memory at a time and this will still causes problems.
    My suggestion would therefore to be to rename the utility VIs to another name and save it as a custom subVI in that program. Then, make sure to include that custom subVI in the App Builder executable and you should b
    e golden.
    Kileen C.
    NI

  • Parent class loaders are not searched for native libraries?

    I'm loading a native library in the default system classloader. I think create several new children of the default class loader and instantiate some new objects in those child classloaders. The problem is that those new objects get a LinkUnsatisfiedError when they try to call the native methods.
    I was under the impression that ClassLoaders would delegate native method class to their parent class loader, the same way that they do when searching for class definition. This is confirmed by this quote from http://java.sun.com/docs/books/jni/html/design.html:
    "Because each class loader maintains a set of native libraries, the programmer may use a single library to store all the native methods needed by any number of classes as long as those classes have the same defining loader."
    I'm in a serious catch-22 here, because I cannot load the native library in the child classloaders (native libs are not allowed to be loaded by multiple class loaders), and I need to put the objects in a separate classloader. What is the solution?

    i.getClass().getResourceAsStream("/hello.txt"); //this should be disallowedWhy is getting a resource so bad? It puts a dependency on a module, but in a plugin system, dependencies should be supported. Netbeans platform supports this same thing. I use image resources from some core modules at my own risk. If you really want to block it, override the getResource method of URLClassLoader to block unwanted resource fetching. You will have to use the SecurityManager, AccessController, ProtectionDomain, and AccessControlContext and I'm not going to tell you how ;)
    i.getClass().newInstance(); //something even worseNot possible to block without package private constructors or similar restrictions as above.

  • Loading different library versions

    Hi all,
    I'm developing an application that detects a specific hardware, then loads the jar file appropriate for that hardware version.
    My question is: How do I load multiple versions of a jar file in a single app? The idea is that the app spawns multiple threads. Each thread handles one hardware and uses the appropriate jar version.

    Why do you need separate jars for each version? Is the Java code different for each version, or just the native libraries?
    If it's Java code you're worried about and the jars do not overlap classes, there's no problem here.

  • Using native libraries in web application (weblogic on linux)

    I have a problem with loading native libraries for use with my web application. Where do I have to put them in order for the server to see them? The same app on windows runs perfectly fine, because it has no problems finding the dll files.
              So far I have tried modifying the weblogic startup scripts, to include the library in LD_LIBRARY_PATH environment variable. I've also tried modifying the security policy just in case, but I don't think it's the case, because like I said, the app ran fine on windows without messing with the policies. So, any ideas, how I could load the libraries?
              The system is a WebLogic 8.1SP4 installed on Linux i386 using JRockit JVM, the native library in question is JAI 1.1.3-alpha native acceleration library.
              PS. if it's in the wrong group, please direct me to the correct one.

    <p>Fukiku,</p>
              <p>Did you get this working?</p>
              <p>You can also try setting the environment variable java.library.path.</p>
              <p>Please post your stack trace to the forum as well.</p>
              <p>
              Hussein Badakhchani</br>
              </p>

  • Loading native libraries

    Hi,
    The other day a came across an UnsatisfiedLinkError with the message "... already loaded in another classloader". I saw the JNI specification states a native library is only permitted to be loaded by a single classloader. My question is why is this the case? What if I have two indipendent applications running on the same JVM instance, and both rely on the same native library? the problem with these native libraries is that there is no classloader delegation architecture when loading one(as there is with java classes), the library will always be loaded by the calling classes' classloader. So what can a developer do? What is the idea behind this behavior?
    Any help is appreciated....

    Thanks for your answers,
    The thing is -
    1) I don't really want to load the library again, I
    simply wish there will be no exception if I attempt to
    load it again from a different classloader. After all,
    what does it matter from which classloader i try to
    load the library? If it is the same classloader the
    method will simply return as if it loaded the lib
    succesfully(even though it didn't since it detected
    it's already loaded), why should there be any
    difference if it's not the same classloader? the
    library is already loaded anyway, all classes in the
    JVM instance will have access to it anyway....Write the code so that it checks for the already loaded exception.
    2) What if I one of my applications is a "third party"
    app in which I cannot change the code to load the
    library through my "library loader"?You are probably out of luck.
    Although I would question why you would want a third party library used by mutliple applications to be individually loaded. In J2EE containers the database drivers are loaded outside the class loaders probably for similar reasons.

  • Can client dynamically link to shared libraries for different versions ?

    Can Oracle client dynamically link to Oracle shared libraries if the versions are different ?
    Hi:
    I apologize for this newbie question:
    We are using PRO C to generate the client C code.
    We can compile both dynamic and static versions of our Oracle client.
    Our question is:
    is it possible to compile a dynamically linked Oracle client in say version 10.1.0.2 and actually run the application against say version 8.1.7.0 environment ?
    That is, can an Oracle client dynamically link to the Oracle shared libraries if the versions are different ?
    If it is possible, then how to modify the makefile
    to enable Oracle client to reference different versions
    of shared libraries ?
    Thanks
    JL

    What you describe is not supported.

  • Standalone OC4J 9.0.4 - Loading Native Libraries - Unsatisfied Link Error

    Hello,
    I incidentally happen to have a similar problem as has been described in several posts in this forum. The problem is that of loading Native libraries in OC4J.
    The scenario is
    1) Environment is Standalone OC4J 9.0.4, Windows 2000, JDK 1.4.2
    2) A Java wrapper loads DLL1 which internally loads DLL2.
    (To be more specific the DLL1 is a SAPSSOEXT.DLL and the DLL2 is SAPSECU.DLL. These are used for establishing SSO with SAP portal)
    The phase-1 of Java wrapper loading DLL1 is achieved by setting either the PATH or the java.library.path variables.
    The phase-2 of DLL1 loading DLL2 is what is failing with an Unsatisfied Link Error.
    Since I am using a standalone version and not a OC4J app-server, the OPMN related configuration for specified PATH variables will not be relevant here. Is there any other place where I can configure these.
    regards
    Shivaram

    A small correction to my observation above.
    The call to load DLL1 via System.loadLibrary() is successful. However when I attempt to call any method on it it fails with UnsatisfiedLinkError.
    Contrary to what was written above the error occured even before DLL1 attempted to load DLL2.
    So why is it that the call to loadLibrary is successful but the call to actual function is failing? (This works flawlessly on the command line)
    Is this a path problem, if so how do I configure it in OC4J standalone. Variables PATH, java.library.path, LD_LIBRARY_PATH none of them seem to have any effect on this.
    I tried debugging using a windows file monitor. The library DLL1 is being read from the correct path and is being opened successfully.
    Any suggestions will be greatly appreciated.

  • Differing behavior loading external swfs between Linux and Windows

    I have a swf that loads several different swfs that implement the same basic class, some of these external
    swfs also import different resources from library swfs, such as font, video, and graphic assets.
    This seems to work perfectly well on both windows and Linux with using the font and graphic assets in
    the flash player (debug v 10r32), everything works as I'd expect.  I am added everything into the main swf's
    appdomain when using the loader (with loadercontext, etc).
    When I am loading the video asset class in the external swfs, it works fine on both systems for the first swf
    loaded that uses the video class.  On windows, whenever the second swf using the video library loads up, it
    gives a #1065 Reference error pointing to one of the variables used in the video asset swf.  It runs fine on Linux.
    I've tried playing around with the different AppDomain settings to no avail.  I am stumped as to why it would
    function perfectly well in Linux, but fail on Windows.  Any pointers as to where to look next?
    Thanks for any and all help,
    RP.

    In this case, it appears to be differing versions of the flexsdk that was being used to compile the application.
    Windows was using the default tarball from the adobe site,
    Linux was using a more up to date version from svn.
    I updated the svn snapshot, recompiled, set the Windows box to use it, and the error messages have disappeared.
    I can still crash the flashplayer doing other things, but it's more or less working exactly as expected now.
    RP.

  • Master iPad configurator question concerning cart syncing with different versions of iPads.

    I have a question concerning configurator syncing.Can the master iPad be a different version of iPad than the other synced iPads? For instance can iPad 2 be the master iPad to a group of iPad Air's? The iPad 2 has some fewer capabilities than the Air, would some settings or restrictions be left off of the iPad Airs if they were set up this way?  Thanks.

    There is no such thing as 'master iPad'.  If you're using Configurator or Profile Manager control of the setup is done from a Macintosh.

  • Two libraries needing different versions of a common library

    I am currently writing an application that utilizes two libraries that depend on a third common library. However, each of the two libraries requires a different version of the third library. Is there any way this can be done?
    I have done some research into writing custom class loaders but I haven't been able to find anything useful in this instance. Any help would be appreciated. Thanks.

    It's not just a feature missing that's the problem.
    If I use one version of the library, one part of the
    program simply doesn't work. If I use the other,
    then the other part of the program refuses to work.The problem you should be trying to solve is why the two libraries won't work with the same (latest) version of the shared library. It indicates that one of them is relying on buggy behavior, and should be fixed.
    Do you have any access to the libraries' source code? You'd be far better off trying to figure out what changed, and how to fix the piece that relied on its old behavior, rather than any sort of hack (and changing package structure to work around a bug is definitely a hack, perhaps moreso than using a custom classloader).
    Finally, what does "doesn't work" mean? Are you unable to compile? Are you able to compile but get incorrect results? Does the program crash?

  • [Java 3D] Wich OpenGL versions are supported by natives libraries ?

    Hi,
    anyone could tell me which OpenGL specifications are supported by Java 3D natives libraries ?
    Thanks in advance.

    Hi,
    Java 3D requires at least OpenGL 1.2. It runs on all newer releases up to the current release 4.1 and will run on future versions. Java 3D creates an OpenGL compatibility profile context supporting the (legacy) fixed function pipeline as well as the OpenGL Shading Language GLSL.
    Java 3D's on-screen and off-screen rendering capabilities correspond to OpenGL 2.0 and support vertex and fragment shaders inclusive newest shading language features. On my OpenGL 3.2/DirectX 10 capable graphics device I successfully ran GLSL 1.5 features, see http://www.java.net/forum/topic/javadesktop/java-desktop-technologies/java-3d/shaders-java-3d-0 .
    August

Maybe you are looking for