[EdLUG] How can I troubleshoot misbehaving java application

Matthew Rankine matthew at mrankine.com
Tue Dec 8 20:10:48 UTC 2020


I believe systemd limits the length of lines in unit files to 2048
characters.

Swithun's email seemed correct to me: your ExecStart (as pasted in 1849
email) had a typo, it included:

-Dhttp.nonProxyHosts=*.service.nexte-Dhttps.proxyHost=
internal-outbounds-nat-1.eu-west-2.elb.amazoneaws.com

which should have read:

-Dhttp.nonProxyHosts=*.service.nexte -Dhttps.proxyHost=
internal-outbounds-nat-1.eu-west-2.elb.amazoneaws.com

Glad you got it fixed!

On Tue, 8 Dec 2020 at 20:01, Tahir Hafiz <tahir.hafiz at gmail.com> wrote:

> It's okay - it's working now - I got rid of the extra stuff and ran
> the ExecStart line with the stuff that worked manually and now it no
> longer crashes!
>
> I just changed the ExecStart to be more simple with just proxy info
> and now the app runs without crashing. Maybe systemd can't handle too
> many flags or the flags are too long - I mean it was a huge one liner!
>
> On Tue, Dec 8, 2020 at 7:29 PM Tahir Hafiz <tahir.hafiz at gmail.com> wrote:
> >
> > Yep, no spaces in the -Dhttps.proxy flags.
> >
> > So from what you are saying the flags should be passed in?
> > It is just one long ExecStart line.
> >
> > I can run my the application manually by:
> > java proxy_info_flags _proxy_stuff -jar my_java_app.jar
> >
> > And it works fine, it's able to pick up the proxy and the app is able
> > to talk https outbound.
> >
> > Just when systemd runs it up with those flags it doesn't pick up the
> > https proxy and it barfs on start-up and then it keeps starting up
> > again, crashing, starting, crashing, ... etc... because of systemd
> > restart every 10 seconds.
> > I just don't know what's wrong.
> >
> > Tai - good shout about running the commands in screen or tmux - so if
> > I screen/tmux it, the parent shell kicks me out, the sub-shell will
> > keep running! Brilliant - thank you!!
> >
> > Cheers,
> > Tahir
> >
> > On Tue, Dec 8, 2020 at 7:21 PM Tai Kedzierski <dch.tai at gmail.com> wrote:
> > >
> > > @Swithun Java has a parameterisation thing that specifies passing the
> "-D<argument>" thing with no spaces...
> > >
> > > // Sent from a mobile device. Typos and brevity may transpire.
> > >
> > > On Tue, 8 Dec 2020, 19:17 Swithun Crowe, <swithun at swithun.com> wrote:
> > >>
> > >> Hello
> > >>
> > >> TH> It’s a line like this in the systemd service
> file:ExecStart=/bin/java
> > >> TH> -Xmx1200m -Dhttp.nonProxyHosts=*.service.nexte-Dhttps.proxyHost=
> internal-outbounds-nat-1.eu-west-2.elb.amazoneaws.com
> > >> TH> -Dhttps.proxyPort=3128
> -Dlogging.config=/opt/my-api/config/logback.xml
> > >> TH> -jar /opt/my-api/my-api-6.1.jar
> > >>
> > >> Has the line got mangled in an email, or should there be spaces
> between
> > >> the -D... flags?
> > >>
> > >> Looking at my systemd .service files, the ExecStart lines have
> arguments
> > >> that get passed to the commands.
> > >>
> > >> TH> Also, how can I log into different server boxes and run these two
> > >> TH> commands in a shell but with some kind of nohup option (or
> similar) so
> > >> TH> the process won’t crash if I get timed out (kicked out) from the
> > >> TH> shells:
> > >>
> > >> Can you install GNU screen or tmux on these servers? If you start a
> > >> session, and run the commands in there, you can disconnect (or get
> > >> disconnected) and the processes will keep running.
> > >>
> > >> Good luck.
> > >>
> > >> Swithun.--
> > >> EdLUG mailing list
> > >> EdLUG at mailman.lug.org.uk
> > >> https://lists.edlug.org.uk/mailman/listinfo/edlug
> > >
> > > --
> > > EdLUG mailing list
> > > EdLUG at mailman.lug.org.uk
> > > https://lists.edlug.org.uk/mailman/listinfo/edlug
>
> --
> EdLUG mailing list
> EdLUG at mailman.lug.org.uk
> https://lists.edlug.org.uk/mailman/listinfo/edlug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.edlug.org.uk/pipermail/edlug/attachments/20201208/ab82c7e8/attachment-0001.html>


More information about the EdLUG mailing list