TestContainers - Can't connect to MySQLContainer Docker - Integration Test - java

I'm Trying to run my Integration Test using MySQLContainer in Docker, however when i run the tests, the application gets caught in a loop trying to establish a JDBC Connection, find bellow my integration Test class and the log of the Spring Boot Application.
Integration Test Class
package com.recargaslda.multiplatform.repositorios;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import java.time.LocalDate;
import org.junit.Rule;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.util.TestPropertyValues;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.testcontainers.containers.MySQLContainer;
import com.recargaslda.multiplatform.entidades.Album;
#SpringBootTest
#ContextConfiguration(initializers = { AlbumRepositorioTesteIntegracao.Initializer.class })
public class AlbumRepositorioTesteIntegracao {
// Even When i change the image version to 5.5 it still fails to connect
#Rule
private static MySQLContainer sqlContainer = new MySQLContainer<>("mysql:8.0");
static {
sqlContainer.withDatabaseName("teste-integração-album-repositorio").withUsername("root").withPassword("root");
sqlContainer.start();
}
static class Initializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
#Override
public void initialize(ConfigurableApplicationContext applicationContext) {
TestPropertyValues.of("spring.datasource.url=" + sqlContainer.getJdbcUrl(),
"spring.datasource.username=" + sqlContainer.getUsername(),
"spring.datasource.password=" + sqlContainer.getPassword()).applyTo(applicationContext);
}
}
#Autowired
AlbumRepositorio albumRepositorio;
#Test
public void DevePersistirUmNovoAlbumSemImagens() {
Album album = new Album("album", LocalDate.now(), "Capa");
albumRepositorio.save(album);
Album albumEncontrado = albumRepositorio.findByNome("album");
assertThat(album.getNome(), is(albumEncontrado.getNome()));
}
}
The Console Log During the loop:
13:48:00.676 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [com.recargaslda.multiplatform.repositorios.AlbumRepositorioTesteIntegracao]: no resource found for suffixes {-context.xml, Context.groovy}.
13:48:00.678 [main] DEBUG org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Ignoring class [com.recargaslda.multiplatform.repositorios.AlbumRepositorioTesteIntegracao$Initializer]; it must be static, non-private, non-final, and annotated with #Configuration to be considered a default configuration class.
13:48:00.678 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [com.recargaslda.multiplatform.repositorios.AlbumRepositorioTesteIntegracao]: AlbumRepositorioTesteIntegracao does not declare any static, non-private, non-final, nested classes annotated with #Configuration.
13:48:00.770 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [com.recargaslda.multiplatform.repositorios.AlbumRepositorioTesteIntegracao]
13:48:00.990 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [C:\Users\Pete\Documents\Workspace\MultiPlatformAplicacao\target\classes\com\recargaslda\multiplatform\MultiPlatformApplication.class]
13:48:00.993 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found #SpringBootConfiguration com.recargaslda.multiplatform.MultiPlatformApplication for test class com.recargaslda.multiplatform.repositorios.AlbumRepositorioTesteIntegracao
13:48:01.216 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - #TestExecutionListeners is not present for class [com.recargaslda.multiplatform.repositorios.AlbumRepositorioTesteIntegracao]: using defaults.
13:48:01.217 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener, org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener, org.springframework.security.test.context.support.ReactorContextTestExecutionListener]
13:48:01.269 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener#2eae8e6e, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener#8f2ef19, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener#470734c3, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener#2cf3d63b, org.springframework.test.context.support.DirtiesContextTestExecutionListener#7674f035, org.springframework.test.context.transaction.TransactionalTestExecutionListener#69e153c5, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener#173ed316, org.springframework.test.context.event.EventPublishingTestExecutionListener#25ce9dc4, org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener#74ea2410, org.springframework.security.test.context.support.ReactorContextTestExecutionListener#17f62e33, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener#76b1e9b8, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener#27406a17, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener#2af004b, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener#248e319b, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener#5d0bf09b]
13:48:01.737 [main] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy - Loaded org.testcontainers.dockerclient.NpipeSocketClientProviderStrategy from ~/.testcontainers.properties, will try it first
13:48:02.995 [ducttape-0] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - Pinging docker daemon...
13:48:03.311 [ducttape-0] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: org.testcontainers.dockerclient.transport.okhttp.OkHttpDockerCmdExecFactory$1#298aadd0
13:48:03.418 [main] INFO org.testcontainers.dockerclient.NpipeSocketClientProviderStrategy - Accessing docker with local Npipe socket (npipe:////./pipe/docker_engine)
13:48:03.419 [main] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy - Found Docker environment with local Npipe socket (npipe:////./pipe/docker_engine)
13:48:03.419 [main] DEBUG org.testcontainers.dockerclient.DockerClientProviderStrategy - Checking Docker OS type for local Npipe socket (npipe:////./pipe/docker_engine)
13:48:03.421 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: com.github.dockerjava.core.exec.InfoCmdExec#1115ec15
13:48:03.715 [main] INFO org.testcontainers.DockerClientFactory - Docker host IP address is localhost
13:48:03.717 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: com.github.dockerjava.core.exec.InfoCmdExec#6155d082
13:48:03.738 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: com.github.dockerjava.core.exec.VersionCmdExec#7803bfd
13:48:03.770 [main] INFO org.testcontainers.DockerClientFactory - Connected to docker:
Server Version: 19.03.8
API Version: 1.40
Operating System: Docker Desktop
Total Memory: 1989 MB
13:48:03.770 [main] DEBUG org.testcontainers.DockerClientFactory - Ryuk is enabled
13:48:03.776 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: ListImagesCmdImpl[imageNameFilter=quay.io/testcontainers/ryuk:0.2.3,showAll=false,filters=com.github.dockerjava.core.util.FiltersBuilder#0,execution=com.github.dockerjava.core.exec.ListImagesCmdExec#4f25b795]
13:48:03.851 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - Looking up auth config for image: quay.io/testcontainers/ryuk:0.2.3
13:48:03.851 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - RegistryAuthLocator has configFile: C:\Users\Pete\.docker\config.json (exists) and commandPathPrefix:
13:48:03.860 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - registryName [quay.io] for dockerImageName [quay.io/testcontainers/ryuk:0.2.3]
13:48:03.861 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - Executing docker credential provider: docker-credential-desktop to locate auth config for: quay.io
13:48:03.878 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Executing [docker-credential-desktop, get].
13:48:03.885 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Started java.lang.ProcessImpl#3212a8d7
13:48:04.044 [WaitForProcess-java.lang.ProcessImpl#3212a8d7] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.WaitForProcess - java.lang.ProcessImpl#3212a8d7 stopped with exit code 1
13:48:04.048 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Executing [docker-credential-desktop, get].
13:48:04.053 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Started java.lang.ProcessImpl#71454b9d
13:48:04.188 [WaitForProcess-java.lang.ProcessImpl#71454b9d] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.WaitForProcess - java.lang.ProcessImpl#71454b9d stopped with exit code 1
13:48:04.190 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - Got credentials not found error message from docker credential helper - credentials not found in native keychain
13:48:04.192 [main] INFO org.testcontainers.utility.RegistryAuthLocator - Credential helper/store (docker-credential-desktop) does not have credentials for quay.io
13:48:04.195 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - no matching Auth Configs - falling back to defaultAuthConfig [null]
13:48:04.195 [main] DEBUG org.testcontainers.dockerclient.auth.AuthDelegatingDockerClientConfig - Effective auth config [null]
13:48:04.239 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: com.github.dockerjava.core.command.CreateContainerCmdImpl#584f54e6[name=testcontainers-ryuk-c9db393d-d0ec-4740-848a-134abfe549c5,hostName=<null>,domainName=<null>,user=<null>,attachStdin=<null>,attachStdout=<null>,attachStderr=<null>,portSpecs=<null>,tty=<null>,stdinOpen=<null>,stdInOnce=<null>,env=<null>,cmd=<null>,healthcheck=<null>,argsEscaped=<null>,entrypoint=<null>,image=quay.io/testcontainers/ryuk:0.2.3,volumes=com.github.dockerjava.api.model.Volumes#23aa363a,workingDir=<null>,macAddress=<null>,onBuild=<null>,networkDisabled=<null>,exposedPorts=com.github.dockerjava.api.model.ExposedPorts#5ef6ae06,stopSignal=<null>,stopTimeout=<null>,hostConfig=com.github.dockerjava.api.model.HostConfig#55dfebeb[binds=com.github.dockerjava.api.model.Binds#604f2bd2,blkioWeight=<null>,blkioWeightDevice=<null>,blkioDeviceReadBps=<null>,blkioDeviceWriteBps=<null>,blkioDeviceReadIOps=<null>,blkioDeviceWriteIOps=<null>,memorySwappiness=<null>,nanoCPUs=<null>,capAdd=<null>,capDrop=<null>,containerIDFile=<null>,cpuPeriod=<null>,cpuRealtimePeriod=<null>,cpuRealtimeRuntime=<null>,cpuShares=<null>,cpuQuota=<null>,cpusetCpus=<null>,cpusetMems=<null>,devices=<null>,deviceCgroupRules=<null>,diskQuota=<null>,dns=<null>,dnsOptions=<null>,dnsSearch=<null>,extraHosts=<null>,groupAdd=<null>,ipcMode=<null>,cgroup=<null>,links=<null>,logConfig=<null>,lxcConf=<null>,memory=<null>,memorySwap=<null>,memoryReservation=<null>,kernelMemory=<null>,networkMode=<null>,oomKillDisable=<null>,init=<null>,autoRemove=true,oomScoreAdj=<null>,portBindings=<null>,privileged=false,publishAllPorts=true,readonlyRootfs=<null>,restartPolicy=<null>,ulimits=<null>,cpuCount=<null>,cpuPercent=<null>,ioMaximumIOps=<null>,ioMaximumBandwidth=<null>,volumesFrom=<null>,mounts=<null>,pidMode=<null>,isolation=<null>,securityOpts=<null>,storageOpt=<null>,cgroupParent=<null>,volumeDriver=<null>,shmSize=<null>,pidsLimit=<null>,runtime=<null>,tmpFs=<null>,utSMode=<null>,usernsMode=<null>,sysctls=<null>,consoleSize=<null>],labels={org.testcontainers=true},shell=<null>,networkingConfig=<null>,ipv4Address=<null>,ipv6Address=<null>,aliases=<null>,authConfig=<null>,execution=com.github.dockerjava.core.exec.CreateContainerCmdExec#1d3ac898]
13:48:05.184 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: 63eb180f9f28ccc0ef8215d62d80d404de21b3841411a9ba29492c5dab3e42e0,com.github.dockerjava.core.exec.StartContainerCmdExec#56e8b606
13:48:06.714 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: 63eb180f9f28ccc0ef8215d62d80d404de21b3841411a9ba29492c5dab3e42e0,false,com.github.dockerjava.core.exec.InspectContainerCmdExec#366c4480
13:48:06.718 [main] DEBUG com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: OkHttpWebTarget(okHttpClient=org.testcontainers.shaded.okhttp3.OkHttpClient#2c7b5824, baseUrl=http://docker.socket/, path=[/containers/63eb180f9f28ccc0ef8215d62d80d404de21b3841411a9ba29492c5dab3e42e0/json], queryParams={})
13:48:06.892 [testcontainers-ryuk] DEBUG org.testcontainers.utility.ResourceReaper - Sending 'label=org.testcontainers%3Dtrue&label=org.testcontainers.sessionId%3Dc9db393d-d0ec-4740-848a-134abfe549c5' to Ryuk
13:48:06.895 [testcontainers-ryuk] DEBUG org.testcontainers.utility.ResourceReaper - Received 'ACK' from Ryuk
13:48:06.895 [main] INFO org.testcontainers.DockerClientFactory - Ryuk started - will monitor and terminate Testcontainers containers on JVM exit
13:48:06.895 [main] DEBUG org.testcontainers.DockerClientFactory - Checks are enabled
13:48:06.895 [main] INFO org.testcontainers.DockerClientFactory - Checking the system...
13:48:06.896 [main] INFO org.testcontainers.DockerClientFactory - ✔︎ Docker server version should be at least 1.6.0
13:48:06.899 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: 63eb180f9f28ccc0ef8215d62d80d404de21b3841411a9ba29492c5dab3e42e0,<null>,true,<null>,<null>,<null>,<null>,{df,-P},<null>,<null>,com.github.dockerjava.core.exec.ExecCreateCmdExec#2a79d4b1
13:48:07.015 [tc-okhttp-stream-1130346421] DEBUG com.github.dockerjava.core.command.ExecStartResultCallback - STDOUT: Filesystem 1024-blocks Used Available Capacity Mounted on
overlay 61255652 3271272 54843048 6% /
tmpfs 65536 0 65536 0% /dev
tmpfs 1018508 0 1018508 0% /sys/fs/cgroup
shm 65536 0 65536 0% /dev/shm
/dev/sda1 61255652 3271272 54843048 6% /etc/resolv.conf
/dev/sda1 61255652 3271272 54843048 6% /etc/hostname
/dev/sda1 61255652 3271272 54843048 6% /etc/hosts
overlay 1018508 400 1018108 0% /run/docker.sock
tmpfs 1018508 0 1018508 0% /proc/acpi
tmpfs 65536 0 65536 0% /proc/kcore
tmpfs 65536 0 65536 0% /proc/keys
tmpfs 65536 0 65536 0% /proc/timer_list
tmpfs 65536 0 65536 0% /proc/sched_debug
tmpfs 1018508 0 1018508 0% /sys/firmware
13:48:07.045 [main] INFO org.testcontainers.DockerClientFactory - ✔︎ Docker environment should have more than 2GB free disk space
13:48:07.046 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: ListImagesCmdImpl[imageNameFilter=<null>,showAll=false,filters=com.github.dockerjava.core.util.FiltersBuilder#0,execution=com.github.dockerjava.core.exec.ListImagesCmdExec#56c698e3]
13:48:07.091 [main] DEBUG org.testcontainers.images.AbstractImagePullPolicy - Using locally available and not pulling image: mysql:8.0
13:48:07.091 [main] DEBUG 🐳 [mysql:8.0] - Starting container: mysql:8.0
13:48:07.092 [main] DEBUG 🐳 [mysql:8.0] - Trying to start container: mysql:8.0
13:48:07.092 [main] DEBUG 🐳 [mysql:8.0] - Trying to start container: mysql:8.0 (attempt 1/3)
13:48:07.092 [main] DEBUG 🐳 [mysql:8.0] - Starting container: mysql:8.0
13:48:07.092 [main] INFO 🐳 [mysql:8.0] - Creating container for image: mysql:8.0
13:48:07.093 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - Looking up auth config for image: mysql:8.0
13:48:07.093 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - RegistryAuthLocator has configFile: C:\Users\Pete\.docker\config.json (exists) and commandPathPrefix:
13:48:07.093 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - registryName [index.docker.io] for dockerImageName [mysql:8.0]
13:48:07.093 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - Executing docker credential provider: docker-credential-desktop to locate auth config for: index.docker.io
13:48:07.093 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Executing [docker-credential-desktop, get].
13:48:07.097 [main] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.ProcessExecutor - Started java.lang.ProcessImpl#5c8504fd
13:48:07.224 [WaitForProcess-java.lang.ProcessImpl#5c8504fd] DEBUG org.testcontainers.shaded.org.zeroturnaround.exec.WaitForProcess - java.lang.ProcessImpl#5c8504fd stopped with exit code 0
13:48:07.225 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - Credential helper/store provided auth config for: index.docker.io
13:48:07.232 [main] DEBUG org.testcontainers.utility.RegistryAuthLocator - found creds store auth config [AuthConfig{username=petechiboleca, password=hidden non-blank value, auth=blank, email=null, registryAddress=index.docker.io, registryToken=blank}]
13:48:07.232 [main] DEBUG org.testcontainers.dockerclient.auth.AuthDelegatingDockerClientConfig - Effective auth config [AuthConfig{username=petechiboleca, password=hidden non-blank value, auth=blank, email=null, registryAddress=index.docker.io, registryToken=blank}]
13:48:07.243 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: com.github.dockerjava.core.command.CreateContainerCmdImpl#5c153b9e[name=<null>,hostName=<null>,domainName=<null>,user=<null>,attachStdin=<null>,attachStdout=<null>,attachStderr=<null>,portSpecs=<null>,tty=<null>,stdinOpen=<null>,stdInOnce=<null>,env={MYSQL_DATABASE=teste-integração-album-repositorio,MYSQL_PASSWORD=root,MYSQL_USER=root,MYSQL_ROOT_PASSWORD=root},cmd={},healthcheck=<null>,argsEscaped=<null>,entrypoint=<null>,image=mysql:8.0,volumes=com.github.dockerjava.api.model.Volumes#2a7686a7,workingDir=<null>,macAddress=<null>,onBuild=<null>,networkDisabled=<null>,exposedPorts=com.github.dockerjava.api.model.ExposedPorts#758a34ce,stopSignal=<null>,stopTimeout=<null>,hostConfig=com.github.dockerjava.api.model.HostConfig#7ec3394b[binds=com.github.dockerjava.api.model.Binds#bff34c6,blkioWeight=<null>,blkioWeightDevice=<null>,blkioDeviceReadBps=<null>,blkioDeviceWriteBps=<null>,blkioDeviceReadIOps=<null>,blkioDeviceWriteIOps=<null>,memorySwappiness=<null>,nanoCPUs=<null>,capAdd=<null>,capDrop=<null>,containerIDFile=<null>,cpuPeriod=<null>,cpuRealtimePeriod=<null>,cpuRealtimeRuntime=<null>,cpuShares=<null>,cpuQuota=<null>,cpusetCpus=<null>,cpusetMems=<null>,devices=<null>,deviceCgroupRules=<null>,diskQuota=<null>,dns=<null>,dnsOptions=<null>,dnsSearch=<null>,extraHosts={},groupAdd=<null>,ipcMode=<null>,cgroup=<null>,links=com.github.dockerjava.api.model.Links#1522d8a0,logConfig=<null>,lxcConf=<null>,memory=<null>,memorySwap=<null>,memoryReservation=<null>,kernelMemory=<null>,networkMode=<null>,oomKillDisable=<null>,init=<null>,autoRemove=<null>,oomScoreAdj=<null>,portBindings={},privileged=<null>,publishAllPorts=true,readonlyRootfs=<null>,restartPolicy=<null>,ulimits=<null>,cpuCount=<null>,cpuPercent=<null>,ioMaximumIOps=<null>,ioMaximumBandwidth=<null>,volumesFrom={},mounts=<null>,pidMode=<null>,isolation=<null>,securityOpts=<null>,storageOpt=<null>,cgroupParent=<null>,volumeDriver=<null>,shmSize=<null>,pidsLimit=<null>,runtime=<null>,tmpFs=<null>,utSMode=<null>,usernsMode=<null>,sysctls=<null>,consoleSize=<null>],labels={org.testcontainers=true, org.testcontainers.sessionId=c9db393d-d0ec-4740-848a-134abfe549c5},shell=<null>,networkingConfig=<null>,ipv4Address=<null>,ipv6Address=<null>,aliases=<null>,authConfig=AuthConfig[username=petechiboleca,password=tWindrifter12345,email=<null>,registryAddress=index.docker.io,auth=<null>,registrytoken=<null>,identitytoken=<null>,stackOrchestrator=<null>],execution=com.github.dockerjava.core.exec.CreateContainerCmdExec#5644dc81]
13:48:08.194 [main] DEBUG org.testcontainers.utility.MountableFile - Copying classpath resource(s) from jar:file:/C:/Users/Pete/.m2/repository/org/testcontainers/mysql/1.13.0/mysql-1.13.0.jar!/mysql-default-conf to C:\Users\Pete\AppData\Local\Temp\.testcontainers-tmp-5095191207689237918 to permit Docker to bind
13:48:08.194 [main] DEBUG org.testcontainers.utility.MountableFile - Copying resource mysql-default-conf from JAR file C:\Users\Pete\.m2\repository\org\testcontainers\mysql\1.13.0\mysql-1.13.0.jar
13:48:08.194 [main] DEBUG org.testcontainers.utility.MountableFile - Copying classpath resource(s) from jar:file:/C:/Users/Pete/.m2/repository/org/testcontainers/mysql/1.13.0/mysql-1.13.0.jar!/mysql-default-conf to C:\Users\Pete\AppData\Local\Temp\.testcontainers-tmp-5095191207689237918 to permit Docker to bind
13:48:08.195 [main] DEBUG org.testcontainers.utility.MountableFile - Copying resource mysql-default-conf from JAR file C:\Users\Pete\.m2\repository\org\testcontainers\mysql\1.13.0\mysql-1.13.0.jar
13:48:08.202 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d,false,com.github.dockerjava.core.exec.InspectContainerCmdExec#57fd91c9
13:48:08.203 [main] DEBUG com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: OkHttpWebTarget(okHttpClient=org.testcontainers.shaded.okhttp3.OkHttpClient#2c7b5824, baseUrl=http://docker.socket/, path=[/containers/ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d/json], queryParams={})
13:48:08.234 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: com.github.dockerjava.core.command.CopyArchiveToContainerCmdImpl#25e2a451[cp ,<null>, ,ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d,:,/]
13:48:08.379 [main] INFO 🐳 [mysql:8.0] - Starting container with ID: ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d
13:48:08.379 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d,com.github.dockerjava.core.exec.StartContainerCmdExec#63b1d4fa
13:48:09.716 [main] INFO 🐳 [mysql:8.0] - Container mysql:8.0 is starting: ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d
13:48:09.718 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d,false,com.github.dockerjava.core.exec.InspectContainerCmdExec#75459c75
13:48:09.718 [main] DEBUG com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: OkHttpWebTarget(okHttpClient=org.testcontainers.shaded.okhttp3.OkHttpClient#2c7b5824, baseUrl=http://docker.socket/, path=[/containers/ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d/json], queryParams={})
13:48:09.735 [ducttape-0] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d,false,com.github.dockerjava.core.exec.InspectContainerCmdExec#410298f0
13:48:09.737 [ducttape-0] DEBUG com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: OkHttpWebTarget(okHttpClient=org.testcontainers.shaded.okhttp3.OkHttpClient#2c7b5824, baseUrl=http://docker.socket/, path=[/containers/ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d/json], queryParams={})
13:48:09.753 [main] INFO 🐳 [mysql:8.0] - Waiting for database connection to become available at jdbc:mysql://localhost:32851/teste-integração-album-repositorio using query 'SELECT 1'
13:48:09.753 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d,false,com.github.dockerjava.core.exec.InspectContainerCmdExec#2a3c96e3
13:48:09.753 [main] DEBUG com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: OkHttpWebTarget(okHttpClient=org.testcontainers.shaded.okhttp3.OkHttpClient#2c7b5824, baseUrl=http://docker.socket/, path=[/containers/ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d/json], queryParams={})
13:48:09.792 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d,false,com.github.dockerjava.core.exec.InspectContainerCmdExec#a8e6492
13:48:09.792 [main] DEBUG com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: OkHttpWebTarget(okHttpClient=org.testcontainers.shaded.okhttp3.OkHttpClient#2c7b5824, baseUrl=http://docker.socket/, path=[/containers/ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d/json], queryParams={})
13:48:09.799 [main] DEBUG 🐳 [mysql:8.0] - Trying to create JDBC connection using com.mysql.cj.jdbc.Driver to jdbc:mysql://localhost:32851/teste-integração-album-repositorio?useSSL=false&allowPublicKeyRetrieval=true with properties: {user=root, password=root}
13:48:10.233 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d,false,com.github.dockerjava.core.exec.InspectContainerCmdExec#1e5f4170
13:48:10.233 [main] DEBUG com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: OkHttpWebTarget(okHttpClient=org.testcontainers.shaded.okhttp3.OkHttpClient#2c7b5824, baseUrl=http://docker.socket/, path=[/containers/ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d/json], queryParams={})
13:48:10.240 [main] DEBUG 🐳 [mysql:8.0] - Trying to create JDBC connection using com.mysql.cj.jdbc.Driver to jdbc:mysql://localhost:32851/teste-integração-album-repositorio?useSSL=false&allowPublicKeyRetrieval=true with properties: {user=root, password=root}
13:48:09.799 [main] DEBUG 🐳 [mysql:8.0] - Trying to create JDBC connection using com.mysql.cj.jdbc.Driver to jdbc:mysql://localhost:32851/teste-integração-album-repositorio?useSSL=false&allowPublicKeyRetrieval=true with properties: {user=root, password=root}
13:48:10.233 [main] DEBUG com.github.dockerjava.core.command.AbstrDockerCmd - Cmd: ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d,false,com.github.dockerjava.core.exec.InspectContainerCmdExec#1e5f4170
13:48:10.233 [main] DEBUG com.github.dockerjava.core.exec.InspectContainerCmdExec - GET: OkHttpWebTarget(okHttpClient=org.testcontainers.shaded.okhttp3.OkHttpClient#2c7b5824, baseUrl=http://docker.socket/, path=[/containers/ce913f5a3ea48d499b6882d31da0c9c37bb004b8036e321f6420ef5d2bd5b73d/json], queryParams={})
13:48:10.240 [main] DEBUG 🐳 [mysql:8.0] - Trying to create JDBC connection using com.mysql.cj.jdbc.Driver to jdbc:mysql://localhost:32851/teste-integração-album-repositorio?useSSL=false&allowPublicKeyRetrieval=true with properties: {user=root, password=root}
MySQL Container Docker Dependency and MySQL Connector 8.0 Dependency (Spring Boot is managing my connector)
<groupId>org.testcontainers</groupId>
<artifactId>mysql</artifactId>
version>1.13.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
Note: When i use PostgreSQLContainer, The test passes succesfully
Note 2: When the loop breaks it Says *Communications link failure

You cannot create a user called "root" in mysql, since it already exists. Remove this part, and see if it helps:
.withUsername("root")

Related

HikariPool-1 - Cannot acquire connection from data source in mockito

I am performing unit tests using mockito to return a dataSource using HikariDataSource,
but inform that you cannot get the connection to the network.
I understand that being a mock it is not necessary to hit the correct URL
07:24:50.913 [main] DEBUG com.zaxxer.hikari.HikariConfig - Driver class oracle.jdbc.driver.OracleDriver found in Thread context class loader sun.misc.Launcher$AppClassLoader#7106e68e
07:24:50.982 [main] WARN com.zaxxer.hikari.HikariConfig - HikariPool-1 - maxLifetime is less than 30000ms, setting to default 1800000ms.
07:24:50.982 [main] WARN com.zaxxer.hikari.HikariConfig - HikariPool-1 - idleTimeout has been set but has no effect because the pool is operating as a fixed size pool.
07:24:50.982 [main] DEBUG com.zaxxer.hikari.HikariConfig - HikariPool-1 - configuration:
07:24:50.987 [main] DEBUG com.zaxxer.hikari.HikariConfig - allowPoolSuspension.............false
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - autoCommit......................true
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - catalog.........................none
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionInitSql...............none
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionTestQuery.............none
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionTimeout...............20000
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSource......................none
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceClassName.............none
07:24:50.988 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceJNDI..................none
07:24:50.989 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceProperties............{password=<masked>}
07:24:50.989 [main] DEBUG com.zaxxer.hikari.HikariConfig - driverClassName................."oracle.jdbc.driver.OracleDriver"
07:24:50.989 [main] DEBUG com.zaxxer.hikari.HikariConfig - exceptionOverrideClassName......none
07:24:50.989 [main] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckProperties...........{}
07:24:50.989 [main] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckRegistry.............none
07:24:50.989 [main] DEBUG com.zaxxer.hikari.HikariConfig - idleTimeout.....................10000
07:24:50.989 [main] DEBUG com.zaxxer.hikari.HikariConfig - initializationFailTimeout.......1
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - isolateInternalQueries..........false
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - jdbcUrl.........................jdbc:oracle:thin:#192.168.55.147:1522:swd126
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - leakDetectionThreshold..........0
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - maxLifetime.....................1800000
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - maximumPoolSize.................10
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - metricRegistry..................none
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - metricsTrackerFactory...........none
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - minimumIdle.....................10
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - password........................<masked>
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - poolName........................"HikariPool-1"
07:24:50.990 [main] DEBUG com.zaxxer.hikari.HikariConfig - readOnly........................false
07:24:50.991 [main] DEBUG com.zaxxer.hikari.HikariConfig - registerMbeans..................false
07:24:50.991 [main] DEBUG com.zaxxer.hikari.HikariConfig - scheduledExecutor...............none
07:24:50.991 [main] DEBUG com.zaxxer.hikari.HikariConfig - schema..........................none
07:24:50.991 [main] DEBUG com.zaxxer.hikari.HikariConfig - threadFactory...................internal
07:24:50.991 [main] DEBUG com.zaxxer.hikari.HikariConfig - transactionIsolation............default
07:24:50.991 [main] DEBUG com.zaxxer.hikari.HikariConfig - username........................"teste"
07:24:50.991 [main] DEBUG com.zaxxer.hikari.HikariConfig - validationTimeout...............5000
07:24:50.992 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
07:24:50.998 [main] WARN com.zaxxer.hikari.util.DriverDataSource - Registered driver with driverClassName=oracle.jdbc.driver.OracleDriver was not found, trying direct instantiation.
07:24:50.999 [main] DEBUG com.zaxxer.hikari.util.DriverDataSource - Driver class oracle.jdbc.driver.OracleDriver found in Thread context class loader sun.misc.Launcher$AppClassLoader#7106e68e
07:24:54.084 [main] DEBUG com.zaxxer.hikari.pool.PoolBase - HikariPool-1 - Failed to create/setup connection: IO Error: The Network Adapter could not establish the connection
07:24:54.086 [main] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Cannot acquire connection from data source
java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:445)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:464)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:594)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:229)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1360)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:486)
... 78 common frames omitted
#Component
public class ConfigDataSource {
#Autowired
private Properties properties;
public DataSource getDataSource(String url, String username, String password) {
DataSource dataSource = null;
try {
HikariConfig ds = new HikariConfig();
ds.setJdbcUrl(url);
ds.setUsername(username);
ds.setPassword(password);
ds.setDriverClassName(properties.getDriveClassName());
ds.setConnectionTimeout(properties.getConnectionTimeout());
ds.setMinimumIdle(properties.getMinimumIdle());
ds.setMaximumPoolSize(properties.getMaximumPoolSize());
ds.setIdleTimeout(properties.getIdleTimeout());
ds.setMaxLifetime(properties.getMaxLifetime());
dataSource = new HikariDataSource(ds);
} catch (Exception e) {
System.err.println("Error connecting to the database: " + e.getMessage());
}
return dataSource;
}
}
Mockito:
#ExtendWith(MockitoExtension.class)
public class ConfigDataSourceTest {
#Mock
private Properties properties;
#InjectMocks
private ConfigDataSource configDataSource;
#Test
public void configDataSourceTest() {
String jdbcUrl = "jdbc:oracle:thin:teste:swd001";
String userName = "teste";
String password = "teste";
String divreClassName = "oracle.jdbc.driver.OracleDriver";
Integer connectionTimeout = 20000;
Integer minimumIdle = 100;
Integer maximumPoolSize = 10;
Integer idleTimeout = 10000;
Integer maxLifetime = 1000;
when(properties.getDriveClassName()).thenReturn(divreClassName);
when(properties.getConnectionTimeout()).thenReturn(connectionTimeout);
when(properties.getMinimumIdle()).thenReturn(minimumIdle);
when(properties.getMaximumPoolSize()).thenReturn(maximumPoolSize);
when(properties.getIdleTimeout()).thenReturn(idleTimeout);
when(properties.getMaxLifetime()).thenReturn(maxLifetime);
DataSource result = configDataSource.getDataSource(jdbcUrl, userName, password);
assertNotNull(result);
}
}

Convert a postman form-data post request to a java request

I want to "transform" the below form-data request in postman into java code (within a java caller). More precisely, I`m trying to implement a caller to the below displayed api so i can access the endpoint through a jar. The problem is that I have 2 String arrays, to and cc , and 2 Strings, content and subject (obviously the api sends an email / ignore the attachment field for now) and I have no idea how I can set those parameters to my form-data in java.
Here my post method in Main class
public static void myPostRequest() throws IOException {
URL object = new URL(POST_ENDPOINT);
HttpURLConnection postConnection = (HttpURLConnection) object.openConnection();
postConnection.setRequestMethod("POST");
postConnection.setRequestProperty("to", "alice#example.com");
postConnection.setRequestProperty("to", "bob#anotherex.com");
postConnection.setRequestProperty("cc", "alice#example.com");
postConnection.setRequestProperty("cc", "bob#anotherex.com");
postConnection.setRequestProperty("subject", "randomsubject");
postConnection.setRequestProperty("content", "randomContent");
// postConnection.setRequestProperty("contentType", "text/html");
// postConnection.setRequestProperty("Content-Type", "application/json");
postConnection.setDoOutput(true);
OutputStream os = postConnection.getOutputStream();
os.flush();
os.close();
int responseCode = postConnection.getResponseCode();
System.out.println("POST response code " + responseCode);
System.out.println("POST response message" + postConnection.getResponseMessage());
if (responseCode == HttpURLConnection.HTTP_OK) { //success
BufferedReader in = new BufferedReader(new InputStreamReader(postConnection.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println("RESPONSE: " + response.toString());
} else {
System.out.println("POST DIDN`T WORK");
}
}
And the controller method in the other application (that works in postman):
#ApiOperation("Send notification email")
#RequestMapping(path = "/email", method = RequestMethod.POST, consumes = {"multipart/form-data"})
private String sendNotificationEmail(#RequestParam("to") String[] to,
#RequestParam("cc") String[] cc,
#RequestParam("subject") String subject,
#RequestParam("content") String content) String contentType,
#RequestParam(name = "attachments") MultipartFile[] attachements
) {
EmailSender.sendMail(new EmailSettings(to, cc, subject, content, null), attachements);
return "Email sent";
}
Log:
"C:\Program Files\Java\jdk1.8.0_211\bin\java.exe" "-javaagent:C:\Program Files\Java\jdk1.8.0_211\jre\lib\rt.jar;C:\GIT\ocademo\target\classes;C:\Users\MARIUS1.POP\.m2\repository\org\springframework\spring-web\5.3.2\spring-web-5.3.2.jar;C:\Users\MARIUS1.POP\.m2\repository\org\springframework\spring-beans\5.3.2\spring-beans-5.3.2.jar;C:\Users\MARIUS1.POP\.m2\repository\org\springframework\spring-core\5.3.2\spring-core-5.3.2.jar;C:\Users\MARIUS1.POP\.m2\repository\org\springframework\spring-jcl\5.3.2\spring-jcl-5.3.2.jar;C:\Users\MARIUS1.POP\.m2\repository\org\apache\httpcomponents\httpclient\4.5.2\httpclient-4.5.2.jar;C:\Users\MARIUS1.POP\.m2\repository\org\apache\httpcomponents\httpcore\4.4.14\httpcore-4.4.14.jar;C:\Users\MARIUS1.POP\.m2\repository\commons-codec\commons-codec\1.15\commons-codec-1.15.jar;C:\Users\MARIUS1.POP\.m2\repository\org\springframework\spring-webflux\5.3.2\spring-webflux-5.3.2.jar;C:\Users\MARIUS1.POP\.m2\repository\io\projectreactor\reactor-core\3.4.1\reactor-core-3.4.1.jar;C:\Users\MARIUS1.POP\.m2\repository\org\reactivestreams\reactive-streams\1.0.3\reactive-streams-1.0.3.jar;C:\Users\MARIUS1.POP\.m2\repository\io\projectreactor\netty\reactor-netty\1.0.2\reactor-netty-1.0.2.jar;C:\Users\MARIUS1.POP\.m2\repository\io\projectreactor\netty\reactor-netty-core\1.0.2\reactor-netty-core-1.0.2.jar;C:\Users\MARIUS1.POP\.m2\repository\io\netty\netty-handler\4.1.55.Final\netty-handler-4.1.55.Final.jar;C:\Users\MARIUS1.POP\.m2\repository\io\netty\netty-common\4.1.55.Final\netty-common-4.1.55.Final.jar;C:\Users\MARIUS1.POP\.m2\repository\io\netty\netty-resolver\4.1.55.Final\netty-resolver-4.1.55.Final.jar;C:\Users\MARIUS1.POP\.m2\repository\io\netty\netty-buffer\4.1.55.Final\netty-buffer-4.1.55.Final.jar;C:\Users\MARIUS1.POP\.m2\repository\io\netty\netty-transport\4.1.55.Final\netty-transport-4.1.55.Final.jar;C:\Users\MARIUS1.POP\.m2\repository\io\netty\netty-codec\4.1.55.Final\netty-codec-4.1.55.Final.jar;C:\Users\MARIUS1.POP\.m2\repository\io\netty\netty-handler-proxy\4.1.55.Final\netty-handler-proxy-4.1.55.Final.jar;C:\Users\MARIUS1.POP\.m2\repository\io\netty\netty-codec-socks\4.1.55.Final\netty-codec-socks-4.1.55.Final.jar;C:\Users\MARIUS1.POP\.m2\repository\io\netty\netty-resolver-dns\4.1.55.Final\netty-resolver-dns-4.1.55.Final.jar;C:\Users\MARIUS1.POP\.m2\repository\io\netty\netty-codec-dns\4.1.55.Final\netty-codec-dns-4.1.55.Final.jar;C:\Users\MARIUS1.POP\.m2\repository\io\netty\netty-transport-native-epoll\4.1.55.Final\netty-transport-native-epoll-4.1.55.Final-linux-x86_64.jar;C:\Users\MARIUS1.POP\.m2\repository\io\netty\netty-transport-native-unix-common\4.1.55.Final\netty-transport-native-unix-common-4.1.55.Final.jar;C:\Users\MARIUS1.POP\.m2\repository\io\projectreactor\netty\reactor-netty-http\1.0.2\reactor-netty-http-1.0.2.jar;C:\Users\MARIUS1.POP\.m2\repository\io\netty\netty-codec-http\4.1.55.Final\netty-codec-http-4.1.55.Final.jar;C:\Users\MARIUS1.POP\.m2\repository\io\netty\netty-codec-http2\4.1.55.Final\netty-codec-http2-4.1.55.Final.jar;C:\Users\MARIUS1.POP\.m2\repository\io\projectreactor\netty\reactor-netty-http-brave\1.0.2\reactor-netty-http-brave-1.0.2.jar;C:\Users\MARIUS1.POP\.m2\repository\io\zipkin\brave\brave-instrumentation-http\5.13.2\brave-instrumentation-http-5.13.2.jar;C:\Users\MARIUS1.POP\.m2\repository\io\zipkin\brave\brave\5.13.2\brave-5.13.2.jar;C:\Users\MARIUS1.POP\.m2\repository\io\zipkin\reporter2\zipkin-reporter-brave\2.16.1\zipkin-reporter-brave-2.16.1.jar;C:\Users\MARIUS1.POP\.m2\repository\io\zipkin\reporter2\zipkin-reporter\2.16.1\zipkin-reporter-2.16.1.jar;C:\Users\MARIUS1.POP\.m2\repository\io\zipkin\zipkin2\zipkin\2.23.0\zipkin-2.23.0.jar;C:\Users\MARIUS1.POP\.m2\repository\com\github\Cloudmersive\Cloudmersive.APIClient.Java\v3.62\Cloudmersive.APIClient.Java-v3.62.jar;C:\Users\MARIUS1.POP\.m2\repository\org\threeten\threetenbp\1.3.5\threetenbp-1.3.5.jar;C:\Users\MARIUS1.POP\.m2\repository\com\squareup\okhttp\okhttp\2.7.5\okhttp-2.7.5.jar;C:\Users\MARIUS1.POP\.m2\repository\com\squareup\okio\okio\1.6.0\okio-1.6.0.jar;C:\Users\MARIUS1.POP\.m2\repository\com\google\code\gson\gson\2.8.6\gson-2.8.6.jar;C:\Users\MARIUS1.POP\.m2\repository\io\gsonfire\gson-fire\1.8.0\gson-fire-1.8.0.jar;C:\Users\MARIUS1.POP\.m2\repository\com\squareup\okhttp\logging-interceptor\2.7.5\logging-interceptor-2.7.5.jar;C:\Users\MARIUS1.POP\.m2\repository\io\swagger\swagger-annotations\1.5.15\swagger-annotations-1.5.15.jar;C:\Users\MARIUS1.POP\.m2\repository\org\springframework\boot\spring-boot-starter\2.4.1\spring-boot-starter-2.4.1.jar;C:\Users\MARIUS1.POP\.m2\repository\org\springframework\boot\spring-boot\2.4.1\spring-boot-2.4.1.jar;C:\Users\MARIUS1.POP\.m2\repository\org\springframework\spring-context\5.3.2\spring-context-5.3.2.jar;C:\Users\MARIUS1.POP\.m2\repository\org\springframework\spring-aop\5.3.2\spring-aop-5.3.2.jar;C:\Users\MARIUS1.POP\.m2\repository\org\springframework\spring-expression\5.3.2\spring-expression-5.3.2.jar;C:\Users\MARIUS1.POP\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.4.1\spring-boot-autoconfigure-2.4.1.jar;C:\Users\MARIUS1.POP\.m2\repository\org\springframework\boot\spring-boot-starter-logging\2.4.1\spring-boot-starter-logging-2.4.1.jar;C:\Users\MARIUS1.POP\.m2\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\Users\MARIUS1.POP\.m2\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;C:\Users\MARIUS1.POP\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.13.3\log4j-to-slf4j-2.13.3.jar;C:\Users\MARIUS1.POP\.m2\repository\org\apache\logging\log4j\log4j-api\2.13.3\log4j-api-2.13.3.jar;C:\Users\MARIUS1.POP\.m2\repository\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;C:\Users\MARIUS1.POP\.m2\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;C:\Users\MARIUS1.POP\.m2\repository\org\yaml\snakeyaml\1.27\snakeyaml-1.27.jar;C:\Users\MARIUS1.POP\.m2\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar" oca.demo.ocademo.Main
14:37:03.760 [main] DEBUG reactor.util.Loggers - Using Slf4j logging framework
14:37:03.789 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory - Using SLF4J as the default logging framework
14:37:03.789 [main] DEBUG io.netty.util.internal.PlatformDependent - Platform: Windows
14:37:03.791 [main] DEBUG io.netty.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
14:37:03.791 [main] DEBUG io.netty.util.internal.PlatformDependent0 - Java version: 8
14:37:03.792 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
14:37:03.793 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
14:37:03.793 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
14:37:03.793 [main] DEBUG io.netty.util.internal.PlatformDependent0 - direct buffer constructor: available
14:37:03.794 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: available, true
14:37:03.794 [main] DEBUG io.netty.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable prior to Java9
14:37:03.794 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.<init>(long, int): available
14:37:03.794 [main] DEBUG io.netty.util.internal.PlatformDependent - sun.misc.Unsafe: available
14:37:03.794 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.tmpdir: C:\Users\MARIUS1.POP\AppData\Local\Temp (java.io.tmpdir)
14:37:03.794 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model)
14:37:03.795 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.maxDirectMemory: 3791650816 bytes
14:37:03.795 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.uninitializedArrayAllocationThreshold: -1
14:37:03.796 [main] DEBUG io.netty.util.internal.CleanerJava6 - java.nio.ByteBuffer.cleaner(): available
14:37:03.796 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false
14:37:03.809 [main] DEBUG reactor.netty.tcp.TcpResources - [http] resources will use the default LoopResources: DefaultLoopResources {prefix=reactor-http, daemon=true, selectCount=12, workerCount=12}
14:37:03.809 [main] DEBUG reactor.netty.tcp.TcpResources - [http] resources will use the default ConnectionProvider: reactor.netty.resources.DefaultPooledConnectionProvider#614c5515
14:37:03.843 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.level: simple
14:37:03.843 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.targetRecords: 4
14:37:04.070 [main] DEBUG org.springframework.web.reactive.function.client.ExchangeFunctions - [7e0b85f9] HTTP POST http://mdl07cj001.bt.wan:7003/MIS/Notification/Email/api/notification/email
14:37:04.135 [main] DEBUG reactor.netty.resources.DefaultLoopEpoll - Default Epoll support : false
14:37:04.136 [main] DEBUG reactor.netty.resources.DefaultLoopKQueue - Default KQueue support : false
14:37:04.139 [main] DEBUG io.netty.channel.MultithreadEventLoopGroup - -Dio.netty.eventLoopThreads: 24
14:37:04.152 [main] DEBUG io.netty.util.internal.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024
14:37:04.152 [main] DEBUG io.netty.util.internal.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096
14:37:04.156 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.noKeySetOptimization: false
14:37:04.157 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.selectorAutoRebuildThreshold: 512
14:37:04.162 [main] DEBUG io.netty.util.internal.PlatformDependent - org.jctools-core.MpscChunkedArrayQueue: available
14:37:04.194 [main] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv4Stack: false
14:37:04.194 [main] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv6Addresses: false
14:37:04.228 [main] DEBUG io.netty.util.NetUtilInitializations - Loopback interface: lo (Software Loopback Interface 1, 127.0.0.1)
14:37:04.229 [main] DEBUG io.netty.util.NetUtil - Failed to get SOMAXCONN from sysctl and file \proc\sys\net\core\somaxconn. Default: 200
14:37:04.278 [main] DEBUG io.netty.resolver.dns.DefaultDnsServerAddressStreamProvider - Default DNS servers: [/10.100.101.50:53, /10.100.101.51:53] (sun.net.dns.ResolverConfiguration)
14:37:04.283 [main] DEBUG reactor.netty.resources.PooledConnectionProvider - Creating a new [http] client pool [PoolFactory{evictionInterval=PT0S, leasingStrategy=fifo, maxConnections=500, maxIdleTime=-1, maxLifeTime=-1, metricsEnabled=false, pendingAcquireMaxCount=1000, pendingAcquireTimeout=45000}] for [mdl07cj001.bt.wan:7003]
14:37:04.317 [main] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.processId: 15532 (auto-detected)
14:37:04.356 [main] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.machineId: f4:93:9f:ff:fe:f6:06:8a (auto-detected)
14:37:04.373 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numHeapArenas: 24
14:37:04.373 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numDirectArenas: 24
14:37:04.373 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.pageSize: 8192
14:37:04.373 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxOrder: 11
14:37:04.373 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.chunkSize: 16777216
14:37:04.373 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.smallCacheSize: 256
14:37:04.373 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.normalCacheSize: 64
14:37:04.373 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedBufferCapacity: 32768
14:37:04.373 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimInterval: 8192
14:37:04.373 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimIntervalMillis: 0
14:37:04.373 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.useCacheForAllThreads: true
14:37:04.373 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedByteBuffersPerChunk: 1023
14:37:04.379 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.allocator.type: pooled
14:37:04.379 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.threadLocalDirectBufferSize: 0
14:37:04.379 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.maxThreadLocalCharBufferSize: 16384
14:37:04.392 [reactor-http-nio-2] DEBUG reactor.netty.resources.DefaultPooledConnectionProvider - [id: 0xacaa8747] Created a new pooled channel, now 1 active connections and 0 inactive connections
14:37:04.409 [reactor-http-nio-2] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.checkAccessible: true
14:37:04.409 [reactor-http-nio-2] DEBUG io.netty.buffer.AbstractByteBuf - -Dio.netty.buffer.checkBounds: true
14:37:04.410 [reactor-http-nio-2] DEBUG io.netty.util.ResourceLeakDetectorFactory - Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector#22f23501
14:37:04.413 [reactor-http-nio-2] DEBUG reactor.netty.transport.TransportConfig - [id: 0xacaa8747] Initialized pipeline DefaultChannelPipeline{(reactor.left.httpCodec = io.netty.handler.codec.http.HttpClientCodec), (reactor.left.httpDecompressor = io.netty.handler.codec.http.HttpContentDecompressor), (reactor.right.reactiveBridge = reactor.netty.channel.ChannelOperationsHandler)}
14:37:04.438 [reactor-http-nio-1] DEBUG io.netty.util.ResourceLeakDetectorFactory - Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector#492aff7f
14:37:04.439 [reactor-http-nio-1] DEBUG io.netty.resolver.dns.DnsQueryContext - [id: 0xa3a7d02f] WRITE: UDP, [23067: /10.100.101.50:53], DefaultDnsQuestion(mdl07cj001.bt.wan. IN A)
14:37:04.443 [reactor-http-nio-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxCapacityPerThread: 4096
14:37:04.443 [reactor-http-nio-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxSharedCapacityFactor: 2
14:37:04.443 [reactor-http-nio-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.linkCapacity: 16
14:37:04.443 [reactor-http-nio-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.ratio: 8
14:37:04.443 [reactor-http-nio-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.delayedQueue.ratio: 8
14:37:04.456 [reactor-http-nio-1] DEBUG io.netty.resolver.dns.DnsNameResolver - [id: 0xa3a7d02f] RECEIVED: UDP [23067: /10.100.101.50:53], DatagramDnsResponse(from: /10.100.101.50:53, to: /0:0:0:0:0:0:0:0:55442, 23067, QUERY(0), NoError(0), RD AA RA)
DefaultDnsQuestion(mdl07cj001.bt.wan. IN A)
DefaultDnsRawRecord(mdl07cj001.bt.wan. 3600 IN A 4B)
DefaultDnsRawRecord(OPT flags:0 udp:4000 0B)
14:37:04.460 [reactor-http-nio-2] DEBUG reactor.netty.resources.DefaultPooledConnectionProvider - [id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003] Registering pool release on close event for channel
14:37:04.460 [reactor-http-nio-2] DEBUG reactor.netty.resources.DefaultPooledConnectionProvider - [id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003] Channel connected, now 1 active connections and 0 inactive connections
14:37:04.461 [reactor-http-nio-2] DEBUG reactor.netty.resources.DefaultPooledConnectionProvider - [id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003] onStateChange(PooledConnection{channel=[id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003]}, [connected])
14:37:04.467 [reactor-http-nio-2] DEBUG reactor.netty.resources.DefaultPooledConnectionProvider - [id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003] onStateChange(GET{uri=/, connection=PooledConnection{channel=[id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003]}}, [configured])
14:37:04.468 [reactor-http-nio-2] DEBUG reactor.netty.http.client.HttpClientConnect - [id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003] Handler is being applied: {uri=http://mdl07cj001.bt.wan:7003/MIS/Notification/Email/api/notification/email, method=POST}
14:37:04.470 [reactor-http-nio-2] DEBUG reactor.netty.resources.DefaultPooledConnectionProvider - [id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003] onStateChange(POST{uri=/MIS/Notification/Email/api/notification/email, connection=PooledConnection{channel=[id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003]}}, [request_prepared])
14:37:04.474 [reactor-http-nio-2] DEBUG org.springframework.http.codec.FormHttpMessageWriter - [7e0b85f9] Writing form fields [to, cc, subject, content, contentType] (content masked)
14:37:04.488 [reactor-http-nio-2] DEBUG reactor.netty.resources.DefaultPooledConnectionProvider - [id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003] onStateChange(POST{uri=/MIS/Notification/Email/api/notification/email, connection=PooledConnection{channel=[id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003]}}, [request_sent])
14:37:04.517 [reactor-http-nio-2] DEBUG reactor.netty.http.client.HttpClientOperations - [id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003] Received response (auto-read:false) : [Cache-Control=no-cache, no-store, max-age=0, must-revalidate, Date=Mon, 18 Jan 2021 12:37:04 GMT, Pragma=no-cache, Transfer-Encoding=chunked, Expires=0, X-ORACLE-DMS-ECID=57445be9-bcb8-496b-bd25-4986e33f3e23-00000135, X-ORACLE-DMS-RID=0, X-Frame-Options=DENY, Accept=multipart/form-data, X-Content-Type-Options=nosniff, X-XSS-Protection=1; mode=block]
14:37:04.517 [reactor-http-nio-2] DEBUG reactor.netty.resources.DefaultPooledConnectionProvider - [id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003] onStateChange(POST{uri=/MIS/Notification/Email/api/notification/email, connection=PooledConnection{channel=[id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003]}}, [response_received])
14:37:04.519 [reactor-http-nio-2] DEBUG org.springframework.web.reactive.function.client.ExchangeFunctions - [7e0b85f9] Response 415 UNSUPPORTED_MEDIA_TYPE
14:37:04.530 [reactor-http-nio-2] DEBUG reactor.netty.channel.FluxReceive - [id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003] FluxReceive{pending=0, cancelled=false, inboundDone=false, inboundError=null}: subscribing inbound receiver
14:37:04.531 [reactor-http-nio-2] DEBUG reactor.netty.http.client.HttpClientOperations - [id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003] Received last HTTP packet
14:37:04.540 [reactor-http-nio-2] DEBUG reactor.netty.resources.DefaultPooledConnectionProvider - [id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003] onStateChange(POST{uri=/MIS/Notification/Email/api/notification/email, connection=PooledConnection{channel=[id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003]}}, [response_completed])
Exception in thread "main" org.springframework.web.reactive.function.client.WebClientResponseException$UnsupportedMediaType: 415 Unsupported Media Type from POST http://mdl07cj001.bt.wan:7003/MIS/Notification/Email/api/notification/email
at org.springframework.web.reactive.function.client.WebClientResponseException.create(WebClientResponseException.java:195)
14:37:04.541 [reactor-http-nio-2] DEBUG reactor.netty.resources.DefaultPooledConnectionProvider - [id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003] onStateChange(POST{uri=/MIS/Notification/Email/api/notification/email, connection=PooledConnection{channel=[id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003]}}, [disconnecting])
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
14:37:04.541 [reactor-http-nio-2] DEBUG reactor.netty.resources.DefaultPooledConnectionProvider - [id: 0xacaa8747, L:/10.0.69.115:49384 - R:mdl07cj001.bt.wan/10.100.139.63:7003] Releasing channel
|_ checkpoint ⇢ 415 from POST http://mdl07cj001.bt.wan:7003/MIS/Notification/Email/api/notification/email [DefaultWebClient]
Stack trace:
at org.springframework.web.reactive.function.client.WebClientResponseException.create(WebClientResponseException.java:195)
at org.springframework.web.reactive.function.client.DefaultClientResponse.lambda$createException$1(DefaultClientResponse.java:216)
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:106)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1784)
at reactor.core.publisher.FluxDefaultIfEmpty$DefaultIfEmptySubscriber.onComplete(FluxDefaultIfEmpty.java:107)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onComplete(FluxMapFuseable.java:150)
at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onComplete(FluxContextWrite.java:126)
at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onComplete(FluxMapFuseable.java:344)
at reactor.core.publisher.FluxFilterFuseable$FilterFuseableConditionalSubscriber.onComplete(FluxFilterFuseable.java:391)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1785)
at reactor.core.publisher.MonoCollect$CollectSubscriber.onComplete(MonoCollect.java:159)
at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:142)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:259)
at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:142)
at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:383)
at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:396)
at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:452)
at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:664)
at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:94)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
Suppressed: java.lang.Exception: #block terminated with an error
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:99)
at reactor.core.publisher.Mono.block(Mono.java:1703)
at oca.demo.ocademo.GetAndPost.newPostMethod(GetAndPost.java:120)
at oca.demo.ocademo.Main.main(Main.java:8)
Process finished with exit code 1
Postman allow converting request to other languages, just click code link below the request url.
If you are using spring, as I see with RequestMapping anotation, why dont you use restTemplate or webclient? (Depnding on the spring version you are using). It will be much easier.
Rest Template for Spring 4 and below, imperative style
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
MultiValueMap<String, String> map= new LinkedMultiValueMap<>();
map.add("to", "alice#example.com");
map.add("to", "bob#anotherex.com");
map.add("cc", "alice#example.com");
map.add("cc", "bob#anotherex.com");
map.add("subject", "randomsubject");
map.add("content", "randomContent");
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<MultiValueMap<String, String>>(map, headers);
RestTemplate restTemplate= new RestTemplateBuilder().rootUri("http://localhost:8080").build();
restTemplate.postForLocation( "url", request);
WebClient for Spring 5+, reactive style Requires WebFlux
WebClient client = WebClient.builder()
.baseUrl("http://localhost:8080")
.defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE)
.build();
client.post()
.uri("/api/notification/email...")
.body(BodyInserters.fromFormData("to", "alice#example.com")
.with("to", "bob#anotherex.com")
.with("cc", "alice#example.com")
.with("cc", "bob#anotherex.com")
.with("subject", "randomsubject")
.with("content", "randomContent"))
.retrieve()
.toBodilessEntity()
.block();
In both cases uses internally a multivalue map, so you can add various values with the same key, such as to and cc

Apache Solr "HTTP ERROR 503" after unloading Core and trying to re-create it

I was looking how I can query some XML files with Solr and thus I went and changed the schema.xml file located under the collection1 directory.
Then I launched a query, which I knew it should return 1 result but in vain.
So I figured I might have to re-load the CORE (the idea was taken from CoreAdmin -Solr Wiki). So I did, but for some reason I wasn't able to. Thats said, I decided to restart the service (sorl/example java -jar start.jar) and now I am getting this error:
HTTP ERROR 503
Problem accessing /solr/. Reason:
Server is shutting down or failed to initialize
Powered by Jetty://
This is the command prompt output which shows that server is running??
0 [main] INFO org.eclipse.jetty.server.Server û jetty-8.1.10.v20130312
75 [main] INFO org.eclipse.jetty.deploy.providers.ScanningAppProvider û Depl
oyment monitor C:\Users\kapel_000\Desktop\solr-4.10.2\example\contexts at interv
al 0
83 [main] INFO org.eclipse.jetty.deploy.DeploymentManager û Deployable added
: C:\Users\kapel_000\Desktop\solr-4.10.2\example\contexts\solr-jetty-context.xml
1916 [main] INFO org.eclipse.jetty.webapp.StandardDescriptorProcessor û NO JSP
Support for /solr, did not find org.apache.jasper.servlet.JspServlet
2066 [main] INFO org.apache.solr.servlet.SolrDispatchFilter û SolrDispatchFilt
er.init()
2083 [main] INFO org.apache.solr.core.SolrResourceLoader û JNDI not configured
for solr (NoInitialContextEx)
2083 [main] INFO org.apache.solr.core.SolrResourceLoader û solr home defaulted
to 'solr/' (could not find system property or JNDI)
2084 [main] INFO org.apache.solr.core.SolrResourceLoader û new SolrResourceLoa
der for directory: 'solr/'
2248 [main] INFO org.apache.solr.core.ConfigSolr û Loading container configura
tion from C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr\solr.xml
2323 [main] INFO org.apache.solr.core.CoresLocator û Config-defined core root
directory: C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr
2334 [main] INFO org.apache.solr.core.CoreContainer û New CoreContainer 307272
05
2335 [main] INFO org.apache.solr.core.CoreContainer û Loading cores into CoreC
ontainer [instanceDir=solr/]
2351 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting socketTimeout to: 0
2352 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting urlScheme to: null
2359 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting connTimeout to: 0
2360 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting maxConnectionsPerHost to: 20
2362 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting corePoolSize to: 0
2363 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting maximumPoolSize to: 2147483647
2363 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting maxThreadIdleTime to: 5
2364 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting sizeOfQueue to: -1
2365 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting fairnessPolicy to: false
2596 [main] INFO org.apache.solr.update.UpdateShardHandler û Creating UpdateSh
ardHandler HTTP client with params: socketTimeout=0&connTimeout=0&retry=false
2599 [main] INFO org.apache.solr.logging.LogWatcher û SLF4J impl is org.slf4j.
impl.Log4jLoggerFactory
2601 [main] INFO org.apache.solr.logging.LogWatcher û Registering Log Listener
[Log4j (org.slf4j.impl.Log4jLoggerFactory)]
2603 [main] INFO org.apache.solr.core.CoreContainer û Host Name:
7194 [main] INFO org.apache.solr.core.CoresLocator û Looking for core definiti
ons underneath C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr
7213 [main] INFO org.apache.solr.core.CoresLocator û Found core collection1 in
C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr\collection1\
7215 [main] INFO org.apache.solr.core.CoresLocator û Found core collection1 in
C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr\collection5\
7216 [main] INFO org.apache.solr.core.CoresLocator û Found 2 core definitions
7220 [main] ERROR org.apache.solr.servlet.SolrDispatchFilter û Could not start
Solr. Check solr/home property and the logs
7270 [main] ERROR org.apache.solr.core.SolrCore û null:org.apache.solr.common.S
olrException: Found multiple cores with the name [collection1], with instancedir
s [C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr\collection1\] and [C:\Use
rs\kapel_000\Desktop\solr-4.10.2\example\solr\collection5\]
at org.apache.solr.core.CoreContainer.checkForDuplicateCoreNames(CoreCon
tainer.java:297)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:241)
at org.apache.solr.servlet.SolrDispatchFilter.createCoreContainer(SolrDi
spatchFilter.java:189)
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.ja
va:136)
at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:64)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.ja
va:719)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletC
ontextHandler.java:265)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.jav
a:1252)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandle
r.java:710)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494
)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:64)
at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(Stan
dardStarter.java:39)
at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:1
86)
at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentM
anager.java:494)
at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.j
ava:141)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(Scan
ningAppProvider.java:145)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(Sc
anningAppProvider.java:56)
at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:609)
at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:540)
at org.eclipse.jetty.util.Scanner.scan(Scanner.java:403)
at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:337)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:64)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(Scanni
ngAppProvider.java:121)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:64)
at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(Deploymen
tManager.java:555)
at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.
java:230)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:64)
at org.eclipse.jetty.util.component.AggregateLifeCycle.doStart(Aggregate
LifeCycle.java:81)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHand
ler.java:58)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrappe
r.java:96)
at org.eclipse.jetty.server.Server.doStart(Server.java:280)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:64)
at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:12
59)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:118
2)
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.eclipse.jetty.start.Main.invokeMain(Main.java:473)
at org.eclipse.jetty.start.Main.start(Main.java:615)
at org.eclipse.jetty.start.Main.main(Main.java:96)
7276 [main] INFO org.apache.solr.servlet.SolrDispatchFilter û SolrDispatchFilt
er.init() done
7302 [main] INFO org.eclipse.jetty.server.AbstractConnector û Started SocketCo
nnector#0.0.0.0:8983
Does any of this make any sense? Did I messed up badly (more than once?) or is it something simle I am not aware of?
Here's your error:
7270 [main] ERROR org.apache.solr.core.SolrCore û
null:org.apache.solr.common.S olrException: Found multiple cores with
the name [collection1], with instancedirs
[C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr\collection1] and
[C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr\collection5]
Check your config, you've got the core collection1 configured twice. Once pointing to example\solr\collection1 and once to example\solr\collection5
HTTP ERROR 503
Problem accessing /solr/. Reason:
Server is shutting down or failed to initialize

"Unknown error" with cypher query on all relations

Using neo4j 2.0.1 I frequently observe Java heap space problems. For example when trying to delete all relations of one type I only get an "unknown error".
I'm running neo4j server on my local machine (kubuntu 13.10) with 8 gig ram, 6gig java heap space. the same happens when performing the query on a virtual ubuntu server.
did not observe these issues with previous versions.
I also attached the neo4j output from the console. I'm not a java developer, so it does not really help me.
thanks for suggestions
Starting Neo4j Server console-mode...
Using additional JVM arguments: -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xms512m -Xmx6196m
Detected incorrectly shut down database, performing recovery..
13:50:00.431 [main] WARN o.e.j.server.handler.ContextHandler - o.e.j.s.ServletContextHandler#35f6002a{/,null,null} contextPath ends with /
13:50:00.431 [main] WARN o.e.j.server.handler.ContextHandler - Empty contextPath
13:50:00.433 [main] INFO org.eclipse.jetty.server.Server - jetty-9.0.5.v20130815
13:50:00.458 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.h.MovedContextHandler#453831c{/,null,AVAILABLE}
13:50:00.534 [main] INFO o.e.j.w.StandardDescriptorProcessor - NO JSP Support for /webadmin, did not find org.apache.jasper.servlet.JspServlet
13:50:00.546 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.w.WebAppContext#3c3aea35{/webadmin,jar:file:/media/data/software/Neo4j/system/lib/neo4j-server-2.0.1-static-web.jar!/webadmin-html,AVAILABLE}
13:50:00.950 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler#2078afe{/db/manage,null,AVAILABLE}
13:50:01.206 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler#216e21b4{/db/data,null,AVAILABLE}
13:50:01.224 [main] INFO o.e.j.w.StandardDescriptorProcessor - NO JSP Support for /browser, did not find org.apache.jasper.servlet.JspServlet
13:50:01.225 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.w.WebAppContext#513f27b6{/browser,jar:file:/media/data/software/Neo4j/system/lib/neo4j-browser-2.0.1.jar!/browser,AVAILABLE}
13:50:01.314 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler#35f6002a{/,null,AVAILABLE}
13:50:01.327 [main] INFO o.e.jetty.server.ServerConnector - Started ServerConnector#42f400c3{HTTP/1.1}{localhost:7474}
13:50:01.756 [main] INFO o.e.jetty.server.ServerConnector - Started ServerConnector#40671ba6{SSL-HTTP/1.1}{localhost:7473}
13:50:02.380 [Thread-24] INFO o.e.jetty.server.ServerConnector - Stopped ServerConnector#42f400c3{HTTP/1.1}{localhost:7474}
13:50:02.384 [Thread-24] INFO o.e.jetty.server.ServerConnector - Stopped ServerConnector#40671ba6{SSL-HTTP/1.1}{localhost:7473}
13:50:02.385 [Thread-24] INFO o.e.j.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler#35f6002a{/,null,UNAVAILABLE}
13:50:02.386 [Thread-24] INFO o.e.j.server.handler.ContextHandler - Stopped o.e.j.w.WebAppContext#513f27b6{/browser,jar:file:/media/data/software/Neo4j/system/lib/neo4j-browser-2.0.1.jar!/browser,UNAVAILABLE}
13:50:02.387 [Thread-24] INFO o.e.j.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler#216e21b4{/db/data,null,UNAVAILABLE}
13:50:02.387 [Thread-24] INFO o.e.j.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler#2078afe{/db/manage,null,UNAVAILABLE}
13:50:02.388 [Thread-24] INFO o.e.j.server.handler.ContextHandler - Stopped o.e.j.w.WebAppContext#3c3aea35{/webadmin,jar:file:/media/data/software/Neo4j/system/lib/neo4j-server-2.0.1-static-web.jar!/webadmin-html,UNAVAILABLE}
13:50:02.388 [Thread-24] INFO o.e.j.server.handler.ContextHandler - Stopped o.e.j.s.h.MovedContextHandler#453831c{/,null,UNAVAILABLE}
Starting Neo4j Server console-mode...
Using additional JVM arguments: -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xms512m -Xmx6196m
13:50:11.228 [main] WARN o.e.j.server.handler.ContextHandler - o.e.j.s.ServletContextHandler#21b4406c{/,null,null} contextPath ends with /
13:50:11.228 [main] WARN o.e.j.server.handler.ContextHandler - Empty contextPath
13:50:11.230 [main] INFO org.eclipse.jetty.server.Server - jetty-9.0.5.v20130815
13:50:11.256 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.h.MovedContextHandler#13b357fd{/,null,AVAILABLE}
13:50:11.346 [main] INFO o.e.j.w.StandardDescriptorProcessor - NO JSP Support for /webadmin, did not find org.apache.jasper.servlet.JspServlet
13:50:11.358 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.w.WebAppContext#24c13894{/webadmin,jar:file:/media/data/software/Neo4j/system/lib/neo4j-server-2.0.1-static-web.jar!/webadmin-html,AVAILABLE}
13:50:11.813 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler#66d51e79{/db/manage,null,AVAILABLE}
13:50:12.108 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler#4984bbd4{/db/data,null,AVAILABLE}
13:50:12.129 [main] INFO o.e.j.w.StandardDescriptorProcessor - NO JSP Support for /browser, did not find org.apache.jasper.servlet.JspServlet
13:50:12.131 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.w.WebAppContext#3f30e292{/browser,jar:file:/media/data/software/Neo4j/system/lib/neo4j-browser-2.0.1.jar!/browser,AVAILABLE}
13:50:12.241 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler#21b4406c{/,null,AVAILABLE}
13:50:12.258 [main] INFO o.e.jetty.server.ServerConnector - Started ServerConnector#7ad78ab8{HTTP/1.1}{localhost:7474}
13:50:12.708 [main] INFO o.e.jetty.server.ServerConnector - Started ServerConnector#3f9c4b9a{SSL-HTTP/1.1}{localhost:7473}
13:54:42.617 [qtp808144526-41] WARN o.e.jetty.servlet.ServletHandler - /db/manage/server/monitor/fetch
javax.ws.rs.WebApplicationException: javax.ws.rs.WebApplicationException: org.eclipse.jetty.io.EofException
at org.neo4j.server.rest.repr.OutputFormat$1.write(OutputFormat.java:174) ~[neo4j-server-2.0.1.jar:2.0.1]
at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71) ~[jersey-core-1.9.jar:1.9]
at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57) ~[jersey-core-1.9.jar:1.9]
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306) ~[jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1437) ~[jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349) ~[jersey-server-1.9.jar:1.9]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339) ~[jersey-server-1.9.jar:1.9]
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) ~[jersey-server-1.9.jar:1.9]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) ~[jersey-server-1.9.jar:1.9]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699) ~[jersey-server-1.9.jar:1.9]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) ~[javax.servlet-3.0.0.v201112011016.jar:na]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:698) ~[jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1506) ~[jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112) ~[neo4j-server-2.0.1.jar:2.0.1]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1477) ~[jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503) [jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:211) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1096) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:432) [jetty-servlet-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1030) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.Server.handle(Server.java:445) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:268) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:229) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:358) [jetty-io-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:601) [jetty-util-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:532) [jetty-util-9.0.5.v20130815.jar:9.0.5.v20130815]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
Caused by: javax.ws.rs.WebApplicationException: org.eclipse.jetty.io.EofException
at org.neo4j.server.rest.repr.formats.StreamingJsonFormat$StreamingRepresentationFormat.flush(StreamingJsonFormat.java:401) ~[neo4j-server-2.0.1.jar:2.0.1]
at org.neo4j.server.rest.repr.formats.StreamingJsonFormat$StreamingRepresentationFormat.complete(StreamingJsonFormat.java:389) ~[neo4j-server-2.0.1.jar:2.0.1]
at org.neo4j.server.rest.repr.MappingRepresentation.serialize(MappingRepresentation.java:43) ~[server-api-2.0.1.jar:2.0.1]
at org.neo4j.server.rest.repr.OutputFormat$1.write(OutputFormat.java:160) ~[neo4j-server-2.0.1.jar:2.0.1]
... 30 common frames omitted
Caused by: org.eclipse.jetty.io.EofException: null
at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:186) ~[jetty-io-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:335) ~[jetty-io-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:125) ~[jetty-io-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.HttpConnection$ContentCallback.process(HttpConnection.java:784) ~[jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:79) ~[jetty-util-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.HttpConnection.send(HttpConnection.java:356) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.HttpChannel.sendResponse(HttpChannel.java:631) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.HttpChannel.write(HttpChannel.java:661) [jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at org.eclipse.jetty.server.HttpOutput.flush(HttpOutput.java:151) ~[jetty-server-9.0.5.v20130815.jar:9.0.5.v20130815]
at com.sun.jersey.spi.container.servlet.WebComponent$Writer.flush(WebComponent.java:315) ~[jersey-server-1.9.jar:1.9]
at com.sun.jersey.spi.container.ContainerResponse$CommittingOutputStream.flush(ContainerResponse.java:145) ~[jersey-server-1.9.jar:1.9]
at org.codehaus.jackson.impl.Utf8Generator.flush(Utf8Generator.java:1091) ~[jackson-core-asl-1.9.7.jar:1.9.7]
at org.neo4j.server.rest.repr.formats.StreamingJsonFormat$StreamingRepresentationFormat.flush(StreamingJsonFormat.java:397) ~[neo4j-server-2.0.1.jar:2.0.1]
... 33 common frames omitted
That is unrelated to your config, the transaction size just gets too big.
If you want to delete elements in a batched way use something like this:
match (a)
with a
limit 10000
optional match (a)-[r]-()
delete a,r
return count(*)
run until the result is 0
Which will find at most 10000 nodes then find all their rels and then delete both.

Jetty + Guice + Jersey gives 404 on accessing the resource

I have seen similar issues and solutions to those, but still cannot figure out the solution to mine.
I start Jetty server programmatically and hook Jersey using Guice into it. When I try to access my Jersey resource, I get 404.
public class TestService {
public static void main(String[] args) throws Exception {
Server server = new Server(8080);
ServletContextHandler context = new ServletContextHandler();
context.setContextPath("/");
server.setHandler(context);
final Injector injector = Guice.createInjector(new MyServletModule());
FilterHolder guiceFilter = new FilterHolder(injector.getInstance(GuiceFilter.class));
context.addFilter(guiceFilter, "/*", EnumSet.allOf(DispatcherType.class));
context.addEventListener(new GuiceServletContextListener() {
#Override
protected Injector getInjector() {
return injector;
}
});
server.start();
server.join();
}
}
class MyServletModule extends ServletModule {
#Override
protected void configureServlets() {
bind(GuiceContainer.class);
Map<String, String> parameters = Maps.newHashMap();
parameters.put(PackagesResourceConfig.PROPERTY_PACKAGES, "com.test");
parameters.put(JSONConfiguration.FEATURE_POJO_MAPPING, "true");
serve("/*").with(GuiceContainer.class, parameters);
}
}
My resource:
#Singleton
#Path("/")
public class MyResource {
#GET
public String sayhello() {
return "hello";
}
}
I can see that the resource is being loaded in the log:
INFO: Root resource classes found:
class com.test.MyResource
But I get 404 on loading http://localhost:8080/. I have also tried mapping the resource to other urls, fx /web, but it was still 404.
And complete log:
2013-07-23 11:06:07,993 [main] DEBUG org.eclipse.jetty.util.log - Logging to org.slf4j.impl.Log4jLoggerAdapter(org.eclipse.jetty.util.log) via org.eclipse.jetty.util.log.Slf4jLog
2013-07-23 11:06:08,114 [main] DEBUG org.eclipse.jetty.util.component.Container - Container org.eclipse.jetty.server.Server#18fef3d + SelectChannelConnector#0.0.0.0:8080 as connector
2013-07-23 11:06:08,131 [main] DEBUG org.eclipse.jetty.util.component.Container - Container org.eclipse.jetty.server.Server#18fef3d + o.e.j.s.ServletContextHandler{/,null} as handler
2013-07-23 11:06:08,425 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - filterNameMap={com.google.inject.servlet.GuiceFilter-1346515=com.google.inject.servlet.GuiceFilter-1346515}
2013-07-23 11:06:08,426 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - pathFilters=[[/*]/[]==31=>com.google.inject.servlet.GuiceFilter-1346515]
2013-07-23 11:06:08,426 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - servletFilterMap={}
2013-07-23 11:06:08,426 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - servletPathMap=null
2013-07-23 11:06:08,427 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - servletNameMap={}
2013-07-23 11:06:08,429 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting org.eclipse.jetty.server.Server#18fef3d
2013-07-23 11:06:08,429 [main] INFO org.eclipse.jetty.server.Server - jetty-8.1.0.RC5
2013-07-23 11:06:08,443 [main] DEBUG org.eclipse.jetty.util.component.Container - Container org.eclipse.jetty.server.Server#18fef3d + qtp22355327{8<=0<=0/254,-1} as threadpool
2013-07-23 11:06:08,444 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:08,453 [main] DEBUG org.eclipse.jetty.util.component.Container - Container org.eclipse.jetty.servlet.ServletHandler#128f6ee + com.google.inject.servlet.GuiceFilter-1346515 as filter
2013-07-23 11:06:08,453 [main] DEBUG org.eclipse.jetty.util.component.Container - Container org.eclipse.jetty.servlet.ServletHandler#128f6ee + [/*]/[]==31=>com.google.inject.servlet.GuiceFilter-1346515 as filterMapping
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.util.component.Container - Container o.e.j.s.ServletContextHandler{/,null} + org.eclipse.jetty.servlet.ServletHandler#128f6ee as handler
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting org.eclipse.jetty.servlet.ServletHandler#128f6ee
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - filterNameMap={com.google.inject.servlet.GuiceFilter-1346515=com.google.inject.servlet.GuiceFilter-1346515}
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - pathFilters=[[/*]/[]==31=>com.google.inject.servlet.GuiceFilter-1346515]
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - servletFilterMap={}
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - servletPathMap=null
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.servlet.ServletHandler - servletNameMap={}
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.server.handler.AbstractHandler - starting org.eclipse.jetty.servlet.ServletHandler#128f6ee
2013-07-23 11:06:08,454 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED org.eclipse.jetty.servlet.ServletHandler#128f6ee
2013-07-23 11:06:08,455 [main] DEBUG org.eclipse.jetty.server.handler.AbstractHandler - starting o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:08,455 [main] INFO org.eclipse.jetty.server.handler.ContextHandler - started o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:08,455 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting com.google.inject.servlet.GuiceFilter-1346515
2013-jul-23 11:06:08 com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Scanning for root resource and provider classes in the packages:
com.test
2013-jul-23 11:06:08 com.sun.jersey.api.core.ScanningResourceConfig logClasses
INFO: Root resource classes found:
class com.test.MyResource
2013-jul-23 11:06:08 com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
2013-jul-23 11:06:08 com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.12 02/15/2012 04:51 PM'
2013-07-23 11:06:09,219 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED com.google.inject.servlet.GuiceFilter-1346515
2013-07-23 11:06:09,219 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:09,219 [main] DEBUG org.eclipse.jetty.server.handler.AbstractHandler - starting org.eclipse.jetty.server.Server#18fef3d
2013-07-23 11:06:09,219 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting qtp22355327{8<=0<=0/254,-1}
2013-07-23 11:06:09,221 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED qtp22355327{8<=1<=8/254,0}
2013-07-23 11:06:09,222 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting SelectChannelConnector#0.0.0.0:8080
2013-07-23 11:06:09,258 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting null/null
2013-07-23 11:06:09,260 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED PooledBuffers [0/1024#6144,0/1024#16384,0/1024#-]/PooledBuffers [0/1024#6144,0/1024#32768,0/1024#-]
2013-07-23 11:06:09,260 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting org.eclipse.jetty.server.nio.SelectChannelConnector$ConnectorSelectorManager#20c906
2013-07-23 11:06:09,279 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED org.eclipse.jetty.server.nio.SelectChannelConnector$ConnectorSelectorManager#20c906
2013-07-23 11:06:09,279 [qtp22355327-10 Selector0] DEBUG org.eclipse.jetty.io.nio - Starting Thread[qtp22355327-10 Selector0,5,main] on org.eclipse.jetty.io.nio.SelectorManager$1#10c3a08
2013-07-23 11:06:09,280 [main] INFO org.eclipse.jetty.server.AbstractConnector - Started SelectChannelConnector#0.0.0.0:8080
2013-07-23 11:06:09,280 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED SelectChannelConnector#0.0.0.0:8080
2013-07-23 11:06:09,280 [main] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED org.eclipse.jetty.server.Server#18fef3d
2013-07-23 11:06:16,602 [qtp22355327-10 Selector0] DEBUG org.eclipse.jetty.io.nio - created SCEP#cc7439{l(/127.0.0.1:61292)<->r(/127.0.0.1:8080),d=false,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=0}-{AsyncHttpConnection#e2892b,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-14,l=0,c=0},r=0}
2013-07-23 11:06:16,604 [qtp22355327-16] DEBUG org.eclipse.jetty.http.HttpParser - filled 0/0
2013-07-23 11:06:16,604 [qtp22355327-10 Selector0] DEBUG org.eclipse.jetty.io.nio - created SCEP#1dd9891{l(/127.0.0.1:61293)<->r(/127.0.0.1:8080),d=false,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=0}-{AsyncHttpConnection#14b6b02,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-14,l=0,c=0},r=0}
2013-07-23 11:06:16,604 [qtp22355327-14] DEBUG org.eclipse.jetty.http.HttpParser - filled 0/0
2013-07-23 11:06:16,634 [qtp22355327-17] DEBUG org.eclipse.jetty.http.HttpParser - filled 328/328
2013-07-23 11:06:16,641 [qtp22355327-17 - /] DEBUG org.eclipse.jetty.server.Server - REQUEST / on AsyncHttpConnection#e2892b,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-5,l=14,c=0},r=1
2013-07-23 11:06:16,641 [qtp22355327-17 - /] DEBUG org.eclipse.jetty.server.handler.ContextHandler - scope null||/ # o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:16,641 [qtp22355327-17 - /] DEBUG org.eclipse.jetty.server.handler.ContextHandler - context=||/ # o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:16,641 [qtp22355327-17 - /] DEBUG org.eclipse.jetty.servlet.ServletHandler - servlet ||/ -> null
2013-07-23 11:06:16,641 [qtp22355327-17 - /] DEBUG org.eclipse.jetty.servlet.ServletHandler - chain=null
2013-07-23 11:06:16,641 [qtp22355327-17 - /] DEBUG org.eclipse.jetty.servlet.ServletHandler - Not Found /
2013-07-23 11:06:16,647 [qtp22355327-17 - /] DEBUG org.eclipse.jetty.server.Server - RESPONSE / 404
2013-07-23 11:06:16,651 [qtp22355327-17] DEBUG org.eclipse.jetty.http.HttpParser - filled 0/0
2013-07-23 11:06:16,769 [qtp22355327-11] DEBUG org.eclipse.jetty.http.HttpParser - filled 279/279
2013-07-23 11:06:16,770 [qtp22355327-11 - /favicon.ico] DEBUG org.eclipse.jetty.server.Server - REQUEST /favicon.ico on AsyncHttpConnection#e2892b,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-5,l=14,c=0},r=2
2013-07-23 11:06:16,770 [qtp22355327-11 - /favicon.ico] DEBUG org.eclipse.jetty.server.handler.ContextHandler - scope null||/favicon.ico # o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:16,771 [qtp22355327-11 - /favicon.ico] DEBUG org.eclipse.jetty.server.handler.ContextHandler - context=||/favicon.ico # o.e.j.s.ServletContextHandler{/,null}
2013-07-23 11:06:16,771 [qtp22355327-11 - /favicon.ico] DEBUG org.eclipse.jetty.servlet.ServletHandler - servlet ||/favicon.ico -> null
2013-07-23 11:06:16,771 [qtp22355327-11 - /favicon.ico] DEBUG org.eclipse.jetty.servlet.ServletHandler - chain=null
2013-07-23 11:06:16,772 [qtp22355327-11 - /favicon.ico] DEBUG org.eclipse.jetty.servlet.ServletHandler - Not Found /favicon.ico
2013-07-23 11:06:16,774 [qtp22355327-11 - /favicon.ico] DEBUG org.eclipse.jetty.server.Server - RESPONSE /favicon.ico 404
2013-07-23 11:06:16,775 [qtp22355327-11] DEBUG org.eclipse.jetty.http.HttpParser - filled 0/0
2013-07-23 11:06:26,564 [qtp22355327-15] DEBUG org.eclipse.jetty.io.nio.ChannelEndPoint - ishut SCEP#1dd9891{l(/127.0.0.1:61293)<->r(/127.0.0.1:8080),d=true,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=1r}-{AsyncHttpConnection#14b6b02,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-14,l=0,c=0},r=0}
2013-07-23 11:06:26,564 [qtp22355327-15] DEBUG org.eclipse.jetty.http.HttpParser - filled -1/0
2013-07-23 11:06:26,566 [qtp22355327-15] DEBUG org.eclipse.jetty.io.nio.ChannelEndPoint - close SCEP#1dd9891{l(/127.0.0.1:61293)<->r(/127.0.0.1:8080),d=true,open=true,ishut=true,oshut=false,rb=false,wb=false,w=true,i=1r}-{AsyncHttpConnection#14b6b02,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=0,l=0,c=0},r=0}
2013-07-23 11:06:26,568 [qtp22355327-10 Selector0] DEBUG org.eclipse.jetty.io.nio - destroyEndPoint SCEP#1dd9891{l(/127.0.0.1:61293)<->r(/127.0.0.1:8080),d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=1!}-{AsyncHttpConnection#14b6b02,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=0,l=0,c=0},r=0}
2013-07-23 11:06:26,572 [qtp22355327-10 Selector0] DEBUG org.eclipse.jetty.server.AbstractHttpConnection - closed AsyncHttpConnection#14b6b02,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=0,l=0,c=0},r=0
You need a default servlet. Try adding
context.addServlet(DefaultServlet.class, "/");
after adding your Guice Filter.

Categories

Resources