Solved

NameNotFoundException in session bean  while running application from jdeveloper

Posted on 2004-10-28
649 Views
Last Modified: 2013-11-24
hi

i am getting NameNotFoundException while connection to session bean when i run from Jdeveloper;

i put ejb.jar.xml and orion-ejb-jar.xml put in classes/META-INF folder;


in my application index.jsp connects to sessionbean;

when i run index.jsp i am getting the follo
[Starting OC4J using the following ports: HTTP=9000, RMI=23891, JMS=9227.]
C:\j2sdk1.4.2_06\bin\javaw.exe -client -classpath C:\JDeveloper903\j2ee\home\oc4j.jar -Xverify:none -Doracle.j2ee.dont.use.memory.archive=true com.evermind.server.OC4JServer -config C:\JDeveloper903\jdev\system9.0.3.1035\oc4j-config\server.xml
[waiting for the server to complete its initialization...]
Embedded OC4J startup time: 4640 ms.

Target URL -- http://192.168.68.214:9000/1304Release3-etrans-context-root/index.jsp
Copying default deployment descriptor from archive at C:\JDeveloper903\jdev\mywork\1304Release3.0\EJB\classes/META-INF/orion-ejb-jar.xml to deployment directory C:\JDeveloper903\jdev\system9.0.3.1035\oc4j-config\application-deployments\current-workspace-app\classes...

Auto-deploying file:/C:/JDeveloper903/jdev/mywork/1304Release3.0/EJB/classes/ (New server version detected)...

The system is out of resources.
Consult the following stack trace for details.


java.lang.OutOfMemoryError

Error compiling C:\JDeveloper903\jdev\mywork\1304Release3.0\EJB\classes: Syntax error in source

 Log4j Properties file Initialized  with Path = C:\JDeveloper903\jdev\mywork\1304Release3.0\etrans\WEB-INF\log4j.properties

Oracle9iAS (9.0.3.0.0) Containers for J2EE initialized

No of Hits to this page : 1

[ERROR   ] ESACLoginController.jsp --   Un Authorised User Not Enough Credentials : ANIL

[ERROR   ] ESACLoginController.jsp --   Un Authorised User Not Enough Credentials : ANIL

[ERROR   ] ESACLoginController.jsp --   Un Authorised User Not Enough Credentials : ANIL

javax.naming.NameNotFoundException: AccessControlSessionBean not found

      at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:130)

      at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:195)

      at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:66)

      at javax.naming.InitialContext.lookup(InitialContext.java:347)

      at _ESACLoginController._jspService(ESACLoginController.jsp:89)

      at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)

      at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)

      at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)

      at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:721)

      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)

      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)

      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)

      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)

      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)

      at java.lang.Thread.run(Thread.java:534)
wing in jdeveloper console;


0
Question by:chaitu chaitu
    7 Comments
     
    LVL 20

    Author Comment

    by:chaitu chaitu
    recently we upgraded jdk1.3 to jdk1.4;


    i write a simple a servlet and it is conenction ejb;

    when i run the servlet i am getting this error;

    [Starting OC4J using the following ports: HTTP=9000, RMI=23891, JMS=9227.]
    C:\j2sdk1.4.2_06\bin\javaw.exe -client -classpath C:\JDeveloper903\j2ee\home\oc4j.jar -Xverify:none -Doracle.j2ee.dont.use.memory.archive=true com.evermind.server.OC4JServer -config C:\JDeveloper903\jdev\system9.0.3.1035\oc4j-config\server.xml
    [waiting for the server to complete its initialization...]
    Embedded OC4J startup time: 2344 ms.

    Target URL -- http://192.168.68.214:9000/Chaitanya-Web-context-root/servlet/Servlet1
    Copying default deployment descriptor from archive at C:\JDeveloper903\jdev\mywork\Chaitanya\EJB\classes/META-INF/orion-ejb-jar.xml to deployment directory C:\JDeveloper903\jdev\system9.0.3.1035\oc4j-config\application-deployments\current-workspace-app\classes...

    Auto-deploying file:/C:/JDeveloper903/jdev/mywork/Chaitanya/EJB/classes/ (No previous deployment found)... Error compiling C:\JDeveloper903\jdev\mywork\Chaitanya\EJB\classes: Syntax error in source

    UserSession_StatelessSessionBeanWrapper0.java:6: cannot access java.rmi.NoSuchObjectException
    bad class file: C:\j2sdk1.4.2_06\jre\lib\rt.jar(java/rmi/NoSuchObjectException.class)
    class file has wrong version 48.0, should be 47.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    import java.rmi.NoSuchObjectException;
                    ^
    1 error
    Oracle9iAS (9.0.3.0.0) Containers for J2EE initialized

    javax.naming.NameNotFoundException: UserSessionBean not found

          at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:130)

          at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:195)

          at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:66)

          at javax.naming.InitialContext.lookup(InitialContext.java:347)

          at mypackage3.Servlet1.doGet(Servlet1.java:39)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

          at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:721)

          at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)

          at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)

          at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)

          at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)

          at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)

          at java.lang.Thread.run(Thread.java:534)

    0
     
    LVL 13

    Expert Comment

    by:petmagdy
    I think u r assembling ur application and referencing ur EJb wrongly, and here is some guidelines:

    1- preferably from ur servlet call ur ejb using local interface
    2-put a local ejb reference into ur webmodule, web.xml like this:

          <ejb-local-ref>
                <ejb-ref-name>ejb/UserSessionBean</ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
                <local-home>urfullpakage.UserSessionLocalHome</local-home>
                <local>urfullpakage.UserSessionLocal</local>
                <ejb-link>UserSessionBean</ejb-link>
          </ejb-local-ref>  

    3- ur call inside the servlet should look like this:

                Object userObject = initCtx.lookup("java:comp/env/ejb/UserSessionBean");
                UserSessionLocalHome userSessionLocalHome= (UserSessionLocalHome ) userObject ;
                
                UserSessionLocal userSessionLocal = userSessionLocalHome.create();

    please try this and tell me
     
    0
     
    LVL 20

    Author Comment

    by:chaitu chaitu
    i solved the problem;actually that is conflict of jdk version and in the java options of Jdeveloper , i increased the memory size;

    hi petmagdy lets continue our discussion remote debugging  today i wrote a simple servlet  and EJB;

    i put break point in servlet;

    i compiled the servlet copied class file

    C:\OC4J\j2ee\home\applications\ETEAGL3170020041102\etrans\WEB-INF\classes

     when i run servlet  it stopped at breakpoint ;

    but i deployed ear file in the same container and put breakpoint in one of the servlet its not recognizing why??
    0
     
    LVL 13

    Accepted Solution

    by:
    I never saw this, on my machine I am using the following enviroment:

    JDK1.4.2
    OC4J10g 9.0.4
    Jdeveloper 9.0.5.2

    Every thing is working as expected

    this may be a bug in Oc4J 9.0.3 and Jdeveloper 9.0.3, do u have an account at metalink.oracle.com? if soo it may be reported
    0
     
    LVL 20

    Author Comment

    by:chaitu chaitu
    ok;

    if set breakpoint in servlet file  or EJB

    sometimes i previously told u one pop window comes up and asking that unable to find source file

    its giving 3 options ;;

    1.generate a stub class
    2.Lets me find Source file
    3.Dont ask me file again

    which option should i take

    usally i am taking  3rd option and clicking ok button;

    Is it correct? then i am pressing Resume button;

    after that i am pressing F7,F8;

    some times if press F7 ,F8... code is not moving to other lines or becoming stand-still ;why is happening like that
    0
     
    LVL 20

    Author Comment

    by:chaitu chaitu
    sometimes debug options r disabling except pause ,Terminate buttons;;;;;;;;;;
    0
     
    LVL 13

    Expert Comment

    by:petmagdy
    yes correct
    if erratic cases happens just restart the Jdeveloper and OC4J

    frankly i feel Jdeveloper and Oc4J 10g are more reliable

    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Course: JavaScript Coding - Massive 12-Part Bundle

    Regardless of your programming skill level, you'll go from basics to advanced concepts in a vast array of JavaScript subjects including Sammy.js, Agility.js, Ember.js, Node.js, jQuery, AJAX, Extjs, AngularJS, Knockout.js, and JSON.

    Suggested Solutions

    This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
    This video teaches viewers about errors in exception handling.

    875 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now