How to solve error of parsing YAML configuration in Spring Boot? - spring

I want to solve while parsing a block mapping error for use Spring Boot with Eureka server configuration
while parsing a block mapping
in 'reader', line 5, column 3:
application:
^
expected <block end>, but found '<block mapping start>'
in 'reader', line 15, column 4:
hikari:

The indention is not correct.
hikari is one space too much to the right.

Related

How to read tomcat error log

Here is a screenshot of my tomcat spring boot error log. How do I read this?
Specifically,
1.) where do I read there is says "63 more"?
2.) Is the top-most error the most generic, or most specific? I'm thinking most generic because it says "caused by" and then another error.
Thanks.
First, get destination of log (console, file, database, ...) by find information in:
application.properties (for example: spring.log.**** = ...)
or log4j.properties/log4j.yml/log4j.yaml (if using log4j)
or log4j2.properties/log4j2.yml/log4j2.yaml (if using log4j2)
or logback.properties/logback.yml (if using logback)
and then you can get "63 more" there
It's the most specific
most specific error <== root cause is here
^ cause by: generic error
^ cause by: generic error
...
^ cause by: most generic error
The first line contains the exact reason for the error, such as this:
java.lang.NullPointerException
abc.def.ghi.handleRequest(MyController.java:30)
...
The more you go down, the more information you get about the root cause. Usually you can find the cause at the bottom of the log message containing the stack trace. In your case, the cause for the exception is "No converter found capable of converting from type ...".

SpelParseException: After parsing a valid expression, there is still more data in the expression: 'lcurly({)'

I am trying to condtionally create a component using #ConditionalOnExpression("not ${service.synchronous} && not ${service.disabled}").
I based this on Spring Boot SpEL ConditionalOnExpression check multiple properties, which provides a multi-property conditional as follows: #ConditionalOnExpression("${properties.first.property.enable:true} && ${properties.second.property.startServer:false}")
However, I keep getting:
Caused by: org.springframework.expression.spel.SpelParseException: EL1041E: After parsing a valid expression, there is still more data in the expression: 'lcurly({)'
Those properties are always set in my .properties file so I did not provide a default value with the colon notation. What am I doing wrong?
You will need to provide the default values for your properties like in the example you followed, so update the expression to be:
#ConditionalOnExpression("not ${service.synchronous:false} && not ${service.disabled:true}")
In most such cases the properties your app is reading are not what you expect them to be.
Set a breakpoint on all constructors of SpelParseException. In the debugger you will see the expression that is parsed, that will give show you exactly which properties you are really using.
Maybe you have to go search a little in the stack until you find the right location where you can see the expression.
My mistake was that I had not imported the test properties file in a Spring test.
After I added #TestPropertySource("classpath:/application.properties") to the test class, the properties from the properties file were used.

What does number#number#number identifies in FreeMarker log error?

I am using FreeMarker Java Template Engine in Liferay Portal and I get this error:
19:55:00,260 ERROR [http-bio-80-exec-2][runtime:96] Template
processing error: "Error on line 290, column 1 in
924629#924665#3296702 request['theme-display'] is undefined. It can not
be assigned to themeDisplay"
I want to know what this number 924629#924665#3296702 identifies or mean?
companyId#companyGroupId#templateId
I have found what is the meaning of those numbers.
The first is the Company ID (ThemeDisplay.getCompanyId()) and the second number is the Company Group ID (ThemeDisplay.getCompanyGroupId()) and the last number is the ID of FreeMarker Template (Liferay templateKey)

Oracle ADF 10g to 11g migration

I have an ADF project in 10g, and i want to migrate it to 11g
i am getting the following errors:
weblogic.application.ModuleException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4a: Expected element 'web-resource-collection#http://java.sun.com/xml/ns/javaee' instead of 'auth-constraint#http://java.sun.com/xml/ns/javaee' here in element security-constraint#http://java.sun.com/xml/ns/javaee:<null>
problem: cvc-complex-type.2.4c: Expected element 'web-resource-collection#http://java.sun.com/xml/ns/javaee' before the end of the content in element security-constraint#http://java.sun.com/xml/ns/javaee:<null>
at weblogic.servlet.internal.WebAppModule.createModuleException(WebAppModule.java:1604)
at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:1358)
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:372)
at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
Truncated. see log file for complete stacktrace
Caused By: weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4a: Expected element 'web-resource-collection#http://java.sun.com/xml/ns/javaee' instead of 'auth-constraint#http://java.sun.com/xml/ns/javaee' here in element security-constraint#http://java.sun.com/xml/ns/javaee:<null>
problem: cvc-complex-type.2.4c: Expected element 'web-resource-collection#http://java.sun.com/xml/ns/javaee' before the end of the content in element security-constraint#http://java.sun.com/xml/ns/javaee:<null>
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:245)
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:231)
at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:155)
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323)
at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
Truncated. see log file for complete stacktrace
any help would be appreciated
I have got rid of the error after i removed the security roles from the ViewController and Model, in the web.xml files.

Apache Camel: How to properly nest a function?

In Camel's Simple documentation they say :
From Camel 2.9 onwards you can nest functions, such as shown below:
<setHeader headerName="myHeader">
<simple>${properties:${header.someKey}}</simple>
</setHeader>
Here is what I am trying to do:
<simple>${property.${property.prefix}variableName}</simple>
I am trying to access the exchange property whose name is:
exchange.getProperty("prefix", String.class) + "variableName"
But I'm getting this exception:
Caused by: org.apache.camel.language.simple.types.SimpleIllegalSyntaxException: ${ cannot accept or at location 22
${property.${property.prefix}variableName}
What am I doing wrong here?
I'm using Camel version 2.13.0.
I confirm the following code works fine with Camel 2.13.0:
from("...")
.setProperty("prefix", constant("pre-"))
.setProperty("pre-variable", constant("value"))
.setHeader("myHeader", simple("${property.${property.prefix}variable}"))
You may have special character in the prefix property that prevents proper resolution.

Resources