I have already included following line to keep all files inside the package.
-keep class com.fasterxml.** { *; }
I am getting following exception.
Caused by: java.lang.IllegalArgumentException: Internal error: TypeReference constructed without actual type information
at com.fasterxml.jackson.core.type.TypeReference.<init>(SourceFile:36)
I found the solution. Adding following find into ProGuard-rules or Config file solved the issue.
-keepattributes Signature
PS: Please voteup if you find this helpful
Related
I am trying out KTOR for building backend server application. When I try to include implementation("io.ktor:ktor-auth:1.6.8") dependency, it gives me an error
Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class io.ktor.auth.Authentication.Feature, unresolved supertypes: io.ktor.application.ApplicationFeature
Adding -Xextended-compiler-checks argument might provide additional information.
Type mismatch: inferred type is Authentication.Feature but Plugin<TypeVariable(P), TypeVariable(B), TypeVariable(F)> was expected
Here is the error
fun Application.authentication() {
install(Authentication) { // here is the error
jwt {
}
}
}
I looked at the Authentication.kt file and it does not have any plugin in it.
how to correct this?
I took the version from mvnrepository https://mvnrepository.com/artifact/io.ktor/ktor-auth/1.6.8
EDIT. I was able to resolve it by adding different dependencies
implementation("io.ktor:ktor-server-auth-jvm:$ktor_version")
implementation("io.ktor:ktor-server-auth-jwt-jvm:$ktor_version")
I'm writing a library based on code generation.
This library generating dagger's module via annotations. How do I run my annotation processor before dagger's code generation?
Now it crashes on build because dagger trying to build the component before modules was generated.
Error:
.ktC:\Users\syncended\AndroidStudioProjects\Daggerblade\app\build\tmp\kapt3\stubs\debug\dev\syncended\daggerblade\AppComponent.java:6: error: cannot find symbol
#dagger.Component(modules = {BookModule.class})
^
symbol: class BookModuleC:\Users\syncended\AndroidStudioProjects\Daggerblade\app\build\tmp\kapt3\stubs\debug\dev\syncended\daggerblade\AppComponent.java:7: error: [ComponentProcessor:MiscError] dagger.internal.codegen.ComponentProcessor was unable to process this interface because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.
public abstract interface AppComponent {
^Attempt to reopen a file for path C:\Users\syncended\AndroidStudioProjects\Daggerblade\app\build\generated\source\kapt\debug\dev\syncended\blade\BookModule.kt
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
* Try:
Trying to run my eclipse plugin from within eclipse, I get error messages to the console, which make the nested eclipse fail to run the plugin:
org.osgi.framework.BundleException: Error starting module.
at org.eclipse.osgi.container.Module.doStart(Module.java:590)
...
Caused by: java.lang.Error: Unresolved compilation problems:
The import org.eclipse cannot be resolved
The import org.eclipse cannot be resolved
The import org.eclipse cannot be resolved
The import org.eclipse cannot be resolved
The import org.osgi cannot be resolved
AbstractUIPlugin cannot be resolved to a type
IStartup cannot be resolved to a type
The method earlyStartup() of type Plugin must override or implement a supertype method
BundleContext cannot be resolved to a type
BundleContext cannot be resolved to a type
Suggesting that my plugin has compilation errors to it, but:
The plugin has not compilation errors
It seems a bit surprising that running a plugin would cause a compilation.
There was indeed no compilation error: the problem lies elsewhere. The main
Plugin class was to be a singleton, which was implemented like so:
public class Plugin extends AbstractUIPlugin implements IStartup {
public static Plugin plugin;
/ ** an empty c'tor. creates an instance of the plugin. */
public Plugin() {
plugin = this;
}
....
}
Now, other classes were referring to this public field, which not initialized; for some reason, eclipse thought this was a compilation
error. It was not. using a getter for that field solved the problem.
Who knows why class HiveConf has no HADOOPCONF enum type in hive-common jar now?
I write code using hive-common-1.2.1.jar HiveConf class to access HDFS(HA namenode), and I get an error below.
I realized my code didn't config HADOOPCONF so it can't connect to HDFS, but there is no HADOOPCONF in hive-common-1.2.1.jar any more, I found previous version of hive-common has the HADOOPCONF.
http://www.docjar.com/html/api/org/apache/hadoop/hive/conf/HiveConf.java.html
My question is how can I config to access HDFS(namenode HA) with HiveConf class by using hive-common-1.2.1.jar?
Here is the error:
Caused by: java.lang.IllegalArgumentException: java.net.UnknownHostException: cluster
at org.apache.hadoop.security.SecurityUtil.buildTokenService(SecurityUtil.java:374)
at org.apache.hadoop.hdfs.NameNodeProxies.createNonHAProxy(NameNodeProxies.java:312)
at org.apache.hadoop.hdfs.NameNodeProxies.createProxy(NameNodeProxies.java:178)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:665)
My code is:
hiveConf.setVar(HiveConf.ConfVars.HADOOPBIN, "/opt/modules/hadoop/bin");
hiveConf.setVar(HiveConf.ConfVars.HADOOPFS, "hdfs://cluster");
hiveConf.setVar(HiveConf.ConfVars.LOCALSCRATCHDIR, "/opt/modules/hive/temp");
hiveConf.setVar(HiveConf.ConfVars.DOWNLOADED_RESOURCES_DIR, "/opt/modules/hive/temp");
hiveConf.setBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
hiveConf.setVar(HiveConf.ConfVars.METASTOREWAREHOUSE, "/warehouse");
hiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, "thrift://127.0.0.1:9083");
hiveConf.setVar(HiveConf.ConfVars.METASTORE_CONNECTION_DRIVER, "com.mysql.jdbc.Driver");
hiveConf.setVar(HiveConf.ConfVars.METASTORECONNECTURLKEY, "jdbc:mysql://192.168.5.29:3306/hive?createDatabaseIfNotExist=true");
hiveConf.setVar(HiveConf.ConfVars.METASTORE_CONNECTION_USER_NAME, "hive");
hiveConf.setVar(HiveConf.ConfVars.METASTOREPWD, "123456");
hiveConf.setVar(HiveConf.ConfVars.HIVEHISTORYFILELOC, "/opt/modules/hive/temp");
OK, I resolved this issue.
Because the class HiveConf in hive-common jar load "hdfs-site.xml" from hadoop by default, if only you set the classpath pointed to the folder of "hdfs-site.xml" when you running it.
CLASSPATH=$CLASSPATH:/opt/modules/hadoop/conf
$JAVA -cp $CLASSPATH com.baofeng.data.writer.HiveHcatalogWriter
I'm developing an Android Module for a Titanium app and I have to generate a Notification. Android SDK forces me to do a setSmallIcon() call to include a png asset as icon for the notification. I've put icon_notification.png asset in /platform/android/res/drawable folder of my module and (tryed to) got it in the code calling
TiRHelper.getResource("drawable.icon_notification")
but when I build module calling ant, the following error is raised:
[javac] Note: [KrollBindingGen] Running Kroll binding generator.
[javac] Note: [KrollBindingGen] No binding data found, creating new data file: org.appcelerator.titanium.bindings/connecthings.json
[javac] Note: [KrollBindingGen] Found binding for proxy Beacon
[javac] Note: [KrollBindingGen] Found binding for module Connect
[javac] Note: [KrollBindingGen] Generating JSON: file:/Users/***/Development/***/modules/android/***/android/build/generated/json/org/appcelerator/titanium/bindings/***.json
[javac] warning: The following options were not recognized by any processor: '[kroll.checkTiContext]'
[javac] /Users/***/Development/***/modules/android/***/android/src/***/***/***/***/ConnectModule.java:76: error: unreported exception ResourceNotFoundException; must be caught or declared to be thrown
[javac] .setSmallIcon(TiRHelper.getResource("drawable.icon_notification"))
[javac] ^
[javac] Note: /Users/***/Development/***/modules/android/***/android/src/***/***/ti/***/BeaconProxy.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 1 error
seems that raising a ResourceNotFoundException exception, builder doesn't find the assset
Have I placed the file in the wrong place?
The platform folder also has to sub-folder of android folder.The full directory is "android/platform/android/res/drawable/". You can also check if the resources are created in the build folder.
Documentation Link
Error posted is trowed during build step of the module.
In this step I think that resources are not already put in place, so, wrapping the TiRHelper method in a try...catch statement as written in the wiki suggested by #Saeed Sharman resolve the problem.
So, the working version is simply:
try {
TiRHelper.getResource("drawable.icon_notification");
catch (ResourceNotFoundException e) {
...
}