<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Jboss5.1 Migration to JBoss7.1 Custom-JNDI-Handling
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/garydux">Gary Dux</a> in <i>EJB3 Development</i> - <a href="https://community.jboss.org/message/807407#807407">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><table border="0" cellpadding="0" cellspacing="0" class="forumline" id="postTable" style="width: 100%;"><tbody><tr class="firstRowOfPost"><td class="row1" style="border:0px solid black;" valign="top"><div class="date"><div class="likesHiddenDiv" id="like_message_2781373"> </div></div></td></tr><tr class="messageRow"><td class="row1 postbody" id="post_text_2781373" style="border:0px solid black;" valign="top"> <span class="postbody"> Hello together, <br/> <br/> in our applications we used to define jndi-mappings in jboss.xml: <br/> <?xml version="1.0" encoding="UTF-8"?> <br/> <<a class="jive-link-external-small" href="http://www.coderanch.com/forums/f-63/JBoss" rel="nofollow" target="_new">jboss</a>> <br/>   <enterprise-beans> <br/>     <session> <br/>       <ejb-name>ContractPortfolioProcessServiceBean</ejb-name> <br/>       <jndi-name>com/fja/ipl/customer/ilis/contractportfolio/ContractPortfolioProcessService</jndi-name> <br/>     </session> <br/>   </enterprise-beans> <br/> </jboss> <br/> <br/> ithis jboss.xml was placed then in META-INF of that ejb-jar <br/> <br/> So it was easy to lookup for that bean like: <br/> <br/> public static ContractPortfolioProcessService lookupContractPortfolioProcessService() <br/>                throws <a class="jive-link-external-small" href="http://docs.oracle.com/javase/7/docs/api/javax/naming/NamingException.html" rel="nofollow" target="_new">NamingException</a> { <br/>                 final Context context = new <a class="jive-link-external-small" href="http://docs.oracle.com/javase/7/docs/api/javax/naming/InitialContext.html" rel="nofollow" target="_new">InitialContext</a>(); <br/>           return (ContractPortfolioProcessService ) context.lookup("com/fja/ipl/customer/ilis/contractportfolio/ContractPortfolioProcessService"); <br/> } <br/> jndi.properties{ <br/> #JBoss <br/> java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory <br/> java.naming.provider.url=jnp://localhost:1099 <br/> java.naming.factory.url.pkgs=org.jboss.naming<a href="http://cache-www.coderanch.com/images/smilies/jr-redface.gif"><span> http://cache-www.coderanch.com/images/smilies/jr-redface.gif </span></a>rg.jnp.interfaces <br/> } <br/> <br/> How can it be made on JBOSS7? <br/> <br/> Due ejb3-spec  in JBOSS7 they can also define jboss-ejb3.xml like this: <br/><span> <jboss:ejb-jar xmlns:jboss="</span><a class="jive-link-external-small" href="http://www.jboss.com/xml/ns/javaee" rel="nofollow" target="_blank">http://www.jboss.com/xml/ns/javaee</a><span>" </span><br/><span>                xmlns="</span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee" rel="nofollow" target="_blank">http://java.sun.com/xml/ns/javaee</a><span>" </span><br/>                xmlns:iiop="urn:iiop" <br/><span>                xmlns:xsi="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>" </span><br/><span>                xsi:schemaLocation="</span><a class="jive-link-external-small" href="http://www.jboss.com/xml/ns/javaee" rel="nofollow" target="_blank">http://www.jboss.com/xml/ns/javaee</a><span> </span><a class="jive-link-external-small" href="http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd" target="_blank">http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd</a> <br/>                   <a class="jive-link-external-small" href="http://java.sun.com/xml/ns/javaee" rel="nofollow" target="_blank">http://java.sun.com/xml/ns/javaee</a> <a class="jive-link-external-small" href="http://www.jboss.org/j2ee/schema/jboss-ejb3-spec-2_0.xsd" target="_blank">http://www.jboss.org/j2ee/schema/jboss-ejb3-spec-2_0.xsd</a> <br/>                   urn:iiop jboss-ejb-iiop_1_0.xsd" <br/>                version="3.1" <br/>                impl-version="2.0"> <br/>     <enterprise-beans> <br/>          <session> <br/>             <ejb-name>CounterBean</ejb-name> <br/>             <mapped-name>org/jboss/as/quickstarts/ejb/remote/stateful/CounterBean</mapped-name> <br/>               </session> <br/>     </enterprise-beans> <br/> <br/>     <assembly-descriptor> <br/>         <iiop:iiop> <br/>             <ejb-name>CounterBean</ejb-name> <br/>             <iiop:binding-name>org/jboss/as/quickstarts/ejb/remote/stateful/CounterBean</iiop:binding-name> <br/>         </iiop:iiop> <br/>     </assembly-descriptor> <br/> </jboss:ejb-jar> <br/> <br/> It deploys also errorless. But i did not find any dokumentation to lookup my ejb like in example above. <br/> <br/> Who can help me giving a hint in this case? <br/> <br/> How is the jndi.properties-Configuration would be in this case?</span></td></tr></tbody></table></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/807407#807407">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in EJB3 Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2030">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>