Error using a dll for acess the parallel port

Hi. I'm doing some testes with JNI. Firs i followed the netbeans tutorial for doing a C programa that prints somthing for java.. like.. "Hello java from C".

So i tried to load a dll from my dll. Like, I have this dll to use the parallel port on windows Xp. So i created a dll to access it an comunicates eoth java.

I did everything just fine.

When I start my Java app, the first thing it does is to load this parallel port dll and configure the functions of it.

After that .. I get this error

EXCEPTION_FLT_STACK_CHECK (0xc0000092) at pc=0x0093d269, pid=2284, tid=3000

Can someone explain why ?

(Sorry if i wasn't clear enough, english is not my native language, so ask if you don't understand something.. )

[763 byte] By [LeandroGuidaa] at [2007-11-26 22:10:50]
# 1
Hi,Probably you are trying to load a DLL created by a Borland compiler, this seams to be not supported.Try to launch your java with the -Xcheck:jni, it may help.--Marc ( http://jnative.sf.net)
mdentya at 2007-7-10 10:58:41 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

Could be that.

But let me explain better to make sure you undertood my problem.

I have this dll called inpout32.dll. This dll provide you access to Paralell Port using c/c++ language. (Website: http://www.logix4u.net/inpout32.htm ).

Since this dll is already compiled, I don't have access to the source code.

So, I wrote a dll (the c programa with the header file made by javah.exe) that access this dll anda send some commands to the parallel port.

In this program i have 4 functions. initPort (initiates the port and configure it), close port, ledsOn (send the command to turn the leds on) and ledsOff.

The initPort function worked just fine, because it returned no alerts (i putted some warns to alert in case of error).

But, after that the program just close (I'm using Jframe to make the visual for the buttons 'turn on' and 'turn off', and I'm using Netbeans IDE 5.5).

and give me that message.

apparently the dll is not developed by borland, but i don't know if it was developed with it.

LeandroGuidaa at 2007-7-10 10:58:41 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3

One more help on understanding...

The error log file:

#

# An unexpected error has been detected by Java Runtime Environment:

#

# EXCEPTION_FLT_STACK_CHECK (0xc0000092) at pc=0x0093d269, pid=3972, tid=404

#

# Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing)

# Problematic frame:

# v ~RuntimeStub::resolve_static_call

#

# If you would like to submit a bug report, please visit:

#http://java.sun.com/webapps/bugreport/crash.jsp

#

T H R E A D

Current thread (0x02b10800): JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=404]

siginfo: ExceptionCode=0xc0000092, ExceptionInformation=0x00000000 0x02faebc4

Registers:

EAX=0x2297d1a0, EBX=0x0c2b1027, ECX=0x2297d1a0, EDX=0x2b7425b0

ESP=0x02faeb58, EBP=0x02faec68, ESI=0x002b0000, EDI=0x00001000

EIP=0x0093d269, EFLAGS=0x00010212

Top of Stack: (sp=0x02faeb58)

0x02faeb58:ffff1372 ffff0000 ffffffff 009206d4

0x02faeb68:011c001b 2297d19c ffff0023 0090f804

0x02faeb78:2a96f4dd 0000f830 00000000 00000000

0x02faeb88:00000000 80000000 00003ffd 00000000

0x02faeb98:4000a8c0 00000000 90800000 00004039

0x02faeba8:00000000 403ade50 00000000 80000000

0x02faebb8:00003fff 00000000 4003d000 6d8471f6

0x02faebc8:02b10800 2b2dc818 02faed50 00000000

Instructions: (pc=0x0093d269)

0x0093d259:00 00 83 ec 6c dd 34 24 9b dd 24 24 dd 5c 24 6c

0x0093d269:dd 5c 24 74 dd 5c 24 7c dd 9c 24 84 00 00 00 dd

Stack: [0x02f60000,0x02fb0000), sp=0x02faeb58, free space=314k

Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)

v ~RuntimeStub::resolve_static_call

J sun.java2d.loops.GraphicsPrimitiveMgr.locatePrim(ILsun/java2d/loops/SurfaceType;Lsun/java2d/loops/CompositeType;Lsun/java2d/loops/SurfaceType;)Lsun/java2d/loops/GraphicsPrimitive;

j sun.java2d.loops.MaskFill.locatePrim(Lsun/java2d/loops/SurfaceType;Lsun/java2d/loops/CompositeType;Lsun/java2d/loops/SurfaceType;)Lsun/java2d/loops/MaskFill;+6

j sun.java2d.loops.MaskFill.getFromCache(Lsun/java2d/loops/SurfaceType;Lsun/java2d/loops/CompositeType;Lsun/java2d/loops/SurfaceType;)Lsun/java2d/loops/MaskFill;+22

j sun.java2d.SurfaceData.getMaskFill(Lsun/java2d/SunGraphics2D;)Lsun/java2d/loops/MaskFill;+12

j sun.java2d.SurfaceData.validatePipe(Lsun/java2d/SunGraphics2D;)V+542

j sun.java2d.windows.Win32OffScreenSurfaceData.validatePipe(Lsun/java2d/SunGraphics2D;)V+252

j sun.java2d.SunGraphics2D.validatePipe()V+5

j sun.java2d.pipe.ValidatePipe.validate(Lsun/java2d/SunGraphics2D;)Z+1

j sun.java2d.pipe.ValidatePipe.fillRect(Lsun/java2d/SunGraphics2D;IIII)V+2

j sun.java2d.SunGraphics2D.fillRect(IIII)V+10

j javax.swing.plaf.metal.MetalUtils$GradientPainter.drawVerticalGradient(Ljava/awt/Graphics2D;FFLjava/awt/Color;Ljava/awt/Color;Ljava/awt/Color;II)V+180

j javax.swing.plaf.metal.MetalUtils$GradientPainter.paintToImage(Ljava/awt/Component;Ljava/awt/Image;Ljava/awt/Graphics;II[Ljava/lang/Object;)V+100

j sun.swing.CachedPainter.paint0(Ljava/awt/Component;Ljava/awt/Graphics;IIII[Ljava/lang/Object;)V+169

j sun.swing.CachedPainter.paint(Ljava/awt/Component;Ljava/awt/Graphics;IIII[Ljava/lang/Object;)V+42

j javax.swing.plaf.metal.MetalUtils$GradientPainter.paint(Ljava/awt/Component;Ljava/awt/Graphics2D;Ljava/util/List;IIIIZ)V+71

j javax.swing.plaf.metal.MetalUtils.drawGradient(Ljava/awt/Component;Ljava/awt/Graphics;Ljava/lang/String;IIIIZ)Z+54

j javax.swing.plaf.metal.MetalButtonUI.update(Ljava/awt/Graphics;Ljavax/swing/JComponent;)V+77

j javax.swing.JComponent.paintComponent(Ljava/awt/Graphics;)V+26

j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+269

j javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+473

j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+301

j javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+473

j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+301

j javax.swing.JLayeredPane.paint(Ljava/awt/Graphics;)V+73

j javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+473

j javax.swing.JComponent.paintToOffscreen(Ljava/awt/Graphics;IIIIII)V+72

j javax.swing.BufferStrategyPaintManager.paint(Ljavax/swing/JComponent;Ljavax/swing/JComponent;Ljava/awt/Graphics;IIII)Z+157

j javax.swing.RepaintManager.paint(Ljavax/swing/JComponent;Ljavax/swing/JComponent;Ljava/awt/Graphics;IIII)V+52

j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+204

j java.awt.GraphicsCallback$PaintCallback.run(Ljava/awt/Component;Ljava/awt/Graphics;)V+2

j sun.awt.SunGraphicsCallback.runOneComponent(Ljava/awt/Component;Ljava/awt/Rectangle;Ljava/awt/Graphics;Ljava/awt/Shape;I)V+155

j sun.awt.SunGraphicsCallback.runComponents([Ljava/awt/Component;Ljava/awt/Graphics;I)V+104

j java.awt.Container.paint(Ljava/awt/Graphics;)V+62

j javax.swing.RepaintManager.paintDirtyRegions(Ljava/util/Map;)V+245

j javax.swing.RepaintManager.paintDirtyRegions()V+46

j javax.swing.RepaintManager.seqPaintDirtyRegions()V+73

j javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run()V+36

j java.awt.event.InvocationEvent.dispatch()V+47

j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+26

j java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z+156

j java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+30

j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11

j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4

j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3

j java.awt.EventDispatchThread.run()V+9

v ~StubRoutines::call_stub

P R O C E S S

Java Threads: ( => current thread )

0x00296000 JavaThread "DestroyJavaVM" [_thread_blocked, id=3968]

=>0x02b10800 JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=404]

0x02b0f400 JavaThread "AWT-Windows" daemon [_thread_in_native, id=364]

0x02b0e400 JavaThread "AWT-Shutdown" [_thread_blocked, id=660]

0x02b0d800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=656]

0x02a5cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=324]

0x02a5b400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3168]

0x02a56c00 JavaThread "Attach Listener" daemon [_thread_blocked, id=3864]

0x02a56000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1984]

0x02a4e000 JavaThread "Finalizer" daemon [_thread_blocked, id=3852]

0x02a4d000 JavaThread "Reference Handler" daemon [_thread_blocked, id=4076]

Other Threads:

0x02a43c00 VMThread [id=3948]

0x02a5e400 WatcherThread [id=1732]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap

def new generationtotal 960K, used 190K [0x22960000, 0x22a60000, 0x22e40000)

eden

[error occurred during error reporting, step 190, id 0xc0000092]

Dynamic libraries:

0x00400000 - 0x00423000 C:\Program Files\Java\jdk1.6.0\jre\bin\java.exe

0x7c900000 - 0x7c9b0000 C:\WINDOWS\system32\ntdll.dll

0x7c800000 - 0x7c8f4000 C:\WINDOWS\system32\kernel32.dll

0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll

0x77e70000 - 0x77f01000 C:\WINDOWS\system32\RPCRT4.dll

0x7c340000 - 0x7c396000 C:\Program Files\Java\jdk1.6.0\jre\bin\msvcr71.dll

0x6d7c0000 - 0x6da07000 C:\Program Files\Java\jdk1.6.0\jre\bin\client\jvm.dll

0x77d40000 - 0x77dd0000 C:\WINDOWS\system32\USER32.dll

0x77f10000 - 0x77f57000 C:\WINDOWS\system32\GDI32.dll

0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll

0x76390000 - 0x763ad000 C:\WINDOWS\system32\IMM32.DLL

0x6d310000 - 0x6d318000 C:\Program Files\Java\jdk1.6.0\jre\bin\hpi.dll

0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL

0x6d770000 - 0x6d77c000 C:\Program Files\Java\jdk1.6.0\jre\bin\verify.dll

0x6d3b0000 - 0x6d3cf000 C:\Program Files\Java\jdk1.6.0\jre\bin\java.dll

0x6d7b0000 - 0x6d7bf000 C:\Program Files\Java\jdk1.6.0\jre\bin\zip.dll

0x6d000000 - 0x6d1c3000 C:\Program Files\Java\jdk1.6.0\jre\bin\awt.dll

0x73000000 - 0x73026000 C:\WINDOWS\system32\WINSPOOL.DRV

0x77c10000 - 0x77c68000 C:\WINDOWS\system32\msvcrt.dll

0x774e0000 - 0x7761d000 C:\WINDOWS\system32\ole32.dll

0x5ad70000 - 0x5ada8000 C:\WINDOWS\system32\uxtheme.dll

0x73760000 - 0x737a9000 C:\WINDOWS\system32\ddraw.dll

0x73bc0000 - 0x73bc6000 C:\WINDOWS\system32\DCIMAN32.dll

0x74720000 - 0x7476b000 C:\WINDOWS\system32\MSCTF.dll

0x755c0000 - 0x755ee000 C:\WINDOWS\system32\msctfime.ime

0x6d2b0000 - 0x6d303000 C:\Program Files\Java\jdk1.6.0\jre\bin\fontmanager.dll

0x7c9c0000 - 0x7d1d5000 C:\WINDOWS\system32\shell32.dll

0x77f60000 - 0x77fd6000 C:\WINDOWS\system32\SHLWAPI.dll

0x773d0000 - 0x774d3000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll

0x5d090000 - 0x5d12a000 C:\WINDOWS\system32\comctl32.dll

0x6d570000 - 0x6d583000 C:\Program Files\Java\jdk1.6.0\jre\bin\net.dll

0x71ab0000 - 0x71ac7000 C:\WINDOWS\system32\WS2_32.dll

0x71aa0000 - 0x71aa8000 C:\WINDOWS\system32\WS2HELP.dll

0x6d590000 - 0x6d599000 C:\Program Files\Java\jdk1.6.0\jre\bin\nio.dll

0x6f780000 - 0x6f788000 C:\Dlls\dllpp.dll

0x03040000 - 0x0304c000 C:\Dlls\inpout32.dll

0x77120000 - 0x771ac000 C:\WINDOWS\system32\oleaut32.dll

VM Arguments:

java_command: dllparport.NovoJFrame

Launcher Type: SUN_STANDARD

Environment Variables:

JAVA_HOME=C:\Program Files\Java\jdk1.6.0

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;

PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\Java\jdk1.6.0\bin\;C:\Program Files\QuickTime\QTSystem\;C:\cygwin\bin

USERNAME=Leandro

OS=Windows_NT

PROCESSOR_IDENTIFIER=x86 Family 15 Model 43 Stepping 1, AuthenticAMD

S Y S T E M

OS: Windows XP Build 2600 Service Pack 2

CPU:total 2 family 15, cmov, cx8, fxsr, mmx, sse, sse2, mmxext, 3dnowext, 3dnow, ht

Memory: 4k page, physical 1310184k(621588k free), swap 3124820k(2607356k free)

vm_info: Java HotSpot(TM) Client VM (1.6.0-b105) for windows-x86, built on Nov 29 2006 00:48:48 by "java_re" with unknown MS VC++:1310

LeandroGuidaa at 2007-7-10 10:58:41 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 4
Hi,The preferred way to use a parallel port is to use JavaComm.There is a free implementation at http://rxtx.org/I used it for serial access to a scanner device, it works pretty well.--Marc ( http://jnative.sf.net)
mdentya at 2007-7-10 10:58:41 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 5
hi, the problem is not that... The parallel dll is just a test.I have a Ip camera, that provides you a dll for developing programs with C++.So I want to access this dll with java, so i could capture the video with it.But since i got a error i want to solve
LeandroGuidaa at 2007-7-10 10:58:41 > top of Java-index,Java HotSpot Virtual Machine,Specifications...