Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring rest api return bad request http 400 #1082

Open
th1m0r opened this issue Apr 18, 2024 · 3 comments
Open

Spring rest api return bad request http 400 #1082

th1m0r opened this issue Apr 18, 2024 · 3 comments

Comments

@th1m0r
Copy link

th1m0r commented Apr 18, 2024

if start app using java -jar app.jar everything works.

when use winsw to put as windows service, the post methods return http 400 - bad request.

i dont understand why. Anyone have a solution for this?

@th1m0r
Copy link
Author

th1m0r commented Apr 19, 2024

After debug, i fugure out the problems was a ioexception cause by app write on network unit. i tried use configuration os extension on version 2.9.0 and 2.12.0 and try too 3.0.0 alpha 11. But in all cases, i receive access denied.

and

the winsw really work with network shared?

@scutken
Copy link

scutken commented Apr 23, 2024

I just happened to see this question. I use WinSW to run Spring Boot and it works fine. If you are using Spring's configuration files, I suspect there might be an inconsistency in the working directory when using java -jar compared to when using WinSW, which could lead to different configuration files being read.

@th1m0r
Copy link
Author

th1m0r commented Apr 23, 2024

The error http 400 did occour because the app write files on network drivers. And ioexception wasn't dispatched. After test some configurations in differents version of WinSW, i found one that solved my problem with one inconvenient. I need put an delay on initialization and this delay is 2 minutos after windows started. And did need to create an user as admin to logon at network.

I did used the last alpha 3.0 version.

`

<id>Aratu-API</id>

<name>Aratu-API</name>

<description>Aratu mobile api</description>

<env name="D:\TM\aratu-api" value="%BASE%"/>

<executable>java</executable>

<arguments>-Xmx512m -jar "%BASE%\aratuapi.jar"</arguments>

<logmode>rotate</logmode>
<delayedAutoStart>true</delayedAutoStart>
<serviceaccount>
    <username>.\winsw</username>
    <password>wsw2024</password>
    <allowservicelogon>true</allowservicelogon>
</serviceaccount>
<sharedDirectoryMapping>
    <map label="F:" uncpath="\\192.168.3.2\tm"/>
</sharedDirectoryMapping>

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants