Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8523173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:19:58+00:00 2026-06-11T07:19:58+00:00

i’ve written an Java program that retrieves Mails from my mail account. This jar

  • 0

i’ve written an Java program that retrieves Mails from my mail account.

This jar is called by a cronjob on a Ubuntu Server every 15 minutes.

cronjob:

/bin/sh /root/scripte/cron_bugtracker.sh

cron_bugtracker.sh:

java -jar /path/to/file.jar

The jar works fine but the program dosen’t exit.

When I do ps ax | grep java it always shows a lot java processes with java -jar /path/to/file.jar as command:

32208 ? Sl 0:59 java -jar /path/to/file.jar

My Java-Program works like that:

  1. In the main I call the constructor
  2. In the constructor I call the Method that gets the mails with javax.mail.*
  3. Then the program is finished…at least it should be

Does anyone know why the programm doesn’t exit? Please help.

EDIT:

In the logfiles I found this:

“Control” is the name of my Main Class.

Full thread dump Java HotSpot(TM) Client VM (23.1-b03 mixed mode):

"Service Thread" daemon prio=10 tid=0xb76bd000 nid=0x292 runnable [0x00000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread0" daemon prio=10 tid=0xb76bb400 nid=0x291 waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=10 tid=0xb76b9800 nid=0x290 waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=10 tid=0xb7681c00 nid=0x28f in Object.wait() [0xa10ad000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0xa1585650> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        - locked <0xa1585650> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(Unknown Source)
        at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

"Reference Handler" daemon prio=10 tid=0xb7680000 nid=0x28e in Object.wait() [0xa10fe000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0xa1585228> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Object.java:503)
        at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
        - locked <0xa1585228> (a java.lang.ref.Reference$Lock)

"main" prio=10 tid=0xb7606000 nid=0x28c runnable [0xb77ae000]
   java.lang.Thread.State: RUNNABLE

        at java.lang.ClassLoader.findBootstrapClass(Native Method)
        at java.lang.ClassLoader.findBootstrapClassOrNull(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        - locked <0xa1855398> (a java.lang.Object)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at com.sun.mail.pop3.POP3Folder.createMessage(POP3Folder.java:362)
        at com.sun.mail.pop3.POP3Folder.getMessage(POP3Folder.java:343)
        - locked <0xa18261a0> (a com.sun.mail.pop3.POP3Folder)
        at javax.mail.Folder.getMessages(Folder.java:947)
        - locked <0xa18261a0> (a com.sun.mail.pop3.POP3Folder)
        at javax.mail.Folder.search(Folder.java:1231)
        at Control.receive(Control.java:53)
        at Control.<init>(Control.java:29)
        at Control.main(Control.java:24)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)

"VM Thread" prio=10 tid=0xb767a800 nid=0x28d runnable

"VM Periodic Task Thread" prio=10 tid=0xb76bf800 nid=0x293 waiting on condition

JNI global references: 163

Heap
 def new generation   total 4928K, used 2907K [0xa1580000, 0xa1ad0000, 0xa6ad0000)
  eden space 4416K,  65% used [0xa1580000, 0xa1856e20, 0xa19d0000)
  from space 512K,   0% used [0xa19d0000, 0xa19d0000, 0xa1a50000)
  to   space 512K,   0% used [0xa1a50000, 0xa1a50000, 0xa1ad0000)
 tenured generation   total 10944K, used 0K [0xa6ad0000, 0xa7580000, 0xb1580000)
   the space 10944K,   0% used [0xa6ad0000, 0xa6ad0000, 0xa6ad0200, 0xa7580000)
 compacting perm gen  total 12288K, used 2688K [0xb1580000, 0xb2180000, 0xb5580000)
   the space 12288K,  21% used [0xb1580000, 0xb1820230, 0xb1820400, 0xb2180000)
No shared spaces configured.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:19:59+00:00Added an answer on June 11, 2026 at 7:19 am

    Put a debug print at the very end of the program.
    If you see the print, then it means that the main thread ends, but the program doesn’t exit. I’m guessing that JavaMail has a thread left open (perhaps a Mail Session), that needs closing. Are you sure you’re closing all resources before exiting?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I know there's a lot of other questions out there that deal with this
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.