0
I have a Java/Vraptor4 application on a Tomcat9.0 , when I am climbing up Tomcat the following error is released:
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server version: Apache Tomcat/9.0.13
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server built: Nov 2 2018 14:27:55 UTC
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server number: 9.0.13.0
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: OS Name: Windows 7
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: OS Version: 6.1
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Architecture: amd64
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Java Home: C:\Program Files\Java\jdk1.8.0_25\jre
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: JVM Version: 1.8.0_25-b18
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: JVM Vendor: Oracle Corporation
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: CATALINA_BASE: C:\ambiente_desenvolvimento\workspace\workspace-samu\backend\.metadata\.plugins\org.eclipse.wst.server.core\tmp2
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: CATALINA_HOME: C:\ambiente_desenvolvimento\Apache\apache-tomcat-9.0.13
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:50654
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -javaagent:C:\ambiente_desenvolvimento\eclipse\configuration\org.eclipse.osgi\237\0\.cp\lib\javaagent-shaded.jar
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dcatalina.base=C:\ambiente_desenvolvimento\workspace\workspace-samu\backend\.metadata\.plugins\org.eclipse.wst.server.core\tmp2
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dcatalina.home=C:\ambiente_desenvolvimento\Apache\apache-tomcat-9.0.13
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dwtp.deploy=C:\ambiente_desenvolvimento\workspace\workspace-samu\backend\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Djava.endorsed.dirs=C:\ambiente_desenvolvimento\Apache\apache-tomcat-9.0.13\endorsed
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dfile.encoding=Cp1252
abr 09, 2019 10:50:13 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFORMAÇÕES: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_25\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jdk1.8.0_25\jre\bin;C:/Program Files/Java/jre1.8.0_191/bin/server;C:/Program Files/Java/jre1.8.0_191/bin;C:/Program Files/Java/jre1.8.0_191/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Git\cmd;C:\Program Files\apache-maven-3.5.3\bin;C:\Program Files\Java\jdk1.6.0_31\bin;C:\ambiente_desenvolvimento\Apache\maven-3.0.3\bin;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Microsoft VS Code\bin;C:\opscode\chefdk\bin\;C:\Program Files\nodejs\;C:\ambiente_desenvolvimento\Vagrant\bin;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\PuTTY\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Users\isaias.coelho-for\AppData\Roaming\npm;C:\Users\isaias.coelho-for\Desktop;;.]
abr 09, 2019 10:50:13 AM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler ["http-nio-8084"]
abr 09, 2019 10:50:13 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMAÇÕES: Using a shared selector for servlet write/read
abr 09, 2019 10:50:13 AM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler ["ajp-nio-8009"]
abr 09, 2019 10:50:13 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMAÇÕES: Using a shared selector for servlet write/read
abr 09, 2019 10:50:13 AM org.apache.catalina.startup.Catalina load
INFORMAÇÕES: Initialization processed in 1261 ms
abr 09, 2019 10:50:13 AM org.apache.catalina.core.StandardService startInternal
INFORMAÇÕES: Starting service [Catalina]
abr 09, 2019 10:50:13 AM org.apache.catalina.core.StandardEngine startInternal
INFORMAÇÕES: Starting Servlet Engine: Apache Tomcat/9.0.13
abr 09, 2019 10:50:15 AM org.apache.jasper.servlet.TldScanner scanJars
INFORMAÇÕES: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
abr 09, 2019 10:50:29 AM org.apache.deltaspike.core.util.ProjectStageProducer initProjectStage
INFORMAÇÕES: Computed the following DeltaSpike ProjectStage: Production
log4j:WARN No appenders could be found for logger (org.hibernate.validator.internal.util.Version).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
abr 09, 2019 10:50:35 AM org.apache.jasper.servlet.TldScanner scanJars
INFORMAÇÕES: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
09-abr-2019 10:50:36,784 INFO [EntityManagerFactoryServlet] INICIANDO LEITURA DAS PROPS DO BANCO!
######################################################################################################
################################# INICIALIZANDO APLICAÇÃO #####################################
######################################################################################################
VERSÃO DA APLICAÇÃO: 2.2.0
VERSÃO DA BASE DE DADOS: 2.2.1
É PARA ATUALIZAR? : true
######################################################################################################
____________________________________ _______________________
___ __ \__ __ \_ __ \__ __ \_ / / /_ ____/__ |_ __ \
__ /_/ /_ /_/ / / / /_ / / / / / /_ / __ /| | / / /
_ ____/_ _, _// /_/ /_ /_/ // /_/ / / /___ _ ___ / /_/ /
/_/ /_/ |_| \____/ /_____/ \____/ \____/ /_/ |_\____/
#######################################################################
09-abr-2019 10:50:43,019 INFO [SamuInitializer] CRIANDO AGENDADORES PADRÕES
09-abr-2019 10:50:43,019 INFO [SamuInitializer] AGENDADORES PADRÕES CRIADOS
######################################################################################################
############################### SERVIDOR ATUALIZADO ##########################################
######################################################################################################
VERSÃO DA APLICAÇÃO: 2.2.0
VERSÃO DA BASE DE DADOS: 2.2.1
######################################################################################################
######################################################################################################
abr 09, 2019 10:50:43 AM org.apache.catalina.core.StandardContext filterStart
GRAVE: Exception starting filter [vraptor]
java.lang.ArrayIndexOutOfBoundsException: 19896
at com.thoughtworks.paranamer.BytecodeReadingParanamer$ClassReader.readUnsignedShort(BytecodeReadingParanamer.java:722)
at com.thoughtworks.paranamer.BytecodeReadingParanamer$ClassReader.accept(BytecodeReadingParanamer.java:563)
at com.thoughtworks.paranamer.BytecodeReadingParanamer$ClassReader.access$200(BytecodeReadingParanamer.java:338)
at com.thoughtworks.paranamer.BytecodeReadingParanamer.lookupParameterNames(BytecodeReadingParanamer.java:103)
at com.thoughtworks.paranamer.AnnotationParanamer.lookupParameterNames(AnnotationParanamer.java:110)
at com.thoughtworks.paranamer.CachingParanamer.lookupParameterNames(CachingParanamer.java:90)
at com.thoughtworks.paranamer.CachingParanamer.lookupParameterNames(CachingParanamer.java:83)
at br.com.caelum.vraptor.http.ParanamerNameProvider.parametersFor(ParanamerNameProvider.java:50)
at br.com.caelum.vraptor.http.ParanamerNameProvider$Proxy$_$$_WeldClientProxy.parametersFor(Unknown Source)
at br.com.caelum.vraptor.http.route.DefaultTypeFinder.getParameterTypes(DefaultTypeFinder.java:57)
at br.com.caelum.vraptor.http.route.DefaultTypeFinder$Proxy$_$$_WeldClientProxy.getParameterTypes(Unknown Source)
at br.com.caelum.vraptor.http.route.DefaultRouteBuilder.addParametersInfo(DefaultRouteBuilder.java:196)
at br.com.caelum.vraptor.http.route.DefaultRouteBuilder.is(DefaultRouteBuilder.java:185)
at br.com.caelum.vraptor.http.route.PathAnnotationRoutesParser.registerRulesFor(PathAnnotationRoutesParser.java:117)
at br.com.caelum.vraptor.http.route.PathAnnotationRoutesParser.rulesFor(PathAnnotationRoutesParser.java:91)
at br.com.caelum.vraptor.http.route.PathAnnotationRoutesParser$Proxy$_$$_WeldClientProxy.rulesFor(Unknown Source)
at br.com.caelum.vraptor.ioc.ControllerHandler.handle(ControllerHandler.java:66)
at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:78)
at org.jboss.weld.injection.MethodInvocationStrategy$SimpleMethodInvocationStrategy.invoke(MethodInvocationStrategy.java:129)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:299)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:277)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:255)
at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:269)
at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:258)
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:154)
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:136)
at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:717)
at org.jboss.weld.util.ForwardingBeanManager.fireEvent(ForwardingBeanManager.java:101)
at br.com.caelum.vraptor.ioc.cdi.StereotypesRegistry.configure(StereotypesRegistry.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:78)
at org.jboss.weld.injection.MethodInvocationStrategy$SimpleMethodInvocationStrategy.invoke(MethodInvocationStrategy.java:129)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:299)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:277)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:255)
at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:269)
at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:258)
at org.jboss.weld.event.EventImpl.fire(EventImpl.java:92)
at br.com.caelum.vraptor.VRaptor.init(VRaptor.java:94)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:270)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:251)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:102)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4491)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1432)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1432)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:801)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:695)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
abr 09, 2019 10:50:43 AM org.apache.catalina.core.StandardContext startInternal
GRAVE: One or more Filters failed to start. Full details will be found in the appropriate container log file
abr 09, 2019 10:50:43 AM org.apache.catalina.core.StandardContext startInternal
GRAVE: Context [/samu-server] startup failed due to previous errors
EMF DESTRUIDO
abr 09, 2019 10:50:44 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
ADVERTÊNCIA: The web application [samu-server] registered the JDBC driver [oracle.jdbc.OracleDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
abr 09, 2019 10:50:44 AM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
ADVERTÊNCIA: The web application [samu-server] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
abr 09, 2019 10:50:44 AM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler ["http-nio-8084"]
abr 09, 2019 10:50:44 AM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler ["ajp-nio-8009"]
abr 09, 2019 10:50:44 AM org.apache.catalina.startup.Catalina start
INFORMAÇÕES: Server startup in 31216 ms
The application goes up, but no communication with the database is achieved. Use drivers libs in Tomcat/libs postgresql-9.4-1201-jdbc41 ojdbc7-ojdbc7
<!-- POSTGRES -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4-1201-jdbc41</version>
</dependency>
<!-- ORACLE -->
<dependency>
<groupId>ojdbc7</groupId>
<artifactId>ojdbc7</artifactId>
<version>ojdbc7</version>
</dependency>
I described that this is the class that makes break during the start, but I can’t identify the cause, someone can help?
package br.com.consulfarmasaude.api.sigss.paciente;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import org.apache.commons.lang.StringUtils;
import br.com.caelum.vraptor.Consumes;
import br.com.caelum.vraptor.Controller;
import br.com.caelum.vraptor.Get;
import br.com.caelum.vraptor.Path;
import br.com.consulfarmasaude.samu.core.CoreController;
import br.com.consulfarmasaude.samu.core.CoreUtils;
import br.com.consulfarmasaude.samu.core.exception.CoreMessageException;
import br.com.consulfarmasaude.samu.core.filtro.CoreFiltroSearch;
import br.com.consulfarmasaude.samu.core.filtro.ICoreFiltro;
import br.com.consulfarmasaude.samu.core.permissao.acesso.Acesso;
@Controller
@Path("/paciente-api")
@Acesso(value = "Paciente API")
public class PacienteAPIController extends CoreController {
@Inject
private IPacienteAPIBeanLocal pacienteAPIBean;
// @Get("/")
// public void buscarPacienteAPIPorNome(String nome) {
// List<PacienteAPI> busca = pacienteAPIBean.buscarPacienteAPIPorNome(nome);
// resultAsJson().from(busca).serialize();
// }
@Get("/")
@Consumes(CoreUtils.APPJSON)
public void buscarPacienteAPIPorFiltro() {
CoreFiltroSearch filtros = getFiltros();
validarBusca(filtros);
List<PacienteAPI> busca = pacienteAPIBean.buscarPacienteAPIPorFiltro(montarQueryString(filtros));
resultAsJson().from(busca).serialize();
}
private void validarBusca(CoreFiltroSearch filtros) {
String nome = filtros.splitValueFromList("nome");
if (StringUtils.isBlank(nome) || (StringUtils.isNotBlank(nome) && filtros.getFiltros().size() == 1)) {
throw new CoreMessageException(null, null);
}
}
private String montarQueryString(CoreFiltroSearch filter) {
return filter.getFiltros().stream().map(p -> urlEncodeUTF8(p.getChave()) + "=" + urlEncodeUTF8(p.getValor()))
.reduce((p1, p2) -> p1 + "&" + p2).orElse("");
}
static String urlEncodeUTF8(Map<?, ?> map) {
StringBuilder sb = new StringBuilder();
for (Map.Entry<?, ?> entry : map.entrySet()) {
if (sb.length() > 0) {
sb.append("&");
}
sb.append(String.format("%s=%s", urlEncodeUTF8(entry.getKey().toString()),
urlEncodeUTF8(entry.getValue().toString())));
}
return sb.toString();
}
static String urlEncodeUTF8(String s) {
try {
return URLEncoder.encode(s, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new UnsupportedOperationException(e);
}
}
private PacienteAPI montarFiltro(CoreFiltroSearch filter) {
PacienteAPI pacienteApi = new PacienteAPI();
for (ICoreFiltro filtro : filter.getFiltros()) {
if (StringUtils.isNotBlank(filtro.getChave())) {
String chave = filtro.getChave();
switch (chave) {
case "nome":
pacienteApi.setNome(filtro.getValor());
break;
case "dataNascimento":
pacienteApi.setDataNasc(filtro.getValor());
break;
case "nomeMae":
pacienteApi.setNomeMae(filtro.getValor());
break;
case "cns":
pacienteApi.setCartaoSus(filtro.getValor());
break;
case "sexo":
pacienteApi.setSexo(filtro.getValor());
break;
}
}
}
return pacienteApi;
}
@Get("/prontuario/")
@Consumes(CoreUtils.APPJSON)
public void buscarLinkProntuarioPaciente(PacienteAPI paciente) {
String link = pacienteAPIBean.buscarProntuarioPaciente(paciente);
resultAsJson().from(link).serialize();
}
}
Are the connection settings with the bank correct? Have a check.
– Filipe L. Constante
are, I can connect with the bank in an older branch, I found out that it is in a certain class that breaks, have how I post the class ?
– Isaías de Lima Coelho