Problema com Login no Flex[RESOLVIDO]

Galera,

Estou tendo o seguinte problema na minha aplicação:

faultCode:Server.Processing faultString:'java.lang.NullPointerException : null' faultDetail:'null'

Isso ocorre toda vez que tento logar pela segunda vez na minha aplicação.

att

Ah galera, estou usando o tomcat

Isso é pau no java. Posta seu código aê.

Abaixo todo o meu codigo com os xml’s de configuração

Meu Login.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init();" xmlns:dto="br.com.ces.dto.*" horizontalAlign="center" verticalAlign="middle" name="formTelemetria1">
	 <mx:Script>
        <![CDATA[
        
        	import br.com.ces.lang.Lang;
        	import mx.rpc.events.FaultEvent;
        	import mx.controls.Alert;
        	import br.com.ces.dto.UsuarioDTO;
        	import mx.rpc.events.ResultEvent;
        	import mx.managers.PopUpManager;
        	
        	private var janelaTelemetria:telemetria;
        	private var janelaRastreamentoCelular:rastreamentocelular;
        	
        	private function init():void
            {
           		Lang.getInstance().getLang('pt-BR');
            }
            
            private function falha(event:FaultEvent):void{
            	Alert.show(event.fault.message);
            }
            
            private function converteEventEmUsuarioDTO(event:ResultEvent):void{
            	usuarioDTO = event.result as UsuarioDTO;
            	if(usuarioDTO.usuarioAtivo){
            		abrirJanelaPrincipal(usuarioDTO);
            	}else{
            		Alert.show(usuarioDTO.descricao);
            	}
            }
            
            private function logarUsuario():void{
            	 validaUsuarioServico.validarUsuario(usuarioDTO);
            }
            
           
            private function abrirJanelaPrincipal(usuarioLogado:UsuarioDTO):void
			{
				//VEICULOS
				this.janelaTelemetria = new telemetria();
				//this.janelaRastreamentoCelular = new rastreamentocelular();
				this.janelaTelemetria.pegarUsuarioLogado(usuarioLogado);
				PopUpManager.addPopUp(janelaTelemetria, this, true);
				PopUpManager.centerPopUp(janelaTelemetria);
				 
				 
			}
            
         ]]>
    </mx:Script>
	 <mx:Panel width="266" height="170" layout="absolute" horizontalCenter="-45" verticalCenter="-68" title="Login de Usuário">
	 	 <mx:Label x="10" y="24" text="Usuário:" fontWeight="bold" color="0x000000" />
	 	 <mx:TextInput x="74" y="24" id="inputUsuario"/>
	 	 <mx:Label x="10" y="50" text="Senha:" fontWeight="bold" color="0x000000" />
	 	 <mx:TextInput x="74" y="50" displayAsPassword="true" id="inputSenha"/>
	 	 <mx:Button x="74" y="80" label="Efetuar Login" width="123" labelPlacement="bottom" click="logarUsuario();"/>
	 </mx:Panel>
	 <dto:UsuarioDTO id="usuarioDTO" 
	 	nomeUsuario = "{inputUsuario.text}"
	 	senha = "{inputSenha.text}"
	 	/>
	  <!--Tag dos Objetos remotos - COMECO-->
    <mx:RemoteObject id="validaUsuarioServico" destination="validaUsuarioServico" showBusyCursor="true">
		<mx:method name="validarUsuario" result="{converteEventEmUsuarioDTO(event)}" fault="falha(event)"/>
	</mx:RemoteObject>
</mx:Application>

UsuarioDTO.as

package br.com.ces.dto
{
	[RemoteClass(alias="br.com.ces.vo.UsuarioVO")]
	public class UsuarioDTO
	{
		public var id:Number;
		public var nomeUsuario:String;
		public var senha:String;
		public var nomeParaExibicao:String;
		public var descricao:String;
		public var usuarioAtivo:Boolean;
		public var usuarioLogado:Boolean;
	}
}

ValidaUsuarioServico.java

public class ValidaUsuarioServico {

	public ValidaUsuarioServico() {

	}

	public String getUserName() {
		String userName = null;
		userName = FlexContextUtil.getNomeUsuario();
		return userName;
	}

	public UsuarioVO validarUsuario(UsuarioVO vo) {
		if (null == vo.getNomeUsuario() || null == vo.getSenha()) {
			vo.setUsuarioLogado(false);
			vo.setDescricao("Dados incorreto: Usuário ou senha em branco");
			return vo;
		} else {
			UsuarioFacade facade = new UsuarioFacade();
			try {
				vo = facade.buscaUsuario(vo);
				if (vo.isUsuarioLogado()) {
					gravaDadosNaSessao(vo);
				}else{
					vo.setUsuarioLogado(false);
					vo.setDescricao("Usuário não encontrado");
				}
				return vo;
			} catch (TelemetriaException e) {
				vo.setUsuarioLogado(false);
				vo.setDescricao(e.getMessage());
				TelemetriaLogger.logError(e.getMessage(), e);
				return vo;
			}
		}
	}

	private void gravaDadosNaSessao(UsuarioVO vo) {
		FlexContextUtil.setNomeUsuario(vo.getNomeUsuario());
		FlexContextUtil.setCodUsuario(vo.getId());
		/*
		flexSession = FlexContext.getFlexSession();
		if (flexSession.getAttribute(nomeSessao) == null) {
			flexSession.setAttribute(nomeSessao, vo.getNomeParaExibicao());
		}
		if(flexSession.getAttribute("codClienteLogado") == null){
			
		}
		*/
	}
}

UsuarioDAO.java

public class UsuarioDAO extends SgmvDAO<SgmvUsuario> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 316670496699837947L;

	@SuppressWarnings("unchecked")
	public UsuarioDAO(Class objectClass) {
		super(objectClass);
	}

	public UsuarioDAO() {
		super(SgmvUsuario.class);
	}

	@SuppressWarnings("unchecked")
	public List<SgmvUsuario> findSgmvEntities(String nomeUsuario, String senha) throws TelemetriaException {
		EntityManager em = null;
		try {
			em = EntityManagerHelper.getEntityManager();
			String hql = "select o from SgmvPerfilUsuario as o where o.login = :nomeUsuario and o.senha = :senha";
			Query q = em.createQuery(hql);
			q.setParameter("nomeUsuario", nomeUsuario);
			q.setParameter("senha", senha);
			return q.getResultList();
		} catch (Exception e) {
			e.printStackTrace();
			throw new TelemetriaException(e);
		}
	}

}

remoting-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service" 
    class="flex.messaging.services.RemotingService">

    <adapters>
        <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
    </adapters>

    <default-channels>
        <channel ref="my-amf"/>
    </default-channels>
	<destination id="telemetriaServico">
		<properties>
			<source>br.com.ces.servico.TelemetriaServico</source>
		</properties>
	</destination>
	<destination id="veiculoServico">
		<properties>
			<source>br.com.ces.servico.VeiculoServico</source>
		</properties>
	</destination>
	<destination id="validaUsuarioServico">
		<properties>
			<source>br.com.ces.servico.ValidaUsuarioServico</source>
			<scope>session</scope>
		</properties>
	</destination>
	
</service>

Esse erro que esta acontecendo esta foda. tenho outra aplicação que esta com o mesmo problema.

Att

Entao, consegui simular o erro na minha maquina. Sei que o erro é de conexao com o banco, mas pq esta acorrendo esse erro? O que eu tenho que configurar?
Isso esta acorrendo depois que eu passei a usar o Flex.


javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: could not execute query
	at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:637)
	at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:74)
	at br.com.ces.persistencia.dao.impl.PerfilUsuarioDAO.findSgmvEntities(PerfilUsuarioDAO.java:48)
	at br.com.ces.persistencia.bo.UsuarioBO.buscaUsuario(UsuarioBO.java:18)
	at br.com.ces.persistencia.facade.UsuarioFacade.buscaUsuario(UsuarioFacade.java:16)
	at br.com.ces.servico.ValidaUsuarioServico.validarUsuario(ValidaUsuarioServico.java:29)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:421)
	at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
	at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1503)
	at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:884)
	at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121)
	at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
	at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
	at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
	at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146)
	at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:278)
	at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:322)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:662)
Caused by: org.hibernate.exception.JDBCConnectionException: could not execute query
	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
	at org.hibernate.loader.Loader.doList(Loader.java:2223)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
	at org.hibernate.loader.Loader.list(Loader.java:2099)
	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
	at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
	at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
	at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
	at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:65)
	... 32 more
Caused by: org.postgresql.util.PSQLException: Um erro de E/S ocorreu ao enviar para o processo servidor.
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
	at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
	at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
	at org.hibernate.loader.Loader.doQuery(Loader.java:674)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
	at org.hibernate.loader.Loader.doList(Loader.java:2220)
	... 40 more
Caused by: java.net.SocketTimeoutException: Read timed out
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.read(SocketInputStream.java:129)
	at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135)
	at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104)
	at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
	at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1620)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
	... 48 more
br.com.ces.exception.TelemetriaException: javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: could not execute query
	at br.com.ces.persistencia.dao.impl.PerfilUsuarioDAO.findSgmvEntities(PerfilUsuarioDAO.java:51)
	at br.com.ces.persistencia.bo.UsuarioBO.buscaUsuario(UsuarioBO.java:18)
	at br.com.ces.persistencia.facade.UsuarioFacade.buscaUsuario(UsuarioFacade.java:16)
	at br.com.ces.servico.ValidaUsuarioServico.validarUsuario(ValidaUsuarioServico.java:29)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:421)
	at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
	at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1503)
	at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:884)
	at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121)
	at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
	at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
	at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
	at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146)
	at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:278)
	at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:322)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:662)
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: could not execute query
	at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:637)
	at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:74)
	at br.com.ces.persistencia.dao.impl.PerfilUsuarioDAO.findSgmvEntities(PerfilUsuarioDAO.java:48)
	... 31 more
Caused by: org.hibernate.exception.JDBCConnectionException: could not execute query
	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
	at org.hibernate.loader.Loader.doList(Loader.java:2223)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
	at org.hibernate.loader.Loader.list(Loader.java:2099)
	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
	at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
	at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
	at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
	at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:65)
	... 32 more
Caused by: org.postgresql.util.PSQLException: Um erro de E/S ocorreu ao enviar para o processo servidor.
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
	at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
	at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
	at org.hibernate.loader.Loader.doQuery(Loader.java:674)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
	at org.hibernate.loader.Loader.doList(Loader.java:2220)
	... 40 more
Caused by: java.net.SocketTimeoutException: Read timed out
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.read(SocketInputStream.java:129)
	at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135)
	at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104)
	at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
	at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1620)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
	... 48 more

Posta teu HBM.

Estou usando JPA. Abaixo os meus codigos

persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  <persistence-unit name="ces_sgmv_webPU" transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <class>br.com.ces.persistencia.modelo.SgmvCliente</class>
    <class>br.com.ces.persistencia.modelo.SgmvContato</class>
    <class>br.com.ces.persistencia.modelo.SgmvEndereco</class>
    <class>br.com.ces.persistencia.modelo.SgmvEquipamento</class>
    <class>br.com.ces.persistencia.modelo.SgmvFornecedor</class>
    <class>br.com.ces.persistencia.modelo.SgmvModelo</class>
    <class>br.com.ces.persistencia.modelo.SgmvMotorista</class>
    <class>br.com.ces.persistencia.modelo.SgmvPerfilUsuario</class>
    <class>br.com.ces.persistencia.modelo.SgmvTransmissao</class>
    <class>br.com.ces.persistencia.modelo.SgmvUsuario</class>
    <class>br.com.ces.persistencia.modelo.SgmvVeiculo</class>
    <properties>
      <property name="hibernate.connection.username" value="postgres"/>
      <property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>
      <property name="hibernate.connection.password" value="123456"/>
      <property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/cessistemas"/>
      <property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/>
      <property name="hibernate.show_sql" value="false" />
      <property name="hibernate.format_sql" value="false" />
    </properties>
  </persistence-unit>
</persistence>

minha classe EntityManagerHelper

public class EntityManagerHelper {

    private static final EntityManagerFactory emf;
    private static final ThreadLocal<EntityManager> threadLocal;
    private static final Logger logger;

    static {
        emf = Persistence.createEntityManagerFactory("ces_sgmv_webPU");
        threadLocal = new ThreadLocal<EntityManager>();
        logger = Logger.getLogger("ces_sgmv_webPU");
        logger.setLevel(Level.ALL);
    }

    public static EntityManager getEntityManager() {
        EntityManager manager = threadLocal.get();
        if (manager == null || !manager.isOpen()) {
            manager = emf.createEntityManager();
            threadLocal.set(manager);
        }
        return manager;
    }

    public static void closeEntityManager() {
        EntityManager em = threadLocal.get();
        threadLocal.set(null);
        if (em != null) {
            em.close();
        }
    }

    public static void beginTransaction() {
        getEntityManager().getTransaction().begin();
    }

    public static void commit() {
        getEntityManager().getTransaction().commit();
    }

    public static void rollback() {
        getEntityManager().getTransaction().rollback();
    }

    public static Query createQuery(String query) {
        return getEntityManager().createQuery(query);
    }

    public static void log(String info, Level level, Throwable ex) {
        logger.log(level, info, ex);
    }
}

UsuarioDAO

public class UsuarioDAO extends SgmvDAO<SgmvUsuario> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 316670496699837947L;

	@SuppressWarnings("unchecked")
	public UsuarioDAO(Class objectClass) {
		super(objectClass);
	}

	public UsuarioDAO() {
		super(SgmvUsuario.class);
	}

	@SuppressWarnings("unchecked")
	public List<SgmvUsuario> findSgmvEntities(String nomeUsuario, String senha) throws TelemetriaException {
		EntityManager em = null;
		try {
			em = EntityManagerHelper.getEntityManager();
			String hql = "select o from SgmvPerfilUsuario as o where o.login = :nomeUsuario and o.senha = :senha";
			Query q = em.createQuery(hql);
			q.setParameter("nomeUsuario", nomeUsuario);
			q.setParameter("senha", senha);
			return q.getResultList();
		} catch (Exception e) {
			e.printStackTrace();
			throw new TelemetriaException(e);
		}
	}

}

Todo hora tem que ficar reiniando o tomcat para poder funcionar

Att

Entao, ainda estoou com o problema. Alguem!!!

Teu problema não é Flex. Cria outro tópico na parte de Hibernate/JPA. Nunca mexi com JPA, só com Hibernate, então não posso te ajudar.

Ok

Valeu pelo help!!!

O problema ta na sua query.

Entao, mas ela chega executar uma vez. Ai quando vou acessar novamente ela da esse problema.

Entendeu?