You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/08/26 04:24:56 UTC

[GitHub] [pulsar] hangc0276 opened a new issue #11789: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

hangc0276 opened a new issue #11789:
URL: https://github.com/apache/pulsar/issues/11789


   **Describe the bug**
   When create a function, the server side throws NosuchMethodError exception
   ```
   Caused by: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
           at io.airlift.compress.lz4.Lz4Compressor.compress(Lz4Compressor.java:100) ~[io.airlift-aircompressor-0.19.jar:0.19]
           at org.apache.pulsar.common.compression.CompressionCodecLZ4.encode(CompressionCodecLZ4.java:78) ~[org.apache.pulsar-pulsar-common-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
           at org.apache.pulsar.client.impl.ProducerImpl.applyCompression(ProducerImpl.java:376) ~[org.apache.pulsar-pulsar-client-original-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
           at org.apache.pulsar.client.impl.ProducerImpl.sendAsync(ProducerImpl.java:403) ~[org.apache.pulsar-pulsar-client-original-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
           at org.apache.pulsar.client.impl.ProducerImpl.internalSendAsync(ProducerImpl.java:292) ~[org.apache.pulsar-pulsar-client-original-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
           at org.apache.pulsar.client.impl.TypedMessageBuilderImpl.sendAsync(TypedMessageBuilderImpl.java:103) ~[org.apache.pulsar-pulsar-client-original-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
           at org.apache.pulsar.client.impl.TypedMessageBuilderImpl.send(TypedMessageBuilderImpl.java:82) ~[org.apache.pulsar-pulsar-client-original-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
           at org.apache.pulsar.functions.worker.FunctionMetaDataManager.updateFunctionOnLeader(FunctionMetaDataManager.java:241) ~[org.apache.pulsar-pulsar-functions-worker-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
           at org.apache.pulsar.functions.worker.rest.api.ComponentImpl.internalProcessFunctionRequest(ComponentImpl.java:1578) ~[org.apache.pulsar-pulsar-functions-worker-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
           at org.apache.pulsar.functions.worker.rest.api.ComponentImpl.updateRequest(ComponentImpl.java:887) ~[org.apache.pulsar-pulsar-functions-worker-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
           at org.apache.pulsar.functions.worker.rest.api.FunctionsImpl.registerFunction(FunctionsImpl.java:238) ~[org.apache.pulsar-pulsar-functions-worker-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
           at org.apache.pulsar.broker.admin.impl.FunctionsBase.registerFunction(FunctionsBase.java:183) ~[org.apache.pulsar-pulsar-broker-2.9.0-SNAPSHOT.jar:2.9.0-SNAPSHOT]
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_291]
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_291]
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_291]
           at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_291]
           at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52) ~[org.glassfish.jersey.core-jersey-server-2.34.jar:?]
           at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124) ~[org.glassfish.jersey.core-jersey-server-2.34.jar:?]
           at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167) ~[org.glassfish.jersey.core-jersey-server-2.34.jar:?]
           at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:159) ~[org.glassfish.jersey.core-jersey-server-2.34.jar:?]
           at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) ~[org.glassfish.jersey.core-jersey-server-2.34.jar:?]
           at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475) ~[org.glassfish.jersey.core-jersey-server-2.34.jar:?]
           at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397) ~[org.glassfish.jersey.core-jersey-server-2.34.jar:?]
           at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81) ~[org.glassfish.jersey.core-jersey-server-2.34.jar:?]
           at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255) ~[org.glassfish.jersey.core-jersey-server-2.34.jar:?]
           at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248) ~[org.glassfish.jersey.core-jersey-common-2.34.jar:?]
           at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244) ~[org.glassfish.jersey.core-jersey-common-2.34.jar:?]
           at org.glassfish.jersey.internal.Errors.process(Errors.java:292) ~[org.glassfish.jersey.core-jersey-common-2.34.jar:?]
   ```
   
   **To Reproduce**
   Steps to reproduce the behavior:
   ```bash
   $ bin/pulsar-admin tenants create test
   $ bin/pulsar-admin namespaces create test/test-namespace
   $ bin/pulsar-admin functions create --function-config-file examples/example-function-config.yaml --jar examples/api-examples.jar
   ```
   
   **Expected behavior**
   Created Successfully
   
   
   **Desktop (please complete the following information):**
    - OS: [e.g. iOS]
   
   **Additional context**
   Add any other context about the problem here.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] liangyuanpeng edited a comment on issue #11789: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

Posted by GitBox <gi...@apache.org>.
liangyuanpeng edited a comment on issue #11789:
URL: https://github.com/apache/pulsar/issues/11789#issuecomment-906111007


   > Please try to run the function with java 11.
   > 
   > I tested with master branch on java 11, the function runs fine.
   
   Thanks for your work and i think it should be work for java8, not java11 only, right?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] hangc0276 commented on issue #11789: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

Posted by GitBox <gi...@apache.org>.
hangc0276 commented on issue #11789:
URL: https://github.com/apache/pulsar/issues/11789#issuecomment-906113225


   Yes, i build and run with java8
   ```bash
    hangc@MacBook-Pro-2  ~/Workspace/release/pulsar-2.8.1  java -version
   java version "1.8.0_291"
   Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
   Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)
   
    hangc@MacBook-Pro-2  ~/Workspace/release/pulsar-2.8.1  mvn -v
   Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
   Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T23:06:16+08:00)
   Maven home: /Users/hangc/Cloud/apache-maven-3.6.2
   Java version: 1.8.0_291, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/jre
   Default locale: en_CN, platform encoding: UTF-8
   OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] hangc0276 commented on issue #11789: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

Posted by GitBox <gi...@apache.org>.
hangc0276 commented on issue #11789:
URL: https://github.com/apache/pulsar/issues/11789#issuecomment-906151538


   @eolivelli Ok, i upgrade the aircompressor to 0.20, it works, thank you very much. It push a PR #11790, PTAL.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] hangc0276 commented on issue #11789: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

Posted by GitBox <gi...@apache.org>.
hangc0276 commented on issue #11789:
URL: https://github.com/apache/pulsar/issues/11789#issuecomment-906118627


   > Arw you using latest master?
   > @codelipenghui fixed this problem recently
   
   @eolivelli  Yes, I build from the latest master. build and run with java8


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli commented on issue #11789: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

Posted by GitBox <gi...@apache.org>.
eolivelli commented on issue #11789:
URL: https://github.com/apache/pulsar/issues/11789#issuecomment-906129979


   I refer to this patch
   https://github.com/apache/pulsar/pull/11594


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] liangyuanpeng commented on issue #11789: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

Posted by GitBox <gi...@apache.org>.
liangyuanpeng commented on issue #11789:
URL: https://github.com/apache/pulsar/issues/11789#issuecomment-906111007


   > Please try to run the function with java 11.
   > 
   > I tested with master branch on java 11, the function runs fine.
   > 
   > ```
   > ➜  sn-pulsar git:(master) ✗ java -version
   > java version "11.0.11" 2021-04-20 LTS
   > Java(TM) SE Runtime Environment 18.9 (build 11.0.11+9-LTS-194)
   > Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.11+9-LTS-194, mixed mode)
   > ```
   > 
   > ```
   > ➜  sn-pulsar git:(master) ./bin/pulsar-admin functions create --jar ./pulsar-functions/java-examples/target/pulsar-functions-api-examples.jar --classname org.apache.pulsar.functions.api.examples.ExclamationFunction --inputs persistent://public/default/my-topic --name exclamation --tenant public --namespace default --output persistent://public/default/output
   > "Created successfully"
   > ```
   > 
   > ```
   > ➜  sn-pulsar git:(master) ✗ ./bin/pulsar-client produce -m "$i. hello" public/default/my-topic
   > ...
   > 22:15:26.993 [main] INFO  org.apache.pulsar.client.cli.PulsarClientTool - 1 messages successfully produced
   > ```
   > 
   > ```
   > ➜  sn-pulsar git:(master) ✗ ./bin/pulsar-client consume -n 0 -s tttt public/default/output
   > ...
   > ----- got message -----
   > key:[null], properties:[__pfn_input_msg_id__=CPoMEAAgADAB, __pfn_input_topic__=persistent://public/default/my-topic], content:. hello!
   > ...
   > ```
   
   Thanks for your work and i think it should be work for java8, not java11 only, right?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli commented on issue #11789: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

Posted by GitBox <gi...@apache.org>.
eolivelli commented on issue #11789:
URL: https://github.com/apache/pulsar/issues/11789#issuecomment-906130709


   AirLift has been upgraded
   https://github.com/airlift/aircompressor/issues/133#issuecomment-897309719
   
   @hangc0276 @codelipenghui  do you want to send a patch that:
   - upgrades AirLift
   - reverts #11594
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] hangc0276 closed issue #11789: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

Posted by GitBox <gi...@apache.org>.
hangc0276 closed issue #11789:
URL: https://github.com/apache/pulsar/issues/11789


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] hangc0276 commented on issue #11789: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

Posted by GitBox <gi...@apache.org>.
hangc0276 commented on issue #11789:
URL: https://github.com/apache/pulsar/issues/11789#issuecomment-906114841


   > > Please try to run the function with java 11.
   > > I tested with master branch on java 11, the function runs fine.
   > 
   > Thanks for your work and i think it should be work for java8, not java11 only, right?
   
   I agree with you. I user run pulsar function with java8, it will fail. @nlu90 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli commented on issue #11789: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

Posted by GitBox <gi...@apache.org>.
eolivelli commented on issue #11789:
URL: https://github.com/apache/pulsar/issues/11789#issuecomment-906115913


   Arw you using latest master?
   @codelipenghui fixed this problem recently 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] hangc0276 edited a comment on issue #11789: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

Posted by GitBox <gi...@apache.org>.
hangc0276 edited a comment on issue #11789:
URL: https://github.com/apache/pulsar/issues/11789#issuecomment-906114841


   > > Please try to run the function with java 11.
   > > I tested with master branch on java 11, the function runs fine.
   > 
   > Thanks for your work and i think it should be work for java8, not java11 only, right?
   
   I agree with you. When user run pulsar function with java8, it will fail. @nlu90 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] nlu90 commented on issue #11789: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

Posted by GitBox <gi...@apache.org>.
nlu90 commented on issue #11789:
URL: https://github.com/apache/pulsar/issues/11789#issuecomment-906103260


   Please try to run the function with java 11.
   
   I tested with master branch on java 11, the function runs fine.
   
   ```
   ➜  sn-pulsar git:(master) ✗ java -version
   java version "11.0.11" 2021-04-20 LTS
   Java(TM) SE Runtime Environment 18.9 (build 11.0.11+9-LTS-194)
   Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.11+9-LTS-194, mixed mode)
   ```
   
   ```
   ➜  sn-pulsar git:(master) ./bin/pulsar-admin functions create --jar ./pulsar-functions/java-examples/target/pulsar-functions-api-examples.jar --classname org.apache.pulsar.functions.api.examples.ExclamationFunction --inputs persistent://public/default/my-topic --name exclamation --tenant public --namespace default --output persistent://public/default/output
   "Created successfully"
   ```
   
   ```
   ➜  sn-pulsar git:(master) ✗ ./bin/pulsar-client produce -m "$i. hello" public/default/my-topic
   ...
   22:15:26.993 [main] INFO  org.apache.pulsar.client.cli.PulsarClientTool - 1 messages successfully produced
   ```
   
   ```
   ➜  sn-pulsar git:(master) ✗ ./bin/pulsar-client consume -n 0 -s tttt public/default/output
   ...
   ----- got message -----
   key:[null], properties:[__pfn_input_msg_id__=CPoMEAAgADAB, __pfn_input_topic__=persistent://public/default/my-topic], content:. hello!
   ...
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] eolivelli commented on issue #11789: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

Posted by GitBox <gi...@apache.org>.
eolivelli commented on issue #11789:
URL: https://github.com/apache/pulsar/issues/11789#issuecomment-906130238


   it is in a different code path.
   
   The correct fix is to upgrade Airlift or to downgrade it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org