• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

jar stops during execution

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm trying to make a RSS parser that parses some RSS document and sends the filtered output elsewhere via mail/screen popup/etc. All is working well, until I compile it into a jar and run the jar.
The jar just seems to stops during execution when trying to creata a new instance GMailMailer. I have put some log messages in place to see what's going on.




The last log entry I see when running the jar is: 'Using new instance of GmailMailer". When I run the same code via IntelliJ IDE, then all is fine and I can see the log messages that come after it. The GmailMailer class is nothing spectacular



When running the jar, I don't see "Entering GMailMailer constructor" in the log, but I do see it when running from IntelliJ 11. Both classes are in the same package. Now I have run out of ideas.. Why is this happening? All help is welcome...
 
Sheriff
Posts: 22802
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Run your JAR file from a command line, using java -jar <your_jar_file>. This will display all errors and exceptions that occur. My guess is that you have a class path issue, which you can solve by putting a Class-Path entry in your manifest file.
 
Gijs van Wieringen
Greenhorn
Posts: 10
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your reply. The problem was indeed caused by a class path issue. The GMailMailer class had a dependency on a class in an external jar

In the end I fixed it by:
IntelliJ (11)-> 'Project Structure->Artifacts->'Create Jar from Modules'
Select option '<All Modules>' and select Main Class.
In the 'Jar files from libraries' section I select he option 'Copy to output directory and link via manifest'.
 
grapes are vegan food pellets. Eat this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic