Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

play2 framework my template is not seen. : package views.html does not exist

The problem is that controller doesn't see template I want to use:

[etl_admin] $ compile [info] Compiling 3 Scala sources and 4 Java sources to D:\ECLIPSE_WORKSPACES\play2_apps\etl_admin\target\scala-2.9.1\classes... [error] D:\ECLIPSE_WORKSPACES\play2_apps\etl_admin\app\controllers\EtlWorkflowSeqNodeController.java:7: error: package views.html.etlworkflowseqnode does not exist [error] import views.html.etlworkflowseqnode.list; [error]
^ [error] D:\ECLIPSE_WORKSPACES\play2_apps\etl_admin\app\controllers\EtlWorkflowSeqNodeController.java:14: error: cannot find symbol

[error] list.render(EtlWorkflowSeqNode.findTree(jobId)) [error] ^ [error] symbol: variable list [error]
location: class EtlWorkflowSeqNodeController [error] 2 errors [error] {file:/D:/ECLIPSE_WORKSPACES/play2_apps/etl_admin/}etl_admin/compile:compile: javac returned nonzero exit code [error] Total time: 7 s, completed 05.06.2012 17:14:44

Here is controller code:

package controllers;

import play.mvc.Controller;
import play.mvc.Result;
import models.EtlWorkflowSeqNode;
import play.db.jpa.Transactional;
import views.html.etlworkflowseqnode.list; /*LINE #7, Eclipse really tells that there is no such package*/

public class EtlWorkflowSeqNodeController  extends Controller {

    @Transactional
    public static Result list(Integer jobId) {
        return ok(
            list.render(EtlWorkflowSeqNode.findTree(jobId))
        );
    }
}

I've attached an image with my project tree. There is such package and there is template named "list". My Eclipse what do I do Wrong

like image 662
Capacytron Avatar asked Jun 06 '12 07:06

Capacytron


1 Answers

Omg, the problem was so easy! *classes_managed* (this folder keeps compiled scala templates) were not updated with newly added templates. I did try to call play compile yesterday, it doesn't help. New templates from new package were not compiled. This morning I've called play clean compile aaand... hooray! I did get compiled templates and problem with missing package gone away (don't forget to refresh Eclipse project, force it to update exisitng project structure from file system. It likes to cache everything.)

Sorry for disturbing, seems like I wasn't attentive while reading documentation :(

like image 167
Capacytron Avatar answered Sep 30 '22 15:09

Capacytron