<!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;">
    Lookup failure of UserTransaction
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/kuribara">栗原 政彦</a> in <i>JBoss AS 7 Development</i> - <a href="https://community.jboss.org/message/736178#736178">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Lookup failure of UserTransaction</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Standanone Java Aplication is made, and it tries to do the EJB call with Remote. <br/>Because UserTransaction is not good at lookup, I am embarrassed. </p><p>Is the specification of the JNDI name bad?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Environment<br/>==========</p><p>Red Hat Enterprise Linux Server release 5.5 Beta (Tikanga)<br/>JBossAS7.1.0 Final<br/>java version "1.7.0_02"<br/>Java(TM) SE Runtime Environment (build 1.7.0_02-b13)<br/>Java HotSpot(TM) Server VM (build 22.0-b10, mixed mode)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>It tries to access Remote EJB by using jboss-client-7.1.0.Final.jar</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>SourceCode<br/>==========</p><p>final Properties env = new Properties();<br/>env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");<br/>env.put(Context.PROVIDER_URL,"remote://localhost:4447");<br/>env.put(Context.SECURITY_PRINCIPAL, "apuser");<br/>env.put(Context.SECURITY_CREDENTIALS, "apuserpass");<br/>context = new InitialContext(env);</p><p>UserTransaction userTransaction = (UserTransaction) context.lookup("java:comp/UserTransaction");</p><p>At lookup, the following exception is generated. </p><p>javax.naming.NameNotFoundException: comp/UserTransaction -- service jboss.naming.context.java.jboss.exported.comp.UserTransaction<br/> at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)<br/> at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:177)<br/> at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:124)<br/> at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:70)<br/> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)<br/> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)<br/> at java.lang.Thread.run(Thread.java:722)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Relating file</p><p>========</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>jndi.properties<br/>===============</p><p>java.naming.provider.url=remote://localhost:4447<br/>java.naming.factory.url.pkgs=org.jboss.ejb.client.naming</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>jboss-ejb-client.properties<br/>===========================</p><p>remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false<br/>remote.connections=default<br/>remote.connection.default.host=localhost<br/>remote.connection.default.port=4447<br/>remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false<br/>remote.connection.default.username=admin<br/>remote.connection.default.password=password</p><p><br/>Supplementation matter</p><p>Security has been added with add-user.sh as an application user. apuser/apuserpass</p><p><br/>Referred URL</p><p>==========</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>EJB invocations from a remote client using JNDI<br/><a class="jive-link-external-small" href="https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI">https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI</a></p><p>Examples of JNDI mappings in previous releases and how they might look now</p><p><a class="jive-link-external-small" href="https://docs.jboss.org/author/display/AS71/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7">https://docs.jboss.org/author/display/AS71/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7</a></p><p>UserTransaction<br/>New Namespaces</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>java:comp/UserTransaction<br/>java:jboss/UserTransaction</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Neither lookup can be done. </p></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/736178#736178">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss AS 7 Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


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

</div>

</body>
</html>