问:
Not able to migrate sonarqube from 7.4 to 7.7
I am upgrading my sonarqube from 7.4 to 7.7 but while migrating database it is giving me an error. I am attaching the logs here. Can someone please help me out.

```<code>2019.05.28 07:31:23 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@75b67f49 [pattern=UrlPattern{inclusions=[/api/system/migrate_db.*, ...], exclusions=[/api/properties*, ...]}]
2019.05.28 07:31:23 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2019.05.28 07:43:09 INFO  web[][o.s.s.p.d.m.DatabaseMigrationImpl] Starting DB Migration and container restart
2019.05.28 07:43:09 INFO  web[][DbMigrations] Executing DB migrations...
2019.05.28 07:43:09 INFO  web[][DbMigrations] #2606 'Drop DATA_TYPE column from FILE_SOURCES table'...
2019.05.28 07:43:09 ERROR web[][DbMigrations] #2606 'Drop DATA_TYPE column from FILE_SOURCES table': failure | time=9ms
2019.05.28 07:43:09 ERROR web[][DbMigrations] Executed DB migrations: failure | time=10ms
2019.05.28 07:43:09 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=75ms
2019.05.28 07:43:09 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration ended with an exception
org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #2606 'Drop DATA_TYPE column from FILE_SOURCES table' failed
    at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:79)
    at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:67)
    at java.lang.Iterable.forEach(Iterable.java:75)
    at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:52)
    at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:68)
    at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doUpgradeDb(DatabaseMigrationImpl.java:105)
    at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(DatabaseMigrationImpl.java:80)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Fail to execute DROP INDEX file_sources_uuid_type ON file_sources
    at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:97)
    at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:77)
    at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:117)
    at org.sonar.server.platform.db.migration.version.v77.DropDataTypeFromFileSources.execute(DropDataTypeFromFileSources.java:43)
    at org.sonar.server.platform.db.migration.step.DdlChange.execute(DdlChange.java:45)
    at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75)
    ... 9 common frames omitted
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Can't DROP 'file_sources_uuid_type'; check that column/key exists
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
    at com.mysql.jdbc.Util.getInstance(Util.java:408)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2482)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2440)
    at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:845)
    at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:745)
    at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
    at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
    at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:82)
    ... 14 common frames omitted
</code>```

Even I tried with adding INDEX manually but it's giving me an error.

答:
So I found the solution for the above query. So what I have done, I tried to add the above index in that data_type column. And after trying couple of times the index gets added. Now again I tried to upgrade DB from sonar portal and hooray! it worked!.

Thanks!

Body:
I am upgrading my sonarqube from 7.4 to 7.7 but while migrating database it is giving me an error. I am attaching the logs here. Can someone please help me out.

2019.05.28 07:31:23 INFO  web[][o.s.s.p.w.MasterServletFilter] Initializing servlet filter org.sonar.server.ws.WebServiceFilter@75b67f49 [pattern=UrlPattern{inclusions=[/api/system/migrate_db.*, ...], exclusions=[/api/properties*, ...]}]
2019.05.28 07:31:23 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2019.05.28 07:43:09 INFO  web[][o.s.s.p.d.m.DatabaseMigrationImpl] Starting DB Migration and container restart
2019.05.28 07:43:09 INFO  web[][DbMigrations] Executing DB migrations...
2019.05.28 07:43:09 INFO  web[][DbMigrations] #2606 'Drop DATA_TYPE column from FILE_SOURCES table'...
2019.05.28 07:43:09 ERROR web[][DbMigrations] #2606 'Drop DATA_TYPE column from FILE_SOURCES table': failure | time=9ms
2019.05.28 07:43:09 ERROR web[][DbMigrations] Executed DB migrations: failure | time=10ms
2019.05.28 07:43:09 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=75ms
2019.05.28 07:43:09 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration ended with an exception
org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #2606 'Drop DATA_TYPE column from FILE_SOURCES table' failed
    at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:79)
    at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:67)
    at java.lang.Iterable.forEach(Iterable.java:75)
    at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:52)
    at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:68)
    at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doUpgradeDb(DatabaseMigrationImpl.java:105)
    at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(DatabaseMigrationImpl.java:80)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Fail to execute DROP INDEX file_sources_uuid_type ON file_sources
    at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:97)
    at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:77)
    at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:117)
    at org.sonar.server.platform.db.migration.version.v77.DropDataTypeFromFileSources.execute(DropDataTypeFromFileSources.java:43)
    at org.sonar.server.platform.db.migration.step.DdlChange.execute(DdlChange.java:45)
    at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75)
    ... 9 common frames omitted
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Can't DROP 'file_sources_uuid_type'; check that column/key exists
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
    at com.mysql.jdbc.Util.getInstance(Util.java:408)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2482)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2440)
    at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:845)
    at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:745)
    at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
    at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
    at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:82)
    ... 14 common frames omitted

Even I tried with adding INDEX manually but it's giving me an error.


来源: stackexchange

问:
How to Highlight the `Selected row` in a `Listview` using Fragments
I created a listview that is acting as a menu. When the user chooses a specific menu, another fragment will show up on the right portion.

Please see this image:

The problem is, the icon and the title are only highlighted and not the whole selected row. How can I highlight the selected row instead of the icon and title only?

This is my code:

fragment_inventory_list.xml

```<code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".InventoryListFragment"
    android:layout_marginTop="@dimen/padding_50"
    android:orientation="vertical"
    android:background="?android:attr/activatedBackgroundIndicator">

   <LinearLayout
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:orientation="vertical">

       <ListView
           android:id="@+id/inventorylist_listview"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:choiceMode="singleChoice"
           android:listSelector="@color/light_gray"/>

   </LinearLayout>

</LinearLayout>
</code>```

InventoryListFragment.java

```<code>package com.example.devcash;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;

import com.example.devcash.CustomAdapters.InventoryListAdapter;
import com.example.devcash.Fragments.CategoriesFragment;
import com.example.devcash.Fragments.DiscountsFragment;
import com.example.devcash.Fragments.ProductsFragment;
import com.example.devcash.Fragments.ServicesFragment;
import com.example.devcash.Lists.InventoryList;

import java.util.ArrayList;

/**
 * A simple {@link Fragment} subclass.
 */
public class InventoryListFragment extends Fragment implements AdapterView.OnItemClickListener {

    ListView lvinventory;
    ArrayList<InventoryList> list = new ArrayList<InventoryList>();
    InventoryListAdapter adapter;

    public InventoryListFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_inventory_list, container, false);

        lvinventory = (ListView) view.findViewById(R.id.inventorylist_listview);
        adapter = new InventoryListAdapter(getActivity(),list);

        list.add(new InventoryList(R.drawable.ic_product,"Products"));
        list.add(new InventoryList(R.drawable.ic_services,"Services"));
        list.add(new InventoryList(R.drawable.ic_category, "Categories"));
        list.add(new InventoryList(R.drawable.ic_local_offer,"Discounts"));

        lvinventory.setAdapter(adapter);
        lvinventory.setOnItemClickListener(this);

        return view;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        InventoryList selectedList = this.list.get(position);

        int icon = selectedList.getIcon();
        String title = selectedList.getInventory_title();

        FragmentManager fragmentManager = getFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();

        switch (position){
            case 0:
                ProductsFragment productsFragment = new ProductsFragment();
                fragmentTransaction.add(R.id.inventorylist_fragmentcontainer, productsFragment);
                fragmentTransaction.addToBackStack(null);
                fragmentTransaction.commit();
                break;
            case 1:
                ServicesFragment servicesFragment = new ServicesFragment();
                fragmentTransaction.add(R.id.inventorylist_fragmentcontainer, servicesFragment);
                fragmentTransaction.addToBackStack(null);
                fragmentTransaction.commit();
                break;
            case  2:
                CategoriesFragment categoriesFragment = new CategoriesFragment();
                fragmentTransaction.add(R.id.inventorylist_fragmentcontainer, categoriesFragment);
                fragmentTransaction.addToBackStack(null);
                fragmentTransaction.commit();
                break;
            case 3:
                DiscountsFragment discountsFragment = new DiscountsFragment();
                fragmentTransaction.add(R.id.inventorylist_fragmentcontainer, discountsFragment);
                fragmentTransaction.addToBackStack(null);
                fragmentTransaction.commit();
                break;
        }
    }
}
</code>```

答:
In InventoryList Model add another one field like isSelected.

```<code>String isSelected;

public String getIsSelected() {
    return isSelected;
}

public void setIsSelected(String isSelected) {
    this.isSelected = isSelected;
}
</code>```

And then By default set Value 0 of isSelected field. if you want to open by default Product fragment then its value is 1.

```<code>list.add(new InventoryList(R.drawable.ic_product,"Products","1"));
list.add(new InventoryList(R.drawable.ic_services,"Services","0"));
list.add(new InventoryList(R.drawable.ic_category, "Categories","0"));
list.add(new InventoryList(R.drawable.ic_local_offer,"Discounts","0"));

lvinventory.setAdapter(adapter);
lvinventory.setOnItemClickListener(this);
</code>```

In onItemClick function to write below code :

```<code>for (int i = 0; i < list.size(); i++) {
    list.get(i).setIsSelected("0");
}

selectedList.setIsSelected("1");
adapter.notifyDataSetChanged();
</code>```

In 'InventoryListAdapter' file 'getView' override function to set background color like ...

```<code>if (list.get(position).getIsSelected().equals("1")) {
    view.setBackgroundColor(/* your selected color */); // Gray
} else {
   view.setBackgroundColor(/* your NOT selected color */); // White
}
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I created a listview that is acting as a menu. When the user chooses a specific menu, another fragment will show up on the right portion.

Please see this image:

The problem is, the icon and the title are only highlighted and not the whole selected row. How can I highlight the selected row instead of the icon and title only?

This is my code:

fragment_inventory_list.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".InventoryListFragment"
    android:layout_marginTop="@dimen/padding_50"
    android:orientation="vertical"
    android:background="?android:attr/activatedBackgroundIndicator">

   <LinearLayout
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:orientation="vertical">

       <ListView
           android:id="@+id/inventorylist_listview"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:choiceMode="singleChoice"
           android:listSelector="@color/light_gray"/>

   </LinearLayout>

</LinearLayout>

InventoryListFragment.java

package com.example.devcash;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;

import com.example.devcash.CustomAdapters.InventoryListAdapter;
import com.example.devcash.Fragments.CategoriesFragment;
import com.example.devcash.Fragments.DiscountsFragment;
import com.example.devcash.Fragments.ProductsFragment;
import com.example.devcash.Fragments.ServicesFragment;
import com.example.devcash.Lists.InventoryList;

import java.util.ArrayList;

/**
 * A simple {@link Fragment} subclass.
 */
public class InventoryListFragment extends Fragment implements AdapterView.OnItemClickListener {

    ListView lvinventory;
    ArrayList<InventoryList> list = new ArrayList<InventoryList>();
    InventoryListAdapter adapter;

    public InventoryListFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_inventory_list, container, false);

        lvinventory = (ListView) view.findViewById(R.id.inventorylist_listview);
        adapter = new InventoryListAdapter(getActivity(),list);

        list.add(new InventoryList(R.drawable.ic_product,"Products"));
        list.add(new InventoryList(R.drawable.ic_services,"Services"));
        list.add(new InventoryList(R.drawable.ic_category, "Categories"));
        list.add(new InventoryList(R.drawable.ic_local_offer,"Discounts"));

        lvinventory.setAdapter(adapter);
        lvinventory.setOnItemClickListener(this);

        return view;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        InventoryList selectedList = this.list.get(position);

        int icon = selectedList.getIcon();
        String title = selectedList.getInventory_title();

        FragmentManager fragmentManager = getFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();

        switch (position){
            case 0:
                ProductsFragment productsFragment = new ProductsFragment();
                fragmentTransaction.add(R.id.inventorylist_fragmentcontainer, productsFragment);
                fragmentTransaction.addToBackStack(null);
                fragmentTransaction.commit();
                break;
            case 1:
                ServicesFragment servicesFragment = new ServicesFragment();
                fragmentTransaction.add(R.id.inventorylist_fragmentcontainer, servicesFragment);
                fragmentTransaction.addToBackStack(null);
                fragmentTransaction.commit();
                break;
            case  2:
                CategoriesFragment categoriesFragment = new CategoriesFragment();
                fragmentTransaction.add(R.id.inventorylist_fragmentcontainer, categoriesFragment);
                fragmentTransaction.addToBackStack(null);
                fragmentTransaction.commit();
                break;
            case 3:
                DiscountsFragment discountsFragment = new DiscountsFragment();
                fragmentTransaction.add(R.id.inventorylist_fragmentcontainer, discountsFragment);
                fragmentTransaction.addToBackStack(null);
                fragmentTransaction.commit();
                break;
        }
    }
}

Body:
In InventoryList Model add another one field like isSelected.

String isSelected;

public String getIsSelected() {
    return isSelected;
}

public void setIsSelected(String isSelected) {
    this.isSelected = isSelected;
}

And then By default set Value 0 of isSelected field. if you want to open by default Product fragment then its value is 1.

list.add(new InventoryList(R.drawable.ic_product,"Products","1"));
list.add(new InventoryList(R.drawable.ic_services,"Services","0"));
list.add(new InventoryList(R.drawable.ic_category, "Categories","0"));
list.add(new InventoryList(R.drawable.ic_local_offer,"Discounts","0"));

lvinventory.setAdapter(adapter);
lvinventory.setOnItemClickListener(this);

In onItemClick function to write below code :

for (int i = 0; i < list.size(); i++) {
    list.get(i).setIsSelected("0");
}

selectedList.setIsSelected("1");
adapter.notifyDataSetChanged();

In 'InventoryListAdapter' file 'getView' override function to set background color like ...

if (list.get(position).getIsSelected().equals("1")) {
    view.setBackgroundColor(/* your selected color */); // Gray
} else {
   view.setBackgroundColor(/* your NOT selected color */); // White
}


问:
How to fix "Forbidden!Configured service account doesn't have access" with Spark on Kubernetes?
I am trying to run the basic example of submitting a spark application with a k8s cluster.

I created my docker image, using the script from the spark folder :

```<code>sudo ./bin/docker-image-tool.sh -mt spark-docker build

sudo docker image ls

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
spark-r             spark-docker        793527583e00        17 minutes ago      740MB
spark-py            spark-docker        c984e15fe747        18 minutes ago      446MB
spark               spark-docker        71950de529b3        18 minutes ago      355MB
openjdk             8-alpine            88d1c219f815        15 hours ago        105MB
hello-world         latest              fce289e99eb9        3 months ago        1.84kB
</code>```

And then tried to submit the SparkPi examples (as in the official documentation).

```<code>./bin/spark-submit \
        --master k8s://[MY_IP]:8443 \
        --deploy-mode cluster \
        --name spark-pi --class org.apache.spark.examples.SparkPi \
        --driver-memory 1g \
        --executor-memory 3g \
        --conf spark.executor.instances=2 \
        --conf spark.kubernetes.container.image=spark:spark-docker \
        local:///opt/spark/examples/jars/spark-examples_2.11-2.4.0.jar
</code>```

But the run fail with the following Exception :

```<code>io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: https://kubernetes.default.svc/api/v1/namespaces/default/pods/spark-pi-1554304245069-driver.
Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. pods "spark-pi-1554304245069-driver" is forbidden: User "system:serviceaccount:default:default" cannot get resource "pods" in API group "" in the namespace "default".
</code>```

Here are the full logs of the pod from the Kubernetes Dashboard :

```<code>2019-04-03 15:10:50 INFO  ContextHandler:781 - Started o.s.j.s.ServletContextHandler@49096b06{/executors/threadDump,null,AVAILABLE,@Spark}
2019-04-03 15:10:50 INFO  ContextHandler:781 - Started o.s.j.s.ServletContextHandler@4a183d02{/executors/threadDump/json,null,AVAILABLE,@Spark}
2019-04-03 15:10:50 INFO  ContextHandler:781 - Started o.s.j.s.ServletContextHandler@5d05ef57{/static,null,AVAILABLE,@Spark}
2019-04-03 15:10:50 INFO  ContextHandler:781 - Started o.s.j.s.ServletContextHandler@34237b90{/,null,AVAILABLE,@Spark}
2019-04-03 15:10:50 INFO  ContextHandler:781 - Started o.s.j.s.ServletContextHandler@1d01dfa5{/api,null,AVAILABLE,@Spark}
2019-04-03 15:10:50 INFO  ContextHandler:781 - Started o.s.j.s.ServletContextHandler@31ff1390{/jobs/job/kill,null,AVAILABLE,@Spark}
2019-04-03 15:10:50 INFO  ContextHandler:781 - Started o.s.j.s.ServletContextHandler@759d81f3{/stages/stage/kill,null,AVAILABLE,@Spark}
2019-04-03 15:10:50 INFO  SparkUI:54 - Bound SparkUI to 0.0.0.0, and started at http://spark-pi-1554304245069-driver-svc.default.svc:4040
2019-04-03 15:10:50 INFO  SparkContext:54 - Added JAR file:///opt/spark/examples/jars/spark-examples_2.11-2.4.0.jar at spark://spark-pi-1554304245069-driver-svc.default.svc:7078/jars/spark-examples_2.11-2.4.0.jar with timestamp 1554304250157
2019-04-03 15:10:51 ERROR SparkContext:91 - Error initializing SparkContext.
org.apache.spark.SparkException: External scheduler cannot be instantiated
    at org.apache.spark.SparkContext$.org$apache$spark$SparkContext$$createTaskScheduler(SparkContext.scala:2794)
    at org.apache.spark.SparkContext.<init>(SparkContext.scala:493)
    at org.apache.spark.SparkContext$.getOrCreate(SparkContext.scala:2520)
    at org.apache.spark.sql.SparkSession$Builder$$anonfun$7.apply(SparkSession.scala:935)
    at org.apache.spark.sql.SparkSession$Builder$$anonfun$7.apply(SparkSession.scala:926)
    at scala.Option.getOrElse(Option.scala:121)
    at org.apache.spark.sql.SparkSession$Builder.getOrCreate(SparkSession.scala:926)
    at org.apache.spark.examples.SparkPi$.main(SparkPi.scala:31)
    at org.apache.spark.examples.SparkPi.main(SparkPi.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
    at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:849)
    at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:167)
    at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:195)
    at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:86)
    at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:924)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:933)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Caused by: io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: https://kubernetes.default.svc/api/v1/namespaces/default/pods/spark-pi-1554304245069-driver. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. pods "spark-pi-1554304245069-driver" is forbidden: User "system:serviceaccount:default:default" cannot get resource "pods" in API group "" in the namespace "default".
    at io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:470)
    at io.fabric8.kubernetes.client.dsl.base.OperationSupport.assertResponseCode(OperationSupport.java:407)
    at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:379)
    at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:343)
    at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleGet(OperationSupport.java:312)
</code>```

Notes :

Spark 2.4

Kubernetes 1.14.0

I use Minikube for my k8s cluster

答:
Hello I had the same issue.
I then found this Github issue
https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes/issues/113

That point me to the problem. I solved the issue following the Spark guide for RBAC cluster here
https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes/issues/113

Create a serviceaccount

```<code>kubectl create serviceaccount spark
</code>```

Give the service account the edit role on the cluster

```<code>kubectl create clusterrolebinding spark-role --clusterrole=edit --serviceaccount=default:spark --namespace=default
</code>```

Run spark submit with the following flag, in order to run it with the (just created(service account)

```<code>--conf spark.kubernetes.authenticate.driver.serviceAccountName=spark
</code>```

Hope it helps!

Body:
I am trying to run the basic example of submitting a spark application with a k8s cluster.

I created my docker image, using the script from the spark folder :

sudo ./bin/docker-image-tool.sh -mt spark-docker build

sudo docker image ls

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
spark-r             spark-docker        793527583e00        17 minutes ago      740MB
spark-py            spark-docker        c984e15fe747        18 minutes ago      446MB
spark               spark-docker        71950de529b3        18 minutes ago      355MB
openjdk             8-alpine            88d1c219f815        15 hours ago        105MB
hello-world         latest              fce289e99eb9        3 months ago        1.84kB

And then tried to submit the SparkPi examples (as in the official documentation).

./bin/spark-submit \
        --master k8s://[MY_IP]:8443 \
        --deploy-mode cluster \
        --name spark-pi --class org.apache.spark.examples.SparkPi \
        --driver-memory 1g \
        --executor-memory 3g \
        --conf spark.executor.instances=2 \
        --conf spark.kubernetes.container.image=spark:spark-docker \
        local:///opt/spark/examples/jars/spark-examples_2.11-2.4.0.jar

But the run fail with the following Exception :

io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: https://kubernetes.default.svc/api/v1/namespaces/default/pods/spark-pi-1554304245069-driver.
Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. pods "spark-pi-1554304245069-driver" is forbidden: User "system:serviceaccount:default:default" cannot get resource "pods" in API group "" in the namespace "default".

Here are the full logs of the pod from the Kubernetes Dashboard :

2019-04-03 15:10:50 INFO  ContextHandler:781 - Started o.s.j.s.ServletContextHandler@49096b06{/executors/threadDump,null,AVAILABLE,@Spark}
2019-04-03 15:10:50 INFO  ContextHandler:781 - Started o.s.j.s.ServletContextHandler@4a183d02{/executors/threadDump/json,null,AVAILABLE,@Spark}
2019-04-03 15:10:50 INFO  ContextHandler:781 - Started o.s.j.s.ServletContextHandler@5d05ef57{/static,null,AVAILABLE,@Spark}
2019-04-03 15:10:50 INFO  ContextHandler:781 - Started o.s.j.s.ServletContextHandler@34237b90{/,null,AVAILABLE,@Spark}
2019-04-03 15:10:50 INFO  ContextHandler:781 - Started o.s.j.s.ServletContextHandler@1d01dfa5{/api,null,AVAILABLE,@Spark}
2019-04-03 15:10:50 INFO  ContextHandler:781 - Started o.s.j.s.ServletContextHandler@31ff1390{/jobs/job/kill,null,AVAILABLE,@Spark}
2019-04-03 15:10:50 INFO  ContextHandler:781 - Started o.s.j.s.ServletContextHandler@759d81f3{/stages/stage/kill,null,AVAILABLE,@Spark}
2019-04-03 15:10:50 INFO  SparkUI:54 - Bound SparkUI to 0.0.0.0, and started at http://spark-pi-1554304245069-driver-svc.default.svc:4040
2019-04-03 15:10:50 INFO  SparkContext:54 - Added JAR file:///opt/spark/examples/jars/spark-examples_2.11-2.4.0.jar at spark://spark-pi-1554304245069-driver-svc.default.svc:7078/jars/spark-examples_2.11-2.4.0.jar with timestamp 1554304250157
2019-04-03 15:10:51 ERROR SparkContext:91 - Error initializing SparkContext.
org.apache.spark.SparkException: External scheduler cannot be instantiated
    at org.apache.spark.SparkContext$.org$apache$spark$SparkContext$$createTaskScheduler(SparkContext.scala:2794)
    at org.apache.spark.SparkContext.<init>(SparkContext.scala:493)
    at org.apache.spark.SparkContext$.getOrCreate(SparkContext.scala:2520)
    at org.apache.spark.sql.SparkSession$Builder$$anonfun$7.apply(SparkSession.scala:935)
    at org.apache.spark.sql.SparkSession$Builder$$anonfun$7.apply(SparkSession.scala:926)
    at scala.Option.getOrElse(Option.scala:121)
    at org.apache.spark.sql.SparkSession$Builder.getOrCreate(SparkSession.scala:926)
    at org.apache.spark.examples.SparkPi$.main(SparkPi.scala:31)
    at org.apache.spark.examples.SparkPi.main(SparkPi.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
    at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:849)
    at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:167)
    at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:195)
    at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:86)
    at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:924)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:933)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Caused by: io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: https://kubernetes.default.svc/api/v1/namespaces/default/pods/spark-pi-1554304245069-driver. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. pods "spark-pi-1554304245069-driver" is forbidden: User "system:serviceaccount:default:default" cannot get resource "pods" in API group "" in the namespace "default".
    at io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:470)
    at io.fabric8.kubernetes.client.dsl.base.OperationSupport.assertResponseCode(OperationSupport.java:407)
    at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:379)
    at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:343)
    at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleGet(OperationSupport.java:312)

Notes :

Spark 2.4

Kubernetes 1.14.0

I use Minikube for my k8s cluster

Body:
Hello I had the same issue.
I then found this Github issue
https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes/issues/113

That point me to the problem. I solved the issue following the Spark guide for RBAC cluster here
https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes/issues/113

Create a serviceaccount

kubectl create serviceaccount spark

Give the service account the edit role on the cluster

kubectl create clusterrolebinding spark-role --clusterrole=edit --serviceaccount=default:spark --namespace=default

Run spark submit with the following flag, in order to run it with the (just created(service account)

--conf spark.kubernetes.authenticate.driver.serviceAccountName=spark

Hope it helps!


问:
Different results in Stata and R with the "same" anova code
I have some Stata code and I want to replicate the results in R. However, even with the same dataset and, I think, the same code, I get different results in R from those in Stata. I think it could be because Stata makes the order of the regression different than keyed in.

Do I need exactly the same order as in Stata to get the same results and how can I do this?

I changed all the variables to factors and tried again but the problem is still there.

I noticed that when I change the order of the explanatory variables I get different results, but I don`t find "the right order" to replicate the Stata results.

Stata code:

```<code>. anova testm2 c.testm1 i.hptreat c.cortm1 c.cortm2 i.female if inelig == 0 & anyoutv1 == 0

Number of obs =39    R-squared =0.7048
Root MSE= 16.0144    Adj R-squared =0.6601

 Source | Partial SS         df         MS        F    Prob>F
---------------------------------------------------------------
  Model |  20209.281          5   4041.8563     15.76  0.0000
 testm1 |  3516.6527          1   3516.6527     13.71  0.0008
 hptreat|  1183.5007          1   1183.5007      4.61  0.0391
 cortm1 |  8.5753841          1   8.5753841      0.03  0.8560
 cortm2 |  2810.9353          1   2810.9353     10.96  0.0023
 female |  2557.3444          1   2557.3444      9.97  0.0034
Residual|  8463.2532         33   256.46222
----------------------------------------------------------------
  Total |  28672.535         38   754.54038
</code>```

R code:

```<code>FosseTest<-aov(testm2~testm1+hptreat+cortm1+cortm2+female,data=X2data)
summary(FosseTest)

            Df Sum Sq Mean Sq F value   Pr(>F)
testm1       1  15121   15121  58.962 7.68e-09 ***
hptreat      1    524     524   2.043  0.16228
cortm1       1     23      23   0.089  0.76715
cortm2       1   1984    1984   7.735  0.00888 **
female       1   2557    2557   9.972  0.00339 **
Residuals   33   8463     256
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
</code>```

You can see that I get totally different values in the replication.

in the X2data Set I already subset the values for if inelig == 0 & anyoutv1 == 0

for the reconstruction of the data:

```<code>dput(X2data)
structure(list(id = c(29L, 30L, 31L, 32L, 34L, 35L, 36L, 37L,
39L, 41L, 42L, 43L, 44L, 46L, 47L, 49L, 50L, 51L, 52L, 53L, 54L,
55L, 57L, 58L, 59L, 60L, 61L, 62L, 64L, 65L, 66L, 67L, 68L, 69L,
70L, 71L, 72L, 73L, 74L), inelig = structure(c(1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L), .Label = c("Analytic sample (keep)", "Ineligible (drop)"
), class = "factor"), ccydrop = c(0L, 0L, 0L, 0L, 1L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
), cortm1v2 = c(0.003, 0.086, 0.047, 0.106, NA, 0.153, 0.086,
0.005, 0.133, 0.036, 0.03, 0.015, 0.014, 0.111, 0.389, 0.298,
0.4, 0.215, 0.062, 0.021, 0.075, 0.073, 0.033, 0.243, 0.126,
0.147, 0.019, 0.048, 0.28, 0.052, 0.039, 0.105, 0.111, 0.133,
0.065, 0.051, 0.143, 0.127, 0.095), cortm2v2 = c(0.025, 0.167,
0.059, 0.112, 0.171, 0.183, 0.102, 0.018, 0.08, 0.015, 0.027,
0.05, 0.025, 0.046, 0.085, 0.144, 0.155, 0.09, 0.057, 0.023,
0.038, 0.205, 0.035, 0.198, 0.112, 0.211, 0.042, 0.142, 0.328,
0.076, 0.067, 0.094, 0.245, 0.153, 0.115, 0.127, 0.257, 0.125,
0.096), cdiffv2 = c(0.022, 0.081, 0.012, 0.006, NA, 0.03, 0.016,
0.013, -0.053, -0.021, -0.003, 0.035, 0.011, -0.065, -0.304,
-0.154, -0.245, -0.125, -0.005, 0.002, -0.037, 0.132, 0.002,
-0.045, -0.014, 0.064, 0.023, 0.094, 0.048, 0.024, 0.028, -0.011,
0.134, 0.02, 0.05, 0.076, 0.114, -0.002, 0.001), testm1v2 = c(38.72,
32.77, 32.32, 17.99, 73.58, 80.69, 48.56, 21.92, 27.24, 40.93,
31.73, 60.05, 38.04, 30.17, 59.07, 26.92, 25.41, 47.81, 63.02,
34.49, 104.38, 38.08, 30.99, 35.23, 104.81, 49.33, 50.03, 11.65,
143.57, 48.31, 90.37, 48.56, 41.67, 75.23, 60.56, 39.03, 18.16,
37.9, 84.5), testm2v2 = c(62.37, 29.23, 27.51, 28.66, 44.67,
105.48, 42.67, 15.01, 21.33, 10.87, 2.14, 44.53, 35.8, 10.43,
47.54, 48.5, 38.98, 91.32, 52.94, 22.43, 58.68, 81.63, 34.79,
38.57, 94.86, 50.83, 55.75, 45.33, 111.62, 65.15, 81.08, 50.08,
44.86, 58.63, 85.85, 58.69, 16.35, 35.97, 99.08), tdiffv2 = c(23.65,
-3.54, -4.81, 10.67, -28.91, 24.79, -5.89, -6.91, -5.91, -30.06,
-29.59, -15.52, -2.24, -19.74, -11.53, 21.58, 13.57, 43.51, -10.08,
-12.06, -45.7, 43.55, 3.8, 3.34, -9.95, 1.5, 5.72, 33.68, -31.95,
16.84, -9.29000000000001, 1.52, 3.19, -16.6, 25.29, 19.66, -1.81,
-1.93, 14.58), testoutv1 = structure(c(1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L), .Label = c("Not selected", "Selected"), class = "factor"),
    cortoutv1 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
    ), .Label = c("Not selected", "Selected"), class = "factor"),
    anyoutv1 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
    ), .Label = c("Not selected", "Selected"), class = "factor"),
    testoutv2 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
    ), .Label = c("Not selected", "Selected"), class = "factor"),
    cortoutv2 = structure(c(1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
    ), .Label = c("Not selected", "Selected"), class = "factor"),
    anyoutv2 = structure(c(1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
    ), .Label = c("Not selected", "Selected"), class = "factor"),
    pose1rate = c(6L, 7L, 6L, 6L, 7L, 7L, 6L, 7L, 5L, 6L, 7L,
    4L, 7L, 7L, 7L, 6L, 7L, 7L, 7L, 7L, 6L, 7L, 7L, 7L, 7L, 7L,
    7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L), pose2rate = c(6L,
    6L, 5L, 7L, 7L, 7L, 7L, 7L, 6L, 7L, 7L, 7L, 7L, 7L, 7L, 6L,
    6L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 6L, 7L, 6L, 7L, 7L, 7L,
    6L, 7L, 7L, 7L, 7L, 7L, 6L, 6L), poseratem = c(6, 6.5, 5.5,
    6.5, 7, 7, 6.5, 7, 5.5, 6.5, 7, 5.5, 7, 7, 7, 6, 6.5, 7,
    7, 7, 6.5, 7, 7, 7, 7, 6.5, 7, 6.5, 7, 7, 7, 6.5, 7, 7, 7,
    7, 7, 6.5, 6.5), saldiff = c(24.30555556, 20.83333333, 29.16666667,
    18.75, 23.61111111, 34.02777778, 18.05555556, 19.44444444,
    21.52777778, 15.97222222, 22.91666667, 13.88888889, 22.22222222,
    25, 22.22222222, 22.22222222, 18.05555556, 17.36111111, 22.22222222,
    27.08333333, 20.83333333, 24.30555556, 22.22222222, 28.47222222,
    24.30555556, 25, 27.77777778, 22.22222222, 15.97222222, 24.30555556,
    21.52777778, 19.44444444, 15.97222222, 15.27777778, 15.97222222,
    24.30555556, 19.44444444, 24.30555556, 15.27777778), sal2manip = c(19.80555556,
    16.33333333, 24.66666667, 14.25, 19.11111111, 29.52777778,
    13.55555556, 14.94444444, 17.02777778, 11.47222222, 18.41666667,
    9.38888889, 17.72222222, 20.5, 17.72222222, 17.72222222,
    13.55555556, 12.86111111, 17.72222222, 22.58333333, 16.33333333,
    19.80555556, 17.72222222, 23.97222222, 19.80555556, 20.5,
    23.27777778, 17.72222222, 11.47222222, 19.80555556, 17.02777778,
    14.94444444, 11.47222222, 10.77777778, 11.47222222, 19.80555556,
    14.94444444, 19.80555556, 10.77777778), hptreat = structure(c(2L,
    1L, 2L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 2L,
    1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 1L,
    2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L), .Label = c("0", "1"), class = "factor"),
    female = structure(c(1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
    2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L,
    1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 1L
    ), .Label = c("0", "1"), class = "factor"), age = c(19L,
    20L, 20L, 18L, 21L, 20L, 18L, 21L, 35L, 20L, 18L, 20L, 20L,
    18L, 20L, 25L, 18L, 23L, 21L, 19L, 20L, 20L, 30L, 19L, 22L,
    18L, 19L, 22L, 19L, 20L, 28L, 28L, 19L, 19L, 20L, 25L, 20L,
    25L, 23L), cort1a1 = c(0.004, 0.085, 0.049, 0.107, 0.486,
    0.159, 0.088, 0.004, 0.138, 0.035, 0.03, 0.018, 0.017, 0.111,
    0.39, 0.292, 0.396, 0.213, 0.065, 0.022, 0.074, 0.077, 0.035,
    0.241, 0.126, 0.154, 0.021, 0.05, 0.296, 0.054, 0.04, 0.109,
    0.114, 0.133, 0.063, 0.055, 0.149, 0.134, 0.098), cort1a2 = c(0.001,
    0.086, 0.045, 0.105, 0.482, 0.147, 0.085, 0.005, 0.127, 0.037,
    0.031, 0.013, 0.011, 0.111, 0.389, 0.304, 0.405, 0.218, 0.059,
    0.02, 0.076, 0.069, 0.032, 0.246, 0.126, 0.141, 0.017, 0.046,
    0.264, 0.051, 0.038, 0.101, 0.109, 0.133, 0.068, 0.048, 0.137,
    0.12, 0.092), cort2a1 = c(0.027, 0.174, 0.056, 0.111, 0.175,
    0.179, 0.103, 0.021, 0.079, 0.014, 0.028, 0.051, 0.024, 0.051,
    0.083, 0.148, 0.156, 0.086, 0.062, 0.024, 0.038, 0.209, 0.036,
    0.199, 0.114, 0.207, 0.041, 0.141, 0.333, 0.078, 0.065, 0.088,
    0.238, 0.157, 0.119, 0.132, 0.268, 0.132, 0.099), cort2a2 = c(0.023,
    0.161, 0.062, 0.113, 0.166, 0.188, 0.101, 0.016, 0.081, 0.015,
    0.026, 0.049, 0.026, 0.041, 0.086, 0.139, 0.154, 0.093, 0.052,
    0.022, 0.038, 0.202, 0.034, 0.198, 0.111, 0.215, 0.042, 0.142,
    0.324, 0.075, 0.068, 0.101, 0.252, 0.149, 0.111, 0.123, 0.247,
    0.118, 0.093), cortm1 = c(0.0024999999, 0.085500002, 0.046999998,
    0.106, 0.484, 0.153, 0.086499996, 0.0044999998, 0.13249999,
    0.035999998, 0.0305, 0.0155, 0.014, 0.111, 0.38949999, 0.29800001,
    0.4005, 0.2155, 0.061999999, 0.021, 0.075000003, 0.072999999,
    0.033500001, 0.24349999, 0.126, 0.14749999, 0.018999999,
    0.048, 0.28, 0.052499998, 0.039000001, 0.105, 0.1115, 0.133,
    0.065499999, 0.0515, 0.14300001, 0.127, 0.094999999), cortm2 = c(0.025,
    0.1675, 0.059, 0.112, 0.1705, 0.18350001, 0.102, 0.0185,
    0.079999998, 0.0145, 0.027000001, 0.050000001, 0.025, 0.046,
    0.0845, 0.1435, 0.155, 0.089500003, 0.057, 0.023, 0.037999999,
    0.20550001, 0.035, 0.19850001, 0.1125, 0.211, 0.041499998,
    0.1415, 0.3285, 0.076499999, 0.066500001, 0.094499998, 0.245,
    0.153, 0.115, 0.1275, 0.25749999, 0.125, 0.096000001), cdiff = c(0.022500001,
    0.082000002, 0.012000002, 0.0060000047, -0.31349999, 0.03050001,
    0.015500002, 0.014, -0.052499995, -0.021499999, -0.0034999996,
    0.034500003, 0.011, -0.064999998, -0.30500001, -0.15450001,
    -0.2455, -0.12599999, -0.004999999, 0.0020000003, -0.037000004,
    0.13250001, 0.0014999993, -0.044999987, -0.013500005, 0.063500002,
    0.022499999, 0.093499996, 0.048500001, 0.024, 0.0275, -0.010499999,
    0.13350001, 0.019999996, 0.049500003, 0.075999998, 0.11449999,
    -0.0020000041, 0.001000002), test1a1 = c(39.87, 33.22, 32.52,
    19.74, 78.85, 83.51, 48.37, 22.31, 28.17, 41.44, 32.92, 61.4,
    40.31, 30.36, 59.44, 27.52, 26.14, 46.75, 63.73, 34.03, 98.47,
    36.62, 30.26, 37.15, 105.64, 47.99, 50.15, 11.33, 149.12,
    48.57, 92.04, 51.22, 42.25, 77.07, 62.75, 38.8, 17.91, 40.28,
    88.47), test1a2 = c(37.58, 32.32, 32.12, 16.25, 68.31, 77.88,
    48.75, 21.53, 26.32, 40.42, 30.55, 58.7, 35.78, 29.97, 58.7,
    26.32, 24.69, 48.87, 62.32, 34.95, 110.29, 39.53, 31.72,
    33.32, 103.99, 50.67, 49.9, 11.97, 138.02, 48.05, 88.7, 45.89,
    41.08, 73.39, 58.38, 39.25, 18.41, 35.53, 80.54), test2a1 = c(64.22,
    29.43, 27.98, 28.17, 46.14, 105.92, 43.68, 16.41, 21.42,
    11.35, 1.66, 44.17, 38.58, 11.11, 48.57, 48.31, 39.71, 92.04,
    52.73, 22.3, 58.23, 82.01, 35.76, 39.59, 94.06, 50.52, 55.82,
    45.91, 115.13, 67.59, 82.97, 49.89, 45.09, 57.86, 86.76,
    58.83, 16.53, 36.7, 100.4), test2a2 = c(60.53, 29.04, 27.04,
    29.14, 43.2, 105.05, 41.66, 13.62, 21.25, 10.39, 2.63, 44.9,
    33.02, 9.75, 46.52, 48.7, 38.25, 90.59, 53.15, 22.57, 59.14,
    81.24, 33.81, 37.55, 95.66, 51.14, 55.69, 44.74, 108.1, 62.71,
    79.18, 50.27, 44.63, 59.39, 84.94, 58.55, 16.16, 35.24, 97.75
    ), testm1 = c(38.724998, 32.77, 32.32, 17.995001, 73.580002,
    80.695, 48.560001, 21.92, 27.245001, 40.93, 31.735001, 60.049999,
    38.044998, 30.165001, 59.07, 26.92, 25.415001, 47.810001,
    63.025002, 34.490002, 104.38, 38.075001, 30.99, 35.235001,
    104.815, 49.330002, 50.025002, 11.65, 143.57001, 48.310001,
    90.370003, 48.555, 41.665001, 75.230003, 60.564999, 39.025002,
    18.16, 37.904999, 84.504997), testm2 = c(62.375, 29.235001,
    27.51, 28.655001, 44.669998, 105.485, 42.669998, 15.015,
    21.334999, 10.87, 2.145, 44.535, 35.799999, 10.43, 47.544998,
    48.505001, 38.98, 91.315002, 52.939999, 22.434999, 58.685001,
    81.625, 34.785, 38.57, 94.860001, 50.830002, 55.755001, 45.325001,
    111.615, 65.150002, 81.074997, 50.080002, 44.860001, 58.625,
    85.849998, 58.689999, 16.344999, 35.970001, 99.074997), tdiff = c(23.650002,
    -3.5349998, -4.8099995, 10.66, -28.910004, 24.790001, -5.8900032,
    -6.9049997, -5.9100018, -30.060001, -29.59, -15.514999, -2.2449989,
    -19.735001, -11.525002, 21.585001, 13.564999, 43.505001,
    -10.085003, -12.055002, -45.694996, 43.549999, 3.7950001,
    3.3349991, -9.9550018, 1.5, 5.7299995, 33.675003, -31.955009,
    16.84, -9.2950058, 1.5250015, 3.1949997, -16.605003, 25.285,
    19.664997, -1.8150005, -1.9349976, 14.57), feelpower = structure(c(2L,
    3L, 1L, 2L, 1L, 2L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 1L, 2L, 1L,
    1L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 4L, 3L,
    4L, 3L, 1L, 3L, 4L, 2L, 2L, 3L), .Label = c("2", "3", "Not at all",
    "Very much"), class = "factor"), incharge = structure(c(1L,
    1L, 3L, 4L, 1L, 2L, 3L, 3L, 1L, 1L, 3L, 4L, 3L, 2L, 2L, 1L,
    3L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L,
    1L, 3L, 1L, 1L, 4L, 3L, 1L, 1L), .Label = c("2", "3", "Not at all",
    "Very much"), class = "factor"), powm = structure(c(3L, 1L,
    1L, 5L, 2L, 4L, 6L, 6L, 1L, 1L, 6L, 7L, 6L, 3L, 4L, 2L, 1L,
    4L, 4L, 3L, 2L, 4L, 2L, 2L, 3L, 3L, 3L, 4L, 1L, 5L, 1L, 4L,
    6L, 2L, 1L, 7L, 2L, 3L, 1L), .Label = c("1.5", "2", "2.5",
    "3", "3.5", "Not at all", "Very much"), class = "factor"),
    diceroll = structure(c(2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L,
    1L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L,
    2L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L
    ), .Label = c("No", "Yes"), class = "factor")), row.names = c(2L,
3L, 4L, 5L, 7L, 8L, 9L, 10L, 12L, 14L, 15L, 16L, 17L, 19L, 20L,
22L, 23L, 24L, 25L, 26L, 27L, 28L, 30L, 31L, 32L, 33L, 34L, 35L,
37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L), class = "data.frame")
</code>```

答:
You can get the same results in R using drop1(FosseTest, test = "F"). This will test the effect of leaving one of the variables off the aov.

```<code>drop1(FosseTest, test = "F")

#
# Single term deletions
#
# Model:
# testm2 ~ testm1 + hptreat + cortm1 + cortm2 + female
#         Df Sum of Sq     RSS    AIC F value    Pr(>F)
# <none>                8463.3 221.82
# testm1   1    3516.7 11979.9 233.37 13.7122 0.0007751 ***
# hptreat  1    1183.5  9646.8 224.92  4.6147 0.0391333 *
# cortm1   1       8.6  8471.8 219.86  0.0334 0.8560279
# cortm2   1    2810.9 11274.2 231.00 10.9604 0.0022605 **
# female   1    2557.3 11020.6 230.11  9.9716 0.0033895 **
# ---
# Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
</code>```

summary(FosseTest) displays the sequential effect of addeding the variables one after another.

There was a different way how to access this, but at the moment I can't remember...

Body:
I have some Stata code and I want to replicate the results in R. However, even with the same dataset and, I think, the same code, I get different results in R from those in Stata. I think it could be because Stata makes the order of the regression different than keyed in.

Do I need exactly the same order as in Stata to get the same results and how can I do this?

I changed all the variables to factors and tried again but the problem is still there.

I noticed that when I change the order of the explanatory variables I get different results, but I don`t find "the right order" to replicate the Stata results.

Stata code:

. anova testm2 c.testm1 i.hptreat c.cortm1 c.cortm2 i.female if inelig == 0 & anyoutv1 == 0

Number of obs =39    R-squared =0.7048
Root MSE= 16.0144    Adj R-squared =0.6601

 Source | Partial SS         df         MS        F    Prob>F
---------------------------------------------------------------
  Model |  20209.281          5   4041.8563     15.76  0.0000
 testm1 |  3516.6527          1   3516.6527     13.71  0.0008
 hptreat|  1183.5007          1   1183.5007      4.61  0.0391
 cortm1 |  8.5753841          1   8.5753841      0.03  0.8560
 cortm2 |  2810.9353          1   2810.9353     10.96  0.0023
 female |  2557.3444          1   2557.3444      9.97  0.0034
Residual|  8463.2532         33   256.46222
----------------------------------------------------------------
  Total |  28672.535         38   754.54038

R code:

FosseTest<-aov(testm2~testm1+hptreat+cortm1+cortm2+female,data=X2data)
summary(FosseTest)

            Df Sum Sq Mean Sq F value   Pr(>F)
testm1       1  15121   15121  58.962 7.68e-09 ***
hptreat      1    524     524   2.043  0.16228
cortm1       1     23      23   0.089  0.76715
cortm2       1   1984    1984   7.735  0.00888 **
female       1   2557    2557   9.972  0.00339 **
Residuals   33   8463     256
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

You can see that I get totally different values in the replication.

in the X2data Set I already subset the values for if inelig == 0 & anyoutv1 == 0

for the reconstruction of the data:

dput(X2data)
structure(list(id = c(29L, 30L, 31L, 32L, 34L, 35L, 36L, 37L,
39L, 41L, 42L, 43L, 44L, 46L, 47L, 49L, 50L, 51L, 52L, 53L, 54L,
55L, 57L, 58L, 59L, 60L, 61L, 62L, 64L, 65L, 66L, 67L, 68L, 69L,
70L, 71L, 72L, 73L, 74L), inelig = structure(c(1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L), .Label = c("Analytic sample (keep)", "Ineligible (drop)"
), class = "factor"), ccydrop = c(0L, 0L, 0L, 0L, 1L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
), cortm1v2 = c(0.003, 0.086, 0.047, 0.106, NA, 0.153, 0.086,
0.005, 0.133, 0.036, 0.03, 0.015, 0.014, 0.111, 0.389, 0.298,
0.4, 0.215, 0.062, 0.021, 0.075, 0.073, 0.033, 0.243, 0.126,
0.147, 0.019, 0.048, 0.28, 0.052, 0.039, 0.105, 0.111, 0.133,
0.065, 0.051, 0.143, 0.127, 0.095), cortm2v2 = c(0.025, 0.167,
0.059, 0.112, 0.171, 0.183, 0.102, 0.018, 0.08, 0.015, 0.027,
0.05, 0.025, 0.046, 0.085, 0.144, 0.155, 0.09, 0.057, 0.023,
0.038, 0.205, 0.035, 0.198, 0.112, 0.211, 0.042, 0.142, 0.328,
0.076, 0.067, 0.094, 0.245, 0.153, 0.115, 0.127, 0.257, 0.125,
0.096), cdiffv2 = c(0.022, 0.081, 0.012, 0.006, NA, 0.03, 0.016,
0.013, -0.053, -0.021, -0.003, 0.035, 0.011, -0.065, -0.304,
-0.154, -0.245, -0.125, -0.005, 0.002, -0.037, 0.132, 0.002,
-0.045, -0.014, 0.064, 0.023, 0.094, 0.048, 0.024, 0.028, -0.011,
0.134, 0.02, 0.05, 0.076, 0.114, -0.002, 0.001), testm1v2 = c(38.72,
32.77, 32.32, 17.99, 73.58, 80.69, 48.56, 21.92, 27.24, 40.93,
31.73, 60.05, 38.04, 30.17, 59.07, 26.92, 25.41, 47.81, 63.02,
34.49, 104.38, 38.08, 30.99, 35.23, 104.81, 49.33, 50.03, 11.65,
143.57, 48.31, 90.37, 48.56, 41.67, 75.23, 60.56, 39.03, 18.16,
37.9, 84.5), testm2v2 = c(62.37, 29.23, 27.51, 28.66, 44.67,
105.48, 42.67, 15.01, 21.33, 10.87, 2.14, 44.53, 35.8, 10.43,
47.54, 48.5, 38.98, 91.32, 52.94, 22.43, 58.68, 81.63, 34.79,
38.57, 94.86, 50.83, 55.75, 45.33, 111.62, 65.15, 81.08, 50.08,
44.86, 58.63, 85.85, 58.69, 16.35, 35.97, 99.08), tdiffv2 = c(23.65,
-3.54, -4.81, 10.67, -28.91, 24.79, -5.89, -6.91, -5.91, -30.06,
-29.59, -15.52, -2.24, -19.74, -11.53, 21.58, 13.57, 43.51, -10.08,
-12.06, -45.7, 43.55, 3.8, 3.34, -9.95, 1.5, 5.72, 33.68, -31.95,
16.84, -9.29000000000001, 1.52, 3.19, -16.6, 25.29, 19.66, -1.81,
-1.93, 14.58), testoutv1 = structure(c(1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L), .Label = c("Not selected", "Selected"), class = "factor"),
    cortoutv1 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
    ), .Label = c("Not selected", "Selected"), class = "factor"),
    anyoutv1 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
    ), .Label = c("Not selected", "Selected"), class = "factor"),
    testoutv2 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
    ), .Label = c("Not selected", "Selected"), class = "factor"),
    cortoutv2 = structure(c(1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
    ), .Label = c("Not selected", "Selected"), class = "factor"),
    anyoutv2 = structure(c(1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
    ), .Label = c("Not selected", "Selected"), class = "factor"),
    pose1rate = c(6L, 7L, 6L, 6L, 7L, 7L, 6L, 7L, 5L, 6L, 7L,
    4L, 7L, 7L, 7L, 6L, 7L, 7L, 7L, 7L, 6L, 7L, 7L, 7L, 7L, 7L,
    7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L), pose2rate = c(6L,
    6L, 5L, 7L, 7L, 7L, 7L, 7L, 6L, 7L, 7L, 7L, 7L, 7L, 7L, 6L,
    6L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 6L, 7L, 6L, 7L, 7L, 7L,
    6L, 7L, 7L, 7L, 7L, 7L, 6L, 6L), poseratem = c(6, 6.5, 5.5,
    6.5, 7, 7, 6.5, 7, 5.5, 6.5, 7, 5.5, 7, 7, 7, 6, 6.5, 7,
    7, 7, 6.5, 7, 7, 7, 7, 6.5, 7, 6.5, 7, 7, 7, 6.5, 7, 7, 7,
    7, 7, 6.5, 6.5), saldiff = c(24.30555556, 20.83333333, 29.16666667,
    18.75, 23.61111111, 34.02777778, 18.05555556, 19.44444444,
    21.52777778, 15.97222222, 22.91666667, 13.88888889, 22.22222222,
    25, 22.22222222, 22.22222222, 18.05555556, 17.36111111, 22.22222222,
    27.08333333, 20.83333333, 24.30555556, 22.22222222, 28.47222222,
    24.30555556, 25, 27.77777778, 22.22222222, 15.97222222, 24.30555556,
    21.52777778, 19.44444444, 15.97222222, 15.27777778, 15.97222222,
    24.30555556, 19.44444444, 24.30555556, 15.27777778), sal2manip = c(19.80555556,
    16.33333333, 24.66666667, 14.25, 19.11111111, 29.52777778,
    13.55555556, 14.94444444, 17.02777778, 11.47222222, 18.41666667,
    9.38888889, 17.72222222, 20.5, 17.72222222, 17.72222222,
    13.55555556, 12.86111111, 17.72222222, 22.58333333, 16.33333333,
    19.80555556, 17.72222222, 23.97222222, 19.80555556, 20.5,
    23.27777778, 17.72222222, 11.47222222, 19.80555556, 17.02777778,
    14.94444444, 11.47222222, 10.77777778, 11.47222222, 19.80555556,
    14.94444444, 19.80555556, 10.77777778), hptreat = structure(c(2L,
    1L, 2L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 2L,
    1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 1L,
    2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L), .Label = c("0", "1"), class = "factor"),
    female = structure(c(1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
    2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L,
    1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 1L
    ), .Label = c("0", "1"), class = "factor"), age = c(19L,
    20L, 20L, 18L, 21L, 20L, 18L, 21L, 35L, 20L, 18L, 20L, 20L,
    18L, 20L, 25L, 18L, 23L, 21L, 19L, 20L, 20L, 30L, 19L, 22L,
    18L, 19L, 22L, 19L, 20L, 28L, 28L, 19L, 19L, 20L, 25L, 20L,
    25L, 23L), cort1a1 = c(0.004, 0.085, 0.049, 0.107, 0.486,
    0.159, 0.088, 0.004, 0.138, 0.035, 0.03, 0.018, 0.017, 0.111,
    0.39, 0.292, 0.396, 0.213, 0.065, 0.022, 0.074, 0.077, 0.035,
    0.241, 0.126, 0.154, 0.021, 0.05, 0.296, 0.054, 0.04, 0.109,
    0.114, 0.133, 0.063, 0.055, 0.149, 0.134, 0.098), cort1a2 = c(0.001,
    0.086, 0.045, 0.105, 0.482, 0.147, 0.085, 0.005, 0.127, 0.037,
    0.031, 0.013, 0.011, 0.111, 0.389, 0.304, 0.405, 0.218, 0.059,
    0.02, 0.076, 0.069, 0.032, 0.246, 0.126, 0.141, 0.017, 0.046,
    0.264, 0.051, 0.038, 0.101, 0.109, 0.133, 0.068, 0.048, 0.137,
    0.12, 0.092), cort2a1 = c(0.027, 0.174, 0.056, 0.111, 0.175,
    0.179, 0.103, 0.021, 0.079, 0.014, 0.028, 0.051, 0.024, 0.051,
    0.083, 0.148, 0.156, 0.086, 0.062, 0.024, 0.038, 0.209, 0.036,
    0.199, 0.114, 0.207, 0.041, 0.141, 0.333, 0.078, 0.065, 0.088,
    0.238, 0.157, 0.119, 0.132, 0.268, 0.132, 0.099), cort2a2 = c(0.023,
    0.161, 0.062, 0.113, 0.166, 0.188, 0.101, 0.016, 0.081, 0.015,
    0.026, 0.049, 0.026, 0.041, 0.086, 0.139, 0.154, 0.093, 0.052,
    0.022, 0.038, 0.202, 0.034, 0.198, 0.111, 0.215, 0.042, 0.142,
    0.324, 0.075, 0.068, 0.101, 0.252, 0.149, 0.111, 0.123, 0.247,
    0.118, 0.093), cortm1 = c(0.0024999999, 0.085500002, 0.046999998,
    0.106, 0.484, 0.153, 0.086499996, 0.0044999998, 0.13249999,
    0.035999998, 0.0305, 0.0155, 0.014, 0.111, 0.38949999, 0.29800001,
    0.4005, 0.2155, 0.061999999, 0.021, 0.075000003, 0.072999999,
    0.033500001, 0.24349999, 0.126, 0.14749999, 0.018999999,
    0.048, 0.28, 0.052499998, 0.039000001, 0.105, 0.1115, 0.133,
    0.065499999, 0.0515, 0.14300001, 0.127, 0.094999999), cortm2 = c(0.025,
    0.1675, 0.059, 0.112, 0.1705, 0.18350001, 0.102, 0.0185,
    0.079999998, 0.0145, 0.027000001, 0.050000001, 0.025, 0.046,
    0.0845, 0.1435, 0.155, 0.089500003, 0.057, 0.023, 0.037999999,
    0.20550001, 0.035, 0.19850001, 0.1125, 0.211, 0.041499998,
    0.1415, 0.3285, 0.076499999, 0.066500001, 0.094499998, 0.245,
    0.153, 0.115, 0.1275, 0.25749999, 0.125, 0.096000001), cdiff = c(0.022500001,
    0.082000002, 0.012000002, 0.0060000047, -0.31349999, 0.03050001,
    0.015500002, 0.014, -0.052499995, -0.021499999, -0.0034999996,
    0.034500003, 0.011, -0.064999998, -0.30500001, -0.15450001,
    -0.2455, -0.12599999, -0.004999999, 0.0020000003, -0.037000004,
    0.13250001, 0.0014999993, -0.044999987, -0.013500005, 0.063500002,
    0.022499999, 0.093499996, 0.048500001, 0.024, 0.0275, -0.010499999,
    0.13350001, 0.019999996, 0.049500003, 0.075999998, 0.11449999,
    -0.0020000041, 0.001000002), test1a1 = c(39.87, 33.22, 32.52,
    19.74, 78.85, 83.51, 48.37, 22.31, 28.17, 41.44, 32.92, 61.4,
    40.31, 30.36, 59.44, 27.52, 26.14, 46.75, 63.73, 34.03, 98.47,
    36.62, 30.26, 37.15, 105.64, 47.99, 50.15, 11.33, 149.12,
    48.57, 92.04, 51.22, 42.25, 77.07, 62.75, 38.8, 17.91, 40.28,
    88.47), test1a2 = c(37.58, 32.32, 32.12, 16.25, 68.31, 77.88,
    48.75, 21.53, 26.32, 40.42, 30.55, 58.7, 35.78, 29.97, 58.7,
    26.32, 24.69, 48.87, 62.32, 34.95, 110.29, 39.53, 31.72,
    33.32, 103.99, 50.67, 49.9, 11.97, 138.02, 48.05, 88.7, 45.89,
    41.08, 73.39, 58.38, 39.25, 18.41, 35.53, 80.54), test2a1 = c(64.22,
    29.43, 27.98, 28.17, 46.14, 105.92, 43.68, 16.41, 21.42,
    11.35, 1.66, 44.17, 38.58, 11.11, 48.57, 48.31, 39.71, 92.04,
    52.73, 22.3, 58.23, 82.01, 35.76, 39.59, 94.06, 50.52, 55.82,
    45.91, 115.13, 67.59, 82.97, 49.89, 45.09, 57.86, 86.76,
    58.83, 16.53, 36.7, 100.4), test2a2 = c(60.53, 29.04, 27.04,
    29.14, 43.2, 105.05, 41.66, 13.62, 21.25, 10.39, 2.63, 44.9,
    33.02, 9.75, 46.52, 48.7, 38.25, 90.59, 53.15, 22.57, 59.14,
    81.24, 33.81, 37.55, 95.66, 51.14, 55.69, 44.74, 108.1, 62.71,
    79.18, 50.27, 44.63, 59.39, 84.94, 58.55, 16.16, 35.24, 97.75
    ), testm1 = c(38.724998, 32.77, 32.32, 17.995001, 73.580002,
    80.695, 48.560001, 21.92, 27.245001, 40.93, 31.735001, 60.049999,
    38.044998, 30.165001, 59.07, 26.92, 25.415001, 47.810001,
    63.025002, 34.490002, 104.38, 38.075001, 30.99, 35.235001,
    104.815, 49.330002, 50.025002, 11.65, 143.57001, 48.310001,
    90.370003, 48.555, 41.665001, 75.230003, 60.564999, 39.025002,
    18.16, 37.904999, 84.504997), testm2 = c(62.375, 29.235001,
    27.51, 28.655001, 44.669998, 105.485, 42.669998, 15.015,
    21.334999, 10.87, 2.145, 44.535, 35.799999, 10.43, 47.544998,
    48.505001, 38.98, 91.315002, 52.939999, 22.434999, 58.685001,
    81.625, 34.785, 38.57, 94.860001, 50.830002, 55.755001, 45.325001,
    111.615, 65.150002, 81.074997, 50.080002, 44.860001, 58.625,
    85.849998, 58.689999, 16.344999, 35.970001, 99.074997), tdiff = c(23.650002,
    -3.5349998, -4.8099995, 10.66, -28.910004, 24.790001, -5.8900032,
    -6.9049997, -5.9100018, -30.060001, -29.59, -15.514999, -2.2449989,
    -19.735001, -11.525002, 21.585001, 13.564999, 43.505001,
    -10.085003, -12.055002, -45.694996, 43.549999, 3.7950001,
    3.3349991, -9.9550018, 1.5, 5.7299995, 33.675003, -31.955009,
    16.84, -9.2950058, 1.5250015, 3.1949997, -16.605003, 25.285,
    19.664997, -1.8150005, -1.9349976, 14.57), feelpower = structure(c(2L,
    3L, 1L, 2L, 1L, 2L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 1L, 2L, 1L,
    1L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 4L, 3L,
    4L, 3L, 1L, 3L, 4L, 2L, 2L, 3L), .Label = c("2", "3", "Not at all",
    "Very much"), class = "factor"), incharge = structure(c(1L,
    1L, 3L, 4L, 1L, 2L, 3L, 3L, 1L, 1L, 3L, 4L, 3L, 2L, 2L, 1L,
    3L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L,
    1L, 3L, 1L, 1L, 4L, 3L, 1L, 1L), .Label = c("2", "3", "Not at all",
    "Very much"), class = "factor"), powm = structure(c(3L, 1L,
    1L, 5L, 2L, 4L, 6L, 6L, 1L, 1L, 6L, 7L, 6L, 3L, 4L, 2L, 1L,
    4L, 4L, 3L, 2L, 4L, 2L, 2L, 3L, 3L, 3L, 4L, 1L, 5L, 1L, 4L,
    6L, 2L, 1L, 7L, 2L, 3L, 1L), .Label = c("1.5", "2", "2.5",
    "3", "3.5", "Not at all", "Very much"), class = "factor"),
    diceroll = structure(c(2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L,
    1L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L,
    2L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L
    ), .Label = c("No", "Yes"), class = "factor")), row.names = c(2L,
3L, 4L, 5L, 7L, 8L, 9L, 10L, 12L, 14L, 15L, 16L, 17L, 19L, 20L,
22L, 23L, 24L, 25L, 26L, 27L, 28L, 30L, 31L, 32L, 33L, 34L, 35L,
37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L), class = "data.frame")

Body:
You can get the same results in R using drop1(FosseTest, test = "F"). This will test the effect of leaving one of the variables off the aov.

drop1(FosseTest, test = "F")

#
# Single term deletions
#
# Model:
# testm2 ~ testm1 + hptreat + cortm1 + cortm2 + female
#         Df Sum of Sq     RSS    AIC F value    Pr(>F)
# <none>                8463.3 221.82
# testm1   1    3516.7 11979.9 233.37 13.7122 0.0007751 ***
# hptreat  1    1183.5  9646.8 224.92  4.6147 0.0391333 *
# cortm1   1       8.6  8471.8 219.86  0.0334 0.8560279
# cortm2   1    2810.9 11274.2 231.00 10.9604 0.0022605 **
# female   1    2557.3 11020.6 230.11  9.9716 0.0033895 **
# ---
# Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

summary(FosseTest) displays the sequential effect of addeding the variables one after another.

There was a different way how to access this, but at the moment I can't remember...


问:
Access objects property in component
I'm trying to access email property of user object

```<code>{"name":"test", "email":"test@test.x"}
</code>```

like this:

```<code><input type="text" :placeholder="user.email">
</code>```

When I try to access property in console -> console.log(user.email) everything work's just fine

component code ->

```<code><template>
<div>
    <form method="POST" action="smth.php">
        <input type="text" :placeholder="user.email">
    </form>
</div>
</template>

<script>
export default {
    props: {
        user: {
            type: Object,
            required: true
        }
    },
}
</script>
</code>```

Component call ->

```<code><div class="container">
    <page-profile :user="{{ $user->toJson() }}"></page-profile>
</div>
</code>```

Could you please show me the right way how to access the email property of user object?

Both console and npm watch show no errors.

答:
The issue is with this code:

    <page-profile :user="{{ $user->toJson() }}"></page-profile>

```

<p>You don't need those curly braces in a property definition. Those are only required in the content of a tag and not an attribute.</p>

<p>I'm also not sure what the <code>-></code> arrow is supposed to be doing. Is that from PHP?</p>

<p>You probably want something more like the following:</p>

<pre class="lang-html prettyprint-override"><code><div class="container">
    <page-profile :user="$user.toJson()"></page-profile>
</div>
</code>```

Title: Access objects property in component

Body:
I'm trying to access email property of user object

{"name":"test", "email":"test@test.x"}

like this:

<input type="text" :placeholder="user.email">

When I try to access property in console -> console.log(user.email) everything work's just fine

component code ->

<template>

    <form method="POST" action="smth.php">
        <input type="text" :placeholder="user.email">
    </form>

</template>

Component call ->

    <page-profile :user="{{ $user->toJson() }}"></page-profile>

Could you please show me the right way how to access the email property of user object?

Both console and npm watch show no errors.

Body:
The issue is with this code:

<div class="container">
    <page-profile :user="{{ $user->toJson() }}"></page-profile>
</div>

You don't need those curly braces in a property definition. Those are only required in the content of a tag and not an attribute.

I'm also not sure what the -> arrow is supposed to be doing. Is that from PHP?

You probably want something more like the following:

<div class="container">
    <page-profile :user="$user.toJson()"></page-profile>
</div>


问:
Need to apply class based on the condition in the header of the table
I need to implement a specific class on the td based on if else condition. If you see my code I am looping through th and td elements.  I need to either blank the text in the th or set the color to white if the th class name equals Legal Class ID so that header text is not visible. I have created a class called cellbgcolor. I need to apply only if the header text is  Legal Class ID for all others it should apply class tableItem bold. How do I do that. I have shared the html and jsfiddle below

html

```<code>  <style>
      .cellbgcolor {
        color: white;
    }
   </style>

    <div *ngIf="LegalFundClasses && LegalFundClasses.LegalFundClassDetailsViewModel && ColumnNames">
         <table class="fundClassesTable table-striped">
          <tr *ngFor="let c of ColumnNames">
            <th class="tableItem bold">{{ c }}</th>
            <ng-container *ngFor="let f of LegalFundClasses.LegalFundClassDetailsViewModel; let i=index">
              <td class="tableItem" *ngIf="c == ColumnNames[0]">{{f.Description}}</td>
              <td class="tableItem" *ngIf="c == ColumnNames[1]">{{f.AuditSummary}}</td>
              <td class="tableItem" *ngIf="c == ColumnNames[2]">{{f.Id}}</td
            </ng-container>
          </tr>
        </table>
      </div>

 Component

  public ColumnNames: string[] = ['Legal Class Name',
                                    'Last Edited',
                                    'Legal Class ID'
                                  ];
</code>```

Here is the JSFiddle

https://jsfiddle.net/zyk9xhd1/2/

答:
try something like this:

```<code><td [class.tableItem]="booleanCondition" [class.cellbgcolor]="booleanCondition">...</td>
</code>```

or

```<code><td [class]="booleanCondition ? 'tableItem' : 'cellbgcolor'">...</td>
</code>```

Body:
I need to implement a specific class on the td based on if else condition. If you see my code I am looping through th and td elements.  I need to either blank the text in the th or set the color to white if the th class name equals Legal Class ID so that header text is not visible. I have created a class called cellbgcolor. I need to apply only if the header text is  Legal Class ID for all others it should apply class tableItem bold. How do I do that. I have shared the html and jsfiddle below

html

            {{ c }}
            <ng-container *ngFor="let f of LegalFundClasses.LegalFundClassDetailsViewModel; let i=index">
              {{f.Description}}
              {{f.AuditSummary}}
              {{f.Id}}</td
            </ng-container>

 Component

  public ColumnNames: string[] = ['Legal Class Name',
                                    'Last Edited',
                                    'Legal Class ID'
                                  ];

Here is the JSFiddle

https://jsfiddle.net/zyk9xhd1/2/

Body:
try something like this:

<td [class.tableItem]="booleanCondition" [class.cellbgcolor]="booleanCondition">...</td>

or

<td [class]="booleanCondition ? 'tableItem' : 'cellbgcolor'">...</td>


问:
HikariCP shutdown initally
First of all, I am not a Java developer. However, I have a service developed in Java and working as expected until today. Our database server get a disk error so we return VMVare backup.

My services which are in different machines doesn't working(or seeming working but not) as expected.

Last Java code developed more than one years ago. So any config has changed. I getting that log and I am squeezed.

Java version: 1.8.0_151

Microsoft SQL Server: 2012 Enterprise Edition

```<code>DEBUG 28/05/2019 12:26:55 [main] [] [] [] Checking 0 named HQL queries
DEBUG 28/05/2019 12:26:55 [main] [] [] [] Checking 0 named SQL queries
DEBUG 28/05/2019 12:26:55 [main] [] [] [] Initializing SessionFactoryRegistry : org.hibernate.internal.SessionFactoryRegistry@3f06ebe0
DEBUG 28/05/2019 12:26:55 [main] [] [] [] Registering SessionFactory: aa73b978-22f9-4309-b9f3-e07d951dbd50 ()
DEBUG 28/05/2019 12:26:55 [main] [] [] [] Not binding SessionFactory to JNDI, no JNDI name configured
INFO  28/05/2019 12:26:56 [main] [] [] [] BatchDML Bean afterPropertiesSet
INFO  28/05/2019 12:26:56 [main] [] [] [] HazelcastCache is initiated amr_common
INFO  28/05/2019 12:26:56 [main] [] [] [] HazelcastCache initializing in afterPropertiesSet.
DEBUG 28/05/2019 12:27:21 [springHikariCP housekeeper] [] [] [] springHikariCP - Before cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:27:21 [springHikariCP housekeeper] [] [] [] springHikariCP - After cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:27:51 [springHikariCP housekeeper] [] [] [] springHikariCP - Before cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:27:51 [springHikariCP housekeeper] [] [] [] springHikariCP - After cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:28:21 [springHikariCP housekeeper] [] [] [] springHikariCP - Before cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:28:21 [springHikariCP housekeeper] [] [] [] springHikariCP - After cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:28:51 [springHikariCP housekeeper] [] [] [] springHikariCP - Before cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:28:51 [springHikariCP housekeeper] [] [] [] springHikariCP - After cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:28:58 [main] [] [] [] HHH000031: Closing
TRACE 28/05/2019 12:28:58 [main] [] [] [] Cleaning QueryPlan Cache
TRACE 28/05/2019 12:28:58 [main] [] [] [] Registering external cascade style [persist : STYLE_PERSIST]
DEBUG 28/05/2019 12:28:58 [main] [] [] [] External cascade style regsitration [persist : STYLE_PERSIST] overrode base registration [STYLE_PERSIST_SKIPLAZY]
DEBUG 28/05/2019 12:28:58 [main] [] [] [] Implicitly destroying ServiceRegistry on de-registration of all child ServiceRegistries
DEBUG 28/05/2019 12:28:58 [main] [] [] [] Implicitly destroying Boot-strap registry on de-registration of all child ServiceRegistries
INFO  28/05/2019 12:28:58 [main] [] [] [] springHikariCP - Shutdown initiated...
DEBUG 28/05/2019 12:28:58 [main] [] [] [] springHikariCP - Before shutdown stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:28:58 [springHikariCP connection closer] [] [] [] springHikariCP - Closing connection net.sourceforge.jtds.jdbc.ConnectionJDBC3@4a1c0752: (connection evicted)
DEBUG 28/05/2019 12:28:58 [springHikariCP connection closer] [] [] [] springHikariCP - Closing connection net.sourceforge.jtds.jdbc.ConnectionJDBC3@6c2336cd: (connection evicted)
DEBUG 28/05/2019 12:28:58 [springHikariCP connection closer] [] [] [] springHikariCP - Closing connection net.sourceforge.jtds.jdbc.ConnectionJDBC3@62e4d539: (connection evicted)
DEBUG 28/05/2019 12:28:58 [springHikariCP connection closer] [] [] [] springHikariCP - Closing connection net.sourceforge.jtds.jdbc.ConnectionJDBC3@66db5dbd: (connection evicted)
DEBUG 28/05/2019 12:28:58 [springHikariCP connection closer] [] [] [] springHikariCP - Closing connection net.sourceforge.jtds.jdbc.ConnectionJDBC3@23d9df02: (connection evicted)
DEBUG 28/05/2019 12:28:58 [main] [] [] [] springHikariCP - After shutdown stats (total=0, active=0, idle=0, waiting=0)
INFO  28/05/2019 12:28:58 [main] [] [] [] springHikariCP - Shutdown completed.
</code>```

答:
There is no error here, at least not in the sense of Hikari. What the log is saying is that your spring based application is shutting down, this is visible here:

```<code>DEBUG 28/05/2019 12:28:58 [main] [] [] [] HHH000031: Closing

DEBUG 28/05/2019 12:28:58 [main] [] [] [] Implicitly destroying Boot-strap registry on de-registration of all child ServiceRegistries
</code>```

Spring is shutting down all beans in its application context. And as a side effect of this you also get a shutdown command on your connection pool. But it is not just the connection pool. It is everything.

From what I can see in the log before the shutdown of spring services is initiated, your hibernate session was closed. This is visible in the previous line in your log.

You need to figure out why your spring application is shutting down and why your hibernate session was closed, the Hikari shutdown is just a side effect.

Title: HikariCP shutdown initally

Body:
First of all, I am not a Java developer. However, I have a service developed in Java and working as expected until today. Our database server get a disk error so we return VMVare backup.

My services which are in different machines doesn't working(or seeming working but not) as expected.

Last Java code developed more than one years ago. So any config has changed. I getting that log and I am squeezed.

Java version: 1.8.0_151

Microsoft SQL Server: 2012 Enterprise Edition

DEBUG 28/05/2019 12:26:55 [main] [] [] [] Checking 0 named HQL queries
DEBUG 28/05/2019 12:26:55 [main] [] [] [] Checking 0 named SQL queries
DEBUG 28/05/2019 12:26:55 [main] [] [] [] Initializing SessionFactoryRegistry : org.hibernate.internal.SessionFactoryRegistry@3f06ebe0
DEBUG 28/05/2019 12:26:55 [main] [] [] [] Registering SessionFactory: aa73b978-22f9-4309-b9f3-e07d951dbd50 ()
DEBUG 28/05/2019 12:26:55 [main] [] [] [] Not binding SessionFactory to JNDI, no JNDI name configured
INFO  28/05/2019 12:26:56 [main] [] [] [] BatchDML Bean afterPropertiesSet
INFO  28/05/2019 12:26:56 [main] [] [] [] HazelcastCache is initiated amr_common
INFO  28/05/2019 12:26:56 [main] [] [] [] HazelcastCache initializing in afterPropertiesSet.
DEBUG 28/05/2019 12:27:21 [springHikariCP housekeeper] [] [] [] springHikariCP - Before cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:27:21 [springHikariCP housekeeper] [] [] [] springHikariCP - After cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:27:51 [springHikariCP housekeeper] [] [] [] springHikariCP - Before cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:27:51 [springHikariCP housekeeper] [] [] [] springHikariCP - After cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:28:21 [springHikariCP housekeeper] [] [] [] springHikariCP - Before cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:28:21 [springHikariCP housekeeper] [] [] [] springHikariCP - After cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:28:51 [springHikariCP housekeeper] [] [] [] springHikariCP - Before cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:28:51 [springHikariCP housekeeper] [] [] [] springHikariCP - After cleanup stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:28:58 [main] [] [] [] HHH000031: Closing
TRACE 28/05/2019 12:28:58 [main] [] [] [] Cleaning QueryPlan Cache
TRACE 28/05/2019 12:28:58 [main] [] [] [] Registering external cascade style [persist : STYLE_PERSIST]
DEBUG 28/05/2019 12:28:58 [main] [] [] [] External cascade style regsitration [persist : STYLE_PERSIST] overrode base registration [STYLE_PERSIST_SKIPLAZY]
DEBUG 28/05/2019 12:28:58 [main] [] [] [] Implicitly destroying ServiceRegistry on de-registration of all child ServiceRegistries
DEBUG 28/05/2019 12:28:58 [main] [] [] [] Implicitly destroying Boot-strap registry on de-registration of all child ServiceRegistries
INFO  28/05/2019 12:28:58 [main] [] [] [] springHikariCP - Shutdown initiated...
DEBUG 28/05/2019 12:28:58 [main] [] [] [] springHikariCP - Before shutdown stats (total=5, active=0, idle=5, waiting=0)
DEBUG 28/05/2019 12:28:58 [springHikariCP connection closer] [] [] [] springHikariCP - Closing connection net.sourceforge.jtds.jdbc.ConnectionJDBC3@4a1c0752: (connection evicted)
DEBUG 28/05/2019 12:28:58 [springHikariCP connection closer] [] [] [] springHikariCP - Closing connection net.sourceforge.jtds.jdbc.ConnectionJDBC3@6c2336cd: (connection evicted)
DEBUG 28/05/2019 12:28:58 [springHikariCP connection closer] [] [] [] springHikariCP - Closing connection net.sourceforge.jtds.jdbc.ConnectionJDBC3@62e4d539: (connection evicted)
DEBUG 28/05/2019 12:28:58 [springHikariCP connection closer] [] [] [] springHikariCP - Closing connection net.sourceforge.jtds.jdbc.ConnectionJDBC3@66db5dbd: (connection evicted)
DEBUG 28/05/2019 12:28:58 [springHikariCP connection closer] [] [] [] springHikariCP - Closing connection net.sourceforge.jtds.jdbc.ConnectionJDBC3@23d9df02: (connection evicted)
DEBUG 28/05/2019 12:28:58 [main] [] [] [] springHikariCP - After shutdown stats (total=0, active=0, idle=0, waiting=0)
INFO  28/05/2019 12:28:58 [main] [] [] [] springHikariCP - Shutdown completed.

Body:
There is no error here, at least not in the sense of Hikari. What the log is saying is that your spring based application is shutting down, this is visible here:

DEBUG 28/05/2019 12:28:58 [main] [] [] [] HHH000031: Closing

DEBUG 28/05/2019 12:28:58 [main] [] [] [] Implicitly destroying Boot-strap registry on de-registration of all child ServiceRegistries

Spring is shutting down all beans in its application context. And as a side effect of this you also get a shutdown command on your connection pool. But it is not just the connection pool. It is everything.

From what I can see in the log before the shutdown of spring services is initiated, your hibernate session was closed. This is visible in the previous line in your log.

You need to figure out why your spring application is shutting down and why your hibernate session was closed, the Hikari shutdown is just a side effect.


问:
Count expression SSRS Report
Trying to count all rows in a column where column=Yes
I have two columns in my report Accepted and rejected.

I'm trying to count the rows where accepted=Yes and do the say thing for rejected.

I've tried these:

```<code>=COUNT(IIF(Fields!accepted.Value="Y",1,0))
=COUNT(IIF(Fields!rejected.Value="Y",1,0))
=COUNT(FIELDS!accepted.value="Y")
=COUNT(FIELDS!rejected.value="Y")
</code>```

this expression is counting every row as opposed to just the ones that are "Y"

答:
You can try to use "And" Operators to check both conditions together.</p>

```<code>=COUNT(IIF(Fields!accepted.Value ="Y" And Fields!rejected.value="Y",1,0))
</code>```

ContentLicense: CC BY-SA 3.0

Title: Count expression SSRS Report

Body:
Trying to count all rows in a column where column=Yes
I have two columns in my report Accepted and rejected.

I'm trying to count the rows where accepted=Yes and do the say thing for rejected.

I've tried these:

=COUNT(IIF(Fields!accepted.Value="Y",1,0))
=COUNT(IIF(Fields!rejected.Value="Y",1,0))
=COUNT(FIELDS!accepted.value="Y")
=COUNT(FIELDS!rejected.value="Y")

this expression is counting every row as opposed to just the ones that are "Y"

Body:
You can try to use "And" Operators to check both conditions together.

=COUNT(IIF(Fields!accepted.Value ="Y" And Fields!rejected.value="Y",1,0))


问:
How to get the base url in jsp?
Im creating a simple project by using jsp and servlet. I want to link the css in my jsp file. So any one can tell me the way to do this??</p>

答:
Try:

```<code><c:url var="baseUri" value="/" />
</code>```

Note that this will give you a relative url to the context.

Title: How to get the base url in jsp?

Body:
Try:

<c:url var="baseUri" value="/" />

Note that this will give you a relative url to the context.