Solved

javax.mail.NoSuchProviderException: pop3

Posted on 2003-11-20
19
1,958 Views
Last Modified: 2010-05-18
Hi,
I have a small e-mail program that works fine from within the IDE, but when running the program as a native executable it gives a
"javax.mail.NoSuchProviderException: pop3" when I try to connect to the mailserver.

javax.mail.NoSuchProviderException: pop3
        at javax.mail.Session.getService(Session.java:750)
        at javax.mail.Session.getStore(Session.java:550)
        at javax.mail.Session.getStore(Session.java:512)
        at javax.mail.Session.getStore(Session.java:491)

I think it has to do with the pop3.jar file.This executable jar file contains the information needed, but I don't know how to pass it to the program. I can include the pop3.jar file in my application jar file, but then what? How do I pass it to the manifest file?

any suggestions?

     
0
Comment
Question by:scriptnov
  • 6
  • 6
  • 5
  • +1
19 Comments
 
LVL 15

Expert Comment

by:dualsoul
Comment Utility
you should include your pop3.jar (and all other files from JavaMail framework too, like smtp.jar, mail.jar) in your classpath.
   you can do it many ways, for instance:

   java -cp pop3.jar;mail.jar;smtp.jar;your_programm_jar SomeClassToRun

, this assuming you have all jars in one directory

   or you can just set your CLASSPATH envioroment variable to point this .jar files

 
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
just copy the jar into your jre's 'ext' directory.
0
 

Author Comment

by:scriptnov
Comment Utility
dualsoul,

My program doesn't send messages, so I don't think I need the smtp.jar.
I use JBuilder and while building the archive it gives the possiblility to include required classes and known resources. I included both
the javax.mail and javax.activation packages.
These packages are now included in my program's executable jar file.
I've packaged the pop3.jar in the same directory as the executable and set up the manifest file like this :

Manifest-Version: 1.0
Class-Path: pop3.jar
Main-Class: gui.Start

but I keep getting the same errormessage. Can you see what's wrong?

Objects,

What do you mean by "jre"?
0
 
LVL 15

Expert Comment

by:dualsoul
Comment Utility
> My program doesn't send messages, so I don't think I need the smtp.jar.
i've just said it to illustarate idea of including all JavaMail framework :)

>I've packaged the pop3.jar in the same directory as the executable
so, why not to include it in CLASSPATH?

for instance this way:
      set CLASSPATH=pop3.jar;%CLASSPATH%
 
0
 

Author Comment

by:scriptnov
Comment Utility
wasn't the classpath set in the manifest?
if not, what's the use of the line "Class-Path: pop3.jar" in the manifest if this doesn't set the classpath?

and:
>set CLASSPATH=pop3.jar;%CLASSPATH%
where do I put this command?

0
 
LVL 15

Expert Comment

by:dualsoul
Comment Utility
>wasn't the classpath set in the manifest?
it depends on how your launcher behave

> where do I put this command?
in the command line :), before you run your application

JBuilder have created .exe for you? or .jar?
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
> What do you mean by "jre"?

Java Runtime Environment.
ie. where Java is installed, if you do a file search for "ext" directory you should find it.

> wasn't the classpath set in the manifest?

yes it should have been

Can you post the command you are using to run it.
0
 

Author Comment

by:scriptnov
Comment Utility
what I'm trying to do is create an installer package for Windows for my application.(the app works fine in the IDE).
JBuilder created an executable .jar file and .exe file. So to run the app I doubleclick the .exe file :) or the jar file.
Both give the same error. I  added "Class-Path: pop3.jar" in the manifest. Is that all that's needed to set the classpath is there an aditionnal command needed? If so, I need to be able to include it into the installer package.
I added all references to the mail api and activation.jar in the classpath on my machine.
this is my classpath : C:\j2sdk1.4.2\bin;C:\j2sdkee1.3.1\lib\j2ee.jar;D:\programmas\jakarta-ant-1.5-bin\jakarta-ant-1.5\bin;C:\javamail-1.3.1\mail.jar;C:\jaf-1.0.2\activation.jar;C:\javamail-1.3.1\lib;D:\cleanerapp\cleaner\pop3.jar;
I also added the pop3.jar in the ext directory of the jre. Keep getting the same error.
0
 
LVL 15

Expert Comment

by:dualsoul
Comment Utility
hm... try to make simple .jar file, and run it like this:
       java -jar YourJarFile
do you still have error?

hm....and also, please post the code where you using JAvaMail, may be you are doing something wrong...
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 92

Expert Comment

by:objects
Comment Utility
Could be a problem with installation of JavaMail on the box you are running it on.

> I added all references to the mail api and activation.jar in the classpath on my machine.

I'd suggest adding them to the ext directory.
0
 

Author Comment

by:scriptnov
Comment Utility
Hi,

The problem seems to be with JBuilder. When I manually create a .jar file the .jar file executes ok, and turning the Jar into an exe works fine aswell.
So I guess this problem is solved.
Thank you both for replying.

0
 
LVL 15

Expert Comment

by:dualsoul
Comment Utility
so, please close the topic, don't leave it open in question list
0
 

Author Comment

by:scriptnov
Comment Utility
and HOW do you do this? I,ve been searching this website for 15 minutes to find out how.
I cannot find a button to submit a question on community support anywhere.
I did lke the previous version of this website better!
0
 
LVL 15

Expert Comment

by:dualsoul
Comment Utility
^))
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
Its at the same place the button is to ask a question in this topic:
http://www.experts-exchange.com/Community_Support/askQuestion.jsp
0
 

Author Comment

by:scriptnov
Comment Utility
Thank you , objects.

I didn't want to "Ask (my) question to have these IT experts collaborate to solve (my) toughest IT questions!"
I just wanted to close this question! Anyway, it's done now.
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
> I didn't want to "Ask (my) question to have these IT experts
> collaborate to solve (my) toughest IT questions!"

The link, not this page :)
0
 
LVL 2

Accepted Solution

by:
Lunchy earned 0 total points
Comment Utility
PAQed, with points refunded (250)

Lunchy
Friendly Neighbourhood Community Support Admin
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Java virtual machine monitoring tools 3 39
sumHeights  challenge 17 59
Updating Java 9 87
Free Alternative to JIRA 4 52
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now