private Optional<Map<String, Object>> getComponentField(String componentName, String componentVariation, String field) {
if (this.map.containsKey(COMPONENTS)) {
Map<String, List<Object>> components = (Map<String, List<Object>>) this.map.get(COMPONENTS);
for (Map.Entry pair: components.entrySet()) {
ArrayList<Map<String, Object>> component = (ArrayList) pair.getValue();
for (Map<String, Object> o : component) {
if (o.containsKey(NAME) && o.containsKey(VARIATION) && o.containsKey(field)) {
if (((String) o.get(NAME)).equalsIgnoreCase(componentName) &&
((String) o.get(VARIATION)).equalsIgnoreCase(componentVariation)) {
return Optional.of((Map<String, Object>)o.get(field));
}
}
}
}
}
return Optional.absent();
}{
"a": "a",
"b": "b",
"c": "c",
"d": "d",
"e": "e",
"f": "f",
"components": {
"name-name": [
{
"name": "name",
"variation": "variation",
"field": {
"a": "a",
"b": {
"c": "c"
}
},
"features": {
"a": {
"b": "b",
"c": "c"
},
"d": {
"e": "e"
}
}
}
]
}
}-verbose:classunderstanding which classes are loaded
- JPA
@Transientdoesn't persist the field on db
- Spring
@Serviceit's a service class
- javax.validation
@Validvalidate the field throw reflection?
//TODOPOST Path Produces Consumes GET Autowired Component Valid NotNull HeaderParam @QueryParam Override
kill -3 <pid>- dump example: output
inside catalina.bat
set "JAVA_OPTS=%JAVA_OPTS% your_option "catalina.sh / bat
set "JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=12345"javax.naming.CommunicationException: anonymous bind failed: package.class.eu:636 [Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]
solution's example:
setting the tomcat VM option
-Djavax.net.ssl.trustStore=path_to_keystore.jks -Djavax.net.ssl.trustStorePassword=password
In an insert, during an Hibernate Transaction with Oracle... I was using a reserved oracle keyword (FILE)
import org.junit.Test;
import java.net.URL;
import java.net.URLClassLoader;
public class PrintClasspath {
@Test
public void printClasspath() {
ClassLoader cl = ClassLoader.getSystemClassLoader();
URL[] urls = ((URLClassLoader)cl).getURLs();
for(URL url: urls){
System.out.println(url.getFile());
}
}
}alternatives --set javac /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.172-9.b11.fc28.x86_64/bin/javacalternatives --config javaString sDate = "20180118";
Date date = new SimpleDateFormat("yyyyMMdd").parse(sDate);private static final Set<String> VALUES = new HashSet<String>(Arrays.asList(
new String[] {"AB","BC","CD","AE"}
));
VALUES.contains(s)Why I don't see stack trace on logs?
After many errors, jvm omit them!
add this parameter to the jvm (1.6+)
-XX:-OmitStackTraceInFastThrowCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'java.util.Set<javax.persistence.EntityManager>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
Fixed putting this in application.properties file: spring.data.jpa.repositories.enabled=false