Java7 for Jodd 3.7

80 views
Skip to first unread message

Jodders

unread,
Jun 14, 2015, 2:47:59 AM6/14/15
to jod...@googlegroups.com
Hey!

We are considering start using java 7 for Jodd 3.7.

wdyt?

أنس الليثي

unread,
Aug 6, 2015, 6:37:57 AM8/6/15
to Jodders
It is my first time to use the Jodd library set. 

Is this message means the previous versions of Jodd does not support java 7? 

Jodders

unread,
Aug 6, 2015, 6:40:41 AM8/6/15
to Jodders
Hello and welcome to the world of Jodd :)

Previous versions of Jodd was build on JDK 5, which means that all versions above are supported - so it works on 5,6,7 and 8 :)

Starting from v3.7 we are dropping support on 5 and 6, having Java 7 as the base version.

أنس الليثي

unread,
Aug 6, 2015, 7:06:41 AM8/6/15
to Jodders
OK that is very fine, 

I am trying to use the Jodd-http library and facing a little problem. 

When I run the application on a machine with java 1.8 installed the application runs fine. When I try to run it on another machine with java 1.7 the following exception is thrown 

java.lang.NoSuchMethodError: jodd.Jodd.init(Ljava/lang/Class;)V

What does this mean ? 

On Sunday, June 14, 2015 at 9:47:59 AM UTC+3, Jodders wrote:

Jodders

unread,
Aug 6, 2015, 7:15:41 AM8/6/15
to Jodders
This shouldn't be related to java version, but to jodd libraries - are you sure you have jodd-core in your classpath?

Because jodd-http can't work without jodd-core, and from your exception it looks like only jodd-http jar is present in the classpath; but not jodd-core.

Can you check this please (you can send example that is not working, too:)?

Jodders

unread,
Aug 6, 2015, 7:26:31 AM8/6/15
to Jodders
Also answered you on the StackOverflow :)))

أنس الليثي

unread,
Aug 6, 2015, 8:08:17 AM8/6/15
to Jodders
I am using the same JAR on both machines. Also I am using maven for dependency management. 

I have suspected that I build the application based on java 1.8 as I have both 1.7 and 1.8 installed to my machine. 

I removed 1.8, kept 1.7, packaged the application again and the problem still that same.


On Sunday, June 14, 2015 at 9:47:59 AM UTC+3, Jodders wrote:

أنس الليثي

unread,
Aug 6, 2015, 8:12:18 AM8/6/15
to Jodders
Also here is the full stacktrace 

java.lang.NoSuchMethodError: jodd.Jodd.init(Ljava/lang/Class;)V
at jodd.http.JoddHttp.init(JoddHttp.java:53)
at jodd.http.JoddHttp.<clinit>(JoddHttp.java:49)
at jodd.http.HttpBase.<init>(HttpBase.java:476)
at jodd.http.HttpRequest.<init>(HttpRequest.java:37)
at jodd.http.HttpRequest.post(HttpRequest.java:188)
at org.css.flumeinterceptor.WisdomSentimentInterceptor.intercept(WisdomSentimentInterceptor.java:47)
at org.css.flumeinterceptor.WisdomSentimentInterceptor.intercept(WisdomSentimentInterceptor.java:67)
at org.apache.flume.interceptor.InterceptorChain.intercept(InterceptorChain.java:62)
at org.apache.flume.channel.ChannelProcessor.processEventBatch(ChannelProcessor.java:146)
at org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:235)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)




On Sunday, June 14, 2015 at 9:47:59 AM UTC+3, Jodders wrote:

Jodders

unread,
Aug 6, 2015, 8:19:17 AM8/6/15
to Jodders
Hm, this tells me that jodd-core is not available on the class path, or you are using different versions.... The line where it fails is:

public static void init() {
Jodd.init(JoddHttp.class);
}

and this one is missing.

I will publish small http requst gradle project for you to try, give me half an hour ;)

أنس الليثي

unread,
Aug 6, 2015, 8:20:49 AM8/6/15
to Jodders
A little thing I just noted now. 

The installed JVM in the working machine is Oracle JVM while in the other machine is OpenJDK. 

I am not sure is this info significant or not. 


On Sunday, June 14, 2015 at 9:47:59 AM UTC+3, Jodders wrote:

أنس الليثي

unread,
Aug 6, 2015, 8:31:06 AM8/6/15
to Jodders
Before you start in this experiment I will try to add jodd-core manually to the libs directory to check and back to you


On Sunday, June 14, 2015 at 9:47:59 AM UTC+3, Jodders wrote:

أنس الليثي

unread,
Aug 6, 2015, 8:43:56 AM8/6/15
to Jodders
I downloaded jodd-core from the maven repo and put it into the libs directory alongside with the package jar of my application and the situation is the same. 

I extracted the jar file of my application and found the core directory and JoddCore.class file. 

Also, I tried to decompile the .class file of JoddHttp and I found the init method like the following 


public static void init() { Jodd.init(jodd/http/JoddHttp); }


Then I decompiled the JoddCore.class file and I found this init method

public static void init() { Jodd.init(jodd/core/JoddCore); }


:( Any idea. 

Currently I have two things to suspect 
1- the java version
2- the difference between the two JVMs




On Sunday, June 14, 2015 at 9:47:59 AM UTC+3, Jodders wrote:

Jodders

unread,
Aug 6, 2015, 8:48:00 AM8/6/15
to Jodders
Java version must not be a problem :)))) Http client is already used on various Java versions, from 5 to 8. So the only thing I suspect may be JVM difference? Which is strange as well, as we test on the both.

Here is simple example:


(check httpclient folder)

Would you be so kind to test this one? Thank you! It is a gradle project, so it would be easy to run it

أنس الليثي

unread,
Aug 6, 2015, 9:00:37 AM8/6/15
to Jodders
The sample application works fine. 

By the way, here is the output of the java -version command when I execute on the machine
--------------------
java version "1.7.0_65"
OpenJDK Runtime Environment (rhel-2.5.1.2.e16_5-x86_64 u65-b17)
OpenJDK 64-BIT Server VM (build 24.65-b04, mixed mode)
----------------------




On Sunday, June 14, 2015 at 9:47:59 AM UTC+3, Jodders wrote:

Jodders

unread,
Aug 6, 2015, 9:09:26 AM8/6/15
to Jodders
If the sample works fine (and it should:) then it must be something local... 

What I can suggest is to put a breakpoint in `WisdomSentimentInterceptor` and check if this class see the jodd core. Try for example to use some util from jodd-core, like StirngUtil.

Also check classloader that loaded jodd-http class. Maybe that classloader is not seeing the core library. Try to manually load the StringUtil using that class loader.

So just try to play with classloaders that loaded Wisdom*Interceptor and the HttpRequest class etc. Also check where this class comes from - maybe you have multiple jodd jars in the class path (dependencies)?

This is all I can think of :))

moh....@googlemail.com

unread,
Jan 23, 2016, 4:56:07 AM1/23/16
to Jodders
Hi,

i think, Java 7 as requirement for Jodd 3.7 is good.

Jodders

unread,
Jan 23, 2016, 4:54:02 PM1/23/16
to Jodders
Great! We will do that. It's time to move on ;)))
Reply all
Reply to author
Forward
0 new messages