I'm trying to implement Spring Profiles to load a specific class implementation based on the profile specified. The profile to use is specified as a property (spring.profiles.active) within a properties file included in the classpath.

Source here: <https://github.com/overattribution/spring-profile-test>

```
public interface MyService {
    public void doSomething();
}

@Service
@Profile("preprod")
public class MyServicePreProdImpl implements MyService {
    private final Logger LOG = LoggerFactory.getLogger(MyServicePreProdImpl.class);
    @Override
    public void doSomething() {
        LOG.debug("Doing something in " + MyServicePreProdImpl.class.getName());
    }
}

@Service
@Profile("prod")
public class MyServiceProdImpl implements MyService {
    private final Logger LOG = LoggerFactory.getLogger(MyServiceProdImpl.class);
    @Override
    public void doSomething() {
        LOG.debug("Doing something in " + MyServiceProdImpl.class.getName());
    }
}

```

However, I'm getting the following error:
No qualifying bean of type [com.example.profileservice.MyService] found for dependency.

What am I missing?

**UPDATE 1:**

I'm manually setting the active profile during web application initialization, but I'm still getting the "No qualifying bean found" error. Changes can be seen here: <https://github.com/overattribution/spring-profile-test/commit/09175a10b28ea8e5a08b43ad1416431bcf094c9d>