问:
Spring boot integration test fails with Neo4j
I am new to spring boot. I use Spring Boot 1.5.1 GA and Neo4j starter of spring boot. I tried to create my very first integration test to whether I can insert a new object into the graph database.
Here is my test class:

```<code>package hu.bookandwalk;
import static org.junit.Assert.assertEquals;
import java.time.LocalDateTime;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.neo4j.ogm.testutil.TestServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import hu.bookandwalk.domain.Address;
import hu.bookandwalk.domain.InvoiceData;
import hu.bookandwalk.domain.User;
import hu.bookandwalk.repository.UserRepository;
import java.util.HashSet;
import java.util.Set;

@ContextConfiguration(classes = {PersistenceTestContext.class})
@RunWith(SpringRunner.class)
@SpringBootTest
public class BnWEbookstoreApplicationTests {

    private static TestServer testServer;

    @Autowired
    UserRepository userRepository;

    @BeforeClass
    public static void setupTestServer() {
        /* just a port without any intention */
        testServer = new TestServer.Builder().build();
    }

    @AfterClass
    public static void stopTestServer() {
       testServer.shutdown();
    }

    @Test
    public void ShouldInsertUser() {
        Address a=new Address("Hungary","Budapest","1092","Erkel street 9",LocalDateTime.now());
        InvoiceData invoiceData=new InvoiceData("BandW", "233456", true, a, LocalDateTime.now());

        Set<InvoiceData> invoiceDatas=new HashSet<InvoiceData>();
        invoiceDatas.add(invoiceData);
        Set<Address> addresses=null;

        User u=new User(1l,"Roland","email@gmail.com","pwd",true,LocalDateTime.now(), true,invoiceDatas,addresses);
        userRepository.save(u);
        assertEquals(1l, userRepository.count());
    }
</code>```

The PersistentTestContext is used specifically to the test of database operations. In this class I set the embedded driver for testing:

```<code>package hu.bookandwalk;

import org.neo4j.ogm.drivers.embedded.driver.EmbeddedDriver;
import org.neo4j.ogm.session.SessionFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
import org.springframework.data.neo4j.transaction.Neo4jTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@EnableNeo4jRepositories("org.neo4j.cineasts.repository")
@EnableTransactionManagement
@ComponentScan("hu.bookandwalk")
public class PersistenceTestContext {
    @Bean
    public org.neo4j.ogm.config.Configuration configuration() {
        final org.neo4j.ogm.config.Configuration configuration = new org.neo4j.ogm.config.Configuration();
        configuration.driverConfiguration().setDriverClassName(EmbeddedDriver.class.getName());
        return configuration;
    }
@Bean
public SessionFactory sessionFactory() {
    return new SessionFactory(configuration(), "hu.bookandwalk.domain");
}

@Bean
public PlatformTransactionManager transactionManager() {
    return new Neo4jTransactionManager(sessionFactory());
}
</code>```

}

Unfortunately, when I run my test from my STS IDE, I got the following error message before even the test can be validated:

```<code>java.lang.NoClassDefFoundError: org/eclipse/jetty/server/SessionManager
    at org.neo4j.server.CommunityNeoServer.createWebServer(CommunityNeoServer.java:89)
    at org.neo4j.server.AbstractNeoServer.init(AbstractNeoServer.java:181)
    at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:196)
    at org.neo4j.harness.internal.InProcessServerControls.start(InProcessServerControls.java:72)
    at org.neo4j.harness.internal.AbstractInProcessServerBuilder.newServer(AbstractInProcessServerBuilder.java:137)
    at org.neo4j.ogm.testutil.TestServer.startServer(TestServer.java:73)
    at org.neo4j.ogm.testutil.TestServer.<init>(TestServer.java:55)
    at org.neo4j.ogm.testutil.TestServer.<init>(TestServer.java:37)
    at org.neo4j.ogm.testutil.TestServer$Builder.build(TestServer.java:239)
    at hu.bookandwalk.BnWEbookstoreApplicationTests.setupTestServer(BnWEbookstoreApplicationTests.java:36)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.SessionManager
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 29 more

java.lang.NullPointerException
    at hu.bookandwalk.BnWEbookstoreApplicationTests.stopTestServer(BnWEbookstoreApplicationTests.java:41)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
</code>```

When I created my project I used the Spring Starter project template. As far as I remember I did not put any other dependencies into my pom.xml in addition to the ones put by Spring Boot. I only add some properties like for thymeleaf to use version 3 instead of 2. You can see my pom.xml here:

```<code><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>BnWEbookstore</name>
<description>Book and Walk e-book webáruház</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.1.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <thymeleaf.version>3.0.3.RELEASE</thymeleaf.version>
    <thymeleaf-layout-dialect.version>2.1.2</thymeleaf-layout-dialect.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-cache</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-neo4j</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-rest</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-rest-hal-browser</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-hateoas</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-mail</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-mobile</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-social-facebook</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-social-twitter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf-spring4</artifactId>
    </dependency>
    <dependency>
        <groupId>org.thymeleaf.extras</groupId>
        <artifactId>thymeleaf-extras-java8time</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-validation</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-ogm-test</artifactId>
        <version>2.1.1</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

<repositories>
    <repository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </pluginRepository>
    <pluginRepository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>
</code>```

When I check the transitive dependencies I see that neo4j-ogm-test indirectly pull the jetty sever 9.4.1.
Any idea what can cause this problem?

答:
A shortcut to get a valid setup is to install neo4j locally and check the /lib directory to find a good match between the version of neo4j and jetty-server

I got the same error running the "vanilla" installation of spring-data-neo4j. According to the default installation of neo4j I could spot the following compatible versions:

neo4j-* version 3.1.2

org.eclipse.jetty.* version 2.9.2 - spring insists me to use 2.3.*

Spring-boot wants me to run jetty-* 2.3.* which the SessionManager was removed by some reason.

Body:
I am new to spring boot. I use Spring Boot 1.5.1 GA and Neo4j starter of spring boot. I tried to create my very first integration test to whether I can insert a new object into the graph database.
Here is my test class:

package hu.bookandwalk;
import static org.junit.Assert.assertEquals;
import java.time.LocalDateTime;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.neo4j.ogm.testutil.TestServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import hu.bookandwalk.domain.Address;
import hu.bookandwalk.domain.InvoiceData;
import hu.bookandwalk.domain.User;
import hu.bookandwalk.repository.UserRepository;
import java.util.HashSet;
import java.util.Set;

@ContextConfiguration(classes = {PersistenceTestContext.class})
@RunWith(SpringRunner.class)
@SpringBootTest
public class BnWEbookstoreApplicationTests {

    private static TestServer testServer;

    @Autowired
    UserRepository userRepository;

    @BeforeClass
    public static void setupTestServer() {
        /* just a port without any intention */
        testServer = new TestServer.Builder().build();
    }

    @AfterClass
    public static void stopTestServer() {
       testServer.shutdown();
    }

    @Test
    public void ShouldInsertUser() {
        Address a=new Address("Hungary","Budapest","1092","Erkel street 9",LocalDateTime.now());
        InvoiceData invoiceData=new InvoiceData("BandW", "233456", true, a, LocalDateTime.now());

        Set<InvoiceData> invoiceDatas=new HashSet<InvoiceData>();
        invoiceDatas.add(invoiceData);
        Set<Address> addresses=null;

        User u=new User(1l,"Roland","email@gmail.com","pwd",true,LocalDateTime.now(), true,invoiceDatas,addresses);
        userRepository.save(u);
        assertEquals(1l, userRepository.count());
    }

The PersistentTestContext is used specifically to the test of database operations. In this class I set the embedded driver for testing:

package hu.bookandwalk;

import org.neo4j.ogm.drivers.embedded.driver.EmbeddedDriver;
import org.neo4j.ogm.session.SessionFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
import org.springframework.data.neo4j.transaction.Neo4jTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@EnableNeo4jRepositories("org.neo4j.cineasts.repository")
@EnableTransactionManagement
@ComponentScan("hu.bookandwalk")
public class PersistenceTestContext {
    @Bean
    public org.neo4j.ogm.config.Configuration configuration() {
        final org.neo4j.ogm.config.Configuration configuration = new org.neo4j.ogm.config.Configuration();
        configuration.driverConfiguration().setDriverClassName(EmbeddedDriver.class.getName());
        return configuration;
    }
@Bean
public SessionFactory sessionFactory() {
    return new SessionFactory(configuration(), "hu.bookandwalk.domain");
}

@Bean
public PlatformTransactionManager transactionManager() {
    return new Neo4jTransactionManager(sessionFactory());
}

}

Unfortunately, when I run my test from my STS IDE, I got the following error message before even the test can be validated:

java.lang.NoClassDefFoundError: org/eclipse/jetty/server/SessionManager
    at org.neo4j.server.CommunityNeoServer.createWebServer(CommunityNeoServer.java:89)
    at org.neo4j.server.AbstractNeoServer.init(AbstractNeoServer.java:181)
    at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:196)
    at org.neo4j.harness.internal.InProcessServerControls.start(InProcessServerControls.java:72)
    at org.neo4j.harness.internal.AbstractInProcessServerBuilder.newServer(AbstractInProcessServerBuilder.java:137)
    at org.neo4j.ogm.testutil.TestServer.startServer(TestServer.java:73)
    at org.neo4j.ogm.testutil.TestServer.<init>(TestServer.java:55)
    at org.neo4j.ogm.testutil.TestServer.<init>(TestServer.java:37)
    at org.neo4j.ogm.testutil.TestServer$Builder.build(TestServer.java:239)
    at hu.bookandwalk.BnWEbookstoreApplicationTests.setupTestServer(BnWEbookstoreApplicationTests.java:36)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.SessionManager
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 29 more

java.lang.NullPointerException
    at hu.bookandwalk.BnWEbookstoreApplicationTests.stopTestServer(BnWEbookstoreApplicationTests.java:41)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

When I created my project I used the Spring Starter project template. As far as I remember I did not put any other dependencies into my pom.xml in addition to the ones put by Spring Boot. I only add some properties like for thymeleaf to use version 3 instead of 2. You can see my pom.xml here:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>BnWEbookstore</name>
<description>Book and Walk e-book webáruház</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.1.RELEASE</version>
    <relativePath />
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <thymeleaf.version>3.0.3.RELEASE</thymeleaf.version>
    <thymeleaf-layout-dialect.version>2.1.2</thymeleaf-layout-dialect.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-cache</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-neo4j</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-rest</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-rest-hal-browser</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-hateoas</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-mail</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-mobile</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-social-facebook</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-social-twitter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf-spring4</artifactId>
    </dependency>
    <dependency>
        <groupId>org.thymeleaf.extras</groupId>
        <artifactId>thymeleaf-extras-java8time</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-validation</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-ogm-test</artifactId>
        <version>2.1.1</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

<repositories>
    <repository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </pluginRepository>
    <pluginRepository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>

When I check the transitive dependencies I see that neo4j-ogm-test indirectly pull the jetty sever 9.4.1.
Any idea what can cause this problem?


来源: stackexchange

问:
Going back to Main Activity on Android app with back key to see user score
Hopefully I can get some advice on this.

My program has a sprite that, when hit/clicked, a score is tallied on screen.  When the game is over (time runs out), I want the user to be able to press the back key on their phone to go back to the main/start screen/activity where they began the game, but it will also show their score (how many hits).

I'm struggling to figure out how to get it to go back with the back key press.  I can figure out the high score bit at a later date if need be.  I just want to get back to that start screen.

UPDATE:

I think it may have something to do with my manifest as to why it's not working.  I've tried to add the 'GameView' class to the manifest but it won't accept it.  It says it has no default constructor.  Any ideas?

```<code><application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="cct.mad.lab.MainMenu"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".GameActivity"
        android:label="@string/app_name" >
     </activity>
    <activity
        android:name=".GameView"
        android:label="@string/app_name" >
    </activity>
</code>```

My GameView code is below:

```<code>public class GameView extends SurfaceView implements SurfaceHolder.Callback {

/* Member (state) fields   */
private GameLoopThread gameLoopThread;
private Paint paint; //Reference a paint object
/** The drawable to use as the background of the animation canvas */
private Bitmap mBackgroundImage;
// For creating the game Sprite
private Sprite sprite;
// For recording the number of hits
private int hitCount;
// To track if a game is over
private boolean gameOver;
// To play sound
private SoundPlayer sound;

//int backButtonCount = 0;

public GameView(Context context) {
    super(context);
    // Focus must be on GameView so that events can be handled.
    this.setFocusable(true);
    // For intercepting events on the surface.
    this.getHolder().addCallback(this);
    // Background image added
    mBackgroundImage = BitmapFactory.decodeResource(this.getResources(), R.drawable.half_moon);

    //sound = new SoundPlayer(this);

}
 /* Called immediately after the surface created */
public void surfaceCreated(SurfaceHolder holder) {
    // We can now safely setup the game start the game loop.
    ResetGame();//Set up a new game up - could be called by a 'play again option'
    mBackgroundImage = Bitmap.createScaledBitmap(mBackgroundImage, getWidth(), getHeight(), true);
    gameLoopThread = new GameLoopThread(this.getHolder(), this);
    gameLoopThread.running = true;
    gameLoopThread.start();
}

// For the countdown timer
private long startTime; // Timer to count down from
private final long interval = 1 * 1000; // 1 sec interval
private CountDownTimer countDownTimer; // Reference to the class
private boolean timerRunning = false;
private String displayTime; // To display the time on the screen

//To initialise/reset game
private void ResetGame(){
    /* Set paint details */
    paint = new Paint();
    paint.setColor(Color.WHITE);
    paint.setTextSize(20);
    sprite = new Sprite(this);
    hitCount = 0;
    // Set timer
    startTime = 10; // Start at 10s to count down
    // Create new object - convert startTime to milliseconds
    countDownTimer = new MyCountDownTimer(startTime*1000, interval);
    countDownTimer.start(); // Start the time running
    timerRunning = true;
    gameOver = false;

}

// Countdown Timer - private class
private class MyCountDownTimer extends CountDownTimer {

    public MyCountDownTimer (long startTime, long interval) {
        super(startTime, interval);
    }
    public void onFinish() {
        //displayTime = "Time is up!";
        timerRunning = false;
        countDownTimer.cancel();
        gameOver = true;
    }
    public void onTick (long millisUntilFinished) {
        displayTime = " " + millisUntilFinished / 1000;
    }
}

//This class updates and manages the assets prior to drawing - called from the Thread
public void update(){

    sprite.update();

}
/**
 * To draw the game to the screen
 * This is called from Thread, so synchronisation can be done
 */
public void doDraw(Canvas canvas) {
    //Draw all the objects on the canvas
    canvas.drawBitmap(mBackgroundImage, 0, 0, null);

    if (!gameOver) {
        sprite.draw(canvas);
        canvas.drawText("Time Remaining: " + displayTime, 35, 50, paint);
        canvas.drawText("Number of hits: " + hitCount, 250, 50, paint);
    } else
        canvas.drawText("Game Over!", 185, 100, paint);
        canvas.drawText("To go back to the main menu, press the 'back' key", 15, 150, paint);

}

//To be used if we need to find where screen was touched
public boolean onTouchEvent(MotionEvent event) {
        if (sprite.wasItTouched(event.getX(), event.getY())) {
            // This just renews the sprite for now
            sprite = new Sprite(this);
            //sound.playZapSound();
            hitCount++;

        }
    return true;
}

public void surfaceDestroyed(SurfaceHolder holder) {
    gameLoopThread.running = false;

    // Shut down the game loop thread cleanly.
    boolean retry = true;
    while(retry) {
        try {
            gameLoopThread.join();
            retry = false;
        } catch (InterruptedException e) {}
    }
}

public void getHitCount() {

}

public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {

}

}
</code>```

My MainActivity is below:

```<code>public class MainMenu extends Activity {

private static final int SCORE_REQUEST_CODE = 1;// The request code for the intent

TextView tvScore;
String score;
Intent gameIntent;

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.game_start);
}

public void startGame(View v){
    gameIntent = new Intent(this,GameActivity.class);
    startActivityForResult(gameIntent, SCORE_REQUEST_CODE );
}
/* Create Options Menu */
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main_menu, menu);
    return true;
}

// Respond to item selected on OPTIONS MENU
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle item selection
    switch (item.getItemId()) {
    //put data in Intent
    case R.id.easy:
        Toast.makeText(this, "Easy chosen", Toast.LENGTH_SHORT).show();
        return true;
    case R.id.medium:
        Toast.makeText(this, "Medium chosen", Toast.LENGTH_SHORT).show();
        return true;
    case R.id.hard:
        Toast.makeText(this, "Hard chosen", Toast.LENGTH_SHORT).show();
        return true;
    case R.id.other:
        Toast.makeText(this, "Other chosen", Toast.LENGTH_SHORT).show();
        return true;
    default:
        return super.onOptionsItemSelected(item);
    }
}

protected void onActivityResult(int requestCode, int resultCode, Intent retIntent) {
    // Check which request we're responding to
    if (requestCode == SCORE_REQUEST_CODE) {
        // Make sure the request was successful
        if (resultCode == RESULT_OK) {
            if (retIntent.hasExtra("GAME_SCORE")) {
                int scoreFromGame = retIntent.getExtras().getInt("GAME_SCORE");
                tvScore.setText(Integer.toString(scoreFromGame));
            }
        }
    }

}

}
</code>```

As always, any help greatly appreciated.

Thanks

答:
It would appear that my issue with the back button not working was all down to my else statement in the doDraw method not having curly braces around the two statements.  Added those and it works fine.  The surfaceDestroyed method gets called automatically when the back button is pressed as this stops the gameLoopThread class.

Thanks for everyone trying to help me.

ContentLicense: CC BY-SA 3.0

Body:
Hopefully I can get some advice on this.

My program has a sprite that, when hit/clicked, a score is tallied on screen.  When the game is over (time runs out), I want the user to be able to press the back key on their phone to go back to the main/start screen/activity where they began the game, but it will also show their score (how many hits).

I'm struggling to figure out how to get it to go back with the back key press.  I can figure out the high score bit at a later date if need be.  I just want to get back to that start screen.

UPDATE:

I think it may have something to do with my manifest as to why it's not working.  I've tried to add the 'GameView' class to the manifest but it won't accept it.  It says it has no default constructor.  Any ideas?

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="cct.mad.lab.MainMenu"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".GameActivity"
        android:label="@string/app_name" >
     </activity>
    <activity
        android:name=".GameView"
        android:label="@string/app_name" >
    </activity>

My GameView code is below:

public class GameView extends SurfaceView implements SurfaceHolder.Callback {

/* Member (state) fields   */
private GameLoopThread gameLoopThread;
private Paint paint; //Reference a paint object
/** The drawable to use as the background of the animation canvas */
private Bitmap mBackgroundImage;
// For creating the game Sprite
private Sprite sprite;
// For recording the number of hits
private int hitCount;
// To track if a game is over
private boolean gameOver;
// To play sound
private SoundPlayer sound;

//int backButtonCount = 0;

public GameView(Context context) {
    super(context);
    // Focus must be on GameView so that events can be handled.
    this.setFocusable(true);
    // For intercepting events on the surface.
    this.getHolder().addCallback(this);
    // Background image added
    mBackgroundImage = BitmapFactory.decodeResource(this.getResources(), R.drawable.half_moon);

    //sound = new SoundPlayer(this);

}
 /* Called immediately after the surface created */
public void surfaceCreated(SurfaceHolder holder) {
    // We can now safely setup the game start the game loop.
    ResetGame();//Set up a new game up - could be called by a 'play again option'
    mBackgroundImage = Bitmap.createScaledBitmap(mBackgroundImage, getWidth(), getHeight(), true);
    gameLoopThread = new GameLoopThread(this.getHolder(), this);
    gameLoopThread.running = true;
    gameLoopThread.start();
}

// For the countdown timer
private long startTime; // Timer to count down from
private final long interval = 1 * 1000; // 1 sec interval
private CountDownTimer countDownTimer; // Reference to the class
private boolean timerRunning = false;
private String displayTime; // To display the time on the screen

//To initialise/reset game
private void ResetGame(){
    /* Set paint details */
    paint = new Paint();
    paint.setColor(Color.WHITE);
    paint.setTextSize(20);
    sprite = new Sprite(this);
    hitCount = 0;
    // Set timer
    startTime = 10; // Start at 10s to count down
    // Create new object - convert startTime to milliseconds
    countDownTimer = new MyCountDownTimer(startTime*1000, interval);
    countDownTimer.start(); // Start the time running
    timerRunning = true;
    gameOver = false;

}

// Countdown Timer - private class
private class MyCountDownTimer extends CountDownTimer {

    public MyCountDownTimer (long startTime, long interval) {
        super(startTime, interval);
    }
    public void onFinish() {
        //displayTime = "Time is up!";
        timerRunning = false;
        countDownTimer.cancel();
        gameOver = true;
    }
    public void onTick (long millisUntilFinished) {
        displayTime = " " + millisUntilFinished / 1000;
    }
}

//This class updates and manages the assets prior to drawing - called from the Thread
public void update(){

    sprite.update();

}
/**
 * To draw the game to the screen
 * This is called from Thread, so synchronisation can be done
 */
public void doDraw(Canvas canvas) {
    //Draw all the objects on the canvas
    canvas.drawBitmap(mBackgroundImage, 0, 0, null);

    if (!gameOver) {
        sprite.draw(canvas);
        canvas.drawText("Time Remaining: " + displayTime, 35, 50, paint);
        canvas.drawText("Number of hits: " + hitCount, 250, 50, paint);
    } else
        canvas.drawText("Game Over!", 185, 100, paint);
        canvas.drawText("To go back to the main menu, press the 'back' key", 15, 150, paint);

}

//To be used if we need to find where screen was touched
public boolean onTouchEvent(MotionEvent event) {
        if (sprite.wasItTouched(event.getX(), event.getY())) {
            // This just renews the sprite for now
            sprite = new Sprite(this);
            //sound.playZapSound();
            hitCount++;

        }
    return true;
}

public void surfaceDestroyed(SurfaceHolder holder) {
    gameLoopThread.running = false;

    // Shut down the game loop thread cleanly.
    boolean retry = true;
    while(retry) {
        try {
            gameLoopThread.join();
            retry = false;
        } catch (InterruptedException e) {}
    }
}

public void getHitCount() {

}

public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {

}

}

My MainActivity is below:

public class MainMenu extends Activity {

private static final int SCORE_REQUEST_CODE = 1;// The request code for the intent

TextView tvScore;
String score;
Intent gameIntent;

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.game_start);
}

public void startGame(View v){
    gameIntent = new Intent(this,GameActivity.class);
    startActivityForResult(gameIntent, SCORE_REQUEST_CODE );
}
/* Create Options Menu */
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main_menu, menu);
    return true;
}

// Respond to item selected on OPTIONS MENU
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle item selection
    switch (item.getItemId()) {
    //put data in Intent
    case R.id.easy:
        Toast.makeText(this, "Easy chosen", Toast.LENGTH_SHORT).show();
        return true;
    case R.id.medium:
        Toast.makeText(this, "Medium chosen", Toast.LENGTH_SHORT).show();
        return true;
    case R.id.hard:
        Toast.makeText(this, "Hard chosen", Toast.LENGTH_SHORT).show();
        return true;
    case R.id.other:
        Toast.makeText(this, "Other chosen", Toast.LENGTH_SHORT).show();
        return true;
    default:
        return super.onOptionsItemSelected(item);
    }
}

protected void onActivityResult(int requestCode, int resultCode, Intent retIntent) {
    // Check which request we're responding to
    if (requestCode == SCORE_REQUEST_CODE) {
        // Make sure the request was successful
        if (resultCode == RESULT_OK) {
            if (retIntent.hasExtra("GAME_SCORE")) {
                int scoreFromGame = retIntent.getExtras().getInt("GAME_SCORE");
                tvScore.setText(Integer.toString(scoreFromGame));
            }
        }
    }

}

}

As always, any help greatly appreciated.

Thanks


问:
Django-restframework with pandas
I am using django-restframework,pandas,django-pandas to make an api and i am getting the following output

This is the data of a single user and each label represents a column name but I want the output in the following format

can anyone help to get the data in the desired format

My code is

views.py

```<code>@api_view(['GET'])
def my_view(request,id):
    qs = Health.objects.filter(id = id)
    df = read_frame(qs)
    df['x-Mean'] = abs(df['Age'] - df['Age'].mean())
    df['1.96*std'] = 1.96*df['Age'].std()
    df['Outlier'] = abs(df['Age'] - df['Age'].mean()) > 1.96*df['Age'].std()
    df['bmi'] = df['Weight']/(df['Height']/100)**2
    a = df.fillna(0)
    return Response(a)
</code>```

答:
This is happening because a is a pandas.DataFrame and it corresponds to table, so during serialization it tries to represent all data for each table column. DataFrame does not know that you have only one value for each column.
Values have to be extracted manually:

```<code>a = {column: values[0] for column, values in df.fillna(0).to_dict().items(orient='list')}
return Response(a)
</code>```

For more details check http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_dict.html

Title: Django-restframework with pandas

Body:
I am using django-restframework,pandas,django-pandas to make an api and i am getting the following output

This is the data of a single user and each label represents a column name but I want the output in the following format

can anyone help to get the data in the desired format

My code is

views.py

@api_view(['GET'])
def my_view(request,id):
    qs = Health.objects.filter(id = id)
    df = read_frame(qs)
    df['x-Mean'] = abs(df['Age'] - df['Age'].mean())
    df['1.96*std'] = 1.96*df['Age'].std()
    df['Outlier'] = abs(df['Age'] - df['Age'].mean()) > 1.96*df['Age'].std()
    df['bmi'] = df['Weight']/(df['Height']/100)**2
    a = df.fillna(0)
    return Response(a)

Body:
This is happening because a is a pandas.DataFrame and it corresponds to table, so during serialization it tries to represent all data for each table column. DataFrame does not know that you have only one value for each column.
Values have to be extracted manually:

a = {column: values[0] for column, values in df.fillna(0).to_dict().items(orient='list')}
return Response(a)

For more details check http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_dict.html


问:
RadioButtonList not posting back despite autopostback being set to true
I'm having issues trying to get radio button list selected index changes to fire, and although I have no issues with postbacks on any other asp control, radio button lists are giving me trouble.  I'll include my asp code and c# codebehind in the event one of you may be able to discern what's wrong.

I have 8 radio button lists, all within their own update panels that are set to always update, and each radio button list has autopostback set to true.

I have code behind logic changing two asp:labels, one changing the average scores based on the radiobuttonlist selections, and one assigning a risk level depending on the value of the average score.

```<code><table class="td-table-bordered" style="width: 90%">
                    <tr>
                        <th>
                            <asp:Label ID="CategoryLabel" runat="server" Text="Category"></asp:Label>
                        </th>
                        <th>
                            <asp:Label ID="OccurrenceProbabilityLabel" runat="server" Text="Probability of Occurrence"></asp:Label>
                        </th>
                        <th>
                            <asp:Label ID="ProbabilityRatingLabel" runat="server" Text="Rating"></asp:Label><br />
                            <asp:Label ID="ProbabilityRatingLabel2" runat="server" Text="(L/M/H)"></asp:Label>
                        </th>
                        <th>
                            <asp:Label ID="OccurrenceImpactLabel" runat="server" Text="Impact of Occurrence"></asp:Label>
                        </th>
                        <th>
                            <asp:Label ID="ImpactRatingLabel" runat="server" Text="Rating"></asp:Label><br />
                            <asp:Label ID="ImpactRatingLabel2" runat="server" Text="(L/M/H)"></asp:Label>
                        </th>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="BaseDesktopLabel" runat="server" Text="Base Desktop"></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="BaseDesktopProbabilityLabel" runat="server" Text="Based on workspace/RBB assessment, what is the probability that this change could impact function, performance or availability of a base component?"></asp:Label>
                        </td>
                        <td>
                            <asp:UpdatePanel ID="DesktopProbabilityPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="DesktopProbabilityButtonList" runat="server" OnSelectedIndexChanged="DesktopProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>

                        </td>
                        <td>
                            <asp:Label ID="BaseDesktopImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the workstation?"></asp:Label>
                        </td>
                        <td>
                            <asp:UpdatePanel ID="DesktopImpactPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="DesktopImpactButtonList" runat="server" OnSelectedIndexChanged="DesktopImpactButtonList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="ProductivityLayerLabel" runat="server" Text="Productivity Layer"></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="ProductivityLayerProbabilityLabel" runat="server" Text="Based on workspace/RBB engineering assessment, what is the probability that this change could impact function, performance or availability of a productivity application?"></asp:Label>
                        </td>
                        <td>
                            <asp:UpdatePanel ID="ProductivityProbabilityPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="ProductivityProbabilityButtonList" runat="server" OnSelectedIndexChanged="ProductivityProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                        <td>
                            <asp:Label ID="ProductivityLayerImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the productivity application?"></asp:Label>
                        </td>
                        <td>
                            <asp:UpdatePanel ID="ProductivityImpactPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="ProductivityImpactButtonList" runat="server" OnSelectedIndexChanged="ProductivityImpactButtonList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="BusinessApplicationsLabel" runat="server" Text="Business Applications"></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="BusinessApplicationsProbabilityLabel" runat="server" Text="Based on workspace engineering assessment, what is the probability that this change could impact function, performance or availability of a business application?"></asp:Label>
                        </td>
                        <td>
                            <asp:UpdatePanel ID="BusinessProbabilityPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="BusinessProbabilityButtonList" runat="server" OnSelectedIndexChanged="BusinessProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                        <td>
                            <asp:Label ID="BusinessApplicationsImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the business application?"></asp:Label>
                        </td>
                        <td>
                            <asp:UpdatePanel ID="BusinessImpactPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="BusinessImpactButtonList" runat="server" OnSelectedIndexChanged="BusinessImpactButtonList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="DatacenterLabel" runat="server" Text="Datacenter/Infrastructure"></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="DatacenterProbabilityLabel" runat="server" Text="What is the probability that this change could impact function, performance or availability of networks, infrastructure or web services used by the branch??"></asp:Label>
                        </td>
                        <td>
                            <asp:UpdatePanel ID="DatacenterProbabilityPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="DatacenterProbabilityButtonList" runat="server" OnSelectedIndexChanged="DatacenterProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                        <td>
                            <asp:Label ID="DataCenterImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the datacenter or infrastructure?"></asp:Label>
                        </td>
                        <td>
                            <asp:UpdatePanel ID="DataCenterImpactPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="DatacenterImpactButtonList" runat="server" OnSelectedIndexChanged="DatacenterImpactList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td> </td>
                        <td style="text-align: right">
                            <asp:Label ID="OverAllRatingLabel" runat="server" Font-Bold="True" Text="Change Risks Overall Average Rating: "></asp:Label>
                        </td>
                        <td style="text-align: right">
                            <asp:Label ID="OverallRating" runat="server" Font-Bold="True"></asp:Label>
                        </td>
                        <td style="text-align: right">
                            <asp:Label ID="OverallRiskLabel" runat="server" Font-Bold="True" Text="Overall Risk: "></asp:Label>
                        </td>
                        <td style="text-align: right">
                            <asp:Label ID="OverallRisk" runat="server" Font-Bold="True"></asp:Label>
                        </td>
                    </tr>
                </table>
</code>```

And now my c#

```<code>double averageRating, desktopProbabilityRating, desktopImpactRating, productivityProbabilityRating, productivityImpactRating, businessProbabilityRating, businessImpactRating, datacenterProbabilityRating, datacenterImpactRating = 0;

protected void DesktopProbabilityButtonList_SelectedIndexChanged(object sender, EventArgs e) {
    desktopProbabilityRating = Convert.ToDouble(DesktopProbabilityButtonList.SelectedValue);
    calculateAverage();
}

protected void DesktopImpactButtonList_SelectedIndexChanged(object sender, EventArgs e) {
    desktopImpactRating = Convert.ToDouble(DesktopImpactButtonList.SelectedValue);
    calculateAverage();
}

protected void ProductivityProbabilityButtonList_SelectedIndexChanged(object sender, EventArgs e) {
    productivityProbabilityRating = Convert.ToDouble(ProductivityProbabilityButtonList.SelectedValue);
    calculateAverage();
}

protected void ProductivityImpactButtonList_SelectedIndexChanged(object sender, EventArgs e) {
    productivityImpactRating = Convert.ToDouble(ProductivityImpactButtonList.SelectedValue);
    calculateAverage();
}

protected void BusinessProbabilityButtonList_SelectedIndexChanged(object sender, EventArgs e) {
    businessProbabilityRating = Convert.ToDouble(BusinessProbabilityButtonList.SelectedValue);
    calculateAverage();
}

protected void BusinessImpactButtonList_SelectedIndexChanged(object sender, EventArgs e) {
    businessImpactRating = Convert.ToDouble(BusinessImpactButtonList.SelectedValue);
    calculateAverage();
}

protected void DatacenterProbabilityButtonList_SelectedIndexChanged(object sender, EventArgs e) {
    datacenterProbabilityRating = Convert.ToDouble(DatacenterProbabilityButtonList.SelectedValue);
    calculateAverage();
}

protected void DatacenterImpactList_SelectedIndexChanged(object sender, EventArgs e) {
    datacenterImpactRating = Convert.ToDouble(DatacenterImpactButtonList.SelectedValue);
    calculateAverage();
}

protected void calculateAverage() {
    averageRating = (desktopProbabilityRating + desktopImpactRating + productivityProbabilityRating + productivityImpactRating + businessProbabilityRating + businessImpactRating + datacenterProbabilityRating + datacenterImpactRating) / 8;
    OverallRating.Text = averageRating.ToString();
    if(averageRating <= 1) {
        OverallRisk.Text = "Low";
    }
    else if(averageRating > 1 && averageRating < 3) {
        OverallRisk.Text = "Med";
    }
    else if(averageRating >=3 || desktopProbabilityRating == 3 || desktopImpactRating == 3 || productivityProbabilityRating == 3 || productivityImpactRating == 3 || businessProbabilityRating == 3 || businessImpactRating == 3 || datacenterProbabilityRating == 3 || datacenterImpactRating == 3) {
        OverallRisk.Text = "High";
    }
}
</code>```

This SHOULD be posting back, I absolutely can't determine why every other control on my form posts back just fine and not these.  Would someone be able to help determine why?  No other question on stack overflow concerning this applied to my problem.

Thanks so much in advance.

答:
Your labels are outside the update panels, that is why it is not working. All the radio buttons postback without any issue.

I would suggest you to wrap all the controls inside one update panel.

Please read further here https://forums.asp.net/t/1120428.aspx?Update+Label+outside+update+panel

```<code><asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Always">
                            <ContentTemplate>
<table class="td-table-bordered" style="width: 90%">
                <tr>
                    <th>
                        <asp:Label ID="CategoryLabel" runat="server" Text="Category"></asp:Label>
                    </th>
                    <th>
                        <asp:Label ID="OccurrenceProbabilityLabel" runat="server" Text="Probability of Occurrence"></asp:Label>
                    </th>
                    <th>
                        <asp:Label ID="ProbabilityRatingLabel" runat="server" Text="Rating"></asp:Label><br />
                        <asp:Label ID="ProbabilityRatingLabel2" runat="server" Text="(L/M/H)"></asp:Label>
                    </th>
                    <th>
                        <asp:Label ID="OccurrenceImpactLabel" runat="server" Text="Impact of Occurrence"></asp:Label>
                    </th>
                    <th>
                        <asp:Label ID="ImpactRatingLabel" runat="server" Text="Rating"></asp:Label><br />
                        <asp:Label ID="ImpactRatingLabel2" runat="server" Text="(L/M/H)"></asp:Label>
                    </th>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="BaseDesktopLabel" runat="server" Text="Base Desktop"></asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="BaseDesktopProbabilityLabel" runat="server" Text="Based on workspace/RBB assessment, what is the probability that this change could impact function, performance or availability of a base component?"></asp:Label>
                    </td>
                    <td>

                                <asp:RadioButtonList ID="DesktopProbabilityButtonList" runat="server" OnSelectedIndexChanged="DesktopProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                    <td>
                        <asp:Label ID="BaseDesktopImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the workstation?"></asp:Label>
                    </td>
                    <td>
                              <asp:RadioButtonList ID="DesktopImpactButtonList" runat="server" OnSelectedIndexChanged="DesktopImpactButtonList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="ProductivityLayerLabel" runat="server" Text="Productivity Layer"></asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="ProductivityLayerProbabilityLabel" runat="server" Text="Based on workspace/RBB engineering assessment, what is the probability that this change could impact function, performance or availability of a productivity application?"></asp:Label>
                    </td>
                    <td>

                                <asp:RadioButtonList ID="ProductivityProbabilityButtonList" runat="server" OnSelectedIndexChanged="ProductivityProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                    <td>
                        <asp:Label ID="ProductivityLayerImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the productivity application?"></asp:Label>
                    </td>
                    <td>
                              <asp:RadioButtonList ID="ProductivityImpactButtonList" runat="server" OnSelectedIndexChanged="ProductivityImpactButtonList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="BusinessApplicationsLabel" runat="server" Text="Business Applications"></asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="BusinessApplicationsProbabilityLabel" runat="server" Text="Based on workspace engineering assessment, what is the probability that this change could impact function, performance or availability of a business application?"></asp:Label>
                    </td>
                    <td>
                               <asp:RadioButtonList ID="BusinessProbabilityButtonList" runat="server" OnSelectedIndexChanged="BusinessProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                    <td>
                        <asp:Label ID="BusinessApplicationsImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the business application?"></asp:Label>
                    </td>
                    <td>
                              <asp:RadioButtonList ID="BusinessImpactButtonList" runat="server" OnSelectedIndexChanged="BusinessImpactButtonList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="DatacenterLabel" runat="server" Text="Datacenter/Infrastructure"></asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="DatacenterProbabilityLabel" runat="server" Text="What is the probability that this change could impact function, performance or availability of networks, infrastructure or web services used by the branch??"></asp:Label>
                    </td>
                    <td>
                               <asp:RadioButtonList ID="DatacenterProbabilityButtonList" runat="server" OnSelectedIndexChanged="DatacenterProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                    <td>
                        <asp:Label ID="DataCenterImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the datacenter or infrastructure?"></asp:Label>
                    </td>
                    <td>
                         <asp:RadioButtonList ID="DatacenterImpactButtonList" runat="server" OnSelectedIndexChanged="DatacenterImpactList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                </tr>
                <tr>
                    <td> </td>
                    <td style="text-align: right">
                        <asp:Label ID="OverAllRatingLabel" runat="server" Font-Bold="True" Text="Change Risks Overall Average Rating: "></asp:Label>
                    </td>
                    <td style="text-align: right">
                        <asp:Label ID="OverallRating" runat="server" Font-Bold="True"></asp:Label>
                    </td>
                    <td style="text-align: right">
                        <asp:Label ID="OverallRiskLabel" runat="server" Font-Bold="True" Text="Overall Risk: "></asp:Label>
                    </td>
                    <td style="text-align: right">
                        <asp:Label ID="OverallRisk" runat="server" Font-Bold="True"></asp:Label>
                    </td>
                </tr>
            </table>
                                </ContentTemplate>
                        </asp:UpdatePanel>
</code>```

Body:
I'm having issues trying to get radio button list selected index changes to fire, and although I have no issues with postbacks on any other asp control, radio button lists are giving me trouble.  I'll include my asp code and c# codebehind in the event one of you may be able to discern what's wrong.

I have 8 radio button lists, all within their own update panels that are set to always update, and each radio button list has autopostback set to true.

I have code behind logic changing two asp:labels, one changing the average scores based on the radiobuttonlist selections, and one assigning a risk level depending on the value of the average score.

                            <asp:Label ID="CategoryLabel" runat="server" Text="Category"></asp:Label>

                            <asp:Label ID="OccurrenceProbabilityLabel" runat="server" Text="Probability of Occurrence"></asp:Label>

                            <asp:Label ID="ProbabilityRatingLabel" runat="server" Text="Rating"></asp:Label>

                            <asp:Label ID="ProbabilityRatingLabel2" runat="server" Text="(L/M/H)"></asp:Label>

                            <asp:Label ID="OccurrenceImpactLabel" runat="server" Text="Impact of Occurrence"></asp:Label>

                            <asp:Label ID="ImpactRatingLabel" runat="server" Text="Rating"></asp:Label>

                            <asp:Label ID="ImpactRatingLabel2" runat="server" Text="(L/M/H)"></asp:Label>

                            <asp:Label ID="BaseDesktopLabel" runat="server" Text="Base Desktop"></asp:Label>

                            <asp:Label ID="BaseDesktopProbabilityLabel" runat="server" Text="Based on workspace/RBB assessment, what is the probability that this change could impact function, performance or availability of a base component?"></asp:Label>

                            <asp:UpdatePanel ID="DesktopProbabilityPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="DesktopProbabilityButtonList" runat="server" OnSelectedIndexChanged="DesktopProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>

                            <asp:Label ID="BaseDesktopImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the workstation?"></asp:Label>

                            <asp:UpdatePanel ID="DesktopImpactPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="DesktopImpactButtonList" runat="server" OnSelectedIndexChanged="DesktopImpactButtonList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>

                            <asp:Label ID="ProductivityLayerLabel" runat="server" Text="Productivity Layer"></asp:Label>

                            <asp:Label ID="ProductivityLayerProbabilityLabel" runat="server" Text="Based on workspace/RBB engineering assessment, what is the probability that this change could impact function, performance or availability of a productivity application?"></asp:Label>

                            <asp:UpdatePanel ID="ProductivityProbabilityPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="ProductivityProbabilityButtonList" runat="server" OnSelectedIndexChanged="ProductivityProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>

                            <asp:Label ID="ProductivityLayerImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the productivity application?"></asp:Label>

                            <asp:UpdatePanel ID="ProductivityImpactPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="ProductivityImpactButtonList" runat="server" OnSelectedIndexChanged="ProductivityImpactButtonList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>

                            <asp:Label ID="BusinessApplicationsLabel" runat="server" Text="Business Applications"></asp:Label>

                            <asp:Label ID="BusinessApplicationsProbabilityLabel" runat="server" Text="Based on workspace engineering assessment, what is the probability that this change could impact function, performance or availability of a business application?"></asp:Label>

                            <asp:UpdatePanel ID="BusinessProbabilityPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="BusinessProbabilityButtonList" runat="server" OnSelectedIndexChanged="BusinessProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>

                            <asp:Label ID="BusinessApplicationsImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the business application?"></asp:Label>

                            <asp:UpdatePanel ID="BusinessImpactPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="BusinessImpactButtonList" runat="server" OnSelectedIndexChanged="BusinessImpactButtonList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>

                            <asp:Label ID="DatacenterLabel" runat="server" Text="Datacenter/Infrastructure"></asp:Label>

                            <asp:Label ID="DatacenterProbabilityLabel" runat="server" Text="What is the probability that this change could impact function, performance or availability of networks, infrastructure or web services used by the branch??"></asp:Label>

                            <asp:UpdatePanel ID="DatacenterProbabilityPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="DatacenterProbabilityButtonList" runat="server" OnSelectedIndexChanged="DatacenterProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>

                            <asp:Label ID="DataCenterImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the datacenter or infrastructure?"></asp:Label>

                            <asp:UpdatePanel ID="DataCenterImpactPanel" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:RadioButtonList ID="DatacenterImpactButtonList" runat="server" OnSelectedIndexChanged="DatacenterImpactList_SelectedIndexChanged" AutoPostBack="True">
                                        <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                    </asp:RadioButtonList>
                                </ContentTemplate>
                            </asp:UpdatePanel>

                            <asp:Label ID="OverAllRatingLabel" runat="server" Font-Bold="True" Text="Change Risks Overall Average Rating: "></asp:Label>

                            <asp:Label ID="OverallRating" runat="server" Font-Bold="True"></asp:Label>

                            <asp:Label ID="OverallRiskLabel" runat="server" Font-Bold="True" Text="Overall Risk: "></asp:Label>

                            <asp:Label ID="OverallRisk" runat="server" Font-Bold="True"></asp:Label>

And now my c#

double averageRating, desktopProbabilityRating, desktopImpactRating, productivityProbabilityRating, productivityImpactRating, businessProbabilityRating, businessImpactRating, datacenterProbabilityRating, datacenterImpactRating = 0;

protected void DesktopProbabilityButtonList_SelectedIndexChanged(object sender, EventArgs e) {
    desktopProbabilityRating = Convert.ToDouble(DesktopProbabilityButtonList.SelectedValue);
    calculateAverage();
}

protected void DesktopImpactButtonList_SelectedIndexChanged(object sender, EventArgs e) {
    desktopImpactRating = Convert.ToDouble(DesktopImpactButtonList.SelectedValue);
    calculateAverage();
}

protected void ProductivityProbabilityButtonList_SelectedIndexChanged(object sender, EventArgs e) {
    productivityProbabilityRating = Convert.ToDouble(ProductivityProbabilityButtonList.SelectedValue);
    calculateAverage();
}

protected void ProductivityImpactButtonList_SelectedIndexChanged(object sender, EventArgs e) {
    productivityImpactRating = Convert.ToDouble(ProductivityImpactButtonList.SelectedValue);
    calculateAverage();
}

protected void BusinessProbabilityButtonList_SelectedIndexChanged(object sender, EventArgs e) {
    businessProbabilityRating = Convert.ToDouble(BusinessProbabilityButtonList.SelectedValue);
    calculateAverage();
}

protected void BusinessImpactButtonList_SelectedIndexChanged(object sender, EventArgs e) {
    businessImpactRating = Convert.ToDouble(BusinessImpactButtonList.SelectedValue);
    calculateAverage();
}

protected void DatacenterProbabilityButtonList_SelectedIndexChanged(object sender, EventArgs e) {
    datacenterProbabilityRating = Convert.ToDouble(DatacenterProbabilityButtonList.SelectedValue);
    calculateAverage();
}

protected void DatacenterImpactList_SelectedIndexChanged(object sender, EventArgs e) {
    datacenterImpactRating = Convert.ToDouble(DatacenterImpactButtonList.SelectedValue);
    calculateAverage();
}

protected void calculateAverage() {
    averageRating = (desktopProbabilityRating + desktopImpactRating + productivityProbabilityRating + productivityImpactRating + businessProbabilityRating + businessImpactRating + datacenterProbabilityRating + datacenterImpactRating) / 8;
    OverallRating.Text = averageRating.ToString();
    if(averageRating <= 1) {
        OverallRisk.Text = "Low";
    }
    else if(averageRating > 1 && averageRating < 3) {
        OverallRisk.Text = "Med";
    }
    else if(averageRating >=3 || desktopProbabilityRating == 3 || desktopImpactRating == 3 || productivityProbabilityRating == 3 || productivityImpactRating == 3 || businessProbabilityRating == 3 || businessImpactRating == 3 || datacenterProbabilityRating == 3 || datacenterImpactRating == 3) {
        OverallRisk.Text = "High";
    }
}

This SHOULD be posting back, I absolutely can't determine why every other control on my form posts back just fine and not these.  Would someone be able to help determine why?  No other question on stack overflow concerning this applied to my problem.

Thanks so much in advance.

Body:
Your labels are outside the update panels, that is why it is not working. All the radio buttons postback without any issue.

I would suggest you to wrap all the controls inside one update panel.

Please read further here https://forums.asp.net/t/1120428.aspx?Update+Label+outside+update+panel

<asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Always">
                            <ContentTemplate>
<table class="td-table-bordered" style="width: 90%">
                <tr>
                    <th>
                        <asp:Label ID="CategoryLabel" runat="server" Text="Category"></asp:Label>
                    </th>
                    <th>
                        <asp:Label ID="OccurrenceProbabilityLabel" runat="server" Text="Probability of Occurrence"></asp:Label>
                    </th>
                    <th>
                        <asp:Label ID="ProbabilityRatingLabel" runat="server" Text="Rating"></asp:Label><br />
                        <asp:Label ID="ProbabilityRatingLabel2" runat="server" Text="(L/M/H)"></asp:Label>
                    </th>
                    <th>
                        <asp:Label ID="OccurrenceImpactLabel" runat="server" Text="Impact of Occurrence"></asp:Label>
                    </th>
                    <th>
                        <asp:Label ID="ImpactRatingLabel" runat="server" Text="Rating"></asp:Label><br />
                        <asp:Label ID="ImpactRatingLabel2" runat="server" Text="(L/M/H)"></asp:Label>
                    </th>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="BaseDesktopLabel" runat="server" Text="Base Desktop"></asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="BaseDesktopProbabilityLabel" runat="server" Text="Based on workspace/RBB assessment, what is the probability that this change could impact function, performance or availability of a base component?"></asp:Label>
                    </td>
                    <td>

                                <asp:RadioButtonList ID="DesktopProbabilityButtonList" runat="server" OnSelectedIndexChanged="DesktopProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                    <td>
                        <asp:Label ID="BaseDesktopImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the workstation?"></asp:Label>
                    </td>
                    <td>
                              <asp:RadioButtonList ID="DesktopImpactButtonList" runat="server" OnSelectedIndexChanged="DesktopImpactButtonList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="ProductivityLayerLabel" runat="server" Text="Productivity Layer"></asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="ProductivityLayerProbabilityLabel" runat="server" Text="Based on workspace/RBB engineering assessment, what is the probability that this change could impact function, performance or availability of a productivity application?"></asp:Label>
                    </td>
                    <td>

                                <asp:RadioButtonList ID="ProductivityProbabilityButtonList" runat="server" OnSelectedIndexChanged="ProductivityProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                    <td>
                        <asp:Label ID="ProductivityLayerImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the productivity application?"></asp:Label>
                    </td>
                    <td>
                              <asp:RadioButtonList ID="ProductivityImpactButtonList" runat="server" OnSelectedIndexChanged="ProductivityImpactButtonList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="BusinessApplicationsLabel" runat="server" Text="Business Applications"></asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="BusinessApplicationsProbabilityLabel" runat="server" Text="Based on workspace engineering assessment, what is the probability that this change could impact function, performance or availability of a business application?"></asp:Label>
                    </td>
                    <td>
                               <asp:RadioButtonList ID="BusinessProbabilityButtonList" runat="server" OnSelectedIndexChanged="BusinessProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                    <td>
                        <asp:Label ID="BusinessApplicationsImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the business application?"></asp:Label>
                    </td>
                    <td>
                              <asp:RadioButtonList ID="BusinessImpactButtonList" runat="server" OnSelectedIndexChanged="BusinessImpactButtonList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="DatacenterLabel" runat="server" Text="Datacenter/Infrastructure"></asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="DatacenterProbabilityLabel" runat="server" Text="What is the probability that this change could impact function, performance or availability of networks, infrastructure or web services used by the branch??"></asp:Label>
                    </td>
                    <td>
                               <asp:RadioButtonList ID="DatacenterProbabilityButtonList" runat="server" OnSelectedIndexChanged="DatacenterProbabilityButtonList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                    <td>
                        <asp:Label ID="DataCenterImpactLabel" runat="server" Text="If a problem did occur, what could be the extent of the impact to the operation of the datacenter or infrastructure?"></asp:Label>
                    </td>
                    <td>
                         <asp:RadioButtonList ID="DatacenterImpactButtonList" runat="server" OnSelectedIndexChanged="DatacenterImpactList_SelectedIndexChanged" AutoPostBack="True">
                                    <asp:ListItem Text="High" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Med" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Low" Value="1"></asp:ListItem>
                                </asp:RadioButtonList>

                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td style="text-align: right">
                        <asp:Label ID="OverAllRatingLabel" runat="server" Font-Bold="True" Text="Change Risks Overall Average Rating: "></asp:Label>
                    </td>
                    <td style="text-align: right">
                        <asp:Label ID="OverallRating" runat="server" Font-Bold="True"></asp:Label>
                    </td>
                    <td style="text-align: right">
                        <asp:Label ID="OverallRiskLabel" runat="server" Font-Bold="True" Text="Overall Risk: "></asp:Label>
                    </td>
                    <td style="text-align: right">
                        <asp:Label ID="OverallRisk" runat="server" Font-Bold="True"></asp:Label>
                    </td>
                </tr>
            </table>
                                </ContentTemplate>
                        </asp:UpdatePanel>