Opened 17 years ago

Closed 16 years ago

#2126 closed defect (invalid)

problem using mapscript with java to getfeature WFS

Reported by: victorH Owned by: unicoletti
Priority: normal Milestone:
Component: MapScript-Java Version:
Severity: blocker Keywords:
Cc:

Description

Use mapscript library to make a consult "WFS getfeature" to "MAPSERVER" to MS4W.

I prove the java example in this url,

"http://mapserver.gis.umn.edu/docs/howto/wxs_mapscript/#java-example"

Adapted for WFS GetFeature. This it is the code that causes the error

" import edu.umn.gis.mapscript.mapObj; import edu.umn.gis.mapscript.OWSRequest; import edu.umn.gis.mapscript.mapscript;

class WxSTest_thread extends Thread {

public String mapName="C:
ms4w
Apache
htdocs
mapserver
hidrocarburos
hidrocarburos.map"; public byte[] resultBytes;

public void run() {

mapObj map = new mapObj(mapName);

map.setMetaData( "ows_onlineresource", "http://dummy.org/" );

OWSRequest req = new OWSRequest();

req.setParameter( "SERVICE", "WFS" ); req.setParameter( "VERSION", "1.0.0" ); req.setParameter( "REQUEST", "getfeature" ); req.setParameter( "TYPENAME", "estaciones_servicio");

mapscript.msIO_installStdoutToBuffer();

int owsResult = map.OWSDispatch( req );

if( owsResult != 0 )

System.out.println( "OWSDispatch Result (expect 0): " + owsResult );

resultBytes = mapscript.msIO_getStdoutBufferBytes();

}

}

public class Wxs {

public static void main(String[] args) {

try {

WxSTest_thread tt[] = new WxSTest_thread[100]; int i; int expectedLength=0, success = 0, failure=0;

for( i = 0; i < tt.length; i++ ) {

tt[i] = new WxSTest_thread(); tt[i].mapName = args[0];

}

for( i = 0; i < tt.length; i++ )

tt[i].start();

for( i = 0; i < tt.length; i++ ) {

tt[i].join(); if( i == 0 ) {

expectedLength = tt[i].resultBytes.length; System.out.println( "Document Length: " + expectedLength + ", expecting somewhere around 10000 or more." );

} else if( expectedLength != tt[i].resultBytes.length ) {

System.out.println( "Document Length:" + tt[i].resultBytes.length + " Expected:" + expectedLength ); failure++;

} else

success++;

}

System.out.println( "Successes: " + success ); System.out.println( "Failures: " + failure );

} catch( Exception e ) {

e.printStackTrace();

}

}

} "

And obtain this error

"

#

# An unexpected error has been detected by HotSpot Virtual Machine:

#

# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x036b68c3, pid=7444, tid=7552

#

# Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode, sharing)

# Problematic frame:

# C [gdal14.dll+0x168c3]

#

# An error report file with more information is saved as hs_err_pid5260.log

#

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

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

#

"

This is the content of file "hs_err_pid5260.log".

# # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0492fadc, pid=5260, tid=5836 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode, sharing) # Problematic frame: # C [gdal14.dll+0x18fadc] #


Current thread (0x02d48788): JavaThread "Thread-41" daemon [_thread_in_native, id=5836]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000004

Registers: EAX=0x00000000, EBX=0x055d0c48, ECX=0x00000000, EDX=0x7c38b1c0 ESP=0x053dd8bc, EBP=0x056a6dd0, ESI=0x051f7580, EDI=0x00000001 EIP=0x0492fadc, EFLAGS=0x00010206

Top of Stack: (sp=0x053dd8bc) 0x053dd8bc: 04a81740 04a81704 05218ff0 055d0c48 0x053dd8cc: 056a6dd0 0467aefc 05622b78 7c3505dc 0x053dd8dc: 0454cb50 055d0c48 05622b78 00000001 0x053dd8ec: 05213de0 056a6dd0 0454d115 056a6dd0 0x053dd8fc: 05622b78 05218fb8 056a6dd0 04560ec5 0x053dd90c: 056a6dd0 00000010 0457188c 056a6dd0 0x053dd91c: 0566f008 0520e050 0521f358 ffffffff 0x053dd92c: 0521f358 05218fb8 0521f4d8 056a6dd0

Instructions: (pc=0x0492fadc) 0x0492facc: 17 a8 04 68 40 17 a8 04 e8 a1 18 e7 ff 8b 4e 0c 0x0492fadc: 8b 14 b9 52 e8 ac 3d e7 ff 8b 4e 08 8b 46 0c 8b

Stack: [0x053a0000,0x053e0000), sp=0x053dd8bc, free space=246k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [gdal14.dll+0x18fadc]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j edu.umn.gis.mapscript.mapscriptJNI.mapObj_OWSDispatch(JJ)I+0 j edu.umn.gis.mapscript.mapObj.OWSDispatch(Ledu/umn/gis/mapscript/OWSRequest;)I+8 j es.nomenclator.struts.action.MapServerAction$WxSTest_thread.run()V+66 v ~StubRoutines::call_stub


Java Threads: ( => current thread ) 0x02d5c5d8 JavaThread "Thread-42" daemon [_thread_in_native, id=5340] =>0x02d48788 JavaThread "Thread-41" daemon [_thread_in_native, id=5836] 0x00a82ea0 JavaThread "TP-Monitor" daemon [_thread_blocked, id=6040] 0x00a82518 JavaThread "TP-Processor4" daemon [_thread_in_native, id=6004] 0x02d97998 JavaThread "TP-Processor3" daemon [_thread_blocked, id=6240] 0x02d97010 JavaThread "TP-Processor2" daemon [_thread_blocked, id=6260] 0x00aab5d8 JavaThread "TP-Processor1" daemon [_thread_blocked, id=5888] 0x00aa98c0 JavaThread "http-8080-Monitor" [_thread_blocked, id=5948] 0x03252ab8 JavaThread "http-8080-Processor25" daemon [_thread_blocked, id=8136] 0x03251ff0 JavaThread "http-8080-Processor24" daemon [_thread_blocked, id=6032] 0x03251580 JavaThread "http-8080-Processor23" daemon [_thread_blocked, id=6016] 0x03250b10 JavaThread "http-8080-Processor22" daemon [_thread_blocked, id=6068] 0x03250130 JavaThread "http-8080-Processor21" daemon [_thread_blocked, id=5636] 0x031f7680 JavaThread "http-8080-Processor20" daemon [_thread_blocked, id=6052] 0x031f6c10 JavaThread "http-8080-Processor19" daemon [_thread_in_native, id=6036] 0x031f61a0 JavaThread "http-8080-Processor18" daemon [_thread_blocked, id=6012] 0x0315a220 JavaThread "http-8080-Processor17" daemon [_thread_blocked, id=5984] 0x03159808 JavaThread "http-8080-Processor16" daemon [_thread_blocked, id=6028] 0x031542a8 JavaThread "http-8080-Processor15" daemon [_thread_blocked, id=7832] 0x03161408 JavaThread "http-8080-Processor14" daemon [_thread_blocked, id=5696] 0x02ef0dd0 JavaThread "http-8080-Processor13" daemon [_thread_blocked, id=5016] 0x02ef0c48 JavaThread "http-8080-Processor12" daemon [_thread_blocked, id=5996] 0x03166110 JavaThread "http-8080-Processor11" daemon [_thread_blocked, id=5992] 0x0324b9d0 JavaThread "http-8080-Processor10" daemon [_thread_blocked, id=6000] 0x031673e0 JavaThread "http-8080-Processor9" daemon [_thread_blocked, id=5600] 0x0322dd18 JavaThread "http-8080-Processor8" daemon [_thread_blocked, id=6084] 0x03242808 JavaThread "http-8080-Processor7" daemon [_thread_blocked, id=6112] 0x031ef7f0 JavaThread "http-8080-Processor6" daemon [_thread_blocked, id=5476] 0x031babd0 JavaThread "http-8080-Processor5" daemon [_thread_blocked, id=6140] 0x02f86d80 JavaThread "http-8080-Processor4" daemon [_thread_blocked, id=5700] 0x031d0da0 JavaThread "http-8080-Processor3" daemon [_thread_blocked, id=6124] 0x031526e0 JavaThread "http-8080-Processor2" daemon [_thread_blocked, id=6220] 0x031235c0 JavaThread "http-8080-Processor1" daemon [_thread_blocked, id=6152] 0x031c0c88 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_blocked, id=1860] 0x031c1bc8 JavaThread "MySQL Statement Cancellation Timer" daemon [_thread_blocked, id=6168] 0x02d36d10 JavaThread "Timer-0" daemon [_thread_blocked, id=5288] 0x00a72148 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=5536] 0x00a70dc8 JavaThread "CompilerThread0" daemon [_thread_blocked, id=4412] 0x00a700c0 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=5348] 0x00a6af70 JavaThread "Finalizer" daemon [_thread_blocked, id=6180] 0x00a6ab00 JavaThread "Reference Handler" daemon [_thread_blocked, id=4328] 0x003a64f8 JavaThread "main" [_thread_in_native, id=5036]

Other Threads: 0x00a681d0 VMThread [id=6268] 0x00a6fda0 WatcherThread [id=5272]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap def new generation total 768K, used 190K [0x22ad0000, 0x22ba0000, 0x22fb0000) eden space 704K, 27% used [0x22ad0000, 0x22affb18, 0x22b80000) from space 64K, 0% used [0x22b80000, 0x22b80000, 0x22b90000) to space 64K, 0% used [0x22b90000, 0x22b90000, 0x22ba0000) tenured generation total 9124K, used 5473K [0x22fb0000, 0x23899000, 0x26ad0000)

the space 9124K, 59% used [0x22fb0000, 0x23508420, 0x23508600, 0x23899000)

compacting perm gen total 8960K, used 8816K [0x26ad0000, 0x27390000, 0x2aad0000)

the space 8960K, 98% used [0x26ad0000, 0x2736c120, 0x2736c200, 0x27390000)

ro space 8192K, 67% used [0x2aad0000, 0x2b02f150, 0x2b02f200, 0x2b2d0000) rw space 12288K, 47% used [0x2b2d0000, 0x2b879750, 0x2b879800, 0x2bed0000)

Dynamic libraries: 0x00400000 - 0x0040d000 C:\Archivos de programa\Java\jdk1.5.0_11\bin\javaw.exe 0x7c910000 - 0x7c9c6000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c901000 C:\WINDOWS\system32\kernel32.dll 0x77da0000 - 0x77e4c000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e50000 - 0x77ee1000 C:\WINDOWS\system32\RPCRT4.dll 0x77d10000 - 0x77da0000 C:\WINDOWS\system32\USER32.dll 0x77ef0000 - 0x77f36000 C:\WINDOWS\system32\GDI32.dll 0x77be0000 - 0x77c38000 C:\WINDOWS\system32\MSVCRT.dll 0x6d740000 - 0x6d8dd000 C:\Archivos de programa\Java\jdk1.5.0_11\jre\bin\client\jvm.dll 0x76b00000 - 0x76b2e000 C:\WINDOWS\system32\WINMM.dll 0x6bd00000 - 0x6bd0d000 C:\WINDOWS\system32\SYNCOR11.DLL 0x6d300000 - 0x6d308000 C:\Archivos de programa\Java\jdk1.5.0_11\jre\bin\hpi.dll 0x76bb0000 - 0x76bbb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d710000 - 0x6d71c000 C:\Archivos de programa\Java\jdk1.5.0_11\jre\bin\verify.dll 0x6d380000 - 0x6d39d000 C:\Archivos de programa\Java\jdk1.5.0_11\jre\bin\java.dll 0x6d730000 - 0x6d73f000 C:\Archivos de programa\Java\jdk1.5.0_11\jre\bin\zip.dll 0x6d540000 - 0x6d553000 C:\Archivos de programa\Java\jdk1.5.0_11\jre\bin\net.dll 0x71a30000 - 0x71a47000 C:\WINDOWS\system32\WS2_32.dll 0x71a20000 - 0x71a28000 C:\WINDOWS\system32\WS2HELP.dll 0x20b00000 - 0x20b45000 C:\WINDOWS\system32\imon.dll 0x71a50000 - 0x71a5a000 C:\WINDOWS\system32\WSOCK32.dll 0x20c00000 - 0x20c0d000 C:\Archivos de programa\Eset\pr_imon.dll 0x77660000 - 0x77681000 C:\WINDOWS\system32\NTMARTA.DLL 0x76f20000 - 0x76f4d000 C:\WINDOWS\system32\WLDAP32.dll 0x774b0000 - 0x775ec000 C:\WINDOWS\system32\ole32.dll 0x71b90000 - 0x71ba3000 C:\WINDOWS\system32\SAMLIB.dll 0x719d0000 - 0x71a10000 C:\WINDOWS\system32\mswsock.dll 0x66740000 - 0x66799000 C:\WINDOWS\system32\hnetcfg.dll 0x71a10000 - 0x71a18000 C:\WINDOWS\System32\wshtcpip.dll 0x10000000 - 0x10095000 C:\ms4w\Apache\cgi-bin\mapscript\java\mapscript.dll 0x04510000 - 0x0473f000 C:\ms4w\Apache\cgi-bin\libmap.dll 0x04740000 - 0x04752000 C:\ms4w\Apache\cgi-bin\zlib1.dll 0x04760000 - 0x04796000 C:\ms4w\Apache\cgi-bin\proj.dll 0x7c340000 - 0x7c396000 C:\WINDOWS\system32\MSVCR71.dll 0x047a0000 - 0x04ba2000 C:\ms4w\tools\gdal-ogr\gdal14.dll 0x745e0000 - 0x7461d000 C:\WINDOWS\system32\ODBC32.dll 0x58c30000 - 0x58cc7000 C:\WINDOWS\system32\COMCTL32.dll 0x7c9d0000 - 0x7d1ee000 C:\WINDOWS\system32\SHELL32.dll 0x77f40000 - 0x77fb6000 C:\WINDOWS\system32\SHLWAPI.dll 0x76360000 - 0x763aa000 C:\WINDOWS\system32\comdlg32.dll 0x7c3a0000 - 0x7c41b000 C:\WINDOWS\system32\MSVCP71.dll 0x770f0000 - 0x7717c000 C:\WINDOWS\system32\OLEAUT32.dll 0x04bb0000 - 0x04bdb000 C:\ms4w\Apache\cgi-bin\libcurl.dll 0x04be0000 - 0x04cee000 C:\ms4w\Apache\cgi-bin\LIBEAY32.dll 0x04cf0000 - 0x04d21000 C:\ms4w\Apache\cgi-bin\SSLEAY32.dll 0x55300000 - 0x5542a000 C:\ms4w\Apache\cgi-bin\pdflib.dll 0x04d30000 - 0x04d4d000 C:\ms4w\Apache\cgi-bin\LIBPQ.dll 0x76740000 - 0x76749000 C:\WINDOWS\system32\SHFOLDER.dll 0x04d50000 - 0x04e64000 C:\ms4w\Apache\cgi-bin\iconv.dll 0x04e70000 - 0x04e7d000 C:\ms4w\Apache\cgi-bin\libfcgi.dll 0x04e80000 - 0x04f6c000 C:\ms4w\Apache\cgi-bin\geos_c.dll 0x04f70000 - 0x0505a000 C:\ms4w\Apache\cgi-bin\libxml2.dll 0x773a0000 - 0x774a2000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll 0x20000000 - 0x20018000 C:\WINDOWS\system32\odbcint.dll 0x612d0000 - 0x612eb000 C:\WINDOWS\system32\odbccp32.dll 0x77bd0000 - 0x77bd8000 C:\WINDOWS\system32\VERSION.dll 0x76ee0000 - 0x76f07000 C:\WINDOWS\system32\DNSAPI.dll 0x76f70000 - 0x76f78000 C:\WINDOWS\System32\winrnr.dll 0x76f80000 - 0x76f86000 C:\WINDOWS\system32\rasadhlp.dll 0x00000000 - 0x00000000

VM Arguments: jvm_args: -Dcatalina.home=C:\Tomcat 5 -Dcatalina.base=C:\Tomcat 5 -Djava.endorsed.dirs=C:\Tomcat 5/common/endorsed -Djava.io.tmpdir=C:\Tomcat 5\temp -Djava.library.path=C:\Archivos de programa\Java\jdk1.5.0_11\bin;C:\Tomcat 5\bin;C:/ms4w/Apache/cgi-bin/mapscript/java;C:/ms4w/Apache/cgi-bin -Dsun.io.useCanonCaches=false java_command: org.apache.catalina.startup.Bootstrap start Launcher Type: SUN_STANDARD

Environment Variables: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\ms4w\tools\gdal-ogr;C:\ms4w\Apache\cgi-bin;C:\ms4w\Apache\cgi-bin\mapscript\java USERNAME=victorherrero OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 9, GenuineIntel


OS: Windows XP Build 2600 Service Pack 2

CPU:total 1 (cores per cpu 1, threads per core 1) family 15 model 2 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2

Memory: 4k page, physical 1539616k(618212k free), swap 3484984k(2705696k free)

vm_info: Java HotSpot(TM) Client VM (1.5.0_11-b03) for windows-x86, built on Dec 15 2006 01:16:12 by "java_re" with MS VC++ 6.0

Attachments (1)

Wxs.java (2.2 KB ) - added by victorH 17 years ago.
the class that produce the error

Download all attachments as: .zip

Change History (3)

by victorH, 17 years ago

Attachment: Wxs.java added

the class that produce the error

comment:1 by unicoletti, 17 years ago

Can you send me the map file, I believe it's something there. On my computer it runs well with test.map from mapserver source.

Please send it to: umberto.nicoletti _at_ gmail.com

comment:2 by unicoletti, 16 years ago

Resolution: invalid
Status: newclosed

Victor, you never sent the mapfile...I assume in the end it worked out. Closing.

Note: See TracTickets for help on using tickets.