Erro estranho

23 respostas
D

Pessoal, deu um erro na minha classe e TelaPrincipal e agora não estou sabendo consertar. No código da classe não é mostrado nenhum erro, mas a classe fica com esse erro ai embaixo:

Exception in thread “main” java.lang.No Class Def Found Error: co/departamentodetransito/visao/TelaPrincipal

Se alguém tiver idéia do que seja e puder me ajudar eu agradeço.

23 Respostas

eberson_oliveira

Olá,

A VM não está encontrando esse pacote co.departamentodetransito.visao.TelaPrincipal…

Ela realmente existe? Poste o código da tela principal e o código que gerou o erro para que possamos ajudar.

[]
Éberson

lugaid

David…
Coloca o código que tá dando esse erro…

Geralmente quando isso acontece, é porque falta alguma lib para ser importada…

A
Exception in thread "main" java.lang.No Class Def Found Error: co/departamentodetransito/visao/TelaPrincipal Se alguém tiver idéia do que seja e puder me ajudar eu agradeço.

Olá,

exato é um erro, e não exception, acontece qdo. a JVM ou o ClassLoader tentar carregar alguma definição da classe e não a encontra. Faça
um teste, exemplo dentro de uma classe vc tem uma instância de outra classe q invoca um método/variável, daí vc compila certinho, depois vai e deleta o .class da classe q tá sendo instanciada (faça na mão sem auxílio do Eclipse caso utilize), detalhe se vc não invoca nada a VM irá criar a classe em tempo de execução fazendo com q não dê erro.

Ex:
public class ClasseTeste1 {

	@SuppressWarnings("static-access")
	public static void main(String[] args) {
		ClasseTeste2 classeTeste2 = new ClasseTeste2();
		System.out.println(classeTeste2.salarioDosEstagiarios);
	}
}
class ClasseTeste2 {

	public static final int salarioDosEstagiarios = 5000;
	
}

veja a documentação:

java.lang
Class NoClassDefFoundError

java.lang.Object
java.lang.Throwable
java.lang.Error
java.lang.LinkageError
java.lang.NoClassDefFoundError
All Implemented Interfaces:
Serializable
public class NoClassDefFoundError
extends LinkageError
Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.

The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found.

Since:
JDK1.0
See Also:
Serialized Form

Fonte: http://download.oracle.com/javase/6/docs/api/

abraço,

D

eberson_oliveira:
Olá,

A VM não está encontrando esse pacote co.departamentodetransito.visao.TelaPrincipal…

Ela realmente existe? Poste o código da tela principal e o código que gerou o erro para que possamos ajudar.

[]
Éberson

eberson_oliveira, não tem erro no código, tipo não mostra erro nenhum, mas na classe sim, vou explicar melhor:
Tenho vários pacotes dentro do meu projeto e a TelaPrincipal está dentro de um desses pacotes, sendo que neste se encontra outras classes que estão normal. Somente a classe TelaPrincipal está dando erro, porém não aparece no código, só mostra na ‘aba’ projetos.
Eu tentei limpar e reconstruir, só que não deu, gerou o seguinte erro:

C:\Users\David\david\TrabalhoInstitucionalBeta\src\co\departamentodetransito\visao\TelaPrincipal.java:2347: code too large

private void initComponents() {

Note: Some input files use or override 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.

1 error

C:\Users\David\david\TrabalhoInstitucionalBeta\nbproject\build-impl.xml:531: The following error occurred while executing this line:

C:\Users\David\david\TrabalhoInstitucionalBeta\nbproject\build-impl.xml:261: Compile failed; see the compiler error output for details.

at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1113)

at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:906)

at org.netbeans.modules.java.source.ant.JavacTask.execute(JavacTask.java:136)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

at org.apache.tools.ant.Task.perform(Task.java:348)

at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

at org.apache.tools.ant.Task.perform(Task.java:348)

at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

at org.apache.tools.ant.Task.perform(Task.java:348)

at org.apache.tools.ant.Target.execute(Target.java:390)

at org.apache.tools.ant.Target.performTasks(Target.java:411)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)

at org.apache.tools.ant.Project.executeTarget(Project.java:1366)

at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

at org.apache.tools.ant.Project.executeTargets(Project.java:1249)

at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:281)

at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)

at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)
D

lugaid:
David…
Coloca o código que tá dando esse erro…

Geralmente quando isso acontece, é porque falta alguma lib para ser importada…

Lugaid, como eu disse para o colega acima, o erro não aparece no código, somente na classe, e quando eu tento limpar e construir ele dá o erro que mencionei na postagem acima.
mas o erro

Exception in thread “main” java.lang.NoClassDefFoundError: co/departamentodetransito/visao/TelaPrincipal

ainda vale, pois quando tento executar dá esse erro.

D
andredecotia:
Exception in thread "main" java.lang.No Class Def Found Error: co/departamentodetransito/visao/TelaPrincipal Se alguém tiver idéia do que seja e puder me ajudar eu agradeço.

Olá,

exato é um erro, e não exception, acontece qdo. a JVM ou o ClassLoader tentar carregar alguma definição da classe e não a encontra. Faça
um teste, exemplo dentro de uma classe vc tem uma instância de outra classe q invoca um método/variável, daí vc compila certinho, depois vai e deleta o .class da classe q tá sendo instanciada (faça na mão sem auxílio do Eclipse caso utilize), detalhe se vc não invoca nada a VM irá criar a classe em tempo de execução fazendo com q não dê erro.

Ex:
public class ClasseTeste1 {

	@SuppressWarnings("static-access")
	public static void main(String[] args) {
		ClasseTeste2 classeTeste2 = new ClasseTeste2();
		System.out.println(classeTeste2.salarioDosEstagiarios);
	}
}
class ClasseTeste2 {

	public static final int salarioDosEstagiarios = 5000;
	
}

veja a documentação:

java.lang
Class NoClassDefFoundError

java.lang.Object
java.lang.Throwable
java.lang.Error
java.lang.LinkageError
java.lang.NoClassDefFoundError
All Implemented Interfaces:
Serializable
public class NoClassDefFoundError
extends LinkageError
Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.

The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found.

Since:
JDK1.0
See Also:
Serialized Form

Fonte: http://download.oracle.com/javase/6/docs/api/

abraço,

andredecotia, não entendi direito o que é pra fazer. Se você pudesse me explicar melhor

eberson_oliveira

Por isso pedimos para que você coloque o código da tela principal… para podermos identificar e analisar o erro… Não sei onde ficam listados os problemas no netbeans… mas deve estar mostrando em algum lugar o fonte e a linha onde o erro ocorre…

E o log da da compilação? Não mostrou onde ocorre o problema?

Poste o código da tela, senão vai ficar difícil de te ajudar… alguém ai no seu projeto está(va) com uma dependência “quebrada”…

[]
Éberson

D

Por isso pedimos para que você coloque o código da tela principal… para podermos identificar e analisar o erro… Não sei onde ficam listados os problemas no netbeans… mas deve estar mostrando em algum lugar o fonte e a linha onde o erro ocorre…

E o log da da compilação? Não mostrou onde ocorre o problema?

Poste o código da tela, senão vai ficar difícil de te ajudar… alguém ai no seu projeto está(va) com uma dependência “quebrada”…

[]
Éberson[/quote]

Posso até postar, mas o código é imenso, tem umas 12000 linhas de código, e a respeito do erro, só aparece isso aqui:

Exception in thread main java.lang.NoClassDefFoundError: co/departamentodetransito/visao/TelaPrincipal

at java.lang.Class.getDeclaredMethods0(Native Method)

at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)

at java.lang.Class.getDeclaredMethod(Class.java:1935)

at java.awt.Component.isCoalesceEventsOverriden(Component.java:5948)

at java.awt.Component.access$500(Component.java:169)

at java.awt.Component$3.run(Component.java:5902)

at java.awt.Component$3.run(Component.java:5900)

at java.security.AccessController.doPrivileged(Native Method)

at java.awt.Component.checkCoalescing(Component.java:5899)

at java.awt.Component.<init>(Component.java:5868)

at java.awt.Container.<init>(Container.java:251)

at java.awt.Window.<init>(Window.java:431)

at java.awt.Frame.<init>(Frame.java:403)

at java.awt.Frame.<init>(Frame.java:368)

at javax.swing.JFrame.<init>(JFrame.java:158)

at co.departamentodetransito.visao.TelaDeLogin.<init>(TelaDeLogin.java:11)

at co.departamentodetransito.visao.InterInicializacao.<init>(InterInicializacao.java:18)

at co.departamentodetransito.Principal.main(Principal.java:14)

Caused by: java.lang.ClassNotFoundException: co.departamentodetransito.visao.TelaPrincipal

at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

 18 more

vou postar o código em outra postagem, aguarde ai

D

eberson_oliveira, mais tade eu posto o código, é que a internet aqui em csa não é muito boa (3g). Quando chegar no trabalho eu posto o código…

eberson_oliveira

Faz o seguinte… coloca a linha as 30 primeiras linhas da TelaDeLogine o código da InterInicializacao…

Acho que isso deve ajudar a identificar o problema.

[]
Éberson

lucasbemo

Olha o que eu achei:

acho que deve ser isso, eles portaram a solucão, mas eu não conseguir compreender a solução?

eu traduzir o que esta no link:

Hello all,

Is there any maximum size for code in java… i wrote a function with more than 10,000 lines. Actually , each line assigns a value to an array variable…

arts_bag[10792]="newyorkartworld";
    arts_bag[10793]="leningradschool";
    arts_bag[10794]="mailart";
    arts_bag[10795]="artspan";
    arts_bag[10796]="watercolor";
    arts_bag[10797]="sculptures";
    arts_bag[10798]="stonesculpture";

And while compiling , i get this error : code too large

How do i overcome this ?

A single method in a Java class may be at most 64KB of bytecode.

But you should clean this up!

Use .properties file to store this data, and load it via java.util.Properties

You can do this by placing the .properties file on your classpath, and use:

Properties properties = new Properties();

InputStream inputStream = getClass().getResourceAsStream(yourfile.properties);

properties.load(inputStream);

===================================
6 down vote

This seems a bit like madness. Can you not initialize the array by reading the values from a text file, or some other data source?

======================================

There is a 64K byte-code size limit on a method

Having said that, I have to agree w/Richard; why do you need a method that large? Given the example in the OP, a properties file should suffice … or even a database if required.

Wow, that’s bad.

Why this is bad has already been explained. There are a number of ways to fix this but the following should not break any other code.

bascially the method creates (and returns but it could just as easily edit a class variable) an array that contains each line of file in order.

Just dump the values in your source example (e.g. “newyorkartworld”) to a text file - in order - and use this to load the array.

While this simple drop in replacement will work, there are far more elegant solution out there if you can find the time to do a little refactoring.

D

eberson_oliveira, está ai todo o código da classe Telade Login

package co.departamentodetransito.visao;

import co.departamentodetransito.Controle.ControleLogin;
import co.departamentodetransito.modelo.UsuarioVO;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.SQLException;
import javax.swing.JOptionPane;


public class OuvinteTelaDeLogin {

    private TelaDeLogin  gui;

    //Construtor
    public OuvinteTelaDeLogin(TelaDeLogin gui) {

        this.gui = gui;

        this.gui.setOuvinteLogin( new OuvintePesquisar() );
    }

    public class OuvintePesquisar implements ActionListener {

        public void actionPerformed(ActionEvent e) {

            UsuarioVO usuario = gui.getUsuario();
            
            ControleLogin controle = new ControleLogin();

            try {
                gui.setPesquisaLogin( controle.pesquisarLogin(usuario) );
            }
            catch (SQLException ex) {

                JOptionPane.showMessageDialog(gui, ex);
                //System.exit(1);
            }
        }
    }
}

e esse é da classe InterInicializacao (todo o código):

package co.departamentodetransito.visao;


public class InterInicializacao extends javax.swing.JFrame {

    TelaDeLogin telaDeLogin = null;

    /** Creates new form InterInicializacao */
    public InterInicializacao() {
        initComponents();

        this.dispose();
        this.setUndecorated(true);
        this.setLocationRelativeTo(null);
        this.setVisible(true);

        this.telaDeLogin = new TelaDeLogin();
        this.telaDeLogin.setVisible(false);

        for (int i = 0; i <= 100; i++) {

            this.jProgressBar1.setValue(i);

            try {
                Thread.sleep(100);
            } catch (InterruptedException ex) {
            }
        }
        
        this.dispose();
        
        this.telaDeLogin.setLocationRelativeTo(null);
        this.telaDeLogin.setVisible(true);
    }

    public TelaDeLogin getTelaDeLogin() {

        return this.telaDeLogin;
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        jPanel5 = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jProgressBar1 = new javax.swing.JProgressBar();
        jLabel6 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(132, 132, 255));
        setMinimumSize(new java.awt.Dimension(700, 400));
        setResizable(false);

        jPanel5.setBackground(new java.awt.Color(132, 132, 255));
        jPanel5.setBorder(javax.swing.BorderFactory.createEtchedBorder(new java.awt.Color(255, 255, 255), new java.awt.Color(102, 102, 102)));
        jPanel5.setPreferredSize(new java.awt.Dimension(700, 400));
        jPanel5.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
            }
            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
                jPanel5AncestorAdded(evt);
            }
            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        jPanel6.setBackground(new java.awt.Color(255, 255, 255));
        jPanel6.setPreferredSize(new java.awt.Dimension(700, 344));

        jLabel5.setText("Inicializando...");

        jProgressBar1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jProgressBar1.setDebugGraphicsOptions(jProgressBar1.getDebugGraphicsOptions());
        jProgressBar1.setModel(jProgressBar1.getModel());
        jProgressBar1.setPreferredSize(new java.awt.Dimension(150, 18));
        jProgressBar1.setStringPainted(true);

        jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/co/departamentodetransito/visao/detran.jpg"))); // NOI18N

        org.jdesktop.layout.GroupLayout jPanel6Layout = new org.jdesktop.layout.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .add(jProgressBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 644, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(42, Short.MAX_VALUE))
            .add(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 141, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(545, Short.MAX_VALUE))
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel6Layout.createSequentialGroup()
                .add(121, 121, 121)
                .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 473, Short.MAX_VALUE)
                .add(102, 102, 102))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel6Layout.createSequentialGroup()
                .add(50, 50, 50)
                .add(jLabel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 191, Short.MAX_VALUE)
                .add(18, 18, 18)
                .add(jLabel5)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jProgressBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 18, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(47, 47, 47))
        );

        org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 696, Short.MAX_VALUE)
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel5Layout.createSequentialGroup()
                .add(20, 20, 20)
                .add(jPanel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(32, Short.MAX_VALUE))
        );

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 700, Short.MAX_VALUE)
            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .add(0, 0, Short.MAX_VALUE)
                    .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(0, 0, Short.MAX_VALUE)))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 400, Short.MAX_VALUE)
            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .add(0, 0, Short.MAX_VALUE)
                    .add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(0, 0, Short.MAX_VALUE)))
        );

        getAccessibleContext().setAccessibleParent(this);

        pack();
    }// </editor-fold>                        

    private void jPanel5AncestorAdded(javax.swing.event.AncestorEvent evt) {                                      

    }                                     

    // Variables declaration - do not modify                     
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JProgressBar jProgressBar1;
    // End of variables declaration                   

}

se precisar de mais alguma coisa é só pedir

D

lucasbemo, puts, num entendi quase nada do que eles explicaram no link que você postou.

D

lucasbemo, essa solução que você achou talvez não sirva para esse problema, pois o problema citado no link está relacionado a um método, já o erro aqui é na classe. Talvez tenha ligação… vou continuar pesquisando

eberson_oliveira

David,

A classe TelaDeLogin existe? no código que você postou tem a classe OuvinteTelaDeLogin…

Pode ser que você tenha renomeado a classe e não ao fonte… isso já geraria problemas no seu projeto…

[]
Éberson

D

eberson_oliveira:
David,

A classe TelaDeLogin existe? no código que você postou tem a classe OuvinteTelaDeLogin…

Pode ser que você tenha renomeado a classe e não ao fonte… isso já geraria problemas no seu projeto…

[]
Éberson

Existe sim, eu até verifiquei se tinha digitado algo errado, mas não.

classe TelaDeLogin foi postada ai.

eberson_oliveira

david.jv:
eberson_oliveira:
David,

A classe TelaDeLogin existe? no código que você postou tem a classe OuvinteTelaDeLogin…

Pode ser que você tenha renomeado a classe e não ao fonte… isso já geraria problemas no seu projeto…

[]
Éberson

Existe sim, eu até verifiquei se tinha digitado algo errado, mas não.

classe TelaDeLogin foi postada ai.

No código que você postou está assim:

public class OuvinteTelaDeLogin {

isso indica que o nome da classe é OuvinteTelaDeLogin e não tela de login como havia mencionado… talvez seja apenas um erro de digitação aqui no fórum, mas algo ainda está estranho…

lucasbemo

Não, esse erro de “code too large” é referente ao método ’ initComponents(); ’ dentro dele tem exesso de código. No java todo método tem um limite de tamanho, esse nosso método --> initComponentes() esta com muito código.

Nós teriamos que remover um pouco de código de dentro desse método, ou o que eu acho ideal no nosso problema que seria achar como que faz para que o java compile essa nossa função mesmo passando do limite de tamanho permitido pelo java.

eberson_oliveira

lucasbemo:
Não, esse erro de “code too large” é referente ao método ’ initComponents(); ’ dentro dele tem exesso de código. No java todo método tem um limite de tamanho, esse nosso método --> initComponentes() esta com muito código.

Nós teriamos que remover um pouco de código de dentro desse método, ou o que eu acho ideal no nosso problema que seria achar como que faz para que o java compile essa nossa função mesmo passando do limite de tamanho permitido pelo java.

O erro inicial é o NoClassDefFoundError que ocorre quando alguma dependência não é encontrada. O problemas de code too large já deve ter sido resolvido já que o David não reclamou mais desse problema então o foco voltou para o problema inicial.

[]
Éberson

D

eberson_oliveira , puts cara foi mal, acabei postando o OuvinteTelaDeLogin

ai vai a classe TelaDeLogin:

package co.departamentodetransito.visao;

import co.departamentodetransito.modelo.UsuarioVO;
import java.awt.event.ActionListener;
import javax.swing.JOptionPane;

public class TelaDeLogin extends javax.swing.JFrame {
    TelaPrincipal telaPrincipal = null;

    // Construtor da Classe TelaDeLogin
    public TelaDeLogin() {
        initComponents();

        lUsuarioLogin.setVisible(false);
        lSenhaLogin.setVisible(false);
    }

    
    //Define um objeto do tipo TelaPrincipal nessa classe
    public void setTelaIPrincipal(TelaPrincipal telaPrincipal) {
        this.telaPrincipal = telaPrincipal;
    }

    //Define o OuvinteLogin
    public void setOuvinteLogin( ActionListener OuvinteTelaDeLogin ) {

        this.bEntrar.addActionListener(OuvinteTelaDeLogin);
    }

    //Obtém os dados de acesso do usuário
    public UsuarioVO getUsuario() {
        UsuarioVO usuario = new UsuarioVO();

        usuario.setUsuario( this.tfUsuario.getText() );
        usuario.setSenha( this.pfSenha.getText() );

        return usuario;
    }

    //Defini se o login e a senha informado esta válida
    public void setPesquisaLogin(String usuarioValido) {

        if(!usuarioValido.isEmpty()) {
            this.telaPrincipal.setUsuarioAtual(usuarioValido);
            this.telaPrincipal.setLocationRelativeTo(null);
            this.telaPrincipal.setVisible(true);

            this.dispose();
        }
        else {
                JOptionPane.showMessageDialog(this, "Usuário ou senha inválidos");
        }
    }

    //Obtém as credenciais da interface
    public void setOuvintePesquisar( ActionListener ouvinte) {
      //  this.bEntrar.addActionListener(ouvinte);
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        jPanel11 = new javax.swing.JPanel();
        pFundo = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        tfUsuario = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        bEntrar = new javax.swing.JButton();
        pfSenha = new javax.swing.JPasswordField();
        jButton_solicitarNovaSenha = new javax.swing.JButton();
        lUsuarioLogin = new javax.swing.JLabel();
        lSenhaLogin = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        bSair = new javax.swing.JButton();
        bMinimizar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Sistema se Gerenciamento do Transporte Nacional");
        setResizable(false);
        setUndecorated(true);

        jPanel11.setBackground(new java.awt.Color(172, 172, 255));
        jPanel11.setBorder(javax.swing.BorderFactory.createEtchedBorder(new java.awt.Color(204, 204, 204), new java.awt.Color(0, 51, 51)));
        jPanel11.setMinimumSize(new java.awt.Dimension(63, 866));
        jPanel11.setPreferredSize(new java.awt.Dimension(866, 63));

        pFundo.setBackground(new java.awt.Color(255, 255, 255));
        pFundo.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
            }
            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
                pFundoAncestorAdded(evt);
            }
            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        jPanel10.setBackground(new java.awt.Color(152, 152, 255));
        jPanel10.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(0, 51, 51), new java.awt.Color(204, 204, 204), new java.awt.Color(0, 51, 51), new java.awt.Color(204, 204, 204)));
        jPanel10.setMinimumSize(new java.awt.Dimension(300, 357));

        jLabel21.setFont(new java.awt.Font("Verdana", 0, 15));
        jLabel21.setText("Usuário");
        jLabel21.setAlignmentX(0.5F);

        jLabel22.setFont(new java.awt.Font("Verdana", 0, 15));
        jLabel22.setText("Senha");

        tfUsuario.setFont(new java.awt.Font("Verdana", 0, 14));
        tfUsuario.setBorder(javax.swing.BorderFactory.createEtchedBorder(java.awt.Color.lightGray, new java.awt.Color(0, 51, 51)));

        jLabel23.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel23.setForeground(new java.awt.Color(0, 51, 51));
        jLabel23.setText("Entre no SDT com seu usuário e senha.");

        jLabel24.setFont(new java.awt.Font("Lucida Grande", 0, 8));
        jLabel24.setText("Exemplo: fulanobeltrano");
        jLabel24.setAlignmentX(0.5F);

        bEntrar.setFont(new java.awt.Font("Arial", 0, 15));
        bEntrar.setText("Entrar");
        bEntrar.setBorder(javax.swing.BorderFactory.createEtchedBorder(java.awt.Color.lightGray, new java.awt.Color(0, 51, 51)));
        bEntrar.setPreferredSize(new java.awt.Dimension(73, 21));
        bEntrar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                bEntrarjButton_EntrarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                bEntrarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                bEntrarMouseExited(evt);
            }
        });

        pfSenha.setFont(new java.awt.Font("Verdana", 0, 14));
        pfSenha.setBorder(javax.swing.BorderFactory.createEtchedBorder(new java.awt.Color(204, 204, 204), new java.awt.Color(0, 51, 51)));

        jButton_solicitarNovaSenha.setText("Não consigo acessar minha conta");
        jButton_solicitarNovaSenha.setBorder(javax.swing.BorderFactory.createEtchedBorder(java.awt.Color.lightGray, new java.awt.Color(0, 51, 51)));
        jButton_solicitarNovaSenha.setPreferredSize(new java.awt.Dimension(163, 21));
        jButton_solicitarNovaSenha.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton_solicitarNovaSenhajButton_solicitarNovaSenhaMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jButton_solicitarNovaSenhaMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jButton_solicitarNovaSenhaMouseExited(evt);
            }
        });

        lUsuarioLogin.setFont(new java.awt.Font("Tahoma", 1, 11));
        lUsuarioLogin.setForeground(new java.awt.Color(255, 0, 0));
        lUsuarioLogin.setText("Campo obrigatório");

        lSenhaLogin.setFont(new java.awt.Font("Tahoma", 1, 11));
        lSenhaLogin.setForeground(new java.awt.Color(255, 0, 0));
        lSenhaLogin.setText("Campo obrigatório");

        org.jdesktop.layout.GroupLayout jPanel10Layout = new org.jdesktop.layout.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel10Layout.createSequentialGroup()
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel23)
                    .add(jButton_solicitarNovaSenha, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 240, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel21)
                    .add(jPanel10Layout.createSequentialGroup()
                        .add(tfUsuario, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 159, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(lUsuarioLogin))
                    .add(jLabel24)
                    .add(jLabel22)
                    .add(jPanel10Layout.createSequentialGroup()
                        .add(pfSenha, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 167, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(lSenhaLogin))
                    .add(bEntrar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(26, 26, 26))
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel10Layout.createSequentialGroup()
                .add(jLabel23)
                .add(18, 18, 18)
                .add(jLabel21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(tfUsuario, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(lUsuarioLogin))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jLabel24)
                .add(23, 23, 23)
                .add(jLabel22)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel10Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(pfSenha, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(lSenhaLogin))
                .add(18, 18, 18)
                .add(bEntrar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(18, 18, 18)
                .add(jButton_solicitarNovaSenha, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(31, Short.MAX_VALUE))
        );

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/co/departamentodetransito/visao/transito.gif"))); // NOI18N

        org.jdesktop.layout.GroupLayout pFundoLayout = new org.jdesktop.layout.GroupLayout(pFundo);
        pFundo.setLayout(pFundoLayout);
        pFundoLayout.setHorizontalGroup(
            pFundoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, pFundoLayout.createSequentialGroup()
                .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 406, Short.MAX_VALUE)
                .add(5, 5, 5)
                .add(jPanel10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 298, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        pFundoLayout.setVerticalGroup(
            pFundoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(pFundoLayout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 289, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 311, Short.MAX_VALUE)
        );

        bSair.setBackground(new java.awt.Color(172, 172, 255));
        bSair.setFont(new java.awt.Font("Verdana", 1, 12));
        bSair.setText("X");
        bSair.setBorder(null);
        bSair.setBorderPainted(false);
        bSair.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                bSairMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                bSairMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                bSairMouseExited(evt);
            }
        });

        bMinimizar.setBackground(new java.awt.Color(172, 172, 255));
        bMinimizar.setFont(new java.awt.Font("Verdana", 1, 19));
        bMinimizar.setText("-");
        bMinimizar.setBorder(null);
        bMinimizar.setBorderPainted(false);
        bMinimizar.setPreferredSize(new java.awt.Dimension(9, 17));
        bMinimizar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                bMinimizarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                bMinimizarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                bMinimizarMouseExited(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jPanel11Layout = new org.jdesktop.layout.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel11Layout.createSequentialGroup()
                .addContainerGap(679, Short.MAX_VALUE)
                .add(bMinimizar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(1, 1, 1)
                .add(bSair, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 17, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .add(jPanel11Layout.createSequentialGroup()
                .add(pFundo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(0, 0, 0))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel11Layout.createSequentialGroup()
                .add(jPanel11Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(bMinimizar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(bSair))
                .add(30, 30, 30)
                .add(pFundo, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(60, 60, 60))
        );

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel11, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 728, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 421, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>                        

    private void bEntrarjButton_EntrarMouseClicked(java.awt.event.MouseEvent evt) {                                                   

    }                                                  

    private void jButton_solicitarNovaSenhajButton_solicitarNovaSenhaMouseClicked(java.awt.event.MouseEvent evt) {                                                                                  
        this.tfUsuario.setText("");
        this.pfSenha.setText("");

        TelaSolicitarNovaSenha telaSolicitarNovaSenha = new TelaSolicitarNovaSenha(this, true);
        telaSolicitarNovaSenha.setLocationRelativeTo(null);
        telaSolicitarNovaSenha.setVisible(true);

        OuvinteTelaSolicitarNovaSenha ouvinteTelaSolicitarNovaSenha = new OuvinteTelaSolicitarNovaSenha(telaSolicitarNovaSenha);
    }                                                                                 

    private void bSairMouseEntered(java.awt.event.MouseEvent evt) {                                   
        bSair.setForeground(new java.awt.Color(255, 102, 0));
    }                                  

    private void bSairMouseExited(java.awt.event.MouseEvent evt) {                                  
        bSair.setForeground(new java.awt.Color(0,0,0));
    }                                 

    private void bMinimizarMouseEntered(java.awt.event.MouseEvent evt) {                                        
        bMinimizar.setForeground(new java.awt.Color(255, 102, 0));
    }                                       

    private void bMinimizarMouseExited(java.awt.event.MouseEvent evt) {                                       
        bMinimizar.setForeground(new java.awt.Color(0,0,0));
    }                                      

    private void bSairMouseClicked(java.awt.event.MouseEvent evt) {                                   
        System.exit(0);
    }                                  

    private void bMinimizarMouseClicked(java.awt.event.MouseEvent evt) {                                        
        this.setExtendedState(TelaDeLogin.ICONIFIED); 
    }                                       

    private void pFundoAncestorAdded(javax.swing.event.AncestorEvent evt) {                                     
     
    }                                    

    private void bEntrarMouseEntered(java.awt.event.MouseEvent evt) {                                     
        bEntrar.setBorder(javax.swing.BorderFactory.createEtchedBorder(java.awt.Color.orange, new java.awt.Color(0, 51, 51)));
    }                                    

    private void bEntrarMouseExited(java.awt.event.MouseEvent evt) {                                    
        bEntrar.setBorder(javax.swing.BorderFactory.createEtchedBorder(java.awt.Color.LIGHT_GRAY, new java.awt.Color(0, 51, 51)));
    }                                   

    private void jButton_solicitarNovaSenhaMouseEntered(java.awt.event.MouseEvent evt) {                                                        
        jButton_solicitarNovaSenha.setBorder(javax.swing.BorderFactory.createEtchedBorder(java.awt.Color.orange, new java.awt.Color(0, 51, 51)));
    }                                                       

    private void jButton_solicitarNovaSenhaMouseExited(java.awt.event.MouseEvent evt) {                                                       
        jButton_solicitarNovaSenha.setBorder(javax.swing.BorderFactory.createEtchedBorder(java.awt.Color.LIGHT_GRAY, new java.awt.Color(0, 51, 51)));
    }                                                      

  
    // Variables declaration - do not modify                     
    private javax.swing.JButton bEntrar;
    private javax.swing.JButton bMinimizar;
    private javax.swing.JButton bSair;
    private javax.swing.JButton jButton_solicitarNovaSenha;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JLabel lSenhaLogin;
    private javax.swing.JLabel lUsuarioLogin;
    private javax.swing.JPanel pFundo;
    private javax.swing.JPasswordField pfSenha;
    private javax.swing.JTextField tfUsuario;
    // End of variables declaration                   

}
D

Vou explicar de novo para que não fique confuso:

Quando eu tento executar o aplicativo, gera esse erro:

Exception in thread main java.lang.NoClassDefFoundError: co/departamentodetransito/visao/TelaPrincipal

at java.lang.Class.getDeclaredMethods0(Native Method)

at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)

at java.lang.Class.getDeclaredMethod(Class.java:1935)

at java.awt.Component.isCoalesceEventsOverriden(Component.java:5948)

at java.awt.Component.access$500(Component.java:169)

at java.awt.Component$3.run(Component.java:5902)

at java.awt.Component$3.run(Component.java:5900)

at java.security.AccessController.doPrivileged(Native Method)

at java.awt.Component.checkCoalescing(Component.java:5899)

at java.awt.Component.(Component.java:5868)

at java.awt.Container.(Container.java:251)

at java.awt.Window.(Window.java:431)

at java.awt.Frame.(Frame.java:403)

at java.awt.Frame.(Frame.java:368)

at javax.swing.JFrame.(JFrame.java:158)

at co.departamentodetransito.visao.TelaDeLogin.(TelaDeLogin.java:11)

at co.departamentodetransito.visao.InterInicializacao.(InterInicializacao.java:18)

at co.departamentodetransito.Principal.main(Principal.java:14)

Caused by: java.lang.ClassNotFoundException: co.departamentodetransito.visao.TelaPrincipal

at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

 18 more

Mas quando eu tento limpar e construir de novo ele gera esse erro:

C:\Users\David\david\TrabalhoInstitucionalBeta\src\co\departamentodetransito\visao\TelaPrincipal.java:9977: code too large for try statement

} catch (java.text.ParseException ex) {

C:\Users\David\david\TrabalhoInstitucionalBeta\src\co\departamentodetransito\visao\TelaPrincipal.java:10015: code too large for try statement

} catch (java.text.ParseException ex) {

C:\Users\David\david\TrabalhoInstitucionalBeta\src\co\departamentodetransito\visao\TelaPrincipal.java:2347: code too large

private void initComponents() {

Note: Some input files use or override 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.

3 errors

C:\Users\David\david\TrabalhoInstitucionalBeta\nbproject\build-impl.xml:531: The following error occurred while executing this line:

C:\Users\David\david\TrabalhoInstitucionalBeta\nbproject\build-impl.xml:261: Compile failed; see the compiler error output for details.

at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1113)

at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:906)

at org.netbeans.modules.java.source.ant.JavacTask.execute(JavacTask.java:136)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

at sun.reflect.GeneratedMethodAccessor296.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

at org.apache.tools.ant.Task.perform(Task.java:348)

at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

at sun.reflect.GeneratedMethodAccessor296.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

at org.apache.tools.ant.Task.perform(Task.java:348)

at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

at sun.reflect.GeneratedMethodAccessor296.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)

at org.apache.tools.ant.Task.perform(Task.java:348)

at org.apache.tools.ant.Target.execute(Target.java:390)

at org.apache.tools.ant.Target.performTasks(Target.java:411)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)

at org.apache.tools.ant.Project.executeTarget(Project.java:1366)

at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)

at org.apache.tools.ant.Project.executeTargets(Project.java:1249)

at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:281)

at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)

at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)

FALHA NA CONSTRUÇÃO (tempo total: 4 segundos)
eberson_oliveira

Experimente quebrar essa sua classe e partes menores e compilar novamente.

Para fins de teste… experimente retirar os itens que não são necessários para fazer este teste… assim o initComponents() vai ficar menor e provavelmente vai compilar.

Editado:

Verifique também os blocos try na TelaPrincipal linha 9977 e 10015, pois estão muito grande para serem compilados. Experimente quebrá-los em mais classes, pois parece que você classes realmente grandes no seu projeto, o que indica que houve alguma quebra na sua Orientação a Objetos.

[]
Éberson

D

blza, vou fazer isso… quando terminar eu posto se deu tudo certo

Criado 7 de dezembro de 2010
Ultima resposta 7 de dez. de 2010
Respostas 23
Participantes 5