Could not initialize class com.geopista.app.AppContext

Hello,
I'm trying to create an application which connects to a data base. When running the program in Eclipse or in a compiled .jar, I get the following message. However, when I use the IDE Intellij IDEA, it works properly. I do have the .jar in the classpath.

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.commons.httpclient.methods.PostMethod.s etRequestContentLength(J)V
at com.geopista.protocol.net.EnviarSeguro.enviar(Envi  arSeguro.java:280)
at com.geopista.protocol.net.EnviarSeguro.enviarPlano  (EnviarSeguro.java:55)
at com.geopista.security.SecurityManager.callHeartBea  tNS(SecurityManager.java:394)
at com.geopista.security.SecurityManager.callHeartBea  t(SecurityManager.java:387)
at com.geopista.app.AppContext.initHeartBeat(AppConte  xt.java:221)
at com.geopista.app.AppContext.<init>(AppContext.java  :200)
at com.geopista.app.AppContext.<clinit>(AppContext.ja  va:156)
at Pruebas.main(Pruebas.java:10)
Exception in thread "Thread-3" java.lang.NoClassDefFoundError: Could not initialize class com.geopista.app.AppContext
at com.geopista.app.AppContext.getHttpClient(AppConte  xt.java:1202)
at com.geopista.protocol.net.EnviarSeguro.enviar(Envi  arSeguro.java:251)
at com.geopista.protocol.net.EnviarSeguro.enviarPlano  (EnviarSeguro.java:55)
at com.geopista.security.SecurityManager.callHeartBea  tNS(SecurityManager.java:394)
at com.geopista.security.SecurityManager.callHeartBea  t(SecurityManager.java:387)
at com.geopista.security.TestConnection.run(TestConne  ction.java:59)


It's not may app who uses the library http-commons.jar directly. I use a library of localgis who uses it and localgis apps works properly.


Thanks in advance
1 comment

Most probably you have different module dependency settings in Eclipse and IDEA. You could try examining the classpath strings they run your application with. At least IDEA outputs that as the first line in the console.

0

Please sign in to leave a comment.