Andrey Dmitriev

Ranch Hand
+ Follow
since Jan 04, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
5
Received in last 30 days
0
Total given
6
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Andrey Dmitriev

I realised reading a file into bytes-array with next writing this array to file in another directory by the following approach:


And this code done well - in target directory appear new file with the relevant content (for example: "abcd").

Further I tried to improve my approach through ApacheCommons abilities.



But this approach entails the problem: in target directory the new file appeals, but this written content is irrelevant. Besides the written text (for example: "abcd") it contains some unreadable unencoded symbols, and I see the warning about problem with encoding.

I suppose this problem is related to the fact, that some excess bytes read and/or write to OutpumStream. And this problem (probably) arise due to the fact I don't restrict read and write-operations, applying IOUtils (second approach).

And in first approach I restrict the write of byte-array in OutputStream by size of length-variable:


If problem in that I must have a way to restrict the write by tools of AppacheCommons.
But I don't see any way to do so in IOUtils-methods.
9 months ago
I'm trying to test service-class of reactive mongoDB application, created on SpringBoot.

I don't use embedded mongodb! I'm only trying to mock repository

This is reactive mongo repository:


Repository, which should use it:


And test class:


Main configuration:



May be It doesn't matter is that case, but test-configurations is:


And, after running test, I receive the following exception:


caused by:


What am I doing wrong?
10 months ago
  Hello!

  I have 2 entities:

 



  And data from B successfully persists in table A. So, one table for 2 entities - A and B.
 

  I created third entity - C.
 

  I want data from C to persisted in separate table - C.  
  So, finally -  one table A for A/B entities,  and one more table for C.
  In this case 2 strategies are mixed: SINGLE_TABLE  and  TABLE_PER_CLASS

  For this purpose i applied to B annotation @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)

 

 But without success - data from C persisted in single table A.   So SINGLE_TABLE  is working only

 

   Thank you! It s a foolishness, but I mixed up Apache Maven and Apache Tomcat
1 year ago
What is the valid tomcat directory in Windows?

I tried to configure apache-maven in Idea in C:\Program Files

But receive: "The selected directory is not a valid tomcat home"
1 year ago
WildFly 14.0.1:

I enter "http://127.0.0.1:8080/" in browser succesfully.

But when when I enter "http://127.0.0.1:9990/console", I receive "Cannot access to site".

Trying to run WildFly I receive following exceptions:



Also I see, that it does not have data-directory and logs.

jBoss is installed, but i cant run it too due to the above reason.

jdk-8 is installed in the same root-directory: C:\Program Files
1 year ago
  I'm still "anchored"....
1 year ago
 Hello!

 I have the following maven-dependency:



 Project-properties:



And try to use it by spring-xml-configuration:



SDK is 11.0.6.

I tried:
1. Rebuild project.

2. Invalidate Caches/Restart

3. Maven Clean/Install.  But Install failed by the reason of:

 
     Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project user_service: Fatal error compiling


Help me, please!!!  I almost a day battle with this problem


1 year ago
    I have found the solution:

   I add separate controller:

 

And conroller for the root-mappring:



new spring-config:



Besides I remain @RestController.  

So this solution cost for my project architecture-sophistication...
1 year ago
Hibernate properties are represent as:




Postgres-driver is 42.2.10
Spring Data JPA

In general hybernate working well: it provides all CRUD-operations.

But if try to update my Entity (for example, by adding new field), assigned table in database is not changing.

 
    I add to spring-mvc.xml the following:

 

   and controller:



directory: test/webapp/access_approved.html.


It redirects me on http://localhost:8080/test/access_approved.    But with the same 404-error.

I tried "forward:access_approved"
But it forwards me on http://localhost:8080/test/
1 year ago

Stephan van Hulst wrote:I mean, what is the literal file name of the built WAR, including the .war extension?



test.war
1 year ago