[
https://issues.apache.org/jira/browse/DIRMINA-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17901594#comment-17901594
]
Emmanuel Lécharny commented on DIRMINA-1183:
--------------------------------------------
Hi Alexender,
I have to check if MINA 2.1.9 has been properly built using a Java 8 target.
What I can tell is that it was built with Java 11.
Also there is a bit of a mess in MINA 2.1.9 pom.xml file:
{code}
<pluginManagement>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.compiler.plugin}</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<optimize>true</optimize>
<showDeprecations>true</showDeprecations>
<encoding>ISO-8859-1</encoding>
</configuration>
</plugin>
...
{code}
and
{code}
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source>
<target>1.8</target>
<debug>true</debug>
<optimize>true</optimize>
<showDeprecations>true</showDeprecations>
</configuration>
</plugin>
...
{code)
That has been change in the coming 2.1.10 version to be released soon:
{code}
<properties>
<!-- Define the Java source and target version -->
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
{code}
What I can suggest is to change the maven-compiler-plugin configuration and
remove the <source> and <target> parts, add the properties, and rebuild MINA
with Java 11, that should solve the issue, until I push the 2.1.10 packages.
> NoSuchMethodError at Version 2.1.9
> ----------------------------------
>
> Key: DIRMINA-1183
> URL: https://issues.apache.org/jira/browse/DIRMINA-1183
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.1.9
> Reporter: Alexander B
> Priority: Major
> Attachments: MinaTest.zip
>
>
> Compiling and Running my project with Java 1.8 and Mina 2.1.8 works fine.
> Now, I have updated Mina to 2.1.9 with no code changes on my side, then it
> seems, that there might be some problems running the program
> (NoSuchMethodException).
> I have prepared a minimal example as a zip file, which is attached.
> Case A (this case works):
> Set Mina to *2.1.8* in pom.xml and build it with *mvn clean package -U*,
> running then in target-subdir *java -jar MinaTest.jar* works fine. You can
> connect, e.g. with Putty to localhost:5555 and you receive messages
> Case B (this case crashes):
> Set Mina to *2.1.9* in pom.xml and build it with *mvn clean package -U*,
> running then in target-subdir *java -jar MinaTest.jar* yields into the
> following exception:
> {quote}Exception in thread "main" java.lang.NoSuchMethodError:
> java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;
> at
> org.apache.mina.core.buffer.AbstractIoBuffer.flip(AbstractIoBuffer.java:462)
> at
> org.apache.mina.filter.codec.textline.TextLineDecoder.<init>(TextLineDecoder.java:137)
> at
> org.apache.mina.filter.codec.textline.TextLineCodecFactory.<init>(TextLineCodecFactory.java:91)
> at org.example.SocketSink.<init>(SocketSink.java:21)
> at org.example.Main.main(Main.java:11){quote}
> The environment was:
> {quote}Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
> Maven home: C:\Users\User\Documents\apache-maven-3.9.9
> Java version: 1.8.0_302, vendor: Temurin, runtime: C:\Program Files\Eclipse
> Foundation\jdk-8.0.302.8-hotspot\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 10", version: "10.0", arch: "amd64", family:
> "windows"{quote}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]