Conflict in Maven Dependencies not getting resolved - java

I am working with Google cloud APIs for Google Speech and Google Natural Language Processing. The version i am using for both is as follows:
google-cloud-speech: 0.13.0-alpha
google-cloud-language: 0.9.4-alpha
And both of them uses the google-gax api as an internal dependency. While speech api using the gax version 0.10.0, the language api uses the 0.1.4.
In the pom, i have the depedency scope as provided. So for the reason, i am providing the jars in the lib folder of the server.
But the issues is with the gax api. The problem is:
When i provide the gax version 0.10.0, the speech api works but language api does not work.
If the gax version 0.1.4 is provided, then language api works but the speech apis doesn't works.
And if both the version are provided, then only speech api works.
Any suggestions to resolve the issue? I have tried everything viz cleaning the project, updating the maven, re-deploy the project, delete all maven dependecy and rebuild. But did not get the problem resolved.

Changing the google-cloud-language worked well. Now updated the language version to
google-cloud-language-0.13.0-alpha
and everything worked smoothly. The reason being this version uses the gax-0.10.0 and thus resolving the conflicts.

Related

javax APIs already provided in standard JRE

I have an application that uses jaxws-api-2.2.8.jar and stax-api-1.0-2.jar. I see that these APIs are already included in standard JRE so I could mark them as provided in my POMs but I'm not sure which version of each API is included in each version of the JRE. Of course the problem arises with other API jars too. I've tried to find an "official" source of info without luck. Have you more info?

How to use Esapi 1.4.4 package in web application

I am currently working on a project that uses JDK 1.4. So its just turned out to be that we have to use ESAPI 1.4.4 which is the only version compatible with JDK 1.4 . I downloaded it from the following path https://github.com/esapi/esapi-java-legacy but it doesnt seem to be a jar file . I couldnt figure out how to include this in my eclipse project or how to bring it into my classpath. Is it possible to get the JAR ??? Someone please guide me how to use it or any sample project for reference is sufficient .Thanks in advance
Ditching JDK 1.4 is my top recommendation as well. But if that is not an option for some reason, then I would try pulling down the ESAPI code base from GitHub (https://github.com/ESAPI/esapi-java-legacy), changing the tag under the maven-compiler-plugin plugin from 1.7 to 1.4 and see if it compiles. Much of it probably will be fine, but you likely will have some huge 3rd party FOSS dependency issues so you will have to adjust those. So, before you go down that route, figure out what exactly it is that you need. If you only need ESAPI's output encoding, use the OWASP Java Encoder Project instead. Various other substitutes are described here: https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API#tab=Should_I_use_ESAPI_3F
Good luck.
-kevin

custom rules are not shown in the dashboard

I'm writing a custom rules for java, following the tutorial http://docs.sonarqube.org/display/PLUG/Writing+Custom+Java+Rules+101
I've build the maven project successfully, and moved the jar to the folder /extenstions/plugins/ ,and I restarted the sonar service, but I cannot find out the rule I wrote in the rules page.
I thought about I have the wrong version of the software. I've checked the version I use. sonarqube is 5.3, sonarscanner is 2.5, java version is 1.8, maven version is 3.0.5. I've downloaded the java-plugin-4.1.jar from the website and put it into the folder /extensions/plugins/
Finally Like Michael said the java-plugin version and the sonarqube version doesn't match very well. I upgraded the sonarqube and mysql, the rule finally come into effect. Thank you Michael.

Unable to load class 'com.google.gson.JsonObject'

I am trying to include firebase SDK in my Android Studio Project. But it giving me an error. I am using latest JDK version (1.7.0_71) and it is asking for upgrading higher version to (1.7.0_67).
I need help for basic firebase setup SDK on android. I tried to setup it by the reference of following link: https://firebase.google.com/docs/android/setup#add_the_sdk.
I am getting following error: Please check attached screenshot
I had the same problem trying to GCM to an old android project.
The solution for me was to also add
classpath 'com.android.tools.build:gradle:2.1.2'
to the top-level build file dependencies, just before classpath 'com.google.gms:google-services:3.0.0'. For the old android project, this dependency only existed in the module-level build file.
Make sure you are using Android Studio 1.5 or above. Just saw a guy who had the same issue and he was using android studio 1.0.1
Updating the Android Studio will fix it for you. Also check other pre-requisites.
Prerequisites from official documentation are as follows:
A device running Android 2.3 (Gingerbread) or newer, and Google Play services 9.2.1 or newer
The Google Play services SDK from the Android SDK Manager
Android Studio 1.5 or higher
An Android Studio project and its package name
First of all complete all the steps mentioned in a link you had followed for Firebase
And note that it requires active internet connection so please check internet connection and add both project and app level dependencies as per suggested in link of Firebase you had used in question
Also it is best to use JDK version 1.8 and above because oracle officialy ended support for those versions. If you are working with Firebase Api which is quiet new so i would highly recommend as it is also recommended by most professionals including developers at Google.Or if you want to go with JDK 1.7 then update it to latest Jdk 7u80 or 7u79 at least because it has least issues comparing to older versions.
The best solution is use JDK version 1.8 and follow all the steps in link https://firebase.google.com/docs/android/setup#add_the_sdk
Ensure that you have the google-services.json file, with the client id: <effective package name>, in the app directory. This you download from the Firebase console when you add an app.

How to patch an eclipse plugin?

I'd like to fix a bug in an eclipse plugin (an official plugin of the WTP).
I locally changed the source code, debugged it - everything is fine.
Now I'd like to propagate this change to my eclipse installation, but I am facing problems.
There seems to be more than one way to achieve this, e.g.:
This site recommended fragments, but the Eclipse FAQ disadvises that.
But I am stuck and no way seems to work for me.
UPDATE:
I tried to create and install a feature patch, as suggested.
After this installation the feature patch is installed, but not the containing patched plugin.
The previous/existing version of the plugin is still present and active.
I'd like to know why this is the case?
Does this something have to do with signing of the official plugins?
Is there a log to see why the patched plugin has not been installed?
FINAL UPDATE:
The problem was that I patched a parent feature (which has been shown in the eclipse installation details), not the direct feature which directly contained the plugin.
After specifying the correct/"lowest-level" feature for patching, everything worked as expected.
The best approach is to create what's known as a "feature patch". A feature patch consists of the entire new version of the plugin you are patching along with a feature that describes what's being patched. See this useful blog post:
http://aniefer.blogspot.com/2009/06/patching-features-with-p2.html

Categories