System.loadLibrary() and DLL manifest files
Hi,
Has anyone gotten Java WebStart working with VisualStudio 2005 DLL manifest files? That is, it is illegal to load DLLs without having the manifest file visible. Last time I checked, Webstart did not extract native DLLs from JARs until System.loadLibrary() was used -- but this would not work for manifest files.
The only workaround I can think of is embedding the manifest files inside the DLL but this sounds a bit ugly.
A related problem is that if I System.loadLibrary() on library A and it depends on library B which I have never loaded before then this will fail because Webstart did not extract B.
This is related to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6191612
Any ideas?
Gili
The dll is
deployed as part of a J2EE application, and shouldn't
need registering by the regsvr32 program.regsvr32 should have nothing to do with JNI dlls. Unless the dll is also a COM object factory (or what ever the proper name for such a thing is), then regsvr32 should make no difference to its operation.
>
Can anyone explain the difference between the load()
and loadLibrary() methods in detail?They do the same thing, except that for load() you specify the full path to the object and with loadLibrary() you just give its base name and the runtime tries to find it in the java.library.path after adding ".dll" to the name.
You should only call one or the other. Calling both would be an error.
Similar Messages
-
Hello,
Someone please help me. What I am trying to do is load two .DLL files in my program. Program works fine when I
do the following way i.e. I have two .java files and in each I am loading one .DLL file. But I don't want to have
two .java files I want to load both the .DLL files in one program.
**************** Example.java **********
import java.io.*;
import java.util.*;
public class Example
public native int A(String in);
static
System.loadLibrary( "API2" );
public static void main( String args[])
Ex ex = new Ex();
int r;
r = ex.A("TEST");
public Example()
*****************Ex.java*****************
public class exsysml
public native int A(String in);
public exsysml()
System.loadLibrary("API3");
The above way works. But I need only one .java file to load both the .DLL files. i.e.
import java.io.*;
import java.util.*;
public class Example
public native int A(String in);
static
System.loadLibrary( "API2" );
System.loadLibrary( "API3" );
public static void main( String args[])
Example ex = new Example();
int r;
r = ex.A("TEST");
public Example()
but when I do this way it doesn't work and I get a UnSatisfiedLinkage Error at ex.A("TEST"). While doing the top way it works.
How can I fix this to just have one .java file and load both the library files as done in the bottom program but doing this program doesn't work. Any help is appreciated.
Thanks!what I figured out so far is that we can only load one library file in a single class and define all the native methods present in that library in the class where we are loading it. Means we can't load multiple library files in a single class. It's just my thought else if someone provides a better solution. I may be wrong so that's why I need your help.
Thanks -
After I moved, my system reconfigured and I lost files.
I've lost all my files in Documents and all my songs in iTunes. My desktop got reconfigured by itself. It may have happened with a brief power outage. I have a backup hard drive, but where did all the files go from my desktop?
Hi Mark,
Open System Preferences>Accounts, (Users & Groups in 10.8), see if there are other Users listed.
Or in Finder... root of drive?Users, how many there? -
Problem with manifest file and Plateau LMS
I have published a course with a quiz in SCORM 1.2 and tried
to upload to a Plateau LMS.
It seems that a "page cannot be found" message is the result
after upload and we try to launch the course. The course works
outside the LMS (when run locally on my computer).
The Plateau LMS support team tried to help, and found the
following: "There is something wrong with this manifest, though I
cannot ascertain what that is exactly. Most of the file name is in
the parameter field, which is causing the launch path to look like
this:
/content/apmm/cbcgis/mars/BRTMAIN/MARS?BRT%20Maintenance%20Template_%2020080226.htm=
Everything in the parameters field is placed after the
filename in a URLencoded querystring after the question mark that
you see above. it should look like this:
/content/apmm/cbcgis/mars/BRTMAIN/MARS BRT Maintenance
Template_ 20080226.htm"
Can anyone please help resolve this, or have any advice?
This is the first time we have tried uploading Captivate
courses to this LMS, and we have been having problems with the
manifest file in general. I have looked at all the material I can
find on publishing and the manifest file, but cannot seem to
resolve my issue.
Thanks
WarwickWarwick,
I have had this error with an Authorware set of SCORM files
when my LMS was looking for index.htm and I had named it index.html
- you wouldn't think that would cause an error but it did. I would
be more than happy to package a Captivate file of just a few
screens that works on my LMS (which is Learn.com's Learning
Center), and send you the SCORM files to test... That could be a
start anyhow. I will send you a private msg. with my e-mail
id. -
Problems with JAR and manifest files
Hi
I have a simple class MyClass.class (not in a package) which contains:
public static void main( String[] args ) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
new MyClass();
}and a manifest file Manifest.mf which contains:
Manifest-Version: 1.0
Created-By: 1.4.2_08 (Sun Microsystems Inc.)
Main-Class: MyClassand i am using the following line to create a JAR file:
jar -cvmf Manifest.mf MyClass.jar MyClass.classHowever when I try to run the file I get the following error:
Could not find the Main file. Program will exitAnd another one
although this one has an answer it doens't solve mine (I have a line at the end of my manifest) -
I'm trying to get my feet wet with JavaMonkeyEngine using netbeans (on Windows XP SP3, Java 1.6).
When I try to run a simple example program, I'm getting
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl.dll in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
My runtime arguments include: -Djava.library.path="../../../../../projectSupport/jME2/lib/lib/lwjgl/native/windows/:etc
I'm pretty sure that the path is correct, because I tried the following code:
String [] dirs = System.getProperties().getProperty("java.library.path").split(":");
for(int i = 0; i < dirs.length; i++ ){
String path = dirs[i] + java.io.File.separatorChar + "lwjgl.dll";
if( (new java.io.File(path)).exists()) {
System.out.println("found in dir " + dirs);
path = (new java.io.File(path)).getAbsolutePath();
System.load(path);
System.out.println("was able to load library manually");
and the System.load method was reached and didn't throw an exception.
However, the below call does throw an exception.
System.loadLibrary("lwjgl.dll");
Presumably, I shouldn't need to put the dlls into my Path (otherwise whats the purpose of the -D argument).
I would appreciate some brilliant illuminating thought about now, something like "you forgot the magical snafu parameter" or such.
Thanks in advance.
Eric.My runtime arguments include:
-Djava.library.path="../../../../../projectSupport/jME2/lib/lib/lwjgl/native/windows/:{code}So, you're on a Windows OS, and looking for a Windows DLL?
I'm pretty sure that the path is correct, because I tried the following code:
{code}String [] dirs = System.getProperties().getProperty("java.library.path").split(":");{code}So, you're specifying a path using the UNIX separator ':', instead of the Windows one ';'?
Your test code has the knowledge to parse a LINUX-like path, but the Windows VM doesn't have this knowledge (I admit the misleading part is that the VM generally accepts '/' as a file separator (instead of the Windows-standard '\' one), but doesn't recognize the ':' separator). Try using ';' to separate multiple pathes in your command line:
{code}-Djava.library.path="../../../../../projectSupport/jME2/lib/lib/lwjgl/native/windows/;<noticeTheSeparators>;... J.
Edited by: jduprez on Jan 12, 2010 1:39 PM -
UnsatisfiedLinkError System.loadLibrary Windows CE JNI
I am writing a java application for a Siemens SIMpad SL4 (Windows CE 3.0,Jeode EVM 1.9)
I have a dll (mylib.dll) compiled with embedded visual c++ containing native functions.
It is placed in the \windows directory.
When I try to load the dll with System.loadLibrary(), I allways get an java.lang.UnsatisfiedLinkError.
Things I have tried:
System.loadLibrary("mylib");
System.loadLibrary("mylib.dll");
System.loadLibrary("\\windows\\mylib");
System.loadLibrary("\\windows\\mylib.dll");
java -Djava.library.path=\windows ...
Different Directories for the dll (\windows, \, \windows\lib)
Using other "CLASSPATH".
Using other "PATH".
But nothing worked.
When I load a system dll (e.g. smartcard.dll) with System.loadLibrary("smartcard"), the dll
is loaded succesfully. Only "self-compiled" libraries are not loaded.
When I load the dll from a c++ test programm(HINSTANCE handle = LoadLibrary(L"mylib"))
my library is loaded sucessfully.
So it seems to be a java only problem.
Any Ideas ?
ThanksI tried to load different dlls with System.loadLibrary() and used the -verbose option of the jvm.
A preinstalled dll: System.loadLibrary("winscard"); (Which has nothing to do at all with JNI)
The "verbose" said: [Loaded Library \Windows\bin\winscard.dll]
So the library seems to load succesfully.
Another preinstalled dll: System.loadLibrary("finance");
The "verbose" said: [Loaded Library \Windows\bin\finance.dll]
The library loaded ok as well.
A non exisiting dll: System.loadLibrary("nothing");
The result was a "java.lang.UnsatisfiedLinkError nothing.dll; library not found"
An empty test dll created with the dll wizard of embedded visual c++: System.loadLibrary("empty");
(The dll is in the \Windows directory)
The result was a "java.lang.UnsatisfiedLinkError empty.dll; library not found"
A selfmade "JNI" dll: System.loadLibrary("mylib");
The result is again a "java.lang.UnsatisfiedLinkError mylib.dll; library not found"
So I don't think it's a problem with the method names.
Thanks anyway. -
How to create a .f4m manifest files to play .FLV files
I typically use .f4v files for my on demand playback media files, however I converted a .mov to a .flv file... How do I create a .f4m and .m3u8 manifest file that plays .flv files? Below is the code I normally use for the .f4m and .m3u8 files. This works great with .f4v files. I also included my player code. What am I doing wrong? The only difference is I'm using a .flv that I didn't use the f4vpp cleaner on.. That shouldn't give me the parse error I'm getting.
022714.f4m is the name of my .f4m Flash manifest file. Below are the contents.
<manifest xmlns="http://ns.adobe.com/f4m/2.0">
<baseURL>http://IPaddress/hds-vod/</baseURL>
<media href="02-27-14-640-480.f4v.f4m" bitrate="1000"/>
<media href="02-27-14-320-240.f4v.f4m" bitrate="450"/>
</manifest>
022714.m3u8 is the name of my HTML 5 manifest. Below are the contents.
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1000000
http://IPaddress/hls-vod/02-27-14-640-480.f4v.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=450000
http://IPaddress/hls-vod/02-27-14-320-240.f4v.m3u8
Flash multi bit rate player
<object width="448" height="336">
<param value="http://IPADDRESS/strobeplayer/StrobeMediaPlayback.swf" name="movie">
<param value="src=http%3A%2F%2FIPADDRESS%2Fvod%2F022714.f4m&streamType=recorded&autoPlay =false" name="flashvars">
<param value="true" name="allowFullScreen">
<param value="always" name="allowscriptaccess">
<param value="direct" name="wmode"><embed src="http://216.37.94.194/strobeplayer/StrobeMediaPlayback.swf" type="application/x-shockwave-flash" flashvars="src=http%3A%2F%2FIPADDRESS%2Fvod%2F022714.f4m&streamType=recorded&auto Play=false" wmode="direct" allowfullscreen="true" allowscriptaccess="always" height="336" width="448"></object>
HTML5 player
<p style="text-align: center;"><a href="http://IPaddress/vod/022714.m3u8"><img alt="" src="/portals/0/Silver-Play-Button.jpg" style="width: 150px; height: 151px;" />to create a file in appl server you have to use open dataset and close data set..
see the sample code
REPORT zanid_test MESSAGE-ID zz .
parameters: FULLPATH(128) obligatory lower case
default 'E:\usr\sap\put\file.txt'.
*you change the appl sever path as per your config.
DATA : BEGIN OF list_asc OCCURS 0,
msg(300) TYPE c,
END OF list_asc.
start-of-selection.
*---populating data
list_asc-msg = 'abcdefghijkl'. "your sample data
append list_asc.
list_asc-msg = 'faagoaagiagig'. "your sample data
append list_asc.
OPEN DATASET fullpath FOR OUTPUT IN TEXT MODE.
LOOP AT LIST_ASC.
TRANSFER LIST_ASC-MSG TO fullpath.
CLEAR LIST_ASC-MSG.
ENDLOOP.
CLOSE DATASET fullpath.
now if you go to appl server , you will find that file in that specified path..
to create a directory yu can go to transaction AL11 and click the 'konfigurieren'button, you then you can specify the directory attibutes to create a directory
and to load a file from your loacl pc to appl server you can use transaction CG3Y also, instead of the abap code.
plz rewrad points if it helps you. -
Manifest file: Help needed
Hi everyone,
We have a java app that includes in its install package some JRE components.
We use to put these JREs under jre a subdirectory of the App main DIR at this point everything works fine and the manifest file looks like:
Manifest-Version: 1.0
Main-Class: mycompany.DIR1.MAINCLASSNAME
Class-Path: .\jre\lib\jh.jar
Created-By: 1.2.2 (Sun Microsystems Inc.)
The problem with this approach is when you install more than one copy you will duplicate also the JRE components (some 15 Megs).
To avoid these duplications we decided to put the JREs in a common directory such as <WINDIR> (WINNT / Windows)
to do so the manifest file has to be updated to reflect the jh.jar path.
I tried a hard coded path: Class-Path: e:\WINNT\jre\lib\jh.jar and got this error:
Exception in thread "main" java.lang.NoClassDefFoundError: mycompany/DIR1/MAINCLASSNAME
by removing the class-path line I got the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/help/HelpSetException at mycompany.DIR1.MAINCLASSNAME.main(MAINCLASSNAME.java:30)
Please help,
any idea or suggestions are appreciated.
Thanks,
dobject.You could try a CLASSPATH along the lines of e:\WINNT\jre\lib\jh.jar;.
Note, though, that you're throwing a lot of portability away. -
Problem: DLL written in CVI ( for usage with teststand) depends on another DLL, written in MSVC++2008. When trying to use the CVI-DLL in TestStand in fails to find msvcr90.dll. Even after I've ensured that MSVC++2008 redistributables ( 32bit ) are installed.
Problem seems to be that MSVC++2008 runtime is installed as "Side by Side Assembly" into winsxs directory and therefore some hints in form of a manifest file are needed to find the right runtime.
I'am not sure, where i can/have to use the manifest file. Does the MSVC++2008 DLL has to be distributed with the manifest ( either embedded or as seperate file) . Or can I create also a manifest for the CVI-DLL and where I can find documentation for doing so ?
Solved!
Go to Solution.The manifest file should be in the DLL built in VC. This VC DLL is the one that depends on the 'side-by-side' msvcr90.dll and so must have a manifest declaring this dependency. The CVI DLL has nothing to do with this issue and does not need any manifest - putting a manifest in the CVI DLL would not help. By default, VC automatically embed the manifest when it builds the DLL - so it should already be there in the VC DLL. You can see the manifest by opening the DLL in VC resource editor and looking in the RT_MANIFEST resource section.
I think the most likely cause of your problem is that the manifest in your VC DLL points to a different version/build of msvcr90 DLL - this could be because:
1) You are using a debug build. The VC redistributable only installs release build of msvc90.dll and this is different from the debug flavor of msvcr90.dll. Solution: use a release build of your VC DLL.
2) You have a newer msvcr90 DLL on your developement machine (may be because of some patch) but you are installing an older redistributable on the target machine. If so, try patching your target machine. I think 1 is more likely than 2. -
1. how Do I solve this issue.
2. How do I ensure that i do not lose my playlists along with the songs.
3. What is the procedure needed to be followed.Ok, I had a glitch, forced to restart, and lost my train of thought.
Reinstalling iTunes should fix the major issue that might have gone wrong, perhaps your explaination points will disappear and everything will be peachy again.
But if they don't, you can open the XML file in iTunes Folder using a Text edit program to see what the common pathname is to the iTunes Music folder or where your content is located.
If you moved the itunes folder, it needs to go back.
I can't download iTunes to my Vista virtual machine to test it out right now because iTunes is down, so I can't verify the pathname, perhaps your issue and the iTunes being down are related somehow?
You don't want to import all your music again, but it's a option, but you lose all your playlists, that's what I'm trying to recover.
If oyu don't have a whole lot of playlists, then simply select all the explaimation point music and delete, select File from the menu and import your itunes folder again. -
Access jar's and dll's whithin a single jar file???
Hello everybody!
I am building an application which is dependent on external jar and dll files. I would like to put these external files in my project jar, and in runtime I want to set the path to these files located in my project jar. Is this possible? I have tried this:
structure in my project jar:
-myApp.jar
+META-INF
-myApp
-Main.class
external.jar
external.dll
and in my manifest file:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.2
Created-By: 1.4.2_01-b06 (Sun Microsystems Inc.)
Main-Class: myApp.Main
Class-Path: /external.jarWhen I try to run my application jar with:
java -jar myApp.jarI get "java.lang.NoClassDefFoundError" .....
i.e. the WM does not find my external jar.
My question now: Is it possible to do things this way? That is to put dependent jars and dlls INSIDE the "running" jar????
Hope someone can help me...
Best regards
TMYou cannot put a JAR inside a JAR - Java won't be able to find the files in the packaged JAR.
What you could do is unpack the myApp.jar and external.jar and include the directory structure inside your own project.jar.
It will not work with a DLL inside the JAR. There's no way around it - the DLL must be a file in the file system, otherwise Windows will not be able to load it (Windows doesn't know what JAR files are, and it can't load a DLL that's inside a JAR file). -
I'm trying to download the new version of itunes. durig the install i get a message that I need to verify that I have sufficient privilege. Then I get a message of a Windows error 126 and a missing file MSVCR 80.dll. I've tried everything on the support site and nothing works.
Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features (later)
Remove all of these items in the following order:
iTunes
Apple Software Update
Apple Mobile Device Support (if this won't uninstall move on to the next item)
Bonjour
Apple Application Support
Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
The uninstall and reinstall process will preserve your iTunes library and settings, but ideally you would back up the library and your other important personal documents and data on a regular basis. See this user tip for a suggested technique.
Please note:
Some users may need to follow all the steps in whichever of the following support documents applies to their system. These include some additional manual file and folder deletions not mentioned above.
HT1925: Removing and Reinstalling iTunes for Windows XP
HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
tt2 -
Hello,
I have a Java Web Start application that runs fine if the application is only 1 .jar file.
But I have a need to also run C++ .exe and .dll file from my Java application.
I wonder if someone could please tell me how to package/include C++ .exe and
.dll files in my Java web start application?
Thank you and Best Regards,
AkinoYou need to place the EXE and DLLs inside the jar.
Java cannot execute them from the jar. They have to be extracted (see Class.getResourceAsStream) from the jar and copyied into the target machine file system, perahps to the temp directory. Now you can execute them using Runtime.exec() or ProcessBuilder.start().
Edited by: baftos on Jan 14, 2011 6:49 PM -
i updated firefox and now I can't access the net on any browser. Wireless router everything is connected and up and running. Just not the browsers. uninstalled it, reinstalled it (didn't work), unistalled it again and internet explorer won't work either (not at anypoint after intial update was run. read several peoples simalr problems with the "could not read chrome manifest file" issue and solutions to no avail. uninstall and system restore did not work either. What did it change on my system, and how can I change it back?
Do a clean (re-)install:
Download a fresh Firefox copy and save the file to the desktop.
* Firefox 4.0.x: http://www.mozilla.com/en-US/firefox/all.html
* Uninstall your current Firefox version and remove the Firefox program folder before installing that copy of the Firefox installer.
* Do not remove personal data if you uninstall the current version.
* It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
* It may not be necessary to create a new profile, so first try if it works with your current profile and if not then create a new profile.
Your bookmarks and other profile data are stored elsewhere in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder] and won't be affected by a reinstall, but make sure that you do not select to remove personal data if you uninstall Firefox.
* http://kb.mozillazine.org/Standard_diagnostic_-_Firefox
Maybe you are looking for
-
Hello, I have a problem with comma and point in a double-digit. I use a english driver for HM8142. When I get the values then I only get int-digits. How can I change "Use comma as separator" . I tried to change the option in LabVIEW. I changed it, th
-
Apple is slowly loosing me as a valued customer. I attempted to update to the latest version of iTunes (11.1.4.62) for my desktop W7 service pack 1 64 bit PC. It would not upgrade it even told me that the install verson was incorrectly installed.
-
How Do I Stop Bookmark Syncing Across Macs
My husband and I both have our own Apple IDs. He has a Macbook Pro and I have a Macbook Air. I need to be able to access his purchased music and movies so we used his Apple ID to login to iTunes on my Macbook Air. This worked fine. But even through I
-
What is a table containing sales order and the contract it refers to
Hi, I have a following problem (ECC6.0): A sales order is created in VA03 and referenced to a contract. I need to locate the table or tables (or FM) which contains the information of the sales order number and the contract number. Problem with VA03 i
-
Video sharing with cc connection?
After all this "pro video" update (btw, I love what adobe is releasing) I'm wondering if creative files will accept also video uploads for client review. Also, files is still missing some basic features like folder sharing....