hive permission denied for user anonymous using beeline shell

I have created the 3 node hadoop cluster with 1 namenode and 2 datanode.

I can perform read write query from hive shell but not beeline

Many suggestion and answer i found related to this issue . In every suggestion it was mentioned to give the permission for the userX for each individual table. But i dont know how to set permission for anonymous user once for all .

Why i am getting the user anonymous while accessing the data from beeline or from java program.

I Am able to read the data from the both beeline shell and using java jdbc connection. But cant insert the data in the table .

Mime4j Casting Exception

I’m using mime4j for parsing mails. I have following methods:

    private void parseBodyParts(Multipart multipart) throws IOException {
        for (BodyPart part : multipart.getBodyParts()) {
            if (part.isMimeType("text/plain")) {
                String txt = getTxtPart(part);
            } else if (part.isMimeType("text/html")) {
                String html = getTxtPart(part);
            } else if (part.getDispositionType() != null && !part.getDispositionType().equals("")) {
                //If DispositionType is null or empty, it means that it's multipart, not attached file

            //If current part contains other, parse it again by recursion
            if (part.isMultipart()) {
                parseBodyParts((Multipart) part.getBody());

This is for parsing body parts, and following is getting text part:

    private String getTxtPart(Entity part) throws IOException {
        //Get content from body
        TextBody tb = (TextBody) part.getBody();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        return new String(baos.toByteArray());

At some e-mails, this code throws an exception which called:

java.lang.ClassCastException: org.apache.james.mime4j.message.StorageBinaryBody cannot be cast to org.apache.james.mime4j.message.TextBody

at TextBody tb = (TextBody) part.getBody(); line.

Where I’m wrong?

Creating a notification inside DialogFragment class doesn’t work! (Android)

I’ve been searching around and tried different solutions but I can’t seem to get this to work.

I have a MainActivity with a list and an “Add” button. When i click the addbutton i open a DialogFragment. In the dialog user inputs data and press “add” and i want a notification that says “xxxx has been added to list” but it never shows.

I have a seperate class for AddDialog which looks like this:

public class AddDialogFragment extends DialogFragment {
Button btnAdd;
Button btnCancel;
TextView etNewSerial, etNewBrand, etNewModel;
String newSerial, newBrand, newModel;

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View rootView = inflater.inflate(R.layout.dialog_add, container, false);
    getDialog().setTitle("Add new serial!");
    btnAdd = (Button) rootView.findViewById(;
    etNewSerial = (TextView) rootView.findViewById(;
    etNewBrand = (TextView) rootView.findViewById(;
    etNewModel = (TextView) rootView.findViewById(;

    btnAdd.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
             newSerial = etNewSerial.getText().toString();
             newBrand = etNewBrand.getText().toString();
             newModel = etNewModel.getText().toString();

            String url = "MY_VOLLEY_URL"
            StringRequest request = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {
                public void onResponse(String response) {
                    int icon = 0;
                    CharSequence notiText = "Item Added!";
                    long notiTime = System.currentTimeMillis();
                    CharSequence notiTitle = "Item Added!";//Titel
                    CharSequence notiContent = newSerial + " added!";
                    PendingIntent pendingIntent = PendingIntent.getActivity(getActivity(), 0, new Intent(), PendingIntent.FLAG_UPDATE_CURRENT);
                    NotificationCompat.Builder notBuilder = new NotificationCompat.Builder(getActivity());
                    Notification notification =;
                    NotificationManager myNotificationManager = (NotificationManager)getActivity().getSystemService(Context.NOTIFICATION_SERVICE);
                    myNotificationManager.notify(1, notification);
            }, new Response.ErrorListener() {
                public void onErrorResponse(VolleyError error) {
    return rootView;

But the notification never shows. I’ve been trying to replace the “getActivity()” with different methods for context but it doesn’t seem to matter. Does anyone has some tips to make this possible?

how can i access the data that that classified or clustered with weka classes in java?

import javax.print.attribute.DateTimeSyntax;
import weka.core.Instances;
import weka.core.converters.ConverterUtils.DataSource;
import weka.classifiers.bayes.NaiveBayes;
import weka.classifiers.trees.J48;
import weka.classifiers.functions.SMO;
public class Classification {
    public static void main(String[] args) throws Exception{
        //load dataset
        DataSource source = new DataSource("j:/weka/wekadataset/iris.arff");
        Instances dataset = source.getDataSet();
        // set the class to the last class attribute
        //create and build classifier
        NaiveBayes nb = new NaiveBayes();

// Here i want get the data for each class and write them in seperated file.

Error during Building an APK file in Android Studio

I was trying to build an apk for my project but i am facing this error and

Error:Execution failed for task
Multiple dex files define Lcom/google/android/gms/internal/zzajl;

i also added multiDexEnabled true but still getting error

Error:Execution failed for task
‘:app:transformClassesWithJarMergingForDebug’. duplicate entry:

Below is my Build.gradle file

    apply plugin: ''

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId ""
        minSdkVersion 14
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner ""
        multiDexEnabled true

    dexOptions {
        javaMaxHeapSize "4g"
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), ''


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('', {
        exclude group: '', module: 'support-annotations'
    compile ''
    compile ''
    compile ''
    testCompile 'junit:junit:4.12'
    // Adding support library for this demo app
    compile ''
    compile ''
    compile ''

apply plugin: ''

Please suggest me some solution

Consuming Dynamics GP native web service from Java using Apache CXF framework

I have a requirement to consume Dynamics GP native web service from Java and i am using Apache CXF to create the soap client. We are using kerbaros authentication as part of CXF (spnego).

We are able to call the web service from a .net based soap client from the same computer by passing the username, password and domain name as input for authentication.

But with java.. we are getting SocketTimeoutException as below.

[Krb5LoginModule] authentication failed
org.apache.cxf.interceptor.Fault: General security error (An error occurred
in trying to obtain a TGT: Receive timed out)
Caused by: Receive timed out
at Method)
at Method)
... 40 more

We have login.config and krb5.conf files as below.

login.config ==============

spnego-client { required





Endpoint : http://MACHINE01:112233/Dynamics/GPService/GPService

client.getRequestContext().put(“ws-security.callback-handler”, new NamePasswordCallbackHandler(“UERNAME”,”PASSWORD”));

Android Studio skips try bracket?

So I have this little App that should only show a JSON-Object(not even parse it) in the Textview “tvJsonItem” after you push the button “btnHit”. I have built in multiple Toasts to follow its procedure, but if i push the button, i only get the Toast Test1 from the onPostExecute. It seems like the Programme skips the whole try bracket.

    public class MainActivity extends AppCompatActivity {

private TextView tvData;

protected void onCreate(Bundle savedInstanceState) {

    Button btnHit = (Button) findViewById(;
    tvData = (TextView) findViewById(;

public void onClick(View view) {
    new JSONTask().execute();
    Toast.makeText(getApplicationContext(), "onClick", Toast.LENGTH_LONG);

public class JSONTask extends AsyncTask<String, String, String> {

    protected String doInBackground(String...params) {

        HttpURLConnection connection = null;
        BufferedReader reader = null;
        URL url = null;
        try {
            url = new URL("");
            connection = (HttpURLConnection) url.openConnection();
            InputStream stream = connection.getInputStream();
            reader = new BufferedReader(new InputStreamReader(stream));
            Toast.makeText(MainActivity.this, "test2", Toast.LENGTH_LONG).show();
            StringBuffer buffer = new StringBuffer();

            String line = "";
            while ((line = reader.readLine()) != null) {
            String result = buffer.toString();
            return result;
        } catch (MalformedURLException e) {
            Toast.makeText(getApplicationContext(), "Malformed", Toast.LENGTH_LONG);
        } catch (IOException e) {
            Toast.makeText(getApplicationContext(), "IOException", Toast.LENGTH_LONG);
        } finally {
            if (connection != null) {
            if (reader != null) {
                try {
                } catch (IOException e) {
            return null;

    protected void onPostExecute(String result){
        Toast.makeText(getApplicationContext(), "test1", Toast.LENGTH_LONG).show();


Two Maven archetypes into one

I would’ve like to create spring project with structure like this:

|-- pom.xml
`-- src
    `-- main
    |   `-- java
    |       `--
        `-- webapp
            |-- WEB-INF
            |   `-- web.xml
            `-- index.jsp           
    `-- test
        `-- java

Right now I’m using one of those (and copy elements from another one).

  • Maven Webapp Archetype

|-- pom.xml
'-- src
'-- main
'-- webapp
| '-- web.xml
'-- index.jsp


  • maven-archetype-quickstart

    |-- pom.xml
    '-- src
    |-- main
    | '-- java
    | '--
    '-- test
    '-- java

Is there a way to do it easier? I was thinking about creating my own archetype but maybe there is way to open them both at once. I was searching for similar question, but couldnt find it (Sorry for my bad english).