Native methods in MIDlet lib
My Midlet uses a third-party lib zip file which has native methods in it. When I built my midlet in SUN's WTK2.0, I got this error message:
ERROR: native methods should not appear
Error preverifying ....
Build failed
If you know the possible solution, pls tell me at [email protected]
Thanks!
Sorry I forgot to add something. WTK2.1 would not
complain "native" but in order for your native access
function to work, you have to implement some bridge
between native functions and your java native access
functions. Those implementation should be done in the
phone code.Hi there lisaran,
I tried to install the WTK 2.1_1 for linux, but the installation is corrupted it seems. Did you work on WTK on linux or on windows. Actually, even I am having the same problem. I have native methods declared in the java code. I use KNI to further the calls to a proprietary c code library.
Thanks in anticipation.
regards...
Similar Messages
-
is it possible to use native methods within MIDlet, working with J2ME?
on www.jguru.com they say:"For both size and security reasons, JNI is not supported by the J2ME CLDC."
-
Hi guys,
i am trying to call a native method from my java code, but i am getting this following error,
# An unexpected error has been detected by HotSpot Virtual Machine:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x052bd55f, pid=2740, tid=3884
# Java VM: Java HotSpot(TM) Client VM (1.5.0_07-b03 mixed mode, sharing)
# Problematic frame:
# C [F3BC1ENG.DLL+0xd55f]
In the log file,
# An unexpected error has been detected by HotSpot Virtual Machine:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x052bd55f, pid=2740, tid=3884
# Java VM: Java HotSpot(TM) Client VM (1.5.0_07-b03 mixed mode, sharing)
# Problematic frame:
# C [F3BC1ENG.DLL+0xd55f]
--------------- T H R E A D ---------------
Current thread (0x03b26e50): JavaThread "httpWorkerThread-8080-0" daemon [_thread_in_native, id=3884]
siginfo: ExceptionCode=0xc0000005, reading address 0x05e71000
Registers:
EAX=0x31304443, EBX=0x05d048f0, ECX=0x0c4c0d16, EDX=0x05e70000
ESP=0x2c76ef38, EBP=0x2c76f034, ESI=0x05e71000, EDI=0x05d06d20
EIP=0x052bd55f, EFLAGS=0x00010213
Top of Stack: (sp=0x2c76ef38)
0x2c76ef38: 00000001 052a9264 2c76f228 052a92a4
0x2c76ef48: 01190002 00000000 00000000 00000000
0x2c76ef58: 00000000 ffffffff 00000002 05d05d38
0x2c76ef68: 00000000 00000000 00000000 00000000
0x2c76ef78: ffffffff 7c9106eb 00000004 00000000
0x2c76ef88: 00000000 00000000 00000000 00000000
0x2c76ef98: 00000000 00000000 00000000 00000000
0x2c76efa8: 00000000 052bf3e1 2c76efd4 0000101f
Instructions: (pc=0x052bd55f)
0x052bd54f: 00 8b 7c 24 2c 8b 4a 18 8d 72 18 8b c1 c1 e9 02
0x052bd55f: f3 a5 8b c8 eb 16 8b b4 24 bc 00 00 00 8b 7c 24
Stack: [0x2c670000,0x2c770000), sp=0x2c76ef38, free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [F3BC1ENG.DLL+0xd55f]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j palmsecuresdk.sample.PvsAuthenticationJNI.identifyMatch(I[BLjava/util/List;ILjava/util/List;)I+0
j packService.palmsImpl.identify([B)Ljava/lang/String;+55
j packService.palmsSEI_Tie.invoke_identify(Lcom/sun/xml/rpc/server/StreamingHandlerState;)V+50
j packService.palmsSEI_Tie.processingHook(Lcom/sun/xml/rpc/server/StreamingHandlerState;)V+58
j com.sun.xml.rpc.server.StreamingHandler.handle(Lcom/sun/xml/rpc/spi/runtime/SOAPMessageContext;)V+819
j com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+394
j com.sun.enterprise.webservice.JAXRPCServlet.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+139
j javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+139
j javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+30
j org.apache.catalina.core.ApplicationFilterChain.servletService(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/Servlet;Lorg/apache/catalina/util/InstanceSupport;)V+93
j org.apache.catalina.core.StandardWrapperValve.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)I+644
j org.apache.catalina.core.StandardPipeline.doInvoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+77
j org.apache.catalina.core.StandardPipeline.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+3
j org.apache.catalina.core.StandardContextValve.invokeInternal(Lorg/apache/catalina/Wrapper;Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)I+238
j org.apache.catalina.core.StandardContextValve.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)I+252
j org.apache.catalina.core.StandardPipeline.doInvoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+77
j com.sun.enterprise.web.WebPipeline.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+53
j org.apache.catalina.core.StandardHostValve.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)I+89
j org.apache.catalina.core.StandardPipeline.doInvoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+77
j com.sun.enterprise.web.VirtualServerPipeline.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+149
j org.apache.catalina.core.ContainerBase.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+6
j org.apache.catalina.core.StandardEngineValve.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)I+58
j org.apache.catalina.core.StandardPipeline.doInvoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+77
j org.apache.catalina.core.StandardPipeline.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+3
j org.apache.catalina.core.ContainerBase.invoke(Lorg/apache/catalina/Request;Lorg/apache/catalina/Response;)V+6
j org.apache.coyote.tomcat5.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V+296
j com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter()V+19
j com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(Ljava/io/InputStream;Ljava/io/OutputStream;)Z+15
j com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(Ljava/io/InputStream;Ljava/io/OutputStream;)Z+25
j com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask()Z+74
j com.sun.enterprise.web.connector.grizzly.ReadTask.doTask()V+161
j com.sun.enterprise.web.connector.grizzly.TaskBase.run()V+1
j com.sun.enterprise.web.connector.grizzly.WorkerThread.run()V+22
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x037aec00 JavaThread "AWT-Windows" daemon [_thread_in_native, id=2664]
0x0376bb10 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=4020]
0x03a526c0 JavaThread "Thread-25" daemon [_thread_blocked, id=2508]
0x03a3b8e8 JavaThread "Timer-5" daemon [_thread_blocked, id=2260]
0x03a51e18 JavaThread "Timer-4" [_thread_blocked, id=2192]
0x035bae38 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[server].StandardContext[__JWSappclients]]" daemon [_thread_blocked, id=2548]
0x035fac10 JavaThread "httpWorkerThread-4848-1" daemon [_thread_blocked, id=3492]
0x03786530 JavaThread "httpWorkerThread-4848-0" daemon [_thread_blocked, id=1952]
0x035fa9e8 JavaThread "SelectorThread-4848" [_thread_in_native, id=408]
0x03576828 JavaThread "httpWorkerThread-8181-1" daemon [_thread_blocked, id=1964]
0x0356ee10 JavaThread "httpWorkerThread-8181-0" daemon [_thread_blocked, id=3476]
0x00c29278 JavaThread "SelectorThread-8181" [_thread_in_native, id=3512]
0x03acb208 JavaThread "httpWorkerThread-8080-1" daemon [_thread_blocked, id=3472]
=>0x03b26e50 JavaThread "httpWorkerThread-8080-0" daemon [_thread_in_native, id=3884]
0x03bea780 JavaThread "SelectorThread-8080" [_thread_in_native, id=1500]
0x03606198 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv]]" daemon [_thread_blocked, id=3788]
0x03b57620 JavaThread "SingleSignOnExpiration" daemon [_thread_blocked, id=3528]
0x03b5fb58 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[server].StandardContext[]]" daemon [_thread_blocked, id=3480]
0x03c03d58 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[server].StandardContext[newPalmService]]" daemon [_thread_blocked, id=3524]
0x03629bf0 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[server].StandardContext[palmSecure_ws]]" daemon [_thread_blocked, id=3560]
0x03acbee8 JavaThread "SingleSignOnExpiration" daemon [_thread_blocked, id=2308]
0x0374f418 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[__asadmin].StandardContext[]]" daemon [_thread_blocked, id=2708]
0x03601a88 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[__asadmin].StandardContext[web1]]" daemon [_thread_blocked, id=2284]
0x03b4e748 JavaThread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[__asadmin].StandardContext[asadmin]]" daemon [_thread_blocked, id=680]
0x037e4ac8 JavaThread "Timer-3" [_thread_blocked, id=2100]
0x03a97b08 JavaThread "RMI RenewClean-[192.168.10.19:1464]" daemon [_thread_blocked, id=2080]
0x037a7f38 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=1580]
0x03a4a050 JavaThread "RMI TCP Accept-8686" daemon [_thread_in_native, id=1316]
0x0379ccd0 JavaThread "Thread-15" [_thread_blocked, id=316]
0x03771d20 JavaThread "Thread-14" [_thread_blocked, id=228]
0x0376bcf0 JavaThread "Thread-13" [_thread_blocked, id=436]
0x0373d2a8 JavaThread "RMI LeaseChecker" daemon [_thread_blocked, id=904]
0x0373aa68 JavaThread "RMI RenewClean-[192.168.10.19:1429,com.sun.enterprise.admin.server.core.channel.LocalRMIClientSocketFactory@ac4d3b]" daemon [_thread_blocked, id=2320]
0x00c66dd0 JavaThread "Timer-2" daemon [_thread_blocked, id=1512]
0x038e3350 JavaThread "Timer-1" [_thread_blocked, id=2272]
0x03a4ac60 JavaThread "Thread-10" [_thread_in_native, id=4052]
0x03a6fc88 JavaThread "Thread-8" [_thread_in_native, id=1052]
0x03a43818 JavaThread "Thread-7" [_thread_in_native, id=2600]
0x03a1e808 JavaThread "Thread-6" [_thread_in_native, id=1648]
0x03a1ac20 JavaThread "GC Daemon" daemon [_thread_blocked, id=4084]
0x03a52e18 JavaThread "RMI Reaper" [_thread_blocked, id=144]
0x03a52c30 JavaThread "Timer-0" daemon [_thread_blocked, id=208]
0x03a3d730 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=2044]
0x00c17020 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3456]
0x00c15bf0 JavaThread "CompilerThread0" daemon [_thread_blocked, id=4064]
0x00c14ed8 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=4060]
0x00c0fd90 JavaThread "Finalizer" daemon [_thread_blocked, id=4044]
0x00c0e8c0 JavaThread "Reference Handler" daemon [_thread_blocked, id=2436]
0x0032df88 JavaThread "main" [_thread_blocked, id=1532]
Other Threads:
0x00bdc778 VMThread [id=4028]
0x00c31a20 WatcherThread [id=4068]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
def new generation total 11712K, used 4051K [0x06a70000, 0x07720000, 0x11510000)
eden space 10432K, 27% used [0x06a70000, 0x06d435b0, 0x074a0000)
from space 1280K, 90% used [0x075e0000, 0x077017d8, 0x07720000)
to space 1280K, 0% used [0x074a0000, 0x074a0000, 0x075e0000)
tenured generation total 25784K, used 15468K [0x11510000, 0x12e3e000, 0x26a70000)
the space 25784K, 59% used [0x11510000, 0x1242b290, 0x1242b400, 0x12e3e000)
compacting perm gen total 26880K, used 26785K [0x26a70000, 0x284b0000, 0x2aa70000)
the space 26880K, 99% used [0x26a70000, 0x28498618, 0x28498800, 0x284b0000)
ro space 8192K, 67% used [0x2aa70000, 0x2afcd9f8, 0x2afcda00, 0x2b270000)
rw space 12288K, 46% used [0x2b270000, 0x2b813808, 0x2b813a00, 0x2be70000)
Dynamic libraries:
0x00400000 - 0x00406000 D:\Sun\AppServer\lib\appserv.exe
0x7c900000 - 0x7c9b0000 C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f4000 C:\WINDOWS\system32\kernel32.dll
0x77c10000 - 0x77c68000 C:\WINDOWS\system32\MSVCRT.dll
0x6d730000 - 0x6d8c7000 C:\Program Files\Java\jdk1.5.0_07\jre\bin\client\jvm.dll
0x77d40000 - 0x77dd0000 C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f56000 C:\WINDOWS\system32\GDI32.dll
0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f01000 C:\WINDOWS\system32\RPCRT4.dll
0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll
0x6d2f0000 - 0x6d2f8000 C:\Program Files\Java\jdk1.5.0_07\jre\bin\hpi.dll
0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL
0x00a10000 - 0x00a27000 C:\Program Files\Common Files\Logishrd\LVMVFM\LVPrcInj.dll
0x6d700000 - 0x6d70c000 C:\Program Files\Java\jdk1.5.0_07\jre\bin\verify.dll
0x6d370000 - 0x6d38d000 C:\Program Files\Java\jdk1.5.0_07\jre\bin\java.dll
0x6d720000 - 0x6d72f000 C:\Program Files\Java\jdk1.5.0_07\jre\bin\zip.dll
0x6d530000 - 0x6d543000 C:\Program Files\Java\jdk1.5.0_07\jre\bin\net.dll
0x71ab0000 - 0x71ac7000 C:\WINDOWS\system32\WS2_32.dll
0x71aa0000 - 0x71aa8000 C:\WINDOWS\system32\WS2HELP.dll
0x71a50000 - 0x71a8f000 C:\WINDOWS\System32\mswsock.dll
0x76f20000 - 0x76f47000 C:\WINDOWS\system32\DNSAPI.dll
0x76fb0000 - 0x76fb8000 C:\WINDOWS\System32\winrnr.dll
0x76f60000 - 0x76f8c000 C:\WINDOWS\system32\WLDAP32.dll
0x76fc0000 - 0x76fc6000 C:\WINDOWS\system32\rasadhlp.dll
0x04220000 - 0x04248000 C:\WINDOWS\system32\rsaenh.dll
0x769c0000 - 0x76a73000 C:\WINDOWS\system32\USERENV.dll
0x5b860000 - 0x5b8b4000 C:\WINDOWS\system32\netapi32.dll
0x6d550000 - 0x6d559000 C:\Program Files\Java\jdk1.5.0_07\jre\bin\nio.dll
0x662b0000 - 0x66308000 C:\WINDOWS\system32\hnetcfg.dll
0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll
0x6d520000 - 0x6d528000 C:\Program Files\Java\jdk1.5.0_07\jre\bin\management.dll
0x6d670000 - 0x6d676000 C:\Program Files\Java\jdk1.5.0_07\jre\bin\rmi.dll
0x6d070000 - 0x6d1d7000 C:\Program Files\Java\jdk1.5.0_07\jre\bin\awt.dll
0x73000000 - 0x73026000 C:\WINDOWS\system32\WINSPOOL.DRV
0x76390000 - 0x763ad000 C:\WINDOWS\system32\IMM32.dll
0x774e0000 - 0x7761c000 C:\WINDOWS\system32\ole32.dll
0x73760000 - 0x737a9000 C:\WINDOWS\system32\ddraw.dll
0x73bc0000 - 0x73bc6000 C:\WINDOWS\system32\DCIMAN32.dll
0x73940000 - 0x73a10000 C:\WINDOWS\system32\D3DIM700.DLL
0x6d2b0000 - 0x6d2ef000 C:\Program Files\Java\jdk1.5.0_07\jre\bin\fontmanager.dll
0x7c9c0000 - 0x7d1d4000 C:\WINDOWS\system32\shell32.dll
0x77f60000 - 0x77fd6000 C:\WINDOWS\system32\SHLWAPI.dll
0x773d0000 - 0x774d2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
0x5d090000 - 0x5d127000 C:\WINDOWS\system32\comctl32.dll
0x05290000 - 0x0529a000 C:\WINDOWS\system32\PvsApiJv.dll
0x052a0000 - 0x052ac000 D:\Java Project\PalmSecure\src\dll\PvFw.dll
0x052b0000 - 0x052dc000 D:\Java Project\PalmSecure\src\dll\F3BC1ENG.DLL
0x052e0000 - 0x0531f000 D:\Java Project\PalmSecure\src\dll\F3BC4CAP.DLL
0x05320000 - 0x05344000 D:\Java Project\PalmSecure\src\dll\F3BC4COM.DLL
0x73dd0000 - 0x73ece000 C:\WINDOWS\system32\MFC42.DLL
0x05c50000 - 0x05cf7000 D:\Java Project\PalmSecure\src\dll\F3BC4MAT.DLL
VM Arguments:
jvm_args: -client -Xmx512m -XX:NewRatio=2 -Dcom.sun.aas.defaultLogFile=D:/Sun/AppServer/domains/domain1/logs/server.log -Djava.endorsed.dirs=D:/Sun/AppServer/lib/endorsed -Djava.security.policy=D:/Sun/AppServer/domains/domain1/config/server.policy -Djava.security.auth.login.config=D:/Sun/AppServer/domains/domain1/config/login.conf -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.rmi.dgc.client.gcInterval=3600000 -Djavax.net.ssl.keyStore=D:/Sun/AppServer/domains/domain1/config/keystore.jks -Djavax.net.ssl.trustStore=D:/Sun/AppServer/domains/domain1/config/cacerts.jks -Djava.ext.dirs=C:/Program Files/Java/jdk1.5.0_07/jre/lib/ext;D:/Sun/AppServer/domains/domain1/lib/ext;D:/Sun/AppServer/javadb/lib -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver -Djavax.management.builder.initial=com.sun.enterprise.admin.server.core.jmx.AppServerMBeanServerBuilder -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory -Dcom.sun.enterprise.taglibs=appserv-jstl.jar,jsf-impl.jar -Dcom.sun.enterprise.taglisteners=jsf-impl.jar -Dcom.sun.aas.classloader.optionalOverrideableChain=appserv-ws.jar,commons-logging.jar,commons-launcher.jar -Dcom.sun.aas.classloader.appserverChainJars=admin-cli.jar,admin-cli-ee.jar,dbschema.jar,j2ee-svc.jar -Dcom.sun.aas.classloader.serverClassPath.ee=%HADB_HOME%/lib/hadbjdbc4.jar,D:/Sun/AppServer/lib/SUNWjdmk/5.1/lib/jdmkrt.jar,%HADB_HOME%/lib/dbstate.jar,%HADB_HOME%/lib/hadbm.jar,%HADB_HOME%/lib/hadbmgt.jar,D:/Sun/AppServer/lib/SUNWmfwk/lib/mfwk_instrum_tk.jar -Dcom.sun.aas.configName=server-config -Ddomain.name=domain1 -Djmx.invoke.getters=true -Dcom.sun.aas.promptForIdentity=true -Dcom.sun.aas.classloader.optionalOverrideableChain.ee= -Dcom.sun.aas.instanceRoot=D:/Sun/AppServer/domains/domain1 -Dcom.sun.aas.domainName=domain1 -Dcom.sun.aas.classloader.sharedChainJars=javaee.jar,C:/Program Files/Java/jdk1.5.0_07/lib/tools.jar,install/applications/jmsra/imqjmsra.jar,commons-launcher.jar
java_command: <unknown>
Launcher Type: generic
Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk1.5.0_07
CLASSPATH=C:\PROGRA~1\JMF21~1.1E\lib\sound.jar;C:\PROGRA~1\JMF21~1.1E\lib\jmf.jar;C:\PROGRA~1\JMF21~1.1E\lib;C:\Program Files\Java\jdk1.5.0_07\jre\lib;.
PATH=C:/Program Files/Java/jdk1.5.0_07\jre\bin\client;D:\Sun\AppServer\lib;D:\Sun\AppServer\lib;C:\Program Files\Java\jdk1.5.0_07\bin;.;C:\WINDOWS\system32;C:\WINDOWS;D:\Sun\AppServer\lib;D:\Sun\AppServer\bin;D:\Sun\AppServer\lib;D:\Sun\AppServer\bin;C:\Sun\share\lib;C:\Sun\share\bin;C:\PROGRA~1\Java\JDK15~2.0_0\bin;C:\Sun\MessageQueue\lib;C:\Sun\MessageQueue\bin;c:\oracledb\product\10.2.0\db_2\bin;D:\oracle\product\10.2.0\db_1\bin;c:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\wamp\php;C:\wamp\Apache\GnuWin32\bin;d:\Program Files\Microsoft SQL Server\90\Tools\binn\;D:\Java Project\PalmSecure\src\dll;D:\Java Project\PalmSecure\src\Lib;.;D:\Sun\AppServer\bin;;C:\Sun\AppServer;C:\Program Files\Java\jdk1.5.0_07\bin;C:\Program Files\Cvsnt;C:\Program Files\CVSNT\;D:\Java Project\PalmSecure\src\dll;D:\Java Project\PalmSecure\src\Lib;
USERNAME=subbu.chandrasekaran
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 15 Model 44 Stepping 2, AuthenticAMD
--------------- S Y S T E M ---------------
OS: Windows XP Build 2600 Service Pack 2
CPU:total 1 family 47, cmov, cx8, fxsr, mmx, sse, sse2
Memory: 4k page, physical 457904k(42684k free), swap 3464136k(2905608k free)
vm_info: Java HotSpot(TM) Client VM (1.5.0_07-b03) for windows-x86, built on May 3 2006 01:04:38 by "java_re" with MS VC++ 6.0
what is the reason for this one....?
In my case, whenever the user has clicked the Identify button then the native method Identify should be called. That time it's working fine.
But once the user has clicked the Enroll button, then first the Identify native method should be called, based upon the result, the enroll() native method will be called. I am getting the error whenever i am clicking the Enroll button.
while clicking the Identify button i didn't get any such error....
What would be the reason?
someone pls clear my doubt.
--SubbuYou have a bug in your C code, and are attempting to access memory location 0.
Look for an unitialized pointer. -
What's wrong about native method?
when I call c navtive method under the Solorais 8 and JDK 1.4.2.
what's wrong?why??
Unexpected Signal : 11 occurred at PC=0xFE0EEA28
Function=[Unknown. Nearest: JVM_IsSupportedJNIVersion+0x988]
Library=/usr/j2sdk1.4.2/jre/lib/sparc/client/libjvm.so
Current Java thread:
at jp.co.dir.am.faimsam.G02F_NativeJniPrt.JNI_BG_trsMrktName(Native Method)
at jp.co.dir.am.faimsam.print.core.creater.G02IF007.exeSimple(G02IF007.java:70)
at jp.co.dir.am.faimsam.print.core.controller.PrintGenerator.process(Unknown Source)
at jp.co.dir.am.faimsam.print.core.controller.Handler.handlePrint(Unknown Source)
at jp.co.dir.am.faimsam.print.web.WebWorker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:534)
Dynamic libraries:
0x10000 java
0xff350000 /usr/lib/libthread.so.1
0xff390000 /usr/lib/libdl.so.1
0xff200000 /usr/lib/libc.so.1
0xff330000 /usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1
0xfe000000 /usr/j2sdk1.4.2/jre/lib/sparc/client/libjvm.so
0xff2e0000 /usr/lib/libCrun.so.1
0xff1e0000 /usr/lib/libsocket.so.1
0xff100000 /usr/lib/libnsl.so.1
0xff0d0000 /usr/lib/libm.so.1
0xff1c0000 /usr/lib/libsched.so.1
0xff310000 /usr/lib/libw.so.1
0xff0a0000 /usr/lib/libmp.so.2
0xff040000 /usr/j2sdk1.4.2/jre/lib/sparc/native_threads/libhpi.so
0xfe7d0000 /usr/j2sdk1.4.2/jre/lib/sparc/libverify.so
0xfe790000 /usr/j2sdk1.4.2/jre/lib/sparc/libjava.so
0xfe760000 /usr/j2sdk1.4.2/jre/lib/sparc/libzip.so
0xfe490000 /usr/lib/locale/ja/ja.so.2
0xfe590000 /usr/lib/locale/ja/methods_ja.so.2
0xfddb0000 /usr/j2sdk1.4.2/jre/lib/sparc/libnet.so
0xfdd90000 /usr/j2sdk1.4.2/jre/lib/sparc/libnio.so
0xfc3d0000 /usr/lib/librt.so.1
0xfc3b0000 /usr/lib/libaio.so.1
0xfc390000 /usr/lib/libsendfile.so.1
0xfc2c0000 /home1/fam/apl/print/lib/libG02JB.so
Heap at VM Abort:
Heap
def new generation total 2112K, used 244K [0xf1400000, 0xf1620000, 0xf1b10000)
eden space 2048K, 8% used [0xf1400000, 0xf142d138, 0xf1600000)
from space 64K, 100% used [0xf1610000, 0xf1620000, 0xf1620000)
to space 64K, 0% used [0xf1600000, 0xf1600000, 0xf1610000)
tenured generation total 1408K, used 326K [0xf1b10000, 0xf1c70000, 0xf5400000)
the space 1408K, 23% used [0xf1b10000, 0xf1b61a00, 0xf1b61a00, 0xf1c70000)
compacting perm gen total 4096K, used 2740K [0xf5400000, 0xf5800000, 0xf9400000)
the space 4096K, 66% used [0xf5400000, 0xf56ad168, 0xf56ad200, 0xf5800000)
Local Time = Tue Sep 9 15:25:56 2003
Elapsed Time = 14
# HotSpot Virtual Machine Error : 11
# Error ID : 4F530E43505002EF 01
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
# Java VM: Java HotSpot(TM) Client VM (1.4.2-b28 mixed mode)
# An error report file has been saved as hs_err_pid19029.log.
# Please refer to the file for further information.I dont know if it actually helps, but following the link
http://www.cs.pub.ro/~gaburici/nstomcat/diss.html#solpre
there are some problems mentioned that still seem to be in Java for Linux/Unix.
Try to set
LD_PRELOAD=/usr/j2sdk1.4.2/jre/lib/sparc/client/libjvm.so
before you start the program.
(I assume you loaded the library via dlopen)
Hope it works... -
UnsatisfiedLinkError, Load Library Successfully, Native Method Not Found
I am using JNI to call a ".dll" file I made on windows.
I got the exception:
Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: com.aspectgaming.core.io.JniInnocore.Dpci.waitEvent(Ljava/lang/Object;J)I
at com.aspectgaming.core.io.JniInnocore.Dpci.waitEvent(Native Method)
at com.aspectgaming.core.io.JniInnocore.IDLPThread.run(IDLPThread.java:19)
at java.lang.Thread.run(Unknown Source)
The code for loading c dll library:
URL url = Thread.currentThread().getContextClassLoader().getResource("");
String baseClassPath = url.getPath();
System.load(baseClassPath "com/aspectgaming/libjnidpcicore.dll");+
The ".dll" file is already loaded, because when I changed the dll file name to any other ones, a "library file not found" exception will be caught.
The problem is Dpci.waitEvent and all the native methods could not be found.
I used a PE viewer to view the dll exports I got:
Export table
Characteristics=0, TimeDateStamp=1237366066, MajorVersion=0, MinorVersion=0, Name=36994, Base=1, NumberOfFunctions=9, NumberOfNames=9, AddressOfFunctions=36904, AddressOfNames=36940, AddressOfNameOrdinals=36976,
TimeDateStamp:Wed Mar 18 16:47:46 GMT+08:00 2009
Java_com_aspectgaming_core_io_JniInnocore_Dpci_getEventName@12 (Ordinal: 1, Entry Point RVA: 147ah (5,242))
Java_com_aspectgaming_core_io_JniInnocore_Dpci_getNumOfEvents@8 (Ordinal: 2, Entry Point RVA: 11a5h (4,517))
Java_com_aspectgaming_core_io_JniInnocore_Dpci_getNumOfInputPorts@12 (Ordinal: 3, Entry Point RVA: 1789h (6,025))
Java_com_aspectgaming_core_io_JniInnocore_Dpci_getSramSize@8 (Ordinal: 4, Entry Point RVA: 1190h (4,496))
Java_com_aspectgaming_core_io_JniInnocore_Dpci_readEvent@12 (Ordinal: 5, Entry Point RVA: 11bah (4,538))
Java_com_aspectgaming_core_io_JniInnocore_Dpci_readPort@12 (Ordinal: 6, Entry Point RVA: 17a7h (6,055))
Java_com_aspectgaming_core_io_JniInnocore_Dpci_waitEvent@20 (Ordinal: 7, Entry Point RVA: 14b8h (5,304))
Java_com_aspectgaming_core_io_JniInnocore_Dpci_waitIOPort@24 (Ordinal: 8, Entry Point RVA: 17dbh (6,107))
Java_com_aspectgaming_core_io_JniInnocore_Dpci_writePort@16 (Ordinal: 9, Entry Point RVA: 182ch (6,188))
The java class "Dpci" is exactly in this package : com.aspectgaming.core.io.JniInnocore;
I compiled it by gcc on linux as a ".so" file and everything is working on linux.
On windows I am compiling this by Mingw gcc.
Here is the make file on Windows which is used by Mingw32-make:
dpci_core:
gcc -o ../../../java/com/aspectgaming/libjnidpcicore.dll -shared -IC:\jdk1.6.0_10\include -IC:\jdk1.6.0_10\include\win32 -I'D:\Program Files\Innocore Gaming Ltd\DirectPCI SDK & Run-time\include' dpci_core.c libdpci_static.lib
dpci_core.c is my code file and libdpci_static.lib is the library that my c dll will depend on.
Any thought to this UnsatisfiedLinkError exception problem?
Thanks!I recompile my codes under visual c++ 2008 express on Windows XP professional, and I have already got rid of this problem.
But when I move the compiled java jar application to windows xp embedded edition, an exception will be caught:
C:\AspectGamingCore>java -jar Aspect.jar
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\AspectGamingCore\l
ib\libjnidpcicore.dll: This application has failed to start because the applicat
ion configuration is incorrect. Reinstalling the application may fix this proble
m
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.aspectgaming.core.io.JniInnocore.Dpci.loadLibraryOnWindows(Unknow
n Source)
at com.aspectgaming.core.io.JniInnocore.DpciTest.main(Unknown Source)
I don't know if there is any compatible problem bewteen xp and xpe but one possible reason is that xpe may be lack of some dll files like msvcr90.dll.
So I tried to compile the dll as static library in vc++2008, but this does not run even on my winxp professional:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\AspectGamingCore\l
ib\libjnidpcicore.dll: %1 is not a valid Win32 application
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.aspectgaming.core.io.JniInnocore.Dpci.loadLibraryOnWindows(Unknow
n Source)
at com.aspectgaming.core.io.JniInnocore.DpciTest.main(Unknown Source)
Could JNI call a c static library? Why it says "not a valid Win32 application"? -
Problems with c++ native methods
hello to all ,
I am building an client-server application in java , which uses java native methods written
in c++ .In every client's request , the applcation updates a hashtable .The hashtable is kept as an
Object member variable in a java class .So updating the hashtable is like this : the native method is
called which accesses the Object member variable , updates the hashtable and sets the new Object
member variable value.
That's the way that it should work ,but i am experiencing some serious problems because the jvm
keeps on crashing with UNEXCPECTED SIGNAL 11 .My distribution is Mandrake 9.0 ,and i use java
j2sdk1.4.1_01
Here some very naive questions i have to ask :
1.Is it possible that the jvm crashes because the size of the hashtable is not fixed ?
2.Can it be a system problem (like libgcc ) or else ?
Any opinion on this would be very helpful
Thanks in advance ,
Sbile
P.S. Here the log file being created after every crash
Unexpected Signal : 11 occurred at PC=0x404657B6
Function=is_forwarded__C7oopDesc+0x6
Library=/usr/local/j2sdk1.4.1_01/jre/lib/i386/client/libjvm.so
Dynamic libraries:
08048000-0804e000 r-xp 00000000 03:06 463913 /usr/local/j2sdk1.4.1_01/bin/java
0804e000-0804f000 rw-p 00005000 03:06 463913 /usr/local/j2sdk1.4.1_01/bin/java
40000000-40011000 r-xp 00000000 03:06 278533 /lib/ld-2.2.5.so
40011000-40012000 rw-p 00010000 03:06 278533 /lib/ld-2.2.5.so
40013000-4001c000 r-xp 00000000 03:06 119905 /usr/local/j2sdk1.4.1_01/jre/lib/i386/native_threads/libhpi.so
4001c000-4001d000 rw-p 00008000 03:06 119905 /usr/local/j2sdk1.4.1_01/jre/lib/i386/native_threads/libhpi.so
4001e000-40021000 r--s 00000000 03:06 447528 /usr/local/j2sdk1.4.1_01/jre/lib/ext/dnsns.jar
40021000-40022000 r--s 00000000 03:06 198504 /usr/lib/kaffe/lib/microsoft.jar
40022000-4002f000 r-xp 00000000 03:06 573447 /lib/i686/libpthread-0.9.so
4002f000-40036000 rw-p 0000d000 03:06 573447 /lib/i686/libpthread-0.9.so
40036000-40038000 r-xp 00000000 03:06 278544 /lib/libdl-2.2.5.so
40038000-40039000 rw-p 00001000 03:06 278544 /lib/libdl-2.2.5.so
40039000-40150000 r-xp 00000000 03:06 573443 /lib/i686/libc-2.2.5.so
40150000-40155000 rw-p 00117000 03:06 573443 /lib/i686/libc-2.2.5.so
40159000-40471000 r-xp 00000000 03:06 119911 /usr/local/j2sdk1.4.1_01/jre/lib/i386/client/libjvm.so
40471000-40625000 rw-p 00317000 03:06 119911 /usr/local/j2sdk1.4.1_01/jre/lib/i386/client/libjvm.so
40635000-40646000 r-xp 00000000 03:06 278548 /lib/libnsl-2.2.5.so
40646000-40647000 rw-p 00011000 03:06 278548 /lib/libnsl-2.2.5.so
40649000-4066b000 r-xp 00000000 03:06 573445 /lib/i686/libm-2.2.5.so
4066b000-4066c000 rw-p 00021000 03:06 573445 /lib/i686/libm-2.2.5.so
4066c000-4067c000 r-xp 00000000 03:06 119915 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libverify.so
4067c000-4067e000 rw-p 0000f000 03:06 119915 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libverify.so
4067e000-4069f000 r-xp 00000000 03:06 119916 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libjava.so
4069f000-406a1000 rw-p 00020000 03:06 119916 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libjava.so
406a1000-406b6000 r-xp 00000000 03:06 119918 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libzip.so
406b6000-406b8000 rw-p 00014000 03:06 119918 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libzip.so
406b8000-41d86000 r--s 00000000 03:06 119961 /usr/local/j2sdk1.4.1_01/jre/lib/rt.jar
41dc9000-41de0000 r--s 00000000 03:06 119941 /usr/local/j2sdk1.4.1_01/jre/lib/sunrsasign.jar
41de0000-41e51000 r--s 00000000 03:06 119943 /usr/local/j2sdk1.4.1_01/jre/lib/jsse.jar
41e51000-41e64000 r--s 00000000 03:06 119942 /usr/local/j2sdk1.4.1_01/jre/lib/jce.jar
41e64000-42120000 r--s 00000000 03:06 119959 /usr/local/j2sdk1.4.1_01/jre/lib/charsets.jar
441c8000-441ca000 r--s 00000000 03:06 198471 /usr/lib/kaffe/lib/comm.jar
441ca000-441cc000 r--s 00000000 03:06 198505 /usr/lib/kaffe/lib/pjava.jar
441cc000-441d0000 r--s 00000000 03:06 185441 /usr/local/j2sdk1.4.1_01/lib/servlet.jar
4c3d3000-4c3fe000 r--p 00000000 03:06 212998 /usr/share/locale/ISO-8859-15/LC_CTYPE
4c3fe000-4c40c000 r--s 00000000 03:06 447534 /usr/local/j2sdk1.4.1_01/jre/lib/ext/ldapsec.jar
4c40d000-4c416000 r-xp 00000000 03:06 278554 /lib/libnss_files-2.2.5.so
4c416000-4c417000 rw-p 00008000 03:06 278554 /lib/libnss_files-2.2.5.so
4c61b000-4c638000 r--s 00000000 03:06 447527 /usr/local/j2sdk1.4.1_01/jre/lib/ext/sunjce_provider.jar
4c638000-4c6d7000 r--s 00000000 03:06 447529 /usr/local/j2sdk1.4.1_01/jre/lib/ext/localedata.jar
4c6d7000-4c6eb000 r--s 00000000 03:06 198506 /usr/lib/kaffe/lib/rmi.jar
4c6eb000-4cb9e000 r--s 00000000 03:06 185437 /usr/local/j2sdk1.4.1_01/lib/tools.jar
4cb9e000-4cc93000 r--s 00000000 03:06 198503 /usr/lib/kaffe/lib/kjc.jar
4cc93000-4cd9e000 r--s 00000000 03:06 198507 /usr/lib/kaffe/lib/rt.jar
4cd9e000-4cda6000 r--s 00000000 03:06 201714 /usr/lib/kaffe/lib/sax.jar
4cda6000-4cf61000 r--s 00000000 03:06 201715 /usr/lib/kaffe/lib/xerces.jar
4cf61000-4cf81000 r--s 00000000 03:06 201713 /usr/lib/kaffe/lib/jdom.jar
4cf81000-4cf85000 r-xp 00000000 03:06 266660 /home/sbile/diplomatikh/build/src/lib/libBuildHashTable.so
4cf85000-4cf86000 rw-p 00004000 03:06 266660 /home/sbile/diplomatikh/build/src/lib/libBuildHashTable.so
4cf95000-4d03e000 r-xp 00000000 03:06 508019 /usr/lib/libstdc++.so.5.0.0
4d03e000-4d054000 rw-p 000a8000 03:06 508019 /usr/lib/libstdc++.so.5.0.0
4d059000-4d060000 r-xp 00000000 03:06 278604 /lib/libgcc_s-3.2.so.1
4d060000-4d061000 rw-p 00007000 03:06 278604 /lib/libgcc_s-3.2.so.1
4d0e2000-4d0f2000 r-xp 00000000 03:06 119921 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libnet.so
4d0f2000-4d0f4000 rw-p 0000f000 03:06 119921 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libnet.so
Local Time = Sat May 10 04:25:40 2003
Elapsed Time = 7
# HotSpot Virtual Machine Error : 11
# Error ID : 4F530E43505002E6
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
# Java VM: Java HotSpot(TM) Client VM (1.4.1_01-b01 mixed mode)
# An error report file has been saved as hs_err_pid4063.log.
# Please refer to the file for further information.The dreaded Signal 11 means you've overwritten some memory you're not supposed to.
Check that all of your array indexes are in range, that you're not accessing memory that's been freed etc etc.
Try placing print statements at strategic places in your native code to narrow down the problem -
Errors in compiling native method
I am trying to call a native method from a java source program. I generated header file by javah and wrote c file for native method implementation. I work on RedHat Linux-7.2.
Java file for native method:-
class HelloNative
{ public static native void greeting();
static
{ System.loadLibrary("HelloNative");
Java file for calling native method(main java file):-
class HelloNativeTest
{ public static void main(String[] args)
{ HelloNative.greeting();
C file implementing native method:-
#include <stdio.h>
JNIEXPORT void JNICALL Java_HelloNative_greeting
(JNIEnv* env, jclass cl)
{ printf("Hello world!\n");
I am using following command for compiling c source file:-
cc -G -I/usr/java/jdk1.3.1/include -I/usr/java/jdk1.3.1/include/linux HelloNative.c -o HelloNative.so
It gave me followig errors on compiling:-
cc: unrecognized option `-G'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o: In function `_start':
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status.Looks to me like you're not telling the linker to create a library (DLL). I'm not familiar with Linux, but clearly if the linker if looking for 'main' then its trying to build an executable.
-
J2ME SDK 3 and Siemens - preverification error: Native Methods
Dear experts,
I am working on this issue for a week, but without success.
Maybe because I am trying to combine something new and old :-(
I tried to use Siemens TC45 GSM java module with j2ME Platform SDK 3.0.
It goes well and I have results until I use standard libraries like:
Import javax.microedition.io.*;But I also need Siemens library so I included:
Import com.siemens.icm.io.*;When building (preverifying stage) I got error:
ERROR: native methods should not appear
If I write similar midlet in SUN ONE Studio 4 ME (with j2me1.0.4) I can preverify it and build midlet without errors. So I assume that I have problems in SDK3.0 with version of preverifier or with some other settings somewhere. Can anyone please point me to the right direction?
Thank you,
MitjaThe issue is resolved. You have to update Java ME SDK 3.0.5 to obtain the fix:
1. Ensure that you have downloaded and installed the latest Java ME SDK 3.0.5 (published on Dec 23, 2011). In the updated 3.0.5 release we have added the Japanese and simplified Chinese localizations and "Update Center" feature that is required to obtain the fix.
2. Run Update Center either from Start menu or from Netbeans "Java ME" menu (in this case you should install Netbeans integration during Java ME SDK installation).
3. Install "Java ME SDK Tools Netbeans Update Site" via Update Center.
4. Restart Netbeans IDE.
5. In Netbeans, go to Tools -> Plugins, Reload Catalog and install "Utilities" update from "Java ME SDK Tools" category.
That's it.
For more details refer to corresponding blog post at: http://blogs.oracle.com/javamesdk/entry/update_java_me_sdk_through
Alexander Burdukov, Engineering Manager for Java ME SDK product. -
JRockIt Crash on Native Method call : Dump Analysis
Can some body help me ???
this crash may happen on this line :
RegistryKey r = new RegistryKey(RootKey.HKEY_LOCAL_MACHINE, SSLRV_REGISTRY_KEY);
Error Message: Illegal memory access. [54]
Exception Rec: EXCEPTION_ACCESS_VIOLATION (c0000005) at 0x7D621B69 - memory at 0x00000038 could not be written.
Minidump : Wrote mdmp. Size is 118MB
SafeDllMode : -1
Version : BEA JRockit(R) R27.3.1-1-85830-1.5.0_11-20070716-1248-windows-ia32
GC Strategy : Mode: throughput. Currently using strategy: genparpar
GC Status : OC is not running. Last finished OC was OC#0.
: YC is not running. Last finished YC was YC#0.
YC History : Ran 0 YCs since last OC.
Heap : 0x7DB00000 - 0x82C01000
Compaction : (no compaction area)
NurseryList : 0x7DB00000 - 0x80C00808
KeepArea : (no keeparea in use)
NurseryMarker: [ 0x7EB003D8, 0x804005D0 ]
CompRefs : References are 32-bit.
CPU : Intel Core (HT) SSE SSE2 SSE3 SSSE3 Core EM64T
Number CPUs : 8
Tot Phys Mem : 17178804224 (16382 MB)
OS version : Microsoft Windows Server 2003 version 5.2 Service Pack 2 (Build 3790) (64-bit)
Thread System: Windows Threads
State : JVM is running
Command Line : -DhistoMilan.properties=//par-data103/eqitpref$/WARRANTS/conf/histoMilan.properties -Xmx2048m -Djava.library.path=//par-data103/eqitpref$/WARRANTS/libGreeks -Dsun.java.launcher=SUN_STANDARD //par-data103/eqitpref$/WARRANTS/libGreeks/greeksHistoDBProcessor.jar Milan
java.home : c:\win32app\java\jrockit-R27.3.1-jdk1.5.0_11\jre
j.class.path : //par-data103/eqitpref$/WARRANTS/libGreeks/greeksHistoDBProcessor.jar
j.lib.path : //par-data103/eqitpref$/WARRANTS/libGreeks
JAVA_HOME : <not set>
JAVAOPTIONS: <not set>
PATH : c:\win32app\java\jrockit-R27.3.1-jdk1.5.0_11\jre\bin;C:\Reuters\Common\Login;C:\Perl\bin\;C:\Program Files (x86)\VERITAS\NetBackup\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files (x86)\Dell\SysMgt\oma\bin;C:\Program Files (x86)\Dell\SysMgt\oma\oldiags\bin;C:\Program Files (x86)\InfraDS;C:\TIBCO\TIBRV\BIN;C:\win32app\Java\jre1.5.0_11\bin;C:\Program Files (x86)\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\
C Heap : Good; no memory allocations have failed
StackOverFlow: 0 StackOverFlowErrors have occured
OutOfMemory : 0 OutOfMemoryErrors have occured
Registers (from ThreadContext: 0x0007F02C / OS context: 0x0007F450):
eax = 00000000 ecx = 00000813 edx = 00030608 ebx = 00030000
esp = 0007f71c ebp = 0007f728 esi = 0307dfa0 edi = 0307df68
es = 0000002b cs = 00000023 ss = 0000002b ds = 0000002b
fs = 00000053 gs = 0000002b
eip = 7d621b69 eflags = 00010283
Stack:
(* marks the word pointed to by the stack pointer)
0007f71c: 00030000* 0307df68 00000000 0007f810 7d620ec5 00030000
0007f734: 0307df68 0007f7f0 00000000 80000002 0307df70 00020019
0007f74c: 003c7e7c 00000038 00005c52 003c0000 0007f558 005b1946
0007f764: 0007f7a4 7d61f218 7d61f7b0 ffffffff 7d61f7ac 7c3416b3
Code:
(* marks the word pointed to by the instruction pointer)
7d621b38: 89045189 0448890a 83d8458b 458920c0 dc458bd0 8bc84589
7d621b50: 32e9c875 8afffffa 403c0747 1c9c830f b60f0000 83448bc0
7d621b68: 38788958* fff272e9 f8418dff ff148589 3b66ffff 75860f18
7d621b80: 8bfffff9 f960e909 008bffff 8ba44589 40e9d475 8bfffff8
Loaded modules:
(* denotes the module causing the exception)
00400000-0040ffff c:\win32app\java\jrockit-R27.3.1-jdk1.5.0_11\bin\java.exe
7d600000-7d6effff *C:\WINDOWS\system32\ntdll.dll
7d4c0000-7d5effff C:\WINDOWS\syswow64\kernel32.dll
7d1e0000-7d27bfff C:\WINDOWS\syswow64\ADVAPI32.dll
7da20000-7dafffff C:\WINDOWS\syswow64\RPCRT4.dll
7d8d0000-7d91ffff C:\WINDOWS\syswow64\Secur32.dll
77ba0000-77bf9fff C:\WINDOWS\syswow64\MSVCRT.dll
00410000-006a1fff c:\win32app\java\jrockit-R27.3.1-jdk1.5.0_11\jre\bin\jrockit\jvm.dll
76aa0000-76accfff C:\WINDOWS\system32\WINMM.dll
7d930000-7d9fffff C:\WINDOWS\syswow64\USER32.dll
7d800000-7d88ffff C:\WINDOWS\syswow64\GDI32.dll
71c00000-71c16fff C:\WINDOWS\system32\WS2_32.dll
71bf0000-71bf7fff C:\WINDOWS\system32\WS2HELP.dll
7c340000-7c395fff c:\win32app\java\jrockit-R27.3.1-jdk1.5.0_11\bin\MSVCR71.dll
6d710000-6d71bfff c:\win32app\java\jrockit-R27.3.1-jdk1.5.0_11\jre\bin\verify.dll
6d380000-6d39cfff c:\win32app\java\jrockit-R27.3.1-jdk1.5.0_11\jre\bin\java.dll
6d300000-6d307fff c:\win32app\java\jrockit-R27.3.1-jdk1.5.0_11\jre\bin\hpi.dll
6d730000-6d73efff C:\win32app\Java\jrockit-R27.3.1-jdk1.5.0_11\jre\bin\zip.dll
6d540000-6d552fff C:\win32app\Java\jrockit-R27.3.1-jdk1.5.0_11\jre\bin\net.dll
02150000-021cffff C:\WINDOWS\system32\mswsock.dll
77670000-777a8fff C:\WINDOWS\syswow64\ole32.dll
5f270000-5f2c9fff C:\WINDOWS\system32\hnetcfg.dll
71ae0000-71ae7fff C:\WINDOWS\System32\wshtcpip.dll
76ed0000-76ef9fff C:\WINDOWS\system32\DNSAPI.dll
76f70000-76f76fff C:\WINDOWS\System32\winrnr.dll
76f10000-76f3dfff C:\WINDOWS\syswow64\WLDAP32.dll
68000000-68034fff C:\WINDOWS\system32\rsaenh.dll
76b70000-76b7afff C:\WINDOWS\system32\PSAPI.DLL
76f80000-76f84fff C:\WINDOWS\system32\rasadhlp.dll
10000000-1000afff \\par-data103\eqitpref$\WARRANTS\libGreeks\tibrvj.dll
02500000-0250efff C:\TIBCO\TIBRV\BIN\tibrvcmq.dll
02510000-02529fff C:\TIBCO\TIBRV\BIN\tibrvcm.dll
02530000-0258bfff C:\TIBCO\TIBRV\BIN\tibrv.dll
02590000-02597fff C:\TIBCO\TIBRV\BIN\tibrvft.dll
76920000-769e1fff C:\WINDOWS\system32\USERENV.dll
02930000-02986fff C:\WINDOWS\syswow64\netapi32.dll
62380000-62389fff \\par-data103\eqitpref$\WARRANTS\libGreeks\jRegistryKey.dll
02990000-029e1fff C:\WINDOWS\syswow64\SHLWAPI.DLL
03790000-038a2fff c:\win32app\java\jrockit-R27.3.1-jdk1.5.0_11\jre\bin\dbghelp.dll
"Main Thread" id=1 idx=0x4 tid=13992 lastJavaFrame=0x0007FAB0
Stack 0: start=0x00040000, end=0x00080000, guards=0x00043000 (ok), forbidden=0x00041000
Thread Stack Trace:
at RtlSizeHeap+296()@0x7D621B69
at RtlUnicodeToMultiByteSize+526()@0x7D620EC5
at free+195()@0x77BBCEF6
at JNI_OnUnload+701()@0x62381ADD
at Java_ca_beq_util_win32_registry_RegistryKey_getValue+40()@0x623827F8
at _nativeUnlock+82()@0x00544E42
at _callC2Java+788()@0x0057F0C4
at _jniCheckExceptionsForCall+258()@0x004BF7E2
at _jniCallStaticIntMethodV@16+54()@0x004C09C6
at _xjniReleaseStringCritical@12+4771()@0x004A6753
-- Java stack --
at ca/beq/util/win32/registry/RegistryKey.getValue(Ljava/lang/String;)Lca/beq/util/win32/registry/RegistryValue;(Native Method)
at com/*******/itlight/realtime/realtime/source/RTService.getSSLRVConfigFileFromRegistry(RTService.java:593)*Without looking at your actual source code, I must still say this looks like you are trying to write registry keys that you do not have security access to, and if so, you would have to figure out how to modify your own code so that Windows will accept your operation.
If you strongly feel that this is a JRockit bug - can you test your code with another JVM and verify that it works with that JVM?
Best Regards,
Tomas Nilsson -
Connector.isNetworkMonitorActive(Native Method)... ?
Hi I'm doing this lines:
import javax.microedition.io.*;
import java.io.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class Server
public static void main( String[] args )
try
// Create the server listening socket for port 8787
ServerSocketConnection scn = (ServerSocketConnection)
Connector.open("socket://:8787");
and get followint exception:
xception in thread "main" java.lang.UnsatisfiedLinkError: isNetworkMonitorActive
at javax.microedition.io.Connector.isNetworkMonitorActive(Native Method)
at javax.microedition.io.Connector.<clinit>(Connector.java:142)
at Server.main(Server.java:18)
Pleased for suggestions
I'm running windows.OK.
Actualy it work when I run J2ME - KToolbar.
How do I to import the needed "stuff". I'm using JCreator
Thanks -
UnsatisfiedLinkError invoke of native method
Hi,
When the native method is invoked in the same Classloader as the native library is loaded, then everything is ok :-)
But when the native method is invoked in a "child" of the ClassLoader, which has loaded the native library, then a
java.lang.UnsatisfiedLinkError: <methodname>
is thrown.
Has anybody an idea?
Thank you for your assistance
Johannes RamederHi,
Here is a small test example for solaris for better understanding.
I have tested this with solaris 9.
Put all files in a directory asst/test
---JNISmallTestHelper.java---
package asst.test;
public class JNISmallTestHelper {
public JNISmallTestHelper() {
printClassLoaderChain(this);
JNISmallTest tmp = new JNISmallTest();
int i = tmp.NoArgs();
System.out.println("result of NoArgs is "+i);
private static void printClassLoaderChain(Object o) {
for (ClassLoader cl = o.getClass().getClassLoader(); cl != null; cl = cl.getParent()) {
System.out.println("H: "+cl.toString());
---JNISmallTest.java---
package asst.test;
public class JNISmallTest {
public JNISmallTest() {
printClassLoaderChain(this);
public native int NoArgs();
private static void printClassLoaderChain(Object o) {
for (ClassLoader cl = o.getClass().getClassLoader(); cl != null; cl = cl.getParent()) {
System.out.println("J: "+cl.toString());
---JNISmallTestMain.java---
package asst.test;
import java.net.URL;
import java.net.URLClassLoader;
public class JNISmallTestMain {
public JNISmallTestMain() {
try {
System.out.println("system "+ClassLoader.getSystemClassLoader());
printClassLoaderChain(this);
System.loadLibrary("JNITest");
URLClassLoader ucl = new URLClassLoader(new URL[] {new URL("file:JNITest.jar")});
ucl.loadClass("asst.test.JNISmallTestHelper").newInstance();
} catch (Exception e) {
System.out.println("Load exception " + e.toString());
e.printStackTrace();
public static void main (String[] args) {
new JNISmallTestMain();
private static void printClassLoaderChain(Object o) {
for (ClassLoader cl = o.getClass().getClassLoader(); cl != null; cl = cl.getParent()) {
System.out.println("M: "+cl.toString());
---JNITest.c---
#define JNITest_c
static char rcsid[] = "$Id:$";
#include <stdio.h>
#include <stdlib.h>
#include "JNITest.h"
JNIEXPORT jint JNICALL Java_asst_test_JNISmallTest_NoArgs (JNIEnv * env, jclass cls) {
printf("*Called NoArgs in shared C library*\n");
return 5;
---makeNOK.sh---
rm -rf *.class *.jar *.so *.o *.h TestMain
javac -classpath ../.. *.java
javah -classpath ../.. -o JNITest.h asst.test.JNISmallTest
cd ../..
jar cvf asst/test/JNITest.jar asst/test/JNISmallTestHelper.class asst/test/JNISmallTest.class
cd asst/test
rm JNISmallTestHelper.class
rm JNISmallTest.class
gcc -g -fPIC -I${JAVA_HOME}/include -I${JAVA_HOME}/include/solaris -c *.c
gcc -g -fPIC -shared -W1 --soname=libJNITest.so JNITest.o -o libJNITest.so
gcc -g -fPIC -L. -lJNITest TestMain.o -o TestMain
---makeOK.sh---
rm -rf *.class *.jar *.so *.o TestMain
javac -classpath ../.. *.java
javah -classpath ../.. -o JNITest.h asst.test.JNISmallTest
cd ../..
jar cvf asst/test/JNITest.jar asst/test/JNISmallTestHelper.class
cd asst/test
rm JNISmallTestHelper.class
gcc -g -fPIC -I${JAVA_HOME}/include -I${JAVA_HOME}/include/solaris -c *.c
gcc -g -fPIC -shared -W1 --soname=libJNITest.so JNITest.o -o libJNITest.so
gcc -g -fPIC -L. -lJNITest TestMain.o -o TestMain
---run.sh---
export LD_LIBRARY_PATH=.:/usr/lib:/usr/local/lib
echo "#start test with java"
java -cp ../.. asst.test.JNISmallTestMain
echo
echo "#start test with C"
TestMain
---TestMain.c---
#define testmain_c
static char rcsid[] = "$Id: TestMain.c,v 1.4 2004/03/16 20:20:54 neiExp $";
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char** argv) {
printf("Calling NoArgs from C Main Program\n");
printf("NoArgs returned %d to calling C program\n",
Java_asst_test_JNISmallTest_NoArgs(0, 0));
printf("After NoArgs call\n");
exit(0);
}call makeOK.sh and run.sh
#start test with java
system sun.misc.Launcher$AppClassLoader@10dd1f7
M: sun.misc.Launcher$AppClassLoader@10dd1f7
M: sun.misc.Launcher$ExtClassLoader@53c015
H: java.net.URLClassLoader@108786b
H: sun.misc.Launcher$AppClassLoader@10dd1f7
H: sun.misc.Launcher$ExtClassLoader@53c015
J: sun.misc.Launcher$AppClassLoader@10dd1f7
J: sun.misc.Launcher$ExtClassLoader@53c015
Called NoArgs in shared C library
result of NoArgs is 5
#start test with C
Calling NoArgs from C Main Program
Called NoArgs in shared C library
NoArgs returned 5 to calling C program
After NoArgs call
Here you can see that the classloader which loads the native library is the same as the classloader which loads the class who invokes the native method.
then call makeOK.sh and run.sh
#start test with java
system sun.misc.Launcher$AppClassLoader@10dd1f7
M: sun.misc.Launcher$AppClassLoader@10dd1f7
M: sun.misc.Launcher$ExtClassLoader@53c015
H: java.net.URLClassLoader@108786b
H: sun.misc.Launcher$AppClassLoader@10dd1f7
H: sun.misc.Launcher$ExtClassLoader@53c015
J: java.net.URLClassLoader@108786b
J: sun.misc.Launcher$AppClassLoader@10dd1f7
J: sun.misc.Launcher$ExtClassLoader@53c015
Exception in thread "main" java.lang.UnsatisfiedLinkError: NoArgs
at asst.test.JNISmallTest.NoArgs(Native Method)
at asst.test.JNISmallTestHelper.<init>(JNISmallTestHelper.java:9)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at asst.test.JNISmallTestMain.<init>(JNISmallTestMain.java:18)
at asst.test.JNISmallTestMain.main(JNISmallTestMain.java:28)
#start test with C
Calling NoArgs from C Main Program
Called NoArgs in shared C library
NoArgs returned 5 to calling C program
After NoArgs call
The classloaders are different. -
How to view the source code for a Native Method
hi
i am using a Native method Math.pow() ;
but since it is a native method it is taking more time to execute ;
since this method i had to call at least 700 times it is affecting the performance of the application ;
so i am thinking to write the user defined method based on the logic which has been implemented in the pow() method ;
for that i need to know in which .c file this method has been written ;
or else it can not be viewed at all ( if it is in the .dll)
can u help me out
nikHi!
Here is part of StrictMath.java code.
* The class <code>StrictMath</code> contains methods for performing basic
* numeric operations such as the elementary exponential, logarithm,
* square root, and trigonometric functions.
* <p>
* To help ensure portability of Java programs, the definitions of
* many of the numeric functions in this package require that they
* produce the same results as certain published algorithms. These
* algorithms are available from the well-known network library
* <code>netlib</code> as the package "Freely Distributable
* Math Library" (<code>fdlibm</code>). These algorithms, which
* are written in the C programming language, are then to be
* understood as executed with all floating-point operations
* following the rules of Java floating-point arithmetic.
* <p>
* The network library may be found on the World Wide Web at:
* <blockquote><pre>
* http://metalab.unc.edu/
* </pre></blockquote>
* <p>
* The Java math library is defined with respect to the version of
* <code>fdlibm</code> dated January 4, 1995. Where
* <code>fdlibm</code> provides more than one definition for a
* function (such as <code>acos</code>), use the "IEEE 754 core
* function" version (residing in a file whose name begins with
* the letter <code>e</code>).
* @author unascribed
* @version 1.9, 02/02/00
* @since 1.3 -
Returning several values from a C native method
Hi,
I need to return 3 values from a native methode : an int (the return code), a string of variable length and a double.
In pure C, my function would be defined as "int f ( char* s, double* d)", and I would "malloc" the string into the calling function, then copy my string to "s" and use "*d" to return the double...
Is there a way to do that with JNI? I found some examples where the native function returns only one parameterlike: "return(*env)->NewStringUTF(env, buffer);" But I didn't find examples where the native function returns several parameters, including a string.
Thanks in advance!
JMThis really has nothing to do with JNI.
You have a method, and you want to return more than one type of value.
The following solutions are possible.
1. Return an array that contains all the values (actual return value.)
2. Return an object that contains all the values (actual return value.)
3. Use an array via the parameter list and fill in a value.
4. Use an object via the parameter list and fill in the values. -
Error while compiling javacode with native method using jni
im trying to call function in dll that is written in vc++ from java application.
For that i write a native method .the method name is StopDS1.
my native method is : public native DWORD StopDS1();
when compiling using javac i'm getting message like this:
testdss.java:4: cannot found symbol
symbol:class dword
location :class testdss
1errorDWORD isn't a Java type, therefore you cannot use it as one.
-
Accessing a native method from within a packaged class
I have seen some very useful information from RPaul. However, I can not quite get it to work.
I have a class "JNIGetUserId" that is in a package "com.services.localoptions". I am trying to call a native method from a dll. it works fine at the default package level. But not in the package. I have tried adding the "_" between each level of the directory in the h and c++ files. I also found that doing a javah at the top of the package structure it includes some information in the h file. A "_0005" shows up between each level.
This is on Windows XP. I am also using VisualAge for Java. I also am using JDK 1.3.1.
The source files:
package com.services.localoptions;
* This class provides the JNI Interface to call the
* AD User Maintainence routines.
* These routines are stored in the JNIGetUserIdLibrary.dll.
* The routines are:
* <ul>
* <li>getUser - returns a string containing the User Id
* <eul>
* @author: Ray Rowehl
* @date (10/15/2003 10:30:59 AM)
public class JNIGetUserId
// Load the library
static
try
System.out.println("loading dll");
System.loadLibrary("JNIGetUserIdLibrary");
System.out.println("loaded dll");
catch (UnsatisfiedLinkError ue)
System.out.println("Link Error");
* native C++ method to call getUserId routine
public native String getUser() throws Exception;
* This method allows us to test standalone..
* Creation date: (10/16/2003 2:08:58 PM)
* @param args java.lang.String[]
public static void main(String[] args)
try
System.out.println("Trying method 3");
JNIGetUserId lGUD = new JNIGetUserId();
System.out.println(lGUD.getUser());
catch (Exception e)
System.out.println("Got an exception " + e);
e.printStackTrace();
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class JNIGetUserId */
#ifndef IncludedJNIGetUserId
#define IncludedJNIGetUserId
#ifdef __cplusplus
extern "C" {
#endif
* Class: JNIGetUserId
* Method: getUser
* Signature: ()Ljava/lang/String;
JNIEXPORT jstring JNICALL Java_com_localoptions_JNIGetUserId_getUser
(JNIEnv *, jobject);
#ifdef __cplusplus
#endif
#endif
// Implements method to return a string to Java
// C++ core header
#include <iostream.h>
// header from Java Interface
#include "JNIGetUserId.h"
#include "JNIGetUserId2.h"
// returns a string back to Java for package structure
JNIEXPORT jstring JNICALL Java_com_services_localoptions_JNIGetUserId_getUser
( JNIEnv * env, jobject thisObject )
// set up constant user id for testing return
char* userid = "RROWEHLP";
// return userid to caller
return env->NewStringUTF( userid );
// returns a string back to Java for flat structure
JNIEXPORT jstring JNICALL Java_JNIGetUserId_getUser
( JNIEnv * env1, jobject thisObject1 )
// set up constant user id for testing return
char* userid1 = "RROWEHL1";
// return userid to caller
return env1->NewStringUTF( userid1 );
}Ok. A co-worker figured it out for me. The key thing is to do "javah com.services.localoptions.JNIGetUserId". Note the use of "." instead of "\". Running on windows, I was used to doing "\". That was part of the problem. Another key is doing the javah at the top of the package structure. This was mentioned in a post over at IBM.
We got our JNI stuff working now. thanks, ray.
Maybe you are looking for
-
How to add additionnal information in EP Logon UI Header ?
Hi all, I would add informations in the message "Welcome FirstName LastName" onto the EP Logon UI header. I could find the variable for the "Welcome" text (in logonLabels_LG.properties file), so I do not know how to add a variable (for example the Pe
-
Udev/dmraid not picking up all partitions of a fake RAID setup!
Hey all. I've been having a problem with my RAID setup in Arch. At first Arch wasn't picking up a partition on one of my arrays, (a single large NTFS partition on a 2TB array between two 1TB drives) but after re-creating the RAID array in the Intel
-
Updates for App won't download - not enough access privilege - Err = -5000
I can't update any of my iPhone Apps thru iTunes. I get the following message "There were problems downloading some purchased items. For more information on the items that could not be downloaded, click below. There was a problem downloading "FastFoo
-
Hello, I am trying to use a page item: If the value is missing, then get a new value from a db sequence else Automated Row Fetch and display a row using the item. I can get these working but only if I have one and not the other programmed as 'page pr
-
Hi, SAP support ask me to send them Nakisa logs (cds.log). Also they ask to clear file before (to minimize the size and remove info not regarding issue). But, after I backed up current file and cleared it (actually delete cds.log and create empty new