0 Replies Latest reply on May 28, 2012 5:26 PM by ronorato

    Error retreiving a ConnectionFactory from a Servlet in a .ear deployed in JBoss AS 7.1.1 Final

    ronorato

      I have some code that was working using a slightly older version of JBoss AS 7.1, but is now failing after I upgraded to JBoss AS 7.1.1.Final "Brontes".  The code is being executed from my initialization servlet that is called upon startup.  Here is a sample of the code:

       

      // This is test code

      try {

           Context ic = new InitialContext();

       

           ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");

           if ( null != cf ) {

              .......

            }

            else {

              ......

            }

      }

      catch ( Exception ex ) {

            ......

      }

       

      Within the console window I am seeing an exception handling with the following:

       

      .............

      16:18:06,042 ERROR [stderr] (MSC service thread 1-3) Caused by: javax.naming.NameNotFoundException: ConnectionFactory -- service jboss.naming.context.java.ConnectionFactory

      16:18:06,043 ERROR [stderr] (MSC service thread 1-3)     at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

      16:18:06,043 ERROR [stderr] (MSC service thread 1-3)     at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)

      16:18:06,044 ERROR [stderr] (MSC service thread 1-3)     at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:113)

      16:18:06,044 ERROR [stderr] (MSC service thread 1-3)     at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:214)

      16:18:06,045 ERROR [stderr] (MSC service thread 1-3)     at javax.naming.InitialContext.lookup(InitialContext.java:409)

      ------------

       

      Any help on this would be greatly appriciated.

       

      Regards,

      Richard