Ejb-ref in oc4j 10.1.3.2.0 standalone

Hi,
i asked this before, but i didnt receive any answers. So i looked in more deeply to be more precise.
I developed and deployed a Webservice with JDEV 10.1.3 which looks up EJBs in a remote oc4j. I configured the ejb-references in web.xml and orion-web.xml like shown in the documentation by using ejb-ref-mapping attribute jndi-properties-file and remote-server-ref=true. That works fine in embedded oc4j 10.1.3.2.0.
If i deploy the same application to standalone oc4j 10.1.3.2.0 the application fails wih a naming exception. If i hardcode the jndi-properties again all works fine, so it seems to be a problem of configuration.
So i let print out some information about the InitialContext constructed im the ServiceLocator-Class i use:
ctx = new InitialContext( );
Hashtable ha = ResourceManager.getInitialEnvironment(null);
logger.debug("" + ha.get(InitialContext.PROVIDER_URL));
NamingEnumeration nenum = ctx.listBindings("java:comp/env");
There are indeed some differences between the standalone and the embedded as listed below:
embedded:
07/09/17 17:53:36 ormi://remote-IP: javax.naming.Reference:Reference Class Name: javax.ejb.EJBHome
Type: location
Content: MyBeanFacade
Type: remote-server-ref
Content: true
Type: jndi-properties-file
Content: jndi.properties
07/09/17 17:53:36 ejb: javax.naming.Context:[Context TestWS-org-webapp: {MyBeanFacade=Reference Class Name: javax.ejb.EJBHome
Type: location
Content: MyBeanFacade
Type: remote-server-ref
Content: true
Type: jndi-properties-file
Content: jndi.properties
, ejb/MBeanServerUserEjb=Reference Class Name: javax.ejb.EJBHome
Type: location
Content: MBeanServerUserEjb
standalone:
07/09/17 18:14:06 ormi://IP-ofTheHostOfOC4J:23791/default
07/09/17 18:14:06 MyBeanFacade: javax.naming.Reference:Reference Class Na
me: javax.ejb.EJBHome
Type: location
Content: MyBeanFacade
07/09/17 18:14:06 ejb: javax.naming.Context:[Context webapp: {MyBeanFacad
e=Reference Class Name: javax.ejb.EJBHome
Type: location
Content: MyBeanFacade
, ejb/MBeanServerUserEjb=Reference Class Name: javax.ejb.EJBHome
Type: location
Content: MBeanServerUserEjb
The difference is obvious.
Interestingly http://www.oracle.com/technology/oracleas/schema/orion-web-10_0.xsd
dosnt neither define jndi-properties-file nor remote-server-ref for ejb-ref-mapping. On the other hand, thats what one finds in the documentation.
Another problem is, that originally the oc4j tried to lookup with protocol ormis.
So i had first to delete ssl-port = "23943" from rmi.xml to see ormi.
Now on the first call of the Web Service after start of the server in fact the lookup goes to the remote-IP not to the IP-ofTheHostOfOC4J as written before. But the lookup fails with a namingexception anyway. After the second call the lookup goes to IP-ofTheHostOfOC4J again, even though the application is restarted or redeployed.
Its not very funny to go through this configuration issues with every new revision of the software. Perhaps the lack of feedback in this forum is a hint to open more often a tar than to post herein.
Regards chris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Thank u both for your answers.
First of all this is not a Web Service specific issue at all, its about configuring ejb-references for web-components.
The difference was between embedded and standalone.
The reason for this behavior is a bug in 10.1.3.1 standalone.
I think this could be fixed in this 1/2 GB patch from july 2007, so why not upgrading to 10.1.3.3 for which i assume that it includes the fix as Olaf proposed following my proposal ;-)
Anyway you can work around it quite simple:
The reason is that during the deployment the contents of the custom (contained in the ear-file) orion-web.xml is not properly added to the generated orion-web.xml in applications-deployments.
The ejb-remote attrbiute is discarded.
So just add it to the generated orion-web.xml after the deployment and restart the oc4j. Dont redeploy or restart the application cause a redopleyment would overwrite your changes.
Thanks for my help :-)
Chris

Similar Messages

  • How to lookup EJBs deployed in OC4J from a standalone client application

    Hello all,
    I am trying to lookup an EJB deployed in OC4J 10.1.3 from a standalone client application using the following code:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791");
    env.put(Context.SECURITY_PRINCIPAL, "jazn.com/test");
    env.put(Context.SECURITY_CREDENTIALS, "test");
    Context context = new InitialContext(env);
    Object ref = context.lookup("ejb/Dispatch");
    I get the following error:
    javax.naming.NameNotFoundException: ejb/Dispatch not found
         at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:51)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
    For the lookup string I've also tried:
    "java:comp/env/ejb/Dispatch" and "Dispatch"
    For the Context.PROVIDER_URL property I've also tried:
    opmn:ormi://localhost:6003:instance
    The result is always the same.
    I appreciate if someone could help me with this?
    Thanks,
    Georgi

    Georgi,
    Your question has been discussed many times on this forum. Search the forum archives for "RMIInitialContextFactory".
    The PROVIDER_URL needs to include the name of the deployed application that your EJB is part of, for example:
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791/MyApp");The lookup name has to be the value of the "ejb-name" element in your "ejb-jar.xml" descriptor file.
    Your SECURITY_PRINCIPAL value looks strange to me. Personally, I use "principals" (and not JAZN), so I modified the "application.xml" file (in the "j2ee/home/config" subdirectory) to use "principals". Look for the following comment in that file:
    <!-- Comment out the jazn element to use principals.
          When both jazn and principals are present jazn is used  -->Good Luck,
    Avi.
    Message was edited by:
    Avi Abrami

  • Running CMP EJB in remote OC4J fails, works in embedded. Oracle 9i

    I more or less followed the EJB Tutorial (in the help) for creating a session-entity bean facade from Oracle 9i tables. Everything executes correctly in the embedded oc4j but it fails on the remote oc4j with
    java.sql.SQLException: Invalid column name
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:187)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:229)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:292)
         at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:5632)
         at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:716)
         at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1506)
         at com.evermind.sql.FilterResultSet.getString(FilterResultSet.java:585)
         at EmployeeLocalHome_EntityHomeWrapper13.findAll(EmployeeLocalHome_EntityHomeWrapper13.java:1260)
    Then I also created another simpler CMP EJB that just has 3 fields from Oracle table. This one doesn't even work in embedded oc4j :
    com.evermind.server.rmi.OrionRemoteException: Database error: ORA-01747: invalid user.table.column, table.column, or column specification
         java.util.Collection TimesheetHoursHome_EntityHomeWrapper11.findAll()
    Are there any known problems I should look out for with generating CMP EJBS with wizards?
    I think the IDE is more intuitive than WSAD. It would be great it things worked though.
    Another question is regarding relationships. Do the wizards always use ejb-refs to implement relationships? It should be easy enough to add them with EJB Editor if they do not.
    Thanks for any help.

    Known issues are documented in the release notes
    http://otn.oracle.com/products/jdev/htdocs/readme_903Preview.html#ejb
    <<<Another question is regarding relationships. Do the wizards always use ejb-refs to implement relationships? >>>>
    Not sure what you meant here. If you reverse engineer let us say DEPT and EMP tables, foreign key relationships between the tables are reverse engineered as CMR but there aren't any ejb-ref/ejb-local-ref tags which get generated in the deployment descriptor.
    <<It should be easy enough to add them with EJB Editor if they do not. >>
    You can double-click on the EJB to bring the EJB Module Editor and select "Relationships" node to add/edit/delete relationships visually.
    raghu
    JDev Team

  • Ejb-ref-mapping in orion-ejb.jar missing location attribute after deployment

    I have noticed that on several of my entity beans that after deployment the <ebj-ref-mapping location="JNDIName" name="LocalName"/> is missing the location attribute. This causes any attempts to lookup the EJBHome for that EJB to fail because the path to the EJBHome in JNDI cannot be found (obviously!). The problem is that this causes me to manually edit the application-deployment/<app>/<ejb.jar>/orion-ejb.zml after each deployment via the admin.jar. This seems like a bug with OC4J and I am wondering if Oracle is aware/doing something to fix this?
    I have noticed that the same problem exists for session beans, however, for some strange reason the EJBHomes can still be resolved in JNDI. In all cases the location in JNDI is different then the <ejb-ref-name> I used in the client EJB.
    Example being I have an entity bean at com.foo.Foo and the session bean uses lookup("java:comp/env/ejb/Foo") it is still able to find the EJB even though the orion-ejb.xml looses the location attribute. If the case is an entity bean referencing another entity bean in the same fashion I get an error because the location attribute is missing.

    If the 'location' value is same as the 'name' value, then even though the location attribute is missing, it is ok and should work. If they are not the same, then you should have defined the ejb-link element in your ejb-jar.xml when defining this ejb-ref and that would make the location attribute appear in the generated orion-ejb-jar.xml.
    If the referenced bean is from a different application (EAR), then you should have used the -parent option when deploying the application.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Kris Trujillo ([email protected]):
    I have noticed that on several of my entity beans that after deployment the <ebj-ref-mapping location="JNDIName" name="LocalName"/> is missing the location attribute. This causes any attempts to lookup the EJBHome for that EJB to fail because the path to the EJBHome in JNDI cannot be found (obviously!). The problem is that this causes me to manually edit the application-deployment/<app>/<ejb.jar>/orion-ejb.zml after each deployment via the admin.jar. This seems like a bug with OC4J and I am wondering if Oracle is aware/doing something to fix this?
    I have noticed that the same problem exists for session beans, however, for some strange reason the EJBHomes can still be resolved in JNDI. In all cases the location in JNDI is different then the <ejb-ref-name> I used in the client EJB.
    Example being I have an entity bean at com.foo.Foo and the session bean uses lookup("java:comp/env/ejb/Foo") it is still able to find the EJB even though the orion-ejb.xml looses the location attribute. If the case is an entity bean referencing another entity bean in the same fashion I get an error because the location attribute is missing.<HR></BLOCKQUOTE>
    null

  • Trasaction problem when migrate ejb application from oc4j 10.1.2 to 10.1.3

    When i migrate my ejb application from oc4j 10.1.2 to 10.1.3
    in application log i found following many exceptions:
    where is problem? on AS 10.1.2 all works fine.
    javax.transaction.SystemException: Transaction state is COMMITTED and therefore can not be suspended, transaction
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ApplicationServerTransaction.suspend(ApplicationServerTransaction.java:356)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ApplicationServerTransactionManager.suspend(ApplicationServerTransactionManager.java:541)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.EJBTransactionManager.suspend(EJBTransactionManager.java:186)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.EJBTransactionManager.suspendLocal(EJBTransactionManager.java:163)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.BeanPool.suspend(BeanPool.java:588)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.BeanPool.destroyContext(BeanPool.java:460)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.BeanPool.releaseContext(BeanPool.java:306)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.BMPOrionEntityBeanPool.releaseContext(BMPOrionEntityBeanPool.java:72)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.EntityEJBHome.releaseContextInstance(EntityEJBHome.java:114)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.EntityEJBHome.passivateAndRelease(EntityEJBHome.java:182)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.EntityEJBObject.releaseContext(EntityEJBObject.java:402)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.EntityEJBObject.removeFromCacheNew(EntityEJBObject.java:336)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.EntityEJBObject.endTransaction(EntityEJBObject.java:178)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ApplicationServerTransactionSynchronization.endTransaction(ApplicationServerTransactionSynchronization.java:198)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ApplicationServerTransactionSynchronization.freeEjbResources(ApplicationServerTransactionSynchronization.java:179)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ApplicationServerTransactionSynchronization.afterCompletion(ApplicationServerTransactionSynchronization.java:677)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ApplicationServerTransaction.callSynchronizationAfterCompletion(ApplicationServerTransaction.java:1215)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ApplicationServerTransactionManager.freeResources(ApplicationServerTransactionManager.java:394)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ApplicationServerTransaction.doCommit(ApplicationServerTransaction.java:282)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ApplicationServerTransaction.commit(ApplicationServerTransaction.java:162)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ApplicationServerTransactionManager.commit(ApplicationServerTransactionManager.java:472)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.EJBTransactionManager.end(EJBTransactionManager.java:143)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:57)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermindhttp://Oracle Containers for J2EE 10g (10.1.3.4.0) .server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
    any idea?
    Thanks. J.

    java.lang.NoSuchMethodError: java.lang.String oracle.adf.model.BindingContext.findBindingContainerIdByPath(java.lang.String) at oracle.adf.controller.v2.struts.actions.DataAction.mappingCreate
    Refer Steve's blog
    http://radio-weblogs.com/0118231/stories/2006/02/28/notesOnMigratingAdfstruts1012ApplicationsTo1013.html

  • Ejb-ref error when deploying a previously working ear on weblogic 8.1

    when deploying an ear module on weblogic 8.1 i get the following error:
    The ejb-link 'CustomessagingBrick.jar/CustomMessaginBrick' declared in ejb-ref
    or ejb-local-ref 'ejb/Service2' in the application module 'cmbrick.war' could
    not be resolved. The target EJB for the ejb ref could not be found.
    The ear is composed of two sub-modules:
    CustomMessaginBrick.jar
    cmbrick.war.
    The same ear was deployed on weblogic 6.1.
    Every reference in the ear seems in the right place so i am really clueless.
    Hereafter i include the relevant portions of the deployment descriptors.
    the web.xml for cmbrick.war contains the following data:
    <ejb-local-ref>
    <ejb-ref-name>ejb/Service2</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>com.hutchison3g.core.brick.custom.messaging.CustomMessagingBrickLocalHome</local-home>
    <local>com.hutchison3g.core.brick.custom.messaging.CustomMessagingBrickLocal</local>
    <ejb-link>CustomMessagingBrick</ejb-link>
    </ejb-local-ref>
    its weblogic.xml file is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN"
    "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
    <weblogic-web-app>
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>ejb/Service2</ejb-ref-name>
    <jndi-name>Service2</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    </weblogic-web-app>
    while the weblogic-ejb-jar for CustomMessaging bricks contains the following:
    <weblogic-enterprise-bean>
    <ejb-name>CustomMessagingBrick</ejb-name>
    <stateless-session-descriptor>
    <pool>
    </pool>
    <stateless-clustering>
    </stateless-clustering>
    </stateless-session-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    <jndi-name>Service2</jndi-name>
    </weblogic-enterprise-bean>....

    when deploying an ear module on weblogic 8.1 i get the following error:
    The ejb-link 'CustomessagingBrick.jar/CustomMessaginBrick' declared in ejb-ref
    or ejb-local-ref 'ejb/Service2' in the application module 'cmbrick.war' could
    not be resolved. The target EJB for the ejb ref could not be found.
    The ear is composed of two sub-modules:
    CustomMessaginBrick.jar
    cmbrick.war.
    The same ear was deployed on weblogic 6.1.
    Every reference in the ear seems in the right place so i am really clueless.
    Hereafter i include the relevant portions of the deployment descriptors.
    the web.xml for cmbrick.war contains the following data:
    <ejb-local-ref>
    <ejb-ref-name>ejb/Service2</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>com.hutchison3g.core.brick.custom.messaging.CustomMessagingBrickLocalHome</local-home>
    <local>com.hutchison3g.core.brick.custom.messaging.CustomMessagingBrickLocal</local>
    <ejb-link>CustomMessagingBrick</ejb-link>
    </ejb-local-ref>
    its weblogic.xml file is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN"
    "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
    <weblogic-web-app>
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>ejb/Service2</ejb-ref-name>
    <jndi-name>Service2</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    </weblogic-web-app>
    while the weblogic-ejb-jar for CustomMessaging bricks contains the following:
    <weblogic-enterprise-bean>
    <ejb-name>CustomMessagingBrick</ejb-name>
    <stateless-session-descriptor>
    <pool>
    </pool>
    <stateless-clustering>
    </stateless-clustering>
    </stateless-session-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    <jndi-name>Service2</jndi-name>
    </weblogic-enterprise-bean>....

  • More information about the ejb-ref element of ejb-jar.xml

    Hello,
    I am currently studying ejbs and I came across the ejb-ref element of the ejb-jar.xml file. I am in reference to O'Reilly Entreprise JavaBeans book. The book says that, thanks to the ejb-ref element it is possible to access one ejb from another ejb with the following client code:
    InitialContext jndiContext = new InitialContext();
    Object ref = jndiContext.lookup("java:comp/env/ejb/ProcessPaymentHomeRemote");
    ProcessPaymentHomeRemote home = (ProcessPaymentHomeRemote) PortableRemoteObject.narrow(ref, ProcessPaymentHomeRemote.class);I thought one could invoke the above client code without the ejb-ref element being present in the ejb-jar.xml... I am right or wrong?
    Then why the need for the ejb-ref element? Can anyone give me a concrete example of usage of the ejb-ref element where the ejb-ref element really is useful? What are the advantages of using the ejb-ref element?
    Thanks in advance,
    Julien Martin.

    Hi Julien,
    The main reason is portability. It's true that in many J2EE implementations it is possible to access an EJB's Home object without going through the component context (java:comp/env), but all such approaches are NOT portable. In the J2EE programming model, all resource access is made via the private component namespace. Using this level of indirection allows the bean developer to code the application without having to know which physical resource will be used at runtime. Each J2EE implementation can use a different scheme to identity physical resources, so by sticking to logical references in your code, you guarantee portability. Finally, you have the advantage that you can change which physical resource is mapped at deployment time without having to change your code.
    So, the bottom line is, whenever you have any J2EE component (ejb, servlet, jsp, Application Client) that looks up an ejb, data source, queue, connection factory, etc., always use the environment reference type that J2EE defines for it and look it up via java:comp/env.
    --ken
    Kenneth Saks
    J2EE SDK Team
    SUN Microsystems

  • Web.xml question -- ejb-ref

    Can anyone explain the reasons for using the <ejb-ref> tag in the web.xml file?
    Currently, I have a context-param that matches a param-name to a param-value. My code looks up the param-value and, via JNDI, gets the EJB referenced.
    Does the <ejb-ref> tag provide an easier, more standard method for doing this or is it there just to show that particular EJB is referenced?
    Any information would be very helpful.

    Thanks, but this makes no sense to me. Why should a
    web app be different than any other app? Why make a
    special tag?
    Is this tag required? Is it possible to use an EJB
    without it or is this someone required?Your webapp can access the ejb without this tag at all but using its jndi name. This tag (<ejb-ref>) is just a standard way of accessing ejb's within the webapp.
    For eg. consider this WEB.XML,
    <ejb-ref>
    <description>Reference to DEPT bean</description>
    <ejb-ref-name>EJB-DeptRecord</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.test.DeptHome</home>
    <remote>com.test.DeptRemote</remote>
    </ejb-ref>
    You can lookup like this using the ejb-reference name.
    Context ctx = new InitialContext();
    Object obj = ctx.lookup("java:comp/env/EJB-DeptRecord"); <-------
    Since JNDI names usually have directory structure (eg. /test/ejb/..),
    this ejb-ref tag provides a convenient way to do the lookup without the jndi-name cluttering up your code.

  • Ejb ref resolution error

    Dear all,
    I try to set up a simple ejb environment. I managed to run the converter example from the JEE tutorial bundle in the NetBeans / Glassfish environment.
    Then I tried to write a standalone java client. The code consists in essential of the statements
    Context ctx = new InitialContext();
    ctx.lookup("converter.ejb.Converter");Unfortunately, running this program from a windows command line by the "java" command (plus some classpath settings) results in:
    NamingException: ejb ref resolution error for remote business interface converter.ejb.ConverterThe jndi entries of the app server are
    jndi root
      |
      |--  converter.ejb.Converter#converter.ejb.Converter
      |--  converter.ejb.Converter__3_x_Internal_RemoteBusinessHome__
      |
      |--ejb
          |-- converter.ejb.Converter All environment settings are the standard ones.
    Has anybody an idea, what the problem could be ? Thank you very much for your help.
    Ralph

    Hi,
    thanks for your interest. The client code is
    // file ConverterClient
    package ejb.clients;
    import javax.naming.*;
    import java.util.*;
    public class ConverterClient
      public static void main(String[] args)
        try
          Context ctx = new InitialContext();
          ctx.lookup("converter.ejb.Converter");
          Enumeration e = ctx.list("");
          while (e.hasMoreElements())
            System.out.println(e.nextElement());
        catch(NamingException ex)
          ex.printStackTrace();
    }The interface:
    // file Converter
    package converter.ejb;
    import java.math.BigDecimal;
    import javax.ejb.Remote;
    @Remote
    public interface Converter {
        public BigDecimal dollarToYen(BigDecimal dollars);
        public BigDecimal yenToEuro(BigDecimal yen);
    }The bean code is
    // file ConverterBean
    package converter.ejb;
    import java.math.BigDecimal;
    import javax.ejb.Stateless;
    @Stateless
    public class ConverterBean implements converter.ejb.Converter {
        private BigDecimal euroRate = new BigDecimal("0.0070");
        private BigDecimal yenRate = new BigDecimal("112.58");
        public BigDecimal dollarToYen(BigDecimal dollars) {
            BigDecimal result = dollars.multiply(yenRate);
            return result.setScale(2, BigDecimal.ROUND_UP);
        public BigDecimal yenToEuro(BigDecimal yen) {
            BigDecimal result = yen.multiply(euroRate);
            return result.setScale(2, BigDecimal.ROUND_UP);
    }It's been deployed successfully with NetBeans on Glassfish app server.
    The commands for compiling and running the client. "c:\java\JEE" is the installation dir for jee.
    c:\java\programs\src javac -d ..  -cp c:\java\JEE\lib\javaee.jar;c:\java\JEE\lib\appserv-rt.jar   ConverterClient.java
    c:\java\programs java -cp c:\java\JEE\lib\javaee.jar;c:\java\JEE\lib\appserv-rt.jar;.  ejb.clients.ConverterClient

  • Ejb-ref and JNDI lookup problem

    Hi,
    I use WLS6.1sp2. I created one EntityBean and SessionBean jar files. I tried to
    use session bean to refer entity bean, I failed. The details are as following:
    In EntityBean's weblogic-ejb-jar.xml, I set:
    <jndi-name>cabin.CabinHome</jndi-name>
    In sessionbean's ejb-jar.xml
    <ejb-ref>
    <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.titan.cabin.CabinHome</home>
    <remote>com.titan.cabin.Cabin</remote>
    </ejb-ref>
    In sessionbean's weblogic-ejb-jar.xml
    <reference-descriptor>
         <ejb-reference-description>
              <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
              <jndi-name>ejb/CabinHome</jndi-name>
         </ejb-reference-description>
    </reference-descriptor>
    At sessionbean's client, I use
    javax.naming.Context jndiContext = getInitialContext();
    Object obj = jndiContext.lookup("java:comp/env/ejb/CabinHome");
    When I run client file, I get the following error message:
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is javax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
    'CabinHome']; Link Remaining Name: 'ejb/CabinHome']>
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
    'CabinHome'
         <<no stack trace available>>
    --------------- nested within: ------------------
    javax.ejb.EJBException
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is javax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining name
    'CabinHome']; Link Remaining Name: 'ejb/CabinHome']
         at com.titan.travelagent.TravelAgentBean.listCabins(TravelAgentBean.java:45)
         at com.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl.listCabins(TravelAgentBean_a4c3ph_EOImpl.java:37)
         at com.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl_WLSkel.invoke(Unknown
    Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    ####<Feb 1, 2002 11:32:40 PM PST> <Info> <Management> <dj> <travelServer> <ExecuteThread:
    '14' for queue: 'default'> <system> <> <140009> <Configuration changes for domain
    saved to the repository.>
    Do you know what's wrong? how to fix this problem?
    Thanks in advance.
    DJ

    Slava,
    I took "cabin." out from weblogic-ejb-jar.xml, I got the same error.
    DJ
    "Slava Imeshev" <[email protected]> wrote:
    Hi DJ,
    I think you don't need "cabin." in weblogic-ejb-jar.xml :
    <jndi-name>cabin.CabinHome</jndi-name>
    Regards,
    Slava Imeshev
    "DJ" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I use WLS6.1sp2. I created one EntityBean and SessionBean jar files.I
    tried to
    use session bean to refer entity bean, I failed. The details are asfollowing:
    In EntityBean's weblogic-ejb-jar.xml, I set:
    <jndi-name>cabin.CabinHome</jndi-name>
    In sessionbean's ejb-jar.xml
    <ejb-ref>
    <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.titan.cabin.CabinHome</home>
    <remote>com.titan.cabin.Cabin</remote>
    </ejb-ref>
    In sessionbean's weblogic-ejb-jar.xml
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>ejb/CabinHome</ejb-ref-name>
    <jndi-name>ejb/CabinHome</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    At sessionbean's client, I use
    javax.naming.Context jndiContext = getInitialContext();
    Object obj = jndiContext.lookup("java:comp/env/ejb/CabinHome");
    When I run client file, I get the following error message:
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is
    javax.naming.NameNotFoundException:>> Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining>name>> 'CabinHome'; Link Remaining Name: 'ejb/CabinHome']>
    javax.naming.LinkException: . Root exception isjavax.naming.NameNotFoundException:
    Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remainingname
    'CabinHome'
    <<no stack trace available>>
    --------------- nested within: ------------------
    javax.ejb.EJBException
    - with nested exception:
    [javax.naming.LinkException:  [Root exception is
    javax.naming.NameNotFoundException:>> Unable to resolve ejb.CabinHome Resolved: '' Unresolved:'ejb' ; remaining>name>> 'CabinHome'; Link Remaining Name: 'ejb/CabinHome']
    atcom.titan.travelagent.TravelAgentBean.listCabins(TravelAgentBean.java:45)
    atcom.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl.listCabins(TravelAgentBe
    an_a4c3ph_EOImpl.java:37)
    atcom.titan.travelagent.TravelAgentBean_a4c3ph_EOImpl_WLSkel.invoke(Unknown
    Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:298)
    atweblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :93)
    atweblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:267)
    atweblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:2
    2)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    ####<Feb 1, 2002 11:32:40 PM PST> <Info> <Management> <dj> <travelServer><ExecuteThread:
    '14' for queue: 'default'> <system> <> <140009> <Configuration changesfor
    domain
    saved to the repository.>
    Do you know what's wrong? how to fix this problem?
    Thanks in advance.
    DJ

  • Ejb-ref errore when deploying a previously working ear on weblogic 8.1

    when deploying an ear module on weblogic 8.1 i get the following error:
    The ejb-link 'CustomessagingBrick.jar/CustomMessaginBrick' declared in ejb-ref
    or ejb-local-ref 'ejb/Service2' in the application module 'cmbrick.war' could
    not be resolved. The target EJB for the ejb ref could not be found.
    The ear is composed of two sub-modules:
    CustomMessaginBrick.jar
    cmbrick.war.
    The same ear was deployed on weblogic 6.1.
    Every reference in the ear seems in the right place so i am really clueless.
    Hereafter i include the relevant portions of the deployment descriptors.
    Thanks in advance!
    Greets,
    Luca
    the web.xml for cmbrick.war contains the following data:
    <ejb-local-ref>
    <ejb-ref-name>ejb/Service2</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>com.hutchison3g.core.brick.custom.messaging.CustomMessagingBrickLocalHome</local-home>
    <local>com.hutchison3g.core.brick.custom.messaging.CustomMessagingBrickLocal</local>
    <ejb-link>CustomMessagingBrick</ejb-link>
    </ejb-local-ref>
    its weblogic.xml file is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN"
    "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
    <weblogic-web-app>
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>ejb/Service2</ejb-ref-name>
    <jndi-name>Service2</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    </weblogic-web-app>
    while the weblogic-ejb-jar for CustomMessaging bricks contains the following:
    <weblogic-enterprise-bean>
    <ejb-name>CustomMessagingBrick</ejb-name>
    <stateless-session-descriptor>
    <pool>
    </pool>
    <stateless-clustering>
    </stateless-clustering>
    </stateless-session-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    <jndi-name>Service2</jndi-name>
    </weblogic-enterprise-bean>....

    The issue is that WLS 6.1 didn't really support ejb-links properly. An
    ejb-link should allow you to link a webapp or an ejb to another EJB
    without requiring additional information or a global JNDI name on the
    target EJB.
    WLS 8.1 is following your ejb-link and telling you there's not enough
    information.
    You have 2 options:
    1) Remove the <ejb-link>...</ejb-link> from your web.xml. You'll be
    using just an ejb-reference at that point, but you've already included
    the necessary information in the weblogic.xml that we can locate the EJB
    via its global jndi-name
    or
    2) Change the ejb-link to be
    <ejb-link>CustomMessaginBrick.jar#CustomMessagingBrick</ejb-link>
    If you wanted to, you could then remove the reference info from the
    weblogic.xml
    -- Rob
    luca wrote:
    when deploying an ear module on weblogic 8.1 i get the following error:
    The ejb-link 'CustomessagingBrick.jar/CustomMessaginBrick' declared in ejb-ref
    or ejb-local-ref 'ejb/Service2' in the application module 'cmbrick.war' could
    not be resolved. The target EJB for the ejb ref could not be found.
    The ear is composed of two sub-modules:
    CustomMessaginBrick.jar
    cmbrick.war.
    The same ear was deployed on weblogic 6.1.
    Every reference in the ear seems in the right place so i am really clueless.
    Hereafter i include the relevant portions of the deployment descriptors.
    Thanks in advance!
    Greets,
    Luca
    the web.xml for cmbrick.war contains the following data:
    <ejb-local-ref>
    <ejb-ref-name>ejb/Service2</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>com.hutchison3g.core.brick.custom.messaging.CustomMessagingBrickLocalHome</local-home>
    <local>com.hutchison3g.core.brick.custom.messaging.CustomMessagingBrickLocal</local>
    <ejb-link>CustomMessagingBrick</ejb-link>
    </ejb-local-ref>
    its weblogic.xml file is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN"
    "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
    <weblogic-web-app>
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>ejb/Service2</ejb-ref-name>
    <jndi-name>Service2</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    </weblogic-web-app>
    while the weblogic-ejb-jar for CustomMessaging bricks contains the following:
    <weblogic-enterprise-bean>
    <ejb-name>CustomMessagingBrick</ejb-name>
    <stateless-session-descriptor>
    <pool>
    </pool>
    <stateless-clustering>
    </stateless-clustering>
    </stateless-session-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    <jndi-name>Service2</jndi-name>
    </weblogic-enterprise-bean>....

  • Error starting WL - weblogic.xml.dom.ChildCountException: missing child home in ejb-ref

    hi,
    i get this following error when i start the WL 7.0. The web application fails
    to start but the ejbs are started properly. This is an example from the Monson
    Haefel book, on the CMP: Entity bean relationships.
    Can anybody tell me what is happening ??
    -thanks
    -vasanth
    Error log:
    =============
    <Error> <HTTP> <101179> <[HTTP] Error parsing des criptor in Web appplication
    "C:\bea\user_projects\mydomain\.\myserver\.wlnotdele
    te\titan\titan.war" [Path="C:\eclipse\workspace\titan4\dist\titan.ear", URI="tit
    an.war"
    weblogic.xml.dom.ChildCountException: missing child home in ejb-ref
            at weblogic.xml.dom.DOMUtils.getElementByTagName(DOMUtils.java:147)
            at weblogic.xml.dom.DOMUtils.getValueByTagName(DOMUtils.java:128)
            at weblogic.servlet.internal.dd.EJBReference.<init>(EJBReference.java:61
            at weblogic.servlet.internal.dd.WebAppDescriptor.<init>(WebAppDescriptor
    .java:247)
            at weblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(Descri
    ptorLoader.java:540)
            at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader
    .java:253)
            at weblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader
    .java:215)
            at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.ja
    va:282)
            at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:714)
            at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:555)
            at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:458)
            at weblogic.management.deploy.slave.SlaveDeployer.prepareAllStagedApplic
    ations(SlaveDeployer.java:490)
            at weblogic.management.deploy.slave.SlaveDeployer.initialize(SlaveDeploy
    er.java:253)
            at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.initi
    alize(DeploymentManagerServerLifeCycleImpl.java:150)
            at weblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.j
    ava:54)
            at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:782)
            at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
            at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
            at weblogic.Server.main(Server.java:32)
    >
    <Jun 23, 2003 10:10:51 AM CDT> <Error> <Deployer> <149205> <The Slave Deployer
    f
    ailed to initialize the application titan due to error weblogic.management.Appli
    cationException: Prepare failed. Task Id = null
    Module Name: titan.war, Error: Could not load web application from 'C:\bea\user_
    projects\mydomain\.\myserver\.wlnotdelete\titan\titan.war'
    weblogic.management.ApplicationException: Prepare failed. Task Id = null
    Module Name: titan.war, Error: Could not load web application from 'C:\bea\user_
    projects\mydomain\.\myserver\.wlnotdelete\titan\titan.war'
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:720)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:555)
    at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:458)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareAllStagedApplic
    ations(SlaveDeployer.java:490)
    at weblogic.management.deploy.slave.SlaveDeployer.initialize(SlaveDeploy
    er.java:253)
    at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.initi
    alize(DeploymentManagerServerLifeCycleImpl.java:150)
    at weblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.j
    ava:54)
    at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:782)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
    at weblogic.Server.main(Server.java:32)
    >

    It is working now.
    For a local entity bean, i was using <ejb-ref> instead of <local-ejb-ref>
    Once i changed that, it worlked.
    thanks
    -vasanth
    "Sanjeev Chopra" <[email protected]> wrote:
    correct url for doc...
    http://e-docs.bea.com/wls/docs81/webapp/web_xml.html#1020090
    "Sanjeev Chopra" <[email protected]> wrote in message
    news:[email protected]...
    Seems like titan.war's WEB-INF/web.xml has an ejb-ref element witha
    missing
    <home> element .
    see http://e-docs/wls/docs81/webapp/web_xml.html#1020090
    "Vasanth" <[email protected]> wrote in message
    news:[email protected]...
    hi,
    i get this following error when i start the WL 7.0. The web applicationfails
    to start but the ejbs are started properly. This is an example from
    the
    Monson
    Haefel book, on the CMP: Entity bean relationships.
    Can anybody tell me what is happening ??
    -thanks
    -vasanth
    Error log:
    =============
    <Error> <HTTP> <101179> <[HTTP] Error parsing des criptor in Webappplication
    "C:\bea\user_projects\mydomain\.\myserver\.wlnotdele
    te\titan\titan.war" [Path="C:\eclipse\workspace\titan4\dist\titan.ear",URI="tit
    an.war"
    weblogic.xml.dom.ChildCountException: missing child home in ejb-ref
    atweblogic.xml.dom.DOMUtils.getElementByTagName(DOMUtils.java:147)
    at
    weblogic.xml.dom.DOMUtils.getValueByTagName(DOMUtils.java:128)
    atweblogic.servlet.internal.dd.EJBReference.<init>(EJBReference.java:61
    atweblogic.servlet.internal.dd.WebAppDescriptor.<init>(WebAppDescriptor
    java:247)
    atweblogic.servlet.internal.dd.DescriptorLoader.initializeWebXml(Descri
    ptorLoader.java:540)
    atweblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader
    java:253)
    atweblogic.servlet.internal.dd.DescriptorLoader.<init>(DescriptorLoader
    java:215)
    atweblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.ja
    va:282)
    atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:714)
    atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:555)
    atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:458)
    atweblogic.management.deploy.slave.SlaveDeployer.prepareAllStagedApplic
    ations(SlaveDeployer.java:490)
    atweblogic.management.deploy.slave.SlaveDeployer.initialize(SlaveDeploy
    er.java:253)
    atweblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.initi
    alize(DeploymentManagerServerLifeCycleImpl.java:150)
    atweblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.j
    ava:54)
    at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:782)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
    at weblogic.Server.main(Server.java:32)
    >
    <Jun 23, 2003 10:10:51 AM CDT> <Error> <Deployer> <149205> <The SlaveDeployer
    f
    ailed to initialize the application titan due to errorweblogic.management.Appli
    cationException: Prepare failed. Task Id = null
    Module Name: titan.war, Error: Could not load web application from'C:\bea\user_
    projects\mydomain\.\myserver\.wlnotdelete\titan\titan.war'
    weblogic.management.ApplicationException: Prepare failed. Task Id
    = null
    Module Name: titan.war, Error: Could not load web application from'C:\bea\user_
    projects\mydomain\.\myserver\.wlnotdelete\titan\titan.war'
    atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:720)
    atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:555)
    atweblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
    er.java:458)
    atweblogic.management.deploy.slave.SlaveDeployer.prepareAllStagedApplic
    ations(SlaveDeployer.java:490)
    atweblogic.management.deploy.slave.SlaveDeployer.initialize(SlaveDeploy
    er.java:253)
    atweblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.initi
    alize(DeploymentManagerServerLifeCycleImpl.java:150)
    atweblogic.t3.srvr.ServerLifeCycleList.initialize(ServerLifeCycleList.j
    ava:54)
    at weblogic.t3.srvr.T3Srvr.initialize1(T3Srvr.java:782)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:594)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:282)
    at weblogic.Server.main(Server.java:32)
    >

  • Ejb-ref element references to other beans

    Hello,
    Can anyone tell me what ejb references to other beans are for? (ejb-ref element).
    I am completely missing the point and would be grateful if someone could tell me why I should have the overhead of writing this:
    <ejb-ref>
    <ejb-ref-name>ejb/waUserMgr</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.reuters.pds.webapp.bl.user.api.WAUserMgrHome</home>
    <remote>com.reuters.pds.webapp.bl.user.api.WAUserMgr</remote>
    <ejb-link>WAUserMgrEJB</ejb-link>
    </ejb-ref>
    Any comment welcome..
    Julien.

    Hi,
    The <ejb-ref> element is optional, you could use the actual JNDI name instead.
    The advantage with using <ejb-ref> is that, if you deploy the bean on another server, probably with a different JNDI name,
    your code can still continue using the same name as defined by <ejb-ref-name>.
    Internally, the <ejb-ref-name> will be mapped to the actual JNDI location, maybe using symbolic links.

  • EJB Refs ( coded name and JNDI name )

    Hi
    I am just starting to develop EJBs . I can't get to work the EJB refs as expected . In a session bean I have a lookup for an Entity bean . Both beans are in separate JAR files , but in the same ear .
    The lookup from session bean to entity bean only works when
    the coded name in EJB ref is defined exactly the same as JNDI name for enity bean , also the name in lookup method must be the same in session bean .
    To my surprise , the JNDI name for the target EJB , defined in EJB ref for session bean , does not mater at all . Even if I change it to a non existant name , the bean lookup works .
    Theoritacally I understand that EJB ref is there to provide a mapping between the name of bean mentioned in code to the actual JNDI name of another bean , at the time of deployment .
    The above is happening in J2EE 1.4 envoirment .
    Please let me know , what am I doing here that is wrong .
    ( All examples and tutorials , usually give coded name same as JNDI name ) .
    Thanks
    Tarun

    Hi Tarun,
    The ejb-ref-name lives in a different namespace than the global JNDI names. Any names of ejb-refs, ejb-local-refs, resource-refs, etc. are scoped within a particular component's private namespace. All environment references are accessed via the java:comp/env namespace at runtime. So, if your ejb-ref-name(a.k.a "coded name") is ejb/foo in the deployment descriptor, you would access it from the code as follows :
    initialContext.lookup("java:comp/env/ejb/foo");
    This way, neither the standard deployment descriptor nor the code has any dependency on the global JNDI name. That's a good thing since the decision about which target EJB should be linked to is often not made until deployment time rather than development time. Furthermore, it means if you want to change the linking you can always do it without recompiling your code.
    As for the global JNDI names, the first thing to note is that they are completely vendor-specific. That's why they don't appear in the standard deployment descriptor. In the J2EE SDK, each EJB that exposes a Remote view is assigned a global JNDI name in sun-ejb-jar.xml. This JNDI name is assigned from the global namespace of the application server. There's nothing stopping it from also being "ejb/foo", but it refers to a different thing than the "ejb/foo" above.
    Now we have an ejb-ref called ejb/foo and an ejb whose JNDI name is ejb/foo, but we haven't linked the two. When it comes to linking, you have two choices:
    1. If the target ejb is in the same .ear as the client component, you can use the ejb-link mechanism. This allows you to specify the target ejb by referring to its ejb-name. Since ejb-name is only guaranteed to be unique within an ejb-jar, the syntax allows for you to give the uri of the containing ejb-jar, followed by #, followed by ejb-name.
    2. Alternatively, you can specify the global JNDI name of the target ejb using sun-ejb-jar.xml Note that this will work whether the target ejb is in the same .ear or not. However, it's the only option if the target ejb is in a different .ear. In this case, you would create an ejb-ref entry for the client component within the sun-ejb-jar.xml. e.g. :
    <ejb>
    <ejb-name>MyClientBean</ejb-name>
    <ejb-ref>
    <ejb-ref-name>ejb/foo</ejb-ref-name>
    <jndi-name>ejb/foo</jndi-name>
    </ejb-ref>
    </ejb>
    Again, it's just a coincidence that both names happen to be ejb/foo. They refer to different things.
    When you do a global lookup from your code, initialContext.lookup('ejb/foo"), it will work in some environments because you're simply bypassing the level of indirection provided by your component environment and going straight to the global namespace. This is non-portable and not a good idea, since you've now tightly coupled the name of the target ejb to your client component. That means if it changes you need to recompile your code. Hope this helps.
    --ken

  • EJB-REF problem

    Hi for all
    I am having problems when I have that reference other EJB from an EJB. I put the reference in the file ejb-jar.xml but like I use the weblogic server a error is generated when I try to do the deploy my EJB where it asks to do the reference in the file weblogic-ejb-jar.xml, that is the configuration of the ejb in the server.
    If somebody knows as doing that reference for the weblogic, please, help me.
    Thanks

    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>CentroCustoBO</ejb-name>
    <caching-descriptor>
    <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
    </caching-descriptor>
    <jndi-name>CentroCustoBO</jndi-name>
    </weblogic-enterprise-bean>
    <weblogic-enterprise-bean>
    <ejb-name>PedidoPagamentoBO</ejb-name>
    <caching-descriptor>
    <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
    </caching-descriptor>
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>FornecedorBO</ejb-ref-name>
    <jndi-name>FornecedorBO</jndi-name>
    </ejb-reference-description>
    <ejb-reference-description>
    <ejb-ref-name>CentroCustoBO</ejb-ref-name>
    <jndi-name>CentroCustoBO</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    <jndi-name>PedidoPagamentoBO</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>

Maybe you are looking for

  • Unable to retrieve collections from the Search Service.

    Hi, I have a user trying to upload a collection. She gets the following error: Unable to retrieve collections from the Search Service. Please verify that the ColdFusion MX Search Server is installed and running. Obviously, I checked the service. It w

  • How to Setup an ACL over a Command in solaris 2.6

    Hi all, Has anyone have an idea on how to setup an ACL over a command in solaris 2.6 . i.e: to force a user (or a group) to enter a password to run a command (like mount and others). Thanks for your help. haed98. [email protected]

  • Font looks sort of 'distorted'

    Lately on some places like Photobucket's Upload Button, Livestream's chat box, and flash games, the font seems to look kinda distorted, having it be terribly pixelated with blue inside, here's an example: http://i652.photobucket.com/albums/uu249/Cele

  • Bugs and Problems Galore

    I am so disappointed, I'm beside myself. Dual monitor support I can wait, thought I'm not happy. I have two monitors, I'd like to make use of that real estate to expand the panels a bit so I can see everything. Scrolling the panels is a huge waste of

  • I received .mov via email and iMessage and quicktime tells me it can't open and to click tell me more for help

    I tried to open .mov from an email and imessage and quicktime says it cant open and to click tell me more but then it doesnt give any information. Ive never had a problem opening videos made from an iphone and emailed before. These arent long clips.