| Summary: | java.lang.UnsatisfiedLinkError on AIX Motif (ppc32) for for libswt-awt-motif-3650.a. | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | stuart pond <Stuart.Pond> | ||||||||
| Component: | SWT | Assignee: | Bogdan Gheorghe <gheorghe> | ||||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||||
| Severity: | critical | ||||||||||
| Priority: | P3 | CC: | akurtakov, eclipse.felipe, gheorghe, grant_gayed | ||||||||
| Version: | 3.6 | ||||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | Other | ||||||||||
| OS: | AIX | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
stuart pond
Can you try your C program but this time make sure that ($java)/jre/bin and ($java)/jre/lib/ppc is in the LD_LIBRARY_PATH. (not that path above can be different on your library, make sure that dir that contains libjawt.a is in the LD_LIBRARY_PATH) We are running java 1.6. The output of java -version is the following: java version "1.6.0" Java(TM) SE Runtime Environment (build pap3260sr8-20100409_01(SR8)) IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc-32 jvmap3260sr8-20100401_55940 (JIT enabled, AOT enabled) J9VM - 20100401_055940 JIT - r9_20100401_15339 GC - 20100308_AA) JCL - 20100408_01 There is no libjawt.a found anywhere under the JRE6 path. There exists a libjawt.so found in the jre\lib\ppc folder. The libjawt.a file can also be found under an older version of Java 1.5 that we are not currently using. So it use to be bundled with Java on AIX. Anyways, I did make sure that jre\lib\ppc folder that containst the libjawt.so was found in the LD_LIBRARY_PATH and re-ran my C program that attempts to dll open the motif library. Error: 0509-022 Cannot load module ./507/1/.cp/libswt-awt-motif-3650.a. 0509-150 Dependent module libjawt.a could not be loaded. 0509-022 Cannot load module libjawt.a. 0509-026 System error: A file or directory in the path name does not exist. 0509-022 Cannot load module ./507/1/.cp/libswt-awt-motif-3650.a. 0509-150 Dependent module ./507/1/.cp/libswt-awt-motif-3650.a could not be loaded. Any other suggestions? Can you use a VM that has the libjawt.a file. Does that work ? Can you try to recompile the SWT using your VM (1.6) ? last hack idea, can you create a symbolic link named libjawt.a that points to libjawt.so. Does that work ? By creating symbolic link between the libjawt.so to libjawt.a my dlopen program got further but it failed to find libjava.so To me the problem looks to be that the AIX SWT libraries were linked against Java 1.5 where the shared objects were *.a files. In Java 1.6 many of those files are now packaged as .so files and thus will not work. Is there anyway we could get a version Motif/AIX libraries liknked against Java 1.6? Do you get any further if you create an archive file named libjawt.a and stuff libjawt.so in there? ("ar -v -q libjawt.a libjawt.so")
Creating a new archive libjawt.a with the libjawt.so does not work. However, I got my C program that does the dlopen the SWT_AWT motif library to successfully load by creating symbolic links for all the java jre .so files to .a and then munging the $LIBPATH environment variable to pick those libraries up first. Obviously this work around will not scale to my RCP application but it clearly demonstrates the problem is Eclipse RCP using the Swing bridge will not work correctly on IBM Java6. How can I a version of AIX32 Motif SWT Jars that are linked against Java6 and not Java5? (In reply to comment #6) > How can I a version of AIX32 Motif SWT Jars that are linked against Java6 and > not Java5? I don't think we can put this change into 3.6.2 build as it will invalidate all the testing that has already being done for the product. Bogdan ? Can you provide a test only version of the SWT plugins that are linked against Java6 so I can validate one way or another the problem goes away in our RCP application We can not change the code in the repository for 3.6.2: http://www.eclipse.org/projects/project-plan.php?planurl=http://www.eclipse.org/eclipse/development/plans/eclipse_project_plan_3_6.xml#target_environments IBM AIX 5.3 Power 32-bit IBM Java 5 SR11 Motif 2.1 We will try to build the plugin for you. Great, but remember I need it for Java 1.6 not Java 1.5 Felipe is right - can't change anything for 3.6.2 which is almost out. I'll try to get the libraries compiled against 6 for you to test. Any luck with getting test version of the libraries compiled against Java 6? Here are the steps I took to build this (in case you need to recompile it on your own): 1. Check out swt and the AIX fragment from the 3_6_maintenance branches 2. Copy .classpath_motif to classpath and change the PI/motif classpath entry attribute to <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="org.eclipse.swt.motif.aix.ppc"/> 3. In org.eclipse.swt tasks folder, edit the build.xml file. Update the build_motif_aix task by changing the JAVA_HOME env var and the AWT_HOME env var to point to the proper Java6 directories. For me this was: JAVA_HOME - [JRE install dir]/sdk/ AWT_HOME - [JRE install dir]/sdk/jre/lib/ppc 4. Since some of the header files got moved around in Java6, you need to add an include in Eclipse SWT PI/motif/make_aix.mak: Add the following line to the CFLAGS section: -I$(JAVA_HOME)/include/aix \ 5. Seems like the AWT_LIBS var needed changing in order to find libjawt.so. Replace the existing AWT_LIBS with: AWT_LIBS = $(AWT_HOME)/libjawt.so -lX11 -bnoentry -bexpall -lc Created attachment 188455 [details]
Libraries linked against Java6
Here is the jar with the libraries.
Thank you for building and providing a patch. However, I am still seeing the same problem. I ran my C program that does a dlopen on the libswt-awt-motif-3659.a file with the right path setup and got the following error. Error: 0509-022 Cannot load module /u/spond/Teamcenter/RAC/9000.0.0/111117112024/org.eclipse.osgi/bundles/483/1/.cp/libswt-awt-motif-3659.a. 0509-150 Dependent module /bluebird/teamswt/swt-builddir/JDKs/AIX/PPC32/sdk/jre/lib/ppc/libjawt.so could not be loaded. 0509-022 Cannot load module /bluebird/teamswt/swt-builddir/JDKs/AIX/PPC32/sdk/jre/lib/ppc/libjawt.so. 0509-026 System error: A file or directory in the path name does not exist. 0509-022 Cannot load module /u/spond/Teamcenter/RAC/9000.0.0/111117112024/org.eclipse.osgi/bundles/483/1/.cp/libswt-awt-motif-3659.a. 0509-150 Dependent module /u/spond/Teamcenter/RAC/9000.0.0/111117112024/org.eclipse.osgi/bundles/483/1/.cp/libswt-awt-motif-3659.a could not be loaded. Note the /bluebird/teamswt/swt-builddir/JDKs/AIX/... I assume that is the hard path to your Java SDK. Is it possible you are building with the wrong parameters to not make it variable? Why is /bluebird/... even in the error output? What would be the best next step from here? Guys, one of our local AIX guru's looked at it and noticed the following: The link line above will never load properly: AWT_LIBS = $(AWT_HOME)/libjawt.so -lX11 -bnoentry -bexpall -lc 1. Have to use -L -l combination to find shared libraries not full path to binary or the runtime loader will not search LIBPATH 2. Need -brtl flag to link to real shared libraries created with .so extension. I imagine that the full path was added to get it link. 3. It is preferred but not required to include -bnolibpath flag so that only shared objects are listed and not their location at build time. AWT_LIBS = -brtl -bnolibpath -bnoentry -bexpall-L$(AWT_HOME) -ljawt.so -lX11 Is it possible for us to get another test patch with trying the above modification to build path? Sure, I can try again with the new settings. Stand by... Just saw a typo in email. I left the .so on for libjawt.so should be -ljawt :( AWT_LIBS should be the following AWT_LIBS = -brtl -bnolibpath -bnoentry -bexpall -L$(AWT_HOME) -ljawt -lX11 Note: it is -ljawt not -ljawt.so Just checking any progress on getting another patch built with the specified parameters? Created attachment 191022 [details]
Makefile for Java6 to link .so instead of .a
Makefile for Java6 to link .so instead of .a
Created attachment 191025 [details]
This is the update to the makefile
We have been successful in building against Java6 using the attached makefile. I do not see how it is possible to dilver a solution that will work with both Java 6 and Java 5 properly given the difference between .so and .a Even though we don't build Motif anymore, this could still be a problem on GTK. SWT no longer provides AIX builds. |