Truncated file error due to array input variable

28 views
Skip to first unread message

Karel Kruger

unread,
Nov 28, 2012, 1:27:45 AM11/28/12
to fb...@googlegroups.com
Hi everyone

I have a question relating to the use of arrays in FBDK. I created a basic function block, which requires a WSTRING[6] data input variable. The FB compiles, but when I run it it gives a "truncated class file" exception - I think this is due to the array input variable (as it works when I remove it). I have also tested the FB with ARRAY[] and ANY[] datatype arrays - same issue. Can you tell what is my problem?

Strange thing is, you can have a WSTRING[6] output data variable without any trouble...

I really appreciate your help!
K

James Christensen

unread,
Nov 28, 2012, 9:44:42 AM11/28/12
to fb...@googlegroups.com
"Truncated class file" is an error that results from trying to load a
class whose compilation terminated abnormally; this can sometimes
produce a .class file of zero length. You should see a compiler error
when trying to compile the offending Java class.

James Christensen

unread,
Nov 28, 2012, 10:56:10 AM11/28/12
to fb...@googlegroups.com
The problem is not with the WSTRING[6] input. Attached find 3 files,
all of which compile and run correctly: WS_GET reads a value from a
WSTRING[6] input, WS_PUT writes a value into a WSTRING[6] output, and
WS_DB combines WS_PUT and WS_GET into a simple "data base" (though a
HashTable would be a lot more flexible).
--
Best regards,
Jim Christensen
WS_PUT.fbt
WS_DB.fbt
WS_GET.fbt

Karel Kruger

unread,
Dec 3, 2012, 5:06:02 PM12/3/12
to fb...@googlegroups.com
Hi Jim

Thank you for the reply and the attached function blocks. I downloaded your function blocks and opened them in fbdk. I could successfully compile the function blocks, but when I wanted to run it, it gave the same "truncated class file" error as before. If they worked perfectly for you, does it mean that something is not working with my compiler? What could be the possible problem?

Appreciate the help!
Regards
Karel


James Christensen

unread,
Dec 3, 2012, 6:46:23 PM12/3/12
to fb...@googlegroups.com
Karel, look at the compiled .class files in the /lib hierarchy. See if
any of them look strange, e.g., zero length.
--
Best regards,
Jim Christensen

Reply all
Reply to author
Forward
0 new messages