Executing HelloWorld program in EJB java.lang.NoClassDefFoundError-help plz

Hi
I am a tyro to Weblogic 8.1 server with EJB. I am Running a simple HeloWorld program ,but it throws No class def found err. Below i listed my program.help needed.
Home interface
package examples;
import java.rmi.*;
import javax.ejb.*;
public interface HelloWorldHome extends EJBHome {
public HelloWorld create() throws CreateException,RemoteException;
Remote interface:
package examples;
import java.rmi.*;
import javax.ejb.*;
public interface HelloWorld extends EJBObject
public String getHelloWorldMsg () throws RemoteException;
HelloWorldLocal-- Remote
package examples;
import javax.ejb.*;
public interface HelloWorldLocal extends EJBLocalObject
public String getHelloWorldMsg();
HelloWorldLocalHome:
package examples;
import javax.ejb.*;
public interface HelloWorldLocalHome extends EJBLocalHome
HelloWorldLocal create() throws CreateException;
HelloWorldBean:
package examples;
import javax.ejb.*;
import javax.SessionContext;
public class HelloWorldBean implements SessionBean
public HelloWorldBean() {}
private void log(String s) {
if (true) System.out.println(s);
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {
log("ejbRemove() called");
public void setSessionContext(SessionContext ctx) {
log("setSessionContext called");
this.ctx = ctx;
public void ejbCreate() throws CreateException {
log("ejbCreate() called");
public String getHelloWorldMsg () {
log("Bean Method called");
return ("Stateless SessionBean says Hello World");
Client program
package examples;
import java.rmi.*;
import javax.rmi.PortableRemoteObject;
import javax.naming.*;
import java.util.*;
import examples.HelloWorldHome;
import examples.HelloWorld;
* This class is an example of client code that calls
* methods on a simple stateless session bean.
public class HelloWorldClient {
private static Context createJNDIContext()
throws NamingException, RemoteException {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL,"t3://localhost:7001");
Context context = new InitialContext( env );
return context;
* Main method to unit test the HelloWorld API
public static void main(String[] args) {
try
// use JNDI to look up the home interface for HelloWorld
Context context = createJNDIContext();
// You could use the following statement to retrieve
// the HelloWorld home
/* HelloWorldHome home =
(HelloWorldHome)
context.lookup("examples.HelloWorldHome"); */
// However, using javax.rmi.PortableRemoteObject
// allows you to narrow the scope
// to the home interface
HelloWorldHome home = (HelloWorldHome )
PortableRemoteObject.narrow(
context.lookup("examples.HelloWorldHome"),
examples.HelloWorldHome.class ) ;
HelloWorld hello = home.create();
* The EJBObject will delegate the call to the HelloWorld
* session bean, receive the result, and return it to this client.
System.out.println(hello.hello());
* Remove the EJBObject.
* The container will mark the EJBObject for destruction.
hello.remove();
catch( Exception err )
System.err.println( err.toString() );
and also i put Class path in sys variables.I don't know reason y not running .help needed.
bye

Client program , No class def found exception.Create an ejb-client.jar containing only the home and remote interfaces for the EJB and add them to the classpath while executing the client code. You could also copy the EJB JAR for that.

Similar Messages

  • Simple program wont run  java.lang.NoClassDefFoundError

    Exception in thread "main" java.lang.NoClassDefFoundError: Server (wrong name: Simple_Server/Server)
    i am new to java and i made this simple script to accept connections then pass them on to HandleClient.
    but when i run it i get this output
    Exception in thread "main" java.lang.NoClassDefFoundError: Server (wrong name: Simple_Server/Server)
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(Unknown Source)
            at java.security.SecureClassLoader.defineClass(Unknown Source)
            at java.net.URLClassLoader.defineClass(Unknown Source)
            at java.net.URLClassLoader.access$000(Unknown Source)
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClassInternal(Unknown Source)here is the source code
    package SMTP_Server;
    import java.io.*;
    import java.net.*;
    public class Server {
        ServerSocket serverSocket = null;
        boolean listening = true;
        public Server(){
         System.out.println("New Server Created");
        public void main(String[] args) {
            try {
                this.serverSocket = new ServerSocket(4444);
            } catch (IOException e) {
                System.err.println("Could not listen on port: 4444.");
                System.exit(1);
         while(listening){
             try{
              new HandleClient(this.serverSocket.accept()).start();
             } catch (IOException e) {
              System.err.println("Caught IOException: " + e.getMessage());
    }I thought it might be that main() is not static but it wont work if make it static because it cannot access the listening or serverSocket fields
    Thanks for all the help
    Scott.

    The directory hierarchy of your .class files must mirror the package hierarchy of your classes.
    So if you've got a class "Foo" in a package "p1" (i.e. a class with the fully qualified name of "p1.Foo") and a clas "Bar" in a package "p2" (i.e. a class with the fully qualified name of "p2.Bar"), then you need a file hierarchy such as this:
    p1/Foo.class
    p2/Bar.classAnd the directory in your classpath needs to be the directory that contains p1 and p2.
    So what you need to do is go to a directory that contains a directory called "Simple_Server" (your source file mentions SMTP_Server, but I assume you changed it at some point).
    That directory Simple_Server must contain a file called Server.class.
    Then execute "java Simple_Server.Server".
    Also please follow common naming conventions, as your code will become harder to understand if you don't. An important rule in those conventions is that package names should be in all-lowercase and not contain any non-letter characters if possible (i.e. use "smtpserver" instead of "SMTP_Server").

  • BPM and Plumtree.Edk.IRemoteSession : java.lang.NoClassDefFoundError

    I am developping in BPM Studio 10.3.1 for a BPM process. I am trying this :
    Plumtree.Edk.IRemoteSession iRemoteSession=RemoteSessionFactory.getExplicitLoginContext(new URL("http://portalhost:11905/ptapi/services/QueryInterfaceAPI"), "administrator", "portal");
    IObjectManager objectManager = iRemoteSession.getObjectManager(ObjectClass.User);
    IObjectQueryRow userObject = objectManager.querySingleObject(220); //objectid of a known user
    String participantMail = userObject.getExtendedData().getStringValue("Mail");
    String participantUserName = userObject.getExtendedData().getStringValue(String.valueOf(UserProperty.LoginName));
    Now, when I execute this code through the BPM application portlet in WCI 10.3.1, I get this error :
    The task could not be successfully executed.
    [     (cont)     ] Main: Reason: 'java.lang.NoClassDefFoundError: com/plumtree/remote/util/xp/OpenLogHelper'
    Caused by: java.lang.NoClassDefFoundError: com/plumtree/remote/util/xp/OpenLogHelper
    [     (cont)     ] Main:      at com.plumtree.remote.prc.xp.XPRemoteSession.<init>(XPRemoteSession.java:32)
    [     (cont)     ] Main:      at com.plumtree.remote.prc.xp.XPRemoteSessionFactory.GetExplicitLoginContext(XPRemoteSessionFactory.java:25)
    [     (cont)     ] Main:      at com.plumtree.remote.prc.RemoteSessionFactory.getExplicitLoginContext(RemoteSessionFactory.java:48)
    I have no compilation error when I publish and deploy the project with BPM Process Administrator
    Would you have any idea to correct this ?
    Thank you for your help
    Edited by: vVince on May 15, 2009 5:03 PM
    Edited by: vVince on May 19, 2009 6:22 PM

    the fix for this bug #8531794 has been released in hotfix#98606 for Oracle BPM 10.3.1

  • Java.lang.NoClassDefFoundError: HelloWorld when running SQLJ program

    i can compile the program but i can't run it. when i try to run ( java HelloWorld) it gives java.lang.NoClassDefFoundError: HelloWorld error message. i have set the classpath, path and oracle_home accordingly to the oracle SQLJ documentation. i'm using win2000 and j2sdk 1.4.0. please help.
    this is my sqlj's code:
    import java.sql.Date;
    import java.sql.SQLException;
    import oracle.sqlj.runtime.Oracle;
    public class HelloWorld
         public static void main(String [] args)
              java.sql.Date current_date;
              try
                   Oracle.connect(
                        "jdbc:oracle:thin:nicole:1521:kwanyee",
                        "y2net",
                        "y90583008"
                   #sql { SELECT sysdate INTO :current_date FROM dual };
                   System.out.println( "Hello" + current_date);
              catch (SQLException e)
                   System.err.println("SQLException " + e);
              finally
                   try
                        Oracle.close();
                   catch (SQLException e)
                        System.err.println("SQLException " + e);
    }

    I am not too sure about sqlj ...if this suggestion doesn't work I can show you the statndard 'java' way to connect to Oracle. But try this, you probably need to add the oracle drivers to your classpath. Look for a file named classes12.zip ...and add that to the classpath settings like this (on my box):
    @SET CLASSPATH=%CLASSPATH%;G:\ORACLE\ORA81\JDBC\LIB\classes12.zip

  • Java.lang.NoClassDefFoundError when executing JAVA code

    Hy everyone,
    Trying to execute some java code through forms I got this error when running my program : java.lang.NoClassDefFoundError : simple (where simple is a java class I developped).
    These are the steps I followed:
    1- Devopping a simple JAVA class (simple.java) and compiling in JDK 1.4 (for compatibilty with forms 10.1.2.0.2)
    2- Creating the JAR file
    3- Copying the JAR file in <ORACLE_HOME>\forms\java
    4- Adding the adress of the JAR file in CLASSPATH (environment variable of the server)
    5- Adding the adress of the JAR file in CLASSPATH (environmental file of OAS default.env)
    6- Importing the JAVA class trought forms builder (program>>import java class)
    7- Invoking the JAVA class via the PL/SQL packages created by forms builder
    8- Running the program
    Thanks for your help.
    Regards.

    In most cases, you should not have to stop and restart OC4J_BI_FORMS to pick such changes. However, since you are having problems, I would ensure that all frmweb processes have been stopped, then stop and restart OC4J_BI_FORMS and retest. If that doesn't work, you should review how you imported the java into your app. Look closely at the Importer options you used and ensure that you have not change the file name at any point. Because you are working with Java, case sensitivity is critical.
    Also, where are you seeing the error message? Client java console or in a server side log? If server side, exactly which log file is reporting the problem? I would suggest you post the first 4 ro 5 lines of the error and not just the NoClassDefFound part.

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

    Hi Java Experts,
    I am at a lost to how Java searches for all the classes when running a program. Below are the following steps I have taken to try a simple basic HelloWorld.java program on the command prompt on Windows XP (SP2) platform:
    ( i ) Installed both jdk1.5.0_09 and Netbeans IDE 5.0 and working properly.
    ( ii ) The source file is located in F:\Documents and Settings\abc\HeadFirstDesignPattern\src\ch11 and the compiled file is in F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes\ch11 which was compiled in Netbeans.
    ( iii ) No problem compiling & running this program in Netbeans.
    ( iv ) The RUN CLASSPATH in Netbeans is F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes.
    ( v ) No CLASSPATH variable has been set.
    ( vi ) The HelloWorld program looks like this:
    package ch11;
    public class HelloWorld {
    public static void main(String[] args) {
    System.out.println("Hello World!");
    ( vi ) Got the message
    "Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld"
    when running a combination of the following Java commands:
    ( a ) cd F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes
    ( b ) java HelloWorld, or
    java -cp . HelloWorld or java -cp "." HelloWorld, or
    java -cp F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes HelloWorld or "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes" HelloWorld, or
    java -cp F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes;. HelloWorld or "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";. HelloWorld, or
    java -cp "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";. HelloWorld or "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";"." HelloWorld, or
    java -cp "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";. HelloWorld or "F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes";"." ch11\HelloWorld.
    It is the package location which is a subdirectory of F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes which caused Java not to find this program. I had no problem running it if the HelloWorld.java was moved one level up. ie from F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes\ch11 to F:\Documents and Settings\abc\HeadFirstDesignPattern\build\classes.
    I have written Java in the last year mostly on Netbeans without any problem running them.
    The reason for having to learn to run Java on the command line is so that I could add arguments to the program which I couldn't do in Netbeans just yet.
    I have gone through a lot of the articles from Java forums, Google searches but yet to have found a solution.
    Many thanks,
    Netbeans Fan

    I am getting the same problem when running the same program on a Fedora 4.0 (Redhat Linux 10) system, together with Netbeans 5.5 and JDK1.5.0_09. Again, I have no such problem when running the same program in Netbeans.
    Here are the steps that I have taken as follows:
    $ hostname
    spisu07.stvincents.com.au
    $ uname -a
    Linux spisu07.stvincents.com.au 2.6.11-1.1369_FC4 #1 Thu Jun 2 22:55:56 EDT 2005 i686
    $ pwd
    /home/dbi/HeadFirstDesignPattern/build/classes/ch11a
    $ cd ..
    $ pwd
    /home/dbi/HeadFirstDesignPattern/build/classes
    $ ls
    ch11a
    $ ls ch11a
    GumballMachine.class GumballMonitor.class NoQuarterState.class State.class
    GumballMachineRemote.class GumballMonitorTestDrive.class SoldOutState.class WinnerState.class
    GumballMachineTestDrive.class HasQuarterState.class SoldState.class
    $ java -cp . ch11a.GumballMachineTestDrive
    Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: ch11a.GumballMachineTestDrive
    at java.lang.VMClassLoader.transformException(java.lang.Class, java.lang.Throwable) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
    at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)
    at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
    Caused by: java.lang.ClassNotFoundException: java.lang.StringBuilder not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./,file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
    at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.ClassLoader.loadClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
    at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)file:///usr/share/doc/HTML/index.html
    ...4 more
    $ echo $PATH
    /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/opt/netbeans-5.5/bin:/etc/alternatives/.:/opt/netbeans-5.5/bin:/opt/jdk1.5.0_09:/etc/alternatives/.
    $ echo $JAVA_HOME
    $ echo $CLASSPATH
    Any suggestions?
    Thanks,
    Henry

  • Can't Run Java Programs -- java.lang.NoClassDefFoundError Error

    I am running 10.4.11. For some reason I can no longer run Java programs. (I could in the past)
    For example. I create a simple Hello World program as follows and save it as Hello.java:
    class HelloWorld
    public static void main (String args[])
    System.out.println("Hello, world!");
    Then I compile it:
    Javac Hello.java
    Then I try to run it:
    java Hello
    But I get this error:
    Exception in thread "main" java.lang.NoClassDefFoundError: Hello
    I think it must be a CLASSPATH problem but normally you do not need to worry about ClassPATH. Apple sets it up for you out of the box.
    What is wrong?

    I totally forgot that the class name should be the same as the filename.
    After I renamed the file to HelloWorld.java and recompiled, I could run "java HelloWorld"
    Rob

  • Java/lang/NoClassDefFoundError when trying to run my program in Eclipse

    I have a problem when using Eclipse. I can compile my classes in Eclipse without problems, but when I try to run the main class I get the following error message:
    Error occurred during initialization of VM
    java/lang/NoClassDefFoundError: java/lang/Object
    I have the same classpath setup when compiling and running the program. I am using JDK 1.3.1 and also have no problem running the program using javaw from a command prompt.
    Please answer if you have encountered this problem or have any idea what the problem might be.

    I start Eclipse using the exe file eclipse.exe with no special arguments.
    I use a JRE installed in e:\jdk1.3.1_01 so on the JRE page in the launch dialog box I have added a JRE with e:\jdk1.3.1_01\jre as the JRE home directory. This means that the JRE system library contain e:\jdk1.3.1_01\jre\lib\rt.jar. On the classpath page this JAR file is also listed as well as some other JAR files I use in my project.

  • Why i get error msg when i run my program? (java.lang.NoClassDefFoundError)

    i have compile and run my program. First time the program can run. But after that when i run, come out error messege as below:
    java.lang.NoClassDefFoundError: FormPoster (wrong name: search/FormPoster)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    Exception in thread "main"
    what can i do? thank very much

    Hello,
    i have compile and run my program. First time theprogram can run.
    But after that when i run, come out error messegeas below:
    java.lang.NoClassDefFoundError: FormPoster (wrongname: search/FormPoster)
    Check your FormPoster class: the classname has to be
    the same as
    the file name and the class should be stored in its
    correct directory
    (the sub directory structure should reflect the
    package name).
    kind regards,
    JosYou should also check your clsspath if you are using packages.

  • Java.lang.NoClassDefFoundError in Linux when I execute my class

    I don't know to happen but I tried all things.
    I compile well my .java but I have problems when I want to execute my class
    the console send me the next error
    Exception in thread "main" java.lang.NoClassDefFoundError : renco
    1. unset CLASSPATH.
    2. define my CLASSPATH again with jars that I need you
    java renco
    the console send me this error
    java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    well, this error I managed with try-catch-finally
    3. compile with:
    java -classpath /directory/myjar.jar renco.java
    the console send mi this:
    Exception in thread "main" java.lang.NoClassDefFoundError : renco
    Other hand, when i use forte for java by execute my class, it execute well. I want to know what commands the IDE used.
    thanks

    this mi code
    * renco.java
    * Created on 22 de agosto de 2003, 8:59
    * @author mloayza
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    public class renco {
    /** Creates a new instance of reniec */
    public String sqlNoticia;
    public String sqlCodigoNoticia;
    public String sqlComunicado;
    public String pathInc;
    private Connection cn;
    public static void main(String args[]) throws Exception {
    renco RN = new renco();
    int estado = RN.proceso();
    System.out.println(estado);
    public renco() throws IOException{
    sqlComunicado= " SELECT TO_CHAR(fecha,'dd/mm/yyyy') fecha, "+
    " resumen resumen, "+
    " id_comunicado codigo "+
    " FROM intranet.int_comunicado "+
    " WHERE"+
    " id_comunicado = (SELECT max(id_comunicado) FROM intranet.int_comunicado) ";
    sqlCodigoNoticia = "SELECT MAX(codigo_nota) codigo "+
    " FROM intranet.nota_prensa ";
    sqlNoticia = " SELECT codigo_nota codigo, "+
    " titulo_nota titulo, TO_CHAR(fecha_nota,'dd/mm/yyyy') fecha "+
    " FROM intranet.nota_prensa "+
    " WHERE "+
    " codigo_nota > ( ? - 4) "+
    " ORDER BY codigo_nota DESC";
    //pathInc = this.LeeParametro("PathInc");
    cn = this.getCn();
    this.pathInc = "/das/por/";
    public Connection getCn() {
    String URL = "jdbc:oracle:thin:@200.20.12.12:1529:asdb";
    String USER = "qweqwe";
    String PASS = "qweqwe";
    try{
    Class.forName("oracle.jdbc.driver.OracleDriver");
    cn = DriverManager.getConnection(URL,USER,PASS);
    catch(Exception sqle){
    cn = null;
    return cn;
    public void closeCn(Connection cn) throws SQLException {
    this.cn.close();
    cn= null;
    public int proceso(){
    ResultSet rs = null;
    StringBuffer textoComunicado = new StringBuffer();
    StringBuffer textoNoticia = new StringBuffer();
    int codigo = 0;
    int estado = 0;
    String URL = "jdbc:oracle:thin:@200.20.12.12:1529:asdb";
    String USER = "qweqwe";
    String PASS = "qweqwe";
    textoNoticia.append("<Script Language='JavaScript1.2'>");textoNoticia.append((char)13);
    textoNoticia.append("aj_scroller = new AJScroller();");textoNoticia.append((char)13);
    textoNoticia.append("aj_scroller.width = 439;");textoNoticia.append((char)13);
    textoNoticia.append("aj_scroller.height = 55;");textoNoticia.append((char)13);
    textoNoticia.append("aj_scroller.scrollspeed = 50;");textoNoticia.append((char)13);
    textoNoticia.append("aj_scroller.pausedelay = 2000;");textoNoticia.append((char)13);
    textoNoticia.append("aj_scroller.pausemouseover = true;");textoNoticia.append((char)13);
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    cn = DriverManager.getConnection(URL,USER,PASS);
    cn = getCn();
    FileOutputStream fosCom = new FileOutputStream(pathInc+"comunicado.inc"); //archivo Comunicado
    DataOutputStream dosCom = new DataOutputStream(fosCom);
    FileOutputStream fosNot = new FileOutputStream(pathInc+"noticia.inc"); //archivo Comunicado
    DataOutputStream dosNot = new DataOutputStream(fosNot);
    //Generacion de cadena para comunicados
    PreparedStatement psc = cn.prepareStatement(sqlComunicado);
    rs = psc.executeQuery();
    rs.next();
    textoComunicado.append("<font size='1' color='#505050'><b>)");textoComunicado.append((char)13);
    textoComunicado.append("("+ rs.getString("fecha") +") .- "+ rs.getString("resumen")+" ");textoComunicado.append((char)13);
    textoComunicado.append("</b></font><font size='1' color='orange'><b><br>");textoComunicado.append((char)13);
    textoComunicado.append("     <a href='/portal/s/portal.PIComunicado?codigo="+ rs.getString("codigo")+"'>M&aacute;s Detalles >></a>");textoComunicado.append((char)13);
    textoComunicado.append("</b></font>");textoComunicado.append((char)13);
    psc.close();psc=null;
    rs = null;
    //Generacion de cadena para comunicados
    //Obtencion del codigo de la ultima noticia
    PreparedStatement pscn = cn.prepareStatement(sqlCodigoNoticia);
    rs = pscn.executeQuery();
    rs.next();
    codigo = rs.getInt("codigo");
    rs = null;
    PreparedStatement psn = cn.prepareStatement(sqlNoticia);
    psn.setInt(1,codigo);
    rs = psn.executeQuery();
    while(rs.next()){
    textoNoticia.append("aj_scroller.add('<table ><tr><td class=rojo><font face=\"Webdings, Wingdings\">4</font></td><td class=rojo><font size=1 color=\"#143E7B\"><p align=\"justify\"><b>"+ rs.getString("Titulo") +" ("+ rs.getString("fecha") +")</b></font></td></table>');");textoNoticia.append((char)13);
    rs.close();rs=null;
    textoNoticia.append("aj_scroller.display();");textoNoticia.append((char)13);
    textoNoticia.append("</Script>");textoNoticia.append((char)13);
    dosCom.writeBytes(textoComunicado.toString());
    fosCom.close();fosCom = null;
    dosCom.close();dosCom=null;
    dosNot.writeBytes(textoNoticia.toString());
    fosNot.close();fosNot= null;
    dosNot.close();dosNot=null;
    closeCn(cn);
    estado=1;
    }catch(IOException ioe){
    estado = 0;
    catch(SQLException sqle){
    estado = 0;
    catch(ClassNotFoundException nfce){
    estado = 0;
    System.out.println(nfce);
    //nfce.printStackTrace();
    return estado;
    public String LeeParametro(String parametro) throws IOException, FileNotFoundException
         String path = System.getProperty("java.home");
              parametro = parametro.trim().toUpperCase();
              String valor = "";
         String s;
         try{
              BufferedReader br = new BufferedReader(new FileReader(path.trim().replace('\\','/')+"/Homepage.conf"));
                   while ((s = br.readLine())!= null) {
                        StringTokenizer st = new StringTokenizer(s, "=");
                        while (st.hasMoreTokens()){
                             String word = st.nextToken();
                             if (word.startsWith(parametro)) {
                             valor = st.nextToken().trim();
              catch (FileNotFoundException e) {
                   throw new FileNotFoundException ("Archivo no encontrado " path"/Homepage.conf");     }
              catch (IOException e) {
                   throw new IOException ("Error al leer "+path+"/Homepage.conf");     }
              return valor;

  • Java.lang.NoClassDefFoundError in EJB DC

    Hi all ,
                    I am working on Netweaver 7.1 sp5 with EJB 3.0 . I have some common java classes which are reused in othr DCs. i have java DC project for java classes. in EJB DC this java project DC is added as used DC. no error while building but in deploytime i am getting
    java.lang.NoClassDefFoundError: com/apl/erec/dto/MailContentDTO
    (MailContentDTO is java class written in JAVA  DC)
    I have followed follwing steps while creating JAVA DC .
    1. create java DC
    2. adding java clsses to SRC folder
    3. right click n add java classes to public parts as public as package => purpose compilation
    then added this public part to EJB DC while adding used DC.

    If it runs from command line, but not through script, then you need to compare your environment with the script. Or you could just export your environment to a script to call before the command.
    Why are you manually setting PATH etc ? Try using oraenv to set the environment.

  • EJB container caught java.lang.NoClassDefFoundError package/classname

    Hello,
    If i start the Websphere 5.1 Test Environment with my EAR deployed in it the following Error appears:
    EJB container caught java.lang.NoClassDefFoundError: package/class
         at java.lang.Class.getDeclaredMethods0(Native Method)
         at java.lang.Class.privateGetDeclaredMethods(Class.java(Compiled Code))
         at java.lang.Class.privateGetPublicMethods(Class.java:1911)
         at java.lang.Class.getMethods(Class.java:909)
         at com.ibm.ejs.container.util.DeploymentUtil.getMethods(DeploymentUtil.java:124)
         at com.ibm.ejs.container.BeanMetaData.initializeBeanMethods(BeanMetaData.java:1566)
         at com.ibm.ejs.container.BeanMetaData.completeInitialization(BeanMetaData.java:1403)
         at com.ibm.ws.runtime.component.EJBContainerImpl.createBeanMetaData(EJBContainerImpl.java:1039)
         at com.ibm.ws.runtime.component.EJBContainerImpl.createModuleMetaData(EJBContainerImpl.java:830)
         at com.ibm.ws.runtime.component.EJBContainerImpl.createMetaData(EJBContainerImpl.java:1575)
         at com.ibm.ws.runtime.component.MetaDataMgrImpl.createFactoryMetaData(MetaDataMgrImpl.java:115)
         at com.ibm.ws.runtime.component.MetaDataMgrImpl.createMetaData(MetaDataMgrImpl.java:159)
         at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:350)
         at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:578)
         at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:311)
         at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:268)
         at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
         at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
         at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:152)
         at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:536)
         at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:413)
         at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:246)
         at com.ibm.ws.runtime.WsServer.start(WsServer.java:128)
         at com.ibm.ws.runtime.WsServer.main(WsServer.java:225)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
         at java.lang.reflect.Method.invoke(Method.java:391)
         at com.ibm.ws.bootstrap.WSLauncher.run(WSLauncher.java:222)
         at java.lang.Thread.run(Thread.java:570)
    Does anyone know where the failure could lie?
    - Thanks and regards
    Fabian

    Hello again,
    What do you exactly mean by saying:
    Did you create the deployment code?
    I deployed the EJB on the Application Server is there anything else i have to do?
    -regards
    Fabian

  • EJB lookup via JNDI results in java.lang.NoClassDefFoundError

    Hello,
    I have created and deployed an EJB to the WebAS (ver 6.40).  There is no problem looking up the bean via JNDI and calling its methods from a J2EE application - I successfully did this via a servlet.
    However, a JNDI lookup from a Web Dynpro application - on the same server - results in a java.lang.NoClassDefFoundError error.
    The code for the JNDI lookup is identical in either case.
    Any thoughts?

    Hello,
    I am calling ejb from .jsp use following code
    Properties props = new Properties();
    InitialContext ctx = new InitialContext();
    Object ob = ctx.lookup("java:comp/env/ejb/CalculatorBean");
    CalculatorHome home = (CalculatorHome) PortableRemoteObject.narrow(ob, CalculatorHome.class);
    calc = home.create();
    I have a error:
    java.lang.ClassNotFoundException: class com.sap.examples.calculator.beans.CalcProxy : com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at calculator, the whole lookup name is java:comp/env/ejb/CalculatorBean
    My ejb-jar.xml is:
    <display-name>
         CalculatorEjb</display-name>
         <enterprise-beans>
              <session>
                   <icon/>
                   <ejb-name>Calculator</ejb-name>
                   <home>com.sap.examples.calculator.CalculatorHome</home>
                   <remote>com.sap.examples.calculator.CalculatorRemote</remote>
                   <local-home>com.sap.examples.calculator.CalculatorLocalHome</local-home>
                   <local>com.sap.examples.calculator.CalculatorLocal</local>
                   <service-endpoint>com.sap.examples.calculator.CalculatorServiceEndpoint</service-endpoint>
                   <ejb-class>com.sap.examples.calculator.CalculatorBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-ref>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <ejb-ref-type>Session</ejb-ref-type>
                        <home>com.sap.examples.calculator.CalculatorHome</home>
                        <remote>com.sap.examples.calculator.CalculatorRemote</remote>
                        <ejb-link>Calculator</ejb-link>
                   </ejb-ref>
                   <ejb-local-ref>
                        <description/>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <ejb-ref-type>Session</ejb-ref-type>
                        <local-home>com.sap.examples.calculator.CalculatorLocalHome</local-home>
                        <local>com.sap.examples.calculator.CalculatorLocal</local>
                        <ejb-link>Calculator</ejb-link>
                   </ejb-local-ref>
              </session>
         </enterprise-beans>
    my ejb-j2ee-engine.xml is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-j2ee-engine
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="ejb-j2ee-engine.xsd">
         <enterprise-beans>
              <enterprise-bean>
                   <ejb-name>Calculator</ejb-name>
                   <ejb-ref>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <jndi-name>ejb/CalculatorBean</jndi-name>
                   </ejb-ref>
                   <ejb-local-ref>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <jndi-name>ejb/CalculatorBean</jndi-name>
                   </ejb-local-ref>
              </enterprise-bean>
         </enterprise-beans>
    </ejb-j2ee-engine>

  • Java.lang.NoClassDefFoundError when trying to create my first EJB

    Hi All,
    I am trying to learn EJB's on my own. I installed the WebLogic Server Trial version and then wrote the Home Interface, Component Interface and the Bean Class. Now I started the WebLogic server and tried and create the deployment descriptor.. I am getting the error below even after I set the classpath. Is there any other correct way to set the classpath?
    C:\bea\jdk150_04\bin\ejb\demo>set classpath=C:\bea\weblogic92\server\lib\weblogic.jar;
    C:\bea\jdk150_04\bin\ejb\demo>java weblogic.ejb.utils.DDCreator -dir dploymentDescriptor.txt
    Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/ejb/utils/DDCreator
    Please help me.
    Thanks.

    If you're just learning EJBs now I'd recommend you start with the EJB 3.0 API. It's much
    easier to use than past releases and otherwise much of what you learn (e.g. Home/Component
    interfaces) are not emphasized in EJB 3.0. You can start with the EJB chapters in the
    Java EE 5 Tutorial :
    http://java.sun.com/javaee/5/docs/tutorial/doc/
    We have some additional resources here :
    https://glassfish.dev.java.net/javaee5/ejb/
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Java.lang.NoClassDefFoundError running session bean client program

    hi
    I am using weblogic 8.1 server, while i run the client program it throws following exception. i am using standalone server.
    D:\Weblogicserver\user_projects\domains\mydomain\applications\statelessSession>a
    nt run
    Buildfile: build.xml
    run:
    [java] java.lang.NoClassDefFoundError: examples/ejb20/basic/statelessSessio
    n/Client
    [java] Exception in thread "main"
    BUILD FAILED
    file:D:/Weblogicserver/user_projects/domains/mydomain/applications/statelessSess
    ion/build.xml:76: Java returned: 1
    Plz guide me to rectify this exception.
    bye
    jaiganesh

    Hi,
    set the setWLSEnv in classpath and try again.
    Regards
    Anilkumar kari

Maybe you are looking for

  • HP 1536 printing problem when using the charger

    On printer, scan HP 1536, when I print manualy the copy is perfect.But when I use the charger, I have two vertical lines on the copy.Somebody can help me to solve this problem.thank you in advance 

  • Regarding Vendor Master Control settings

    Hi . Can somebody expain Vendor master settings and what all they control ? Also, who is considered as Second Vendor? Thansk & Regards, Smitha

  • Help on cross tab query

    Hi all I need an help SELECT * FROM TABLE_A ID SCHEDULED MARK 1 01/18/2011 T01 2 01/18/2011 T02 3 01/18/2011 T03 4 01/19/2011 T04 5 01/20/2011 T05 I want Results like below for folllowing query SELECT SCHEDULED,MARK FROM TABLE_A WHERE SCHEDULED BETWE

  • Creative MediaSource player and URL addr

    how?can i?to hear music via Creative MediaSource player in version?3.30.2- from URL address ?like http://www.i can't find this option,and which version of the MediaSource player,i can find this option?thanks for help.

  • Error Encountered 0x80040FB3, Check Documentation

    I ahve been using the desktop software successfully for a number of months.  Recently a colleague changed an appointment (Outlook 2007) that I added to my clanedar. Now, when I try to synch the Curve (8330), I receive a dialog box explaing the differ