hackerham
12/02/2016, 3:46 PMhackerham
12/02/2016, 3:47 PMsss
12/02/2016, 3:49 PMjakub.dyszkiewicz
12/03/2016, 7:23 PM@SpringBootApplication
@EnableJpaRepositories
@ComponentScan("customer")
open class Application {
}
fun main(args: Array<String>) {
SpringApplication.run(Application::class.java, *args)
}
Repository
interface CustomerRepository : JpaRepository<Customer, Long> {
}
Service
@Service
open class CustomerService(val repository: CustomerRepository) {
}
What am I missing here? 🙂jakub.dyszkiewicz
12/03/2016, 7:23 PMParameter 0 of constructor in customer.CustomerService required a bean of type 'customer.CustomerRepository' that could not be found.
yousuf.haque
12/03/2016, 9:37 PMopen class CustomerService @Autowired constructor val repository : CustomerRepository)
jakub.dyszkiewicz
12/03/2016, 9:43 PM@Autowried
annotation is not required when injecting via constructor since Spring 4.3
@Repository
is also not required when you extend Repository
interface.
Actually I moved Application class to package with repository and service and it started working so there is something definitely wrong with package scanningjakub.dyszkiewicz
12/03/2016, 9:43 PMorangy
fellshard
12/05/2016, 8:29 AMorangy
fellshard
12/07/2016, 10:15 PMfellshard
12/07/2016, 10:16 PMorangy
orangy
fellshard
12/07/2016, 10:18 PMfellshard
12/07/2016, 10:18 PMorangy
sdeleuze
12/12/2016, 3:36 PMchristophsturm
12/13/2016, 9:55 AMsdeleuze
12/13/2016, 9:56 AMsss
12/13/2016, 2:03 PMsdeleuze
12/13/2016, 2:08 PMsss
12/13/2016, 2:15 PMsdeleuze
12/13/2016, 2:16 PMsdeleuze
12/13/2016, 2:17 PMsss
12/13/2016, 2:20 PMhackerham
12/13/2016, 2:29 PMhackerham
12/13/2016, 2:29 PMhackerham
12/13/2016, 2:29 PM