aspose file tools*
The moose likes GWT and the fly likes GWT can't compile SMC generated code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "GWT can Watch "GWT can New topic
Author

GWT can't compile SMC generated code

Jerry Storm
Greenhorn

Joined: Apr 15, 2011
Posts: 6
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

Joined: Jul 26, 2007
Posts: 10451
    
    8

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.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Jerry Storm
Greenhorn

Joined: Apr 15, 2011
Posts: 6
I understand this, I want to know what causes the problem so that I can maybe address it.
Hauke Ingmar Schmidt
Rancher

Joined: Nov 18, 2008
Posts: 433
    
    2
statemap.FSMContext is not in the client or shared package? Is it inherited?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

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

Joined: Jul 26, 2007
Posts: 10451
    
    8

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

Joined: Jul 26, 2007
Posts: 10451
    
    8

Found and added the white listed classes.
http://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GWT can't compile SMC generated code