Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GWT can't compile SMC generated code

 
Jerry Storm
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used SMC (State Machine Compiler) to generate Java code I wanted to use in GWT. The code looks trivial, and I can compile it with javac with no problem.
However GWT produces errors like:

[java] [ERROR] Line 11: statemap cannot be resolved to a type
[java] [ERROR] Line 39: _transition cannot be resolved
[java] [ERROR] Line 41: _transition cannot be resolved
[java] [ERROR] Line 46: statemap cannot be resolved to a type
[java] [ERROR] Line 48: _state cannot be resolved

What can be the problem?

Here is the source code: (I could not attach a file)


 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

GWT accepts only those java classes for the client side, which it can convert to JS. Looks like your smc package cannot.
 
Jerry Storm
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand this, I want to know what causes the problem so that I can maybe address it.
 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
statemap.FSMContext is not in the client or shared package? Is it inherited?
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jerry Storm wrote:I understand this, I want to know what causes the problem so that I can maybe address it.

This can only work if
1) Is the source code for the smc package available to GWT to 'compile' to JS?
2) Ensure the smc package uses only 'white listed' classes.
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hauke Ingmar Schmidt wrote:statemap.FSMContext is not in the client or shared package? Is it inherited?

I think then Jerry would have got the "Did you inherit the ...." error message.
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic