Solved

javax.mail.NoSuchProviderException: pop3

Posted on 2003-11-20
19
2,068 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
ID: 9790276
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
ID: 9800744
just copy the jar into your jre's 'ext' directory.
0
 

Author Comment

by:scriptnov
ID: 9802148
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:dualsoul
ID: 9802219
> 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
ID: 9802374
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
ID: 9803834
>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
ID: 9804615
> 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
ID: 9810108
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
ID: 9813353
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
 
LVL 92

Expert Comment

by:objects
ID: 9814167
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
ID: 9824918
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
ID: 9827463
so, please close the topic, don't leave it open in question list
0
 

Author Comment

by:scriptnov
ID: 9830796
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
ID: 9833509
^))
0
 
LVL 92

Expert Comment

by:objects
ID: 9833708
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
ID: 9857276
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
ID: 9861207
> 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
ID: 9885871
PAQed, with points refunded (250)

Lunchy
Friendly Neighbourhood Community Support Admin
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How  can  i  resolve  HTTP Status 404 -? 8 58
servlet and mdb, jms error 1 54
How to configure empty element in XML Document parser? 15 44
wild fly 8 startup error 2 37
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn different types of Android Layout and some basics of an Android App.
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…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

685 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