 |
codeworker A universal parsing tool & a source code generator
|
| View previous topic :: View next topic |
| Author |
Message |
watteau newbie
Joined: 31 Jul 2008 Posts: 3
|
Posted: Thu Jul 31, 2008 10:32 pm Post subject: EXCEPTION_ACCESS_VIOLATION |
|
|
Hello,
I try to use CodeWorker in a java project :
Basic test for the moment :
| Code: |
// load the JNI library of CodeWorker
try {
System.loadLibrary("JNICodeWorker");
} catch(Exception exception) {
System.out.println("Unable to load the library: '" + exception.toString() + "'");
}
// Set Dynamic attributes
ParseTree pContext = new ParseTree();
pContext.insertNode("fileName");
pContext.getNode("fileName").setValue("Mon_doc.txt");
// My source String
String desc = "@fileName@ : @getNow()@";
CompiledTranslationScript script = new CompiledTranslationScript();
// My translated String
String r = script.translateString(pContext, desc);
System.out.println(r);
|
and i have the message :
| Quote: |
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100203e1, pid=2912, tid=972
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
# Problematic frame:
# C [JNICodeWorker.dll+0x203e1]
#
# An error report file with more information is saved as hs_err_pid2912.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
|
and the log file :
| Quote: |
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100203e1, pid=2912, tid=972
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
# Problematic frame:
# C [JNICodeWorker.dll+0x203e1]
#
--------------- T H R E A D ---------------
Current thread (0x00737de0): JavaThread "main" [_thread_in_native, id=972]
siginfo: ExceptionCode=0xc0000005, reading address 0x00000000
Registers:
EAX=0x0006f9c8, EBX=0x0ad05780, ECX=0x00000000, EDX=0x00000003
ESP=0x0006f968, EBP=0x0006fa14, ESI=0x0ad05820, EDI=0x0ad04ba0
EIP=0x100203e1, EFLAGS=0x00010206
Top of Stack: (sp=0x0006f968)
0x0006f968: 009d81cc 00737ea0 0ad05780 0ad04ba0
0x0006f978: 0006fa08 100fb348 ffffffff 10004e97
0x0006f988: 0ad05780 0006f9a0 0006f9c8 00737de0
0x0006f998: 06c004c8 06c004c8 6d7c3338 0ad05830
0x0006f9a8: 00737178 06c004c8 6d8756bc 00000017
0x0006f9b8: 0000001f 00000000 0ad05820 009ff898
0x0006f9c8: 00015338 00000000 0000000d 00737178
0x0006f9d8: 00737de0 00000000 0000000f 0006fa0c
Instructions: (pc=0x100203e1)
0x100203d1: ff ff 8b 00 a3 3c 18 16 10 8b 44 24 28 8b 4e 04
0x100203e1: 8b 11 53 50 8b 44 24 2c 50 c7 44 24 24 00 00 00
Stack: [0x00030000,0x00070000), sp=0x0006f968, free space=254k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [JNICodeWorker.dll+0x203e1]
j org.codeworker.jni.CompiledTranslationScript.translateString(Lorg/codeworker/jni/ParseTree;Ljava/lang/String;)Ljava/lang/String;+0
j com.damart.SAR.SARTest.run()V+84
j com.damart.SAR.SARTest.main([Ljava/lang/String;)V+9
v ~StubRoutines::call_stub
V [jvm.dll+0x871a8]
V [jvm.dll+0xdf462]
V [jvm.dll+0x87079]
V [jvm.dll+0x8e0d5]
C [javaw.exe+0x14c5]
C [javaw.exe+0x3151]
C [KERNEL32.DLL+0x2893d]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j org.codeworker.jni.CompiledTranslationScript.translateString(Lorg/codeworker/jni/ParseTree;Ljava/lang/String;)Ljava/lang/String;+0
j com.damart.SAR.SARTest.run()V+84
j com.damart.SAR.SARTest.main([Ljava/lang/String;)V+9
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x009e6828 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3204]
0x00737aa0 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2660]
0x009e4830 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2152]
0x009db5a8 JavaThread "Finalizer" daemon [_thread_blocked, id=1552]
0x009da0d0 JavaThread "Reference Handler" daemon [_thread_blocked, id=2536]
=>0x00737de0 JavaThread "main" [_thread_in_native, id=972]
Other Threads:
0x009d7610 VMThread [id=2156]
0x009e7dc0 WatcherThread [id=828]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
def new generation total 576K, used 201K [0x02aa0000, 0x02b40000, 0x02f80000)
eden space 512K, 39% used [0x02aa0000, 0x02ad2710, 0x02b20000)
from space 64K, 0% used [0x02b20000, 0x02b20000, 0x02b30000)
to space 64K, 0% used [0x02b30000, 0x02b30000, 0x02b40000)
tenured generation total 1408K, used 0K [0x02f80000, 0x030e0000, 0x06aa0000)
the space 1408K, 0% used [0x02f80000, 0x02f80000, 0x02f80200, 0x030e0000)
compacting perm gen total 8192K, used 1409K [0x06aa0000, 0x072a0000, 0x0aaa0000)
the space 8192K, 17% used [0x06aa0000, 0x06c007e8, 0x06c00800, 0x072a0000)
No shared spaces configured.
Dynamic libraries:
0x00400000 - 0x0040d000 C:\java\jdk_1.5_u11\bin\javaw.exe
0x78460000 - 0x784e3000 C:\WINNT\system32\ntdll.dll
0x78ed0000 - 0x78f32000 C:\WINNT\system32\ADVAPI32.dll
0x77e70000 - 0x77f2e000 C:\WINNT\system32\KERNEL32.DLL
0x770c0000 - 0x77131000 C:\WINNT\system32\RPCRT4.DLL
0x77e00000 - 0x77e65000 C:\WINNT\system32\USER32.dll
0x77f40000 - 0x77f7b000 C:\WINNT\system32\GDI32.DLL
0x78000000 - 0x78045000 C:\WINNT\system32\MSVCRT.dll
0x6d740000 - 0x6d8dd000 C:\java\jdk_1.5_u11\jre\bin\client\jvm.dll
0x77540000 - 0x77571000 C:\WINNT\system32\WINMM.dll
0x6d300000 - 0x6d308000 C:\java\jdk_1.5_u11\jre\bin\hpi.dll
0x68ea0000 - 0x68eab000 C:\WINNT\system32\PSAPI.DLL
0x6d710000 - 0x6d71c000 C:\java\jdk_1.5_u11\jre\bin\verify.dll
0x6d380000 - 0x6d39d000 C:\java\jdk_1.5_u11\jre\bin\java.dll
0x6d730000 - 0x6d73f000 C:\java\jdk_1.5_u11\jre\bin\zip.dll
0x10000000 - 0x1018b000 C:\java\jdk_1.5_u11\jre\bin\JNICodeWorker.dll
0x74fb0000 - 0x74fc4000 C:\WINNT\system32\WS2_32.dll
0x74fa0000 - 0x74fa8000 C:\WINNT\system32\WS2HELP.DLL
0x7c340000 - 0x7c396000 C:\WINNT\system32\MSVCR71.dll
0x7c3a0000 - 0x7c41b000 C:\WINNT\system32\MSVCP71.dll
VM Arguments:
jvm_args: -Dfile.encoding=Cp1252
java_command: com.damart.SAR.SARTest
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=C:\java\jdk_1.5_u11
CLASSPATH=C:\WDSC\JAVA;.
PATH=C:/java/jdk_1.5_u11/bin/../jre/bin/client;C:/java/jdk_1.5_u11/bin/../jre/bin;C:\java\jdk_1.5_u11\bin;C:\Tools\cygwin\bin;C:\Tools\cygwin\usr\X11R6\bin;C:\ibmdebug\bin;C:\WDSC;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\WINNT\system32\nls;C:\WINNT\system32\nls\FRANCAIS;C:\Program Files\IBM\Client Access;C:\Program Files\IBM\Client Access\Shared;C:\Program Files\IBM\Client Access\Emulator;c:\Program Files\ViaVoiceTTS;C:\Program Files\UltraEdit;C:\Program Files\ShowCase Suite\Bin;C:\Program Files\ShowCase Suite\JRE\bin;C:\Program Files\ShowCase Suite\JRE\bin\client;C:\PROGRA~1\IBM\CLIENT~1;C:\PROGRA~1\IBM\CLIENT~1\Shared;C:\PROGRA~1\IBM\CLIENT~1\Emulator;C:\Program Files\IBM\GSK7\bin;C:\Program Files\IBM\GSK7\lib;C:\Program Files\IBM\ITM\bin;C:\Program Files\IBM\ITM\bin\dll;C:\Program Files\IBM\ITM\Install;C:\Program Files\IBM\ITM\InstallITM;C:\Program Files\IBM\ITM\TMAITM6;C:\java\apache-maven-2.0.9\bin;C:\Java\MySQL\MySQL Server 5.1\bin
USERNAME=WATTEAU
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 15 Model 3 Stepping 4, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 2000 Build 2195 Service Pack 4
CPU:total 1 (cores per cpu 1, threads per core 2) family 15 model 3 stepping 4, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ht
Memory: 4k page, physical 1039344k(263148k free), swap 3039104k(2116984k 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
|
Can you help me ?
Regards, Franck |
|
| Back to top |
|
 |
clemaire newbie

Joined: 09 May 2008 Posts: 13
|
Posted: Fri Aug 01, 2008 3:56 am Post subject: |
|
|
Hello,
You have forgotten to specify what translation script to execute.
| Code: | CompiledTranslationScript script = new CompiledTranslationScript();
// ** The translation script to execute **
script.buildFromFile("MyTranslationScript.cwp");
// My translated String
String r = script.translateString(pContext, desc);
|
It shouldn't have crashed; I'll fix it. |
|
| Back to top |
|
 |
watteau newbie
Joined: 31 Jul 2008 Posts: 3
|
Posted: Fri Aug 01, 2008 5:13 pm Post subject: EXCEPTION_ACCESS_VIOLATION |
|
|
Effectively, it's correct.
A last answer: how create an array in a parse tree ?
like
| Code: |
local list;
insert list["twin peaks"] = "twin peaks";
insert list["everest"] = "everest";
traceline(list#[1]);
|
| Code: |
// load the JNI library of CodeWorker
try {
System.loadLibrary("JNICodeWorker");
} catch(Exception exception) {
System.out.println("Unable to load the library: '" + exception.toString() + "'");
}
// Set Dynamic attributes
ParseTree pContext = new ParseTree();
pContext.insertNode("filename").setValue("MARECAUX-Mon_doc.txt");
pContext.insertNode("folder").setValue("gamer repository c");
pContext.insertNode("folder").setValue("repository c");
pContext.insertNode("folder").setValue("c");
pContext.insertNode("format").setValue("%d/%m/%Y");
// Set template
String myTemplate = "Reporting journalier pour l’utilisateur @leftString(this.filename, findString(this.filename, \"-\"))@ (@this.folder@ @getArraySize(this.folder)@) en date du @formatDate(getNow(), this.format)@";
CompiledTemplateScript script = new CompiledTemplateScript();
script.buildFromString(myTemplate);
// Get generated string
String r = script.generateString(pContext, myTemplate);
// Display values
System.out.println(r);
|
Thanks, Franck |
|
| Back to top |
|
 |
clemaire newbie

Joined: 09 May 2008 Posts: 13
|
Posted: Sat Aug 02, 2008 5:08 am Post subject: |
|
|
| Oups! The method org.codeworker.IParseTree addItem(String sKey) is missing! I am going to deliver the version 4.5.2 tomorrow, just including the precedent bug fix and this method. |
|
| Back to top |
|
 |
clemaire newbie

Joined: 09 May 2008 Posts: 13
|
|
| Back to top |
|
 |
watteau newbie
Joined: 31 Jul 2008 Posts: 3
|
Posted: Mon Aug 04, 2008 4:15 pm Post subject: |
|
|
As they say here: "vindious, t'es au taquet toi"
It's ok :
| Code: |
// load the JNI library of CodeWorker
try {
System.loadLibrary("JNICodeWorker");
} catch(Exception exception) {
System.out.println("Unable to load the library: '" + exception.toString() + "'");
throw exception;
}
// Set Dynamic attributes
ParseTree pContext = new ParseTree();
pContext.insertNode("filename").setValue("MARECAUX-Mon_doc.txt");
pContext.insertNode("format").setValue("%d/%m/%Y");
IParseTree folder = pContext.insertNode("folder");
folder.addItem("0").setValue("gamers");
folder.addItem("1").setValue("repository");
folder.addItem("2").setValue("c");
// Set template
String myTemplate = "Reporting journalier pour l’utilisateur @leftString(this.filename, findString(this.filename, \"-\"))@ (@this.folder#[1]@ : @getArraySize(this.folder)@) en date du @formatDate(getNow(), this.format)@";
CompiledTemplateScript script = new CompiledTemplateScript();
script.buildFromString(myTemplate);
// Get generated string
String r = script.generateString(pContext, myTemplate);
// Display values
System.out.println(r);
|
Thanks a lot, Franck |
|
| Back to top |
|
 |
clemaire newbie

Joined: 09 May 2008 Posts: 13
|
Posted: Mon Aug 04, 2008 6:32 pm Post subject: |
|
|
For English people, the above expression (translated word by word) | Quote: | | For Christ's sake, are you in the wedge, you! | means | Quote: | | For Christ's sake, you really throw yourself [in your work]! | . |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|