Stateless EJB as CORBA callback objects

I am trying to have an EJB working as a client of an external CORBA system that provides
an asynchronous interface. This means the EJB has to provide the CORBA server with
a Callback object implementing a particular CORBA interface. I'd like to have the
EJB directly implement that interface, and use a reference to its remote interface
as the object I pass in the method call: is it possible in some way? Right now I've
tried passing context.getEJBObject()and I receive the following exception:
java.rmi.RemoteException: EJB Exception: ; nested exception is: org.omg.CORBA.BAD_OPERATION:
The delegate has not been set! minor code: 0 completed: No
org.omg.CORBA.BAD_OPERATION: The delegate has not been set! minor code: 0 completed:
No
at org.omg.CORBA.portable.ObjectImpl._get_delegate(ObjectImpl.java:55)
at com.inprise.vbroker.orb.ORB.getDelegate(ORB.java:1328)
at com.inprise.vbroker.orb.CDROutputStream.write_Object(CDROutputStream.java:1494)
at weblogic.iiop.UtilDelegateImpl.writeRemoteObject(UtilDelegateImpl.java:326)
at javax.rmi.CORBA.Util.writeRemoteObject(Util.java:110)
at Bank._AccountStub.balanceAndCallback(_AccountStub.java:87)
at it.altoprofilo.mcss.prove.CorbaClient1EJB.getBalanceWithCallback(CorbaClient1EJB.java:99)
at it.altoprofilo.mcss.prove.CorbaClient1EJB_4jr201_EOImpl.getBalanceWithCallback(CorbaClient1EJB_4jr201_EOImpl.java:78)
at java.lang.reflect.Method.invoke(Native Method)
at com.sun.forte4j.j2ee.ejbtest.webtest.InvocableMethod$MethodIM.invoke(InvocableMethod.java:232)
at com.sun.forte4j.j2ee.ejbtest.webtest.EjbInvoker.getInvocationResults(EjbInvoker.java:97)
at com.sun.forte4j.j2ee.ejbtest.webtest.DispatchHelper.getForward(DispatchHelper.java:190)
at jsp_servlet.__dispatch._jspService(__dispatch.java:116) 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:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2495)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

Perhaps you can find the resolution for your problem
in these documents:
http://download-east.oracle.com/docs/cd/B10501_01/java.920/a96656.pdf
http://download-east.oracle.com/docs/cd/B10501_01/java.920/a96659.pdf
[email protected]
Joel P�rez

Similar Messages

  • EJB Java Client to Corba C++ object

    Does BEA have any examples of calling from an EJB java client to a CORBA C++ object
    (please no Tuxedo examples, thank you)?
    I've tried the c++ -> EJB examples, however now I need the other way around.
    thanks,
    Sean

    Andy Piper <[email protected]> wrote:
    "Sean Cloutier" <[email protected]> writes:
    Does BEA have any examples of calling from an EJB java client to aCORBA C++ object
    (please no Tuxedo examples, thank you)? Not that I am aware of. This is just a standard CORBA client scenario.
    andy
    -- Cool, thanks Andy!

  • Problem: Connecting to EJB from CORBA with Glassfish as AppServer

    Hi all,
    I was looking and tryieng for days now, but never found a proper solution or how to, to solve my problem:
    I have to expose a Remote EJB as Corba Object and provide a set of IDL Files, which can be used by any CORBA Client (i.e. IIOP.NET).
    First i tried it the EJB3 way, but everywhere is mentioned that IIOP cann only be used by EJB2.x way. So this ist what i have done so far:
    The Home Inteface, as described at many tutorials
    package org.ba.services.iiop;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    import javax.ejb.EJBHome;
    public interface KursmanagerRemoteServiceHome extends EJBHome {
        public KursmanagerRemoteService create() throws CreateException, RemoteException;
    }The Service Interface:
    package org.ba.services.iiop;
    import java.rmi.RemoteException;
    import java.util.ArrayList;
    import javax.ejb.EJBObject;
    import org.ba.entities.Kurs;
    import org.ba.entities.Person;
    * @author Pocket
    public interface KursmanagerRemoteService extends EJBObject{
        public void prepareApplication(long callID) throws RemoteException;
        public boolean resetDataFile() throws RemoteException;
        byte[] getOneMegabyte(long callID) throws RemoteException;
    }there are some more methods, but thats not the point
    And this is the implementing bean:
    package org.ba.services.iiop;
    import java.rmi.RemoteException;
    @Stateless
    @RemoteHome(KursmanagerRemoteServiceHome.class)
    public class KursmanagerRemoteServiceBean extends AbstractService implements KursmanagerRemoteService, SessionBean {
        @EJB
        Kursmanager km;
        @Init
        public void create() {
        public void prepareApplication(long callID) {
        public boolean resetDataFile() {
             return emptyDataFile();
    public EJBHome getEJBHome() throws RemoteException {
            return null;
        public Object getPrimaryKey() throws RemoteException {
            return null;
        public void remove() throws RemoteException, RemoveException {
        public Handle getHandle() throws RemoteException {
            return null;
        public boolean isIdentical(EJBObject arg0) throws RemoteException {
        return false;
        public void setSessionContext(SessionContext arg0) throws EJBException, RemoteException {
        public void ejbRemove() throws EJBException, RemoteException {
        public void ejbActivate() throws EJBException, RemoteException {
        public void ejbPassivate() throws EJBException, RemoteException {
        }Deployed on Glassfish V2ur1
    IDE: Netbeans 6.0.1
    Does anyone know if this is correct? How do i create the IDLs correctly? Which of the SessionBeanIF Methods have to be implemented (or at all)?
    is there no easy way to expose objects for CORBA Clients?
    I would appreciate any help..
    thanx
    Andreas

    John,
    JDeveloper 3.1 is not certified against OAS 4.0.8.2 - and JDeveloper 3.2 will not be certified against any version of OAS, since Oracle is moving to iAS.
    If your project is in its early stages, I suggest that you consider switching to iAS - and you can work against Apache until iAS is available, which will be with JDeveloper 3.2, in the last quarter of this calendar year (2000).
    Thanks
    Blaise

  • Error while calling EJB with a heavyweight Object Parameter

    Hi Everybody,
    I am getting the following Error when i call a EJB with a heavyweight Object Parameter in Sun ONE Application Server 7.0.0_04.
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr: org.omg.CORBA.BAD_PARAM: java.util.PropertyResourceBundle vmcid: OMG minor code: 6 completed: Maybe
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.util.Utility.throwNotSerializableForCorba(Utility.java:1018)
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:691)
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:526)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:1062)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_value(CDROutputStream.java:259)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.corba.TCUtility.marshalIn(TCUtility.java:136)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.corba.AnyImpl.write_value(AnyImpl.java:599)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_any(CDROutputStream_1_0.java:538)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_any(CDROutputStream.java:233)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.writeAny(ShutdownUtilDelegate.java:196)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at javax.rmi.CORBA.Util.writeAny(Util.java:78)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.write_Array(ValueHandlerImpl.java:446)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:134)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:916)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:651)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_value(CDROutputStream.java:263)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:685)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.OutputStreamHook.defaultWriteObject(OutputStreamHook.java:129)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at java.util.Vector.writeObject(Vector.java:1017)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.writeObject(Native Method)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.invokeObjectWriter(IIOPOutputStream.java:560)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:523)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:1062)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:651)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_value(CDROutputStream.java:263)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:685)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:526)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:1082)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_value(CDROutputStream.java:259)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.copyObjects(Util.java:440)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at javax.rmi.CORBA.Util.copyObjects(Util.java:296)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.hrsystem.ejb._HRSystem_Stub.get(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.transaction.AddressType.submitAddressChange(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.transaction.AddressType.submitToSAP(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.mydata.servlet.MyDataConfirmationServlet.processServlet(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.core.servlet.EnetBaseHttpServlet.service(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at java.security.AccessController.doPrivileged(Native Method)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr: java.rmi.UnexpectedException: java.io.IOException: Serializable readObject method failed internally
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.wrapException(Util.java:370)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at javax.rmi.CORBA.Util.wrapException(Util.java:277)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.hrsystem.ejb._HRSystem_Stub.get(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.transaction.AddressType.submitAddressChange(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.transaction.AddressType.submitToSAP(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.mydata.servlet.MyDataConfirmationServlet.processServlet(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.core.servlet.EnetBaseHttpServlet.service(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at java.security.AccessController.doPrivileged(Native Method)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    Can someone please help to solve this.
    Regards,
    Sunil

    Unfortunately there's not really enough information for anyone to help you much. I can tell you've hit an EOF Exception, but that's about it.
    What exactly do you mean by a heavyweight object parameter? Do you mean a large (in memory size) object?
    Without any knowledge of your application, I'd probably start by changing your ejb method to do nothing. That should tell you at least whether it's the serialization of the parameter that's the issue or not. Narrow it down from there.
    If you need more help, printing the entire stack trace of the EOFException and posting it here would be helpful.
    -- Rob

  • HOWTO: Using a BC4J Application Module in an Stateless EJB Session Bean

    HOWTO: Using a BC4J Application Module in an Stateless EJB Session Bean
    by Steve Muench
    Overview
    BC4J provides automatic facilities for deploying any application module as a stateful EJB session bean. If you want to leverage the features of your BC4J application module from a stateless EJB session bean, it's not automatic but it is straightforward to implement. This howto article explains the details.
    For our example, we will create a stateless EJB session bean that uses a container-managed transaction. To keep things simple, let's assume the session bean has a single public method on its remote interface named createDepartment() with the following signature:
    public void createDepartment(int id, String name, String loc) throws AppException
    AppException is an example of an application-specific exception that our method will throw if any problems arise during its execution.The goal of this article is to illustrate how to use the BC4J application module named com.example.hr.HRApp as part of the implementation of this createDepartment method on our stateless enterprise bean. Let's assume that the HRApp application module has a view object member named Departments, based on the com.example.hr.DeptView view object, based on the familiar DEPT table and related to the com.example.hr.Dept entity object so our view can be updateable.
    Creating the Stateless Session Bean
    We can start by using the JDeveloper Enterprise Bean wizard to create a new stateless session bean called StatelessSampleEJB implemented by:[list][*]com.example.StatelessSampleEJBBean (Bean class)[*]com.example.StatelessSampleEJBHome (Home interface)[*]com.example.StatelessSampleEJB (Remote interface)[list]
    We then use the EJB Class Editor to add the createDepartment method to the remote interface of StatelessSampleEJB with the signature above. We edit the remote interface to make sure that it also reflects that the createDepartment method thows the AppException like this:
    package com.example;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface StatelessSampleEJB extends EJBObject {
      void createDepartment(int id, String name, String loc)
      throws RemoteException,AppException;
    }Before we start adding BC4J into the picture for our implementation, our StatelessSampleEJBBean class looks like this:
    package com.example;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class StatelessSampleEJBBean implements SessionBean {
      public void ejbCreate(){}
      public void ejbActivate(){}
      public void ejbPassivate(){}
      public void ejbRemove(){}
      public void setSessionContext(SessionContext ctx){
      public void createDepartment(int id, String name, String loc) 
      throws AppException {
        // TODO: Implement method here
    }We can double-click on the ejb-jar.xml file in our project to see the XML deployment descriptor for the bean we just created:
    <ejb-jar>
       <enterprise-beans>
          <session>
             <description>Session Bean ( Stateless )</description>
             <display-name>StatelessSampleEJB</display-name>
             <ejb-name>StatelessSampleEJB</ejb-name>
             <home>com.example.StatelessSampleEJBHome</home>
             <remote>com.example.StatelessSampleEJB</remote>
             <ejb-class>com.example.StatelessSampleEJBBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
          </session>
       </enterprise-beans>
    </ejb-jar>We need to add the extra <assembly-descriptor> section in this file to indicate that the createDepartment method will require a transaction. After this edit, the ejb-jar.xml file looks like this:
    <ejb-jar>
       <enterprise-beans>
          <session>
             <description>Session Bean ( Stateless )</description>
             <display-name>StatelessSampleEJB</display-name>
             <ejb-name>StatelessSampleEJB</ejb-name>
             <home>com.example.StatelessSampleEJBHome</home>
             <remote>com.example.StatelessSampleEJB</remote>
             <ejb-class>com.example.StatelessSampleEJBBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
          </session>
       </enterprise-beans>
       <assembly-descriptor>
          <container-transaction>
             <method>
                <ejb-name>StatelessSampleEJB</ejb-name>
                <method-name>createDepartment</method-name>
                <method-params>
                   <method-param>int</method-param>
                   <method-param>java.lang.String</method-param>
                   <method-param>java.lang.String</method-param>
                </method-params>
             </method>
             <trans-attribute>Required</trans-attribute>
          </container-transaction>
       </assembly-descriptor>
    </ejb-jar>
    Aggregating a BC4J Application Module
    With the EJB aspects of our bean setup, we can proceed to implementing the BC4J application module aggregation.
    The first thing we do is add private variables to hold the EJB SessionContext and the instance of the aggregated BC4J ApplicationModule, like this:
    // Place to hold onto the aggregated appmodule instance
    transient private ApplicationModule _am  = null;
    // Remember the SessionContext that the EJB container provides us
    private           SessionContext    _ctx = null;and we modify the default, empty implementation of the setSessionContext() method to remember the session context like this:
    public void setSessionContext(SessionContext ctx){ _ctx = ctx; }We add additional constants that hold the names of the J2EE datasource that we want BC4J to use, as well as the fully-qualified name of the BC4J application module that we'll be aggregating:
    // JNDI resource name for the J2EE datasource to use
    private static final String DATASOURCE = "jdbc/OracleCoreDS";
    // Fully-qualified BC4J application module name to aggregate
    private static final String APPMODNAME = "com.example.hr.HRApp";We expand the now-empty ejbCreate() and ejbRemove() methods to create and destory the aggregated instance of the BC4J application module that we'll use for the lifetime of the stateless session bean. When we're done, ejbCreate() it looks like this:
    public void ejbCreate() throws CreateException {
      try {
        // Setup a hashtable of environment parameters for JNDI initial context
        Hashtable env = new Hashtable();
        env.put(JboContext.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
        // NOTE: we want to use the BC4J app module in local mode as a simple Java class!
        env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
        env.put(PropertyConstants.INTERNAL_CONNECTION_PARAMS,DATASOURCE);
        // Create an initial context, using this hashtable of environment params
        InitialContext ic = new InitialContext(env);
        // Lookup a home interface for the application module
        ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(APPMODNAME);
        // Using the home, create the instance of the appmodule we'll use
        _am = home.create();
        // Register the BC4J factory to handle EJB container-managed transactions
        registerContainerManagedTransactionHandlerFactory();
      catch(Exception ex) {
         ex.printStackTrace();
        throw new CreateException(ex.getMessage());
    }and ejbRemove() looks like this:
    public void ejbRemove() {
      try {
        // Cleanup any appmodule resources before getting shutdown
        _am.remove();
      catch(JboException ex) { /* Ignore */ }
    }The helper method named reigsterContainerManagedTransactionHandlerFactory() looks like this:
    private void registerContainerManagedTransactionHandlerFactory() {
      SessionImpl session = (SessionImpl)_am.getSession();
      session.setTransactionHandlerFactory(
        new TransactionHandlerFactory() {
          public TransactionHandler  createTransactionHandler() {
            return new ContainerManagedTxnHandlerImpl();
          public JTATransactionHandler createJTATransactionHandler() {
            return new ContainerManagedTxnHandlerImpl();
    }The last detail is to use the BC4J appmodule to implement the createDepartment() method. It ends up looking like this:
    public void createDepartment(int id, String name, String loc)
    throws AppException {
      try {
        // Connect the AM to the datasource we want to use for the duration
        // of this single method call.
        _am.getTransaction().connectToDataSource(null,DATASOURCE,false);
        // Use the "Departments" view object member of this AM
        ViewObject departments = _am.findViewObject("Departments");
        // Create a new row in this view object.
        Row newDept = departments.createRow();
        // Populate the attributes from the parameter arguments.
        newDept.setAttribute("Deptno", new Number(id));
        newDept.setAttribute("Dname", name);
        newDept.setAttribute("Loc", loc);
        // Add the new row to the view object's default rowset
        departments.insertRow(newDept);
        // Post all changes in the AM, but we don't commit them. The EJB
        // container managed transaction handles the commit.
        _am.getTransaction().postChanges();
      catch(JboException ex) {
        // To be good EJB Container-Managed Transaction "citizens" we have
        // to mark the transaction as needing a rollback if there are problems
        _ctx.setRollbackOnly();
        throw new AppException("Error creating dept "+ id +"\n"+ex.getMessage());
      finally {
        try {
          // Disconnect the AM from the datasource we're using
          _am.getTransaction().disconnect();
        catch(Exception ex) { /* Ignore */ }
    Building a Test Client
    With the EJB-Tier work done, we can build a sample client program to test this new stateless EJB Session Bean by selecting the bean in the Oracle9i JDeveloper IDE and choosing "Create Sample Java Client" from the right-mouse menu.
    When the "Sample EJB Client Details" dialog appears, we take the defaults of connecting to embedded OC4J container. Clicking the (OK) button generates the following test class:
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import com.example.StatelessSampleEJB;
    import com.example.StatelessSampleEJBHome;
    public class SampleStatelessSampleEJBClient {
      public static void main(String [] args) {
        SampleStatelessSampleEJBClient sampleStatelessSampleEJBClient =
           new SampleStatelessSampleEJBClient();
        try {
          Hashtable env = new Hashtable();
          env.put(Context.INITIAL_CONTEXT_FACTORY,
                  "com.evermind.server.rmi.RMIInitialContextFactory");
          env.put(Context.SECURITY_PRINCIPAL, "admin");
          env.put(Context.SECURITY_CREDENTIALS, "welcome");
          env.put(Context.PROVIDER_URL,
                  "ormi://localhost:23891/current-workspace-app");
          Context ctx = new InitialContext(env);
          StatelessSampleEJBHome statelessSampleEJBHome =
               (StatelessSampleEJBHome)ctx.lookup("StatelessSampleEJB");
          StatelessSampleEJB statelessSampleEJB;
          // Use one of the create() methods below to create a new instance
          // statelessSampleEJB = statelessSampleEJBHome.create();
          // Call any of the Remote methods below to access the EJB
          // statelessSampleEJB.createDepartment( int id, java.lang.String name, java.lang.String loc );
        catch(Throwable ex) {
          ex.printStackTrace();
    }We uncomment the call to the create() method and add a few calls to the createDepartment() method so that the body of the test program now looks like this:
    // Use one of the create() methods below to create a new instance
    statelessSampleEJB = statelessSampleEJBHome.create();
    // Call any of the Remote methods below to access the EJB
    statelessSampleEJB.createDepartment( 13, "Test1","Loc1");
    System.out.println("Created department 13");
    statelessSampleEJB.createDepartment( 14, "Test2","Loc2");
    System.out.println("Created department 14");
    try {
      // Try setting a department id that is too large!
      statelessSampleEJB.createDepartment( 23456, "Test3","Loc3");
    catch (AppException ax) {
      System.err.println("AppException: "+ax.getMessage());
    }Before we can successfully run our SampleStatelessSampleEJBClient we need to first run the EJB bean that the client will try to connect to. Since Oracle9i JDeveloper supports local running and debugging of the EJB-Tier without doing through a full J2EE deployment step, to accomplish this prerequisite step we just need to right-mouse on the StatelessSampleEJB node in the System Navigator and select "Run". This starts up the embedded OC4J instance and runs the EJB right out of the current out path.Finally, we can run the SampleStatelessSampleEJBClient, and see the output of the test program in the JDeveloper log window:
    Created department 13
    Created department 14
    AppException: Error creating dept 23456
    JBO-27010: Attribute set with value 23456 for Deptno in Dept has invalid precision/scale
    Troubleshooting
    One error that might arise while running the example is that the database connection information in your data-sources.xml for the jdbc/OracleCoreDS datasource does not correspond to the database you are trying to test against. If this happens, then double-check the file .\jdev\system\oc4j-config\data-sources.xml under the JDeveloper installation home directory to make sure that the url value provided is what you expect. For example, to work against a local Oracle database running on your current machine, listening on port 1521, with SID of ORCL, you would edit this file to have an entry like this for jdbc/OracleCoreDS :
    <data-source
        class="com.evermind.sql.DriverManagerDataSource"
        name="OracleDS"
        location="jdbc/OracleCoreDS"
        xa-location="jdbc/xa/OracleXADS"
        ejb-location="jdbc/OracleDS"
        connection-driver="oracle.jdbc.driver.OracleDriver"
        username="scott"
        password="tiger"
        url="jdbc:oracle:thin:@localhost:1521:ORCL"
        inactivity-timeout="30"
    />This is the data-sources.xml file that gets used by the embedded OC4J instance running in JDeveloper.
    Conclusion
    Hopefully this article has illustrated that it is straightforward to utilize the full power of BC4J in local mode as part of your EJB Stateless Session Beans using container-managed transaction. This example illustrated a single createDepartment method in the enterprise bean, but by replicating the application module interaction code that we've illustrated in createDepartment, any number of methods in your stateless session bean can use the aggregated application module instance created in the ejbCreate() method.
    Code Listing
    The full code listing for the SampleStatelessEJB bean implementation class looks like this:
    * StatelessSampleEJB
    * Illustrates how to use an aggregated BC4J application module
    * in local mode as part of the implementation of a stateless
    * EJB session bean using container-managed transaction.
    * HISTORY
    * smuench/dmutreja 14-FEB-2002 Created
    package com.example;
    import oracle.jbo.*;
    import oracle.jbo.server.*;
    import javax.ejb.*;
    import oracle.jbo.domain.Number;
    import oracle.jbo.common.PropertyConstants;
    import java.util.Hashtable;
    import javax.naming.InitialContext;
    import oracle.jbo.server.ejb.ContainerManagedTxnHandlerImpl;
    public class StatelessSampleEJBBean implements SessionBean {
      // JNDI resource name for the J2EE datasource to use
      private static final String DATASOURCE = "jdbc/OracleCoreDS";
      // Fully-qualified BC4J application module name to aggregate
      private static final String APPMODNAME = "com.example.hr.HRApp";
      // Place to hold onto the aggregated appmodule instance
      transient private ApplicationModule _am  = null;
      // Remember the SessionContext that the EJB container provides us
      private           SessionContext    _ctx = null;
      public void ejbCreate() throws CreateException {
        try {
          // Setup a hashtable of environment parameters for JNDI initial context
          Hashtable env = new Hashtable();
          env.put(JboContext.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
          env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
          env.put(PropertyConstants.INTERNAL_CONNECTION_PARAMS,DATASOURCE);
          // Create an initial context, using this hashtable of environment params
          InitialContext ic = new InitialContext(env);
          // Lookup a home interface for the application module
          ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(APPMODNAME);
          // Using the home, create the instance of the appmodule we'll use
          _am = home.create();
          // Register the BC4J factory to handle EJB container-managed transactions
          registerContainerManagedTransactionHandlerFactory();
        catch(Exception ex) {
           ex.printStackTrace();
          throw new CreateException(ex.getMessage());
      public void ejbActivate(){}
      public void ejbPassivate(){}
      public void ejbRemove(){}
      public void setSessionContext(SessionContext ctx){ _ctx = ctx; }
      public void createDepartment(int id, String name, String loc)
      throws AppException {
        try {
          // Connect the AM to the datasource we want to use for the duration
          // of this single method call.
          _am.getTransaction().connectToDataSource(null,DATASOURCE,false);
          // Use the "Departments" view object member of this AM
          ViewObject departments = _am.findViewObject("Departments");
          // Create a new row in this view object.
          Row newDept = departments.createRow();
          // Populate the attributes from the parameter arguments.
          newDept.setAttribute("Deptno", new Number(id));
          newDept.setAttribute("Dname", name);
          newDept.setAttribute("Loc", loc);
          // Add the new row to the view object's default rowset
          departments.insertRow(newDept);
          // Post all changes in the AM, but we don't commit them. The EJB
          // container managed transaction handles the commit.
          _am.getTransaction().postChanges();
        catch(JboException ex) {
          // To be good EJB Container-Managed Transaction "citizens" we have
          // to mark the transaction as needing a rollback if there are problems
          _ctx.setRollbackOnly();
          throw new AppException("Error creating dept "+ id +\n"+ex.getMessage());
        finally {
          try {
            // Disconnect the AM from the datasource we're using
            _am.getTransaction().disconnect();
          catch(Exception ex) { /* Ignore */ }
      private void registerContainerManagedTransactionHandlerFactory() {
        SessionImpl session = (SessionImpl)_am.getSession();
        session.setTransactionHandlerFactory(
          new TransactionHandlerFactory() {
            public TransactionHandler createTransactionHandler() {
              return new ContainerManagedTxnHandlerImpl();
            public JTATransactionHandler createJTATransactionHandler() {
              return new ContainerManagedTxnHandlerImpl();

    Hi Steve, It4s me again;
    About the question I made, I tried with a single assembly-descriptor tag and a single container-transaction tag in the deployment descriptor of the session bean and these were the results.
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    Then I tried with multiple assembly-descriptor tags each with a single container-transaction tag and the results were:
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    Finally I tried with a single assembly-descriptor and multiple container tags and the results were:
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    How can I make my Stateless Session bean work out?

  • Stateless EJB blocks

    Hi.
    I've an stateless ejb that calls another stateless ejb. The two EJB's use Entity Beans though the database schema is different.
    Here's the snippet of code:
        public Libro insertarLibro( String codigo,
                                    Long ejemplar,
                                    Calendar dataPublicacion,
                                    String isdn,
                                    String titulo,
                                    String cifEditorial,
                                    String nifAutor) throws SGLException,
                                                           StockException,
                                                           Exception {
            ServiceFacade01EJBClient externalSystemProxy = new ServiceFacade01EJBClient();                                                      
            StockFacadeEJB stockFacade = SglServiceLocator.getInstance().getStockFacadeEjb();
            stockFacade.addBook(getLibroDto(libro));
            em.persist(libro);
            em.getTransaction().commit();
            return libro;
        }The problem is that the blocking is random. Sometimes it blocks in this line:
    stockFacade.addBook(getLibroDto(libro));
    Other times it returns normally but then blocks (I use JDeveloper).
    The odd thing is that sometimes the data is written in the database. Other times not.
    On the called ejb the data is always written. But on the caller the data is not written.
    I'm using same database instance but different users/schemas for the two stateless EJB's.

    Or is it becoz the two methods that it objected to were returning user-defined objects and not String, void, Integer ... that a web service can recognize !
    But still ... why cannot it just ignore the methods that are not exposed ?
    Can someone throw some light on this.
    Thanks,
    Krishna

  • Transaction problems in Stateless EJB

    I have problems as follows. my client is a servlet which call method B in stateless ejb, In side of method B, there is a loop from which antoher method C in this same ejb is called repeatedly. I want each call of method C being a separate transaction. I can not make this work. the final result will always be one transaction from for loop. I set the transaction attribute as Requires for method B, and Requires New for method C. Please offer some help.
    Thanks.
    void ejbMethodB(){
    where(mycondition)
    ejbMethodC()
    I like to make each call of ejbMethodC be a standalone transaction instaed of the running results from the whole loop being a transaction

    First of all, thank you so much for your time.
    I also doubt the problem is Resin. But "Required" attribut works fine. The following is the coding:
    EJB implementation:
    //mehtodB
    public RequestResult getDailyCreateUpdateInfo(Request request)
    throws RemoteException, ProcessException
    boolean testFlag = false;
    List resultList = null;
    ClaimsDAO dao = null;
    Map mapRequestData = getRequestData(request);
    int num = 0;
    InterfacePushProcess push_process = (InterfacePushProcessRemote)(mySessionCtx.getEJBLocalObject());
    try {
    //Call DAO and get Student, ExchangeVisitor and their dependent information
    dao = (ClaimsDAO) getEntityObject(ClaimsDAO.class.getName());
    dataPushBO = new ClaimsDataImpl(mapRequestData);
    //get the list of categories for DOS or US-VISIT
    interdataList = dataPushBO.createCategoryList();
    Iterator iterator = interdataList.iterator();
    System.out.println("before invokeTransacprocess. ");
    //testing
    this.invokeTransacProcess();
    //process all the categories for DOS or US-VISIT
    while(iterator.hasNext())
    interconfigData = (InterfaceDataConfig) iterator.next();
    processOneCategory(mapRequestData, interconfigData, dao);
    } catch (Exception e) {
    mySessionCtx.setRollbackOnly();
    log.logp(Level.SEVERE, classname, "getDailyCreateUpdateInfo", e.getMessage());
    Object[] args = createExceptionArgs();
    args[0] = request.getName();
    throw new ProcessException(IMessage.ENTITY_POPULATION_FAILED, args, e);
    return new RequestResult(request, resultList);
    //mehtodC
    public void processOneCategory(Map reqmap, InterfaceDataConfig interconfigData, ClaimsDAO dao)
    throws ProcessException
    List pageList = null;
    String fileType = interconfigData.getGroupName(); //student, dep etc
    String countKey = interconfigData.getCountKey();
    String logKey = interconfigData.getIDKey();
    UserTransaction trans = null;
    int count = 0;
    boolean process = false;
    String groupname = interconfigData.getGroupName();
    log.logp(Level.INFO, classname, "processOneCategory() ", "group name = " + groupname);
    try
    Context ct = new InitialContext();
    trans = (UserTransaction) ct.lookup("java:comp/UserTransaction");
    trans.begin();
    String startTime = convert.getTimestamp();
    log.logp( Level.INFO, classname, "processOneCategory() ", "processing start time: "+startTime);
    pageList = processOnePage(interconfigData, dao);
    if (pageList.isEmpty())
    log.info("There are no records which need be processed.");
    else
    do
    try
    this.displayResult(pageList);
    process = pageOutputProcessor(reqmap, interconfigData, pageList);
    pageList.clear();
    pageList = this.processOnePage(interconfigData, dao);
    } catch (Exception ex) {
    mySessionCtx.setRollbackOnly();
    String msg = "Error while processing one page : " + ex.getMessage();
    log.logp(Level.SEVERE, classname, "processOneCategory() ", msg);
    throw new ProcessException(msg);
    } while (!pageList.isEmpty());
    //testing separate transaction
    if(groupname.equalsIgnoreCase("STUDENT"))
    trans.commit();
    else
    trans.rollback();
    } catch (Exception t) {
    mySessionCtx.setRollbackOnly();
    String m = "Error when processing results from ClaimsDAO's : " + t.getMessage();
    log.logp(Level.SEVERE, classname, "processOneCategory() ", m);
    throw new ProcessException(m);
    } finally {
    I put both methods: getDailyCreateUpdateInfo and processOneCategory in remote interface so I can use your suggested method to reference the EJB instance.
    Servlet Client call "getDailyCreateUpdateInfo" method (the transaction attribute is Required) in which call processOneCategory(,,) method (transaction attribute is RequiresNew).
    I put some testing code to see if I can achieve the separate transaction in each call of mehtod processOneCategory(,,) , it does not work. If I use Bean Managed Transaction, it works right away. My app. server is Resin 2.1.4.
    Again, Thank you.
    Mark

  • Javax.ejb.CreateException: CORBA TRANSACTION_ROLLEDBACK 9998

    while interacting with the server side bean , i am getting teh following exception.
    exception
    Aug 30, 2007 5:53:12 PM com.sun.enterprise.appclient.MainWithModuleSupport <init>
    WARNING: ACC003: Application threw an exception.
    javax.ejb.CreateException: CORBA TRANSACTION_ROLLEDBACK 9998 Maybe; nested exception is:
    org.omg.CORBA.TRANSACTION_ROLLEDBACK: vmcid: 0x2000 minor code: 1806 completed: Maybe
    at ossj.sa.ri.order.JVTActivationBean.createOrderByValue(JVTActivationBean.java:357)
    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:585)
    at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
    at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
    at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
    at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:190)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:107)
    at $Proxy23.createOrderByValue(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:585)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
    at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
    Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:340)
    at com.sun.enterprise.appclient.Main.main(Main.java:180)
    Caused by: java.lang.reflect.InvocationTargetException
    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:585)
    at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:232)
    at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:329)
    ... 1 more
    Caused by: javax.ejb.CreateException: CORBA TRANSACTION_ROLLEDBACK 9998 Maybe; nested exception is:
    org.omg.CORBA.TRANSACTION_ROLLEDBACK: vmcid: 0x2000 minor code: 1806 completed: Maybe
    at ossj.sa.ri.order.JVTActivationBean.createOrderByValue(JVTActivationBean.java:357)
    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:585)
    at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
    at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
    at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
    at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:190)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:107)
    at $Proxy23.createOrderByValue(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:585)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
    at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
    I could not undersatnd waht can be the roblem.
    Please do help me

    check your server log, it may contain some information

  • Relation between EJB and CORBA

    Hi,
    I'm confused as to the relation between EJB and CORBA. Some books I've read say that CORBA is used to implement the underlying RMI protocol in EJB while others say it is an alternative to EJB.
    Could someone please clarify.
    Thanks

    Could you pleae restate your question.
    I'm assuming you want to bind a Corba object to a
    CosNaming service from within a j2ee component. JNDI
    supports this case fully via their CosNaming service provider
    (see http://java.sun.com/products/jndi/serviceproviders.html) JNDI is part of J2SE, so it's fully available to any J2EE component.
    Amlan on behalf of Kenneth Saks

  • Stateless EJB (exposed only one fn) as a web service - Error illegal public

    I have a stateless EJB which has 3 methods.
    I expose one of them only as a web service.
    But when I test my web service I receive an error...
    500 Internal Server Error
    Servlet error: The class blah.blah.I_EmpRemote contains illegal public methods.
    These methods do not conform to the
    restrictions imposed by the web service implementation
    Offending methods:
    public abstract blah.blah.Employee blah.blah.I_EmpRemote.GetEmployee(java.lang.String) throws java.rmi.RemoteException
    public abstract blah.blah.Operator blah.blah.I_EmpRemote.GetOperator(java.lang.String,int) throws java.rmi.RemoteException
    So does this mean .. I should make sure all or none of my methods of an EJB are exposed in the Web Service ?
    Or I can resolve this in any other way ?
    Thanks,
    Krishna

    Or is it becoz the two methods that it objected to were returning user-defined objects and not String, void, Integer ... that a web service can recognize !
    But still ... why cannot it just ignore the methods that are not exposed ?
    Can someone throw some light on this.
    Thanks,
    Krishna

  • Corba server objects

    Just like we have EJB's which can be accessed by Corba clients using RMI/IIOP,
    can we have pure Corba objects on the server side (e.g. java IDL servants) in
    Weblogic ? If so, how to deploy them into the Weblogic server? How to bind a Corba
    object to JNDI? Or, is it that Weblogic can only support EJB, and RMI server side
    objects?
    Thanks,
    Sashi

    Sashi,
    We have a similar requirement. What we've done is to launch Orbix (orbixdj) and
    NS within a startup class. It's a proxy pattern where the Impl's simply delegate
    the service to the EJB. Our key requirements were that:
    1) painful - needed to support legacy clients that were using proprietary orbix
    bind().
    2) support corporate defined IDL for integration with OSS systems
    We wanted the services co-located if possible since the proxy was only an
    integration technique. Everything seems to be working fine but we haven't put
    heavy stress on it yet. This is on Solaris 2.8 with NT & Solaris c++ clients.
    Wanting to make it portable I've also tested it on Linux/BEA/JacORB. Worked
    fine. I can send a copy of the startup class if this is something similar to
    what you're looking for. Would be interested in knowing if anybody else has
    tried something similar.
    Wayne Lund
    Principal Technical Architecture
    Emerald Solutions
    !www.emeraldsolutions.com
    Sashi Reddy wrote:
    Andy,
    Is there a correlation between weblogic JNDI, and COSNaming services?
    How does a C++ client that tries to invoke a server side RMI object
    (EJB, or otherwise) do the lookup ? Will it be a corba type lookup?
    In that case how does it get translated to JNDI ?
    - Sashi.
    Andy Piper <[email protected]> wrote:
    "Sashi Reddy" <[email protected]> writes:
    Just like we have EJB's which can be accessed by Corba clients usingRMI/IIOP,
    can we have pure Corba objects on the server side (e.g. java IDL servants)in
    Weblogic ? If so, how to deploy them into the Weblogic server? Howto bind a Corba
    object to JNDI? Or, is it that Weblogic can only support EJB, and RMIserver side
    objects?You can do this, but you have to start an ORB - weblogic does not
    provide this support itself. You could use the JDK orb but that's pretty
    limited.
    andy

  • Stateless EJB 3.0 to webservice

    Hello,
    I'm using EJB 3.0 deployed on weblogic server 10. I can deploy Stateless EJB without any problem.
    If I add a @WebService tag above my stateless bean, my deployment fails with the following error:
    Exception activating module: EJBModule(EfanetTA_EJB.jar) Unable to deploy EJB: ProfilesFacade from EfanetTA_EJB.jar: Unable to deploy EJB: EfanetTA_EJB.jar from EfanetTA_EJB.jar: [HTTP:101216]Servlet: "WSEE_SERVLET" failed to preload on startup in Web application: "/BusinessManager". class: lu.efa.ejb.jaxws.FindProfilesById could not be found at com.sun.xml.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:272) at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:566) at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:513) at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:358) at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:245) at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:229) at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:161) at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:291) at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:315) at weblogic.wsee.jaxws.JAXWSServlet.registerEndpoint(JAXWSServlet.java:125) at weblogic.wsee.jaxws.JAXWSServlet.init(JAXWSServlet.java:64) at javax.servlet.GenericServlet.init(GenericServlet.java:241) at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:282) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(Unknown Source) at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:63) at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58) at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:504) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1830) at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1807) at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1727) at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2890) at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:948) at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:353) at weblogic.wsee.deploy.WseeWebappModule.activate(WseeWebappModule.java:139) at weblogic.wsee.deploy.WSEEEjbModule.activate(WSEEEjbModule.java:371) at weblogic.wsee.deploy.WsEJBDeployListener.activate(WsEJBDeployListener.java:52) at weblogic.ejb.container.deployer.EJBDeployer.activate(EJBDeployer.java:1414) at weblogic.ejb.container.deployer.EJBModule.activate(EJBModule.java:423) at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107) at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:381) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26) at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:71) at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:63) at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26) at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212) at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154) at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:566) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:136) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:104) at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:139) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:320) at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:816) at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1223) at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:434) at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:161) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67) at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:464) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200) at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
    Thank's for your help.
    Thomas

    I am facing a new problem, i tried to create the folowing build script:
    <project default="build_artefacts">
         <taskdef name="apt" classname="com.sun.tools.ws.ant.Apt">
              <classpath refid="jaxws.classpath" />
         </taskdef>
         <target name="compile-server">
              <echo message="Compiling server classes" />
              <javac destdir="target/classes" includes="**/com/**">
                   <src path="com/b2winc/controlpanel/business/facade/customer" />
                   <classpath refid="project.classpath" />
              </javac>
         </target>
         <target name="apt" depends="compile-server">
              <apt destdir="${build}" sourcedestdir="${generated}" sourcepath="${src}">
                   <classpath refid="jaxws.classpath" />
                   <source dir="${src}">
                        <include name="**com/b2winc/controlpanel/business/*.java" />
                   </source>
              </apt>
         </target>
         <target name="build_artefacts" depends="apt">
              <echo message="${src}"></echo>
              <taskdef name="antwsgen" classname="com.sun.tools.ws.ant.WsGen"
                   classpath="${src}jaxws/lib/jaxws-tools.jar" />
              <antwsgen
                   sei="CustomerFacade" verbose="true"
                   destdir="target/classes" sourcedestdir="target/temp" >
                   <classpath path="jaxws.classpath"/>
              </antwsgen>
         </target>
         <path id="jaxws.classpath">
              <pathelement path="jaxws-ri-121/lib/jaxws-tools.jar" />
              <pathelement path="jaxws-ri-121/lib/jaxb-api.jar" />
              <pathelement path="jaxws-ri-121/lib/jaxb-impl.jar" />
              <pathelement path="jaxws-ri-121/lib/jaxws-api.jar" />
         </path>
    </project>     I used this guideline: http://today.java.net/pub/a/today/2006/06/13/web-services-with-jax-ws-2.0.html
    And i get the following error:
          [apt] An exception has occurred in apt (1.5.0_11). Please file a bug at th
    e Java Developer Connection (http://java.sun.com/webapps/bugreport)  after check
    ing the Bug Parade for duplicates. Include your program and the following diagno
    stic in your report.  Thank you.
          [apt] java.lang.NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcessorFactoryThe strange thing, that this class belongs to the tools.jar inside my JDK 5.
    Thanks
    Carlos

  • Javax ejb CreateException: Could not create stateless EJB

    Hi,
    I have a JavaEE (EJB3.0) project deployed on glassfish2.1 as -.ear (exported from eclipse3.4 to the autodeploy-folder) with -.ejb.jar, -.webui.war, general-lib-base.jar (some other...)
    The session bean is invoked by a jsf-managed bean. Have a pure annotation +@ejb+ in managed bean (identifiing the ejb-interface (+@Remote+) ...the ejb is annotated with +@stateless+
    get the following error message:
    *...nested exception is: javax.ejb.CreateException: Could not create stateless EJB*
    as beginner in the JavaEE-field I'm looking for some help concerning the possible causes.
    thank's for any comment...
    (also posted in the Enterprise JavaBeans-forum possibly better there)

    problem fixed: in the deployment-descriptor ejb-jar.xml a spezification of the session-bean hung around ...very annoying!

  • Stateless EJB is null using TimerService

    Hi,
    I created a stateless ejb using TimerService to run it in weblogic 10.3. After deploying it, I could not get the ejb instantiated properly. The code is as below.
    Could anyone explain what is missing?
    Thanks in advance.
    //=================================================
    public interface ReconTimer {
    public void createTimer();
    //================================================
    import static javax.ejb.TransactionAttributeType.NOT_SUPPORTED;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import javax.annotation.Resource;
    import javax.ejb.EJB;
    import javax.ejb.Stateless;
    import javax.ejb.Timeout;
    import javax.ejb.Timer;
    import javax.ejb.TimerService;
    import javax.ejb.Local;
    import javax.ejb.TransactionAttribute;
    import javax.ejb.TransactionManagement;
    import javax.ejb.TransactionManagementType;
    @Stateless (name="ReconTimerBean")
    @Local (ReconTimer.class)
    @TransactionManagement(value=TransactionManagementType.BEAN )
    @TransactionAttribute(value=NOT_SUPPORTED)
    public class ReconTimerBean implements ReconTimer {
         private static final Log log = LogFactory.getLog(ReconTimerBean.class);
    @Resource
    TimerService timerService;
    public void createTimer() {
         log.info("Crating timer");
         log.info("timerService [" + timerService + "]");
    Timer timer = timerService.createTimer(20000,
    "Created new timer");
    @Timeout
    public void timeout(Timer timer) {
    log.info("Timeout occurred !!!");
    ========================================
    client code:
    @EJB(beanName="ReconTimerBean")
    ReconTimer timerBean
    if (timerBean != null)
    timerBean.createTimer();
    else log.error ("Timer Bean is null !!!");
    Error is always logged when the bean is deployed.
    ======================================
    weblogic-ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/weblogic-ejb-jar"
         xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
         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 http://www.bea.com/ns/weblogic/weblogic-ejb-jar http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd">
    <weblogic-enterprise-bean>
    <ejb-name>ReconTimerBean</ejb-name>
         <stateless-session-descriptor>
              <pool>          
                   <max-beans-in-free-pool>1</max-beans-in-free-pool>          
                   <initial-beans-in-free-pool>1</initial-beans-in-free-pool>     
              </pool>
         </stateless-session-descriptor>
    <jndi-name>app-recon-bean</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>

    Hi Ashley,
    The Dependency injection has some limitations as well…Please referto the following link: (Web Component Classes That Support Annotations)
    http://download.oracle.com/docs/cd/E13222_01/wls/docs100/webapp/annotateservlet.html
    …Which says that DI is not possible from every web component.
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com/ejbs_weblogic/#comment-165  (Dependency Injection Issues)

  • Error with stateless EJB

    Hi,
    I am new to WebLogic and I trying to learn it. I was doing an exercise with a stateless EJB I got from a book and get this error:
    javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory. Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory
         at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    That class is already in my class path and still does not work. I am using WLS 8.1 on a Linux Suse 9.0 OS, and my IDE is Eclipse. The code seems to be fine seems it is deployed flawlessly by the server. No errors, no warnings. I can post if some one needs to see it. Any ideas?
    Thanks!

    If anyone is interested, and since it seems to be a common anoying problem, the solution is to put the weblogic.jar files in the classpath, and all of the client ones as well.

Maybe you are looking for

  • Wish List UK access and longgevity

    It could be teething trouble, but here in the UK anyway, I find that the Wish List function works on and off. I hope this gets sorted out. I'd like to know if anybody can confirm that the tracks/albums I place there will never be removed? I have had

  • Export quality issues

    When I export from Lightroom 4 my image quality changes dramatically between the Lightroom image and the exported image. I have my export settings at 1500x1500 and 240 pixels per inch. Any ideas on how I can keep the exported image the same as the on

  • Another shot battery thread

    Howdy folks! Purchsed my 15" MBP JAN of 2008 and here are my battery results: Battery Information: Model Information: Serial Number: Sony-ASMB012-374b-7706 Manufacturer: Sony Device name: ASMB012 Pack Lot Code: 0001 PCB Lot Code: 0000 Firmware Versio

  • X-Fi Xtreme Music + Digital I/O + Optical Connection for z-5

    Hi there, im new and very raw so i was wondering if anyone can clear some things up. Ive had my X-Fi Xtreme Music card for about 3 months and in that time i've been using the 3 analogue 3.5mm connections to my z-5500 controller, and i've had no probl

  • HT201263 What does can not restore iphone unknown error occured (3005) mean? is it dead?

    I have an Iphone 3.  Yesterday it was working fine then Itunes said it had an update.  The update was unsucsessful and it said the phone needed to be restored.  I went through the restore steps and recieved an error.  Any suggestions?