No such property: org for class: org.grails.plugins.log4jxml.Log4jConfigurationInitializer while setup grails 2.0.0 - grails-2.0

While im running 'grails war' im getting the following exception
| Error Error loading plugin manager: Could not create a new instance of class [Log4jXmlGrailsPlugin]! (NOTE: Stack trace has been filtered. Use --ver
bose to see entire trace.)
org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [Log4jXmlGrailsPlugin]!
at _PluginDependencies_groovy$_run_closure5_closure23.doCall(_PluginDependencies_groovy:178)
at _PluginDependencies_groovy$_run_closure5_closure23.doCall(_PluginDependencies_groovy)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at _PluginDependencies_groovy$_run_closure5.doCall(_PluginDependencies_groovy:176)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at _GrailsPackage_groovy$_run_closure2.doCall(_GrailsPackage_groovy:60)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at org.codehaus.gant.GantMetaClass.processClosure(GantMetaClass.java:81)
at org.codehaus.gant.GantMetaClass.processArgument(GantMetaClass.java:95)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:128)
at _GrailsWar_groovy$_run_closure4.doCall(_GrailsWar_groovy:92)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at org.codehaus.gant.GantMetaClass.processClosure(GantMetaClass.java:81)
at org.codehaus.gant.GantMetaClass.processArgument(GantMetaClass.java:95)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:128)
at War$_run_closure1.doCall(War.groovy:38)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:591)
at gant.Gant.executeTargets(Gant.groovy:590)
Caused by: groovy.lang.MissingPropertyException: No such property: org for class: org.grails.plugins.log4jxml.Log4jConfigurationInitializer
Possible solutions: log
at org.grails.plugins.log4jxml.Log4jConfigurationInitializer.init(Log4jConfigurationInitializer.groovy:21)
at org.grails.plugins.log4jxml.Log4jConfigurationInitializer.(Log4jConfigurationInitializer.groovy:12)
at Log4jXmlGrailsPlugin.(Log4jXmlGrailsPlugin.groovy:16)
... 53 more
| Error Error loading plugin manager: Could not create a new instance of class [Log4jXmlGrailsPlugin]!
What is that 'org' property to be in Log4jConfigurationInitializer class

This is due the fact that you have a log4j-xml plug-in in the project plug-ins.
just remove and it will go away!

log4j-xml plugin is a valid and useful plugin for grails 1.3.x versions. So applications that have a log4j.xml file for logging behavior would find this plugin useful. I do not think that this is the correct solution to the above problem.

Related

jetified-protobuf-javalite-3.14.0 com.google.protobuf:protobuf-javalite:3.14.0) jetified-protobuf-lite-3.0.1 (com.google.protobuf:protobuf-lite:3.0.1

I have several projects to use the com. com.google.protobuf:protobuf-lite:3.0.1 , now, I want to integrate firebase Performance monitoring of my application, I add the following to rely on:
implementation platform('com.google.firebase:firebase-bom:28.3.0')
implementation ("com.google.firebase:firebase-perf")
implementation 'com.google.firebase:firebase-analytics:19.0.1'
implementation 'com.google.firebase:firebase-crashlytics:18.2.1'
implementation 'com.google.firebase:firebase-core:19.0.1'
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'com.google.firebase:firebase-auth:21.0.1'
I will get the following questions:
Duplicate class com.google.protobuf.WireFormat$FieldType$3 found in modules jetified-protobuf-javalite-3.14.0 (com.google.protobuf:protobuf-javalite:3.14.0) and jetified-protobuf-lite-3.0.1 (com.google.protobuf:protobuf-lite:3.0.1)
Then, I use it in the project
configurations.all {
exclude group: 'com.google.protobuf', module: "protobuf-lite"
}
Protobuf-Lite has been removed globally, after which compilation is not a problem, but when I open the application I have the following problems:
java.lang.NoClassDefFoundError: failed for class com.google.firebase.perf.v1.NetworkRequestMetric; see exception in other thread
at com.google.firebase.perf.v1.NetworkRequestMetric.newBuilder(NetworkRequestMetric.java:1336)
at com.google.firebase.perf.metrics.NetworkRequestMetricBuilder.(NetworkRequestMetricBuilder.java:61)
at com.google.firebase.perf.metrics.NetworkRequestMetricBuilder.(NetworkRequestMetricBuilder.java:92)
at com.google.firebase.perf.metrics.NetworkRequestMetricBuilder.builder(NetworkRequestMetricBuilder.java:84)
at com.google.firebase.perf.network.FirebasePerfUrlConnection.instrument(FirebasePerfUrlConnection.java:186)
at com.facebook.GraphRequest.createConnection(GraphRequest.java:1376)
at com.facebook.GraphRequest.toHttpConnection(GraphRequest.java:1045)
at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1132)
at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1109)
at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1093)
at com.facebook.GraphRequest.executeAndWait(GraphRequest.java:1068)
at com.facebook.GraphRequest.executeAndWait(GraphRequest.java:962)
at com.facebook.internal.FetchedAppSettingsManager.getAppSettingsQueryResponse(FetchedAppSettingsManager.java:368)
at com.facebook.internal.FetchedAppSettingsManager.access$000(FetchedAppSettingsManager.java:59)
at com.facebook.internal.FetchedAppSettingsManager$1.run(FetchedAppSettingsManager.java:177)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
2021-08-28 10:36:24.030 11807-11963/com.realu.dating E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.realu.dating, PID: 11807
java.lang.NoSuchMethodError: No static method registerDefaultInstance(Ljava/lang/Class;Lcom/google/protobuf/GeneratedMessageLite;)V in class Lcom/google/protobuf/GeneratedMessageLite; or its super classes (declaration of 'com.google.protobuf.GeneratedMessageLite' appears in /data/app/com.realu.dating-wIVBwzcBmy2s70YdCgdDJA==/base.apk!classes19.dex)
at com.google.firebase.perf.v1.NetworkRequestMetric.(NetworkRequestMetric.java:2460)
at com.google.firebase.perf.v1.NetworkRequestMetric.newBuilder(NetworkRequestMetric.java:1336)
at com.google.firebase.perf.metrics.NetworkRequestMetricBuilder.(NetworkRequestMetricBuilder.java:61)
at com.google.firebase.perf.metrics.NetworkRequestMetricBuilder.(NetworkRequestMetricBuilder.java:92)
at com.google.firebase.perf.metrics.NetworkRequestMetricBuilder.builder(NetworkRequestMetricBuilder.java:84)
at com.google.firebase.perf.network.FirebasePerfUrlConnection.instrument(FirebasePerfUrlConnection.java:186)
at com.facebook.GraphRequest.createConnection(GraphRequest.java:1376)
at com.facebook.GraphRequest.toHttpConnection(GraphRequest.java:1045)
at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1132)
at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1109)
at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1093)
at com.facebook.GraphRequest.executeAndWait(GraphRequest.java:1068)
at com.facebook.GraphRequest.executeAndWait(GraphRequest.java:962)
What should I do about it, thanks

QBS: Explicitly setting qbs.profiles inside Products causing build to fail

My use-case is this:
I have a static library which I want to be available for some profiles (e.g. "gcc", "arm-gcc", "mips-gcc").
I also have an application which links to this library, but this applications should only build using a specific profile (e.g. "arm-gcc").
For this I am modifying the app-and-lib QBS example.
The lib.qbs file:
import qbs 1.0
Product {
qbs.profiles: ["gcc", "arm-gcc", "mips-gcc"] //I added only this line
type: "staticlibrary"
name: "mylib"
files: [
"lib.cpp",
"lib.h",
]
Depends { name: 'cpp' }
cpp.defines: ['CRUCIAL_DEFINE']
Export {
Depends { name: "cpp" }
cpp.includePaths: [product.sourceDirectory]
}
}
The app.qbs file:
import qbs 1.0
Product {
qbs.profiles: ["arm-gcc"] //I added only this line
type: "application"
consoleApplication: true
files : [ "main.cpp" ]
Depends { name: "cpp" }
Depends { name: "mylib" }
}
The app build fails. Qbs wrongly tries to link to the "gcc" version of the library instead of the "arm-gcc" version, as you can see in the log:
Build graph does not yet exist for configuration 'default'. Starting from scratch.
Resolving project for configuration default
Setting up build graph for configuration default
Building for configuration default
compiling lib.cpp [mylib {"profile":"gcc"}]
compiling lib.cpp [mylib {"profile":"arm-gcc"}]
compiling lib.cpp [mylib {"profile":"mips-gcc"}]
compiling main.cpp [app]
creating libmylib.a [mylib {"profile":"gcc"}]
creating libmylib.a [mylib {"profile":"mips-gcc"}]
creating libmylib.a [mylib {"profile":"arm-gcc"}]
linking app [app]
ERROR: /usr/bin/arm-linux-gnueabihf-g++ -o /home/user/programs/qbs/usr/local/share/qbs/examples/app-and-lib/default/app.7d104347/app /home/user/programs/qbs/usr/local/share/qbs/examples/app-and-lib/default/app.7d104347/3a52ce780950d4d9/main.cpp.o /home/user/programs/qbs/usr/local/share/qbs/examples/app-and-lib/default/mylib.eyJwcm9maWxlIjoiZ2NjIn0-.792f47ec/libmylib.a
ERROR: /home/user/programs/qbs/usr/local/share/qbs/examples/app-and-lib/default/mylib.eyJwcm9maWxlIjoiZ2NjIn0-.792f47ec/libmylib.a: error adding symbols: File format not recognized
collect2: error: ld returned 1 exit status
ERROR: Process failed with exit code 1.
The following products could not be built for configuration default:
app
The build fails only when selecting one profile in the app.qbs file, and this profile should not be the first profile in the qbs.profiles line in the lib.qbs file.
When selecting two or more profiles - the build succeeds.
My analysis:
I think this problem is related to multiplexing:
The lib.qbs contains more than one profile. This turns on multiplexing when building the library, which, in turn, adds additional 'multiplexConfigurationId' to the build-directory name (moduleloader.cpp).
The app.lib contains only one profile, so multiplexing is not turned on and the build-directory name does not get the extra string.
The problem can be solved by changing the code (moduleloader.cpp) so that multiplexing is turned even if there is only one profile i.e. with the following patch:
--- moduleloader.cpp 2018-10-24 16:17:43.633527397 +0300
+++ moduleloader.cpp.new 2018-10-24 16:18:27.541370544 +0300
## -872,7 +872,7 ##
= callWithTemporaryBaseModule<const MultiplexInfo>(dummyContext,
extractMultiplexInfoFromProduct);
- if (multiplexInfo.table.size() > 1)
+ if (multiplexInfo.table.size() > 0)
productItem->setProperty(StringConstants::multiplexedProperty(), VariantValue::trueValue());
VariantValuePtr productNameValue = VariantValue::create(productName);
## -891,7 +891,7 ##
const QString multiplexConfigurationId = multiplexInfo.toIdString(row);
const VariantValuePtr multiplexConfigurationIdValue
= VariantValue::create(multiplexConfigurationId);
- if (multiplexInfo.table.size() > 1 || aggregator) {
+ if (multiplexInfo.table.size() > 0 || aggregator) {
multiplexConfigurationIdValues.push_back(multiplexConfigurationIdValue);
item->setProperty(StringConstants::multiplexConfigurationIdProperty(),
multiplexConfigurationIdValue);
This worked for my use case. I don't know if it make sense in a broader view.
Finally, the questions:
Does it all make sense?
Is this a normal behavior?
Is this use-case simply not supported?
Is there a better solution?
Thanks in advance.
Yes, the default behavior with multiplexing is that the a non-multiplexed product depends on all variants of the dependency. In general, there is no way for a user to change that behavior, but there should be.
However, luckily for you, profiles are special:
Depends { name: "mylib"; profiles: "arm-gcc" }
This should fix your problem.

Why did not found return type in Custom UDAF of presto

Custom Function what I made did not work in presto on EMR.
I want to create a simple UDAF that just return 42.
First, my custom function what I wrote a simple functions, but did not work in presto.
A error is following in presto-cli:
presto> select answer_to_life('the universe');
Query 20180324_120433_00000_7n6s6 failed: answer_to_life(varchar):bigint not found
com.facebook.presto.spi.PrestoException: answer_to_life(varchar):bigint not found
at com.facebook.presto.metadata.FunctionRegistry.doGetSpecializedFunctionKey(FunctionRegistry.java:972)
at com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:146)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211)
at com.google.common.cache.LocalCache.get(LocalCache.java:4154)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147)
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5153)
at com.facebook.presto.metadata.FunctionRegistry.getSpecializedFunctionKey(FunctionRegistry.java:898)
at com.facebook.presto.metadata.FunctionRegistry.getAggregateFunctionImplementation(FunctionRegistry.java:875)
at com.facebook.presto.sql.planner.LocalExecutionPlanner$Visitor.buildAccumulatorFactory(LocalExecutionPlanner.java:1973)
at com.facebook.presto.sql.planner.LocalExecutionPlanner$Visitor.planGlobalAggregation(LocalExecutionPlanner.java:1984)
at com.facebook.presto.sql.planner.LocalExecutionPlanner$Visitor.visitAggregation(LocalExecutionPlanner.java:955)
at com.facebook.presto.sql.planner.LocalExecutionPlanner$Visitor.visitAggregation(LocalExecutionPlanner.java:596)
at com.facebook.presto.sql.planner.plan.AggregationNode.accept(AggregationNode.java:167)
at com.facebook.presto.sql.planner.LocalExecutionPlanner$Visitor.visitExchange(LocalExecutionPlanner.java:1919)
at com.facebook.presto.sql.planner.LocalExecutionPlanner$Visitor.visitExchange(LocalExecutionPlanner.java:596)
at com.facebook.presto.sql.planner.plan.ExchangeNode.accept(ExchangeNode.java:196)
at com.facebook.presto.sql.planner.LocalExecutionPlanner$Visitor.visitAggregation(LocalExecutionPlanner.java:952)
at com.facebook.presto.sql.planner.LocalExecutionPlanner$Visitor.visitAggregation(LocalExecutionPlanner.java:596)
at com.facebook.presto.sql.planner.plan.AggregationNode.accept(AggregationNode.java:167)
at com.facebook.presto.sql.planner.LocalExecutionPlanner$Visitor.visitOutput(LocalExecutionPlanner.java:638)
at com.facebook.presto.sql.planner.LocalExecutionPlanner$Visitor.visitOutput(LocalExecutionPlanner.java:596)
at com.facebook.presto.sql.planner.plan.OutputNode.accept(OutputNode.java:82)
at com.facebook.presto.sql.planner.LocalExecutionPlanner.plan(LocalExecutionPlanner.java:393)
at com.facebook.presto.sql.planner.LocalExecutionPlanner.plan(LocalExecutionPlanner.java:324)
at com.facebook.presto.execution.SqlTaskExecution.<init>(SqlTaskExecution.java:161)
at com.facebook.presto.execution.SqlTaskExecution.createSqlTaskExecution(SqlTaskExecution.java:121)
at com.facebook.presto.execution.SqlTaskExecutionFactory.create(SqlTaskExecutionFactory.java:71)
at com.facebook.presto.execution.SqlTask.updateTask(SqlTask.java:340)
at com.facebook.presto.execution.SqlTaskManager.updateTask(SqlTaskManager.java:321)
at com.facebook.presto.server.TaskResource.createOrUpdateTask(TaskResource.java:128)
at sun.reflect.GeneratedMethodAccessor311.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:200)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)
at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
at org.glassfish.jersey.internal.Errors.process(Errors.java:268)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at io.airlift.http.server.TraceTokenFilter.doFilter(TraceTokenFilter.java:63)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at io.airlift.http.server.TimingFilter.doFilter(TimingFilter.java:52)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:454)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:169)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:61)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:564)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:673)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:591)
at java.lang.Thread.run(Thread.java:748)
Code of AggregationFunction is following.
I referenced to this presto code
package sample;
import com.facebook.presto.spi.block.BlockBuilder;
import com.facebook.presto.spi.function.*;
import com.facebook.presto.spi.type.BigintType;
import com.facebook.presto.spi.type.StandardTypes;
import io.airlift.slice.Slice;
#AggregationFunction("answer_to_life")
public final class AnswerToLife {
private AnswerToLife() {
}
#InputFunction
public static void input(#AggregationState NullState state, #SqlType(StandardTypes.VARCHAR) Slice value) {
}
#CombineFunction
public static void combine(#AggregationState NullState state, #AggregationState NullState other) {
}
#OutputFunction(StandardTypes.BIGINT)
public static void output(#AggregationState NullState state, BlockBuilder out) {
BigintType.BIGINT.writeLong(out, 42);
}
}
Detail code is here (https://github.com/asari-mtr/presto-udaf/tree/stackoverflow).
The structure what I deployed is follwoing:
$ ls -1 /usr/lib/presto/plugin/my-udaf/
commons-codec-1.4.jar
guava-21.0.jar
hive-udf-1.0-SNAPSHOT.jar
presto-array-0.197.jar
stats-0.155.jar
presto-udaf-1.0-SNAPSHOT.jar
I use emr-5.12.0(Presto 0.188)
Thank you for your time.
Edited1
list in jar file.
% jar -tf target/presto-udaf-1.0-SNAPSHOT.jar
Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8
META-INF/
META-INF/MANIFEST.MF
META-INF/services/
sample/
META-INF/services/com.facebook.presto.spi.Plugin
sample/AnswerToLife.class
sample/AnswerToLifePlugin.class
sample/NullState.class
META-INF/maven/
META-INF/maven/sample/
META-INF/maven/sample/presto-udaf/
META-INF/maven/sample/presto-udaf/pom.xml
META-INF/maven/sample/presto-udaf/pom.properties
sever.log
$ grep answer -i /mnt/var/log/presto/server.log
2018-03-26T06:37:14.213Z INFO main com.facebook.presto.server.PluginManager Installing sample.AnswerToLifePlugin
2018-03-26T06:37:14.214Z INFO main com.facebook.presto.server.PluginManager Registering functions from sample.AnswerToLife
And execute show funcstions
presto> show functions;
Function | Return Type | Argument Types
---------------------------------+-----------------------------------------------------+------------------------------------------------------------------------------
ST_Area | double | Geometry
ST_AsText | varchar | Geometry
...
answer_to_life | bigint | varchar
...
Edited2
Delete src/main/resources/META-INF/services/com.facebook.presto.spi.Plugin
Add <packaging>presto-plugin</packaging> to pom.xml
https://github.com/asari-mtr/presto-udaf/commit/f2a2ddbf0339e08f418b378a7ead511020e98a3b
I deployed zip made by Maven under /usr/lib/presto/plugin/.
But, The contents of the error does not change.
Edited3
I got the source from github (branch 0.188) on my Mac and built presto.
When we placed the above UDAF on its presto, it worked perfectly.
Perhaps there is a mistake in the installation procedure for presto on EMR.
Solved!!
The Custom plugin did not work because it was not a plugin creation, but a way of deploying on EMR was wrong.
Since I did not deploy to all nodes in the procedure I performed, I confirmed the operation by registering the following shell as a bootstrap action.
#/bin/bash
aws s3 cp s3://hogehoge/presto-udaf-1.0-SNAPSHOT.zip /tmp/
sudo mkdir -p /usr/lib/presto/plugin/
sudo unzip -d /usr/lib/presto/plugin/ /tmp/presto-udaf-1.0-SNAPSHOT.zip
10.1. SPI Overview — Presto 0.198 Documentation
Plugins must be installed on all nodes in the Presto cluster
(coordinator and workers).
Create Bootstrap Actions to Install Additional Software - Amazon EMR
You can use a bootstrap action to copy objects from Amazon S3 to each
node in a cluster before your applications are installed. The AWS CLI
is installed on each node of a cluster, so your bootstrap action can
call AWS CLI commands.
From what you wrote there are two things which are missing.
make sure that you used maven packaging presto-plugin in your pom.xml
also implement com.facebook.presto.spi.Plugin which in getFunctions method would return your function.
Take a look in presto-geospatial Presto module and see com.facebook.presto.plugin.geospatial.GeoPlugin and its pom.xml as reference.

Apktool decompiling/decoding exception

I want to recompile adidas app. When I use Apktool in Windows CLI, the exception is raised:
C:\Apktool>apktool d adidasConfirmed.apk
I: Using Apktool 2.2.2 on adidasConfirmed.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f090000 string/abc_act
ion_bar_home_description, config=-sr
at brut.androlib.res.data.ResType.addResource(ResType.java:66)
at brut.androlib.res.data.ResType.addResource(ResType.java:55)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:270)
at brut.androlib.res.decoder.ARSCDecoder.readTableType(ARSCDecoder.java:226)
at brut.androlib.res.decoder.ARSCDecoder.readTableTypeSpec(ARSCDecoder.java:156)
at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:118)
at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:80)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:559)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:72)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:64)
at brut.androlib.Androlib.getResTable(Androlib.java:67)
at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:193)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:102)
at brut.apktool.Main.cmdDecode(Main.java:166)
at brut.apktool.Main.main(Main.java:81)
What's wrong?
P.S. I've gotten this app from here.
Try this
apktool d adidasConfirmed.apk --keep-broken-res

Storm-R integration

I am trying to integrate my R script with Storm. The code for my Rbolt is:
public class RBolt extends ShellBolt implements IRichBolt {
public RBolt() {
super("Rscript", "storm_OR.R");
}
#Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
outputFieldsDeclarer.declare(new Fields("OR"));
}
#Override
public Map<String, Object> getComponentConfiguration() {
Config ret = new Config();
ret.setMaxTaskParallelism(1);
return ret;
}
}
I am getting the following error. Any help? I have made sure that the path variables have path of R and Rscript.
17469 [Thread-12-__system] INFO backtype.storm.daemon.executor - Preparing bolt __system:(-1)
17474 [Thread-12-__system] INFO backtype.storm.daemon.executor - Prepared bolt __system:(-1)
17480 [Thread-6] INFO backtype.storm.daemon.executor - Loading executor RBolt:[1 1]
17483 [Thread-6] INFO backtype.storm.daemon.executor - Loaded executor tasks RBolt:[1 1]
17491 [Thread-6] INFO backtype.storm.daemon.executor - Finished loading executor RBolt:[1 1]
17491 [Thread-6] INFO backtype.storm.daemon.worker - Launching receive-thread for 8d8a13de-5e87-4e14-b2c2-59b4dfc070c6:1027
17493 [Thread-14-RBolt] INFO backtype.storm.daemon.executor - Preparing bolt RBolt:(1)
17496 [Thread-15-worker-receiver-thread-0] INFO backtype.storm.messaging.loader - Starting receive-thread: [stormId: EventProcessing-1-1457335172, port: 1027, thread-id: 0 ]
17500 [Thread-14-RBolt] INFO backtype.storm.utils.ShellProcess - Storm multilang serializer: backtype.storm.multilang.JsonSerializer
17510 [Thread-14-RBolt] ERROR backtype.storm.util - Async loop died!
java.lang.RuntimeException: Error when launching multilang subprocess
at backtype.storm.utils.ShellProcess.launch(ShellProcess.java:64) ~[storm-core-0.9.2-incubating.jar:0.9.2-incubating]
at backtype.storm.task.ShellBolt.prepare(ShellBolt.java:99) ~[storm-core-0.9.2-incubating.jar:0.9.2-incubating]
at backtype.storm.daemon.executor$fn__5641$fn__5653.invoke(executor.clj:690) ~[storm-core-0.9.2-incubating.jar:0.9.2-incubating]
at backtype.storm.util$async_loop$fn__457.invoke(util.clj:429) ~[storm-core-0.9.2-incubating.jar:0.9.2-incubating]
at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]
Caused by: java.io.IOException: Cannot run program "Rscript" (in directory "/tmp/933c85f3-f5b5-4a60-b342-7d4969b43d46/supervisor/stormdist/EventProcessing-1-1457335172/resources"): error=2, No such file or directory
This directory in tmp folder does not exist and is created on the fly. Any suggestions please.
UPDATE: Resolved this by creating another resources folder in the resources folder of the project such that the jar has a resources folder with the R script in it.
The whole purpose of "shell" components is to start as an independent process, therefore your script needs to implement multilang protocol.
Alternatively you can find a library that implements the protocol and has R integration, like FsStorm: it implements multilang and you can call R functions via R type provider.

Resources