Denis Stephanov

1

votes
0

answer
107

views

Pagination over Spring Websocket

I have question for Spring Developers ... we are developing intern chatting application where need implement pagination and fetch data when it's needed. With websockets is created persistent connection with server, so my question is, if it is possible replace rest api with websocket channel, and fe...
Denis Stephanov
1

votes
0

answer
308

views

Relation “xxxx” does not exist

Can you tell me how to fix this exception from console? org.postgresql.util.PSQLException: ERROR: relation 'xxxx' does not exist This exception is for some tables in my project, and I don't know why. Application works fine without any issues. I have in resources import script dml and tables are fill...
Denis Stephanov
1

votes
1

answer
31

views

Access to one data collection from multiple logged users

I am solving following problem and I will grateful for some advice because I can move my project ahead, so I hope this question don't break any rules. In my app I have 2 rest controller: for data storing for data fetching It should works something like that: Some user send data to database with firs...
Denis Stephanov
1

votes
0

answer
156

views

Thread-safe multi-values map

need store multiple values with specific key. I decide to use Guava's cache class for that, which contains another functions, e.g auto-remove entries after some time and so on ... I implement this 'multimap' like this: private final Cache notifications = CacheBuilder.newBuilder().expireAfterWrite(10...
Denis Stephanov
1

votes
0

answer
134

views

How to name Foreign Key with @CollectionTable in JPA?

I need help with resolving our problem with naming FK in JPA. We have one embeddable entity e.g. Foo which is used as collection in another one entity Bar. embeddable entity: @Embeddable public class Foo{ @Column(name = 'foo1') private String foo1; @Column(name = 'foo2') private String foo2; } main...
Denis Stephanov
1

votes
0

answer
32

views

Index doesnt hit in my query (PostgreSQL)

Hello I have folowwing query (I used CURRENT_DATE for query demonstration, later it will be param from function): SELECT * FROM FOO_TBL WHERE FOO_VERSION_FROM = CURRENT_DATE) OR (FOO_VERSION_TO IS NULL)) AND (FOO_ACTIVE_FROM IS NOT NULL) ORDER BY ID; I've created index like this: CREATE INDEX FOO_I...
Denis Stephanov
1

votes
1

answer
184

views

Kendo grid custom navigation

Is possible override default behaviour after any key press or disable it? I've added this command to grid declaration ...., navigatable: true, .... but i can allow only arrow navigation, and add them custom function. Thanks for response.
Denis Stephanov
1

votes
1

answer
64

views

Call stored procedure in loop in wcf

I have a problem with calling WCF service from ajax. I pass to WCF an array of objects, and for every object, I need a stored procedure to be called via ADO.NET. The problem is when I call this procedure in the loop, the application starts to lag. Can you tell me, how is possible to fix it ?
Denis Stephanov
1

votes
2

answer
799

views

Android emulator open failed: ENOENT (No such file or directory)

I need help with permission to save file in Android emulator ... I've had added in AndroidManifest.xml My code for save file: if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) { Bundle extras = data.getExtras(); Bitmap imageBitmap = (Bitmap) extras.get('data'); imageView.setImage...
Denis Stephanov
1

votes
2

answer
839

views

Routing network from OSM

I'm looking for some good tool to import map.osm to postgres and next create some routes which will be displayed by geoserver. I need route, with some text information about vertexes (e.g. city, address, address number, and so on...) I found this: osm2pgrouting - Import OSM data into pgRouting Datab...
Denis Stephanov
1

votes
1

answer
822

views

Scala - bad constant pool tag

I need to use this project https://github.com/dwins/mapnik2geotools . I proceed step by step, but when I enter sbt run I get this error : C:\Users\Admin\Downloads\mapnik2geotools-master\mapnik2geotools- master>sbt run Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; suppo...
Denis Stephanov
1

votes
1

answer
71

views

Consume WCF service on android - Invalid hostname

I need call WCF Service in my android application. For comunication I am using OkHttp library. In desktop browser service works fine on url like this: http://localhost:7915/GeoService.svc/GetRoute?source=kyjevska&target=cyrila here are WCF contract:: [ServiceContract] public interface IGeoService {...
Denis Stephanov
1

votes
1

answer
69

views

Correct way to handle ERROR in TSQL transaction

I have transaction in with this structure: CREATE PROCEDURE XXX @param bit AS BEGIN TRAN IF (@param = 1) BEGIN -- DO SOME STUFF LIKE INSERT, UPDATE AND SO ON... RETURN 1 -- RETURN 1 FOR SUCCESS END ELSE BEGIN -- CONDITION IS NOT SUCCESSFUL SO NOTHING HAPPENED AND I NEED HANDLE -- IN C# RETURN -1 END...
Denis Stephanov
1

votes
1

answer
28

views

Push changed project structure into git

I have currently single project without modules in Git. But now I do some changes and one of these changes is split project into maven modules and created maven inheritance. Can you tell me please if can I simply push it into master branch or should I something extra do? I wouldn't make mess in git...
Denis Stephanov
1

votes
2

answer
541

views

JUnit Test for database exception for duplicate records

I need test my database that, when I insert duplicate value in specific column where I have constraint, it fire exception. Can you show me how can I simulate second same call and fire exception? here is my code, but doesn't work: @RunWith(MockitoJUnitRunner.class) public class SomeTestClass { @Injec...
Denis Stephanov
1

votes
1

answer
153

views

Chat bubbles in bootstrap and flex?

I need code chat bubbles within bootstrap framework where I distinguish right and left bubbles with 2 class, e.g. right and left. Each bubble should have max width, e.g. 70% but should be less if text isn't too large. Here is my code: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellente...
1

votes
1

answer
86

views

Persist database of docker container

I am using postgres docker image in my project. For initialization I am using following command to create and init my database (tables, views, data, ...) COPY sql_dump.sql /docker-entrypoint-initdb.d/ Is possible persist these data after container is stopped and removed? For instance when I run imag...
Denis Stephanov
1

votes
2

answer
106

views

Manualy execute code in transaction in test with rollback

we are using spring boot 2, and in our integration tests we need manually execute some code in transaction, and on the end of transaction and after asserts, we want rollback that transaction. We are using explicit defined transactions instead of @Transactional because sometimes we need execute in te...
Denis Stephanov
0

votes
1

answer
18

views

Check if variable is fill and pass it into function in condition

I am new in javascript and I have question how to check if variable is not null and if not use it in function ? For instance: var fooNumber = null; if (!!fooNumber && someFunctionWhichFailWithNull(fooNumber)) { // there I got error because function is called with null; // .. } is some way how to ch...
Denis Stephanov
1

votes
2

answer
76

views

ConstraintValidator for single field and colection as well

can you tell me how to create custom constraint validator which will work for single field and collection as well? For instance, I have an object Foo which contains the enum of status public class Foo { Status status; } Status can be of type active or disabled. I want to ensure when I use my annotat...
Denis Stephanov
1

votes
2

answer
448

views

Revert all commits in branch and make clean copy of master

I have my feature branch which is created from master branch. I did some changes which I want revert back. In short I want feature branch which will be looks like after creation. After that reverts, I need do some changes and push it on bitbucket with amend parameter to the commit which is on server...
Denis Stephanov
1

votes
2

answer
2.7k

views

@ControllerAdvice doesn't handle exceptions

I am using Spring Boot 1.5.9 for developing my application. I need implement jwt authentication, and I used jjwt library. Following code is from my custom authentication security filter which inherit from OncePerRequestFilter. Here I tried parse username from token, when username is parsing automati...
Denis Stephanov
1

votes
1

answer
807

views

Oauth2 doesn't work in Spring Boot

I have question about Spring Boot. Our app works as Authorization server and Resource server as well. We provide token to users and also secure rest controllers. Now we starting new app and we decide to use Spring Boot 2.0.1. We have implemented Oauth configuration in previous app (1.5.X) so we want...
Denis Stephanov
1

votes
2

answer
47

views

Deserialize flat array in XML by Jackson to List of Pojo

can you help me to parse following XML file? 2017-10-25T09:13:54+02:00 1 Stuart 34 2017-10-25T09:13:54+02:00 2 Lora 12 2017-10-25T09:13:54+02:00 3 Ben 50 2017-10-25T09:13:54+02:00 I tried to create pojo like this: @Getter @Setter @JacksonXmlRootElement(localName = 'element') public class ElementXML...
Denis Stephanov
1

votes
4

answer
184

views

Design customizable ERP in Spring Boot

we are going to develop ERP which should be customizable for different customers, and also customer can tell which modules need and which not. For instance. We got modules A, B and C. Customer needs only A and B, where each module will have domain model, bussiness layer, rest api. Also need add anot...
Denis Stephanov
0

votes
0

answer
4

views

Convert Spring's Order to JPA Order from Pageable

Our frontend is designed to send Pageable object with Spring's Order which contains attribute name. Sample Entity: @Entity @Table public class Foo { private String userName; private Bar bar; } @Embeddable public class Bar { private String value; } We receive pageable with order in repository and par...
Denis Stephanov
1

votes
1

answer
314

views

osm2pgrouting - Parsing data not well-formed (invalid token)

I need import open street maps data into my PostGIS database over osm2pgrouting tool. But when I run command, tables was created but without any data. Can you tell me what am I doing wrong? I have installed extension pgrouting in my db ... As mapconfig I use default mapconfig.xml which is in same fo...
Denis Stephanov
5

votes
3

answer
5.8k

views

Bootstrap 4 layout with one width fixed column

this is my html code: fixed 100px 3 6 3 Can you help me to fix my code please? I need on left side column with fixed width, which will be have 100px. This column have not resize. Rest of space I need to should be dynamically adjustable in ratio 1 : 2 : 1. Thanks for help.
Denis Stephanov
1

votes
3

answer
1.5k

views

Access to outside of context in Dockerfile

In my Maven project I have following structure: docker/ docker-compose.yml A/ Dockerfile B/ Dockerfile src/ target/ foo.war In A's Dockerfile I need access to war in /target folder with the following command: COPY ../../target/foo.war /usr/local/tomcat/webapps/foo.war when I run docker-compose up tt...
Denis Stephanov
2

votes
1

answer
198

views

Generate docker image by maven plugin

I have manually written dockerfile but now I need configure maven to create that file and build image. I'm trying do it with spotify's maven plugin. Here is dockerfile which is written by me and it works: FROM tomcat:8.0-jre8 RUN rm -rvf /usr/local/tomcat/webapps/ROOT COPY ./context.xml /usr/local/t...
Denis Stephanov
12

votes
3

answer
1.5k

views

How to use docker volume to deploy war / jar in Tomcat

Is it possible to deploy some java war or jar file in Tomcat? I looking for a lot of tutorials and the only solution I found is copy project war file into /usr/local/tomcat/webapps/. I actually used that solution but I would like to improve my dockerisation. My primary goal is when I run my 2 images...
Denis Stephanov
1

votes
3

answer
4.9k

views

Do I need resource server with Spring Security OAuth2?

I am trying implement OAuth2 authentication with JWT tokens. If I understand, I need send credentials to authorization server, this verify my credentials, and return back signed JWT token. Next I tried implement WebSecurityConfig which extends WebSecurityConfigurerAdapter, and there I have to set wh...
Denis Stephanov
12

votes
5

answer
17.4k

views

Android - could not install *smartsocket* listener

When I try run my Android application I get this exception: Error while waiting for device: java.lang.RuntimeException: Unable to create Debug Bridge: Unable to start adb server: error: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: An attempt was made to access a socket in a...
Denis Stephanov
24

votes
6

answer
65.3k

views

Access to Image from origin 'null' has been blocked by CORS policy

I have JavaScript application in OpenLayers 3, and my base layer is created from local tiles. I work only in my computer so I do not know why I have CORS error. var newLayer = new ol.layer.Tile({ source: new ol.source.OSM({ url: 'E:/Maperitive/Tiles/vychod/{z}/{x}/{y}.png' }) }); var schladming = [2...
Denis Stephanov
5

votes
2

answer
123

views

On child hover, add background color to container

When the cursor hovers the left div, I need to overlap the whole wrapper, except for left div, with black color with opacity 0.2. How can I do that in css? Thanks. ... some elements ... some elements
Denis Stephanov
4

votes
1

answer
4k

views

Spring MockMvc - How to test delete request of REST controller?

I need to test my controller methods including a delete method. Here is partial controller code: @RestController @RequestMapping('/api/foo') public class FooController { @Autowired private FooService fooService; // other methods which works fine in tests @RequestMapping(path='/{id}', method = Reques...
Denis Stephanov
3

votes
1

answer
551

views

Spring Boot project structure with Authentication

I am learning Spring boot and its modules, but I want avoid to learning bad practices. So can you tell me what project structure is usually using for that? I am using this structure: com +- example +- myproject +- Application.java | +- config | +- CustomSecurityConfig.java (extends WebSecurityConf...
Denis Stephanov
1

votes
3

answer
1.9k

views

Angular 4 condition nested in loop

can you help me fix my code of ng4? I have array of user models, which every have property firstName, lastName, and age like that: export class User { public firstName: string; public lastName: string; public age: number; constructor(fName: string, lName: string, age: number) { this.firstName = fNam...
Denis Stephanov
1

votes
3

answer
980

views

Set object in lambda expression

how could I set my object to another in lambda expression? I got error variable used in lambda expression should be final or effectively final with following code: public MyObj myFun(MyObj o) { MyObj obj = null; myObjList.stream().filter(o -> ...).forEach(o -> { // I do some stuff here // I need he...
Denis Stephanov
1

votes
1

answer
64

views

Find element in ArrayList by conditions and return him or null by lambda

I have collection of custom objects, and I need in my function find the correct one by id property, and return him. If element with that id won't found function return null. Can you help me fix my code? Here is it: public MyObj find(long id) { return myList.stream() .filter(obj -> obj.getId() == id)...
Denis Stephanov

View additional