1. java
  2. android
  3. c#
  4. .net
  5. javascript
  6. php
  7. jquery
  8. html
  9. sql

Problema com Anotacoes do Spring

Gostaria de saber se alguem sabe o que pode estar acontecendo em meu projeto. tenho uma classe abstrata para repositorio e outras que estende ela. porem quando eu coloco a anotacao @Autowired da erro.

vou postar o codigo.

classe abstrata :

package com.simple.repository;

import java.lang.reflect.ParameterizedType;
import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.type.Type;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.simple.model.ModelBase;



public abstract class RepositoryBaseDefault <T extends ModelBase<?>> implements RepositoryBase<T>{

    @Autowired
    private SessionFactory sessionFactory;


    @Transactional
    public void salvar(T objeto){
        Session session = sessionFactory.getCurrentSession();
        Object id = objeto.getId();
        if(id == null) {
            session.save(objeto);
            session.flush();
        }
        else {
             session.merge(objeto); 
             session.flush();
        }

    }


    @Transactional
    public void atualizar(T objeto){
        Session session = sessionFactory.getCurrentSession();
        session.merge(objeto); 
        session.flush();
    }


    @Transactional
    public void delete(T objeto){
        Session session = sessionFactory.getCurrentSession();
        session.delete(objeto);
        session.flush();
    }


    @Transactional
    public void deletarPorId(Long id){
        Session session = sessionFactory.getCurrentSession();
        final T entity = this.buscaPorId(id);  
        session. delete(entity);
        session.flush();
    }

    @Transactional
    public List<T> buscaTodos(){
        Session session = sessionFactory.getCurrentSession();
        Criteria criteria = session.createCriteria(pegarClasseT());
        return (List<T>)criteria.list();
    }


    @Transactional
    public T buscaPorId(Long id){
        Session session = sessionFactory.getCurrentSession();
        T objeto =  (T) session.load(pegarClasseT(), id);
        return objeto;
    }


    private Class<T> pegarClasseT(){
        Type type = (Type) getClass().getGenericSuperclass();
        if ( type instanceof ParameterizedType){
            ParameterizedType paramType = (ParameterizedType)type;
            Class<T> tClass = (Class<T>) paramType.getActualTypeArguments()[0];
            return tClass;
        }else {
            return null;
        }
    }



}

classe que implementa a classe abstrata:

package com.simple.repository.teste;



import org.springframework.stereotype.Repository;

import com.simple.repository.RepositoryBaseDefault;
import com.simple.beans.Teste;

@Repository
public class TesteServiceImpl extends RepositoryBaseDefault<Teste> implements TesteService{

}

e criei uma classe controle para testar se esta funcionando :

package com.simple.Controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.simple.beans.Teste;
import com.simple.repository.teste.TesteServiceImpl;

@Controller
public class TesteController {


    private TesteServiceImpl repo;


    @RequestMapping("/testee")
    public ModelAndView ola() {

        /*
         * Objetos para Teste de Banco de dados.
         */
        Teste t1 = new Teste();
        Teste t2 = new Teste();
        Teste t3 = new Teste();
        Teste t4 = new Teste();

        //salvar 5x para existir registros no banco.

        t1.setName("Teste1 de Salvar OK");
        //repo.salvar(t1);
        t1.setName("Teste2 de Salvar OK");
        //repo.salvar(t1);
        t1.setName("Teste3 de Salvar OK");
        //repo.salvar(t1);
        t1.setName("Teste para busca por Id");
        //repo.salvar(t1);
        t1.setName("Teste5 de Salvar OK");
        //repo.salvar(t1);

        //Alterar
        t2.setId(2L);
        t2.setName("Teste Alterar OK ID 2");
        //repo.atualizar(t2);

        //Buscar Lista imprimir lista para ver o que tem
        //List<Teste> listaTodos = repo.buscaTodos();
        //System.out.println(listaTodos.toString());

        //Buscar por Id
        //t3 = repo.buscaPorId(4L);
        //System.out.println(t3.toString());

        //Delete por id;
        t4.setId(1L);
        //repo.deletarPorId(1L);
        //System.out.println("Deletado Objeto com Id 1");



        System.out.println("Funcionando yes !!!");

        String mensagem = "Metodo teste em Ação";
        ModelAndView modelAndView = new ModelAndView("ola");
        modelAndView.addObject("mensagem", mensagem);
        return modelAndView;

        }

}

quando eu anoto a variavel com a anotacao @Autowired da erro e ela teria que estar anotada para que a aplicacao funcione.

o erro do log a partir do erro.

14:57:07,171 GRAVE [org.springframework.web.servlet.DispatcherServlet] (MSC service thread 1-5) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.simple.repository.teste.TesteServiceImpl com.simple.Controller.TesteController.repo; nested exception is java.lang.IllegalArgumentException: Can not set com.simple.repository.teste.TesteServiceImpl field com.simple.Controller.TesteController.repo to com.sun.proxy.$Proxy26
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) [spring-context-3.2.6.RELEASE.jar:]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) [spring-context-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:599) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:518) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:459) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) [spring-webmvc-3.2.6.RELEASE.jar:]
    at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3631) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3844) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
    at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [:1.8.0]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [:1.8.0]
    at java.lang.Thread.run(Thread.java:744) [:1.8.0]
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.simple.repository.teste.TesteServiceImpl com.simple.Controller.TesteController.repo; nested exception is java.lang.IllegalArgumentException: Can not set com.simple.repository.teste.TesteServiceImpl field com.simple.Controller.TesteController.repo to com.sun.proxy.$Proxy26
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286) [spring-beans-3.2.6.RELEASE.jar:]
    ... 27 more
Caused by: java.lang.IllegalArgumentException: Can not set com.simple.repository.teste.TesteServiceImpl field com.simple.Controller.TesteController.repo to com.sun.proxy.$Proxy26
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) [:1.8.0]
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) [:1.8.0]
    at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81) [:1.8.0]
    at java.lang.reflect.Field.set(Field.java:758) [:1.8.0]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:513) [spring-beans-3.2.6.RELEASE.jar:]
    ... 29 more

14:57:07,176 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/RedySimple]] (MSC service thread 1-5) StandardWrapper.Throwable: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.simple.repository.teste.TesteServiceImpl com.simple.Controller.TesteController.repo; nested exception is java.lang.IllegalArgumentException: Can not set com.simple.repository.teste.TesteServiceImpl field com.simple.Controller.TesteController.repo to com.sun.proxy.$Proxy26
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) [spring-context-3.2.6.RELEASE.jar:]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) [spring-context-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:599) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:518) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:459) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) [spring-webmvc-3.2.6.RELEASE.jar:]
    at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3631) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3844) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
    at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [:1.8.0]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [:1.8.0]
    at java.lang.Thread.run(Thread.java:744) [:1.8.0]
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.simple.repository.teste.TesteServiceImpl com.simple.Controller.TesteController.repo; nested exception is java.lang.IllegalArgumentException: Can not set com.simple.repository.teste.TesteServiceImpl field com.simple.Controller.TesteController.repo to com.sun.proxy.$Proxy26
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286) [spring-beans-3.2.6.RELEASE.jar:]
    ... 27 more
Caused by: java.lang.IllegalArgumentException: Can not set com.simple.repository.teste.TesteServiceImpl field com.simple.Controller.TesteController.repo to com.sun.proxy.$Proxy26
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) [:1.8.0]
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) [:1.8.0]
    at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81) [:1.8.0]
    at java.lang.reflect.Field.set(Field.java:758) [:1.8.0]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:513) [spring-beans-3.2.6.RELEASE.jar:]
    ... 29 more

14:57:07,181 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/RedySimple]] (MSC service thread 1-5) Servlet /RedySimple threw load() exception: java.lang.IllegalArgumentException: Can not set com.simple.repository.teste.TesteServiceImpl field com.simple.Controller.TesteController.repo to com.sun.proxy.$Proxy26
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) [:1.8.0]
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) [:1.8.0]
    at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81) [:1.8.0]
    at java.lang.reflect.Field.set(Field.java:758) [:1.8.0]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:513) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628) [spring-beans-3.2.6.RELEASE.jar:]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) [spring-context-3.2.6.RELEASE.jar:]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) [spring-context-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:599) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:518) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:459) [spring-webmvc-3.2.6.RELEASE.jar:]
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) [spring-webmvc-3.2.6.RELEASE.jar:]
    at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3631) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3844) [jbossweb-7.0.1.Final.jar:7.0.1.Final]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.1.Final.jar:7.0.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
    at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [:1.8.0]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [:1.8.0]
    at java.lang.Thread.run(Thread.java:744) [:1.8.0]

14:57:07,203 INFO  [org.jboss.web] (MSC service thread 1-5) registering web context: /RedySimple
14:57:07,239 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "RedySimple.war"

Eu axo que estou fazendo alguma coisa errada, nao sei pq de outro jeito deu certo, ele salva quando eu faço uma classe concreta ja com os metodos e chamo ela em uma outra classe controle da certo, agora quando eu faco uma classe abstrata quando eu insiro o @Autowired o sistema nao sobe, reclama que nao da conta de criar o bean.

Desde ja agradeco a atencao. se alguem puder me ajudar.

RESOLVIDO :

Bom dei conta de fazer funcionar, era que eu estava chamando a classe que extende a classe abstrata e implementa a interface. ai colocando :

@Autowired
private TesteService repo;

na classe TesteController, ao inves de colocar a classe TesteServiceImpl.

agora nao sei o pq que tenho que chamar a interface ao inves da classe.

  • Eu axo que estou fazendo alguma coisa errada, nao sei pq de outro jeito deu certo, ele salva quando eu faço uma classe concreta ja com os metodos e chamo ela em uma outra classe controle da certo, agora quando eu faco uma classe abstrata quando eu insiro o @Autowired o sistema nao sobe, reclama que nao da conta de criar o bean.

    Arautog   23 de jun de 2014
  1. Você vai ver essas setas em qualquer página de pergunta. Com elas, você pode dizer se uma pergunta ou uma resposta foram relevantes ou não.
  2. Edite sua pergunta ou resposta caso queira alterar ou adicionar detalhes.
  3. Caso haja alguma dúvida sobre a pergunta, adicione um comentário. O espaço de respostas deve ser utilizado apenas para responder a pergunta.
  4. Se o autor da pergunta marcar uma resposta como solucionada, esta marca aparecerá.
  5. Clique aqui para mais detalhes sobre o funcionamento do GUJ!

0 resposta

Não é a resposta que estava procurando? Procure outras perguntas com as tags java spring hibernate ou faça a sua própria pergunta.