Access EJB 3.0 (deployed on Glassfish v3) from Tomcat 6.0.20 (Netbeans 6.8)

Hi all,
I'm a newbie (of java EE and Sun forum).
I have a problem.
I followed this tutorial: http://technology.amis.nl/blog/1368/connecting-to-an-ejb-30-remote-sessionbean-from-tomcat
using Netbeans 6.8, Tomcat 6.0.20, Glassfish v3.
The deploy of EJB on Glassfish is OK.
The deploy of WebApp on Tomcat is OK.
But when I access to the servlet using the browser I receive this exception.
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.enterprise.naming.SerialInitContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.enterprise.naming.SerialInitContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at web.MyServlet.processRequest(MyServlet.java:51)
at web.MyServlet.doGet(MyServlet.java:75)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
I know that I must copy *.jar files in Tomcat dir and App libraries (https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#Step_3._Include_appserv-rt.jar_and), but it doesn't work.
What are my mistakes?
Thank you for your help.
Servlet code:
package web;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Properties;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import testbean.MySessionBeanRemote;
* @author Stefano
public class MyServlet extends HttpServlet {
* Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
Properties props = new Properties();
props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
props.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
try {
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet MyServlet</title>");
out.println("</head>");
out.println("<body>");
out.println(MySessionBeanRemote.class.getName());
try {
InitialContext ic = new InitialContext(props);
MySessionBeanRemote mySessionRemote = (MySessionBeanRemote) ic.lookup("pippo");
out.println(mySessionRemote.getOK());
} catch (NamingException ex) {
ex.printStackTrace();
out.println("</body>");
out.println("</html>");
} finally {
out.close();

Yes, I did.
I'm not sure about the right actions to do.
For example: the Glassfish FAQ told me to add gf-client*.jar to the Tomcat folder, not appserv-rt.jar , with v3.
I tried with both files. I restarted Tomcat, but nothing work :-(

Similar Messages

  • How to connect to remote EJB 3.0 deployed on Glassfish from ADF application

    Hello, as we haven't managed to deploy ADF app with EJB 3.0 on Glassfish AS, nor on tomcat 6 with openEJB, nor on JBOSS 5GA, we're trying to deploy our app with remote interface on tomcat 6. We're using ADF, JSF and EJB 3.0 (Eclipselink as JPA).
    When the model project is deployed on WLS 10.3, everything works fine. Here is a part from DataControls.cpx
    <Source>
    <ejb-definition ejb-version="3.0" ejb-name="MySession"
    ejb-type="Session"
    ejb-business-interface="model.MySession"
    ejb-interface-type="remote"
    jndi-name="MySessionBean#model.MySession"
    provider-url="t3://localhost:7001"
    initial-context-factory="weblogic.jndi.WLInitialContextFactory"
    xmlns="http://xmlns.oracle.com/adfm/adapter/ejb"
    DataControlHandler="oracle.adf.model.adapter.bean.jpa.JPQLDataFilterHandler"/>
    </Source>Now the model project is deployed on Glassfish 2. I had to change DataControls.cpx
    <Source>
    <ejb-definition ejb-version="3.0" ejb-name="MySession"
    ejb-type="Session"
    ejb-business-interface="model.MySession"
    ejb-interface-type="remote"
    jndi-name="MySessionBean#model.MySession"
    provider-url="iiop://localhost:3700"
    initial-context-factory="com.sun.enterprise.naming.SerialInitContextFactory"
    xmlns="http://xmlns.oracle.com/adfm/adapter/ejb"
    DataControlHandler="oracle.adf.model.adapter.bean.jpa.JPQLDataFilterHandler"/>
    </Source>But I get the following error:
    SEVERE: Exception:
    oracle.jbo.JboException: JBO-29000: Выявлено непредвиденное исключение: javax.naming.NameNotFoundException, сообщ.=Exception in lookup.: `DocJournalService' could not be found.
         at oracle.adfinternal.model.adapter.ejb.EjbDataControl.<init>(EjbDataControl.java:171)
         at oracle.adfinternal.model.adapter.ejb.EjbDefinition.createDataControl(EjbDefinition.java:142)
         at oracle.adf.model.adapter.DataControlFactoryImpl.createSession(DataControlFactoryImpl.java:173)
         at oracle.adf.model.binding.DCDataControlReference.getDataControl(DCDataControlReference.java:166)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: javax.naming.NameNotFoundException: Exception in lookup.: `DocJournalService' could not be found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
         at weblogic.corba.j2ee.naming.Utils.wrapNamingException(Utils.java:58)
         at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:252)
         at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:230)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at oracle.adfinternal.model.adapter.ejb.EjbDataControl.<init>(EjbDataControl.java:148)
         ... 60 more
    Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
         at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
         at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:406)
         at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:241)
         ... 63 more
    ## Detail 0 ##
    javax.naming.NameNotFoundException: Exception in lookup.: `DocJournalService' could not be found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
         at weblogic.corba.j2ee.naming.Utils.wrapNamingException(Utils.java:58)
         at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:252)
         at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:230)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at oracle.adfinternal.model.adapter.ejb.EjbDataControl.<init>(EjbDataControl.java:148)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
         at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
         at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:406)
         at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:241)
         ... 63 more
    Could you tell me where is my mistake?

    http://www.alexnet.fr/doc/oracle/oas10132/web.1013/b28221/undejdev003.htm

  • Calling EJB 3.1 deployed in Glassfish 3.1 from  a web app in Tomcat7

    I have a EJB 3.1 bean deployed in Glassfish 3.1.1 server. I want to call this bean from a remote web client deployed in Tomcat 7. The EJB class and its remote interface is as follows ...
    Remote Interface -
    @Remote
    public interface MyEJBRemote
    public String sayHello();
    EJB Bean -
    @Stateless
    public class MyEJB implements MyEJBRemote
    public String sayHello()
    return "Hello EJB Client. Hope everything worked just fine.";
    In the remote client I have the following code
    Properties props = new Properties();
    props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
    props.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
    props.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
    props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
    props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
    InitialContext ic = new InitialContext(props);
    MyEJBRemote myEJBREmote = (MyEJBRemote)ic.lookup("java:global/MyEJB-1/MyEJB!com.dw.ejb.MyEJBRemote");
    Now the problem is with the last line of code. In Eclise this line of code is marked as error as the MyEJBRemote class is not there in the client project (the web app going to be deployed in tomcat 7). So where do I get the client jar generated from the deployed EJB to include in the client project ? Is there any way to generate this jar file.
    I tried using the glassfish command
    asadmin deploy generatermistubs retrieve . MyEJB.jar
    But glassfish didn't not generate any MyEJB-client.jar file. I tried a lot of times but without any success. I read up many forums. In one of them, it was mentioned that from EJB 3.1 glassfish does not generate the client stubs.
    So does that mean that one cannot use remote clients from EJB 3.1 in Glasssfish anymore ? Because the client project will never compile without the MyEJB-client.jar .

    You don't have to generate anything, you need the business interface class in your client application (MyEJBRemote in this case). One way to do that is to put the business interfaces in a separate jar and link that jar in both your client and server projects. The glassfish 3 FAQ documents the need to include the business interface class in your client application:
    http://glassfish.java.net/javaee5/ejb/EJB_FAQ.html#StandaloneRemoteEJB
    Another option is to turn the EJB into a JAX-WS webservice, which can be as easy as only adding a few annotations to it. That way you don't need any additional dependencies at all; the only thing you need to do is generate the stub classes using the wsimport tool (also part of the JDK) for your client application. I'm not a huge fan of SOAP, but for internal use I find it less cumbersome and more portable than remote EJBs.
    I can't offer any more advice on the topic as I don't use Glassfish. For better help, I do advise you to ask in the Glassfish forum where you'll find more people that have been in the same boat you are.
    http://www.java.net/forums/glassfish/glassfish

  • Access EJB's deployed in WL 61 from Tomcat 4.0.3

    Question -
    Can anyone point me at documentation that will help me understand what jar files
    are required to allow access EJB's that are deployed in Weblogic 6.1 from a Servlet
    that is running under Tomcat.
    I am currently getting the following exception:
    javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory.
    Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1394)
    Thanks,
    Gary Bartlett

    I got the same problem.
    Some posts here suggest you should put weblogic.jar under /common/lib,
    I tried it but it didn't work. I also tried to put it under
    webapps/yourweb/web-inf/lib
    but it didn't work too. At last I had to unpack the weblogic.jar and put
    them under
    webapps/yourweb/web-inf/classes. This at least solved the problem you
    mentioned.
    I got other problem like ClassCastException that might be due to my own
    code.
    Anyway you can try the above approach. And please post your results here
    just let
    others know.
    Thanks.
    "Gary Bartlett" <[email protected]> wrote in message
    news:3ce3fdf1$[email protected]..
    >
    Question -
    Can anyone point me at documentation that will help me understand what jarfiles
    are required to allow access EJB's that are deployed in Weblogic 6.1 froma Servlet
    that is running under Tomcat.
    I am currently getting the following exception:
    javax.naming.NoInitialContextException: Cannot instantiate class:weblogic.jndi.WLInitialContextFactory.
    >
    >
    >
    Root exception is java.lang.ClassNotFoundException:weblogic.jndi.WLInitialContextFactory
    atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
    a:1394)
    >
    >
    Thanks,
    Gary Bartlett

  • Accessing EJB in already deployed jar

    Hi
    I have an .jar file already deployed into my weblogic server. Am getting an error when trying to access an EJB in the .jar from my web application(.war).
    Even if i package the .jar and .war together am gettign a JNDI exception for the EJB's
    Is there any work around to access an EJB in .jar from a jsp /servlet in .war file

    Hi
    I have an .jar file already deployed into my weblogic server. Am getting an error when trying to access an EJB in the .jar from my web application(.war).
    Even if i package the .jar and .war together am gettign a JNDI exception for the EJB's
    Is there any work around to access an EJB in .jar from a jsp /servlet in .war file

  • Error accessing EJB bean on ias 10.1.2 from Jdev 10.1.3

    I have deployed an ADF Application Module from Jdev 10.1.3 to Oracle Application Server 10.1.2 as an EJB.
    Then I made að sample java client (by right clicking the EJB).
    When I run the client I get the following exception (which is thrown at the Application Server):
    java.lang.NoClassDefFoundError: javax/servlet/jsp/el/VariableResolver
         at oracle.jbo.mom.DefinitionManager.getCurrentDefinitionContext(DefinitionManager.java:1592)
         at oracle.jbo.mom.DefinitionManager.loadProjectDefinition(DefinitionManager.java:874)
         at oracle.jbo.server.SessionImpl.init(SessionImpl.java:143)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.createSession(AbstractRemoteApplicationModuleImpl.java:343)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.createSession(ServerApplicationModuleImpl.java:118)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.createRootApplicationModule(AbstractRemoteApplicationModuleImpl.java:208)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.initAsRoot(ServerApplicationModuleImpl.java:138)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.createInstance(ServerApplicationModuleImpl.java:55)
         at oracle.jbo.server.ejb.SessionBeanImpl.createApplicationModule(SessionBeanImpl.java:400)
         at is.fiskistofa.ask.vigtun.bc4j.appmod.server.ejb.beanmanaged.VigtunAppModuleServer.ejbCreate(VigtunAppModuleServer.java:73)
         at VigtunAppModuleHome_StatefulSessionHomeWrapper7.create(VigtunAppModuleHome_StatefulSessionHomeWrapper7.java:90)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:124)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    I have installed the ADF runtime libraries at the application server so why won't it find this class ?

    We installed the ias again completely deployed our application and were able to run this simple test without errors. Then we installed the ADF Runtime (from JDev 10.1.3, without errors) and then the error in our application came again.
    We reverted the ADF Runtime installation so I don't currently have the 10.1.3 runtime installed on the Application Server.
    A simple test case would be:
    1. create new business components project
    2. define a database connection (e.g. scott)
    3. generate business components from tables (e.g. scott.emp), make a entity, a view object and an applicationmodule
    4. define a connection to an application server (in our case it is ias 10.1.2 on solaris)
    5. right click the appmodule and select "business components deployment"
    6. select EJB session beans (not simple archive)
    7. in the next step select the application module and create new local configuration
    8. deploy to appserver (using enterprise manager, I think direct deployment from JDev 10.1.3. to ias 10.1.2 is not possible)
    9. right click the EJB (in JDev) that was created after step 7 and select "new sample java client"
    10. uncomment the line where create is called.
    11. run the sample client

  • How to access ejb jar in ear package from other war web package?

    How to access ejb in jar packed in ear package from other war web package?

    Typically you would just look the EJB Home up in JNDI. If you're
    looking for example code, the medrec example in WLS 8.1 or petstore has
    plenty of webapps calling EJBs.
    -- Rob
    CottonXu wrote:
    How to access ejb in jar packed in ear package from other war web package?

  • Issues in looking up a ejb deployed on glassfish from tomcat.

    Hi all,
    I have followed the steps mentioned in the EJB FAQ in the glassfish site and was able to lookup a remote ejb deployed in glassfish from a standalone client.
    In case of standalone client, i set the appropriate jndi properties in the initial context as mentioned in the FAQ and added the 4 jars specified to the classpath of the application.
    It all worked perfectly well.
    But I attempted to do the same from a servlet running under tomcat.
    I set the appropriate jndi properties in the intial context and added 4 jars specified in the lib directory of the war file.
    But this did not turn out well and tomcat complained me with some servlet init errors.
    Then i searched through the web and found this posting from you:
    http://www.archivesat.com/GlassFish_Enterprise_JavaBeans_Developers/thread1399339.htm
    Then i created a folder called "shared/lib" under TOMCAT_HOME directory in my machine and ran the same example. Wow.....miraculously the application ran well.
    But i found that the "index.jsp" which i configured in the welcome file list does not appear now. But i was able to access the servlet without any problem. And the servlet was able to successfully lookup the ejb deployed in glassfish.
    Then i thought, let me try to access the ejb from a jsf application.
    Then i created a jsf application in netbeans 5.5.1 and tried to access the bean deployed in glassfish.
    (Note: the jsf application runs in tomcat 5.5.17 which is bundled with netbeans)
    OOPSS....
    Tomcat now complains me that it cannot compile the jsp page..
    This is the error i got...
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    C:\Documents and Settings\james\.netbeans\5.5.1\apache-tomcat-5.5.17_base\work\Catalina\localhost\CityExplorer-WebClient1\org\apache\jsp\index_jsp.java:7: org.apache.jsp.index_jsp is not abstract and does not override abstract method getDependants() in org.apache.jasper.runtime.JspSourceDependent
    public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
    ^
    Generated servlet error:
    C:\Documents and Settings\james\.netbeans\5.5.1\apache-tomcat-5.5.17_base\work\Catalina\localhost\CityExplorer-WebClient1\org\apache\jsp\index_jsp.java:12: getDependants() in org.apache.jsp.index_jsp cannot implement getDependants() in org.apache.jasper.runtime.JspSourceDependent; attempting to use incompatible return type
    found : java.lang.Object
    required: java.util.List
    public Object getDependants() {
    ^
    2 errors
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    Any ideas...
    Can you please help me.
    I've noticed that you were eagerly answering questions related to ejb lookup in many places.
    I feel there is some potential compatability issue between tomcat and glassfish...
    I request you to investigate on this and clarify the community with your response.
    Thanks in advance,
    James Selvakumar

    Thank you guys!
    I've found the answer myself.

  • Can't access EJB deployed on remote OC4J - what am I doing wrong?

    I'm unable to access an EJB deployed on a remote OC4J instance (ie, part of a 9iAS installation on another machine vs local in JDeveloper).
    I've reverted to a stupid-simple EJB in hopes of getting it going prior to trying my actual code. The EJB works fine in JDev (9.0.3) - I 'run' the EJB to start the local OC4J instance, run my client code (generated via the "New Sample Java Client..." option in the Navigator context popup) and all is well.
    I then create an EAR file via the the "Create EJB Jar Deployment Profile..." context popup of the ejb-jar.xml node, followed by "Deploy to EAR file" from the context popup of the resulting ejb1.deploy node. I next "Deploy EAR File" via the "Oracle Enterprise Manager" that comes with 9iAS (the :1810 port). After successfully deploying, I modify my client code in JDeveloper, specifying the new connection information for the remote machine via the Hashtable constructor of InitialContext and attempt to run it. I've tried a number of Context.PROVIDER_URL forms, including: ormi://registered_pingable_host_name:23791/deployed_application_name
    ormi://registered_pingable_host_name:23791/session_deployment_name (from the <enterprise-beans><session-deployment name="xxx"/></enterprise-beans> section of my orion-ejb-jar.xml file, as per a tip in this forum)
    I've tried prefixing ormi:// with http:, but get no response whatesoever in this case.
    I've also tried it without the port number (this port number matches that in my remote OC4J's <oc4j_instance_home>/config/rmi.xml file).
    On the Context.SECURITY_PRINCIPAL and Context.SECURITY_CREDENTIALS settings, I've tried various values, generally using the 'admin' user, with passwords taken from:
    <oc4j_instance_home>/principals.xml
    <oc4j_instance_home>/application-deployments/application_name/principals.xml
    I've also tried matching the password in the jazn-data.xml, to no avail - this password appears encrypted anyway, but thought I'd give it a try on the off-chance that it was just a randomly-generated password - no go.
    I've also tried SCOTT/TIGER, anonymous, etc. Incidentally, the 'deactivated' attribute of the <user> tag is set to "false" in my principals.xml files.
    No matter what I do, I always get back "javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect"
    Additionally, I get this same message when I try to establish an Application Server Connection via JDev.
    Clearly, I'm missing something critical (and probably simple), but I can't for the life of me figure it out.
    Any help would be much appreciated!
    Thanks,
    Jim Stoll

    Ok, well this is a bit strange...
    3103 - 3103 also fails, and some experimentation has led me to find that any time that I specify a range smaller than 6 (3101 - 3106 works, 3101 - 3105, 3101-3101, 3103-3103, etc does not), the OC4J instance will not restart. I get "An error occurred while starting. The opmn request has failed. From opmn: HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html Response: 0 of 1 processes started. Check opmn log files such as ipm.log and ons.log for detailed." in the OEM window (I specify the RMI port range, hit Apply, go to the OC4J instance home page, see that the Status is 'Down', hit Start, and get that message.) <ORACLE_HOME>/product/iasinfra/opmn/logs/ipm.log tells me:
    02/12/03 09:41:12 There is no rmi port left for starting an OC4J process. Please check oc4j's port property in OPMN's configuration file.
    02/12/03 09:41:12 start_proc: UID 3719788: failed to build args
    02/12/03 09:41:12 start_proc_req: failed to start a process in GID OC4JJim2, type: 2
    If I bump it up to 3101 - 3106 or higher, it starts right up. Running opmnadmin debug, as suggested by Venky (thanks Venky!), yields:
    PROCESS TABLE
    UID PID FLAGS TYPE STATUS REF HTTP AJP RMI JMS
    3654011 84 00000040 OC4J Alive 1 0 3005 3106 3206
    424987 604 00000000 Apache Alive 1 7777 0 0 0
    2932088 14849 00000000 OC4J Alive 1 0 3003 3103 3203
    3063160 14878 00000000 OC4J Alive 1 0 3001 3101 3201
    3194232 14906 00000000 OC4J Alive 1 0 3000 3105 3205
    3325304 14936 00000000 OC4J Alive 1 0 3002 3102 3202
    3456376 14964 00000000 OC4J Alive 1 0 3004 3104 3204
    Which is what I would expect, given the specified range of 3101-3106. Trying each of these ports in turn, I've found that I can hit the EJB successfully on 3106, but 3101 - 3105 all fail with:
    javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: No such domain/application: Project7_2; nested exception is:
         javax.naming.AuthenticationException: No such domain/application: Project7_2
         java.lang.Object com.evermind.server.rmi.RMIContext.lookup(java.lang.String)
              RMIContext.java:134
         java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
              InitialContext.java:350
         void Samplemypackage9.MySessionEJBClient1.main(java.lang.String[])
              MySessionEJBClient1.java:15
    I'm a little concerned about assuming the high-end of the range to be the active port on a regular basis (though thus far, among about 20 - 30 tries spaced over 20 - 30 minutes, it has been...) - I guess I can have my code loop through the range until it finds a good port or exhausts the list, but that seems a bit excessive.
    Can you think of a reason that my OC4J instance won't start with a range size of less than 6? I'm on 9iAS 9.0.2, if that makes any difference.
    Thanks,
    Jim

  • NoClassDefFoundError during deployment & accessing EJBs in ear

    Platform - Redhat Linux 7.2 weblogic6.0 ant 1.3 for compilation and creation of ear.
    I get a NoClassDefFoundError when I try to access some of the EJBs in my deployed
    ear file.
    Previously, I faced a NoClassDefFoundError problem in deployment and I put the jar
    containing
    the classes that it was asking for, in the classpath in startWeblogic.sh.
    The ear got deployed after that.
    Error I am getting now...
    2002-04-29 18-05-18 - bang - <INFO> - Type :Operation Groups
    2002-04-29 18-05-18 - bang - <INFO> - SELECT member FROM s_access_group WHERE site
    = ? AND facility
    = ? AND type = ? AND name in('null')
    2002-04-29 18-05-18 - bang - <DEBUG> - DB Connection closed
    2002-04-29 18-05-18 - bang - <DEBUG> - DB Connection closed
    2002-04-29 18-05-18 - bang - <ERROR> - Controller: createSessionForTheUser: Caught
    Remote exception
    while creating SessionMgrEJB
    java.rmi.RemoteException: EJB Exception:; nested exception is:
    java.lang.NoClassDefFoundError: com/seagate/edcs/server/system/sysmgr/GroupDetails
    java.lang.NoClassDefFoundError: com/seagate/edcs/server/system/sysmgr/GroupDetails
    at com.seagate.edcs.util.system.SecurityUtils.getMembersOfGroups(SecurityUtils.java:205)
    at com.seagate.edcs.util.system.SecurityUtils.getGuestPrivileges(SecurityUtils.java:376)
    at com.seagate.edcs.server.system.sessionmgr.SessionMgrEJB.ejbCreate(SessionMgrEJB.java:127)
    I have done the same compilation and creation of ear and deployment in a Solaris
    server, using the
    same source code and build.xml ( ant build file) and ant properties file; never saw
    any errors like this.
    I unjared the ear lying in the solaris machine that I was using previously and the
    ear that
    I created now in the linux server, and saw a difference in the manifest files...
    the manifest files remains same as what I decribe with the EJB source in the previous
    (solaris)
    case...
    Manifest-Version: 1.0
    Created-By: 1.3.0 (Sun Microsystems Inc.)
    Class-Path: edcs2000_utility.jar edcsreportmgr.jar wipgrpmgr.jar resourcegrpmgr.jar
    systemgrpmgr.jar
    notificationmgr.jar role.jar user.jar
    The manifest file in the ear created now in the linux machine is something like this;
    different
    from what I describe together with the EJB.
    Manifest-Version: 1.0
    Name: com/seagate/edcs/server/system/role/RoleEJBHomeImpl_WLStub.class
    Name: com/seagate/edcs/server/system/role/ACLDetails.class
    Name: WLGENERATED
    Name: com/seagate/edcs/server/system/role/RolePK.class
    Name: com/seagate/edcs/server/system/role/RoleEJBHomeImplAD.ser
    Name: com/seagate/edcs/server/system/role/RoleEJBEOImpl_WLStub.class
    Name: com/seagate/edcs/server/system/role/RoleEJBEOImpl.class
    Name: META-INF/ejb-jar.xml
    what might be the issue here ? Please do have a look and help!
    Thanks in advance
    Prabin.

    Hi Kevin,
    Use remote EJB method calls. For details, look for "Parent application" topic in this forum or Servlet development guide in Oracle Documentation Library. I know, it does not seem to be the right source when looking for EJB documentation, however, it is.
    Daniel.

  • How to access EJB deployed in JBOSS 4 from Creator

    Hello.
    I am trying to access EJBs deployed on JBOSS in order to develop a web app client, when I import the EJB set from Creator (sessions and entities packages in a jar file) I got the following error message....."No EJB set found in file....." .
    I presume there is an kind of xml file description specific for Sun App Server missing. I would like to know if there is other way to expose EJB in creator?....maybe write a config file by hand.
    I already read the tutorials related to EJB but those only use pre build EJB jars for Sun App Sserver.
    Also I read all the posted about JBoos and EJB in this forum but those are pretty general.
    By the way I have Delegate classes to access the EJB. How do I register my delegates in Creator in order to expose their methods?
    I�ll really appreciate some light in this matter.
    Thanks in advance!!!

    Hi,
    The below forum thread may help you :
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=51321
    Thanks,
    Runa.

  • Spring 2.5.5 and EJB 3.0 Deployment problem in WLS 10.3

    Hi,
    I am attempting to deploy a EAR file that previously ran on SJSAS 9.1 update 1 to WLS 10.3. As part of the deployment I get the following error related to the EJB3 classes.
    There are 1 nested errors: weblogic.j2ee.dd.xml.AnnotationProcessException: [EJB:015002]Unable to load class au.edu.cqu.cis.web.ajaxservice.AjaxServicesBean in Jar D:\dev\env\oracle\middleware\jdeveloper\system\system11.1.1.0.31.51.56\DefaultDomain\servers\DefaultServer\tmp\_WL_user\ProgEnrol-ear-3\v540rk\ProgEnrol-ejb-3.0.4-SNAPSHOT.jar : java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
    I suspect that this is related to the @Autowired spring annotation in use in the session bean. Either, the server is not finding the Spring JAR correctly or it has a problem with the annotation.
    Can anyone point me in the right direction? Do I need to deploy the spring jar as a library?
    Thank you.
    Regards,
    Graeme.

    Hi, Graeme.
    Seems there is an existing CR on something related from v10.0: CR353213
    * WLS 10.0 - EJB 3.0 deployment fails when parsing class for Stateless annotation
    According to http://edocs.bea.com/wls/docs103/issues/known_resolved.html, this is not addressed in 10.3
    Closely review your classpath, and then (assuming you have access to the source) review the body of your ejb. If it is related to this CR, you may be able to workaround the issue by shortening the body and split large methods into more sub-methods.
    I hope this helps,
    -Adrian

  • Ejb-link not working when i access ejb in different ear

    Hi All
    I am here trying to access ejb's which is in different ear, I am providing ejb-link inside web.xml of war file deployed inside deffirent ear file.
    I am using wls8.1sp5. I tried different combination with elb-link name , but its not working . <ejb-ref>
    <ejb-ref-name>ejb/AuditService</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.onstar.audit.ejb.AuditServiceHome</home>
    <remote>com.onstar.audit.ejb.AuditService</remote>
    <ejb-link>ccarenewal.jar#AuditService</ejb-link>
    </ejb-ref>
    <ejb-ref>
         <ejb-ref-name>ejb/AccountService</ejb-ref-name>
         <ejb-ref-type>Session</ejb-ref-type>
         <home>com.onstar.account.ejb.AccountServiceHome</home>
         <remote>com.onstar.account.ejb.AccountService</remote>
         <ejb-link>ccarenewal.jar#AccountService</ejb-link>
         </ejb-ref>
    Exception:weblogic.management.ApplicationException: activate failed for sbwo Module: sbwo Error: weblogic.management.DeploymentException: Could not setup environment - with nested exception: [weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'ccarenewal.jar#AuditService' declared in the ejb-ref or ejb-local-ref 'ejb/AuditService' in the application module 'accountadj.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.] weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'ccarenewal.jar#AuditService' declared in the ejb-ref or ejb-local-ref 'ejb/AuditService' in the application module 'accountadj.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct. at weblogic.deployment.EnvironmentBuilder.addEJBLinkRef(EnvironmentBuilder.java:658) at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:467) at weblogic.servlet.internal.CompEnv.init(CompEnv.java:123) at weblogic.servlet.internal.WebAppServletContext.activate
    I will appreciate any help.
    Rajiv

    Rob,
    Thanks for your reply.
    Below is all deployment descriptor entries i have(ejb-jar.xml, weblogic-ejb-jar.xml, web.xml, weblogic.xml)
    please correct me if i have wrong entries any where.
    ejb-jar.xml
    ejb-ref>
    <description />
    <ejb-ref-name>ejb/AccountService</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.onstar.account.ejb.AccountServiceHome</home>
    <remote>com.onstar.account.ejb.AccountService</remote>
    <ejb-link>AccountService</ejb-link>
    </ejb-ref>
    weblogic-ejb-jar.xml
    <ejb-reference-description>
    <ejb-ref-name>ejb/AccountService</ejb-ref-name>
    <jndi-name>cca/AccountService</jndi-name>
    </ejb-reference-description>
    web.xml
    <ejb-ref>
    <ejb-ref-name>ejb/AccountService</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.onstar.account.ejb.AccountServiceHome</home>
    <remote>com.onstar.account.ejb.AccountService</remote>
    <ejb-link>ccarenewal.jar#AccountService</ejb-link>
    </ejb-ref>
    weblogic.xml
    <ejb-reference-description>
    <ejb-ref-name>ejb/AccountService</ejb-ref-name>
    <jndi-name>cca/AccountService</jndi-name>
    </ejb-reference-description>
    I appreciate your help.
    Thanks
    Rajiv

  • Help me which JNDIFactory to use to access EJB from a java class of JAR

    I am confused in understanding the different JNDI factories
    RMIInitialContextFactory, ApplicationInitialContextFactory and ApplicationClientInitialContextFactory
    And the different namespaces like global, container local and component local.
    Especially is there any relationship between the JNDI factories and the namespaces?
    Or are they related to the deployment descriptors.
    Because in application specific deployment descriptors (orion-ejb-jar.xml), we just map the JNDI location with the object (or its reference from ejb-jar.xml). We dont specify it can be accessed from this factory or that.
    Shall we access an EJB from using any JNDI factory?
    Specifically, I am stuck with what Factory to use to access an EJB from a Java class in a library (jar). The JAR is packaged with the EAR which contains the EJB Jar that I am trying to access.
    THANK YOU

    Ed,
    As Robin said, I think you need code similar to this:
    Context c = new InitialContext();
    Object o = c.lookup("java:comp/env/Name");where Name is the name of your EJB as it appears in the "ejb-jar.xml"
    deployment descriptor XML file.
    Good Luck,
    Avi.

  • Access EJB from Servlet that in different archive?

    <font class="mediumtxt">package kyro.ejb.session;
    import javax.ejb.*;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless(name="StandAlone")
    @Remote(StandAlone.class)
    public class StandAloneBean
    implements StandAlone, StandAloneLocal
    public StandAloneBean() {
    public String sayHello() {     
    return "sayHello";
    I want to access ejb from servlet that .war and .jar not in single .ear. I want to try that just with annotation not xml descriptor cause is easy to understand for me. I use Glassfish. But i can't lookup that ejb. How can i lookup that ejb with jndi? Can't you give me example of servlet to access that? I not use JNDI.properties, are that caused i can't access my ejb? I just thing .war and.jar in one server, are i have to used JNDI.properties. can you explain how to use JNDI.properties in servlet or separate file?
    </font>

    But i can't lookup that ejb. How are you trying and what exception is occurring?
    How can i lookup that ejb with jndi? [https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html|https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html]
    m

Maybe you are looking for