Skip to content

org.springframework.dao.InvalidDataAccessApiUsageException: object is not an instance of declaring class #132

Open
@furlatq

Description

@furlatq

Hi, I'm facing the following error and just can't figure out what's the solution for it... I made all configuration like specified but seems that my JPA context is not getting the right class for DataTablesRepository.

Here's what I have:

  • Spring version 4.1.1
  • Spring JPA 1.7.1
  • Java 7

My repository context xml:

<jpa:repositories factory-class="org.springframework.data.jpa.datatables.repository.DataTablesRepositoryFactoryBean"
    		base-package="br.com.xx.paginated.repository" />
    <jpa:repositories base-package="br.com.xx.repository" />

My repository declaration:

package br.com.xx.paginated.repository;
import org.springframework.data.jpa.datatables.repository.DataTablesRepository;

import br.com.xx.entity.AuditoriaProduto;

public interface AuditoriaProdutoRepository extends DataTablesRepository<AuditoriaProduto, Integer> {
}

My service class:

@Service	
public class AuditoriaProdutoServiceImpl implements AuditoriaProdutoService {

	@Autowired
	private AuditoriaProdutoRepository auditoriaProdutoRepository;

        @Override
	public DataTablesOutput<AuditoriaProduto> findAll(DataTablesInput dti) {
		return auditoriaProdutoRepository.findAll(dti);
	}
}

But when I inspect the repository, it has underlying class of SimpleJPARepository instead of the DataTables repository... then I get the error mentioned.

Any ideas of what I'm missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions