Problem with Javamail in Red Hat
Good afternoon.
I have a problem with javamail in Red Hat.
When i send a email in windows with my application, works well. But in Red Hat no works.
Gives the following error:
Java.lang.ClassCastException .... gnu.mail.handler.TextPlain
Does anyone know that happens?
You have much to learn. This is the wrong forum for most of it.
You should be able to use the package manager in Linux to
uninstall the Gnu version. Then read this:
[http://java.sun.com/products/javamail/FAQ.html#install|http://java.sun.com/products/javamail/FAQ.html#install]
Similar Messages
-
Networking error (ORA-28547) with 10g on Red Hat Linux
Hello everybody
I'm having the following error when trying to set up a 10g database on a Red Hat machine. I can start the listener correctly, but then the Enterprise Manager shows the following error in the 'Agent Connection to Instance' section:
ORA-28547: connection to server failed, probable Oracle Net admin error (DBD ERROR: OCISessionBegin)
When I try to access using SQL*Plus, I get the same error. I don't know what can be wrong: the listener starts correctly, tnsping gives OK, both using the server name and the SID, and the config. files seem to be correct. Anyone has a clue?
Thanks in advance for your answers.
Just in case, here are (the relevant parts of) mi config. files:
listener.ora:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(PROGRAM = extproc)
(SID_NAME = oradb10g)
(ORACLE_HOME = /opt/app/oracle/)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = oradb10g))
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = st03)(PORT = 1521))
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
tnsnames.ora:
ORADB10G =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = st03)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = oradb10g)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(Key = EXTPROC0))
(CONNECT_DATA =
(SID = oradb10g)
(PRESENTATION = RO)
sqlnet.ora:
SQLNET.AUTHENTICATION_SERVICES=(NONE)
Thanks again.Sorry for the delay, I've been kind of busy :S
Here are the requested files' contents
/etc/hosts:
192.168.1.19 st00.summatec.net st00
192.168.1.33 st03.summatec.net st03
127.0.0.1 localhost.localdomain localhost
192.168.1.11 st01.summatec.net st01
/etc/nsswitch.conf:
passwd: files
shadow: files
group: files
hosts: files dns
bootparams: nisplus [NOTFOUND=return] files
ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files
netgroup: files
publickey: nisplus
automount: files
aliases: files nisplus
$ORACLE_HOME/sysman/config/emd.properties:
perlBin=/opt/app/oracle/perl/bin
scriptsDir=/opt/app/oracle/sysman/admin/scripts
emdRoot=/opt/app/oracle
agentStateDir=/opt/app/oracle
chronosRoot=/opt/app/oracle/sysman/emd/chronos
REPOSITORY_URL=http://st03.summatec.net:4889/em/upload/
agentSeed=802746336
agentVersion=10.1.0.4.0
UploadInterval=5
UploadFailBackoffPct= 20
UploadTimeout=1800
UploadFileSize=2048
UploadMaxBytesXML=50
UploadMaxNumberXML=5000
UploadMaxDiskUsedPct=98
UploadMaxDiskUsedPctFloor=95
emdRootCertLoc=/opt/app/oracle/sysman/config/b64LocalCertificate.txt
internetCertLoc=/opt/app/oracle/sysman/config/b64InternetCertificate.txt
emdWalletSrcUrl=http://st03.summatec.net:4889/em/wallets/emd
emdWalletDest=/opt/app/oracle/sysman/config/server
emd_email_address=
emd_email_gateway=
emd_from_email_address=
EMD_URL=http://st03.summatec.net:/emd/main/
AgentListenOnAllNICs=TRUE
NormalThreadStackSize=0
ouiLoc=/opt/app/oracle/oui
hostConfigClasspath=/opt/app/oracle/oui/jlib/xmlparserv2.jar:/opt/app/oracle/oui/jlib/OraInstaller.jar:/opt/app/oracle/oui/jlib/srvm.jar:/opt/app/oracle/oui/jlib/share.jar:/opt/app/oracle/sysman/jlib/emd_java.jar:/opt/app/oracle/sysman/jlib/log4j-core.jar
JAVA_HOME=/opt/app/oracle/jdk/jre
CLASSPATH=/opt/app/oracle/sysman/jlib/emd_java.jar:/opt/app/oracle/opmn/lib/ons.jar:/opt/app/oracle/lib/xmlparserv2.jar:/opt/app/oracle/sysman/jlib/log4j-core.jar:/opt/app/oracle/oc4j/j2ee/home/lib/http_client.jar:/opt/app/oracle/lib/dms.jar:/opt/app/oracle/lib/dmsEmd.jar:/opt/app/oracle/jlib/share.jar:/opt/app/oracle/jdbc/lib/ojdbc14dms.jar:/opt/app/oracle/jlib/jssl-1_1.jar:/opt/app/oracle/jlib/javax-ssl-1_1.jar:/opt/app/oracle/jlib/ojmisc.jar:/opt/app/oracle/lib/em_test.jar:/opt/app/oracle/jlib/ojmisc.jar:/opt/app/oracle/jlib/repository.jar:/opt/app/oracle/opmn/lib/optic.jar
agentJavaDefines=-Doracle.dms.refresh.wait.time=1000 -DUrlTiming.UseJSSE=true
LogFileMaxSize=4096
LogFileMaxRolls=4
TrcFileMaxSize=4096
TrcFileMaxRolls=4
dynamicPropsComputeTimeout=60
EMAGENT_PERL_TRACE_LEVEL=ERROR
tracelevel.main=WARN
tracelevel.emSDK.xml=WARN
tracelevel.emSDK.utl=WARN
tracelevel.ResMonitor=WARN
tracelevel.Dispatcher=WARN
tracelevel.ThreadPool=WARN
tracelevel.pingManager=WARN
tracelevel.collector=WARN
tracelevel.http=WARN
tracelevel.ssl=WARN
tracelevel.ssl.io=WARN
tracelevel.blackouts=WARN
tracelevel.upload=WARN
tracelevel.command=WARN
tracelevel.reload=WARN
tracelevel.scheduler=WARN
tracelevel.Authentication=WARN
tracelevel.metadata=WARN
tracelevel.targets=WARN
tracelevel.TargetManager=WARN
tracelevel.engine=WARN
tracelevel.javaproc=WARN
tracelevel.vpxoci=WARN
tracelevel.javavm=WARN
tracelevel.fetchlets=WARN
tracelevel.fetchlets.os=WARN
tracelevel.fetchlets.osline=WARN
tracelevel.fetchlets.oslinetok=WARN
tracelevel.fetchlets.UDM=WARN
tracelevel.fetchlets.sql=WARN
tracelevel.fetchlets.url=WARN
tracelevel.fetchlets.urllines=WARN
tracelevel.fetchlets.urllinetoken=WARN
tracelevel.fetchlets.URLTiming=WARN
tracelevel.fetchlets.propEcho=WARN
tracelevel.fetchlets.readFromFile=WARN
tracelevel.fetchlets.readMultFromFile=WARN
tracelevel.fetchlets.throwable=WARN
tracelevel.fetchlets.resourceGrab=WARN
tracelevel.fetchlets.emSDK=WARN
httpTimeoutPrimaryHeader=30
httpTimeoutSecondaryHeaders=30
httpTimeoutBody=60
$ORACLE_HOME/log/st03/client/css.log:
(the following lines are repeated several times)
2006-05-02 12:33:35.709: [ OCROSD][3070490304]utgdv:2:ocr loc file cannot be opened
2006-05-02 12:33:35.710: [ OCROSD][3070490304]utopen:1: Couldnt find ocr,[ocrmirror] location in config file
2006-05-02 12:33:35.710: [ OCRRAW][3070490304]proprinit: Could not open raw device
2006-05-02 12:33:35.710: [ default][3070490304]a_init:7!: Backend init unsuccessful : [33]
2006-05-02 12:33:35.711: [ CSSCLNT][3070490304]clsssinit: error(33 ) in OCR initialization
$ORACLE_HOME/network/log/listener.log (a representative piece):
05-MAY-2006 10:46:58 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=oradb10g)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.33)(PORT=52204)) * establish * oradb10g * 0
05-MAY-2006 10:47:07 * ping * 0
WARNING: Subscription for node down event still pending
05-MAY-2006 10:47:07 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=st03.summatec.net)(USER=oracle))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=st03.summatec.net)(PORT=1521)))(VERSION=169869568)) * status * 0
05-MAY-2006 10:47:08 * (CONNECT_DATA=(SID=oradb10g)(CID=(PROGRAM=perl)(HOST=st03.summatec.net)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.33)(PORT=52208)) * establish * oradb10g * 0
05-MAY-2006 10:47:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=oradb10g)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.33)(PORT=52212)) * establish * oradb10g * 0
(the last line is repeated several times)
$ORACLE_HOME/network/log/sqlnet.log :
Fatal NI connect error 12505, connecting to:
(DESCRIPTION=(SOURCE_ROUTE=OFF)(ADDRESS=(PROTOCOL=IPC)(Key=EXTPROC0))(CONNECT_DATA=(SID=oradb10g)(SERVER=)(PRESENTATION=RO)(CID=(PROGRAM=java)(HOST=st03.summatec.net)(USER=oracle))))
VERSION INFORMATION:
TNS for Linux: Version 10.2.0.1.0 - Production
Unix Domain Socket IPC NT Protocol Adaptor for Linux: Version 10.2.0.1.0 - Production
TCP/IP NT Protocol Adapter for Linux: Version 10.2.0.1.0 - Production
Time: 02-MAY-2006 12:35:22
Tracing not turned on.
Tns error struct:
ns main err code: 12564
TNS-12564: TNS:connection refused
ns secondary err code: 0
nt main err code: 0
nt secondary err code: 0
nt OS err code: 0
Fatal NI connect error 12505, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(Key=EXTPROC0))(CONNECT_DATA=(SID=oradb10g)(PRESENTATION=RO)(CID=(PROGRAM=java)(HOST=st03.summatec.net)(USER=oracle))))
VERSION INFORMATION:
TNS for Linux: Version 10.2.0.1.0 - Production
Unix Domain Socket IPC NT Protocol Adaptor for Linux: Version 10.2.0.1.0 - Production
TCP/IP NT Protocol Adapter for Linux: Version 10.2.0.1.0 - Production
Time: 02-MAY-2006 12:38:18
Tracing not turned on.
Tns error struct:
ns main err code: 12564
TNS-12564: TNS:connection refused
ns secondary err code: 0
nt main err code: 0
nt secondary err code: 0
nt OS err code: 0
I wasn't sure which logs to post, so I included the ones in $ORACLE_HOME/logs and $ORACLE_HOME/network/logs; I hope they are helpful.
Thanks again, and sorry for the long post. -
Problems with Javamail Attachments
Hi,
i've got a major problem with my application and i can't find the answer. Whenever i'm trying to send an attachment i have this error :
javax.mail.internet.ParseException
at javax.mail.internet.ParameterList.<init>(ParameterList.java:77)
at javax.mail.internet.ContentDisposition.<init>(ContentDisposition.java:69)
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1104)
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:824)
at javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:215)
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1056)
at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:1914)
at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1895)
at javax.mail.Transport.send(Transport.java:79)
at Send$5.run(Send.java:209)
at java.lang.Thread.run(Thread.java:536)
Interactive Session Ended
My source code is :
public class DemoSend implements ActionListener{
public void actionPerformed(ActionEvent evt) {
try {
final Properties props = System.getProperties();
props.put("mail.host", hostField.getText());
final Session mailConnection = Session.getDefaultInstance(props, null);
final MimeMessage msg = new MimeMessage(mailConnection);
final Address to = new InternetAddress(toField.getText());
final Address from = new InternetAddress(fromField.getText());
msg.setContent(message.getText(), "text/plain");
msg.setFrom(from);
msg.setRecipient(Message.RecipientType.TO, to);
msg.setSubject(subjectField.getText());
msg.setSentDate(new java.util.Date());
final MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setText(message.getText());
final MimeBodyPart mbp2 = new MimeBodyPart();
mbp2.setDisposition(mbp2.ATTACHMENT);
final FileDataSource fds=new FileDataSource(FileName);
mbp2.setDataHandler(new DataHandler(fds));
mbp2.setFileName(fds.getName());
final Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
mp.addBodyPart(mbp2);
msg.setSentDate(new Date());
msg.setContent(mp);
Runnable r = new Runnable() {
public void run() {
try {
Transport.send(msg);
JOptionPane.showMessageDialog(null," Your message has been sent successfuly","G T P Email Client",JOptionPane.INFORMATION_MESSAGE);
catch (Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null," -- E r r o r -- Your message has not been sent!!!!! ","G T P Email Client",JOptionPane.INFORMATION_MESSAGE);
Thread t = new Thread(r);
t.start();
message.setText("");
catch (Exception e) {
e.printStackTrace();
and i define at the beggining the string FileName
public static String FileName = new String();
and thats for the attach button
attachButton.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
if (fc == null) {
fc = new JFileChooser();
fc.addChoosableFileFilter(new ImageFilter());
fc.setAcceptAllFileFilterUsed(true);
fc.setFileView(new ImageFileView());
fc.setAccessory(new ImagePreview(fc));
fc.setMultiSelectionEnabled(true);
int returnVal = fc.showDialog(Send.this,"Attach File");
fc.getSelectedFile();
File file = fc.getSelectedFile();
It would be a great help if you can can help me find an answer to my problem.
Thanks in advance.I tried to set a specific file for the FileChooser but again the same results.I tried without the preview classes again the same mistake.But when i tried without the JFileChooser it worked, but i must use a JFileChooser in order to choose a file to attach.I used a simple FileChooser and again the same mistakes.I don't know where the mistake is.
I will be grateful if you can help me out,this is an emergency it is for my project and i'm desperate.
I include the whole class.
Thanks again and sorry for the long message.
I hope you have some free time to help me out.
Thanks again
import java.awt.*;
import javax.swing.JFileChooser.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import javax.activation.*;
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
import java.util.Properties;
public class Send extends JFrame {
public static void main(String[] args) throws Exception{
Send client = new Send();
client.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
client.show();
public static JLabel fromLabel = new JLabel("From: ");
public static JLabel toLabel = new JLabel("To: ");
public static JLabel hostLabel = new JLabel("SMTP Server: ");
public static JLabel subjectLabel = new JLabel("Subject: ");
public static JTextField fromField = new JTextField(40);
public static JTextField toField = new JTextField(40);
public static JTextField hostField = new JTextField(40);
public static JTextField subjectField = new JTextField(40);
public static JTextArea message = new JTextArea(40, 80);
public static JScrollPane jsp = new JScrollPane(message);
public static JButton sendButton = new JButton("Send Message");
public static JButton clearButton = new JButton("Clear");
public static JButton attachButton = new JButton("Attach File");
public static JButton adbButton = new JButton("AddressBook");
public static JFileChooser fc;
public static String FileName = new String();
public Send() {
super("SMTP Send email");
Container contentPane = this.getContentPane();
contentPane.setLayout(new BorderLayout());
JPanel labels = new JPanel();
labels.setLayout(new GridLayout(4, 1));
labels.add(hostLabel);
JPanel fields = new JPanel();
fields.setLayout(new GridLayout(4, 1));
final String host = System.getProperty("mail.host", hostField.getText());
hostField.setText(host);
fields.add(hostField);
final String to = System.getProperty("mail.to", toField.getText());
labels.add(toLabel);
fields.add(toField);
final String from = System.getProperty("mail.from", fromField.getText());
fromField.setText(from);
labels.add(fromLabel);
fields.add(fromField);
labels.add(subjectLabel);
fields.add(subjectField);
Box north = Box.createHorizontalBox();
north.add(labels);
north.add(fields);
north.add(attachButton);
north.add(adbButton);
contentPane.add(north, BorderLayout.NORTH);
message.setFont(new Font("Arial", Font.PLAIN, 12));
contentPane.add(jsp, BorderLayout.CENTER);
JPanel south = new JPanel(new FlowLayout());
south.setLayout(new FlowLayout(FlowLayout.CENTER));
south.add(sendButton);
south.add(clearButton);
contentPane.add(south, BorderLayout.SOUTH);
this.pack();
adbButton.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
AddressBook adbook = new AddressBook();
clearButton.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
fromField.setText("");
toField.setText("");
hostField.setText("");
subjectField.setText("");
message.setText("");
attachButton.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
if (fc == null) {
fc = new JFileChooser();
fc.addChoosableFileFilter(new ImageFilter());
fc.setAcceptAllFileFilterUsed(true);
fc.setFileView(new ImageFileView());
fc.setAccessory(new ImagePreview(fc));
fc.setMultiSelectionEnabled(true);
int returnVal = fc.showDialog(Send.this,"Attach File");
File file= fc.getSelectedFile();
//fc.getSelectedFile();
/* JFileChooser fc = new JFileChooser();
int retval = fc.showOpenDialog(Send.this);
fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
fc.setMultiSelectionEnabled(true);
File file = fc.getSelectedFile();*/
DemoSend handler = new DemoSend();
sendButton.addActionListener(handler);
addWindowListener(new WindowAdapter()
public void windowClosing (WindowEvent e)
setSize (600, 500);
show();
public class DemoSend implements ActionListener{
public void actionPerformed(ActionEvent evt) {
try {
final Properties props = new Properties();
props.put("mail.host", hostField.getText());
final Session mailConnection = Session.getDefaultInstance(props, null);
final MimeMessage msg = new MimeMessage(mailConnection);
final Address to = new InternetAddress(toField.getText());
final Address from = new InternetAddress(fromField.getText());
//msg.setContent(message.getText(), "Content-Transfer-Encoding ,base64");
msg.setFrom(from);
msg.setRecipient(Message.RecipientType.TO, to);
msg.setSubject(subjectField.getText());
msg.setSentDate(new java.util.Date());
final MimeBodyPart mbp1 = new MimeBodyPart();
final MimeBodyPart mbp2 = new MimeBodyPart();
mbp1.setContent("Content-Transfer-Encoding", "base64");
mbp1.setText(message.getText());
//if (!FileName.equals("")) {
mbp2.setDisposition(mbp2.ATTACHMENT);
mbp2.setContent("Content-Transfer-Encoding", "base64");
final FileDataSource fds=new FileDataSource(FileName);
mbp2.setDataHandler(new DataHandler(fds));
mbp2.setFileName(fds.getName());
final Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
//if (!FileName.equals("")) {
mp.addBodyPart(mbp2);
msg.setSentDate(new Date());
msg.setHeader("Content-Type", "multipart/mixed");
msg.setContent(mp);
Runnable r = new Runnable() {
public void run() {
try {
Transport.send(msg);
JOptionPane.showMessageDialog(null," Your message has been sent successfuly","G T P Email Client",JOptionPane.INFORMATION_MESSAGE);
catch (Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null," -- E r r o r -- Your message has not been sent!!!!! ","G T P Email Client",JOptionPane.INFORMATION_MESSAGE);
Thread t = new Thread(r);
t.start();
catch (Exception e) {
e.printStackTrace();
} -
Problem with JavaMail 1.1 Api
I have written a stateles session bean that should send a email using
JavaMail 1.1 API. When running as it is now I receive a MessagingException:
"No provider for Address type: rfc822". How do I grant permission to the
mail.jar and activiation.jar files so that WL get it ? Im using Windows NT.
Any help is greatly appreciated.
Regards,
Johan.
SP2 is out now also - so please try it and let me know. I am trying to use the
JavaMail stuff also. I do not seem to be having a problem on SP2 so far.
- Tom
Michael Girdley wrote:
> I understand that this is a bug that is to be fixed in service pack No. 2.
>
> Thanks,
> Michael
>
> --
> ----
> Michael Girdley
> Product Manager, WebLogic Server & Express
> BEA Systems Inc
>
> johan sanden <[email protected]> wrote in message
> news:8hipsh$dur$[email protected]..
> > I have written a stateles session bean that should send a email using
> > JavaMail 1.1 API. When running as it is now I receive a
> MessagingException:
> > "No provider for Address type: rfc822". How do I grant permission to the
> > mail.jar and activiation.jar files so that WL get it ? Im using Windows
> NT.
> >
> > Any help is greatly appreciated.
> >
> > Regards,
> >
> > Johan.
> >
> >
-
Problem with JavaMail: don't work after I made it a jar
Hi, My program works fine if I use -classpath to mail.jar and activation.jar but when I jar it i get:
javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: IOException while sending message;
nested exception is:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type text/plain; charset=us-ascii
at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
please helpWhat did you jar?
The archives JavaMail consists of might contain some non-class extra information.
unzip -l /mnt/ntfs/LANGS/java/extjars/mail.jar |grep -v class
Archive: /mnt/ntfs/LANGS/java/extjars/mail.jar
Length Date Time Name
26991 05-21-99 13:31 META-INF/MANIFEST.MF
0 05-21-99 13:31 META-INF/
286 05-21-99 13:31 META-INF/javamail.default.providers
12 05-21-99 13:31 META-INF/javamail.default.address.map
1107 05-21-99 13:31 META-INF/javamail.charset.map
335 05-21-99 13:31 META-INF/mailcap -
Problems with previously applied red eye corrections
I imported my Aperture 2 library and see that some images that had red eye correction before aren't corrected in AP3. It isn't universal and sometimes one person's eye would be corrected while the other would be red, even though the adjustments indicated both had been corrected.
Anyone else see this?Me, too. I tried reapplying the red eye on a couple of pictures. After I clicked on the red eye tool, my previous red eye corrections appeared as the target icons on the pictures, but the red eyes didn't get corrected. There doesn't seem to be any way I can correct them, now.
-
Hello,
I am trying to use javamail, for sending emails and I am using NetBeans as the IDE, and IIS as the webserver.
I found a code online, from this webpage: http://www.javacommerce.com/displaypage.jsp?name=javamail.sql&id=18274
The webserver runs fine, and the code runs fine too, but the email doesnt get sent. maybe what parameters I pass are wrong, so I am attaching my code as well.
package emailexample;
import
com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingExcep
tion;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
public class Main {
public static void postMail( String recipients[ ],
String subject,
String message ,
String from) throws javax.mail.MessagingException
boolean debug = false;
//Set the host smtp address
Properties props = new Properties();
//props.put("mail.smtp.host", "localhost");
props.put("mail.smtp.host", "localhost");
// create some properties and get the default Session
Session session = Session.getDefaultInstance(props, null);
session.setDebug(debug);
// create a message
Message msg = new MimeMessage(session);
// set the from and to address
InternetAddress addressFrom;
try {
addressFrom = new InternetAddress(from);
msg.setFrom(addressFrom);
InternetAddress[] addressTo = new InternetAddress[recipients.length];
for (int i = 0; i < recipients.length; i++)
addressTo[i] = new InternetAddress(recipients);
msg.setRecipients(Message.RecipientType.TO, addressTo);
// Optional : You can also set your custom headers in the Email if you Want
msg.addHeader("MyHeaderName", "myHeaderValue");
// Setting the Subject and Content Type
msg.setSubject(subject);
msg.setContent(message, "text/plain");
Transport.send(msg);
} catch (AddressException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
public static void main(String[] args) {
try {
postMail(new String[]{"[email protected]"},
"testing java mail", "see it works :)",
"[email protected]");
} catch (javax.mail.MessagingException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
can someone please help?The JavaMail FAQ has tips for debugging, pointers to sample programs, and much more. Start there.
In particular, a protocol trace will help us figure out what's not working. -
Ive had my credit card information stolen at least 2 times since i used firefox. I unistaled firefox untill this issue can be resoved i use spybot ani-spyware and avast antivirus.
== This happened ==
Just once or twice
== First time accured in february 2009 and again in may 2010 ==
== User Agent ==
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.4; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 2.0.50727; yie8)This is unlikely to be a problem related to Firefox unless you downloaded a fake copy. Can you link to where you downloaded your firefox from?
-
Hi there,
I have a problem with cfexecute on Red hat linux 6, i am executing the cat command to read the content and print the output parameter, however CF throws exception "Variable MYOUTPUT is undefined".
Here is my code
<cfexecute name="/bin/cat" arguments="sample_1.txt" variable="myoutput" errorVariable="errorInfo"></cfexecute>
<cfoutput>#myoutput#</cfoutput>
<cfdump var="#errorInfo#"><cfabort>
Any help is much appreciated.arguments="sample_1.txt"
Try the full path instead. -
Using Linux/Red Hat/Intel for Sun ONE/Java Directory Server
Anybody have any experience of this? We're looking to get off AIX, and Total Cost of Ownership for using Solaris/Sparc versus Linux/Intel is very similar.
The decider will be if no-one is using Linux as a platform for Sun ONE/Java Directory Server....
Any feedback would be appreciated....We run Directory 5.1 in production on Solaris/Sparc, but I've tried it with sucess on Red Hat 7.2 on Intel. We have not been able to get it to work on Red Hat Enterprise 2.1 or 3.0. The main problem has been that the administration server fails on startup. Obvious the lack of support for the latest enterprise class Linux is a huge drawback. At this point I've decided to stay on Solaris/Sparc until Red Hat comes out with its own release of Netscape's Directory. When that happens we're going to evaluate whether to move the whole environment to Red Hat. The Sun and Netscape servers are almost identical in terms of features and performance, but having an open source version that can run on less expensive hardware would be a terrific win for us.
-
Problems with the "credentials to connect" on Linux
Hi!
I have installed the the FlashMediaEncoder and the
FlashMediaServer on two seperate machines. The FLashMedia Server
runs on a machine with OS: Linux Red Hat Enterprise. The
FlashMediaEncoder on a Windows XP machine.
At the Connect appears the pop-up of "credentials to connect
to FMS"....
Which password they must be inserted?
Exists a Flash Media Server Authentication Add In for Linux?
Thanks.....As the FMS authentication Add-In is currently not available,
ideally you should not get the credential dialog box.
There can be two possible reasons for which you are getting
the credential dialog:
1. The application mentioned in the URL is not present at the
FMS. Goto [FMS install directory]/Applications and check whether
the application is present.
2. Check whether there is already some access module present
at [FMS install directory]/modules/access. If yes then removing
this can solve the problem. -
Installing Oracle 10g Express Edition on Red Hat Linux
Hi,
I am new with Linux Os and have to install oracle 10g Express Edition on Red Hat Linux Os for a customer. So before proceeding, I need some guidelines.
1) which Linux(freeware) flavor should I install ?
2) is there any virtual enviornment available for Linux Os on which I can install 10g Express Edition database ?
3) If available, is there any difference in using the Linux Os in Virtual enviornment and actual installing Linux ? will there be any difference in installing database and configuration for both the cases?
4) need download link for latest version of Red Hat Linux setup
Regards
Edited by: user640001 on Feb 25, 2011 5:44 AM1) which Linux(freeware) flavor should I install ?Ordinarily, I'd recommend getting Oracle Linux (http://eDelivery.oracle.com/linux) because the default install includes all the prerequisite RPM packages you will need. And failing that, also offers another RPM package "oracle-validated" which will cause the installation of the necessary prerequisites.
But... you mentioned customer: if this is a revenue-producing situation and customer money is at stake, I strongly recommend they obtain commercial O/S support with either Oracle, Red Hat, or maybe SuSE/Novell. Compared to the cost of a downed business, an O/S support arrangement is cheap, cheap, cheap.
2) is there any virtual enviornment available for Linux Os on which I can install 10g Express Edition database ?Sure. You can run Oracle VirtualBox on most Linux, Windows, or Solaris boxes. http://VirtualBox.org for info.
3) If available, is there any difference in using the Linux Os in Virtual enviornment and actual installing Linux ? will there be any difference in installing database and configuration for both the cases?No real differences in either environment.
4) need download link for latest version of Red Hat Linux setupWhat, you didn't try http://eDelivery.oracle.com/linux yet? -
Problem with activesync provisioning user from ldap to red hat
hello,
i am using activesync to provision the user from ldap to red hat linux . i am getting the following error message
An error occurred adding user '#########' to resource 'Red Hat Linux'.
Script failed waiting for " PASSWORD:" in response "passwd: Only one user name may be specified.
_,)#+(:"
Script processor timed out with nothing to read and the following unprocessed text: "passwd: Only one user name may be specified.
_,)#+(:".
when to try to assign redhat resource to a user from the idm the user is getting provisioned to redhat successfully .active sync form is working for all the other resource except the redhat.
can anyone give me solution for the above problem
thanks in advance.Have you set the xhost as ROOT (xhost +hostname), and then as the ORACLE user type "export DISPLAY:0.0" (without the quotes of course) ? This needs to be done prior to running the installer. Try this site for further information - http://www.puschitz.com/OracleOnLinux.shtml
-
Problems with the installation of the Oracle 8i in Red Hat 6.1
It has some days I come trying to install the Oracle (Oracle 8i) in an operational system Linux Red Hat 6.1 and come finding problems, that did not obtain to determine correctly are of the Virtual Java Machine or in runIns.sh of the Oracle.
I go to give a detailed description of the error and mainly of runIns.sh for who it knows vocjs to help me in this arduous task that became the installation of oracle.
The installation of the Virtual Java Machine as well as the one of the Oracle followed the procedures told in the Leiame.Oracle being carried through with the user root.
All the installation process is being carried through with an user of the called system oracle8i pertaining to the primary group oinstall and the suplemental group dba.
When I enter with the following string of command I receive the error below:
$ ./runInstaller
Initializing Java Virtual Machine from /usr/local/jre/bin/jre. Please
wait...
Error in CreateOUIProcess(): -1
: invalid address
The archive runInstall.sh before I discovered this group if found in the following way.
/usr/local/jre/bin/jre -ss4m -oss4m -ms32m -mx64mb -Doracle.installer.nlsEnabled=TRUE -Doracle.installer.startup_location=. -Doracle.installer.library_loc=../../stage/Components/oracle/swd/oui/1.6.0.7.0/1/DataFiles/Expanded/bin/linux -cp ../../stage/Components/oracle/swd/oui/1.6.0.7.0/1/DataFiles/Expanded/lib/InstImages.jar:../../stage/Components/oracle/swd/.oui/1.6.0.7.0/1/DataFiles/Expanded/lib/xmlparser.jar:./ru nimage/lib/OraInstaller.jar:../../stage/Components/oracle/swd/oui/1.6.0.7.0/1/DataFiles/Expanded/lib/ewt.jar:../../stage/Components/oracle/swd/oui/1.6.0.7.0/1/DataFiles/Expanded/li b/help.jar:../../stage/Components/oracle/swd/oui/1.6.0.7.0/1/DataFiles/Expanded/lib/InstHelp.jar:../../stage/Components/oracle/swd/oui/1.6.0.7.0/1/DataFiles/Expanded/lib/oracleice. jar:../../stage/Components/oracle/swd/oui/1.6.0.7.0/1/DataFiles/Expanded/lib/OraInstaller.jar:/tmp/orainstall: -nojit oracle.sysman.oii.oiic.OiicInstaller -scratchPath /tmp/orainstall -sourceLoc "../../stage/products.jar" -sourceType network $1 $2 $3
Soon after with a message placed here I moved for the following format, that is with which remains now.
/usr/local/jre/bin/jre -ss4m -oss4m -ms32m -mx100mb -Doracle.installer.nlsEnabled=TRUE -Doracle.installer.startup_location=. -Doracle.installer.library_loc=../../stage/Components/oracle/swd/oui/1.6.0.7.0/1/DataFiles/Expanded/bin/linux -cp ../../stage/Components/oracle/swd/oui/1.6.0.7.0/1/DataFiles/Expanded/lib/InstImages.jar:../../stage/Components/oracle/swd/.oui/1.6.0.7.0/1/DataFiles/Expanded/lib/xmlparser.jar:./ru nimage/lib/OraInstaller.jar:../../stage/Components/oracle/swd/oui/1.6.0.7.0/1/DataFiles/Expanded/lib/ewt.jar:../../stage/Components/oracle/swd/oui/1.6.0.7.0/1/DataFiles/Expanded/li b/help.jar:../../stage/Components/oracle/swd/oui/1.6.0.7.0/1/DataFiles/Expanded/lib/InstHelp.jar:../../stage/Components/oracle/swd/oui/1.6.0.7.0/1/DataFiles/Expanded/lib/oracleice. jar:../../stage/Components/oracle/swd/oui/1.6.0.7.0/1/DataFiles/Expanded/lib/OraInstaller.jar:/tmp/orainstall: -nojit oracle.sysman.oii.oiic.OiicInstaller -scratchPath /tmp/orainstall -sourceLoc "../../stage/products.jar" -sourceType network $1 $2 $3
They forgive for the exaggerated size of the question, but already I placed this question in other groups of discugco as well as for the Oracle bed and I did not get reply.
I anticipate Gratefulness.
Sebastico Carlos Santos
Universidade Federal de Uberlbndia
Uberlbndia, Minas Gerais, BrasilI had this problem the best thing to do is make sure you have the Blackdown.org JDK116_v5 for Linux installed. Then:
JAVA_HOME=/somedirectory/jdk116_v5
export JAVA_HOME
This fixed the problem for me and I was able to run runIns.sh. -
Hi Group,
I have deployed my project in sun one application server 7.0 installed in red hat linux 7.2 and database is mysql. Its working in fine in normal conditions. I could not able to get connection from datasource after I kept my server 10 hours ideal. Again its working fine once I restarted the server. Please give me any solution to prevent this.
The same project is working fine under all conditions in Sun one app server 7.0 installed in windows 2000 server without any look up probem. I Got this problem only in linux OS.
mysql datasource class com.mysql.jdbc.jdbc2.optional.MysqlDataSource
please find the below code..
Context ctx = new InitialContext();
Datasource testDS = (javax.sql.DataSource)ctx.lookup( "jdbc/testDS");
Connection con = testDs.getConnection();
connection pool settings
<jdbc-connection-pool steady-pool-size="8" max-pool-size="32" max-wait-time-in-millis="0" pool-resize-quantity="2" idle-timeout-in-seconds="0" is-isolation-level-guaranteed="false" is-connection-validation-required="false" connection-validation-method="auto-commit" fail-all-connections="false" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" name="testCP">
<property value="localhost" name="serverName"/>
<property value="3306" name="portNumber"/>
<property value="root" name="user"/>
<property value="test" name="databaseName"/>
</jdbc-connection-pool>
Regards,
Hari haranMy team solved the problem and I thought that we would share.
The version of Xalan that was packaged with the JRE, that is installed by the Sun One app server, was at least 2 versions out of date. Updating the Xalan package solves the issue and the WAR file now works.
Again, this appears to be only on the Linux version as the package deploys and works perfectly on the Windows version.
Maybe you are looking for
-
How to find a lost file in Microsoft Office Autorecovery
Hi - This isn't really a question, though it would have been a couple of hours ago. After saving all his files, closing them and closing all apps, my husband rebooted his Mac Pro (Lion). When it restarted, his key Excel file wasn't there. There was
-
BAPI_SALESORDER_CREATEFROMDAT2 - Configurating Items
Hi everybody! Now i'm trying to create an order but configurating some items, i'm testing the BAPI at SE37, when i test the BAPI it gives me the order number but the configuration in the item WHERE i SEND the data is not made, I give YOU the pa
-
Illustrator crashes at launch on Mac OS X 10.9!!
Please some one help meeeee.. i have brand new iMac 27... i can't use illustrator since 2 months...Illustrator crashes at launch on Mac OS X 10.9!!
-
How can I find and remove an unused font embedded in PDF exported from a book?
The font (Myriad Pro) was the original [Basic Paragraph] font in the indd files, but I need to replace it with a different (approved) font. MP is no longer found by Find Font in any of the indd files in the book. It is not used (that I can find) in t
-
Getting the expression used in the procedure(query)
I am workng with MS Access 2000. I have procedure(query) by the name BILL, created on a table Order Details as: SELECT [UnitPrice], [Quantity], [UnitPrice]*[Quantity] AS BillValue FROM [Order Details]; The dbmd.getColumns(null, null, "BILL", "%") giv