Search code examples
jolie

error: Invalid token encountered. Found token type ID, token content from


I am using Visual Code and have typed in a sample code from the Jolie site. When I try to run the service from the terminal using "jolie CalculatorService.ol" I get this error

error: Invalid token encountered. Found token type ID, token content from

The CalculatorService.ol starts with this code

from CalculatorInterfaceModule import CalculatorInterface {
    service CalculatorService {
        
        inputPort CalculatorPort {
            location: "socket://localhost:8000"
            protocol: http {format = "json" }
            interfaces: CalculatorInterface
        }
...

I have seen another post suggesting to check for encoding issues. It is not.

Appreciate any lead to identify the issue?


Solution

  • Welcome to the Jolie community!

    You have an extra "{" at the end of the first line, it's probably that. Also, that "CalculatorInterfaceModule" in the import statement might need to be ".CalculatorInterfaceModule" (notice the dot, meaning "in this directory") if that module is not in a package path.

    The rest of your code looks fine, so if you still encounter the problem I might need to see more.

    By the way, just to make sure, this syntax requires Jolie version 1.10.