These are chat archives for spring-cloud/spring-cloud

Jan 2018
Andrew Fitzgerald
Jan 04 2018 05:05
This message was deleted
Jan 04 2018 08:21

public interface BaseRepository<T, ID extends Serializable> extends Repository<T, ID> {

    Optional<T> deleteById(ID id);

    public List<T> findByAttributeContainsText(String attributeName, String text);

public class BaseRepositoryImpl<T, ID extends Serializable>
        extends SimpleJpaRepository<T, ID> implements BaseRepository<T, ID> {

    private final EntityManager entityManager;

    public BaseRepositoryImpl(JpaEntityInformation entityInformation,  EntityManager entityManager) {
        super(entityInformation, entityManager);
        this.entityManager = entityManager;

    public Optional<T> deleteById(ID id) {
        T deleted = entityManager.find(this.getDomainClass(), id);
        Optional<T> returned = Optional.empty();

        if (deleted != null) {
            returned = Optional.of(deleted);
        return returned;

    public List<T> findByAttributeContainsText(String attributeName, String text) {
        CriteriaBuilder builder = entityManager.getCriteriaBuilder();
        CriteriaQuery<T> cQuery = builder.createQuery(getDomainClass());
        Root<T> root = cQuery.from(getDomainClass());
                        .like(root.<String>get(attributeName), "%" + text + "%"));
        TypedQuery<T> query = entityManager.createQuery(cQuery);
        return query.getResultList();

public interface TodoRepository  extends BaseRepository<Todo, Integer> {}

java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'todoRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Failed to create query method public abstract java.util.List,java.lang.String)! No property attributeContainsText found for type Todo!
Caused by: No property attributeContainsText found for type Todo!
Caused by: No property attributeContainsText found for type Todo!
I have created a customized base jpa repository, But I get this error
Jan 04 2018 20:02
Hi guys
iam trying to run Spring boot web application with @Enabletask annotation in my main class.
iam getting Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@20ccf40b: startup date [Fri Jan 05 01:29:03 IST 2018]; root of context hierarchy
I could't find the issue
can we run the application in embedded tomcat?
I added Springcloudtask dependencies to my existing spring batch application
And @EnableTask annotation to my main class.
Do we need to to any more configs?
Dave Syer
Jan 04 2018 22:19
You might want to add if your app is long lived (it is not the default)
I don't really understand why that is not the default. You could take it up in github if you want to argue that way.