javax.mail.NoSuchProviderException: pop3

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?

     
scriptnovAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dualsoulCommented:
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
objectsCommented:
just copy the jar into your jre's 'ext' directory.
0
scriptnovAuthor Commented:
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
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

dualsoulCommented:
> 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
scriptnovAuthor Commented:
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
dualsoulCommented:
>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
objectsCommented:
> 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
scriptnovAuthor Commented:
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
dualsoulCommented:
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
objectsCommented:
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
scriptnovAuthor Commented:
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
dualsoulCommented:
so, please close the topic, don't leave it open in question list
0
scriptnovAuthor Commented:
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
dualsoulCommented:
^))
0
objectsCommented:
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
scriptnovAuthor Commented:
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
objectsCommented:
> 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
LunchyCommented:
PAQed, with points refunded (250)

Lunchy
Friendly Neighbourhood Community Support Admin
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.