<!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="http://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;">
    jndi.properties files is not read
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/snavarro89">Samuel Navarro</a> in <i>EJB3</i> - <a href="http://community.jboss.org/message/639622#639622">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hello everyone,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Im starting to develop with JBoss, and got stuck while trying to create my first application.</p><p>Im running JBoss 7.0, maven 3.0.3, Eclipse Indigo 3.7</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>So, I started with a Hello World Project just to test if my setup was correct, and it worked, I succesfully deployed the project and acces it through a web page.</p><p>Then I tried to create a Hello World from my own, but this time I wanted to access my bean from a client application. So I deployed another bean to the server, so far so good, but then I created another project to create a test client application, and I got the following error</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:&#160; java.naming.factory.initial</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>So I start searching in the web and read a lot of forums (before posting a question that surely was previously asked) and everyone said the same, I needed to add a jndi.properties file to my classpath, so I did, and the error still appeared, then I followed a basic tutorial for&#160; stateless session beans, and did as the tutorial specified, which was the same as I was doing, but insted the client application class, was in the same project, I added the jndi file and the error was still coming up.</p><p>I have the following structure</p><p>SampleEJBProject</p><p>&#160; -ejbModule</p><p>&#160;&#160;&#160;&#160; -com.code.project</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; -XXX.java</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; -YYY.java</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; -jndi.properties</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This is how I have the file configured</p><p>java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory</p><p>java.naming.provider.url=localhost:1099&#160; (already tried with jpn:// at the beginning)</p><p>java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I searched on how could I be sure that my file was being used and found</p><p>loader.getResources("jndi.properties")</p><p>Which returns null.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Ive already places the jdni.properties file in the root folder of the classpath and it didnt work.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Is there configuration I may be missing?</p><p>Do I need to place jdni.properties file somewhere else?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks in advance!</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/639622#639622">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in EJB3 at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>