EJB vs COM+

If one is going to develop components for a web based project what are some of the things that they should consider when choosing EJB or COM+?
What are the advantages and disadvantages of EJB over COM+?
If the server is going to be hosted using IIS then would COM+ be better to use in this scenario vs EJB?
If your using a Sun Server then in this cause EJB would be the choice.
thanks,
newbie

Hi
well the comparision that u have asked abt
it depends upon the type of application that u developing.
like u are developing a small database driven website and ur client doesnot want to invest much then u can use Microsoft solution
IIS is free with windows 2000 so no charges for a web server. u can use com easliy with ASP .. thats again no problem.
but if client wants same small database driven application in java then he will have to pay for web servers as well ..... and for small database sites it good to use java beans instead of EJB ... cause EJB is ment for big applications .... like hundreds of thousands of users connecting and doing transactions ........ and thousands of connection pooling is involved ......
the comparision bw EJB and com.. its like every thing has some advantages and som e drawbacks .. thats up to client that wht is his requirement and wht he wants to use .....

Similar Messages

  • Accessing EJBs as COM objects.

    Hi,
    I want to access deployed EJBs from Visual Basic.
    I've used Sun's COM-CAS bridge inside a VB application to access EJBs deployed in their J2EE server and it worked OK.
    How do I do the same thing with EJBs in Oracle8i (8.1.5)?
    Does Oracle provide a similar package to Sun's COM-CAS bridge?
    Do I deploy to OAS instead of Oracle8i to achieve what I want to do?
    Any help would be appreciated.
    Thanks

    A search of the forum using "Java COM" turned this up:
    http://forum.java.sun.com/thread.jsp?forum=54&thread=106901
    Try it on your machine and see what you get back. Searches are always a good thing, especially if you're new. - MOD

  • Can not find my EJB's from my Servlet

    Hi
    I am new to EJB and am trying to get a Servlet to call some sessionless EJB beans. I have got it working in JDeveloper but when I deploy it to orion application server I keep getting a javax.naming.NameNotFoundException exception throw from the Servlet when it tries to find the first EJB.
    The code in the Servlet is:
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "jewels");
    // env.put(Context.PROVIDER_URL, "ormi://localhost:23891/current-workspace-app");
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791/dev");
    Context ctx = new InitialContext(env);
    System.out.println("Getting mapping class ejb");
    //mapping
    ExponentMappingServiceHome mappingHome = (ExponentMappingServiceHome)ctx.lookup("ExponentMappingServiceHome");
    ExponentMappingService mapping = mappingHome.create();
    My EJB xml looks like this:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">
    <ejb-jar>
    <enterprise-beans>
    <session>
    <description>Session Bean ( Stateless )</description>
    <display-name>ExponentMappingService</display-name>
    <ejb-name>ExponentMappingService</ejb-name>
    <home>com.exponent.ejb.service.map.ExponentMappingServiceHome</home>
    <remote>com.exponent.ejb.service.map.ExponentMappingService</remote>
    <ejb-class>com.exponent.ejb.service.map.ExponentMappingServiceBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    <session>
    <description>Session Bean ( Stateless )</description>
    <display-name>ExponentMappingViewsService</display-name>
    <ejb-name>ExponentMappingViewsService</ejb-name>
    <home>com.exponent.ejb.service.map.ExponentMappingViewsServiceHome</home>
    <remote>com.exponent.ejb.service.map.ExponentMappingViewsService</remote>
    <ejb-class>com.exponent.ejb.service.map.ExponentMappingViewsServiceBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    <session>
    <description>Session Bean ( Stateless )</description>
    <display-name>FalconService</display-name>
    <ejb-name>FalconService</ejb-name>
    <home>com.exponent.ejb.service.FalconServiceHome</home>
    <remote>com.exponent.ejb.service.FalconService</remote>
    <ejb-class>com.exponent.ejb.service.FalconServiceBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    I have been trying for a while to get the JNDI naming right but everything I try gets the above error. Any help would be great.
    Thanks
    Andre

    You have to lookup for "ExponentMappingService", and not "ExponentMappingServiceHome"
    The name you give in the <ejb-name> tag in ejb-jar.xml is the JNDI name of the EJB. This is the name u have to look up.

  • Java.lang.NoClassDefFoundError: com/sap/util/monitor/jarm/TaskMonitor

    hi all,
    i was trying to build and try a web service in my project.
    but at runtime it keeps throwing the following error(  log trace)
    i am unable to figure out the source of error.
    is it in the jco or anything else
    thanks in advance
    1.5#001143C809E500470000002E00000B8C00040CBB0F05957C#1139897457152#com.sap.engine.services.httpserver##com.sap.engine.services.httpserver#Guest#2####a9a4e0009d2011dacd42001143c809e5#SAPEngine_Application_Thread[impl:3]_16##0#0#Error#1#/System/Server#Plain###User Guest, IP address
    HTTP request processing failed. HTTP error [401] will be returned. The error is [Cannot authenticate the user.No details available].#
    #1.5#001143C809E500530000001F00000B8C00040CBB0FEBCF9E#1139897472233#com.sap.engine.services.ejb#sap.com/xappsospservicebundle~enterpriseapp#com.sap.engine.services.ejb#I020381E1#1839####b13de9b09d2011da944e001143c809e5#SAPEngine_Application_Thread[impl:3]_24##0#0#Error##Java###
    [EXCEPTION]
    #1#com.sap.engine.services.ejb.exceptions.BaseEJBException: Exception in method getRelatedReports.
         at com.sap.xapps.osp.orgmgmt.servicebundle.sbejb.OrgMgmtSBLocalLocalObjectImpl10.getRelatedReports(OrgMgmtSBLocalLocalObjectImpl10.java:121)
         at com.sap.xapps.osp.orgmgmt.servicebundle.facade.OrgMgtFacadeBean.getRelatedReports(OrgMgtFacadeBean.java:425)
         at com.sap.xapps.osp.orgmgmt.servicebundle.facade.OrgMgtFacadeLocalLocalObjectImpl10.getRelatedReports(OrgMgtFacadeLocalLocalObjectImpl10.java:103)
         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.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
         at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
         at SoapServlet.doPost(SoapServlet.java:51)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.NoClassDefFoundError: com/sap/util/monitor/jarm/TaskMonitor
         at com.sap.mw.jco.util.Jarm.getRequestMonitor(Jarm.java:57)
         at com.sap.mw.jco.JCO$Repository.getFunctionInterface(JCO.java:19069)
         at com.sap.mw.jco.JCO$BasicRepository.getFunctionTemplate(JCO.java:18151)
         at com.sap.xapps.osp.orgmgmt.servicebundle.common.OrgMgmtSBHelper.createFunction(OrgMgmtSBHelper.java:491)
         at com.sap.xapps.osp.orgmgmt.servicebundle.impl.OrgMgmtBusinessDelegate.getRelatedReports(OrgMgmtBusinessDelegate.java:1273)
         at com.sap.xapps.osp.orgmgmt.servicebundle.sbejb.OrgMgmtSBBean.getRelatedReports(OrgMgmtSBBean.java:170)
         at com.sap.xapps.osp.orgmgmt.servicebundle.sbejb.OrgMgmtSBLocalLocalObjectImpl10.getRelatedReports(OrgMgmtSBLocalLocalObjectImpl10.java:103)
         ... 27 more

    hi,
    thanks for the replies.
    well i guess that(user authentication) is not the problem.
    Coz that happens even before i start the web service.
    i guess the problem is that the appl. is not finding the TaskMonitor class ( see the last 10 lines of the log).
    does anyone have a solution for that.
    thanks

  • Deploy multiple instances of the same stateless session EJB

    I have a stateless session bean.
    The methods on the bean operate against DB tables.
    Q: Can I deploy multiple instances of the same stateless session bean, but specify a different JNDI/datasource name in the deployment descriptor?
    The method calls are all enclosed within a single invocation, just that I need to hit different databases (all with the same schema), and Id like to be able to lookup the EJB via a different JNDI name, and have the exact same functionality, just against different deployed datasources.
    Does the spec allow/support this?
    If not, any suggestions as to how to achieve this sort of functionality?
    Im using JBoss 3.2.1 on Solaris, so Im not sure whether or not this is a JBoss "issue" or a limitation of the EJB Spec (or me being just plain wrong and trying to do something the "wrong way")
    Nick

    I have a stateless session bean.
    The methods on the bean operate against DB tables.
    Q: Can I deploy multiple instances of the same
    stateless session bean, but specify a different
    JNDI/datasource name in the deployment descriptor?
    The method calls are all enclosed within a single
    invocation, just that I need to hit different
    databases (all with the same schema), and Id like to
    be able to lookup the EJB via a different JNDI name,
    and have the exact same functionality, just against
    different deployed datasources.
    Does the spec allow/support this?
    If not, any suggestions as to how to achieve this sort
    of functionality?
    Im using JBoss 3.2.1 on Solaris, so Im not sure
    whether or not this is a JBoss "issue" or a limitation
    of the EJB Spec (or me being just plain wrong and
    trying to do something the "wrong way")
    NickI haven't done it but judging from the deployment descriptors yes.
    For example if I have two bounded datasources java:/Database1 and java:/Database2
    Lets say I have a session bean called MySession, then in your ejb-jar.xml you would have (notice that the desc, display, and ejb-name are the only differences)
    <session>
    <description>MySessionAlpha</description>
    <display-name>MySessionAlpha</display-name>
    <ejb-name>MySessionAlpha</ejb-name>
    <home>com.mycorp.MySessionRemoteHome</home>
    <remote>com.mycorp.MySessionRemote</remote>
    <local-home>com.mycorp.MySessionLocalHome</local-home>
    <local>com.mycorp.MySessionLocal</local>
    <ejb-class>com.mycorp.MySessionFacadeBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <resource-ref>
    <res-ref-name>jdbc/DataSource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </session>
    <session>
    <description>MySessionBeta</description>
    <display-name>MySessionBeta</display-name>
    <ejb-name>MySessionBeta</ejb-name>
    <home>com.mycorp.MySessionRemoteHome</home>
    <remote>com.mycorp.MySessionRemote</remote>
    <local-home>com.mycorp.MySessionLocalHome</local-home>
    <local>com.mycorp.MySessionLocal</local>
    <ejb-class>com.mycorp.MySessionFacadeBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <resource-ref>
    <res-ref-name>jdbc/DataSource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </session>
    But now in the jboss.xml, we will have the following elements. What you may notice is that are bound to different remote and local jndi names. But the resource bindings are very different. The res-ref-name stays the same, but the jndi-name are different. I think this will work for you.
    <session>
    <ejb-name>MySessionAlpha</ejb-name> <jndi-name>ejb/com/mycorp/MySessionAlphaRemoteHome</jndi-name> <local-jndi-name>ejb/com/mycorp/MySessionAlphaLocalHome</local-jndi-name>
    <resource-ref>
    <res-ref-name>jdbc/datasource</res-ref-name>
    <jndi-name>java:/Database1</jndi-name>
    </resource-ref>
    </session>
    <session>
    <ejb-name>MySessionBeta</ejb-name> <jndi-name>ejb/com/mycorp/MySessionBetaRemoteHome</jndi-name> <local-jndi-name>ejb/com/mycorp/MySessionBetaLocalHome</local-jndi-name>
    <resource-ref>
    <res-ref-name>jdbc/datasource</res-ref-name>
    <jndi-name>java:/Database2</jndi-name>
    </resource-ref>
    </session>

  • Could not lookup PortalManagerHome in the JNDI tree using EJB reference java:comp/env/ejb/PortalManager

    Hi
    I am just a starter on WLPortal.
    I have created a barebone Application from scratch. I have synchronized it properly
    from EBCC to WLP. But When I am trying to access the home page of my application,
    I am getting from stack trace -
    <Nov 6, 2002 5:37:59 PM IST> <Error> <PortalAppflow> <Could not lookup PortalManagerHome
    in the JNDI tree using EJB reference java:comp/env/ejb/PortalManager.
    javax.naming.NameNotFoundException: Unable to resolve comp/env/ejb/PortalManager
    Resolved: 'comp/env' Unresolved:'ejb' ; remaining name 'PortalManager'
    at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:802)
    at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:209)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:173)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:181)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:181)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
    at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:36)
    at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:124)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    at com.bea.p13n.util.JndiHelper.lookupNarrow(JndiHelper.java:96)
    at com.bea.portal.appflow.PortalAppflowHelper.<clinit>(PortalAppflowHelper.java:64)
    at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.init(PortalWebflowServlet.java:78)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:700)
    at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:643)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:588)
    at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:368)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:215)
    at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:112)
    at jsp_servlet.__index._jspService(__index.java:92)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:304)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2459)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    >
    <Nov 6, 2002 5:37:59 PM IST> <Error> <HTTP> <[WebAppServletContext(19695286,FirstWebApp,/FirstWebApp)]
    Servlet failed with Exception
    java.lang.NullPointerException:
    at com.bea.portal.appflow.PortalAppflowHelper.createPortalManager(PortalAppflowHelper.java:82)
    at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.setupPortalRequest(PortalWebflowServlet.java:187)
    at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.doGet(PortalWebflowServlet.java:99)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:215)
    at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:112)
    at jsp_servlet.__index._jspService(__index.java:92)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:304)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2459)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    When I decompiled the class PortalAppflowHelper, I found a static block in it,
    which was as under-
    static
    debug = Debug.getInstance(com.bea.portal.appflow.PortalAppflowHelper.class);
    try
    if(debug.ON)
    debug.out("Looking up PortalManagerHome using EJB reference java:comp/env/ejb/PortalManager");
    portalManagerHome = (PortalManagerHome)JndiHelper.lookupNarrow("java:comp/env/ejb/PortalManager",
    com.bea.portal.manager.ejb.PortalManagerHome.class);
    if(debug.ON)
    debug.out("Successfully retrieved PortalManagerHome " + portalManagerHome);
    catch(Exception e)
    PortalAppflowLogger.errorFindingPortalManagerHome("java:comp/env/ejb/PortalManager",
    e);
    I have checked the PortalManager's JNDI name on WLConsole. Its ${APPNAME}.BEA_portal.PortalManager.
    Should I change it?
    When I tried to change it, I started getting other weird errors.
    Thanks
    Neeraj Hans

    Neeraj -
    The Portal framework code (including PortalAppflowHelper) uses ejb
    references to find the PortalManager (and other EJBs) from servlets and
    taglibs; that is what is signified by the java:comp/env/... name.
    Since you built your webapp from scratch (instead of using the portal
    wizard), you will need to make sure the you have the appropriate
    <ejb-ref> entries in your web.xml, and the corresponding
    <ejb-reference-description> entries in your weblogic.xml. By default,
    you will need at least mappings for:
    - ejb/PortalManager
    - ejb/UserManager
    - ejb/GroupManager
    - ejb/PipelineExecutor
    - ejb/EventService
    See either the resulting webapp from using the portal wizard or
    BEA_HOME/weblogic700/samples/portal/sampleportalDomain/beaApps/sampleportal/sampleportal/WEB-INF
    for example syntax.
    Greg
    Neeraj Hans wrote:
    Hi
    I am just a starter on WLPortal.
    I have created a barebone Application from scratch. I have
    synchronized it properly
    from EBCC to WLP. But When I am trying to access the home page of my
    application,
    I am getting from stack trace -
    <Nov 6, 2002 5:37:59 PM IST> <Error> <PortalAppflow> <Could not lookup
    PortalManagerHome
    in the JNDI tree using EJB reference java:comp/env/ejb/PortalManager.
    javax.naming.NameNotFoundException: Unable to resolve
    comp/env/ejb/PortalManager
    Resolved: 'comp/env' Unresolved:'ejb' ; remaining name 'PortalManager'
    at <stack trace lines snipped>
    When I decompiled the class PortalAppflowHelper, I found a static
    block in it,
    which was as under-
    static
    debug =
    Debug.getInstance(com.bea.portal.appflow.PortalAppflowHelper.class);
    try
    if(debug.ON)
    debug.out("Looking up PortalManagerHome using EJB
    reference java:comp/env/ejb/PortalManager");
    portalManagerHome =
    (PortalManagerHome)JndiHelper.lookupNarrow("java:comp/env/ejb/PortalManager",
    com.bea.portal.manager.ejb.PortalManagerHome.class);
    if(debug.ON)
    debug.out("Successfully retrieved PortalManagerHome "
    + portalManagerHome);
    catch(Exception e)
    PortalAppflowLogger.errorFindingPortalManagerHome("java:comp/env/ejb/PortalManager",
    e);
    I have checked the PortalManager's JNDI name on WLConsole. Its
    ${APPNAME}.BEA_portal.PortalManager.
    Should I change it?
    When I tried to change it, I started getting other weird errors.
    Thanks
    Neeraj Hans

  • Error while running EJB from java client on JBOSS

    Hi
    As i am new to EJB i have created a helloworld application in ejb which is working fine when i try to call it from servlet but when i try to invoke the same ejb from java client (i.e from diff jvm) on jboss i got the following error:
    javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]]
         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1399)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at com.gl.TestClient.main(TestClient.java:39)
    Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:254)
         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370)
         ... 4 more
    Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:228)
         ... 5 more
    Caused by: java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
         at java.net.Socket.connect(Socket.java:519)
         at java.net.Socket.connect(Socket.java:469)
         at java.net.Socket.<init>(Socket.java:366)
         at java.net.Socket.<init>(Socket.java:266)
         at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
         at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:224)
         ... 5 more
    Following is my code:
    Home Interface:
    package com.gl;
    import javax.ejb.CreateException;
    public interface testHome extends EJBHome {
         String JNDI_NAME = "testBean";
         public     test create()
         throws java.rmi.RemoteException,CreateException;
    Remote Interface:
    package com.gl;
    import java.rmi.RemoteException;
    import javax.ejb.EJBObject;
    public interface test extends EJBObject {
         public String welcomeMessage() throws RemoteException;
    Bean:
    package com.gl;
    import java.rmi.RemoteException;
    import javax.ejb.EJBException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class testbean implements SessionBean {
         public void ejbActivate() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void ejbPassivate() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void ejbRemove() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void setSessionContext(SessionContext arg0) throws EJBException,
                   RemoteException {
              // TODO Auto-generated method stub
         public void ejbCreate(){}
         public String welcomeMessage(){
              return "Welcome to the World of EJB";
    ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>testBean</ejb-name>
    <home>com.gl.testHome</home>
    <remote>com.gl.test</remote>
    <ejb-class>com.gl.testbean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    jboss.xml:
    <?xml version='1.0' ?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
    <jboss>
    <enterprise-beans>
    <entity>
    <ejb-name>testBean</ejb-name>
    <jndi-name>testBean</jndi-name>
    </entity>
    </enterprise-beans>
    </jboss>
    Client code:
    package com.gl;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    public class TestClient {
         public static void main(String[] args) throws Exception{
                   try{
                   /*     Properties props=new Properties();
                        props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                        props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
                        props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
                   Properties props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,
    "org.jnp.interfaces.NamingContextFactory");
    props.put(Context.PROVIDER_URL, "localhost:1099");
                        System.out.println("Properties ok");
                        //env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
                        //env.put(Context.PROVIDER_URL,"http://localhost:8080");
                        //env.put(Context.SECURITY_PRINCIPAL, "");
                        //env.put(Context.SECURITY_CREDENTIALS, "");
                        Context ctx=new InitialContext(props);
                        System.out.println("context ok");
                        //testHome home = (testHome)ctx.lookup("testBean");
                        Object obj = ctx.lookup ("testBean");
                        System.out.println("ojb = " + obj);
                        testHome ejbHome = (testHome)PortableRemoteObject.narrow(obj,testHome.class);
                   test ejbObject = ejbHome.create();
                   String message = ejbObject.welcomeMessage();
                        System.out.println("home ok");
                        System.out.println("remote ok");
                        System.out.println(message);
                        catch(Exception e){e.printStackTrace();}
    I am able to successfully deployed my ejb on JBOSS but i m getting above error when i am trying to invoke ejb from java client.
    kindly suggest me something to solve this issue.
    Regards
    Gagan
    Edited by: Gagan2914 on Aug 26, 2008 3:28 AM

    Is it a remote lookup? Then maybe this will help:
    [http://wiki.jboss.org/wiki/JBoss42FAQ]
    - Roy

  • Oracle Application Server 10.1.3 EJB Deployment Error

    Hi ,
    I am keep getting following error when try to deploy my ear files in 10.1.3. standalone env.
    my ejb-jar.xml looks is
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <session>
    <description>Session Facade Bean ( Stateless )</description>
    <display-name>FacadeBean</display-name>
    <ejb-name>FacadeBean</ejb-name>
    <home>com.sjrwmd.dmsap.ejb.FacadeBeanHome</home>
    <remote>com.sjrwmd.dmsap.ejb.FacadeBeanRemote</remote>
    <ejb-class>com.sjrwmd.dmsap.ejb.FacadeBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>FacadeBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    Your help appriciated
    Thank You
    Jigar
    2006-02-08 17:13:40.670 NOTIFICATION JMS Router is initiating ...
    2006-02-08 17:13:55.702 NOTIFICATION Application Deployer for dmsap STARTS.
    2006-02-08 17:13:55.733 NOTIFICATION Copy the archive to C:\JDev1013\j2ee\home\applications\dmsap.ear
    2006-02-08 17:13:55.733 NOTIFICATION Initialize ./applications\dmsap.ear begins...
    2006-02-08 17:13:55.733 NOTIFICATION Removing everything under: C:\JDev1013\j2ee\home\.\applications\dmsap
    2006-02-08 17:13:55.733 NOTIFICATION Auto-unpacking C:\JDev1013\j2ee\home\.\applications\dmsap.ear...
    2006-02-08 17:13:55.733 NOTIFICATION Unpacking dmsap.ear
    2006-02-08 17:13:55.733 NOTIFICATION Unjar C:\JDev1013\j2ee\home\.\applications\dmsap.ear in C:\JDev1013\j2ee\home\.\applications\dmsap
    2006-02-08 17:13:55.998 NOTIFICATION Done unpacking dmsap.ear
    2006-02-08 17:13:55.998 NOTIFICATION Finished auto-unpacking C:\JDev1013\j2ee\home\.\applications\dmsap.ear
    2006-02-08 17:13:56.045 NOTIFICATION Auto-unpacking C:\JDev1013\j2ee\home\applications\dmsap\dmsap-web.war...
    2006-02-08 17:13:56.045 NOTIFICATION Unpacking dmsap-web.war
    2006-02-08 17:13:56.045 NOTIFICATION Unjar C:\JDev1013\j2ee\home\applications\dmsap\dmsap-web.war in C:\JDev1013\j2ee\home\applications\dmsap\dmsap-web
    2006-02-08 17:13:56.498 NOTIFICATION Done unpacking dmsap-web.war
    2006-02-08 17:13:56.498 NOTIFICATION Finished auto-unpacking C:\JDev1013\j2ee\home\applications\dmsap\dmsap-web.war
    2006-02-08 17:13:56.498 NOTIFICATION Auto-unpacking C:\JDev1013\j2ee\home\applications\dmsap\uploaddirapp.jar...
    2006-02-08 17:13:56.498 NOTIFICATION Unpacking uploaddirapp.jar
    2006-02-08 17:13:56.498 NOTIFICATION Unjar C:\JDev1013\j2ee\home\applications\dmsap\uploaddirapp.jar in C:\JDev1013\j2ee\home\applications\dmsap\uploaddirapp
    2006-02-08 17:13:56.748 NOTIFICATION Done unpacking uploaddirapp.jar
    2006-02-08 17:13:56.748 NOTIFICATION Finished auto-unpacking C:\JDev1013\j2ee\home\applications\dmsap\uploaddirapp.jar
    2006-02-08 17:13:56.748 NOTIFICATION Auto-unpacking C:\JDev1013\j2ee\home\applications\dmsap\downloadfileapp.jar...
    2006-02-08 17:13:56.764 NOTIFICATION Unpacking downloadfileapp.jar
    2006-02-08 17:13:56.764 NOTIFICATION Unjar C:\JDev1013\j2ee\home\applications\dmsap\downloadfileapp.jar in C:\JDev1013\j2ee\home\applications\dmsap\downloadfileapp
    2006-02-08 17:13:56.967 NOTIFICATION Done unpacking downloadfileapp.jar
    2006-02-08 17:13:56.967 NOTIFICATION Finished auto-unpacking C:\JDev1013\j2ee\home\applications\dmsap\downloadfileapp.jar
    2006-02-08 17:13:56.983 NOTIFICATION Initialize ./applications\dmsap.ear ends...
    2006-02-08 17:13:56.983 NOTIFICATION Starting application : dmsap
    2006-02-08 17:13:56.983 NOTIFICATION Initializing ClassLoader(s)
    2006-02-08 17:13:56.983 NOTIFICATION Initializing EJB container
    2006-02-08 17:13:56.983 NOTIFICATION Loading connector(s)
    2006-02-08 17:13:57.295 NOTIFICATION Starting up resource adapters
    2006-02-08 17:13:57.295 NOTIFICATION Processing EJB module: dmsap-ejb.jar
    2006-02-08 17:13:57.405 ERROR J2EE EJB3027 [dmsap] An error occured deploying EJB module: com.evermind.server.ejb.deployment.InvalidEJBAssemblyException: [dmsap:dmsap-ejb:FacadeBean] - Unable to load ejb-class com.sjrwmd.dmsap.ejb.FacadeBean, see section 23.2 of the EJB 2.1 specificationoracle.classloader.util.AnnotatedClassFormatError: com.sjrwmd.dmsap.ejb.FacadeBean
         Invalid class: com.sjrwmd.dmsap.ejb.FacadeBean
         Loader: dmsap.root:0.0.0
         Code-Source: /C:/JDev1013/j2ee/home/applications/dmsap/dmsap-ejb.jar
         Configuration: <ejb> in C:\JDev1013\j2ee\home\applications\dmsap
         Dependent class: com.evermind.server.ejb.deployment.BeanDescriptor
         Loader: oc4j:10.1.3
         Code-Source: /C:/JDev1013/j2ee/home/lib/oc4j-internal.jar
         Configuration: <code-source> in META-INF/boot.xml in C:\JDev1013\j2ee\home\oc4j.jar
    2006-02-08 17:13:57.405 NOTIFICATION application : dmsap is in failed state
    Feb 8, 2006 5:13:57 PM com.evermind.server.Application setConfig
    WARNING: Application: dmsap is in failed state as initialization failedjava.lang.InstantiationException: Error initializing ejb-modules: [dmsap:dmsap-ejb:FacadeBean] - Unable to load ejb-class com.sjrwmd.dmsap.ejb.FacadeBean, see section 23.2 of the EJB 2.1 specificationoracle.classloader.util.AnnotatedClassFormatError: com.sjrwmd.dmsap.ejb.FacadeBean
         Invalid class: com.sjrwmd.dmsap.ejb.FacadeBean
         Loader: dmsap.root:0.0.0
         Code-Source: /C:/JDev1013/j2ee/home/applications/dmsap/dmsap-ejb.jar
         Configuration: <ejb> in C:\JDev1013\j2ee\home\applications\dmsap
         Dependent class: com.evermind.server.ejb.deployment.BeanDescriptor
         Loader: oc4j:10.1.3
         Code-Source: /C:/JDev1013/j2ee/home/lib/oc4j-internal.jar
         Configuration: <code-source> in META-INF/boot.xml in C:\JDev1013\j2ee\home\oc4j.jar
    06/02/08 17:13:57 oracle.oc4j.admin.internal.DeployerException: java.lang.InstantiationException: Error initializing ejb-modules: [dmsap:dmsap-ejb:FacadeBean] - Unable to load ejb-class com.sjrwmd.dmsap.ejb.FacadeBean, see section 23.2 of the EJB 2.1 specificationoracle.classloader.util.AnnotatedClassFormatError: com.sjrwmd.dmsap.ejb.FacadeBean
         Invalid class: com.sjrwmd.dmsap.ejb.FacadeBean
         Loader: dmsap.root:0.0.0
         Code-Source: /C:/JDev1013/j2ee/home/applications/dmsap/dmsap-ejb.jar
         Configuration: <ejb> in C:\JDev1013\j2ee\home\applications\dmsap
         Dependent class: com.evermind.server.ejb.deployment.BeanDescriptor
         Loader: oc4j:10.1.3
         Code-Source: /C:/JDev1013/j2ee/home/lib/oc4j-internal.jar
         Configuration: <code-source> in META-INF/boot.xml in C:\JDev1013\j2ee\home\oc4j.jar
    06/02/08 17:13:57      at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:510)
    06/02/08 17:13:57      at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:191)
    06/02/08 17:13:57      at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
    06/02/08 17:13:57      at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
    06/02/08 17:13:57      at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
    06/02/08 17:13:57      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
    06/02/08 17:13:57      at java.lang.Thread.run(Thread.java:534)
    06/02/08 17:13:57 Caused by: java.lang.InstantiationException: Error initializing ejb-modules: [dmsap:dmsap-ejb:FacadeBean] - Unable to load ejb-class com.sjrwmd.dmsap.ejb.FacadeBean, see section 23.2 of the EJB 2.1 specificationoracle.classloader.util.AnnotatedClassFormatError: com.sjrwmd.dmsap.ejb.FacadeBean
         Invalid class: com.sjrwmd.dmsap.ejb.FacadeBean
         Loader: dmsap.root:0.0.0
         Code-Source: /C:/JDev1013/j2ee/home/applications/dmsap/dmsap-ejb.jar
         Configuration: <ejb> in C:\JDev1013\j2ee\home\applications\dmsap
         Dependent class: com.evermind.server.ejb.deployment.BeanDescriptor
         Loader: oc4j:10.1.3
         Code-Source: /C:/JDev1013/j2ee/home/lib/oc4j-internal.jar
         Configuration: <code-source> in META-INF/boot.xml in C:\JDev1013\j2ee\home\oc4j.jar
    06/02/08 17:13:57      at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:1056)
    06/02/08 17:13:57      at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:210)
    06/02/08 17:13:57      at com.evermind.server.Application.setConfig(Application.java:391)
    06/02/08 17:13:57      at com.evermind.server.Application.setConfig(Application.java:308)
    06/02/08 17:13:57      at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1771)
    06/02/08 17:13:57      at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:507)
    06/02/08 17:13:57      ... 6 more
    06/02/08 17:13:57 Caused by: com.evermind.server.ejb.deployment.InvalidEJBAssemblyException: [dmsap:dmsap-ejb:FacadeBean] - Unable to load ejb-class com.sjrwmd.dmsap.ejb.FacadeBean, see section 23.2 of the EJB 2.1 specificationoracle.classloader.util.AnnotatedClassFormatError: com.sjrwmd.dmsap.ejb.FacadeBean
         Invalid class: com.sjrwmd.dmsap.ejb.FacadeBean
         Loader: dmsap.root:0.0.0
         Code-Source: /C:/JDev1013/j2ee/home/applications/dmsap/dmsap-ejb.jar
         Configuration: <ejb> in C:\JDev1013\j2ee\home\applications\dmsap
         Dependent class: com.evermind.server.ejb.deployment.BeanDescriptor
         Loader: oc4j:10.1.3
         Code-Source: /C:/JDev1013/j2ee/home/lib/oc4j-internal.jar
         Configuration: <code-source> in META-INF/boot.xml in C:\JDev1013\j2ee\home\oc4j.jar
    06/02/08 17:13:57      at com.evermind.server.ejb.exception.ValidationExceptions.unableToLoadEJBClass(ValidationExceptions.java:36)
    06/02/08 17:13:57      at com.evermind.server.ejb.deployment.BeanDescriptor.initialize(BeanDescriptor.java:298)
    06/02/08 17:13:57      at com.evermind.server.ejb.deployment.ExposableBeanDescriptor.initialize(ExposableBeanDescriptor.java:158)
    06/02/08 17:13:57      at com.evermind.server.ejb.deployment.SessionBeanDescriptor.initialize(SessionBeanDescriptor.java:190)
    06/02/08 17:13:57      at com.evermind.server.ejb.deployment.EJBPackage.initialize(EJBPackage.java:814)
    06/02/08 17:13:57      at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:855)
    06/02/08 17:13:57      ... 11 more
    06/02/08 17:13:57 Caused by: oracle.classloader.util.AnnotatedClassFormatError: com.sjrwmd.dmsap.ejb.FacadeBean
         Invalid class: com.sjrwmd.dmsap.ejb.FacadeBean
         Loader: dmsap.root:0.0.0
         Code-Source: /C:/JDev1013/j2ee/home/applications/dmsap/dmsap-ejb.jar
         Configuration: <ejb> in C:\JDev1013\j2ee\home\applications\dmsap
         Dependent class: com.evermind.server.ejb.deployment.BeanDescriptor
         Loader: oc4j:10.1.3
         Code-Source: /C:/JDev1013/j2ee/home/lib/oc4j-internal.jar
         Configuration: <code-source> in META-INF/boot.xml in C:\JDev1013\j2ee\home\oc4j.jar
    06/02/08 17:13:57      at oracle.classloader.PolicyClassLoader.defineClass(PolicyClassLoader.java:2268)
    06/02/08 17:13:57      at oracle.classloader.PolicyClassLoader.findLocalClass(PolicyClassLoader.java:1457)
    06/02/08 17:13:57      at oracle.classloader.SearchPolicy$FindLocal.getClass(SearchPolicy.java:167)
    06/02/08 17:13:57      at oracle.classloader.SearchSequence.getClass(SearchSequence.java:119)
    06/02/08 17:13:57      at oracle.classloader.PolicyClassLoader.internalLoadClass(PolicyClassLoader.java:1660)
    06/02/08 17:13:57      at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1621)
    06/02/08 17:13:57      at oracle.classloader.PolicyClassLoader.loadClass(PolicyClassLoader.java:1606)
    06/02/08 17:13:57      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    06/02/08 17:13:57      at java.lang.Class.forName0(Native Method)
    06/02/08 17:13:57      at java.lang.Class.forName(Class.java:219)
    06/02/08 17:13:57      at com.evermind.server.ejb.deployment.BeanDescriptor.initialize(BeanDescriptor.java:296)
    06/02/08 17:13:57      ... 15 more
    06/02/08 17:13:57 Caused by: java.lang.UnsupportedClassVersionError: com.sjrwmd.dmsap.ejb.FacadeBean
    06/02/08 17:13:57      at java.lang.ClassLoader.defineClass0(Native Method)
    06/02/08 17:13:57      at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
    06/02/08 17:13:57      at oracle.classloader.PolicyClassLoader.defineClass(PolicyClassLoader.java:2224)
    06/02/08 17:13:57      ... 25 more
    2006-02-08 17:13:57.545 NOTIFICATION Application Deployer for dmsap FAILED.
    2006-02-08 17:13:57.545 NOTIFICATION Application UnDeployer for dmsap STARTS.
    2006-02-08 17:13:59.045 NOTIFICATION Removing all web binding(s) for application dmsap from all web site(s)
    2006-02-08 17:13:59.795 NOTIFICATION Application UnDeployer for dmsap COMPLETES.
    2006-02-08 17:13:59.795 WARNING java.lang.InstantiationException: Error initializing ejb-modules: [dmsap:dmsap-ejb:FacadeBean] - Unable to load ejb-class com.sjrwmd.dmsap.ejb.FacadeBean, see section 23.2 of the EJB 2.1 specificationoracle.classloader.util.AnnotatedClassFormatError: com.sjrwmd.dmsap.ejb.FacadeBean
         Invalid class: com.sjrwmd.dmsap.ejb.FacadeBean
         Loader: dmsap.root:0.0.0
         Code-Source: /C:/JDev1013/j2ee/home/applications/dmsap/dmsap-ejb.jar
         Configuration: <ejb> in C:\JDev1013\j2ee\home\applications\dmsap
         Dependent class: com.evermind.server.ejb.deployment.BeanDescriptor
         Loader: oc4j:10.1.3
         Code-Source: /C:/JDev1013/j2ee/home/lib/oc4j-internal.jar
         Configuration: <code-source> in META-INF/boot.xml in C:\JDev1013\j2ee\home\oc4j.jar

    A point of clarification: Using JDK 1.5, it compiles and "tries" to start, but then gives this error : Unable to load ejb-class com.MyTestEJB see section 23.2 of the EJB 2.1 specificationjava.lang.ExceptionInInitializerError: java.lang.NullPointerException
    There are other EJB which are deploying fine.
    I really can't tell why one is deploying but this one is not.
    Thanks

  • EJB 3.0 Constraints Problem

    Hi everybody !
    Hope someone can help me !! Im really go crazy with this stuff :s...
    Im Using jdeveloper .... I have 2 Entity Bean called Jiverating and Jiveuser, I creadte them using "Create Entity Bean from Table".... also a Session Bean called ForumFacadeBean I created using a EJB diagram as EJB Sesion Bean ....
    I can execute query without any problem but when I want to sotre a new Jiverating the aplication thows an exception... I just call the following metold of ForumFacadeBean
    public Jiverating persistJiverating(Jiverating jiverating) {   
    em.persist(jiverating);
    return jiverating;
    The exception I got is:
    <Jan 13, 2012 8:42:48 PM PET> <Warning> <EclipseLink> <BEA-2005000> <2012-01-13 20:42:48.125--UnitOfWork(317933487)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    Error Code: 2091
    Call: INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (?, ?, ?, ?)
         bind => [2, 0, 2, 11]
    Query: InsertObjectQuery(pe.com.bcts.gart.ejb.entities.Jiverating@12f3242c)>
    <Jan 13, 2012 8:42:48 PM PET> <Warning> <EclipseLink> <BEA-2005000> <2012-01-13 20:42:48.126--UnitOfWork(317933487)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    Error Code: 2091
    Call: INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (?, ?, ?, ?)
         bind => [2, 0, 2, 11]
    Query: InsertObjectQuery(pe.com.bcts.gart.ejb.entities.Jiverating@12f3242c)>
    <Jan 13, 2012 8:42:48 PM PET> <Error> <EJB> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB pe.com.gart.ejb.entities.ForumFacadeBean.persistJiverating(pe.com.bcts.gart.ejb.entities.Jiverating)],Xid=BEA1-001B5FB5B4DB06A00B5F(317932956),Status=Rolled back. [Reason=Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    Error Code: 2091
    Call: INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (?, ?, ?, ?)
         bind => [2, 0, 2, 11]
    Query: InsertObjectQuery(pe.com.bcts.gart.ejb.entities.Jiverating@12f3242c)],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds left=30,SCInfo[osinergminWebPortalDesa+WC_Spaces]=(state=rolledback),properties=({weblogic.transaction.name=[EJB pe.com.gart.ejb.entities.ForumFacadeBean.persistJiverating(pe.com.bcts.gart.ejb.entities.Jiverating)]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=WC_Spaces+192.168.101.124:9000+osinergminWebPortalDesa+t3+, XAResources={WSATGatewayRM_WC_Spaces_osinergminWebPortalDesa, CustomPortalServicesEJB@Portal@Portal_osinergminWebPortalDesa, webapp@Portal@Portal_osinergminWebPortalDesa},NonXAResources={})],CoordinatorURL=WC_Spaces+192.168.101.124:9000+osinergminWebPortalDesa+t3+): weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion: sync=[email protected]f34805
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    Error Code: 2091
    Call: INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (?, ?, ?, ?)
    *     bind => [2, 0, 2, 11]*Query: InsertObjectQuery(pe.com.bcts.gart.ejb.entities.Jiverating@12f3242c)
         at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1881)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:345)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:240)
         at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:627)
         at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:49)
         at weblogic.ejb.container.internal.BaseRemoteObject.__WL_postInvokeTxRetry(BaseRemoteObject.java:444)
         at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:53)
         at pe.com.gart.ejb.entities.ForumFacade_xgr9io_ForumFacadeImpl.persistJiverating(Unknown Source)
         at pe.com.gart.ejb.entities.ForumFacade_xgr9io_ForumFacadeImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:345)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
         at pe.com.gart.ejb.entities.ForumFacade_xgr9io_ForumFacadeImpl_1035_WLStub.persistJiverating(Unknown Source)
         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:597)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
         at $Proxy247.persistJiverating(Unknown Source)
         at customdiscussions.backing.AddRating.<init>(AddRating.java:51)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at java.lang.Class.newInstance0(Class.java:355)
         at java.lang.Class.newInstance(Class.java:308)
         at oracle.adfinternal.controller.beans.ManagedBeanFactory.newInstance(ManagedBeanFactory.java:187)
         at oracle.adfinternal.controller.beans.ManagedBeanFactory.instantiateBean(ManagedBeanFactory.java:874)
         at oracle.adfinternal.controller.state.ScopeMap.get(ScopeMap.java:83)
         at javax.el.MapELResolver.getValue(MapELResolver.java:164)
         at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:173)
         at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:200)
         at com.sun.el.parser.AstValue.getValue(Unknown Source)
         at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:250)
         at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
         at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:513)
         at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:782)
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1354)
         at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:75)
         at oracle.adfinternal.view.faces.unified.taglib.UnifiedDocumentTag.doStartTag(UnifiedDocumentTag.java:50)
         at jsp_servlet.__addrating_jspx._jspx___tag1(__addrating_jspx.java:154)
         at jsp_servlet.__addrating_jspx._jspx___tag0(__addrating_jspx.java:113)
         at jsp_servlet.__addrating_jspx._jspService(__addrating_jspx.java:74)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:35)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:417)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:326)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
         at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:523)
         at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at oracle.adfinternal.view.faces.config.rich.RecordRequestAttributesDuringDispatch.dispatch(RecordRequestAttributesDuringDispatch.java:45)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:45)
         at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$OverrideDispatch.dispatch(FacesContextFactoryImpl.java:268)
         at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:471)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
         at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:191)
         at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:800)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:294)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:214)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransactionRollbackException: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not found
    I dont underestand this error beacuse when I execute INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (2, 0, 2, 11) directly on the database I got no error !
    please help me !!!!!

    ORA-02291: integrity constraint (DEV_DISCUSSIONS.JIVERATE_SCR_FK) violated - parent key not foundWell it is a database constraint, so it is the database that is blocking the insertion of the record.
    I dont underestand this error beacuse when I execute INSERT INTO JIVERATING (SCORE, OBJECTTYPE, USERID, OBJECTID) VALUES (2, 0, 2, 11) directly on the database I got no error !And did you actually attempt to -commit- the transaction? If you did then I can only conclude one thing: you are using two different databases. One has a constraint, the other does not. Constraints do not magically appear out of thin air, especially ones that generate an ORA error.

  • EJB 3.0 EntityManager null on JBoss 4.2

    Hi ,
    I am developing an application in EBJ 3.0.
    My application is properly deployed on JBoss 4.2 application server but when I am trying to persist data I am getting EntityManaget always null.
    My Mail Id is : [email protected]
    following is my code Please help me...........
    My datasource for oracle
    D:\jboss-4.2.2.GA\server\default\deploy\oracle-ds.xml
    <datasources>
    <local-tx-datasource>
    <jndi-name>OracleDS</jndi-name>
    <connection-url>jdbc:oracle:thin:@serverIp:1521:SID</connection-url>
    <!--
    Here are a couple of the possible OCI configurations.
    For more information, see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/toc.htm
    <connection-url>jdbc:oracle:oci:@youroracle-tns-name</connection-url>
    or
    <connection-url>jdbc:oracle:oci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</connection-url>
    Clearly, its better to have TNS set up properly.
    -->
    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <user-name>V2RND</user-name>
    <password>V2RND</password>
    <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
    <!-- Checks the Oracle error codes and messages for fatal errors -->
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
    <!-- sql to call when connection is created
    <new-connection-sql>some arbitrary sql</new-connection-sql>
    -->
    <!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
    <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
    -->
    <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
    <metadata>
    <type-mapping>Oracle9i</type-mapping>
    </metadata>
    </local-tx-datasource>
    </datasources>
    Entity Bean
    com.ntpl.v2hralign.master.entity.Department
    package com.ntpl.v2hralign.master.entity;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import javax.persistence.Table;
    @Entity
    @Table(name="MASTER_DEPARTMENT")
    public class Department implements Serializable {
    @Id
    @Column(name="DEPT_ID")
    private int deptId;
    @Column(name="DEPT_NAME")
    private String deptName;
    private static final long serialVersionUID = 1L;
    public Department() {
    super();
    public int getDeptId() {
    return this.deptId;
    public void setDeptId(int deptId) {
    this.deptId = deptId;
    public String getDeptName() {
    return this.deptName;
    public void setDeptName(String deptName) {
    this.deptName = deptName;
    Remote Interface
    package com.ntpl.v2hralign.master.session;
    import javax.ejb.Remote;
    @Remote
    public interface DepartmentRemote {
    public void createDepartment(int deptId, String deptName);
    package com.ntpl.v2hralign.master.session;
    import javax.annotation.Resource;
    import javax.ejb.Stateless;
    import javax.naming.InitialContext;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.Persistence;
    import javax.persistence.PersistenceContext;
    import javax.persistence.PersistenceContextType;
    import org.hibernate.mapping.Component;
    import org.jboss.aspects.Injected;
    import com.ntpl.v2hralign.master.entity.Department;
    @Stateless
    public class DepartmentSession implements DepartmentRemote {
    @PersistenceContext EntityManager entityManager;
    //@Injected protected EntityManager entityManager;
    /*EntityManagerFactory emf = Persistence.createEntityManagerFactory("V2HRAlign");
    EntityManager entityManager = emf.createEntityManager();*/
    /*protected EntityManager entityManager;
    public EntityManager getEntityManager() {
    if (entityManager == null){
    try{
    System.out.println("hi dear not yet get anaything");
    entityManager = (EntityManager)(new InitialContext()).lookup("java:comp/ejb/EntityManager");
    } catch (Exception e){};
    return entityManager;
    @Override
    public void createDepartment(int deptId, String deptName) {
    //entityManager = getEntityManager();
    Department department = new Department();
    department.setDeptId(deptId);
    department.setDeptName(deptName);
    System.out.println("entityManager="+entityManager);
    entityManager.persist(department);
    persistence.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
    <persistence-unit name="V2HRAlign">
    <jta-data-source>java:/OracleDS</jta-data-source>
    <class>com.ntpl.v2hralign.master.entity.Department</class>
    <properties>
    <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect"/>
    <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
    <property name="hibernate.hbm2ddl.auto" value="create"/>
    <property name="hibernate.show_sql" value="true" />
    </properties>
    </persistence-unit>
    </persistence>
    Client Program
    package com.ntpl.v2hralignclient.master.client;
    import javax.ejb.EJB;
    import com.ntpl.v2hralign.master.session.DepartmentRemote;
    import com.ntpl.v2hralign.master.session.DepartmentSession;
    public class DepartmentClient {
    * @param args
    @EJB
    public static DepartmentRemote department = new DepartmentSession();
    public static void main(String[] args) {
    department.createDepartment(1, "Software");
    Error -------------------------------
    entityManager=null
    Exception in thread "main" java.lang.NullPointerException
    at com.ntpl.v2hralign.master.session.DepartmentSession.createDepartment(DepartmentSession.java:54)
    at com.ntpl.v2hralignclient.master.client.DepartmentClient.main(DepartmentClient.java:20)
    ---------------------------------------------------------------------------------------------------------------------------------------

    the problem is in your client code. you are instantiating the EJB locally. that is not what you want. you should be looking up the remote ejb using a Context object. look for information on setting up a client program to contact jboss using jndi.

  • I can't lookup EJB (3.0) in WebLogic 12 using ENC

    I have a simple application divided in 2 modules:
    HolaMundo - Servlet component
    SimpleEJB - EJB Component
    The EJB Component use EJB 3.0. I created a local business interface with one method. A stateless EJB that implement that interface. And I use the ejb-jar.xml for declare it.
    And a Servlet that use the EJB.
    In Glassfish or Tomee this way for working with EJB works, but i don't understand why it doesn't work in WebLogic 12...
    When i try to access to the servlet, i get an error. this is the error:
    javax.naming.NameNotFoundException: While trying to look up /app/SimpleEJB/Example!com.edwin.ejb.ExampleLocal in /app/webapp/HolaMundo.war/1051995086.; remaining name '/app/SimpleEJB/Example!com/edwin/ejb/ExampleLocal'
      at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1180)
      at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:146)
    Servlet:
    package servlet;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import com.edwin.ejb.ExampleLocal;
    public class EJB extends HttpServlet {
       private static final long serialVersionUID = 1L;
       @Override
       protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1)
       throws ServletException, IOException {
       PrintWriter out = arg1.getWriter();
       ExampleLocal el2;
       try {
      el2 = (ExampleLocal) new InitialContext()
       .lookup("java:app/SimpleEJB/Example!com.edwin.ejb.ExampleLocal");
       out.println("EJBBBB: " + el2.nombre());
       } catch (NamingException e) {
      e.printStackTrace();
    Local business interface:
    package com.edwin.ejb;
    public interface ExampleLocal {
        public String nombre();
    EJB Stateless:
    package com.edwin.ejb;
    public class Example implements ExampleLocal{
        @Override
        public String nombre() {
            return "Edwin";
    ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
      <display-name>SimpleEJB </display-name>
      <enterprise-beans>
        <session>
            <ejb-name>Example</ejb-name>
            <business-local>com.edwin.ejb.ExampleLocal</business-local>
            <ejb-class>com.edwin.ejb.Example</ejb-class>
            <session-type>Stateless</session-type>
        </session>
      </enterprise-beans>
    </ejb-jar>

    Both answers did not work. I do not understand why it did not work because in other Java EE Servers it works.
    My JNDI Tree (Screenshot):
    http://oi58.tinypic.com/vs1jjd.jpg
    However, i could get the EJB when i use the Global ENC, but i got a Casting Exception...
    Eg:
    try {
      ej = (EjLocal) new InitialContext().lookup("java:global.EjemploEJB.Ej!stateless.EjLocal");
      out.print("EJ: "+ej.ej());
    } catch (NamingException e) {
      e.printStackTrace();
    Output:
    java.lang.ClassCastException: stateless.Ej_1aafe_EjLocalImpl cannot be cast to stateless.EjLocal
    at servlet.Ejemplo.doGet(Ejemplo.java:33)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731).....
    There is a strange value in the EJB's JNDI Tree:
    Header 1
    Header 2
    Binding Name:
    java:global.EjemploEJB.Ej!stateless.EjLocal
    Class:
    stateless.Ej_1aafe_EjLocalImpl
    Hash Code:
    2021087981
    toString Results:
    stateless.Ej_1aafe_EjLocalImpl@78775aed

  • EJB 3.0 Bean name

    Is there a way that we can override the EJB 3.0 Bean name in the deployment descriptor? I know we can provide the name in the Annotation via @MessageDriven(name="bar").
    For example, if I have the following Bean,
    package com.example;
    @MessageDriven
    public class Foo implements MessageListener {
    When deployed, it always deploys as Foo, even if I have the following in my ejb-jar.xml and weblogic-ejb-jar.xml:
    <mesage-driven>
    <ejb-name>Bar</ejb-name>
    <ejb-class>com.example.Foo</ejb-class>
    <destination-type>javax.jms.Topic</destination-type>
    <subscription-durablility>Durable</subscription-durablity>
    </message-driven>
    <mesage-driven>
    <ejb-name>Baz<r</ejb-name>
    <ejb-class>com.example.Foo</ejb-class>
    <destination-type>javax.jms.Queue</destination-type>
    </message-driven>
    There seems no way I can re-use the Same bean class with EJB 3.0 if I needed to. If there is anyway, the ejb-name can be used please let me know.
    Thanks

    Hi,
    For a JEE5 EJB module, rather than using EJBGen, you can use WLS specific annotations for configuring common settings. If you follow the link below, you can see a list of supported EJB annotations. Disregard the fact that the documentation section title is WebLogic Kodo Annotations. That is incorrect and I've filed a bug for it.
    http://edocs.bea.com/wls/docs103/ejb30/annotations.html#wp1438036.
    Unfortunately, we don't yet support setting all weblogic-ejb-jar.xml configuration values via annoations so in some cases a weblogic-ejb-jar.xml is still required.
    You can hand edit your weblogic-ejb-jar.xml and the example you posted below should work fine.
    - Matt

  • How to get remote ejb client working with Weblogic 8.1?

    I have Weblogic 8.1 running on a WinXP box behind my firewall. Port 7001 is open to WL and remote browsers can access the console.
    I have a client machine running WinXP on a different network that is remote to the WL server. It can ping the WL server machine.
    I use JVM 1.4.2_08 on all machines.
    If I put my client machine on the LAN with the WL server, then my EJB test client works fine. If I put the client machine on the remote network then the test client fails with a ClassCastException when trying to do a PortableRemoteObject.narrow on the bean home.
    I had this running fine on JBoss 3.22 using RMI over HTTP. I added an HTTP invoker service to my jboss.xml file. I don't know if something similar is needed on the Weblogic side - any ideas on that? All I've done on the WL side is turn on Tunneling - which obviously works because the remote client gets a correct home object when doing a lookup on the bean - based on the IOR string of the home obj.
    Below I include my client code, exception, ejb-jar.xml and my weblogic-ejb-jar.xml.
    Any ideas on what else needs to be done so that a remote client can do a PortableRemoteObject.narrow? My client.jar has all of the EJB classes, and runs fine when run from LAN.
    Thanks,
    --BobC
    Client Code
    Properties p = new Properties();
    p.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");
    p.put("java.naming.provider.url", "http://66.114.140.213:7001");
    InitialContext ic = new InitialContext(p);
    // Test register bean
    Object homeObj = ic.lookup("tacplanner/register");
    RegisterHome home = (RegisterHome) PortableRemoteObject.narrow(homeObj, RegisterHome.class); // <<< ClassCastException here
    Exception
    java.lang.ClassCastException
    at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
    at com.nimblus.tacplanner.test.TestUtils.<init>(TestUtils.java:60)
    at com.nimblus.tacplanner.test.TestUtils.main(TestUtils.java:196)
    ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>register</ejb-name>
    <home> com.nimblus.tacplanner.server.ejb.stateless.RegisterHome</home>
    <remote> com.nimblus.tacplanner.server.ejb.stateless.Register</remote>
    <ejb-class>com.nimblus.tacplanner.server.ejb.stateless.RegisterSession</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <resource-ref>
    <description>The Oracle Datasource</description>
    <res-ref-name>java:/OracleDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>register</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </ejb-jar>
    weblogic-ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC
    '-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN'
    'http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>register</ejb-name>
    <stateless-session-descriptor>
    <pool>
    <max-beans-in-free-pool>100</max-beans-in-free-pool>
    </pool>
    </stateless-session-descriptor>
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jdbc/OracleDS</res-ref-name>
    <jndi-name>OracleDS</jndi-name>
    </resource-description>
    </reference-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    <jndi-name>tacplanner/register</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    --------------------

    Problem solved.
    For remote clients you need to generate and use the stub classes for EJB interfaces using Weblogic's appc utility.
    See: "http://e-docs.bea.com/wls/docs81/ejb/appc_ejbc.html#1151900"
    --BobC                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to use alternative sql statements in ejb 2.0

    hi
    i have written the alternative sql statement in persistence.xml like  "select max(modifieddate) from tmp_dlv_mgmt".
    i am getting the error
    java.rmi.RemoteException: com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method in.kgs.bean.Dlv_EntityHomeImpl0.findMaxModifiedByUserID(java.lang.String).
         at in.kgs.bean.Dlv_EntityHomeImpl0.findMaxModifiedByUserID(Dlv_EntityHomeImpl0.java:1477)
         at in.kgs.bean.Dlv_EntityHomeImpl0p4_Skel.dispatch(Dlv_EntityHomeImpl0p4_Skel.java:387)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.engine.services.ejb.exceptions.BaseEJBException: Exception in method Dlv_EntityBean0.FindMaxModifiedByUserID(java.lang.String).
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:900)
         at in.kgs.bean.Dlv_EntityHomeImpl0.findMaxModifiedByUserID(Dlv_EntityHomeImpl0.java:1449)
         ... 10 more
    Caused by: com.sap.sql.log.OpenSQLException: A column with name DLVNO is unknown.
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
         at com.sap.sql.jdbc.common.CommonResultSet.findColumn(CommonResultSet.java:643)
         at com.sap.sql.jdbc.common.CommonResultSet.getLong(CommonResultSet.java:382)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPK(Dlv_EntityBean0Persistent.java:213)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPrimaryKey(Dlv_EntityBean0Persistent.java:206)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractSinglePK(FindPKCollection.java:152)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractAndAddSinglePK(FindPKCollection.java:167)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.onlyLoadAllElementsFromRS(FindPKCollection.java:146)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.forceLoadingOfAllElementsFromRS(FindPKCollection.java:128)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.<init>(FindPKCollection.java:99)
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:896)
         ... 11 more
    ; nested exception is:
         javax.ejb.EJBException: com.sap.engine.services.ejb.exceptions.BaseEJBException: Exception in method Dlv_EntityBean0.FindMaxModifiedByUserID(java.lang.String).
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:900)
         at in.kgs.bean.Dlv_EntityHomeImpl0.findMaxModifiedByUserID(Dlv_EntityHomeImpl0.java:1449)
         at in.kgs.bean.Dlv_EntityHomeImpl0p4_Skel.dispatch(Dlv_EntityHomeImpl0p4_Skel.java:387)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.sql.log.OpenSQLException: A column with name DLVNO is unknown.
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
         at com.sap.sql.jdbc.common.CommonResultSet.findColumn(CommonResultSet.java:643)
         at com.sap.sql.jdbc.common.CommonResultSet.getLong(CommonResultSet.java:382)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPK(Dlv_EntityBean0Persistent.java:213)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPrimaryKey(Dlv_EntityBean0Persistent.java:206)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractSinglePK(FindPKCollection.java:152)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractAndAddSinglePK(FindPKCollection.java:167)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.onlyLoadAllElementsFromRS(FindPKCollection.java:146)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.forceLoadingOfAllElementsFromRS(FindPKCollection.java:128)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.<init>(FindPKCollection.java:99)
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:896)
         ... 11 more
    com.sap.sql.log.OpenSQLException: A column with name DLVNO is unknown.
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
         at com.sap.sql.jdbc.common.CommonResultSet.findColumn(CommonResultSet.java:643)
         at com.sap.sql.jdbc.common.CommonResultSet.getLong(CommonResultSet.java:382)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPK(Dlv_EntityBean0Persistent.java:213)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPrimaryKey(Dlv_EntityBean0Persistent.java:206)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractSinglePK(FindPKCollection.java:152)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractAndAddSinglePK(FindPKCollection.java:167)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.onlyLoadAllElementsFromRS(FindPKCollection.java:146)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.forceLoadingOfAllElementsFromRS(FindPKCollection.java:128)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.<init>(FindPKCollection.java:99)
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:896)
         at in.kgs.bean.Dlv_EntityHomeImpl0.findMaxModifiedByUserID(Dlv_EntityHomeImpl0.java:1449)
         at in.kgs.bean.Dlv_EntityHomeImpl0p4_Skel.dispatch(Dlv_EntityHomeImpl0p4_Skel.java:387)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
         at com.sap.engine.services.ejb.exceptions.BaseRemoteException.writeReplace(BaseRemoteException.java:276)
         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 java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1011)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
         at com.sap.engine.services.rmi_p4.DispatchImpl.throwException(DispatchImpl.java:144)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:322)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: javax.ejb.EJBException: com.sap.engine.services.ejb.exceptions.BaseEJBException: Exception in method Dlv_EntityBean0.FindMaxModifiedByUserID(java.lang.String).
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:900)
         at in.kgs.bean.Dlv_EntityHomeImpl0.findMaxModifiedByUserID(Dlv_EntityHomeImpl0.java:1449)
         at in.kgs.bean.Dlv_EntityHomeImpl0p4_Skel.dispatch(Dlv_EntityHomeImpl0p4_Skel.java:387)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.sql.log.OpenSQLException: A column with name DLVNO is unknown.
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
         at com.sap.sql.jdbc.common.CommonResultSet.findColumn(CommonResultSet.java:643)
         at com.sap.sql.jdbc.common.CommonResultSet.getLong(CommonResultSet.java:382)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPK(Dlv_EntityBean0Persistent.java:213)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPrimaryKey(Dlv_EntityBean0Persistent.java:206)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractSinglePK(FindPKCollection.java:152)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractAndAddSinglePK(FindPKCollection.java:167)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.onlyLoadAllElementsFromRS(FindPKCollection.java:146)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.forceLoadingOfAllElementsFromRS(FindPKCollection.java:128)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.<init>(FindPKCollection.java:99)
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:896)
         ... 11 more
    com.sap.sql.log.OpenSQLException: A column with name DLVNO is unknown.
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
         at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
         at com.sap.sql.jdbc.common.CommonResultSet.findColumn(CommonResultSet.java:643)
         at com.sap.sql.jdbc.common.CommonResultSet.getLong(CommonResultSet.java:382)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPK(Dlv_EntityBean0Persistent.java:213)
         at in.kgs.bean.Dlv_EntityBean0Persistent.extractPrimaryKey(Dlv_EntityBean0Persistent.java:206)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractSinglePK(FindPKCollection.java:152)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.extractAndAddSinglePK(FindPKCollection.java:167)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.onlyLoadAllElementsFromRS(FindPKCollection.java:146)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.forceLoadingOfAllElementsFromRS(FindPKCollection.java:128)
         at com.sap.engine.services.ejb.entity.finder.FindPKCollection.<init>(FindPKCollection.java:99)
         at in.kgs.bean.Dlv_EntityBean0PM.ejbFindMaxModifiedByUserID(Dlv_EntityBean0PM.java:896)
         at in.kgs.bean.Dlv_EntityHomeImpl0.findMaxModifiedByUserID(Dlv_EntityHomeImpl0.java:1449)
         at in.kgs.bean.Dlv_EntityHomeImpl0p4_Skel.dispatch(Dlv_EntityHomeImpl0p4_Skel.java:387)
         at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
         at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
         at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
         at com.sap.engine.services.ejb.exceptions.BaseEJBException.writeReplace(BaseEJBException.java:274)
         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 java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1011)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
         ... 11 more

    Hi Guruvulu,
    >
    Guruvulu Bojja wrote:
    > i have written the alternative sql statement in persistence.xml like  "select max(modifieddate) from tmp_dlv_mgmt".
    Could you please explain in detail - what you have done and what you want to achieve? You can also post the code of your persistence.xml for reference...
    Regards,
    Yordan

  • Weblogic Server 8.1 giving weird error while deploying EJB

    Hi All,
    I am using weblogic8.1 server with service pack 4.
    I am trying to deploy an entitybean (ejb2.0) specification. I am getting following error.
    ==========================================================
    [Deployer:149033]preparing application sum.LDN on MyServer
    [Deployer:149033]failed application sum.LDN on MyServer
    [Deployer:149034]An exception occurred for task [Deployer:149026]Deploy application sum.LDN on MyServer.:
    Exception:weblogic.management.ApplicationException: prepare failed for sumEJB.jar
    Module: sumEJB.jar Error: Exception preparing module: EJBModule(sumEJB.jar,status=NEW)
    Unable to deploy EJB: sumEJB.jar from sumEJB.jar:
    [EJB:011017]Error while reading 'META-INF/weblogic-cmp-rdbms-jar.xml'. The error was:
    In bean com.csfb.csar.sum.ods.TradeSetlmtMapping, the abstract method, getHandle(), does not correspond to any container-managed field and is not implemented in the bean class or any of its superclasses.
    In bean com.csfb.csar.sum.ods.TradeSetlmtMapping, the abstract method, getEJBHome(), does not correspond to any container-managed field and is not implemented in the bean class or any of its superclasses.
    In bean com.csfb.csar.sum.ods.TradeSetlmtMapping, the abstract method, isIdentical(javax.ejb.EJBObject), does not correspond to any container-managed field and is not implemented in the bean class or any of its superclasses.
    at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:255)
    at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:476)
    at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:407)
    at weblogic.ejb20.deployer.EJBDeployer.runEJBC(EJBDeployer.java:493)
    at weblogic.ejb20.deployer.EJBDeployer.compileJar(EJBDeployer.java:784)
    at weblogic.ejb20.deployer.EJBDeployer.compileIfNecessary(EJBDeployer.java:700)
    at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1339)
    at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:498)
    at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:3142)
    at weblogic.j2ee.J2EEApplicationContainer.prepareModules(J2EEApplicationContainer.java:1583)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1227)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1070)
    at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2513)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2463)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2379)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:866)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:594)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:508)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    ==========================================================
    This is very surprising error I am getting. Because getHandle(), getEJBHome(), isIdentical() are no where declared in business interface extending EJBObject.
    Descriptor File is perfectly fine.
    $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    <weblogic-rdbms-bean>
    <ejb-name>com.csfb.csar.sum.ods.TradeSetlmtMapping</ejb-name>
    <data-source-name>com.csfb.csar.ODSDataSource</data-source-name>
    <table-map>
    <table-name>ODS_CNS_ELIGIBLE_TRADES</table-name>
    <field-map>
    <cmp-field>auditCreatedDate</cmp-field>
    <dbms-column>STAMP_ADD_DTIME</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>auditCreatedBy</cmp-field>
    <dbms-column>PROCESS_ADD_ID</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>transId</cmp-field>
    <dbms-column>TRANS_ID</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>transVersId</cmp-field>
    <dbms-column>TRANS_VERS_ID</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>transItemSequenceId</cmp-field>
    <dbms-column>TRANS_ITEM_SEQUENCE_ID</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>externalReference</cmp-field>
    <dbms-column>EXTERNAL_REFERENCE</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>setLmtStatus</cmp-field>
    <dbms-column>SETLMT_STATUS</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>setLmtDate</cmp-field>
    <dbms-column>SETLMT_DATE</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>stampUpdateDtime</cmp-field>
    <dbms-column>STAMP_UPDATE_DTIME</dbms-column>
    </field-map>
    </table-map>
    <weblogic-query>
    <query-method>
    <method-name>findAll</method-name>
    <method-params/>
    </query-method>
    </weblogic-query>
    </weblogic-rdbms-bean>
    $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    Please Help..

    <p>I could not find any documentation that suggested LIMIT or OFFSET where supported. Some of our developers needed to use limit, in the end all I could suggest was using a dynamic query and setting the maximum number of results see here
    .</p>
    <p>
    Hussein Badakhchani</br>
    </p>

Maybe you are looking for

  • Logic 7 Songs all messed up in Logic 8

    Hi everyone, I've just upgraded to logic 8 from 7 and I'm having some problems with songs made in 7. They play back in Logic 8 but they are all over the place. Some Instruments, Loops and Audio files are said to be "not found", yet I can find them my

  • Office Interop 32 bit on 64 bit OS email attachments filling up outlook temp folder OLK

    I have an issue when sending emails (many) using Office.Interop 32 bit that when the application is installed on a 64 bit OS the outlook secure temp is filling up and throwing an exception, this does not occur when the application is installed on a 3

  • Blue screen of death error on HP Officejet Pro 8500 wireless - HELP

    Hi all I have a officejet pro 8500, used (rarely) in a home office environment, probably done no more than 1000 pages total. Turned it on today to print something, powers up ok with no errors, sounds normal, but when sending something to print I get

  • Autonomous database transaction

    Hello, I'll log some application information in a local table like this: Here a pseudocode example: funktion mainFunction{   "INSERT something"   log(count of inserted rows).   do something other   on error COMMIT eles ROLLBACK function log(message){

  • Simulation in java

    hello: i am working on a project which deliver a signal from sensor and send it to computer by serial port. actually i need to make simulation to this system using Java, i mean that i want to exchange the hardware part (sensor) and simulate it in jav