Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

java.lang.VerifyError Expecting to find object/array on stack

7 réponses
Avatar
pcouas
Bonsoir,

Cela fonctionnais, je ne pense rien avoir chang=E9 dans cette Classe,
Mais j'ai l'erreur suivante
L'erreur se situe dans le Constructeur.
Pourriez vous m'=E9clairer

Merci d'avance
Philippe

java.lang.VerifyError: (class: util/generic/URLConnectionT$MTimer,
method: <init
> signature: (Lutil/generic/URLConnectionT;JLutil/generic/TimeOutListener;)=
V) Ex
pecting to find object/array on stack

at
util.generic.URLConnectionT.connectToHere(URLConnectionT.java(Compile
d Code))

at
util.generic.URLConnectionT.connectToHere(URLConnectionT.java(Compile
d Code))

at
servlet24.TestServlet.setFixPostsBean(TestServlet.java(Compiled Code)
)







package util.generic;


//Sert a tester,

import java.net.*;
import java.io.*;

public class URLConnectionT implements TimeOutListener,
URLResponseListener
{

class MTimer extends Thread
{
private long timeOutInterval =3D 3000L;
TimeOutListener listener =3D null;
boolean continueThread =3D true;
boolean debug =3D false;

public MTimer(long timeOut, TimeOutListener l)
{
super("Time Out Thread");
System.out.println("Tmier apsuper");
timeOutInterval =3D timeOut;
listener =3D l;
}


public void stopTimer()
{
if(debug)System.out.println("Timer stopped");
continueThread =3D false;
}

public void run()
{
if(debug)System.out.println("Running Timer");
long actualTimeSlept =3D 0L;


while( (actualTimeSlept < timeOutInterval) &&
continueThread)
{
long l1 =3D System.currentTimeMillis();
try
{
sleep(timeOutInterval);
}
catch(Exception e) // InterruptedException
{
continueThread =3D false;
}
long l2 =3D System.currentTimeMillis();
actualTimeSlept +=3D l2 - l1;
}
if(continueThread)
listener.timedOut(timeOutInterval);
if(debug)System.out.println("Running Compete");
} // fin run
} //fin class Thread MTimer



static boolean responseAvailable =3D false; //permet de mettre
fin au Thread
public URLRequester uR;
private long timeSleep =3D 1000L;
MTimer timer;
boolean debug =3D false;
private boolean isok =3D false;

public URLConnectionT()
{
super();
}


public URLConnectionT(boolean d)
{
this();
debug=3Dd;
}


public synchronized void error(String s)
{
System.out.println(s);
}

public synchronized void timedOut(long mtimeOutInterval)
{
if(debug)System.out.println("Connection timedOut1");
uR.stopRequest();
timer.stopTimer();

if(debug)System.out.println("Connection timedOut2");
responseAvailable =3D true;
}

public synchronized void done()
{
isok =3D true;
timer.stopTimer();
uR.stopRequest();

if(debug)System.out.println("Success");
responseAvailable =3D true; // met fin du
Thread
// isok =3D true;
}

// other methods for various HTTP Response Types..
public boolean connectToHere(String sURL)
{
return this.connectToHere(sURL,null);
}

public boolean connectToHere(String sURL,OutputStream mout)
{
isok =3D false;
if(debug)System.out.println("Starting to connect to : "
+ sURL);
System.out.println("URLConnection AvTimer");
timer =3D new MTimer(100, this);

try
{
uR =3D new URLRequester(new URL(sURL),
this,debug,mout); //creation du Thread
/* }
catch (MalformedURLException e)
{}*/

responseAvailable =3D false;
timer.start(); //demmarrage timeout
uR.start(); //demmarrage thread de test

while(!responseAvailable)
{
try
{
Thread.sleep(timeSleep);
}
catch(InterruptedException e)
{
}
} // fin while
if(debug)System.out.println("Done");

}
catch (Exception e)
{}

return isok;
} // fin methode connectToHere

class URLRequester extends Thread
{
URL urlToOpen;
URLResponseListener listener;
BufferedInputStream dis =3D null;
OutputStream out=3Dnull;

URLRequester(URL urlToRead, URLResponseListener ul,boolean
mdebug, OutputStream mout)
{
urlToOpen =3D urlToRead;
listener =3D ul;
debug=3Dmdebug;
out=3Dmout;
}

URLRequester(URL urlToRead, URLResponseListener ul)
{
urlToOpen =3D urlToRead;
listener =3D ul;
debug=3Dfalse;
}


boolean continueThread =3D true;

public void stopRequest()
{
if(debug)System.out.println("Request Stopped");
continueThread =3D false;
}


public void run()
{
if(debug)System.out.println("Starting request.");
dis =3D null;
while( continueThread )
{
try
{
URLConnection uc =3D
urlToOpen.openConnection(); // no connection yet
uc.setUseCaches(false); //
possibly user specified.

if(debug)System.out.println("Connecting....");
uc.connect(); // request for
connection now!!! throws IOException here ,

if(debug)System.out.println("Opening....");
dis =3D new
BufferedInputStream(uc.getInputStream()); // throws IOException
here .try again

if(debug)System.out.println("DoneStream.");
// read the data in a loop

if(out!=3Dnull)
{
byte buf[] =3D new byte[2048];
int len;

if(debug)System.out.println("DoneStream out.");
while (true)
{
try
{
len =3D dis.read(buf);

if(debug)System.out.println("WriteStream01. "+len);
if (len<1)//done?
{
out.flush();
break;
}
}
catch (Exception e)
{
System.out.println("Err run
Stream. ");
break;
}
try
{

if(debug)System.out.println("WriteStream02. "+len);
out.write(buf,0,len);

if(debug)System.out.println("WriteStream03. "+len);
}
catch (Exception e)
{
System.out.println("Err run
Stream02. "+e.getMessage());
}
}//while

if(debug)System.out.println("WriteStream End. ");
}


dis.close(); // throws an exception
continueThread =3D false; // because we
are done.

listener.done();
}
catch(IOException e) // catch errors while
connecting and reading from the input stream.
{
// notify the user that the HTTP Reqest
failed using the HTTPResponseListener
listener.error(e.toString());
continueThread =3D false;
return;
}

}

if(dis!=3Dnull)
{
try { dis.close(); }
catch (IOException e) {}
dis =3D null;
}
if(debug)System.out.println("Request Complete.");
}
}
}


package util.generic;


public interface TimeOutListener
{
public void timedOut(long l);
}

7 réponses

Avatar
Olivier Thomann
Bonsoir,

Cela fonctionnais, je ne pense rien avoir changé dans cette Classe,
Mais j'ai l'erreur suivante
L'erreur se situe dans le Constructeur.
Pourriez vous m'éclairer
Ceci est un bug dans le compilateur. Quel compilateur utilises-tu?

--
Olivier

Avatar
pcouas
$ ./java -fullversion
java full version "J2RE 1.3.1 IBM AIX build ca131-20031105"
Avatar
pcouas
J'ai fait un peu d'Upgrade mais sans meilleur resulat !
$ ./java -fullversion
java full version "J2RE 1.3.1 IBM AIX build ca131-20040517"

Il y a til un moyen par Programme de contourner ce bug ?

Merci d'avancePhilippe
Avatar
pcouas
Question,
Es un Bug du Compilateur quand je cree les .class sur mon PC
Ou es un Bug du Compilateur de L'execution sur le Serveur ?

A+
Philippe
Avatar
Olivier Thomann
$ ./java -fullversion
java full version "J2RE 1.3.1 IBM AIX build ca131-20031105"
C'est vraiment une vieille version. N'as-tu pas acces a un compilateur

plus recent?
--
Olivier

Avatar
pcouas
Bonjour,

J'ai Updgrader à la derniere version de JDK 1.3 sous AIX, c'est le
meme probleme, je ne peut passer en JDK 1.4 à cause de l'OS un AIX
4.3.3.
J'ai le soucis sur plusieurs constructeur de Classes interne, je vais
resinstaller la précédente version de Jdevelopper, je pencherais pour
des parametres de Compilation mis dans Jdevelopper ou absent de la
derniere version.
Cela fontionne en JDK 1.4
Avatar
pcouas
En fait cela fonctionne avec Jdevlopper1012 et JDK 1.3
Cela crash avec Jdevelopper1013 et le meme JDK 1.3 (meme répertoire)

A+
Philippe