问题描述
在当地机上一切正常,但在64位服务器上出现了下面的问题,开发运行环境和当地机一样:请大家帮帮看看,谢谢!异常:---------------------------------------start-----------------------------------------Exceptioninthread"main"java.lang.IllegalStateException:JNativelibrarynotloaded,sorry!atorg.xvolks.jnative.JNative.<init>(JNative.java:512)atorg.xvolks.jnative.JNative.<init>(JNative.java:440)atcom.test.mediainfo.MediaInfo.New(MediaInfo.java:99)atcom.test.mediainfo.MediaInfo.<init>(MediaInfo.java:88)atcom.test.mediainfo.TestMediaInfoClass.main(TestMediaInfoClass.java:13)
代码如下:packagecom.test.jnative;importorg.xvolks.jnative.JNative;importorg.xvolks.jnative.exceptions.NativeException;importorg.xvolks.jnative.misc.basicStructures.AbstractBasicData;importorg.xvolks.jnative.pointers.Pointer;importorg.xvolks.jnative.pointers.memory.MemoryBlockFactory;/***SystemTime**typedefstruct_SYSTEMTIME{*WORDwYear;*WORDwMonth;*WORDwDayOfWeek;*WORDwDay;*WORDwHour;*WORDwMinute;*WORDwSecond;*WORDwMilliseconds;*}SYSTEMTIME,*/publicclassSystemTimeextendsAbstractBasicData<SystemTime>{publicshortwYear;publicshortwMonth;publicshortwDayOfWeek;publicshortwDay;publicshortwHour;publicshortwMinute;publicshortwSecond;publicshortwMilliseconds;/***分配内存,并返回指针*/publicPointercreatePointer()throwsNativeException{pointer=newPointer(MemoryBlockFactory.createMemoryBlock(getSizeOf()));returnpointer;}/***内存大小*/publicintgetSizeOf(){return8*2;}/***获取通过内存指针解析出结果*/publicSystemTimegetValueFromPointer()throwsNativeException{wYear=getNextShort();wMonth=getNextShort();wDayOfWeek=getNextShort();wDay=getNextShort();wHour=getNextShort();wMinute=getNextShort();wSecond=getNextShort();wMilliseconds=getNextShort();returnthis;}publicSystemTime()throwsNativeException{super(null);createPointer();}publicStringtoString(){returnwYear+"/"+wMonth+"/"+wDay+"at+"+wHour+":"+wMinute+":"+wSecond+":"+wMilliseconds;}publicstaticSystemTimeGetSystemTime()throwsNativeException,IllegalAccessException{//创建对象JNativenGetSystemTime=newJNative("Kernel32.dll","GetSystemTime");SystemTimesystemTime=newSystemTime();//设置参数nGetSystemTime.setParameter(0,systemTime.getPointer());nGetSystemTime.invoke();//解析结构指针内容returnsystemTime.getValueFromPointer();}publicstaticvoidmain(String[]args)throwsNativeException,IllegalAccessException{System.err.println(GetSystemTime());}}
服务器信息如下所示:
解决方案
本帖最后由 myaimit 于 2011-05-18 16:26:29 编辑