When I launch the Main class for execution in Intellij Idea, a request is sent to the server using the jsoup library. Immediately I get a response containing the required class gs_result_i_t_name.
Immediately generate a JAR file. I launch it through Idea (to track requests and responses). The request to the server goes the same as in the first case. But the answer is completely different. The response comes the code, but only in it there is no class gs_result_i_t_name.
As a result of the code operation, a file is created and the data received from the server is written to it. When you compile Main.java files are filled. But even if I run the JAR file separately, there is no result. What can be wrong? Maybe some rights do not have enough JAR-file?
There is a small thought that, under Idea, the server skips the request, but when executing the JAR file, it does not. All because of some difference (I do not know what) between these requests. The request format is the same in both cases. Maybe some User-Agent is changing? Or something like that? Although I did not register the User-agent in the code. The server, by the way, with HTTPS. Maybe JSOUP is not friendly with him? I am sending a username and password.
Here is a piece of code if it helps. Request:
Document doc_for = Jsoup.connect(urls + page + i).cookies(loginCookies2).get(); I get the answer:
Elements elements = doc.getElementsByClass("gs_result_i_t_name"); loginCookies2 in the first case:
{bd_login_cookie="1477424432793:7afa7810c87cf2afbff2c39e1de19aa5", JSESSIONID=a2c8e7b6e99b880faade5f3ff23491abe7433171bb650cd.e677e4e7, LASTSRV=tt.ru, landref=""} And in the second:
{bd_login_cookie="1477424468318:0ab45a3b6eee5a04ae67b78f5f713d6e", JSESSIONID=802b47ae0ba87e6d220d26c47e3341c3ffadf7e522e3f656.b914f103, LASTSRV=tt.ru, landref=""} Here is the Artifacts settings screen: https://goo.gl/vLHPRN
Here is a screen of launch settings: https://goo.gl/nbrqXY
Тут же генерирую JAR-файл. Запускаю его через IdeaТут же генерирую JAR-файл. Запускаю его через Idea. Explain the startup process more specifically. - post_zeew