Link to home
Start Free TrialLog in
Avatar of chaitu chaitu
chaitu chaituFlag for India

asked on

NameNotFoundException in session bean while running application from jdeveloper

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;


Avatar of chaitu chaitu
chaitu chaitu
Flag of India image

ASKER

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)

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
 
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??
ASKER CERTIFIED SOLUTION
Avatar of petmagdy
petmagdy
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
sometimes debug options r disabling except pause ,Terminate buttons;;;;;;;;;;
yes correct
if erratic cases happens just restart the Jdeveloper and OC4J

frankly i feel Jdeveloper and Oc4J 10g are more reliable