harald michael

Greenhorn
+ Follow
since Jul 05, 2021
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by harald michael

Hi,

a SpringBoot application is ignoring a class annotated with @Configuration and I need shelp to understand how I can make SpringBoot
process this class and create beans inside it. Thank you!

Here is what I tried from what I found in the documentation and online and sample code:

- placed the class in the same package and in a subpackage called 'config'
- added the annotations which are below in the code (although SpringBoot should find it without any of these according to the doc)
- imported annotation context in an context.xml file imported with @ImportResource
- added following additoinal dependecies to pom:

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure-processor -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure-processor</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-configuration-processor -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>







context.xml :

3 weeks ago
I have managed to solve it by setting the same proxy as in Eclipse  (it is running in Eclipse) with method



( and with help of Codota plugin) .
Thank you for pointing me in the right direction!

It looks fun to work with this framework, although I get different errors, I will try to understand how to access objects and use them.

1 month ago
hi, and thanks  a lot for the answer. Well it is a personal idea I try and thus I do not think it is a good idea to ask about this, there are small chances anyway to change something.

No, I do not use Spring here, just simply HtmlUnit, as in the link from first post.

I tried again now on the Jdoodle online ide and get the same exception unknown host - see screenshot. Probably they also have some acces issues..

Can we tell htmlUnit to use that proxy server ?


1 month ago
hi , thank you.

pinging 8.8.8.8  results in timeout messages.
I confirm internet is working , I am at it right now on coderanch..
Also pinging host from the intranet works.

This is a machine from the employer, I think it is risky to mess around with such settings. I know at least in Eclipse there are some proxy settings in the networking settings to be able to access the Eclipse marketplace. Is it possible that these proxies do not allow traffic to the outside from cmd or Eclipse? From browser it works obviously. Although I see in the LAN settings in IE there is a wpad....  script as well to setup proxy.
1 month ago
ok, I pinged google.com  - it says it cannot find host, as with the others.
1 month ago
I have pinged  https://www.google.com  ,  http://www.google.com  and www.google.com and none of them was successful..
1 month ago
ok, I tried with https too and the result is the same.
1 month ago
Hi,

I try to do something similar as here .



It returns



in the Console.
Can this somehow be designed to access the webpage?
Thank you!
1 month ago
no, that is not something I can decide
2 months ago
yes , we do , like in the above link on stackoverflow.
There is no application class annotated with SpringBootApplication , there is a class annotated with Webservice which is basically where it starts.
2 months ago
Is it possible that JBoss is taking its own logging configuration instead of what we configure for logging in application.properties for Spring Boot ?
2 months ago
yes, it is indeed the same issue.
An explanation of how jpa properties interact with loggers is not easy to find..
2 months ago
well I used those settings to log to a file , the file is created successfully, but the sql stuff is not logged in there..
2 months ago
Hi,

I just tried with this option too with same result.
It looks like every setting related to queries is ignored.

The setting to log in a file is though executed - the file gets created:



Additionally I have set again show_sql to false  and removed format_sql in jpaproperties as indicated in the mentioned article.
In this case the query is not logged at all...

I also removed show_sql from jpaproperties, so that only the settings in application.properties remained - in this case an unformatted query is printed, but with no parameter values. (As it is not printed to springboot.log I assume show_sql defaults to true.)

So, is there a way to make the application take these settings in application.properties into consideration?


LE: I have managed to get formatted query and parameters to the console using log4j.xml Thank you for the hint! With file appender the query is logged to console although it should be logged to a file. The file appender is though respected for the parameters. It looks as like the show_sql=true in jpaproperties has priority and loggs by default to console.
With log4j.properties it behaves similar to Springs's application properties - it simply seems to be ignored and query and parameters are not printed.  
Still I would like to use the application.properties of Spring.

Opposed to the previous link, this  one says show_sql has to be true when using the org.hibernate.SQL logger in xml or properties file.
2 months ago