Cant connect to Phoenix using JDBC in spring boot

I have a spring-boot application where I am trying to configure phoenix DataSource but getting "no suitable Driver" found error.

@DependsOn(value = "placeholderConfigurer")
public DataSource phoenixDataSource() {
        SimpleDriverDataSource phoenixDataSource = new SimpleDriverDataSource();
        phoenixDataSource.setUrl( "jdbc:phoenix:localhost" );
        try {
            Class<?> driverClass = this.getClass().getClassLoader().loadClass("org.apache.phoenix.jdbc.PhoenixDriver");
            phoenixDataSource.setDriverClass((Class<? extends Driver>) driverClass);
        } catch( ClassNotFoundException e ) {
            // TODO Auto-generated catch block

        return phoenixDataSource;

    @Bean(name = "phoenixJdbcTemplate")
    public JdbcTemplate phoenixJdbcTemplate(@Qualifier("phoenixDataSource") DataSource ds) {
        return new JdbcTemplate(ds);