开发者

Play in Production - Secure cannot be resolved to a type

I have developed a little program for myself. After testing and finishing it locally I now wanted to put it on my server.

I get this error:

Compilation error The file /app/controllers/Links.java could not be compiled. Error raised is : Secure cannot be resolved to a type

It is thrown at this line:

@With(Secure.class) 

In the Class Links I have:

   import play.mvc.With; 

   import controllers.*; 

   @With(Secure.class) 

   public class Links extends CRUD { 
   } 

I have installed play 1.2.2 on my server. Play is running probably. I type in the terminal "play start appname" and opened serverIp:9010 to see this error. If I type "play precompile appname" everything seems to work.

In the subfolder /modules of the app I have two text files, one "crud" and one "secure" which point to the modules location on the server. I also have defined the modules in dependencies.yml like this:

require: 
    - play 
    - crud 
    - secure 

In the application.conf I have a Production definition for my server with the proper Server-ID like this:

%server1.application.mode=PROD 

Any idea why this isn't working开发者_JS百科?


I have solved it. For future reference:

I had an old process of play running. Found it with ps -aux and then kill PID. After that I started the application again with play start.

It's now running fine :)

Thanks for you help!


Declaring the secure module in dependencies.yml file is the first step.

Next you have to type the shell command "play dependencies" in order to resolve them.

Just have a glance on the documentation here : http://www.playframework.org/documentation/1.2.2/dependency#Theplaydependenciescommand

Have fun with Play!


Sometimes you have to refesh the classpath settings by using play eclipsify again. (depends on the IDE you are using)


I had to insert this line to application.config

module.secure=${play.path}/modules/secure


I had the same problem in my development environment, but not in my production server. I tried to solve by the module documentation, the accepted answer here, and many others with no success.

My solution was to download again play framework (1.2.7) and replacing it in the path where I installed first.

Hope this can guide someone else with the same issue.

Regards.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜