leoduval 13 de set. de 2010
Opa… blz? Cara acho que é alguma configuração porque se ele não conseguisse encontrar as classes teria um ClassNotFoundException no log e não é o caso…
O servidor de aplicação de desenvolvimento é o mesmo de produção? manda mais detalhes pra ver se tem como ajudar…
Abs
thiago.fernandes 13 de set. de 2010
o grande problema é que esse servidor fica no EUA, foi um maluco literamente falando, aqui da empresa que contratou, agora to quebrando a cabeça para fazer funcionar aqui e não consigo, e o jeito que se coloca o mesmo em produção eu nunca tinha visto.
eu tenho que acessar o tomcat manager deles e usar uma opção deploy passando o meu .war.
na minha máquina e em desenvolvimento consigo fazer funcionar, aqui não.
segue a URl para ver o problema:
http://isquare.virtuaserver.com.br:8180/AppTesteStrutsHibernate/ListarUsuarios.do;jsessionid=EC602CFAFF3C6567274BAAE97B6BBA67
leoduval 13 de set. de 2010
thiago.fernandes 13 de set. de 2010
eu pedi isso porem eles falaram que não pode ser acessado desse jeito, o unico jeito e fazer o deploy pelo tmcat manager deles
adriano_si 13 de set. de 2010
O que é que tem na linha 29 da classe UsuarioDao ??? e na linha 44 de ListarUsuarios ???
Manda aí…
leoduval 14 de set. de 2010
Posta o teu hibernate.cfg.xml tb…
thiago.fernandes 14 de set. de 2010
foi malz a dmora, segue em anexo o hibernate.hbm.xml da app de testes que estamos colocando no servidor:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name= "hibernate.dialect" > org.hibernate.dialect.MySQLDialect</property>
<property name= "hibernate.connection.driver_class" > com.mysql.jdbc.Driver</property>
<property name= "hibernate.connection.url" > jdbc:mysql://localhost:3306/thiago_testes</property>
<property name= "hibernate.connection.username" > lorem</property>
<property name= "hibernate.connection.password" > lorem</property>
<!-- arquivos de mapeamento -->
<mapping resource= "Municipio.hbm.xml" />
<mapping resource= "Usuario.hbm.xml" />
<mapping resource= "Estado.hbm.xml" />
<mapping resource= "Campanha.hbm.xml" />
<mapping resource= "Ministerio.hbm.xml" />
</session-factory>
</hibernate-configuration>
adriano_si 14 de set. de 2010
você não respondeu o que tem nas linhas que eu te pedi…
Esse erro ocorre quando tem erro de inicialização em algum bloco static ou em algum atributo static…
Manda o que tem nessas linhas…
thiago.fernandes 14 de set. de 2010
desculpe meu querido, não percebi que havia esquecido.
UsuarioDao - sessao = HibernateUtility.getSession();(linha 29)
ListaUsuarios - UsuarioDao usuarioDao = new UsuarioDao();(linha 44)
abaixo segue a classe HibernateUtility
package com.apptestesstrutshibernate.util ;
import org.hibernate.Session ;
import org.hibernate.SessionFactory ;
import org.hibernate.cfg.Configuration ;
public class HibernateUtility {
private static SessionFactory factory ;
static {
try {
factory = new Configuration (). configure (). buildSessionFactory ();
} catch ( Throwable ex ) {
throw new ExceptionInInitializerError ( ex . getLocalizedMessage ());
}
}
public static Session getSession () {
return factory . openSession ();
}
}
adriano_si 14 de set. de 2010
Poutz…
Tira esse catch Trowable, ou deixa e manda o StackTrace… Estás tú mesmo lançando uma ExceptionInInitializerError… É obrigado a ter esse Trowable ??
Nunca trabalhei com Hibernate assim, não sei nem pra onde vai esse tipo de configuração…
Mas tua real exceção está mascarada…
thiago.fernandes 14 de set. de 2010
Fala galera,
retirei o throwable e coloquei para ele lançar uma HibernateException e mandei o stacktrace, o erro que aparece é esse, não consegui identificar a causa dele ainda
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request .
exception
javax . servlet . ServletException
org . apache . catalina . security . SecurityUtil . execute ( SecurityUtil . java : 294 )
org . apache . catalina . security . SecurityUtil . doAsPrivilege ( SecurityUtil . java : 162 )
root cause
java . lang . ExceptionInInitializerError
net . sf . cglib . core . DefaultGeneratorStrategy . getClassWriter ( DefaultGeneratorStrategy . java : 30 )
net . sf . cglib . core . DefaultGeneratorStrategy . generate ( DefaultGeneratorStrategy . java : 24 )
net . sf . cglib . core . AbstractClassGenerator . create ( AbstractClassGenerator . java : 216 )
net . sf . cglib . core . KeyFactory $ Generator . create ( KeyFactory . java : 145 )
net . sf . cglib . core . KeyFactory . create ( KeyFactory . java : 117 )
net . sf . cglib . core . KeyFactory . create ( KeyFactory . java : 108 )
net . sf . cglib . core . KeyFactory . create ( KeyFactory . java : 104 )
net . sf . cglib . proxy . Enhancer .< clinit >( Enhancer . java : 69 )
org . hibernate . proxy . pojo . cglib . CGLIBLazyInitializer . getProxyFactory ( CGLIBLazyInitializer . java : 117 )
org . hibernate . proxy . pojo . cglib . CGLIBProxyFactory . postInstantiate ( CGLIBProxyFactory . java : 43 )
org . hibernate . tuple . entity . PojoEntityTuplizer . buildProxyFactory ( PojoEntityTuplizer . java : 162 )
org . hibernate . tuple . entity . AbstractEntityTuplizer .< init >( AbstractEntityTuplizer . java : 135 )
org . hibernate . tuple . entity . PojoEntityTuplizer .< init >( PojoEntityTuplizer . java : 55 )
org . hibernate . tuple . entity . EntityEntityModeToTuplizerMapping .< init >( EntityEntityModeToTuplizerMapping . java : 56 )
org . hibernate . tuple . entity . EntityMetamodel .< init >( EntityMetamodel . java : 295 )
org . hibernate . persister . entity . AbstractEntityPersister .< init >( AbstractEntityPersister . java : 434 )
org . hibernate . persister . entity . SingleTableEntityPersister .< init >( SingleTableEntityPersister . java : 109 )
org . hibernate . persister . PersisterFactory . createClassPersister ( PersisterFactory . java : 55 )
org . hibernate . impl . SessionFactoryImpl .< init >( SessionFactoryImpl . java : 226 )
org . hibernate . cfg . Configuration . buildSessionFactory ( Configuration . java : 1294 )
com . apptestesstrutshibernate . util . HibernateUtility .< clinit >( HibernateUtility . java : 21 )
com . apptestesstrutshibernate . dao . UsuarioDao .< init >( UsuarioDao . java : 29 )
com . apptestesstrutshibernate . actions . ListarUsuarios . execute ( ListarUsuarios . java : 44 )
org . apache . struts . action . RequestProcessor . processActionPerform ( RequestProcessor . java : 425 )
org . apache . struts . action . RequestProcessor . process ( RequestProcessor . java : 228 )
org . apache . struts . action . ActionServlet . process ( ActionServlet . java : 1913 )
org . apache . struts . action . ActionServlet . doGet ( ActionServlet . java : 449 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 689 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
sun . reflect . GeneratedMethodAccessor125 . invoke ( Unknown Source )
sun . reflect . DelegatingMethodAccessorImpl . invoke ( DelegatingMethodAccessorImpl . java : 25 )
java . lang . reflect . Method . invoke ( Method . java : 597 )
org . apache . catalina . security . SecurityUtil $ 1 . run ( SecurityUtil . java : 244 )
java . security . AccessController . doPrivileged ( Native Method )
javax . security . auth . Subject . doAsPrivileged ( Subject . java : 517 )
org . apache . catalina . security . SecurityUtil . execute ( SecurityUtil . java : 276 )
org . apache . catalina . security . SecurityUtil . doAsPrivilege ( SecurityUtil . java : 162 )
root cause
java . security . AccessControlException : access denied ( java . util . PropertyPermission cglib . debugLocation read )
java . security . AccessControlContext . checkPermission ( AccessControlContext . java : 323 )
java . security . AccessController . checkPermission ( AccessController . java : 546 )
java . lang . SecurityManager . checkPermission ( SecurityManager . java : 532 )
java . lang . SecurityManager . checkPropertyAccess ( SecurityManager . java : 1285 )
java . lang . System . getProperty ( System . java : 652 )
net . sf . cglib . core . DebuggingClassWriter .< clinit >( DebuggingClassWriter . java : 35 )
net . sf . cglib . core . DefaultGeneratorStrategy . getClassWriter ( DefaultGeneratorStrategy . java : 30 )
net . sf . cglib . core . DefaultGeneratorStrategy . generate ( DefaultGeneratorStrategy . java : 24 )
net . sf . cglib . core . AbstractClassGenerator . create ( AbstractClassGenerator . java : 216 )
net . sf . cglib . core . KeyFactory $ Generator . create ( KeyFactory . java : 145 )
net . sf . cglib . core . KeyFactory . create ( KeyFactory . java : 117 )
net . sf . cglib . core . KeyFactory . create ( KeyFactory . java : 108 )
net . sf . cglib . core . KeyFactory . create ( KeyFactory . java : 104 )
net . sf . cglib . proxy . Enhancer .< clinit >( Enhancer . java : 69 )
org . hibernate . proxy . pojo . cglib . CGLIBLazyInitializer . getProxyFactory ( CGLIBLazyInitializer . java : 117 )
org . hibernate . proxy . pojo . cglib . CGLIBProxyFactory . postInstantiate ( CGLIBProxyFactory . java : 43 )
org . hibernate . tuple . entity . PojoEntityTuplizer . buildProxyFactory ( PojoEntityTuplizer . java : 162 )
org . hibernate . tuple . entity . AbstractEntityTuplizer .< init >( AbstractEntityTuplizer . java : 135 )
org . hibernate . tuple . entity . PojoEntityTuplizer .< init >( PojoEntityTuplizer . java : 55 )
org . hibernate . tuple . entity . EntityEntityModeToTuplizerMapping .< init >( EntityEntityModeToTuplizerMapping . java : 56 )
org . hibernate . tuple . entity . EntityMetamodel .< init >( EntityMetamodel . java : 295 )
org . hibernate . persister . entity . AbstractEntityPersister .< init >( AbstractEntityPersister . java : 434 )
org . hibernate . persister . entity . SingleTableEntityPersister .< init >( SingleTableEntityPersister . java : 109 )
org . hibernate . persister . PersisterFactory . createClassPersister ( PersisterFactory . java : 55 )
org . hibernate . impl . SessionFactoryImpl .< init >( SessionFactoryImpl . java : 226 )
org . hibernate . cfg . Configuration . buildSessionFactory ( Configuration . java : 1294 )
com . apptestesstrutshibernate . util . HibernateUtility .< clinit >( HibernateUtility . java : 21 )
com . apptestesstrutshibernate . dao . UsuarioDao .< init >( UsuarioDao . java : 29 )
com . apptestesstrutshibernate . actions . ListarUsuarios . execute ( ListarUsuarios . java : 44 )
org . apache . struts . action . RequestProcessor . processActionPerform ( RequestProcessor . java : 425 )
org . apache . struts . action . RequestProcessor . process ( RequestProcessor . java : 228 )
org . apache . struts . action . ActionServlet . process ( ActionServlet . java : 1913 )
org . apache . struts . action . ActionServlet . doGet ( ActionServlet . java : 449 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 689 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
sun . reflect . GeneratedMethodAccessor125 . invoke ( Unknown Source )
sun . reflect . DelegatingMethodAccessorImpl . invoke ( DelegatingMethodAccessorImpl . java : 25 )
java . lang . reflect . Method . invoke ( Method . java : 597 )
org . apache . catalina . security . SecurityUtil $ 1 . run ( SecurityUtil . java : 244 )
java . security . AccessController . doPrivileged ( Native Method )
javax . security . auth . Subject . doAsPrivileged ( Subject . java : 517 )
org . apache . catalina . security . SecurityUtil . execute ( SecurityUtil . java : 276 )
org . apache . catalina . security . SecurityUtil . doAsPrivilege ( SecurityUtil . java : 162 )
thiago.fernandes 14 de set. de 2010
sou meio leigo ainda no que se diz em entender algumas causas de erros no java, mas creio que seja alguma coisa relacionada a alguma tipode permissão.
thiago.fernandes 14 de set. de 2010
alguem que possa me dar uma luz?