Problema na Implantação no Servidor GlassFish

Bom Dia a Todos… deste ja agradeço a todos pela atençao.

Estou com um problema na implatação da aplicação no servidor.

aparece este erro:

[color=red]Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Lorg/primefaces/model/StreamedContent;. Please see server.log for more details.[/color]

Sendo que local funciona perfeitamente.

O que vc acham q pode ser?

Usor primefaces 3.2 nativo o Netbeans

Não é só por que funciona localmente que em qualquer outro pc vai funcionar.

A mensagem de erro diz: java.lang.NoClassDefFoundError: Lorg/primefaces/model/StreamedContent;

Veja se no servidor tem a biblioteca do primefaces. Ou se no EAR/WAR enviado tem a biblioteca do Primefaces.

Obrigado pela ajuda.
No servidor deve ter, existe outras aplicacoes com uso do primefaces.
vou verificar…

Obrigado pela ajuda

Coloquei a api no servidor mas ainda continua o mesmo erro…

Verifiquei quando mando compilar a aplicação aparece esta seguinte notificação:

[list]

Compiling 16 source files to /Users/michaelgerson/Desktop/Transparencia/build/web/WEB-INF/classes
Note: /Users/michaelgerson/Desktop/Transparencia/src/java/br/gov/rr/transparencia/controller/RelatorioUtil.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Copying 1 file to /Users/michaelgerson/Desktop/Transparencia/build/web/WEB-INF/classes
compile:
compile-jsps:
Created dir: /Users/michaelgerson/Desktop/Transparencia/dist
Building jar: /Users/michaelgerson/Desktop/Transparencia/dist/Transparencia.war
do-dist:
dist:
CONSTRUÍDO COM SUCESSO (tempo total: 4 segundos)
[/list]

Segue abaixo a Classe



package br.gov.rr.transparencia.controller;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.HashMap;
import javax.faces.context.FacesContext;
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.export.JRHtmlExporter;
import net.sf.jasperreports.engine.export.JRPdfExporter;
import net.sf.jasperreports.engine.export.JRXlsExporter;
import net.sf.jasperreports.engine.export.oasis.JROdtExporter;
import net.sf.jasperreports.engine.util.JRLoader;
import org.primefaces.model.DefaultStreamedContent;
import org.primefaces.model.StreamedContent;


public class RelatorioUtil {

    public static final int RELATORIO_PDF = 1;
    public static final int RELATORIO_EXCEL = 2;
    public static final int RELATORIO_HTML = 3;
    public static final int RELATORIO_PLANILHA_OPEN_OFFICE = 4;

    public StreamedContent geraRelatorio(HashMap parametrosRelatorio, String nomeRelatorioJasper, String nomeRelatorioSaida, int tipoRelatorio) throws UtilException {
        StreamedContent arquivoRetorno = null;

        try {
            FacesContext context = FacesContext.getCurrentInstance();
            Connection conexao = this.getConexao();
            String caminhoRelatorio = context.getExternalContext().getRealPath("jasper");
            String caminhoArquivoJasper = caminhoRelatorio + File.separator + nomeRelatorioJasper + ".jasper";
            String caminhoArquivoRelatorio = null;

            JasperReport relatorioJasper = (JasperReport) JRLoader.loadObject(caminhoArquivoJasper);
            JasperPrint impressoraJasper = JasperFillManager.fillReport(relatorioJasper, parametrosRelatorio, conexao);
            JRExporter tipoArquivoExportado = null;
            String extensaoArquivoExportado = "";
            File arquivoGerado = null;

            switch (tipoRelatorio) {
                case RelatorioUtil.RELATORIO_PDF:
                    tipoArquivoExportado = new JRPdfExporter();
                    extensaoArquivoExportado = "pdf";
                    break;
                case RelatorioUtil.RELATORIO_HTML:
                    tipoArquivoExportado = new JRHtmlExporter();
                    extensaoArquivoExportado = "html";
                    break;
                case RelatorioUtil.RELATORIO_EXCEL:
                    tipoArquivoExportado = new JRXlsExporter();
                    extensaoArquivoExportado = "xls";
                    break;
                case RelatorioUtil.RELATORIO_PLANILHA_OPEN_OFFICE:
                    tipoArquivoExportado = new JROdtExporter();
                    extensaoArquivoExportado = "ods";
                    break;
                default:
                    tipoArquivoExportado = new JRPdfExporter();
                    extensaoArquivoExportado = "pdf";
                    break;
            }
            caminhoArquivoRelatorio = caminhoRelatorio + File.separator + nomeRelatorioSaida + "." + extensaoArquivoExportado;
            arquivoGerado = new java.io.File(caminhoArquivoRelatorio);
            tipoArquivoExportado.setParameter(JRExporterParameter.JASPER_PRINT, impressoraJasper);
            tipoArquivoExportado.setParameter(JRExporterParameter.OUTPUT_FILE, arquivoGerado);
            tipoArquivoExportado.exportReport();
            arquivoGerado.deleteOnExit();

            InputStream conteudoRelatorio = new FileInputStream(arquivoGerado);
            arquivoRetorno = new DefaultStreamedContent(conteudoRelatorio, "application/" + extensaoArquivoExportado, nomeRelatorioSaida + "." + extensaoArquivoExportado);
        } catch (JRException e) {
            throw new UtilException("Nao foi possovel gerar o relatorio.", e);
        } catch (FileNotFoundException e) {
            throw new UtilException("Arquivo do relatorio nao encontrado.", e);
        }
        return arquivoRetorno;
    }

    private Connection getConexao() throws UtilException {
        Connection connection = null;
        String url = "org.postgresql.Driver";
        String bd = "jdbc:postgresql://192.168.227.11:5432/cti";
        String usuario = "postgres";
        String senha = "xxx";

        try {
            Class.forName(url);
            connection = DriverManager.getConnection(bd, usuario, senha);
            return connection;
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    }
}