JavaMail NoClassDefFoundError

The following code complies OK but won't run. I get a ava.lang.NoClassDefFoundError: . What's my problem?
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;
public class SendMail {
public static void main (String[] args) throws Exception {
String host = "mail.xxxxx.com";
String from = "[email protected]";
Address address = new InternetAddress("[email protected]")
Properties props = System.getProperties();
props.put("mail.smtp.host", host);
Session session = Session.getDefaultInstance(props, null);
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.setRecipients(Message.RecipientType.TO,
address);
message.setSubject("Hello JavaMail");
message.setText("Welcome to JavaMail");
Transport.send(message);
}

Probably forgot to set the class path so it can find the javax.mail package. If it works when you compile, then make sure you got the same classpath when you run it. Then there should be no problem.

Similar Messages

  • NoClassDefFoundError - JavaMail

    Hi All!
    I have written a aplication to send mail using JavaMail.
    It compiles like a dream, but gives a NoClassDefFoundError: java/mail/Address
    Is it a bug? (OS: NT Workstation 4)

    Your classpath is not set up properly when running java. If you app is a jar, you can specify the classpath in the manifest file when running it, or setting the classpath globally on your system. It has to point directly to the javamail jar. Another fix is to put the javamail jar in the jre/lib/ext folder so that it becomes apart of java's default loaded classes.

  • Getting error while sending mail through javamail api

    I can able to compile the following code successfully but while executing it showing the error
    C:\Program Files\Java\javamail-1.4\demo>java msgsend -o [email protected] -M 203.112.158.188 [email protected]
    Exception in thread "main" java.lang.NoClassDefFoundError: msgsend
    import java.io.*;
    import java.net.InetAddress;
    import java.util.Properties;
    import java.util.Date;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class msgsend {
    public static void main(String[] argv) {
         String to, subject = null, from = null,
              cc = null, bcc = null, url = null;
         String mailhost = "null";
         String mailer = "msgsend";
         String file = null;
         String protocol = null, host = null, user = null, password = null;
         String record = null;     // name of folder in which to record mail
         boolean debug = false;
         BufferedReader in =
                   new BufferedReader(new InputStreamReader(System.in));
         int optind;
         for (optind = 0; optind < argv.length; optind++) {
         if (argv[optind].equals("-T")) {
              protocol = argv[++optind];
         } else if (argv[optind].equals("-H")) {
              host = argv[++optind];
         } else if (argv[optind].equals("-U")) {
              user = argv[++optind];
         } else if (argv[optind].equals("-P")) {
              password = argv[++optind];
         } else if (argv[optind].equals("-M")) {
              mailhost = argv[++optind];
         } else if (argv[optind].equals("-f")) {
              record = argv[++optind];
         } else if (argv[optind].equals("-a")) {
              file = argv[++optind];
         } else if (argv[optind].equals("-s")) {
              subject = argv[++optind];
         } else if (argv[optind].equals("-o")) { // originator
              from = argv[++optind];
         } else if (argv[optind].equals("-c")) {
              cc = argv[++optind];
         } else if (argv[optind].equals("-b")) {
              bcc = argv[++optind];
         } else if (argv[optind].equals("-L")) {
              url = argv[++optind];
         } else if (argv[optind].equals("-d")) {
              debug = true;
         } else if (argv[optind].equals("--")) {
              optind++;
              break;
         } else if (argv[optind].startsWith("-")) {
              System.out.println(
    "Usage: msgsend [[-L store-url] | [-T prot] [-H host] [-U user] [-P passwd]]");
              System.out.println(
    "\t[-s subject] [-o from-address] [-c cc-addresses] [-b bcc-addresses]");
              System.out.println(
    "\t[-f record-mailbox] [-M transport-host] [-a attach-file] [-d] [address]");
              System.exit(1);
         } else {
              break;
         try {
         if (optind < argv.length) {
              // XXX - concatenate all remaining arguments
              to = argv[optind];
              System.out.println("To: " + to);
         } else {
              System.out.print("To: ");
              System.out.flush();
              to = in.readLine();
         if (subject == null) {
              System.out.print("Subject: ");
              System.out.flush();
              subject = in.readLine();
         } else {
              System.out.println("Subject: " + subject);
         Properties props = System.getProperties();
         // XXX - could use Session.getTransport() and Transport.connect()
         // XXX - assume we're using SMTP
         if (mailhost != null)
              props.put("mail.smtp.host", mailhost);
         // Get a Session object
         Session session = Session.getInstance(props, null);
         if (debug)
              session.setDebug(true);
         // construct the message
         Message msg = new MimeMessage(session);
         if (from != null)
              msg.setFrom(new InternetAddress(from));
         else
              msg.setFrom();
         msg.setRecipients(Message.RecipientType.TO,
                             InternetAddress.parse(to, false));
         if (cc != null)
              msg.setRecipients(Message.RecipientType.CC,
                             InternetAddress.parse(cc, false));
         if (bcc != null)
              msg.setRecipients(Message.RecipientType.BCC,
                             InternetAddress.parse(bcc, false));
         msg.setSubject(subject);
         String text = collect(in);
         if (file != null) {
              // Attach the specified file.
              // We need a multipart message to hold the attachment.
              MimeBodyPart mbp1 = new MimeBodyPart();
              mbp1.setText(text);
              MimeBodyPart mbp2 = new MimeBodyPart();
              mbp2.attachFile(file);
              MimeMultipart mp = new MimeMultipart();
              mp.addBodyPart(mbp1);
              mp.addBodyPart(mbp2);
              msg.setContent(mp);
         } else {
              // If the desired charset is known, you can use
              // setText(text, charset)
              msg.setText(text);
         msg.setHeader("X-Mailer", mailer);
         msg.setSentDate(new Date());
         // send the thing off
         Transport.send(msg);
         System.out.println("\nMail was sent successfully.");
         // Keep a copy, if requested.
         if (record != null) {
              // Get a Store object
              Store store = null;
              if (url != null) {
              URLName urln = new URLName(url);
              store = session.getStore(urln);
              store.connect();
              } else {
              if (protocol != null)          
                   store = session.getStore(protocol);
              else
                   store = session.getStore();
              // Connect
              if (host != null || user != null || password != null)
                   store.connect(host, user, password);
              else
                   store.connect();
              // Get record Folder. Create if it does not exist.
              Folder folder = store.getFolder(record);
              if (folder == null) {
              System.err.println("Can't get record folder.");
              System.exit(1);
              if (!folder.exists())
              folder.create(Folder.HOLDS_MESSAGES);
              Message[] msgs = new Message[1];
              msgs[0] = msg;
              folder.appendMessages(msgs);
              System.out.println("Mail was recorded successfully.");
         } catch (Exception e) {
         e.printStackTrace();
    public static String collect(BufferedReader in) throws IOException {
         String line;
         StringBuffer sb = new StringBuffer();
         while ((line = in.readLine()) != null) {
         sb.append(line);
         sb.append("\n");
         return sb.toString();
    So please help me to resolve that error.

    The directory that contains msgsend.class (usually the current directory)
    is not in your CLASSPATH setting. Be sure that "." is included as one of the
    entries in CLASSPATH.

  • Sending mail using javamail

    Hi!
    I am new to JavaMail and trying to execute a simple code to send mail.
    I can compile the code without any errors. But when I try to run it, I get following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/MessagingException
    I have my mail.jar and activation.jar in \lib\ext.
    the code is demo code from sun, in their demo files that one gets with javamail.
    Thanks,
    bandya

    You have to put the paths if mail.jar and activation.jar in the system CLASSPATH.
    or you can do this before executing the java program
    in command prompt
    set CLASSPATH=%CLASSPATH%;c:\mail.jar;c:\activation.jar
    assuming the jar are in c:\ .

  • Oracle BI 11.1.1.7.1: Calling BI webservices from Plsql Procedure: ORA-29532: Java call terminated by uncaught Java exception: java.lang.NoClassDefFoundError

    Hi,
         I have a requirement of calling BI webservices from Plsql stored procedure. I generated all my wsdl java classes and loaded them into the database. However, when I tried to call one of my java class using stored procedure, it is giving me"ORA-29532: Java call terminated by uncaught Java exception: java.lang.NoClassDefFoundError".
    *Cause:    A Java exception or error was signaled and could not be
               resolved by the Java code.
    *Action:   Modify Java code, if this behavior is not intended.
    But all my dependency classes are present in database as java class objects and are valid. Can some one help me out of this?

    Stiphane,
    You can look in USER_ERRORS to see if there's anything more specific reported by the compiler. But, it could also be the case that everything's OK (oddly enough). I loaded the JavaMail API in an 8.1.6 database and also got bytecode verifier errors, but it ran fine. Here are the errors I got when loading Sun's activation.jar, which ended up not being a problem:
    ORA-29552: verification warning: at offset 12 of <init> void (java.lang.String, java.lang.String) cannot access class$java$io$InputStream
    verifier is replacing bytecode at <init> void (java.lang.String, java.lang.String):12 by a throw at offset 18 of <init> void (java.lang.String, java.lang.String) cannot access class$java$io$InputStream
    verifier is replacing bytecode at <init> void (java.lang.String, java.lang.String):18 by a throw at offset 30 of <init> void (java.lang.String, java.lang.String) cannot access class$java$io$InputStream
    verifier is replacing bytecode at <init> void (java.lang.String, java.lang.String):30 by a throw
    Hope this helps,
    -Dan
    http://www.compuware.com/products/devpartner/db/oracle_debug.htm
    Debug PL/SQL and Java in the Oracle Database

  • Java.lang.NoClassDefFoundError: javax/mail/Service

    Hi,
    Happy New Year Everyone! Sadly, it's not that happy for me right now, I'm trying to write a mail app using JavaMail, but I'm getting a NoClassDefFoundError when I run the program.... The program compiles fine, it only crashes when I run the program. Does anyone have any ideas why that's happenning? I compile the program using javac -classpath .:mail.jar *.java and I'm working on a Unix Box. Any help anyone can provide is greatly appreciated!
    The error message I received is pasted below (I left out the stack trace to make reading easier).
    Exception occurred during event dispatching:
    java.lang.NoClassDefFoundError: javax/mail/Service
    [Stack Trace]
    Thanks in Advance!
    Juivette

    Read the directions that came with the javamail API...it tells you the OTHER API you need. Also, word of advice....I un jar'd and re-jar'd all the classes from BOTH API's in one file...makes life easier.

  • JavaMail classpath problems...

    Hi there,
    I have coded a function that will send an email. The code compiles perfectly in the command line and i have the mail.jar file placed in the C:\j2sdk1.4.2_12\lib\javamail-1.3 folder and the activation.jar file placed in the C:\j2sdk1.4.2_12\lib\jaf-1.0.2 folder with the classpaths set in the environment variables. Everytime i go to run the program i get the "java.lang.NoClassDefFoundError: javax/mail/Session" error in the console. It clearly can't find the Session.class for some reason. Anybody have any ideas what I can do to fix this?
    (I have the jar files installed on the server that my application is located on)
    James
    Edited by: JamesAL on Jun 19, 2008 3:53 AM

    I'm running it on a web server. It's part of an application on which orders can be placed. The email is basically a little confirmation email after the order is successfully placed. I have the classpath set for the neccessary jar files on the webserver in the Environment variables and also have the imports at the top. I am using JavaMail 1.3 and Java SDK 1.4 and it has been suggested there could be some sort of bug when trying to use this version of JavaMail with this version of Java. Do you think that is a possibility?
    The function is located in the same .class file from which it is called (so its called internally) rather than it being located in the WEB-INF folder in tomcat. Would that make a difference?

  • "main" java.lang.NoClassDefFoundError: msgshow : ERROR

    Hi To All Of U!
    I am a new user to this group and very new to Java.
    I tried to install JavaMail-1.3.2ea on linux server.
    before installing JavaMail i installed JavaBeans Activation Framework
    (Jaf-1_0_2.) also.
    After installation of both the things i set the CLASSPATH which include both mail.jar and activation.jar files.
    $CLASSPATH = .:/usr/local/jdk/lib/classes.zip:/root/downloads/Javamail/javamail-1.3.2ea/mail.jar:.:/root/downloads/Javamail/jaf-1.0.2/activation.jar
    then i compiled the demo prg msgshow.java it compiled successfully..
    but when i run
    java msgshow -T imap -H <mailserver> -U <username> -P <passwd> -f INBOX 5
    i got an error
    Exception in thread "main" java.lang.NoClassDefFoundError: msgshow
    i am not able to understand this problem..as i am very new to this..
    any help will be appreciated..
    hope to get a quick response..i need to rectify it soon.

    i have tried again to reinstall JAVAMAIL.
    now the error comes..:
    Exception in thread "main" java.lang.NumberFormatException: For input string: "shrankhl"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:468)
    at java.lang.Integer.parseInt(Integer.java:518)
    at msgshow.main(msgshow.java:94)
    the code of msgshow function is :
    public class msgshow {
    static String protocol;
    static String host = null;
    static String user = null;
    static String password = null;
    static String mbox = null;
    static String url = null;
    static int port = -1;
    static boolean verbose = false;
    static boolean debug = false;
    static boolean showStructure = false;
    static boolean showMessage = false;
    static boolean showAlert = false;
    static boolean saveAttachments = false;
    static int attnum = 1;
    public static void main(String argv[]) {
    int msgnum = -1;
    int optind;
    InputStream msgStream = System.in;
    for (optind = 0; optind < argv.length; optind++) {
    if (argv[optind].equals("-T")) {
    protocol = argv[++optind];
    } else if (argv[optind].equals("-H")) {
    host = argv[++optind];
    } else if (argv[optind].equals("-U")) {
    user = argv[++optind];
    } else if (argv[optind].equals("-P")) {
    password = argv[++optind];
    } else if (argv[optind].equals("-v")) {
    verbose = true;
    } else if (argv[optind].equals("-D")) {
    debug = true;
    } else if (argv[optind].equals("-f")) {
    mbox = argv[++optind];
    } else if (argv[optind].equals("-L")) {
    url = argv[++optind];
    } else if (argv[optind].equals("-p")) {
    port = Integer.parseInt(argv[++optind]);
    } else if (argv[optind].equals("-s")) {
    showStructure = true;
    } else if (argv[optind].equals("-S")) {
    saveAttachments = true;
    } else if (argv[optind].equals("-m")) {
    showMessage = true;
    } else if (argv[optind].equals("-a")) {
    showAlert = true;
    } else if (argv[optind].equals("--")) {
    optind++;
    break;
    } else if (argv[optind].startsWith("-")) {
    System.out.println(
    "Usage: msgshow [-L url] [-T protocol] [-H host] [-p port] [-U user]");
    System.out.println(
    "\t[-P password] [-f mailbox] [msgnum] [-v] [-D] [-s] [-S] [-a]");
    System.out.println(
    "or msgshow -m [-v] [-D] [-s] [-S] [-f msg-file]");
    System.exit(1);
    } else {
    break;
    try {
    if (optind < argv.length)
    msgnum = Integer.parseInt(argv[optind]);
    // Get a Properties object
    Properties props = System.getProperties();
    // Get a Session object
    Session session = Session.getInstance(props, null);
    session.setDebug(debug);
    if (showMessage) {
    MimeMessage msg;
    if (mbox != null)
    msg = new MimeMessage(session,
    new BufferedInputStream(new FileInputStream(mbox)));
    else
    msg = new MimeMessage(session, msgStream);
    dumpPart(msg);
    System.exit(0);
    // Get a Store object
    Store store = null;
    if (url != null) {
    URLName urln = new URLName(url);
    store = session.getStore(urln);
    if (showAlert) {
    store.addStoreListener(new StoreListener() {
    public void notification(StoreEvent e) {
    String s;
    if (e.getMessageType() == StoreEvent.ALERT)
    s = "ALERT: ";
    else
    s = "NOTICE: ";
    System.out.println(s + e.getMessage());
    store.connect();
    } else {
    if (protocol != null)
    store = session.getStore(protocol);
    else
    store = session.getStore();
    // Connect
    if (host != null || user != null || password != null)
    store.connect(host, port, user, password);
    else
    store.connect();
    // Open the Folder
    Folder folder = store.getDefaultFolder();
    if (folder == null) {
    System.out.println("No default folder");
    System.exit(1);
    if (mbox == null)
    mbox = "INBOX";
    folder = folder.getFolder(mbox);
    if (folder == null) {
    System.out.println("Invalid folder");
    System.exit(1);
    // try to open read/write and if that fails try read-only
    try {
    folder.open(Folder.READ_WRITE);
    } catch (MessagingException ex) {
    folder.open(Folder.READ_ONLY);
    int totalMessages = folder.getMessageCount();
    if (totalMessages == 0) {
    System.out.println("Empty folder");
    folder.close(false);
    store.close();
    System.exit(1);
    if (verbose) {
    int newMessages = folder.getNewMessageCount();
    System.out.println("Total messages = " + totalMessages);
    System.out.println("New messages = " + newMessages);
    System.out.println("-------------------------------");
    if (msgnum == -1) {
    // Attributes & Flags for all messages ..
    Message[] msgs = folder.getMessages();
    // Use a suitable FetchProfile
    FetchProfile fp = new FetchProfile();
    fp.add(FetchProfile.Item.ENVELOPE);
    fp.add(FetchProfile.Item.FLAGS);
    fp.add("X-Mailer");
    folder.fetch(msgs, fp);
    for (int i = 0; i < msgs.length; i++) {
    System.out.println("--------------------------");
    System.out.println("MESSAGE #" + (i + 1) + ":");
    dumpEnvelope(msgs);
    // dumpPart(msgs[i]);
    } else {
    System.out.println("Getting message number: " + msgnum);
    Message m = null;
    try {
    m = folder.getMessage(msgnum);
    dumpPart(m);
    } catch (IndexOutOfBoundsException iex) {
    System.out.println("Message number out of range");
    folder.close(false);
    store.close();
    } catch (Exception ex) {
    System.out.println("Oops, got exception! " + ex.getMessage());
    ex.printStackTrace();
    System.exit(1);
    System.exit(0);
    public static void dumpPart(Part p) throws Exception {
    if (p instanceof Message)
    dumpEnvelope((Message)p);
    /** Dump input stream ..
    InputStream is = p.getInputStream();
    // If "is" is not already buffered, wrap a BufferedInputStream
    // around it.
    if (!(is instanceof BufferedInputStream))
    is = new BufferedInputStream(is);
    int c;
    while ((c = is.read()) != -1)
    System.out.write(c);
    String ct = p.getContentType();
    try {
    pr("CONTENT-TYPE: " + (new ContentType(ct)).toString());
    } catch (ParseException pex) {
    pr("BAD CONTENT-TYPE: " + ct);
    String filename = p.getFileName();
    if (filename != null)
    pr("FILENAME: " + filename);
    * Using isMimeType to determine the content type avoids
    * fetching the actual content data until we need it.
    if (p.isMimeType("text/plain")) {
    pr("This is plain text");
    pr("---------------------------");
    if (!showStructure && !saveAttachments)
    System.out.println((String)p.getContent());
    } else if (p.isMimeType("multipart/*")) {
    pr("This is a Multipart");
    pr("---------------------------");
    Multipart mp = (Multipart)p.getContent();
    level++;
    int count = mp.getCount();
    for (int i = 0; i < count; i++)
    dumpPart(mp.getBodyPart(i));
    level--;
    } else if (p.isMimeType("message/rfc822")) {
    pr("This is a Nested Message");
    pr("---------------------------");
    level++;
    dumpPart((Part)p.getContent());
    level--;
    } else {
    if (!showStructure && !saveAttachments) {
    * If we actually want to see the data, and it's not a
    * MIME type we know, fetch it and check its Java type.
    Object o = p.getContent();
    if (o instanceof String) {
    pr("This is a string");
    pr("---------------------------");
    System.out.println((String)o);
    } else if (o instanceof InputStream) {
    pr("This is just an input stream");
    pr("---------------------------");
    InputStream is = (InputStream)o;
    int c;
    while ((c = is.read()) != -1)
    System.out.write(c);
    } else {
    pr("This is an unknown type");
    pr("---------------------------");
    pr(o.toString());
    } else {
    // just a separator
    pr("---------------------------");
    * If we're saving attachments, write out anything that
    * looks like an attachment into an appropriately named
    * file. Don't overwrite existing files to prevent
    * mistakes.
    if (saveAttachments && level != 0 && !p.isMimeType("multipart/*")) {
    String disp = p.getDisposition();
    // many mailers don't include a Content-Disposition
    if (disp == null || disp.equalsIgnoreCase(Part.ATTACHMENT)) {
    if (filename == null)
    filename = "Attachment" + attnum++;
    pr("Saving attachment to file " + filename);
    try {
    File f = new File(filename);
    if (f.exists())
    // XXX - could try a series of names
    throw new IOException("file exists");
    OutputStream os =
    new BufferedOutputStream(new FileOutputStream(f));
    InputStream is = p.getInputStream();
    int c;
    while ((c = is.read()) != -1)
    os.write(c);
    os.close();
    } catch (IOException ex) {
    pr("Failed to save attachment: " + ex);
    pr("---------------------------");
    public static void dumpEnvelope(Message m) throws Exception {
    pr("This is the message envelope");
    pr("---------------------------");
    Address[] a;
    // FROM
    if ((a = m.getFrom()) != null) {
    for (int j = 0; j < a.length; j++)
    pr("FROM: " + a[j].toString());
    // TO
    if ((a = m.getRecipients(Message.RecipientType.TO)) != null) {
    for (int j = 0; j < a.length; j++) {
    pr("TO: " + a[j].toString());
    InternetAddress ia = (InternetAddress)a[j];
    if (ia.isGroup()) {
    InternetAddress[] aa = ia.getGroup(false);
    for (int k = 0; k < aa.length; k++)
    pr(" GROUP: " + aa[k].toString());
    // SUBJECT
    pr("SUBJECT: " + m.getSubject());
    // DATE
    Date d = m.getSentDate();
    pr("SendDate: " +
    (d != null ? d.toString() : "UNKNOWN"));
    // FLAGS
    Flags flags = m.getFlags();
    StringBuffer sb = new StringBuffer();
    Flags.Flag[] sf = flags.getSystemFlags(); // get the system flags
    boolean first = true;
    for (int i = 0; i < sf.length; i++) {
    String s;
    Flags.Flag f = sf[i];
    if (f == Flags.Flag.ANSWERED)
    s = "\\Answered";
    else if (f == Flags.Flag.DELETED)
    s = "\\Deleted";
    else if (f == Flags.Flag.DRAFT)
    s = "\\Draft";
    else if (f == Flags.Flag.FLAGGED)
    s = "\\Flagged";
    else if (f == Flags.Flag.RECENT)
    s = "\\Recent";
    else if (f == Flags.Flag.SEEN)
    s = "\\Seen";
    else
    continue; // skip it
    if (first)
    first = false;
    else
    sb.append(' ');
    sb.append(s);
    String[] uf = flags.getUserFlags(); // get the user flag strings
    for (int i = 0; i < uf.length; i++) {
    if (first)
    first = false;
    else
    sb.append(' ');
    sb.append(uf[i]);
    pr("FLAGS: " + sb.toString());
    // X-MAILER
    String[] hdrs = m.getHeader("X-Mailer");
    if (hdrs != null)
    pr("X-Mailer: " + hdrs[0]);
    else
    pr("X-Mailer NOT available");
    static String indentStr = " ";
    static int level = 0;
    * Print a, possibly indented, string.
    public static void pr(String s) {
    if (showStructure)
    System.out.print(indentStr.substring(0, level * 2));
    System.out.println(s);
    this is the whole code of msgshow function.
    this is a demo function only.
    pls suggest any other way also to check that the java application is running or not.
    Thanx Very Much
    Hope to get a reply soon....
    Happy New Year

  • NoClassDefFoundError: com/sap/sql/log/OpenSQLException

    I have developed a Java project. It consists of 2 SQLJ files and then a Java class. When I try to execute the Java program, I get a Java error:
    java.lang.NoClassDefFoundError: com/sap/sql/log/OpenSQLException
         at com.mbb.crrs.business.report.dao.ReportDAO.<init>(ReportDAO.sqlj:23)
         at com.mbb.crrs.business.report.dao.Test.main(Test.java:24)
    Exception in thread "main"
    I notice a similar problem on message: Re: Which jar to include com.sap.sql.log.OpenSQLException
    Is that something that I need to maintain for it to work? Thank you.

    Hi,
    the problem one year ago was that the SQLException class was not available through remote access. I don't know if that might have been changed meanwhile in the latest release.
    I implemented a simple work around: I caught every SQL-exception in the method where it was thrown, wrapped the exception message and any nested exception in a self written exception and threw this new exception. That worked fine.
    Regards, Astrid

  • Exception in thread "main" java.lang.NoClassDefFoundError

    Am using java 1.3.1 on Red Hat Linux 7.1
    i get this error
    Exception in thread "main" java.lang.NoClassDefFoundError
    while running a simple program HelloWorld.java
    help

    When you use the "java" command, the only required argument is the name of the class that you want to execute. This argument must be a class name, not a file name, and class names are case sensitive. For example, "java HelloWorld.java" won't work because the class name isn't HelloWorld.java, it's HelloWorld. Similarly, "java helloworld" won't work because a class defined as "public class HelloWorld {" is not named helloworld due to case sensitivity. Finally, the .class file must be in a directory that is in the Classpath - that's where java.exe searches to find the file that contains the class.

  • Error during generation of the WSDL:  BUILD FAILED java.lang.NoClassDefFoundError: com/sun/javadoc/Type

    When I create an EJB Transport Business Service, after selecting the jar that has the EJB 2.1 artefacts (Remote, Home, etc) the oepe plugin fails and can't continue.
    As I understand it seems that there is a problem with the classpath of ant build.xml  that oepe creates inside folder /tmp/alsbejbtransport/ to compile the bs and generate the wsdl. I checked if tools.jar is in the classpath (in eclipse) and is included, so I can't figure out wich is the problem.
    I found this in Oracle, but not helps solve the problem:
    BEA-398120
    Error: The WSDL for the typed transport endpoint could not be accessed.
    Description
    There was a problem retrieving the WSDL from the typed transport service endpoint at the time of service registration
    Action
    Contact technical support
    This is the the full stacktrace that shows eclipse.
    Generate : Error during generation of the WSDL:
    BUILD FAILED
    java.lang.NoClassDefFoundError: com/sun/javadoc/Type
            at com.bea.util.jam.provider.JamServiceFactoryImpl.createSourceBuilder(JamServiceFactoryImpl.java:205)
            at com.bea.util.jam.provider.JamServiceFactoryImpl.createBuilder(JamServiceFactoryImpl.java:158)
            at com.bea.util.jam.provider.JamServiceFactoryImpl.createClassLoader(JamServiceFactoryImpl.java:137)
            at com.bea.util.jam.provider.JamServiceFactoryImpl.createService(JamServiceFactoryImpl.java:78)
            at weblogic.wsee.util.JamUtil.parseSource(JamUtil.java:152)
            at weblogic.wsee.tools.anttasks.JwsLoader.loadJClasses(JwsLoader.java:186)
            at weblogic.wsee.tools.anttasks.JwsLoader.load(JwsLoader.java:75)
            at weblogic.wsee.tools.anttasks.JwsModule.loadWebServices(JwsModule.java:569)
            at weblogic.wsee.tools.anttasks.JwsModule.generate(JwsModule.java:369)
            at weblogic.wsee.tools.anttasks.JwsModule.build(JwsModule.java:256)
            at weblogic.wsee.tools.anttasks.JwscTask.execute(JwscTask.java:184)
            at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
            at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:601)
            at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
            at org.apache.tools.ant.Task.perform(Task.java:348)
            at org.apache.tools.ant.Target.execute(Target.java:357)
            at org.apache.tools.ant.Target.performTasks(Target.java:385)
            at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
            at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
            at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
            at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
            at org.apache.tools.ant.Main.runBuild(Main.java:758)
            at org.apache.tools.ant.Main.startAnt(Main.java:217)
            at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
            at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
    Caused by: java.lang.ClassNotFoundException: com.sun.javadoc.Type
            at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1400)
            at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1341)
            at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1088)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
            ... 27 more
    Total time: 0 seconds
    Eclipse Installation details:
    *** System properties:
    eclipse.application=org.eclipse.ui.ide.workbench
    eclipse.buildId=M20110909-1335
    eclipse.commands=-os
    linux
    -ws
    gtk
    -arch
    x86_64
    -showsplash
    -launcher
    {home}/Development/oepe-indigo/eclipse
    -name
    Eclipse
    --launcher.library
    {home}/Development/oepe-indigo//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.v20110505/eclipse_1407.so
    -startup
    {home}/Development/oepe-indigo//plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
    --launcher.overrideVmargs
    -exitdata
    1e418010
    -vm
    /usr/bin/java
    eclipse.home.location=file:{home}/Development/oepe-indigo/
    eclipse.launcher={home}/Development/oepe-indigo/eclipse
    eclipse.launcher.name=Eclipse
    [email protected]/../p2/
    eclipse.p2.profile=PlatformProfile
    eclipse.product=org.eclipse.platform.ide
    eclipse.startTime=1374623921455
    eclipse.vm=/usr/bin/java
    eclipse.vmargs=-Xms256m
    -Xmx768m
    -XX:MaxPermSize=512m
    -Dsun.lang.ClassLoader.allowArraySyntax=true
    -Dweblogic.home={home}/Oracle/Middleware/wlserver_10.3
    -Dharvester.home={home}/Oracle/Middleware/Oracle_OSB1/harvester
    -Dosb.home={home}/Oracle/Middleware/Oracle_OSB1
    -Dosgi.bundlefile.limit=750
    -Dosgi.nl=en_US
    -Dmiddleware.home={home}/Oracle/Middleware
    -jar
    {home}/Development/oepe-indigo//plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
    equinox.use.ds=true
    file.encoding=UTF-8
    file.encoding.pkg=sun.io
    file.separator=/
    guice.disable.misplaced.annotation.check=true
    harvester.home={home}/Oracle/Middleware/Oracle_OSB1/harvester
    http.nonProxyHosts=localhost
    java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
    java.awt.printerjob=sun.print.PSPrinterJob
    java.class.path={home}/Development/oepe-indigo//plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
    java.class.version=50.0
    java.endorsed.dirs=/usr/lib/jvm/jdk1.6.0_45/jre/lib/endorsed
    java.ext.dirs=/usr/lib/jvm/jdk1.6.0_45/jre/lib/ext:/usr/java/packages/lib/ext
    java.home=/usr/lib/jvm/jdk1.6.0_45/jre
    java.io.tmpdir=/tmp
    java.library.path=/usr/lib/jvm/jdk1.6.0_45/jre/lib/amd64/server:/usr/lib/jvm/jdk1.6.0_45/jre/lib/amd64:/usr/lib/jvm/jdk1.6.0_45/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
    java.protocol.handler.pkgs=null|com.bea.wli.sb.resources.url|com.bea.wli.sb.resources.jca.upgrade.url|weblogic.utils|weblogic.utils|weblogic.utils|weblogic.net|weblogic.net
    java.runtime.name=Java(TM) SE Runtime Environment
    java.runtime.version=1.6.0_45-b06
    java.specification.name=Java Platform API Specification
    java.specification.vendor=Sun Microsystems Inc.
    java.specification.version=1.6
    java.vendor=Sun Microsystems Inc.
    java.vendor.url=http://java.sun.com/
    java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi
    java.version=1.6.0_45
    java.vm.info=mixed mode
    java.vm.name=Java HotSpot(TM) 64-Bit Server VM
    java.vm.specification.name=Java Virtual Machine Specification
    java.vm.specification.vendor=Sun Microsystems Inc.
    java.vm.specification.version=1.0
    java.vm.vendor=Sun Microsystems Inc.
    java.vm.version=20.45-b01
    javax.rmi.CORBA.PortableRemoteObjectClass=weblogic.iiop.PortableRemoteObjectDelegateImpl
    javax.rmi.CORBA.UtilClass=weblogic.iiop.UtilDelegateImpl
    jna.platform.library.path=/usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:/lib64:/usr/lib:/lib
    line.separator=
    middleware.home={home}/Oracle/Middleware
    oracle.eclipse.tools.weblogic.ui.isWebLogicServer=true
    org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog
    org.eclipse.equinox.launcher.splash.location={home}/Development/oepe-indigo/plugins/org.eclipse.platform_3.7.1.v201109091335/splash.bmp
    org.eclipse.equinox.simpleconfigurator.configUrl=file:org.eclipse.equinox.simpleconfigurator/bundles.info
    org.eclipse.m2e.log.dir={home}/workspace/pragma/.metadata/.plugins/org.eclipse.m2e.logback.configuration
    org.eclipse.update.reconcile=false
    org.omg.CORBA.ORBClass=weblogic.corba.orb.ORB
    org.omg.CORBA.ORBSingletonClass=weblogic.corba.orb.ORB
    org.osgi.framework.executionenvironment=OSGi/Minimum-1.0,OSGi/Minimum-1.1,OSGi/Minimum-1.2,JRE-1.1,J2SE-1.2,J2SE-1.3,J2SE-1.4,J2SE-1.5,JavaSE-1.6
    org.osgi.framework.language=en
    org.osgi.framework.os.name=Linux
    org.osgi.framework.os.version=3.8.0
    org.osgi.framework.processor=x86-64
    org.osgi.framework.system.capabilities=osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0, 1.1, 1.2",osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6"
    org.osgi.framework.system.packages=javax.accessibility,javax.activation,javax.activity,javax.annotation,javax.annotation.processing,javax.crypto,javax.crypto.interfaces,javax.crypto.spec,javax.imageio,javax.imageio.event,javax.imageio.metadata,javax.imageio.plugins.bmp,javax.imageio.plugins.jpeg,javax.imageio.spi,javax.imageio.stream,javax.jws,javax.jws.soap,javax.lang.model,javax.lang.model.element,javax.lang.model.type,javax.lang.model.util,javax.management,javax.management.loading,javax.management.modelmbean,javax.management.monitor,javax.management.openmbean,javax.management.relation,javax.management.remote,javax.management.remote.rmi,javax.management.timer,javax.naming,javax.naming.directory,javax.naming.event,javax.naming.ldap,javax.naming.spi,javax.net,javax.net.ssl,javax.print,javax.print.attribute,javax.print.attribute.standard,javax.print.event,javax.rmi,javax.rmi.CORBA,javax.rmi.ssl,javax.script,javax.security.auth,javax.security.auth.callback,javax.security.auth.kerberos,javax.security.auth.login,javax.security.auth.spi,javax.security.auth.x500,javax.security.cert,javax.security.sasl,javax.sound.midi,javax.sound.midi.spi,javax.sound.sampled,javax.sound.sampled.spi,javax.sql,javax.sql.rowset,javax.sql.rowset.serial,javax.sql.rowset.spi,javax.swing,javax.swing.border,javax.swing.colorchooser,javax.swing.event,javax.swing.filechooser,javax.swing.plaf,javax.swing.plaf.basic,javax.swing.plaf.metal,javax.swing.plaf.multi,javax.swing.plaf.synth,javax.swing.table,javax.swing.text,javax.swing.text.html,javax.swing.text.html.parser,javax.swing.text.rtf,javax.swing.tree,javax.swing.undo,javax.tools,javax.transaction,javax.transaction.xa,javax.xml,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.bind.attachment,javax.xml.bind.helpers,javax.xml.bind.util,javax.xml.crypto,javax.xml.crypto.dom,javax.xml.crypto.dsig,javax.xml.crypto.dsig.dom,javax.xml.crypto.dsig.keyinfo,javax.xml.crypto.dsig.spec,javax.xml.datatype,javax.xml.namespace,javax.xml.parsers,javax.xml.soap,javax.xml.stream,javax.xml.stream.events,javax.xml.stream.util,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stax,javax.xml.transform.stream,javax.xml.validation,javax.xml.ws,javax.xml.ws.handler,javax.xml.ws.handler.soap,javax.xml.ws.http,javax.xml.ws.soap,javax.xml.ws.spi,javax.xml.ws.wsaddressing,javax.xml.xpath,org.ietf.jgss,org.omg.CORBA,org.omg.CORBA_2_3,org.omg.CORBA_2_3.portable,org.omg.CORBA.DynAnyPackage,org.omg.CORBA.ORBPackage,org.omg.CORBA.portable,org.omg.CORBA.TypeCodePackage,org.omg.CosNaming,org.omg.CosNaming.NamingContextExtPackage,org.omg.CosNaming.NamingContextPackage,org.omg.Dynamic,org.omg.DynamicAny,org.omg.DynamicAny.DynAnyFactoryPackage,org.omg.DynamicAny.DynAnyPackage,org.omg.IOP,org.omg.IOP.CodecFactoryPackage,org.omg.IOP.CodecPackage,org.omg.Messaging,org.omg.PortableInterceptor,org.omg.PortableInterceptor.ORBInitInfoPackage,org.omg.PortableServer,org.omg.PortableServer.CurrentPackage,org.omg.PortableServer.POAManagerPackage,org.omg.PortableServer.POAPackage,org.omg.PortableServer.portable,org.omg.PortableServer.ServantLocatorPackage,org.omg.SendingContext,org.omg.stub.java.rmi,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.css,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.stylesheets,org.w3c.dom.traversal,org.w3c.dom.views,org.w3c.dom.xpath,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers
    org.osgi.framework.uuid=901615cd-f3f3-0012-11b6-a3bca4d97ac1
    org.osgi.framework.vendor=Eclipse
    org.osgi.framework.version=1.6.0
    org.osgi.supports.framework.extension=true
    org.osgi.supports.framework.fragment=true
    org.osgi.supports.framework.requirebundle=true
    os.arch=amd64
    os.name=Linux
    os.version=3.8.0-26-generic
    osb.home={home}/Oracle/Middleware/Oracle_OSB1
    osgi.arch=x86_64
    osgi.bundlefile.limit=750
    osgi.bundles=reference:file:javax.transaction_1.1.1.v201105210645.jar,reference:file:org.eclipse.equinox.simpleconfigurator_1.0.200.v20110502-1955.jar@1:start
    osgi.bundles.defaultStartLevel=4
    osgi.bundlestore={home}/Development/oepe-indigo/configuration/org.eclipse.osgi/bundles
    osgi.configuration.area=file:{home}/Development/oepe-indigo/configuration/
    osgi.framework=file:{home}/Development/oepe-indigo/plugins/org.eclipse.osgi_3.7.1.R37x_v20110808-1106.jar
    osgi.framework.extensions=reference:file:javax.transaction_1.1.1.v201105210645.jar
    osgi.framework.shape=jar
    osgi.framework.version=3.7.1.R37x_v20110808-1106
    osgi.frameworkClassPath=., file:{home}/Development/oepe-indigo/plugins/javax.transaction_1.1.1.v201105210645.jar
    osgi.install.area=file:{home}/Development/oepe-indigo/
    osgi.instance.area=file:{home}/workspace/pragma/
    osgi.instance.area.default=file:{home}/workspace/
    osgi.logfile={home}/workspace/pragma/.metadata/.log
    osgi.manifest.cache={home}/Development/oepe-indigo/configuration/org.eclipse.osgi/manifests
    osgi.nl=en_US
    osgi.nl.user=en_US
    osgi.os=linux
    osgi.splashLocation={home}/Development/oepe-indigo/plugins/org.eclipse.platform_3.7.1.v201109091335/splash.bmp
    osgi.splashPath=platform:/base/plugins/org.eclipse.platform
    osgi.syspath={home}/Development/oepe-indigo/plugins
    osgi.tracefile={home}/workspace/pragma/.metadata/trace.log
    osgi.ws=gtk
    path.separator=:
    securerandom.source=file:/dev/./urandom
    socksNonProxyHost=localhost
    sun.arch.data.model=64
    sun.boot.class.path=/usr/lib/jvm/jdk1.6.0_45/jre/lib/resources.jar:/usr/lib/jvm/jdk1.6.0_45/jre/lib/rt.jar:/usr/lib/jvm/jdk1.6.0_45/jre/lib/sunrsasign.jar:/usr/lib/jvm/jdk1.6.0_45/jre/lib/jsse.jar:/usr/lib/jvm/jdk1.6.0_45/jre/lib/jce.jar:/usr/lib/jvm/jdk1.6.0_45/jre/lib/charsets.jar:/usr/lib/jvm/jdk1.6.0_45/jre/lib/modules/jdk.boot.jar:/usr/lib/jvm/jdk1.6.0_45/jre/classes
    sun.boot.library.path=/usr/lib/jvm/jdk1.6.0_45/jre/lib/amd64
    sun.cpu.endian=little
    sun.cpu.isalist=
    sun.desktop=gnome
    sun.io.unicode.encoding=UnicodeLittle
    sun.java.command={home}/Development/oepe-indigo//plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar -os linux -ws gtk -arch x86_64 -showsplash -launcher {home}/Development/oepe-indigo/eclipse -name Eclipse --launcher.library {home}/Development/oepe-indigo//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.100.v20110505/eclipse_1407.so -startup {home}/Development/oepe-indigo//plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar --launcher.overrideVmargs -exitdata 1e418010 -vm /usr/bin/java -vmargs -Xms256m -Xmx768m -XX:MaxPermSize=512m -Dsun.lang.ClassLoader.allowArraySyntax=true -Dweblogic.home={home}/Oracle/Middleware/wlserver_10.3 -Dharvester.home={home}/Oracle/Middleware/Oracle_OSB1/harvester -Dosb.home={home}/Oracle/Middleware/Oracle_OSB1 -Dosgi.bundlefile.limit=750 -Dosgi.nl=en_US -Dmiddleware.home={home}/Oracle/Middleware -jar {home}/Development/oepe-indigo//plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
    sun.java.launcher=SUN_STANDARD
    sun.jnu.encoding=UTF-8
    sun.lang.ClassLoader.allowArraySyntax=true
    sun.management.compiler=HotSpot 64-Bit Tiered Compilers
    sun.os.patch.level=unknown
    svnkit.http.methods=Basic
    svnkit.library.gnome-keyring.enabled=false
    user.country=AR
    user.dir={home}/Development/oepe-indigo
    user.home={home}
    user.language=es
    user.name={username}
    user.timezone=America/Argentina/Buenos_Aires
    weblogic.home={home}/Oracle/Middleware/wlserver_10.3
    Thanks!!

    run this one in command prompt and then convert the applet using converter tool
    JC_HOME = C:\java_card_kit-2_2_2\bin\
    set CLASSES=%JCHOME%\lib\apduio.jar;%JC_HOME%\lib\apdutool.jar;%JC_HOME%\lib\jcwde.jar;%JC_HOME%\lib\converter.jar;%JC_HOME%\lib\scriptgen.jar;%JC_HOME%\lib\offcardverifier.jar;%JC_HOME%\lib\api.jar;%JC_HOME%\lib\installer.jar;%JC_HOME%\lib\capdump.jar;
    D:\NareshPalle\jcardRE\Smart\src>java -classpath %_CLASSES% com.sun.javacard.con
    verter.Converter -out EXP JCA CAP -exportpath .\exp -applet 0x0a:0x00:0x00:0x00:0x0e:0x01:0x02:
    0x03:0x04:0x05:0x06 PackageName appletName 0x01:0x02:0x03:0x04:0x05:0x0
    6:0x07:0x08 1.0
    or
    go to following directory and run the converter tool in command prompt
    step 1: cd C:\java_card_kit-2_2_2\bin\
    then run this command under the above directory
    step 2:converter -classdir E:\Pathof Your applet class file -out EXP JCA CAP -exportpath E:\path of exp files folder -applet AID PackageName AppletName PackAID major.minor no
    For more doubts mail me....
    *[removed by moderator]*
    Thanks and Regards
    NareshPalle
    Edited by: EJP on 31/03/2012 20:09: removed your email address. Unless you like spam and unless you think these forums are provided for your personal benefit only, posting an email address here serves no useful purpose whatsoever.

  • Java.lang.NoClassDefFoundError: com/sapportals/wcm/util/pcr/PortalComponent

    Hi All,
    I am getting the following Portal Runtime error while accessing the KM Content on Content Administration.
    In the error log following class is involved com.sapportals.wcm.portal.component.base.ControllerComponent
    The error caused by: Caused by: java.lang.NoClassDefFoundError: com/sapportals/wcm/util/pcr/PortalComponentRequestCache
    Can you pls help me on this ?
    Detailed error log
    << item 0 : >>#1.5#0013725D3B3B00690000011D0000EF74000435FB36917386#1185252975455#com.sap.portal.portal#sap.com/irj#com.sap.portal.portal#10268883#40896##MB1ES1005.idcsap_EC6_11485350#10268883#f6cefb3039a111dc95b40013725d3b3b#SAPEngine_Application_Thread[impl:3]_22##0#0#Error#1#/System/Server#Java###Exception ID:10:26_24/07/07_0201_11485350
    [EXCEPTION]
    #1#com.sapportals.portal.prt.component.PortalComponentException: Error in service call of Portal Component
    Component : pcd:portal_content/administrator/super_admin/super_admin_role/com.sap.portal.content_administration/com.sap.portal.content_admin_ws/com.sap.km.AdminContent/com.sap.km.AdminContentExplorer/com.sap.km.AdminExplorer
    Component class : com.sapportals.wcm.portal.component.base.ControllerComponent
    User : 10268883
    at com.sapportals.portal.prt.core.PortalRequestManager.handlePortalComponentException(PortalRequestManager.java:969)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:343)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
    at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
    at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:645)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
    at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
    at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
    at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:174)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.NoClassDefFoundError: com/sapportals/wcm/util/pcr/PortalComponentRequestCache
    at com.sapportals.wcm.portal.component.base.ControllerComponent.doContent(ControllerComponent.java:72)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    ... 29 more
    Thanks in advance and warm regards
    Purnendu

    Hi,
    Redeploy the <b>com.sap.netweaver.bc.util.par</b> file and check if <b>bc.util.private_api.jar</b> file is present on your server.
    c:usr\sap\J2E\JC00\j2ee\cluster\server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\portalapps\com.sap.netweaver.bc.util\lib\bc.util.private_api.jar
    Greetings,
    Praveen Gudapati

  • Java.lang.NoClassDefFoundError:Couldnot initialize class com.sap.mw.jco.JCO

    Hi,
    I am having an issue with SAP adapter configuration. It throws below error in log files :
    java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
    JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [no sapjcorfc in java.library.path]. java.library.path [opt/apps/Oracle/jdk160_14_R27.6.5-32/jre/lib/i386/client:/opt/apps/Oracle/jdk160_14_R27.6.5-32/jre/lib/i386:/opt/apps/Oracle/jdk160_14_R27.6.5-32/jre/../lib/i386:/opt/apps/Oracle/patch_wls1032/profiles/default/native:/opt/apps/Oracle/patch_jdev1111/profiles/default/native:/opt/apps/Oracle/jdk160_14_R27.6.5-32/jre/lib/i386/client:/opt/apps/Oracle/jdk160_14_R27.6.5-32/jre/lib/i386:/opt/apps/Oracle/jdk160_14_R27.6.5-32/jre/../lib/i386:/opt/apps/Oracle/patch_wls1032/profiles/default/native:/opt/apps/Oracle/patch_jdev1111/profiles/default/native:/opt/apps/Oracle/wlserver_10.3/server/native/linux/i686:/opt/apps/Oracle/wlserver_10.3/server/native/linux/i686/oci920_8:/opt/apps/Oracle/wlserver_10.3/server/native/linux/i686:/opt/apps/Oracle/wlserver_10.3/server/native/linux/i686/oci920_8:/opt/apps/Oracle/Oracle_SOA1/soa/thirdparty/edifecs/XEngine/bin:/opt/apps/Oracle/Oracle_SOA1/soa/thirdparty/edifecs/XEngine/bin]
    java.lang.NoClassDefFoundError: Could not initialize class com.sap.mw.jco.JCO
    Invoking SAP targets from bpel or iwafjca test servlet fails with "java.lang.NoClassDefFoundError: Could not initialize class com.sap.mw.jco.JCO."
    I am able to connect from Application Explorer(AE) and browse through idocs and bapis. I tried to check the class loading pattern for AE using Jconsole :
    1. Started the AE
    2. /opt/apps/Oracle/jdk1.6.0_19/bin/jps
    15279 BseFlashScreen
    3. /opt/apps/Oracle/jdk1.6.0_19/bin/jconsole 15279
    Enabled verbose output on class loading page and connected to SAP target from AE
    4. The verbose output shows below :
    Loaded com.sap.mw.jco.JCO from file:/opt/apps/Oracle/Oracle_SOA1/soa/thirdparty/ApplicationAdapters/lib/sapjco.jar
    I have added the above path to my LD_LIBRARY_PATH
    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${WL_HOME}/server/native/linux/${arch}:${MW_HOME}/Oracle_SOA1/soa/thirdparty/ApplicationAdapters/lib:${MW_HOME}/user_projects/domains/base_domain/lib:${WL_HOME}/server/native/linux/${arch}/oci920_8
    I also added the path to WEBLOGIC_CLASSPATH in commEnv.sh file.
    The sapjco.jar, libsapjcorfc.so and librfccm.so files are also available under below directories
    WL_HOME/server/lib
    MW_HOME/Oracle_SOA1/soa/thirdparty/ApplicationAdapters/lib
    MW_HOME/user_projects/domains/base_domain/lib
    Any suggestions will be really helpful.
    Regards
    Subhankar

    Hi Manoj,
    I have added the libsapjcorfc.so and librfccm.so files to below locations:
    WL_HOME/server/lib
    MW_HOME/Oracle_SOA1/soa/thirdparty/ApplicationAdapters/lib
    MW_HOME/user_projects/domains/base_domain/lib
    And also set the LD_LIBRARY_PATH and WEBLOGIC_CLASSPATH in commEnv.sh file.
    Eg:
    LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${WL_HOME}/server/native/linux/${arch}:${MW_HOME}/Oracle_SOA1/soa/thirdparty/ApplicationAdapters/lib:${MW_HOME}/user_projects/domains/base_domain/lib:${WL_HOME}/server/native/linux/${arch}/oci920_8
    Is there any other location where these need to be added ? I hope library path/system path refers to the WEBLOGIC_CLASSPATH ?
    Regards
    Subhankar

  • Exception:[java.lang.NoClassDefFoundError: com/sap/sldserv/SldApplicationSe

    I'm using a User defined function "getFGN" to call a Java Class developed in NWDS. the source in NWDS has no errors when it is build. But when i Run the code i get error below.
    Buy using the Debugging facility in NWDS i can see that the problem is this code linie:
    <i>SldApplicationServiceInterface srvContext = (SldApplicationServiceInterface) jndiContext.lookup(SldApplicationServiceInterface.KEY);</i>
    <u><b>NWDS Log</b></u>
    07:50:12 Start of test
    Exception:[java.lang.NoClassDefFoundError: com/sap/sldserv/SldApplicationServiceInterface] in class com.sap.xi.tf._SAP_APPL_Invoice_to_CustomerInvoice_ method getFGN$[“invoicenumber”, CUSTOMER, com.sap.aii.mappingtool.tf3.rt.Context@daa46b]
    com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[java.lang.NoClassDefFoundError: com/sap/sldserv/SldApplicationServiceInterface] in class com.sap.xi.tf._SAP_APPL_Invoice_to_CustomerInvoice_ method getFGN$[“invoicenumber”, CUSTOMER, com.sap.aii.mappingtool.tf3.rt.Context@daa46b]
    at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:56)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:186)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:298)
    at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:63)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:77)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:259)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:304)
    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:193)
    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:122)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Root Cause:
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:47)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:186)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:298)
    at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:63)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:77)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:259)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:304)
    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:193)
    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:122)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.NoClassDefFoundError: com/sap/sldserv/SldApplicationServiceInterface
    at com.danfoss.xi.mapping.util.GenerateFileNumber.getFileGeneratedNumber(GenerateFileNumber.java:53)
    at com.sap.xi.tf._SAP_APPL_Invoice_to_CustomerInvoice_.getFGN$(_SAP_APPL_Invoice_to_CustomerInvoice_.java:2556)
    ... 29 more
    RuntimeException in Message-Mapping transformation: Exception:[java.lang.NoClassDefFoundError: com/sap/sldserv/SldApplicationServiceInterface] in class com.sap.xi.tf._SAP_APPL_Invoice_to_CustomerInvoice_ method getFGN$[“invoicenumber”, CUSTOMER, com.sap.aii.mappingtool.tf3.rt.Context@daa46b]

    Hi,
    Looks like your CLASSPATH is not set properly...Just try to Put the Jar inside "<DOMAIN_HOME>\lib" directory...in that case u need not to alter anything in the Classpath variable...it will be appended at the end of Classpath at the run time, Using Extended Directory ClassLoader.
    by default Classpath settings doesnt take effect if we specify it in the startScript of Servers but we start them using NodeManagers...So if you are using Nodemanagers to start your Servers... then you can follow the below link to set the Classpath & Memory Arguments http://weblogic-wonders.com/weblogic/2010/03/26/nodemanager-based-managedservers-setting-mem_args/
    Thanks
    Jay SenSharma
    http://weblogic-wonders.com/weblogic (WebLogic Wonders Are Here)

  • Java.lang.NoClassDefFoundError: com/sap/util/monitor/jarm/TaskMonitor

    hi all,
    i was trying to build and try a web service in my project.
    but at runtime it keeps throwing the following error(  log trace)
    i am unable to figure out the source of error.
    is it in the jco or anything else
    thanks in advance
    1.5#001143C809E500470000002E00000B8C00040CBB0F05957C#1139897457152#com.sap.engine.services.httpserver##com.sap.engine.services.httpserver#Guest#2####a9a4e0009d2011dacd42001143c809e5#SAPEngine_Application_Thread[impl:3]_16##0#0#Error#1#/System/Server#Plain###User Guest, IP address
    HTTP request processing failed. HTTP error [401] will be returned. The error is [Cannot authenticate the user.No details available].#
    #1.5#001143C809E500530000001F00000B8C00040CBB0FEBCF9E#1139897472233#com.sap.engine.services.ejb#sap.com/xappsospservicebundle~enterpriseapp#com.sap.engine.services.ejb#I020381E1#1839####b13de9b09d2011da944e001143c809e5#SAPEngine_Application_Thread[impl:3]_24##0#0#Error##Java###
    [EXCEPTION]
    #1#com.sap.engine.services.ejb.exceptions.BaseEJBException: Exception in method getRelatedReports.
         at com.sap.xapps.osp.orgmgmt.servicebundle.sbejb.OrgMgmtSBLocalLocalObjectImpl10.getRelatedReports(OrgMgmtSBLocalLocalObjectImpl10.java:121)
         at com.sap.xapps.osp.orgmgmt.servicebundle.facade.OrgMgtFacadeBean.getRelatedReports(OrgMgtFacadeBean.java:425)
         at com.sap.xapps.osp.orgmgmt.servicebundle.facade.OrgMgtFacadeLocalLocalObjectImpl10.getRelatedReports(OrgMgtFacadeLocalLocalObjectImpl10.java:103)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
         at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
         at SoapServlet.doPost(SoapServlet.java:51)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.NoClassDefFoundError: com/sap/util/monitor/jarm/TaskMonitor
         at com.sap.mw.jco.util.Jarm.getRequestMonitor(Jarm.java:57)
         at com.sap.mw.jco.JCO$Repository.getFunctionInterface(JCO.java:19069)
         at com.sap.mw.jco.JCO$BasicRepository.getFunctionTemplate(JCO.java:18151)
         at com.sap.xapps.osp.orgmgmt.servicebundle.common.OrgMgmtSBHelper.createFunction(OrgMgmtSBHelper.java:491)
         at com.sap.xapps.osp.orgmgmt.servicebundle.impl.OrgMgmtBusinessDelegate.getRelatedReports(OrgMgmtBusinessDelegate.java:1273)
         at com.sap.xapps.osp.orgmgmt.servicebundle.sbejb.OrgMgmtSBBean.getRelatedReports(OrgMgmtSBBean.java:170)
         at com.sap.xapps.osp.orgmgmt.servicebundle.sbejb.OrgMgmtSBLocalLocalObjectImpl10.getRelatedReports(OrgMgmtSBLocalLocalObjectImpl10.java:103)
         ... 27 more

    hi,
    thanks for the replies.
    well i guess that(user authentication) is not the problem.
    Coz that happens even before i start the web service.
    i guess the problem is that the appl. is not finding the TaskMonitor class ( see the last 10 lines of the log).
    does anyone have a solution for that.
    thanks

Maybe you are looking for

  • PREQ, PO line item

    Hi, 1.how many line items a PREQ, PO can accomodate? 2. there is an user exit by which we can increase the line items in PREQ, PO? which is that one? 3. by using user exit then how many maximum lines can be achieved? kavita

  • Solaris 8 VM on T41 Sparc server?

    is it possible to virtualize a solaris 8 OS as a VM on OVM server for sparc, 3.x running ona T4-1 server? I'm sure it's not possible, but have to ask. secondly, legacy zones only work with solaris 10, isit possible to make a solaris 10 VM and then ru

  • Select all functionality in a check box

    Hi all I am using forms 6i I have a tabular block with a check box i want to have the functionality wherein the user can select all the records of the form by a single click or any other way basically if the user wants to select all the records he do

  • Issue in education tab in EHP6 in talent management

    Hi All, In EHP6 demo , ESS -> Career and development -> Talent Profile -> Education TAB , is giving dump as attached . Please revert me back with possible solution Thanks & regards Tarun

  • What does this mean when I try to open a new window "Exc in ev handl: TypeError: brw is undefined

    The above message pops up when I click on new window, once I click OK the message goes and a blank new window does appear. It has also just happened when I was in BBC language site and tried to open a link, the message appeared but once I clicked OK