Java Message \"java:49 type expected\"

When I try to compile the java service provided with the 4.6 demo software I get a “java:49 type expected” compile error on the line of code “pipelineCursor.first ( “GSG_ack_number” );” in the program.

This is probably a simple problem. But can anyone tell me why I am getting this error.

Thanks for the help.

are you sure that’s the line causing the problem?
If you are doing a getValue after that are you explicitly casting?ie
“String widget = (String)pipelineCursor.getValue();”
Just a guess - hope it helps

Thanks for the reply. I did have an error in a related line. The following line read:

“StringGSG_ack_number = (String) pipelineCursor.getValue();”

instead of

“String GSG_ack_number = (String) pipelineCursor.getValue();”

Should the following line go before or after the line above:

“pipelineCursor.first( “transaction_number” );”

Or could there be something wrong with my environment?

I really appreciate your help.

The correct sequence for logData.java is:


line 1:
IDataHashCursor pipelineCursor = pipeline.getHashCursor();

line 2:
pipelineCursor.first(“GSG_ack_number”);

line 3:
String GSG_ack_number = (String)pipelineCursor.getValue();

line 4:
pipelineCursor.first(“transaction_number”);

line 5:
String transaction_number = (String) pipelineCursor.getValue();

Your code snippet should be

IDataCursor pipelineCursor = pipeline.getCursor();

pipelineCursor.first( “transaction_number” );

String GSG_ack_number = (String) pipelineCursor.getValue();

pipelineCursor.destroy();

HTH…