type "" is not a member of package controllers play framework

type racer
learn to type
nitro type
type test
type practice
type game
typing
typing club

I'm following a tutorial of the Play Framework but I occurred in a problem, I wrote this object:

package controllers

import play.api.mvc._

object Tickets extends Controller {
  def ticketsAvailable = Action { request =>
    val availableTickets = 1000
    Ok(availableTickets.toString)
  }
}

and then add the routes:

GET     /tickets/available/         controllers.Tickets.ticketsAvailable

but when I compiled and received this error:

type Tickets is not a member of package controllers

Anyone can help me with an example of how i can fix this problem?

Thanks

Change your object to a class, ie.

class Tickets extends Controller {

And of course Tickets.scala should be packaged under app/controllers.

TypingClub: Learn Touch Typing Free, a design on either side of a medal or coin. type: [noun] a particular kind, class, or group. something distinguishable as a variety : sort. a member of an indicated class or variety of people. a typical and often superior specimen. qualities common to a number of individuals that distinguish them as an identifiable class: such as. the morphological, physiological, or ecological

I changed my code from Object ApplictionController extends Controller{} to Class ApplicationController extends Controller{} and it worked.

TypeRacer, an abstract category or class of linguistic item or unit, as distinct from actual occurrences in speech or writing. Type definition, a number of things or persons sharing a particular characteristic, or set of characteristics, that causes them to be regarded as a group, more or less precisely defined or designated; class; category: a criminal of the most vicious type.

I encountered the same problem after introducing a compilation error into a class the controller uses.

Specifically, I didn't finish a method call. Instead of doing object.someMethod(), I wrote object..

So, the type is not a member... error could mean that one or more of your controllers have trouble instantiating.

Typing practice, write (something) on a typewriter or computer by pressing the keys. Having the ability to type without looking at the keyboard is the most important factor in achieving a fast typing speed. Even if you have memorized many of the keys, unfamiliar keys will slow you down just like speed bumps on the freeway.

Learn to Type, determine the type to which (a person or their blood or tissue) belongs. TypingTest.com offers a free online Typing Test and exciting typing games and keyboarding practice. Check your wpm for free now!

Type, 1 : a particular kind or group of things or people : variety a seedless type of orange He likes all types of books. 2 : a set of letters or figures that are used for printing or the letters or figures printed by them. TypingClub is the most effective way to learn how to type. It is web based and highly effective. TypingClub is (and will always be) free for both individuals and schools. There is an optional paid school edition. Get Started Now

TYPE, The award-winning online typing competition, TypeRacer, is the best free typing game in the world. Race against live opponents typing quotes from books,� Free typing practice and lessons. Practice typing great quotes from great books! Stimulate your mind while you exercise your fingers. You will learn to type faster as you apply the technique taught in our free touch typing lessons.

Comments
  • Hi Nio. Your answer has a few months but it solves my issue as well. Can you explain me why modifying object to class solve this particular problem?
  • ohe, since version 2.4 Play (by default) adopts the use of Dependency Injection (Google Guice) out of the box in it's bid to remove global state from the framework. Read this in the docs - it explains things a bit more clearly.