Injecting ejbs via @Resource

Hi all,
I have an ejb that injects a helper ejb like
@EJB
Helper help; and whose business method calls the helper beans business method. This works fine.
Now I try to inject the helper ejb as
@Resource(name="Helper") 
Helper help; The first call of the ejb's business method from the client works fine, but the second one throws the following exception (extract):
org.omg.CORBA.BAD_OPERATION: The delegate has not been set!
Please, can someone, who has an ejb that injects another ejb, check if he gets the same problem when @EJB is replaced through something like @Resource(name = ...).
Thanks in advance.
I googled for the error message and found search results dating from around 2004 where the error was due to a bug in the Java-IDL mapping of an old java version. I'm working with glassfish v2 and java 1.6.

Hi, thanks for your reply.
Is there a particular behavior you would like that you don't think is available when using @EJB?No. I read in "EJB 3 in action", 5.2.1 that @Resource can "be used for [...] environment entries, ORB reference and even EJB references" and just tried it out.

Similar Messages

  • How am I able to use an injected EJB in a Managed Bean Constructor?

    JSF 1.2
    EJB 3.0
    Glassfish v1
    Summary:
    Managed bean injected EJB is null when referencing EJB var in constructor.
    Details:
    In my managed bean, I have a constructor that tries to reference an injected EJB, such as:
    public class CustomerBean implements Serializable {
    @EJB private CustomerSessionRemote customerSessionRemote;
    public CustomerBean() {
    List<CustomerRow> results = customerSessionRemote.getCustomerList();
    }The call within the constructor to customerSessionRemote is null - I've double checked this in Netbeans 5.5.
    How am I able to use an injected EJB in a Managed Bean Constructor?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    OK, I was reading the article Web Tier to Go With Java EE 5: A Look at Resource Injection and I understand your statement too.
    Is there any way possible to Inject the EJB prior to the bean instance creation at all?
    Maybe, I need to approach it with the old fashion Java EE 1.4 route and using JNDI in the PostConstruct annotated method to reference the EJB in the managed bean.
    This had to been thought out before, I don't understand why a manged bean's life cycle places any injections at the end of the bean creation.
    Also, now that I understand that the @PostConstruct annotated method will be called by the container after the bean has been constructed and before any business methods of the bean are executed.
    I am trying to reference my EJB as part of the creation of the managed bean.
    What happens: the JSF page loads the managed bean and I need to populate a listbox component with data from an EJB.
    When I try to make the call to the EJB in the listbox setter method, the EJB reference is null.
    Now, I'm not for sure if the @PostConstruct annotation is going to work... hmmmm.
    ** Figured it out. ** I just needed to move the EJB logic that was still in the setter of the component I wanted to populate into the annotated PostConstruct method.

  • Best way to inject EJB's in Struts 2

    Hi all,
    I'd like to ask you what do you think is the best way to inject EJB's in Struts 2 Actions (and perhaps other struts classes such as type converters).
    I've read and implemented both a Struts 2 Interceptor and used CDI. About CDI I've read there's a discussion whether the injected resource should be a private field or injected through the constructor which would help testing.
    Personally I seem to prefer CDI as it looks a bit simpler after you are familiar a bit with the technology.
    What is your preferred solution and why?

    Make sure you are using JDeveloper with a "regular Oracle DB" and not Oracle XE - Oracle XE doesn't have support for JPublisher.
    And make sure you are trying to invoke this from the database navigator window and not from the connection manager of your application.
    Anton - I think you are mixing JPublisher with something else - maybe with Java stored procedures?
    JPublisher just creates a JDBC wrapper that calls the functions in the DB - it doesn't run inside the DB so I don't get your point about the mini JVM?
    So it basically does exactly what you recommended: "access PL/SQL procedures from java directly?"

  • How to inject ejb in servlet

    hi all
    How to inject ejb in servlet ?
    please explain how to config my servlet and my paroject
    I have an ear file with two jar files
    Thanks in advance

    hi
    I have this error in my project
    I have an ear file ,two war file and three jar file in it
    and I did configuration
    but there was this error
    14:19:45,398 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[conference-servlet].[enterLet]] Allocate exception for servlet enterLet: javax.naming.NameNotFoundException: ITrmnlAuthenticationBL not bound
    @Remote
    public interface ITrmnlAuthenticationBL{
    @Stateless
    public class TrmnlAuthenticationBL implements ITrmnlAuthenticationBL{
    public class EnterLet extends HttpServlet {
         @EJB(mappedName = "ITrmnlAuthenticationBL")
         private ITrmnlAuthenticationBL trmnlMg;
    please explain my mistake

  • Injection @EJB  x  InitialContextLookup

    Hello all,
    what is the "lookup" correspondent to this injection:
    @EJB (mappedName="corbaname:iiop:jupiter:3700#ejb/package.HelloRemote")
    Are the following lines?
    InitialContext ic = new InitialContext();
    HelloRemote hello = (HelloRemote) ic.lookup("corbaname:iiop:jupiter:3700#ejb/package.HelloWorld");
    Why these lines dont work? The injection woks fine, but these lines produces an exception:
    "javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]"
    I'm trying for one week now to do this dynamic lookup without succeeding. Please, what am I missing?

    If you're running within a Java EE component the portable way to retrieve the EJB is
    to use a component environment lookup, not a direct global lookup. Just add a
    name() attribute to your @EJB.
    @EJB (name="myejbref", mappedName="corbaname:iiop:jupiter:3700#ejb/package.HelloRemote")
    If the lookup is within an EJB, you can use SessionContext.lookup("myejbref");
    Otherwise, instantiate the no-arg InitialContext and lookup ("java:comp/env/myejbref")
    Whenever the code attempts to bypass the Java EE component environment, it opens
    itself up to portability issues. In this case, we try to support many variations of
    direct global JNDI lookups, but Remote 3.0 Interfaces are not direct CosNaming objects,
    so lookup("corbaname:iiop:...") will not work.
    If you have to pass a dynamic string to the lookup you can try the same approach as
    is recommended for non-Java EE environments, where you create a special
    InitialContext that is configured to point to a particular naming service :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#nonJavaEEwebcontainerRemoteEJB
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Injecting EJB to JSF Converter

    Is it possible to inject EJB (or at least EntityManager) to JSF Converter or Validator?
    I don't know if i'm missing something or is it just impossible - it works when injecting EJB into Managed Bean.
    Thanks.
    S&#322;awek S.

    Slawek_Sobotka wrote:
    Thanks.
    So I'll redefine my question to be problem oriented:
    I have SelectItem that contains Address object.
    I have implemented AddressConverter so that it converts Adress to String simply by using it's id.
    How to convert back: from string (address's id) do Address object?Map it. Two general ways are mentioned here: [http://balusc.blogspot.com/2007/09/objects-in-hselectonemenu.html].
    I would like to load it form DB...That's a bit too expensive for less or more static data.
    Another solutions are:
    - SelectItem should contain address.id instead of address. Than no converter is need. My ManagedBean is reposnsible for translating ids do entities. Works but primitive.JSF can't help that HTTP/HTML only understands Strings (by the way, primitives are also already implicitly converted by EL, you only don't know that).
    - Converter is created by factory method of Managed Bean. MB sets address list to the converter while creating it. List shouldn't be huge if it is used in GUI.
    drawback: loading list in BB twice because converter is used while rendering and while decoding.
    - In converter try to possess MB that has EJB and call method that reutrns entities, sth like this: facesContext.getApplication().getELResolver()...Reloading static data on every request makes als no sense.
    Retoric question: what for are useful JSF Converters?To convert between Object and String, so that it can be passed through HTTP request/response and displayed/taken in HTML.

  • Using External Topics via Resource Mgr?

    I am trying to link external topics from another project to my current project through Resource Manager (RH9), but it doesn't seem to be working. When I add a shared location containing topic (HTML) files, the folder and its contents appears, everything except the topic files. Both projects are FlashHelp. I was lead to believe (Usinging RoboHelp 9: http://help.adobe.com/en_US/robohelp/robohtml/WS1b49059a33f77726-14df8d3712b0ab9d010-8000. html) that I could "Drag images, style sheets, and topics from Project Manager to Resource Manager" (quote from help page), but this does not provide any visible results, either. Am I doing something wrong, or is this just not really something RH9 can do?

    Hi, Rick;
    Thanks for the response. Even though there is no resolution, it's still good to know others are suffering alongside me. I've submitted a feature request to Adobe, pointing out that the lack of this feature diminishes their claim that RH is a great single sourcing solution.
    - Chris
    Captiv8r <[email protected]> wrote:
    Hi there
    Long ago I identified an issue with using Topics this way. But so far it has fallen on deaf ears at Adobe.
    Indeed Adobe doesn't seem to allow Topics to be used that way. You can certainly configure HTML files to appear there but using them will always be a one way street. There isn't a notification that anything changed or a synchronization of the topic in the project with a changed topic in the Resource Manager.
    Please consider submitting a Wish Form to add your voice to others that are requesting topics be available via Resource Manager! (Link is in my sig)
    Cheers... Rick
    | http://www.robowizard.com/pc.gif | Helpful and Handy Links
    http://www.Adobe.com/cfusion/mmform/index.cfm?name=wishform&product=38
    http://www.gooberguides.com/ProductPages/RoboHelp/RoboHelp82Day.htm
    http://www.ShowMeSolutions.biz
    http://sorcererstone.wordpress.com/
    http://www.gooberguides.com |
    >

  • EJB Client/Resource Injection

    Hi,
    could anyone explain to me why the field into which an EJB reference in an EJB client can be injected has to be static? I've read the following in the EJB3.0 tutorial (see below), but I don't know what "static context" means exactly. Care to explain, anyone?
    Thanks, Michael
    Creating a Reference to an Enterprise Bean Instance
    "Java EE application clients refer to enterprise bean instances by annotating static fields with the @EJB annotation. The annotated static field represents the enterprise bean's business interface, which will resolve to the session bean instance when the application client container injects the resource references at runtime.
    @EJB
    private static Converter converter;
    The field is static because the client class runs in a static context."

    The question was about why the field needs to be marked static. mappedName is a separate issue. The reason injected fields/methods in Application Clients need to be marked static is because of the Application Client programming model. It has always been the case that for an Application Client component the developer writes a static void main() method as the entry point, much like a regular Java Client. This means that the Application Client container invokes the application code with a static invocation, i.e. there is no instance of the main class. Injection is only useful if it takes place before the application code runs, so to accomplish that without changing the Application Client programming model, the Java EE platform spec requires that injected fields/methods be marked static.
    As for mappedName, it deals with how to map the ejb dependency to the target bean. By default in SUN's implementation, the remote @EJB dependency will map to the global JNDI name formed by taking the fully qualified type of the remote business interface, in this case <packagename>.Converter. That will work as long as the target Remote EJB has that global JNDI name. If the target Remote EJB's global JNDI name were "GlobalJNDIName", then you would need to explicitly assign that to the client's ejb dependency, as this example shows. That can be done either by using the mappedName() attribute or sun-application-client.xml.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • OEMS/10.1.3.2 MDB/AQ via Resource Adapter - message gone but no "onMessage"

    Hi I have a very simple ear file containing an EJB/MDB and a JMS Resource Adapter configured to listen to an AQ, JMS Provider. What I see happening is that messages are gone from the AQ (after some time), I also see some ejb activitiy - enabled via logging - but my onMessage is never called. Was could be causing this?

    Things are getting stranger by the minute (for me)
    I've just changed my PL/SQL procedure to include at least one of the JMS properties which seem necessary for MDB's to pick things up: JMS_OracleDeliveryMode. With that change, and making sure the rest of the header properties (like username) were in order, I saw my MDB picking up messages that were enqueue via PL/SQL... but.... only if a MDB instance was readily available.
    Whenever ejbRemove() was called by the container, entering another JMS message in the queue using PL/SQL didn't result in the onMessage() being called. Message where still available in 'READY' state. Now what is really disturbing is that whenever I called my standalone Java client to enter a new JMS message, obviously this was picked up - but as a side effect every subsequent enqueue using PL/SQL also resulted in onMessage() being called.

  • Is it possible to inject EJB 3.0 SLSB into EntityImpl?

    Hello,
    I'm running JDev Studio Edition Version 11.1.2.3.0.
    Is it possible to inject an EJB 3.0 stateless session bean into an EntityImpl Class via the @EJB annotation? I need to do so in order to use the SLSB to schedule an EJB 3.0 timer.
    If injection is not possible, how do I do a manual lookup?
    Any suggestions with sample config and code would be appreciated.
    Many thanks.

    So you're saying that there are going to be new features in the released product that have not been tested in a beta release? I can't believe you'd go to release without another public beta considering the number of bugs there are in the current public beta never mind what else might be introduced by new features. That aside I appreciate the work of the developers.
    Also, I've seen several posts that refer to bug tracking ids. Where is the bug database? It's hard to know if a bug should be submitted here on this board without knowing which bugs have already been identified. With JDeveloper now available for use by the masses, a public database is essential to keeping message board traffic manageable. An RSS feed for the bug database would be an excellent feature.

  • Connectivity from ejb to Resource Adapter at run time

              I am facing a problem regarding the look-up of the Resource Adapter from the Ejb.
              To explain :
              1.I have The <resource-ref> tag in ejb-jar.xml set at follows :
              <resource-ref>
              <description>The Resource Adapter</description>
              <res-ref-name>eis/RitResourceAdapter</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
              </resource-ref>
              and the <resource-description> tag in weblogic-ejb-jar.xml as follows:
              <resource-description>
              <res-ref-name>eis/RitResourceAdapter</res-ref-name>
              <jndi-name>eis/RitResourceAdapterConnectorJNDINAME</jndi-name>
              </resource-description>
              2.Even though I have mentioned the res-ref-type as javax.sql.Datasource , in my
              code I have done :
              rcf = (RitConnectionFactory) c.lookup ("java:comp/env/eis/RitResourceAdpapter");
              Where rcf is the my Resource Adapter specific Connection Factory (one which
              I have prepared and not
              the javax.resource.cci.ConnectionFactory). So this means the connection
              object which I get is casted to
              get my own application specific connection object.
              3.When I run my servlet (which looks up the Ejb and which in turn looks-up the
              Resource Adapter) it works fine to the point that it looks-up the bean successfully
              but fails when it tries to do so for Resource Adapter. The Server exception is
              as follows :
                        javax.ejb.EJBException
                        - with nested exception:
              [javax.naming.NameNotFoundException: Unable to resolve comp/env/eis/RitResourceAdpapter/
              Resolved: 'comp/env/eis' Unresolved:'RitResourceAdpapter' ; remaining name '']
              It will be great to hear about any solution from you people.
              For your information :
              I am using Weblogic 6.1, both the ejb jar and the RitResourceAdapter.rar has been
              deployed and the relevant portion of the weblogic-ra. xml is :
              <connection-factory-name>LogicalNameOfRitResourceAdapter</connection-factory-name>
              <jndi-name>eis/RitResourceAdapterConnectorJNDINAME</jndi-name>
              Regards,
              Ritwik
              

    > My question here is that is there any way where I do not put the queue name in the sender adapter at design time and based on the data availability in the queue let the sender adapter know the queue name to be processed at run time.
    Unfortunately for JMS Sender CC it is not possible, but other way around is possible. I.e. you can dynamically choose the receving queue names by using ASMA "JMSReplyTo" in JMS Sender CC.
    Regards,
    Sarvesh

  • Problem injecting ejb in war

    This problem have dogged me for one week but cant seem to know where the problem is.
    i am creating an enterprise with war, ejb and jar.
    i want both web clients and application client to share the code in ejb to ease maintainablility.
    i have a jsf backing bean that is supposed to get some data from an enterprise bean in ejb.
    the backing bean has this method
    public class CategoryController {
    @Stateful
    public class CategoryControllerBean implements CategoryControllerRemote {
        @PersistenceUnit(unitName = "JNationForum-ejbPU")
        private EntityManagerFactory emf;
        private EntityManager getEntityManager() {
            return emf.createEntityManager();
    public List<CategoryDetails> getCategorys(){
             EntityManager em = getEntityManager();
             List<Category> categorys=null;
             try{
                Query q = em.createQuery("select object(o) from Category as o");
                return copyCategorysToDetails(categorys=q.getResultList());
            } finally {
                em.close();
         private List<CategoryDetails> copyCategorysToDetails(List categorys) {
            List<CategoryDetails> detailsList = new ArrayList<CategoryDetails>();
            Iterator i = categorys.iterator();
            while (i.hasNext()) {
                Category category = (Category) i.next();
                CategoryDetails details = new CategoryDetails(
                        category.getCategorypk(),
                        category.getTitle(),
                        category.getDescription(),
                        category.getActive());
                detailsList.add(details);
            return detailsList;
    }it brings this error
    type Exception report
    message
    descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: com.sun.enterprise.InjectionException: Exception attempting to inject Unresolved Ejb-Ref com.safarisoftsolutions.jnationforum.war.bean.CategoryController/categoryControllerBean@jndi: com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean@null@com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean@Session@null into class com.safarisoftsolutions.jnationforum.war.bean.CategoryController
    root cause
    javax.faces.FacesException: com.sun.enterprise.InjectionException: Exception attempting to inject Unresolved Ejb-Ref com.safarisoftsolutions.jnationforum.war.bean.CategoryController/categoryControllerBean@jndi: com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean@null@com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean@Session@null into class com.safarisoftsolutions.jnationforum.war.bean.CategoryController
    root cause
    com.sun.enterprise.InjectionException: Exception attempting to inject Unresolved Ejb-Ref com.safarisoftsolutions.jnationforum.war.bean.CategoryController/categoryControllerBean@jndi: com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean@null@com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean@Session@null into class com.safarisoftsolutions.jnationforum.war.bean.CategoryController
    root cause
    javax.naming.NameNotFoundException: com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean#com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean not found
    note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server 9.1 logs.

    This problem have dogged me for one week but cant seem to know where the problem is.
    i am creating an enterprise with war, ejb and jar.
    i want both web clients and application client to share the code in ejb to ease maintainablility.
    i have a jsf backing bean that is supposed to get some data from an enterprise bean in ejb.
    the backing bean has this method.package com.safarisoftsolutions.jnationforum.war.bean;
    public class CategoryController {
        @EJB
        private CategoryControllerBean categoryControllerBean;
        public DataModel getCategorys() {
                model = new ListDataModel(categoryControllerBean.getCategorys());
                return model;
    }from the above you can see am trying to get a list from categoryControllerBean.getCategorys() which is a enterprise bean whose code is
    public class CategoryController {
    @Stateful
    public class CategoryControllerBean implements CategoryControllerRemote {
        @PersistenceUnit(unitName = "JNationForum-ejbPU")
        private EntityManagerFactory emf;
        private EntityManager getEntityManager() {
            return emf.createEntityManager();
    public List<CategoryDetails> getCategorys(){
             EntityManager em = getEntityManager();
             List<Category> categorys=null;
             try{
                Query q = em.createQuery("select object(o) from Category as o");
                return copyCategorysToDetails(categorys=q.getResultList());
            } finally {
                em.close();
         private List<CategoryDetails> copyCategorysToDetails(List categorys) {
            List<CategoryDetails> detailsList = new ArrayList<CategoryDetails>();
            Iterator i = categorys.iterator();
            while (i.hasNext()) {
                Category category = (Category) i.next();
                CategoryDetails details = new CategoryDetails(
                        category.getCategorypk(),
                        category.getTitle(),
                        category.getDescription(),
                        category.getActive());
                detailsList.add(details);
            return detailsList;
    }it brings this error
    type Exception report
    message
    descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: com.sun.enterprise.InjectionException: Exception attempting to inject Unresolved Ejb-Ref com.safarisoftsolutions.jnationforum.war.bean.CategoryController/categoryControllerBean@jndi: com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean@null@com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean@Session@null into class com.safarisoftsolutions.jnationforum.war.bean.CategoryController
    root cause
    javax.faces.FacesException: com.sun.enterprise.InjectionException: Exception attempting to inject Unresolved Ejb-Ref com.safarisoftsolutions.jnationforum.war.bean.CategoryController/categoryControllerBean@jndi: com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean@null@com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean@Session@null into class com.safarisoftsolutions.jnationforum.war.bean.CategoryController
    root cause
    com.sun.enterprise.InjectionException: Exception attempting to inject Unresolved Ejb-Ref com.safarisoftsolutions.jnationforum.war.bean.CategoryController/categoryControllerBean@jndi: com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean@null@com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean@Session@null into class com.safarisoftsolutions.jnationforum.war.bean.CategoryController
    root cause
    javax.naming.NameNotFoundException: com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean#com.safarisoftsolutions.jnationforum.ejb.bean.CategoryControllerBean not found
    note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server 9.1 logs.

  • Inject EJB using @EJB in Servlet Filter on Weblogic 11g

    Hi All,
    I want to inject the EJB (Local interface) into the Servlet Filter and the EAR is deployed on Weblogic 11g.
    My question is:
    Shall the @EJB Annotation work on Weblogic 11g or it will be ignored in case of Servlet or Servlet Filter?
    OR
    I have to do look up as below and mention the references in web.xml and weblogic xml file:
    I know below code should be used when you have remote interface.
    Hashtable env = new Hashtable();
    env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
    Context ctx = new InitialContext( env );
    ctx.lookup( "myejb" );
    Thanks

    Hi,
    It should work in 11g.
    Regards,
    Kal

  • Dependecy injection EJB into a jsp

    Hello,
    How can I do a dependency injection of and EJB into a jsp?
    When Iu2019m trying to used it (see below), It doesnu2019t work, What Iu2019m doing wrong?
    Also I tried to do a lookup, but I canu2019t do a cast because the classe returned by the lookup is some Proxy class and the only way that Iu2019ve find to access the EJBu2019s methods is through reflection.
    Regards,
    Janeth
    @EJB (name = "crystal.com.co/captura_produccion_ear/CapturaPrimeraEjbBean")
         private CapturaPrimeraEjbRemote capPrimeraEjbRemote;
    if (capPrimeraEjbRemote != null) {
           capPrimeraEjbRemote.test();
    else{
              out.println("null");

    Thank both for the answer, about the lookup:
    Vladimir you are right about implementation, actually I print trough reflection the interfaces of Proxy class, and I obtain this:
    co.com.crystal.eficiencia.primera.CapturaPrimeraEjbRemote
    javax.ejb.EJBObject
    com.sap.engine.services.ejb3.runtime.ComponentInterface com.sap.engine.services.ejb3.runtime.ReplaceableProxy
    The common code is:
    Properties props = new Properties();
         props.put(Context.INITIAL_CONTEXT_FACTORY,
                   "com.sap.engine.services.jndi.InitialContextFactoryImpl");
         props.put(Context.PROVIDER_URL, "localhost:50004");
         InitialContext ctx = new InitialContext(props);
         Object object = ctx.lookup("crystal.com.co/captura_produccion_ear/REMOTE/CapturaPrimeraEjbBean/co.com.crystal.eficiencia.primera.CapturaPrimeraEjbRemote");
         out.println(object.getClass());
    If I do injection, itu2019s work correctly:
    Method findAll = object.getClass().getMethod("test", null);
         String listaTurnos = (String) findAll.invoke(object, null);
         out.print(listaTurnos);
    But if I use narrow or cast, it doesnu2019t work (I get a java.lang.ClassCastException):
    co.com.crystal.eficiencia.primera.CapturaPrimeraEjbRemote capPrimera = (co.com.crystal.eficiencia.primera.CapturaPrimeraEjbRemote)PortableRemoteObject.narrow(object, co.com.crystal.eficiencia.primera.CapturaPrimeraEjbRemote.class);
         String listaTurnos = capPrimera.test
         out.print(listaTurnos);
    or the cast:
    co.com.crystal.eficiencia.primera.CapturaPrimeraEjbRemote capPrimera = (co.com.crystal.eficiencia.primera.CapturaPrimeraEjbRemote)object;
    What I have to do to check the correctly way to do the cast or the narrow? What Iu2019m doing wrong?
    Thanks
    Janeth

  • Call another WebLogic's EJBs from resource adapter?

              Is it possible to call another WebLogic's EJBs from a resource adapter?
              A call to the javax.naming.InitialContext(Hashtable environment) results in a
              VersioningError:
              weblogic.common.internal.VersioningError: Incompatible service packs in CLASSPATH:
              (BEA Systems, WebLogic Server 6.1 SP4 11/08/2002 21:50:43 #221641 , 6.1.4.0)
              not compatible with
              (BEA Systems, WebLogic Server 6.1 SP3 06/19/2002 22:25:39 #190835 , 6.1.3.0)
              at weblogic.common.internal.VersionInfo.verifyPackages(VersionInfo.java:128)
              at weblogic.common.internal.VersionInfo.<init>(VersionInfo.java:60)
              at weblogic.common.internal.VersionInfo.initialize(VersionInfo.java:79)
              at weblogic.kernel.Kernel.initialize(Kernel.java:122)
              at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:101)
              at weblogic.jndi.WLInitialContextFactoryDelegate.<init>(WLInitialContextFactoryDelegate.java:166)
              at java.lang.Class.newInstance0(Native Method)
              at java.lang.Class.newInstance(Class.java:232)
              at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:147)
              at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:241)
              at javax.naming.InitialContext.init(InitialContext.java:217)
              at javax.naming.InitialContext.<init>(InitialContext.java:193)
              at java.lang.reflect.Constructor.newInstance(Native Method)
              I'm not sure it will always be possible to match the version, although here upgrading
              the SP3 to SP4 will probably be done soon.
              Does anyone have experience with this?
              Or better: is there any documentation on this issue?
              

              Hi Hans,
              Here is the link for Weblogic SP3 / SP4 vulnerability and comparison for
              http://216.239.53.104/search?q=cache:RqqaQ3HZdwoJ:www.nipc.gov/cybernotes/2003/cyberissue2003-06.pdf+Versioning+Error+in+BEA+weblogic+6.1+SP3+and+SP4&hl=en&ie=UTF-8
              Hope this will help you.
              Let me know if u have any further problems.
              rgds
              KSK
              "Hans Bausewein" <[email protected]> wrote:
              >
              >
              >Is it possible to call another WebLogic's EJBs from a resource adapter?
              >
              >A call to the javax.naming.InitialContext(Hashtable environment) results
              >in a
              >VersioningError:
              >
              >weblogic.common.internal.VersioningError: Incompatible service packs
              >in CLASSPATH:
              >(BEA Systems, WebLogic Server 6.1 SP4 11/08/2002 21:50:43 #221641 ,
              >6.1.4.0)
              >not compatible with
              >(BEA Systems, WebLogic Server 6.1 SP3 06/19/2002 22:25:39 #190835 , 6.1.3.0)
              > at weblogic.common.internal.VersionInfo.verifyPackages(VersionInfo.java:128)
              > at weblogic.common.internal.VersionInfo.<init>(VersionInfo.java:60)
              > at weblogic.common.internal.VersionInfo.initialize(VersionInfo.java:79)
              > at weblogic.kernel.Kernel.initialize(Kernel.java:122)
              > at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:101)
              > at weblogic.jndi.WLInitialContextFactoryDelegate.<init>(WLInitialContextFactoryDelegate.java:166)
              > at java.lang.Class.newInstance0(Native Method)
              > at java.lang.Class.newInstance(Class.java:232)
              > at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:147)
              > at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:241)
              > at javax.naming.InitialContext.init(InitialContext.java:217)
              > at javax.naming.InitialContext.<init>(InitialContext.java:193)
              > at java.lang.reflect.Constructor.newInstance(Native Method)
              >
              >
              >
              >I'm not sure it will always be possible to match the version, although
              >here upgrading
              >the SP3 to SP4 will probably be done soon.
              >
              >Does anyone have experience with this?
              >
              >Or better: is there any documentation on this issue?
              >
              

Maybe you are looking for

  • How do I create a podcast button on my iPod Touch?

    I use my touch mainly for listening and watching podcasts. Getting to them isn't that smooth, clicking on music, then more, then finally podcasts. It would be far better if I had a dedicated podcast button that I could have on the main bar. Is it pos

  • Oracle 10g forms problem

    hi can any body help me? i have installed oracle developer 10g with oracle 8i database when i run any form including the test.fmx it always ask to install JInitiator although it has been installed (appears in the control panel and in c:\program file\

  • Creating a Paragraph Format

    Hi All, Please let me know how to create a paragraph format in sap scripts. I tried to create a paragraph format, because there were some tab space issues with the old paragraph formats.for this at the header level I clicked on paragraph format and e

  • Admin server on MS window while Managed Server on Unix

              Hi,           Is it possible to run Weblogic Administrative server 7.0 SP1 on MS Windows Platform           while run the Managed (or Clustered) Server instances on several Unix box           such as HPUX or Solaris?           thanks       

  • ToC stops at 17?

    Hi so all my chapter titles have the exact same paragraph styles applied to them, however no matter what I try when i export to epub the toc style  for some reason stops at chapter seventeen of twenty five. Help?