Pessoal bom dia.
Estou com um sério problema que não consigo resolver.
Tenho uma aplicação e 2 domínios apontam para essa aplicação.
em 1 domínio o erro acontece, e em outro não.
O usuário insere documentos, e posteriormente pode baixá-los e outros usuários também pode baixá-los.
no domínio www.XXXXX.com.br/aplicação funciona normalmente. e no domínio www.YYYYYY.com.br não funciona.
obs: o link para download utiliza o ip do servidor, ou seja o domínio não influencia nesse momento. e o erro http status que recebo é completamente esquisito.
Código do redirecionamento para o download:
try
{
HttpSession sessionUsuario = request . getSession ();
String file = request . getParameter ( "file" );
String mode = request . getParameter ( "mode" );
if ( mode == null )
{
if ( sessionUsuario . getAttribute ( "idUsuario" ) != null || sessionUsuario . getAttribute ( "idUsuario" ) != "0" )
{
Usuario usuario = new Usuario ();
Log log = new Log ();
log . EscreveLog ( "Usuário " + usuario . GetNomeById ( Integer . parseInt ( sessionUsuario . getAttribute ( "idUsuario" ). toString ()), request . getRemoteHost ()) + " efetuou download do arquivo " + file + " # " , request . getRemoteHost (), false );
out . println ( "<script type='text/javascript'>window.location='" + ReadXML . pathDownload + file + "';</script>" ); //ReadXML.pathDownload retorna http://XXX.XX.XXX.XXX/minha_aplicacao/materiais/ e file=categoria/102/OfertasMarco12-novasofertas.pdf
}
}
}
catch ( Exception e )
{
e . printStackTrace ();
}
AGORA É, PORQUE RETORNA ESSE ERRO EM UM DOMÍNIO E EM OUTRO NÃO??
OBS: O DOMÍNIO QUE NÃO FUNCIONA, EU UTILIZEI VIRTUAL HOST DO TOMCAT, E NO OUTRO APENAS REDIRECIONAMENTO.
erro 500:
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 6 in the generated java file
Only a type can be imported. DataAccessLayer.Documento resolves to a package
An error occurred at line: 7 in the generated java file
Only a type can be imported. DataAccessLayer.Usuario resolves to a package
An error occurred at line: 8 in the generated java file
Only a type can be imported. XML.ReadXML resolves to a package
An error occurred at line: 9 in the generated java file
Only a type can be imported. Funcoes.Log resolves to a package
An error occurred at line : 21 in the jsp file : / countdownload . jsp
Usuario cannot be resolved to a type
18 : {
19 : if ( sessionUsuario . getAttribute ( “ idUsuario ” ) != null || sessionUsuario . getAttribute ( “ idUsuario ” ) != “ 0 ” )
20 : {
21 : Usuario usuario = new Usuario ();
22 : Log log = new Log ();
23 :
24 : log . EscreveLog ( "Usu�rio " + usuario . GetNomeById ( Integer . parseInt ( sessionUsuario . getAttribute ( “ idUsuario ” ). toString ()), request . getRemoteHost ()) + " efetuou download do arquivo " + file + " # " , request . getRemoteHost (), false );
An error occurred at line : 21 in the jsp file : / countdownload . jsp
Usuario cannot be resolved to a type
18 : {
19 : if ( sessionUsuario . getAttribute ( “ idUsuario ” ) != null || sessionUsuario . getAttribute ( “ idUsuario ” ) != “ 0 ” )
20 : {
21 : Usuario usuario = new Usuario ();
22 : Log log = new Log ();
23 :
24 : log . EscreveLog ( "Usu�rio " + usuario . GetNomeById ( Integer . parseInt ( sessionUsuario . getAttribute ( “ idUsuario ” ). toString ()), request . getRemoteHost ()) + " efetuou download do arquivo " + file + " # " , request . getRemoteHost (), false );
An error occurred at line : 22 in the jsp file : / countdownload . jsp
Log cannot be resolved to a type
19 : if ( sessionUsuario . getAttribute ( “ idUsuario ” ) != null || sessionUsuario . getAttribute ( “ idUsuario ” ) != “ 0 ” )
20 : {
21 : Usuario usuario = new Usuario ();
22 : Log log = new Log ();
23 :
24 : log . EscreveLog ( "Usu�rio " + usuario . GetNomeById ( Integer . parseInt ( sessionUsuario . getAttribute ( “ idUsuario ” ). toString ()), request . getRemoteHost ()) + " efetuou download do arquivo " + file + " # " , request . getRemoteHost (), false );
25 : out . println ( “” );
An error occurred at line : 22 in the jsp file : / countdownload . jsp
Log cannot be resolved to a type
19 : if ( sessionUsuario . getAttribute ( “ idUsuario ” ) != null || sessionUsuario . getAttribute ( “ idUsuario ” ) != “ 0 ” )
20 : {
21 : Usuario usuario = new Usuario ();
22 : Log log = new Log ();
23 :
24 : log . EscreveLog ( "Usu�rio " + usuario . GetNomeById ( Integer . parseInt ( sessionUsuario . getAttribute ( “ idUsuario ” ). toString ()), request . getRemoteHost ()) + " efetuou download do arquivo " + file + " # " , request . getRemoteHost (), false );
25 : out . println ( “” );
An error occurred at line : 25 in the jsp file : / countdownload . jsp
ReadXML . pathDownload cannot be resolved to a type
22 : Log log = new Log ();
23 :
24 : log . EscreveLog ( "Usu�rio " + usuario . GetNomeById ( Integer . parseInt ( sessionUsuario . getAttribute ( “ idUsuario ” ). toString ()), request . getRemoteHost ()) + " efetuou download do arquivo " + file + " # " , request . getRemoteHost (), false );
25 : out . println ( “” );
26 : }
27 : }
28 : }
An error occurred at line : 51 in the jsp file : / countdownload . jsp
Documento cannot be resolved to a type
48 : {
49 : HttpSession sessionUsuario = request . getSession ();
50 :
51 : Documento documento = new Documento ();
52 :
53 : idDocumento = Integer . parseInt ( request . getParameter ( “ id ” ));
54 : file = documento . GetFileByIdDocumento ( idDocumento , request . getRemoteHost ());
An error occurred at line : 51 in the jsp file : / countdownload . jsp
Documento cannot be resolved to a type
48 : {
49 : HttpSession sessionUsuario = request . getSession ();
50 :
51 : Documento documento = new Documento ();
52 :
53 : idDocumento = Integer . parseInt ( request . getParameter ( “ id ” ));
54 : file = documento . GetFileByIdDocumento ( idDocumento , request . getRemoteHost ());
An error occurred at line : 57 in the jsp file : / countdownload . jsp
ReadXML . pathDocumentoDownload cannot be resolved to a type
54 : file = documento . GetFileByIdDocumento ( idDocumento , request . getRemoteHost ());
55 :
56 : documento . InsertDocumentoDownload ( idDocumento , Integer . parseInt ( sessionUsuario . getAttribute ( “ idUsuario ” ) . toString ()), request . getRemoteHost ());
57 : String path = ReadXML . pathDocumentoDownload ;
58 : out . print ( “” );
59 : out . print ( "<script type=“text/javascript”>window.close();" );
60 : }
Stacktrace :
org . apache . jasper . compiler . DefaultErrorHandler . javacError ( DefaultErrorHandler . java : 92 )
org . apache . jasper . compiler . ErrorDispatcher . javacError ( ErrorDispatcher . java : 330 )
org . apache . jasper . compiler . JDTCompiler . generateClass ( JDTCompiler . java : 439 )
org . apache . jasper . compiler . Compiler . compile ( Compiler . java : 334 )
org . apache . jasper . compiler . Compiler . compile ( Compiler . java : 312 )
org . apache . jasper . compiler . Compiler . compile ( Compiler . java : 299 )
org . apache . jasper . JspCompilationContext . compile ( JspCompilationContext . java : 586 )
org . apache . jasper . servlet . JspServletWrapper . service ( JspServletWrapper . java : 317 )
org . apache . jasper . servlet . JspServlet . serviceJspFile ( JspServlet . java : 342 )
org . apache . jasper . servlet . JspServlet . service ( JspServlet . java : 267 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 717 )
obrigado pessoal.