Buiding lambda applicaion error. API altMetaFactory() is needed but not existing in java.lang.invoke.LambdaMetafactory APIs

44 views
Skip to first unread message

Luc

unread,
Nov 28, 2016, 9:54:16 AM11/28/16
to Avian
Repost due to my previous post did not appear in post lists. (weird)

The lambda applicaiton was built under OpenJDK, but runs failed on Avian VM. The NoSuchMethod exception was thrown, showing that altMetaFactory() is missing.

Please advice:
1. Why this API is needded? Because of invokedynamic opcode?
2. How to workround this error? Use Avian classpath as bootclasspath to compile the application again?

Regards,
Luc

Joel Dice .

unread,
Nov 28, 2016, 9:59:41 AM11/28/16
to Avian
Hi Luc,

Sorry your earlier post wasn't published. I got an email about it,
but it went to my spam folder, so I didn't notice it.

Lambdas should work fine without recompiling. Can you provide a test
case? If so, I'll be happy to debug it.

Thanks.
> --
> You received this message because you are subscribed to the Google Groups
> "Avian" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to avian+un...@googlegroups.com.
> To post to this group, send email to av...@googlegroups.com.
> Visit this group at https://groups.google.com/group/avian.
> For more options, visit https://groups.google.com/d/optout.

Luc

unread,
Nov 30, 2016, 3:57:54 AM11/30/16
to Avian
It's a large test case binary, and I was not able to abstract to a smaller one. Please try that when you have time. Thanks! 


Please tell me if you can not fetch it.

Setup instructions
unzip workspace folder and put in /home/agent folder.
It contains library binary and application Eclipse project. The problem resides one of the library binary, not in application. (That's why I was not able to seperate them)

Running command
agent@agent-VirtualBox:~/bin/eclipse$ ~/workspace/avian/build/linux-i386-openjdk-src/avian -classpath /home/agent/workspace/SensorAnalyticsApplication_avian/bin:/home/agent/workspace/quarks/target/java8/lib/quarks.api.function.jar:/home/agent/workspace/quarks/target/java8/ext/google-gson-2.2.4/gson-2.2.4.jar:/home/agent/workspace/quarks/target/java8/ext/slf4j-1.7.12/slf4j-api-1.7.12.jar:/home/agent/workspace/quarks/target/java8/ext/metrics-3.1.2/metrics-core-3.1.2.jar:/home/agent/workspace/quarks/target/java8/lib/quarks.api.execution.jar:/home/agent/workspace/quarks/target/java8/lib/quarks.api.window.jar:/home/agent/workspace/quarks/target/java8/lib/quarks.api.oplet.jar:/home/agent/workspace/quarks/target/java8/lib/quarks.api.graph.jar:/home/agent/workspace/quarks/target/java8/lib/quarks.api.topology.jar:/home/agent/workspace/quarks/target/java8/lib/quarks.spi.topology.jar:/home/agent/workspace/quarks/target/java8/lib/quarks.spi.graph.jar:/home/agent/workspace/quarks/target/java8/lib/quarks.runtime.etiao.jar:/home/agent/workspace/quarks/target/java8/lib/quarks.providers.direct.jar:/home/agent/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-http-9.3.6.v20151106.jar:/home/agent/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-io-9.3.6.v20151106.jar:/home/agent/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-security-9.3.6.v20151106.jar:/home/agent/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-server-9.3.6.v20151106.jar:/home/agent/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-servlet-9.3.6.v20151106.jar:/home/agent/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-util-9.3.6.v20151106.jar:/home/agent/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-webapp-9.3.6.v20151106.jar:/home/agent/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-xml-9.3.6.v20151106.jar:/home/agent/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/servlet-api-3.1.jar:/home/agent/workspace/quarks/target/java8/console/server/lib/quarks.console.server.jar:/home/agent/workspace/quarks/target/java8/utils/metrics/lib/quarks.utils.metrics.jar:/home/agent/workspace/quarks/target/java8/lib/quarks.runtime.jmxcontrol.jar:/home/agent/workspace/quarks/target/java8/lib/quarks.providers.development.jar:/home/agent/workspace/quarks/target/java8/ext/slf4j-1.7.12/slf4j-jdk14-1.7.12.jar:/home/agent/workspace/quarks/target/java8/analytics/math3/ext/commons-math3-3.4.1/commons-math3-3.4.1.jar:/home/agent/workspace/quarks/target/java8/samples/lib/quarks.samples.utils.jar:/home/agent/workspace/quarks/target/java8/lib/quarks.runtime.jsoncontrol.jar:/home/agent/workspace/quarks/target/java8/connectors/file/lib/quarks.connectors.file.jar:/home/agent/workspace/quarks/target/java8/analytics/math3/lib/quarks.analytics.math3.jar quarks.samples.apps.sensorAnalytics.SensorAnalyticsApplication /home/agent/workspace/applicationTemplate.properties

Output is:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/agent/workspace/quarks/target/java8/ext/slf4j-1.7.12/slf4j-jdk14-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/agent/workspace/quarks/target/java8/samples/lib/../../ext/slf4j-1.7.12/slf4j-jdk14-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory]
java/lang/NoSuchMethodError: altMetafactory (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite; not found in java/lang/invoke/LambdaMetafactory
  at quarks/samples/utils/sensor/PeriodicRandomSensor.newDouble (line 82)
  at quarks/samples/apps/sensorAnalytics/Sensor1.addAnalytics (line 115)
  at quarks/samples/apps/sensorAnalytics/SensorAnalyticsApplication.buildTopology (line 39)
  at quarks/samples/apps/AbstractApplication.run (line 69)
  at quarks/samples/apps/sensorAnalytics/SensorAnalyticsApplication.main (line 23)
agent@agent-VirtualBox:~/bin/eclipse$ 

Joel Dice .

unread,
Nov 30, 2016, 9:45:26 AM11/30/16
to Avian
That looks fine, thanks. I'll debug it this weekend when I have time
and let you know what happens.

Joel Dice .

unread,
Dec 4, 2016, 11:11:42 PM12/4/16
to Avian, shiw...@gmail.com
Hi Luc,

I spent some time debugging your test case and fixed a few things:
https://github.com/ReadyTalk/avian/pull/511

However, now I'm getting a crash during garbage collection, so it's
not completely working yet. I'll keep debugging it when I have more
time and let you know what happens.

Luc

unread,
Dec 5, 2016, 1:29:39 AM12/5/16
to Avian, shiw...@gmail.com
Thank you Joel. I will stay tuned on that.


Joel Dice .

unread,
Dec 7, 2016, 11:42:31 PM12/7/16
to Avian, Luc Shi
Hi Luc,

I'm now able to run your test code without any problems.  Please pull the latest code from the Git repo and let me know if you see any more issues.

On Dec 4, 2016 11:29 PM, "Luc" <shiw...@gmail.com> wrote:
Thank you Joel. I will stay tuned on that.


--
You received this message because you are subscribed to the Google Groups "Avian" group.
To unsubscribe from this group and stop receiving emails from it, send an email to avian+unsubscribe@googlegroups.com.

Luc

unread,
Dec 8, 2016, 3:41:18 AM12/8/16
to Avian, shiw...@gmail.com
Many thanks for your time and effort!

Regards,
Luc


On Thursday, December 8, 2016 at 12:42:31 PM UTC+8, Joel Dice wrote:
Hi Luc,

I'm now able to run your test code without any problems.  Please pull the latest code from the Git repo and let me know if you see any more issues.
On Dec 4, 2016 11:29 PM, "Luc" <shiw...@gmail.com> wrote:
Thank you Joel. I will stay tuned on that.


--
You received this message because you are subscribed to the Google Groups "Avian" group.
To unsubscribe from this group and stop receiving emails from it, send an email to avian+un...@googlegroups.com.

Luc

unread,
Dec 12, 2016, 12:22:13 AM12/12/16
to Avian, shiw...@gmail.com
Hi Joel,

I used the latest Avian build to run my workload, but found the execute exit (with no error or exception) after the first few logic.
The expected output of this workload is numbers periodcally. Using openjdk or Oracle java can get those output while Avian cannot.

Could you paste the output log ?

Regards,
Luc



在 2016年12月8日星期四 UTC+8下午12:42:31,Joel Dice写道:
Hi Luc,

I'm now able to run your test code without any problems.  Please pull the latest code from the Git repo and let me know if you see any more issues.
On Dec 4, 2016 11:29 PM, "Luc" <shiw...@gmail.com> wrote:
Thank you Joel. I will stay tuned on that.


--
You received this message because you are subscribed to the Google Groups "Avian" group.
To unsubscribe from this group and stop receiving emails from it, send an email to avian+un...@googlegroups.com.

Joel Dice .

unread,
Dec 12, 2016, 9:40:53 AM12/12/16
to Avian, Luc Shi
Hi Luc,

Sorry you're still having problems. This is the command I'm using:

$HOME/p/avian/build/linux-x86_64-debug-openjdk-src/avian -classpath
$HOME/p/workspace/SensorAnalyticsApplication_avian/bin:$HOME/p/workspace/quarks/target/java8/lib/quarks.api.function.jar:$HOME/p/workspace/quarks/target/java8/ext/google-gson-2.2.4/gson-2.2.4.jar:$HOME/p/workspace/quarks/target/java8/ext/slf4j-1.7.12/slf4j-api-1.7.12.jar:$HOME/p/workspace/quarks/target/java8/ext/metrics-3.1.2/metrics-core-3.1.2.jar:$HOME/p/workspace/quarks/target/java8/lib/quarks.api.execution.jar:$HOME/p/workspace/quarks/target/java8/lib/quarks.api.window.jar:$HOME/p/workspace/quarks/target/java8/lib/quarks.api.oplet.jar:$HOME/p/workspace/quarks/target/java8/lib/quarks.api.graph.jar:$HOME/p/workspace/quarks/target/java8/lib/quarks.api.topology.jar:$HOME/p/workspace/quarks/target/java8/lib/quarks.spi.topology.jar:$HOME/p/workspace/quarks/target/java8/lib/quarks.spi.graph.jar:$HOME/p/workspace/quarks/target/java8/lib/quarks.runtime.etiao.jar:$HOME/p/workspace/quarks/target/java8/lib/quarks.providers.direct.jar:$HOME/p/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-http-9.3.6.v20151106.jar:$HOME/p/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-io-9.3.6.v20151106.jar:$HOME/p/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-security-9.3.6.v20151106.jar:$HOME/p/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-server-9.3.6.v20151106.jar:$HOME/p/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-servlet-9.3.6.v20151106.jar:$HOME/p/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-util-9.3.6.v20151106.jar:$HOME/p/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-webapp-9.3.6.v20151106.jar:$HOME/p/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/jetty-xml-9.3.6.v20151106.jar:$HOME/p/workspace/quarks/target/java8/console/server/ext/jetty-9.3.6/servlet-api-3.1.jar:$HOME/p/workspace/quarks/target/java8/console/server/lib/quarks.console.server.jar:$HOME/p/workspace/quarks/target/java8/utils/metrics/lib/quarks.utils.metrics.jar:$HOME/p/workspace/quarks/target/java8/lib/quarks.runtime.jmxcontrol.jar:$HOME/p/workspace/quarks/target/java8/lib/quarks.providers.development.jar:$HOME/p/workspace/quarks/target/java8/ext/slf4j-1.7.12/slf4j-jdk14-1.7.12.jar:$HOME/p/workspace/quarks/target/java8/analytics/math3/ext/commons-math3-3.4.1/commons-math3-3.4.1.jar:$HOME/p/workspace/quarks/target/java8/samples/lib/quarks.samples.utils.jar:$HOME/p/workspace/quarks/target/java8/lib/quarks.runtime.jsoncontrol.jar:$HOME/p/workspace/quarks/target/java8/connectors/file/lib/quarks.connectors.file.jar:$HOME/p/workspace/quarks/target/java8/analytics/math3/lib/quarks.analytics.math3.jar
quarks.samples.apps.sensorAnalytics.SensorAnalyticsApplication
$HOME/p/workspace/applicationTemplate.properties

And this is the output:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in
[jar:file:/home/dicej/p/workspace/quarks/target/java8/ext/slf4j-1.7.12/slf4j-jdk14-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in
[jar:file:/home/dicej/p/workspace/quarks/target/java8/samples/lib/../../ext/slf4j-1.7.12/slf4j-jdk14-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory]
{"N":1,"MIN":0.20973323128884702,"MAX":0.20973323128884702,"MEAN":0.20973323128884702,"STDDEV":0.0}
{"N":2,"MIN":0.07796598120216702,"MAX":0.20973323128884702,"MEAN":0.14384960624550702,"STDDEV":0.09317351607459512}
{"N":3,"MIN":0.07796598120216702,"MAX":0.5811665939742179,"MEAN":0.28962193548841064,"STDDEV":0.2609393952004103}
{"N":4,"MIN":0.07796598120216702,"MAX":0.5811665939742179,"MEAN":0.3220323416186095,"STDDEV":0.22269856236731372}
{"N":3,"MIN":0.07796598120216702,"MAX":0.5811665939742179,"MEAN":0.35946537839519693,"STDDEV":0.2568746407623734}
{"N":4,"MIN":0.07796598120216702,"MAX":0.8998166117626664,"MEAN":0.4945531867370643,"STDDEV":0.34203009306439}
{"N":3,"MIN":0.41926356000920595,"MAX":0.8998166117626664,"MEAN":0.6334155885820301,"STDDEV":0.24450005514423992}
{"N":4,"MIN":0.41926356000920595,"MAX":0.8998166117626664,"MEAN":0.6210067073985864,"STDDEV":0.2011701749910347}
{"N":3,"MIN":0.41926356000920595,"MAX":0.8998166117626664,"MEAN":0.6342867452067094,"STDDEV":0.24422531100148953}

The exit code is zero, which I assume means the program was
successful. What is the program supposed to do?

Joel Dice .

unread,
Dec 12, 2016, 10:00:28 AM12/12/16
to Avian, Luc Shi
Ah, I see. I just ran it with OpenJDK and see that it continues
outputting values indefinitely. I'll try to determine what the
difference is when I have more time to look at it.

Luc

unread,
Dec 13, 2016, 3:33:57 AM12/13/16
to Avian, shiw...@gmail.com
I will stay tuned.

My output is as below, w/o any value. My version has slight difference with yours, which was added some logic in between. It seems as "timing" related issue.

SLF4J: Class path contains multiple SLF4J bindings. 
SLF4J: Found binding in 
[jar:file:/home/dicej/p/workspace/quarks/target/java8/ext/slf4j-1.7.12/slf4j-jdk14-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in 
[jar:file:/home/dicej/p/workspace/quarks/target/java8/samples/lib/../../ext/slf4j-1.7.12/slf4j-jdk14-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 
SLF4J: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory] 

在 2016年12月12日星期一 UTC+8下午11:00:28,Joel Dice写道:

Joel Dice .

unread,
Dec 18, 2016, 9:17:16 PM12/18/16
to Avian, Luc Shi
Hi Luc,

This should fix the issue:

https://github.com/ReadyTalk/avian/pull/515

Let me know if you still have trouble.
Reply all
Reply to author
Forward
0 new messages