facebook

EJB3 Tutorial: MyBeanRemote not found, NameNotFoundException

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #272948 Reply

    emoc
    Member

    Hi Support,

    I am following the EJB3 tutorial with the MyEclipse 5.5 version on GlassFish v2-b50g app server. My progress fails at the tutorial’s “Testing the Bean” step. I have given an extract from the configuration log and console log below. How do you run this client?

    Thanks, E

    MyEclipse Configuration
    *** Date: Fri Jul 20 17:17:44 EST 2007
    *** Platform Details:
    *** System properties:
    awt.toolkit=sun.awt.windows.WToolkit
    catalina.base=/C:/java/MyEclipse 5.5.1 GA/eclipse/plugins/org.eclipse.tomcat_4.1.130.v20060601/
    catalina.home=/C:/java/MyEclipse 5.5.1 GA/eclipse/plugins/org.eclipse.tomcat_4.1.130.v20060601/
    catalina.useNaming=true
    eclipse.buildId=M20070212-1330
    eclipse.commands=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\java\MyEclipse 5.5.1 GA\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    bb4_70
    -vm
    C:\java\MyEclipse 5.5.1 GA\jre\bin\javaw.exe

    Console log

    20/07/2007 17:10:48 com.sun.ejb.base.sfsb.util.EJBServerConfigLookup needToAddSFSBVersionInterceptors
    INFO: EJBServerConfigLookup::==> isClustered:false ; isEJBAvailabilityEnabled: false ; isStoreTypeMemory ==> false ; result: false
    20/07/2007 17:10:48 com.sun.enterprise.iiop.J2EEInitializer post_init
    INFO: J2EEInitializer: Checking if interceptors need to be added
    javax.naming.NameNotFoundException: com.myeclipseide.ejb3.MyBeanRemote not found
    at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
    at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
    at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
    at com.sun.enterprise.naming.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:129)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:125)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:658)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:198)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1820)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1680)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1062)
    at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:194)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:780)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:537)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2541)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:524)

    [/b][/i]

    #272965 Reply

    Riyad Kalla
    Member

    Eileen,
    We’ve been working with the Glassfish team to fix some deployment issues with EARs and EJBs and some of the most recent fixes went into the Build55 nightly. The current release is Build 56 and I would strongly encourage you to try that before trying to trouble shoot anything. Development is pretty active on GF right now:
    https://glassfish.dev.java.net/downloads/v2-b56.html

    #273022 Reply

    emoc
    Member

    Hi again,

    the tutorial indicates glassfish-2.0b45 was running, so I guess it was working then, however I have now installed build 56 and get different (better?) runtime behaviour.
    A RMI error is produced when I do the following:
    … from Package Explorer: SampleEJBProject <right click> Run As, Run

    Activation.main: warning: sun.rmi.activation.execPolicy system
    property unspecified and no ExecPermissions/ExecOptionPermissions
    granted; subsequent activation attempts may fail due to unsuccessful
    ExecPermission/ExecOptionPermission permission checks …refer to 1.4 doco

    How do I configure RMI from MyEclipse?

    Thanks, Eileen.

    #273044 Reply

    Riyad Kalla
    Member

    Eileen,
    I’m glad that your runtime behavior is getting more on track with what you need… any time you run into squirrlyness with GF, try the latest build, they are making lots of changes as they go.

    As far as RMI, I’m sorry I cannot help there… I haven’t tried setting up an RMI client before, but it isn’t a MyEclipse-specific item. Just from this message:

    system
    property unspecified and no ExecPermissions/ExecOptionPermissions
    granted;

    looks like a properties file of some type declaring certain permissions is missing.

    #273050 Reply

    ylou
    Member

    Riyad,
    I used JBOSS 4.2 and myEclipse 5.5.1 and following the EJB3 tutorial. I got an error when I run the client.
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at com.myeclipseide.ejb3.MyBeanClient.main(MyBeanClient.java:18)
    Could you tell us how to deploy the EJB example to JBOSS 4.2 and how to run the client?
    I assume we need change a few files.
    Thanks.

    Here is my installation details:
    *** Date:
    Monday, July 23, 2007 10:02:27 AM CDT

    ** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.5.0_11

    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 5.5.1 GA
    Build id: 20070521-5.5.1-GA

    *** Eclipse details:
    MyEclipse Enterprise Workbench

    Version: 5.5.1 GA
    Build id: 20070521-5.5.1-GA

    Eclipse Platform

    Version: 3.2.2.r322_v20070119-RQghndJN8IM0MsK
    Build id: M20070212-1330

    Eclipse RCP

    Version: 3.2.2.r322_v20070104-8pcviKVqd8J7C1U
    Build id: M20070212-1330

    Eclipse Java Development Tools

    Version: 3.2.2.r322_v20070104-R4CR0Znkvtfjv9-
    Build id: M20070212-1330

    Eclipse Plug-in Development Environment

    Version: 3.2.1.r321_v20060823-6vYLLdQ3Nk8DrFG
    Build id: M20070212-1330

    Eclipse Project SDK

    Version: 3.2.2.r322_v20070104-dCGKm0Ln38lm-8s
    Build id: M20070212-1330

    Eclipse Graphical Editing Framework

    Version: 3.2.2.v20070208
    Build id: 20070208-1315

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\MyEclipse 5.5.1 GA\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    1784_70
    -vm
    C:\MyEclipse 5.5.1 GA\jre\bin\javaw.exe

    #273051 Reply

    Riyad Kalla
    Member

    Ylou,
    You will need to search for the correct JNDI information under JBoss, I don’t know what it is.

    The issue is that the application servers load up the EJBs into a JDNI context under a certain name. And if you want to run a client, you need to connect to the running JNDI instance and request the EJBs out of it.

    Every app server does it differently, and with Glassfish, all you have to do is add the appserv-rt.jar file to your classpath, and the client will pickup the JNDI conection information from the properties file in the JAR and use that, making it super simple to use.

    With JBoss I don’t know if the same thing will work, or if you need to code the connection properties by hand.

    #273223 Reply

    emoc
    Member

    Hi Support,
    I am following the EJB3 tutorial with the MyEclipse 5.5 version on GlassFish v2-b56 app server. My progress fails at the tutorial’s “Testing the Bean” step.
    I run this client from … from Package Explorer: SampleEJBProject <right click> Run As, Run
    Why am I getting a RMI error and can the MyEclipse Tutorial include more detail on how you are supposed to run this client so the following error does not occur.
    Thanks, E

    A RMI error is produced when I do the following:

    Activation.main: warning: sun.rmi.activation.execPolicy system
    property unspecified and no ExecPermissions/ExecOptionPermissions
    granted; subsequent activation attempts may fail due to unsuccessful
    ExecPermission/ExecOptionPermission permission checks

    #273243 Reply

    Riyad Kalla
    Member

    Eileen,
    What does your build path look like? Did you include the appserv-rt.jar file from glassfish on your build path for that project?

    #273267 Reply

    emoc
    Member

    Hello Riyad,
    the SampleEJBProject build class path looks like:
    SampleEJBProject/src
    JRE System Library [MyEclipse 5.5.1 GA]
    Java EE 5 Libraries
    appserv-rt.jar – glassfish\lib

    I now realize the GlassFish v2-b50g and build 56 runtime behaviour is the same. Has the Tutorial been tested since build 45?
    When I run from
    … Package Explorer: MyBeanClient <right click> Run As, Java App, MyBeanClient, or
    … Package Explorer: SampleEJBProject <right click> Run As, Run (with default values)
    javax.naming.NameNotFoundException: com.myeclipseide.ejb3.MyBeanRemote not found

    By the way, I now know why the RMI error was generated, and I don’t want the RMI behaviour anyway. When I run from …
    … Package Explorer: SampleEJBProject <right click> Run As, Java App, Activation – sun.rmi.server (default value)
    the RMI error described above is produced.

    Thanks for any help or advice, Eileen.

    #273328 Reply

    Riyad Kalla
    Member

    Eileen,
    I just tested the EJB 3 Tutorial using Build 57 of Glassfish and it worked fine. I imported the project from the tutorial, pointed the appserv-rt.jar that was already on the build path to the real one under my build 57/lib install dir and then right-clicked on the MyBeanClient class and did Run-As, then in the App Server console it property printed out Hello World!

    #273872 Reply

    The reason might be that Eileen didn’t put the @Remote annotation on the remote interface. I did the same mistake and got the same error.

    #273886 Reply

    Riyad Kalla
    Member

    Good point… Eileen did that help?

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: EJB3 Tutorial: MyBeanRemote not found, NameNotFoundException

You must be logged in to post in the forum log in