Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

NameNotFoundException in session bean  while running application from jdeveloper

Posted on 2004-10-28
7
Medium Priority
?
657 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
Comment
Question by:chaitu chaitu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 12441731
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
ID: 12441930
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
ID: 12442036
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Accepted Solution

by:
petmagdy earned 1500 total points
ID: 12442068
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
ID: 12442132
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
ID: 12442144
sometimes debug options r disabling except pause ,Terminate buttons;;;;;;;;;;
0
 
LVL 13

Expert Comment

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

frankly i feel Jdeveloper and Oc4J 10g are more reliable

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

610 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