8 Replies Latest reply on Sep 18, 2014 1:51 AM by miteshmanani

    javax.naming.NameNotFoundException: jboss/datasources/ExampleDS -- service jboss.naming.context.java.jboss.exported.jboss.datasources.ExampleDS

    aalsobeh

      I used the EAP 6.3.0 to run my application on remote server, but I have this error when trying to lookup for mssql jndi

      DataSource das1= (DataSource) context.lookup("java:jboss/datasources/ExampleDS");

       

      this is the error

       

      I couldn't understand this error and why

       

      javax.naming.NameNotFoundException: jboss/datasources/ExampleDS -- service jboss.naming.context.java.jboss.exported.jboss.datasources.ExampleDS

        at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:103)

        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197)

        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:174)

        at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)

        at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at java.lang.Thread.run(Thread.java:745)

        • 1. Re: javax.naming.NameNotFoundException: jboss/datasources/ExampleDS -- service jboss.naming.context.java.jboss.exported.jboss.datasources.ExampleDS
          weboctave

          Do you have the datasource connection pool enabled?

          In domain mode, check domain.xml. Make sure you are looking at the correct profile.

           

          <subsystem xmlns="urn:jboss:domain:datasources:1.1">

                          <datasources>

                              <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">

                                  <security>...

          • 2. Re: javax.naming.NameNotFoundException: jboss/datasources/ExampleDS -- service jboss.naming.context.java.jboss.exported.jboss.datasources.ExampleDS
            aalsobeh

            Thank you for replying Yes,I have the following

            subsystem xmlns="urn:jboss:domain:datasources:1.2">

                        <datasources>

                            <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">

                                <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>

                                <driver>h2</driver>

                                <security>

                                    <user-name>sa</user-name>

                                    <password>sa</password>

                                </security>

                            </datasource>

                            <datasource jndi-name="java:jboss/datasources/MSSQLDS" pool-name="myDatasource" enabled="true">

                                <connection-url>jdbc:sqlserver://localhost:1433;DatabaseName=GooPile</connection-url>

                                <driver>mssql</driver>

                                <pool>

                                    <min-pool-size>0</min-pool-size>

                                    <max-pool-size>20</max-pool-size>

                                </pool>

                                <security>

                                    <user-name>anas</user-name>

                                    <password>tedi</password>

                                </security>

                                <validation>

                                    <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker"/>

                                </validation>

                            </datasource>

                            <drivers>

                                <driver name="h2" module="com.h2database.h2">

                                    <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                                </driver>

                                <driver name="mssql" module="com.microsoft.sqlserver">

                                    <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>

                                </driver>

                            </drivers>

                        </datasources>

            • 3. Re: javax.naming.NameNotFoundException: jboss/datasources/ExampleDS -- service jboss.naming.context.java.jboss.exported.jboss.datasources.ExampleDS
              wdfink

              Where do you run the lookup, could you show a bit more details?

              Did you see the message that the DS is activated in the server.log?

              • 4. Re: javax.naming.NameNotFoundException: jboss/datasources/ExampleDS -- service jboss.naming.context.java.jboss.exported.jboss.datasources.ExampleDS
                aalsobeh

                I have not seen this message, where can I found it ?Bellow part of the server.log

                 

                This is part of code, Please, Look to  the bold lines

                 

                package com.client.utilities;

                 

                import java.sql.Connection;

                import java.sql.DriverManager;

                import java.sql.PreparedStatement;

                import java.util.Properties;

                import javax.activation.DataSource;

                import javax.ejb.TransactionAttribute;

                import javax.ejb.TransactionAttributeType;

                import javax.ejb.TransactionManagement;

                import javax.ejb.TransactionManagementType;

                import javax.naming.Context;

                import javax.naming.InitialContext;

                import javax.naming.NamingException;

                import javax.sql.XAConnection;

                import javax.sql.XADataSource;

                import javax.transaction.xa.XAResource;

                import javax.transaction.xa.Xid;

                import com.arjuna.ArjunaOTS.Current;

                import com.arjuna.ats.arjuna.common.CoordinatorEnvironmentBean;

                import com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.TransactionImple;

                import com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple;

                import com.arjuna.ats.internal.jta.xa.XID;

                import com.arjuna.ats.internal.jts.orbspecific.ControlImple;

                import com.arjuna.ats.internal.jts.orbspecific.CurrentImple;

                import com.arjuna.ats.internal.jts.orbspecific.TransactionFactoryImple;

                import com.arjuna.ats.jdbc.TransactionalDriver;

                import com.arjuna.ats.jta.cdi.TransactionContext;

                import com.arjuna.ats.jta.xa.XidImple;

                import com.microsoft.sqlserver.jdbc.SQLServerConnection;

                import com.microsoft.sqlserver.jdbc.SQLServerXADataSource;

                import org.jboss.jca.adapters.jdbc.*;

                import org.omg.CosTransactions.Control;

                import org.omg.CosTransactions.Coordinator;

                import org.omg.CosTransactions.HeuristicHazard;

                import org.omg.CosTransactions.HeuristicMixed;

                import org.omg.CosTransactions.Inactive;

                import org.omg.CosTransactions.NoTransaction;

                import org.omg.CosTransactions.PropagationContext;

                import org.omg.CosTransactions.RecoveryCoordinator;

                import org.omg.CosTransactions.Resource;

                import org.omg.CosTransactions.SubtransactionAwareResource;

                import org.omg.CosTransactions.SubtransactionsUnavailable;

                import org.omg.CosTransactions.Terminator;

                import org.omg.CosTransactions.Unavailable;

                 

                 

                @TransactionAttribute(TransactionAttributeType.REQUIRED)

                @TransactionManagement(TransactionManagementType.BEAN)

                public class ClientUtility {

                 

                    private static final String PKG_INTERFACES = "org.jboss.ejb.client.naming";

                    public static Context initialContext;

                    public static Coordinator coordinatorParent=null;

                    public static CurrentImple currentParent= null;//new CurrentImple();

                    public static ControlImple controlParent= null;

                    public TransactionContext transactionContext =null;

                    public static com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple transactionParentJTA = null;

                    public static com.arjuna.ats.internal.jta.transaction.jts.TransactionImple transactionParentJTS = null;

                  

                  

                    public static Context getInitialContext() throws NamingException

                    {

                        if (initialContext == null)

                        {

                            Properties properties = new Properties();

                            properties.put(Context.URL_PKG_PREFIXES, PKG_INTERFACES);

                            //properties.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");

                            //properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");

                            //properties.put(Context.PROVIDER_URL,"jnp://127.0.0.1:1099");

                            properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");

                            properties.put(Context.PROVIDER_URL,"remote://127.0.0.1:4447"); 

                            properties.put(Context.SECURITY_PRINCIPAL, "admin");

                            properties.put(Context.SECURITY_CREDENTIALS, "godanas2005!");

                            properties.put("jboss.naming.client.ejb.context", true);

                            // create a context passing these properties

                            initialContext = new InitialContext(properties);

                        }

                        return initialContext;

                    }

                   

                    public static void loadDrivers(String dbType)

                    {       

                        // Register the driver via the system properties variable "jdbc.drivers"

                         Properties property = System.getProperties();

                        try

                        {

                            switch(dbType)

                            {

                                case "ORACLE":

                                    property.put("jdbc.drivers", "oracle.jdbc.driver.OracleDriver");

                                    //sun.jdbc.odbc.JdbcOdbcDriver drv = new sun.jdbc.odbc.JdbcOdbcDriver();

                                    //DriverManager.registerDriver(drv);

                                    break;

                                case "SQLSERVER":

                                    property.put("jdbc.drivers", "com.microsoft.sqlserver.jdbc.SQLServerDriver");

                                    //SQLServerDriver drv = new SQLServerDriver();

                                    //DriverManager.registerDriver(drv);

                                    break;

                                case "MYSQL":

                                    property.put("jdbc.drivers", "com.mysql.jdbc.Driver");

                                    break;

                                case "PGSQL":

                                    property.put("jdbc.drivers", "org.postgresql.Driver");

                                    break;

                            }

                        System.setProperties(property);

                        }

                        catch(Exception ex)

                        {

                            ex.printStackTrace();

                            System.out.println(ex.getMessage());

                        }   

                    }

                 

                    private static Connection registerDriver(String username, String password,String dbName, String sqlStatement)

                    {

                        Connection conn=null;

                        Context context= null;

                        try

                        {

                            TransactionalDriver JDBCDriver = new TransactionalDriver();

                            DriverManager.registerDriver(JDBCDriver);

                           

                            XADataSource ds = getxaResource(username, password, dbName);

                           

                            Properties dbProps = new Properties();

                            dbProps.setProperty(TransactionalDriver.userName, username);

                            dbProps.setProperty(TransactionalDriver.password, password);

                           

                            //dbProps.setProperty(TransactionalDriver.dynamicClass, "com.arjuna.ats.internal.jdbc.drivers.modifiers.sqlserver_jndi");

                            conn = JDBCDriver.connect("jdbc:arjuna:jdbc/"+dbName, dbProps);

                            XAConnection c= ds.getXAConnection();

                            WrappedConnection wc = (WrappedConnection)c;

                            com.microsoft.sqlserver.jdbc.SQLServerConnection  mc = (SQLServerConnection) wc.getUnderlyingConnection();

                            System.out.println(mc.getMetaData());

                            manageXADataSource(ds,conn, sqlStatement);

                        }

                        catch (Exception e)

                        {

                            e.printStackTrace();

                            System.exit(0);

                        }

                        return conn;

                    }

                 

                    private static XADataSource getxaResource(String username, String password,

                            String dbName) throws NamingException

                        {

                            Context context;

                            XADataSource ds = new SQLServerXADataSource();

                       

                        try

                        {   

                            context = getInitialContext();

                            System.out.println(context.getClass());

                           

                            DataSource das1= (DataSource) context.lookup("java:jboss/datasources/ExampleDS");

                            DataSource dataSource= (DataSource) context.lookup("java:jboss/datasources/MSSQLDS");//+dbname           

                            System.out.println(dataSource.getName());

                            context.bind("java:/MSSQLDS",dataSource);           

                            XADataSource xaDataSource = (XADataSource) context.lookup("java:/MSSQLXADS"); //+dbname

                            System.out.println(xaDataSource.getXAConnection());

                //            Hashtable env = new Hashtable();

                //            String initialCtx = PropertyManager.getProperty("Context.INITIAL_CONTEXT_FACTORY");

                //            env.put(Context.INITIAL_CONTEXT_FACTORY, initialCtx);

                //            InitialContext ctx = new InitialContext(env);

                            context.bind("java:/MSSQLXADS/"+dbName, ds);

                       

                        }

                        catch(Exception ex)

                        {

                            System.out.println(ex.getMessage());

                            ex.printStackTrace();

                        }

                        return ds;

                    }

                   

                    //JNDI: Java Naming and Directory Interface

                    public static void manageXADataSource(XADataSource ds, Connection con,String sqlStatement)

                    {

                        // Create the XA data source and XA ready connection.

                         XAResource xaRes = null;

                         TransactionManagerImple tm = new  TransactionManagerImple();

                        try{

                            XAConnection xaCon = ds.getXAConnection();

                            con = xaCon.getConnection();

                           

                         // Get the XAResource object and set the timeout value.

                             xaRes = xaCon.getXAResource();

                             xaRes.setTransactionTimeout(0);

                             tm.getTransaction().enlistResource(xaRes);

                            

                        // Perform the XA transaction.

                             xaRes.start(getXid(), XAResource.TMNOFLAGS);

                             PreparedStatement pstmt = con.prepareStatement(sqlStatement);

                             pstmt.executeUpdate();

                 

                       // Commit the transaction.

                             xaRes.end(getXid(),XAResource.TMSUCCESS);

                             xaRes.commit(getXid(),true);

                 

                       // Cleanup.

                             con.close();

                             xaCon.close();

                            

                        }

                        catch(Exception ex)

                        {

                            System.out.print(ex.getMessage());

                            ex.printStackTrace();

                        }

                    }

                   

                    public static Xid getXid()

                    {

                        XidImple tid= new XidImple();

                        XID xid= tid.getXID();

                        System.out.println("xid = " + xid.toString());

                        return (Xid)xid;

                    } 

                   

                    public static Connection setupGooPileXAConnection(String dbtype, String dbName, String userName, String password,String sqlStatement)

                    {

                        loadDrivers(dbtype);

                        Connection con= registerDriver(userName, password, dbName, sqlStatement);

                        return con;

                    }

                   

                    public static void TransactionContext()

                    {

                        TransactionImple transaction = new TransactionImple(0);

                        com.arjuna.ats.jta.cdi.TransactionContext transactionContext = new TransactionContext();

                       

                        // Begin a new top-level transaction

                        TransactionFactoryImple transactionFactory= new TransactionFactoryImple("java:jboss/T1");

                        ControlImple control = (ControlImple) transactionFactory.create(1000);

                       

                        CoordinatorEnvironmentBean coordinator= new CoordinatorEnvironmentBean();

                        CurrentImple current = new CurrentImple();

                        PropagationContext pgtx;

                        Terminator terminator= null;

                       

                        try

                        {

                            // control use to make the direct Context management and explicit transaction propagation

                       

                            IndirectImplicitContext();           

                            control = DirectExplicitContext(transactionFactory);

                            //control._orb().init();

                           

                            //control._orb().shutdown(true);

                        }

                        catch(Exception ex){

                            System.out.println(ex.getMessage());

                            ex.printStackTrace();

                        }

                    }

                 

                    private static void IndirectImplicitContext()

                            throws SubtransactionsUnavailable, NoTransaction, HeuristicMixed,

                            HeuristicHazard

                    {

                        CurrentImple current=null;

                        current.begin();

                        String currentTransactionName= current.get_transaction_name();

                        System.out.println("Current Transaction Name is " + currentTransactionName);

                        current.commit(true);

                    }

                 

                    private static ControlImple DirectExplicitContext(

                            TransactionFactoryImple transactionFactory) throws Unavailable,

                            HeuristicHazard, HeuristicMixed

                    {

                        ControlImple control;

                        PropagationContext pgtx;

                        Terminator terminator;

                        //CREATE top-level action

                        control = (ControlImple) transactionFactory.create(0);

                        pgtx=control.get_coordinator().get_txcontext();

                        // explicit propogation context operation

                            //trans_obj.operation(arg, pgtx);

                       

                        //get terminator

                        terminator= control.get_terminator();

                        // it can be used to commit

                        terminator.commit(false);

                        return control;

                    }

                   

                    public ControlImple createTopLevelTransaction(Resource resource)

                    {

                       

                        TransactionFactoryImple transactionFactory = new TransactionFactoryImple();

                       

                        try

                        {

                            currentParent.begin();

                            controlParent =(ControlImple) transactionFactory.create(0);

                            coordinatorParent = controlParent.get_coordinator();

                            registerResource(resource, coordinatorParent);

                           

                            com.arjuna.ats.internal.jta.transaction.jts.TransactionImple transactionJTS= new com.arjuna.ats.internal.jta.transaction.jts.TransactionImple();

                            com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple transactionJTA = new com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple(0);

                           

                            //chanage context of thread

                            System.out.println(controlParent.get_coordinator().get_txcontext().current.otid);

                        }

                        catch(Exception ex)

                        {

                            System.out.println(ex.getMessage());

                            ex.printStackTrace();

                        }

                        return controlParent;

                    }

                   

                    public void CreateSubTransactionUsingCurrent(Current currentTransaction, Resource resource)

                    {

                        Control controlTransaction= null;

                        Coordinator coordinator= null;

                        RecoveryCoordinator recoveryCoordinator=null;

                        try

                        {

                           

                            currentTransaction = (Current) new CurrentImple();

                            controlTransaction = currentTransaction.get_control();

                            coordinator= controlTransaction.get_coordinator();

                            controlTransaction = coordinator.create_subtransaction();

                            registerResource(resource, coordinator);

                            //chanage context of thread

                            System.out.println(controlTransaction.get_coordinator().get_txcontext().current.otid);

                        }

                        catch(Exception ex)

                        {

                            System.out.println(ex.getMessage());

                            ex.printStackTrace();

                        }

                    }

                   

                    // using narayana to register a resource and nested transactions

                    public RecoveryCoordinator registerResource(Resource resource, Coordinator coordinator)

                            throws Inactive

                    {

                            RecoveryCoordinator recoveryCoordinator;

                            recoveryCoordinator= coordinator.register_resource(resource);

                            boolean isTopLevelTransaction= coordinator.is_top_level_transaction();

                            if(isTopLevelTransaction==false)

                            {

                                recoveryCoordinator= coordinatorParent.register_resource(resource);

                            }

                            return recoveryCoordinator;

                    }

                   

                    public void registerSubTransactionAware(SubtransactionAwareResource SubTransactionResource, Coordinator coordinator)

                    {

                        try

                        {

                            coordinator.register_subtran_aware(SubTransactionResource);

                           

                        }

                        catch (Exception e)

                        {

                            // TODO: handle exception

                            System.out.println(e.getMessage());

                            e.printStackTrace();

                        }

                    }

                   

                    public void CurrentCommit(Current current)

                    {

                        try

                        {

                            current.commit(true);

                        }

                        catch(Exception ex)

                        {

                            System.out.println(ex.getMessage());

                            ex.printStackTrace();

                        }

                    }

                   

                    public void CurrentRollBack(Current current)

                    {

                        try

                        {

                            current.rollback();

                        }

                        catch(Exception ex)

                        {

                            System.out.println(ex.getMessage());

                            ex.printStackTrace();

                        }

                    }

                    public void ControlCommit(Control control)

                    {

                        try

                        {

                            ((CurrentImple) control).commit(true);

                        }

                        catch(Exception ex)

                        {

                            System.out.println(ex.getMessage());

                            ex.printStackTrace();

                        }

                    }

                   

                    public void ControlRollBack(ControlImple control)

                    {

                        try

                        {

                            (control).get_terminator().rollback();

                        }

                        catch(Exception ex)

                        {

                            System.out.println(ex.getMessage());

                            ex.printStackTrace();

                        }

                    }

                }

                 

                This is part of log

                logging.configuration = file:/C:/Users/AnasAlsubh/EAP-6.3.0-R/jboss-eap-6.3/standalone/configuration/logging.properties

                    module.path = C:/Users/AnasAlsubh/EAP-6.3.0-R/jboss-eap-6.3/modules

                    org.jboss.boot.log.file = C:/Users/AnasAlsubh/EAP-6.3.0-R/jboss-eap-6.3/standalone/log/boot.log

                    org.jboss.logmanager.nocolor = true

                    org.jboss.resolver.warning = true

                    org.xml.sax.driver = __redirected.__XMLReaderFactory

                    os.arch = amd64

                    os.name = Windows 7

                    os.version = 6.1

                    path.separator = ;

                    program.name = JBossTools: JBoss Enterprise Application Platform 6.1+

                    sun.arch.data.model = 64

                    sun.boot.class.path = C:\Program Files\Java\jdk1.8.0_05\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_05\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_05\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_05\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_05\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_05\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_05\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_05\jre\classes

                    sun.boot.library.path = C:\Program Files\Java\jdk1.8.0_05\jre\bin

                    sun.cpu.endian = little

                    sun.cpu.isalist = amd64

                    sun.desktop = windows

                    sun.io.unicode.encoding = UnicodeLittle

                    sun.java.command = org.jboss.modules.Main -mp C:/Users/AnasAlsubh/EAP-6.3.0-R/jboss-eap-6.3/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -b localhost --server-config=standalone.xml -Djboss.server.base.dir=C:\Users\AnasAlsubh\EAP-6.3.0-R\jboss-eap-6.3\standalone

                    sun.java.launcher = SUN_STANDARD

                    sun.jnu.encoding = Cp1252

                    sun.management.compiler = HotSpot 64-Bit Tiered Compilers

                    sun.os.patch.level = Service Pack 1

                    sun.rmi.dgc.client.gcInterval = 3600000

                    sun.rmi.dgc.server.gcInterval = 3600000

                    user.country = US

                    user.dir = C:\Users\AnasAlsubh\EAP-6.3.0-R\jboss-eap-6.3\bin

                    user.home = C:\Users\AnasAlsubh

                    user.language = en

                    user.name = AnasAlsubh

                    user.script =

                    user.timezone = America/Denver

                    user.variant =

                20:32:55,844 DEBUG [org.jboss.as.config] (MSC service thread 1-7) VM Arguments: -Dprogram.name=JBossTools: JBoss Enterprise Application Platform 6.1+ -Xms1024m -Xmx1024m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=C:/Users/AnasAlsubh/EAP-6.3.0-R/jboss-eap-6.3/standalone/log/boot.log -Dlogging.configuration=file:/C:/Users/AnasAlsubh/EAP-6.3.0-R/jboss-eap-6.3/standalone/configuration/logging.properties -Djboss.home.dir=C:/Users/AnasAlsubh/EAP-6.3.0-R/jboss-eap-6.3 -Dorg.jboss.logmanager.nocolor=true -Djboss.bind.address.management=localhost -Dfile.encoding=Cp1252

                20:32:56,714 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found EnterpriseTransactionEJB.jar in deployment directory. To trigger deployment create a file called EnterpriseTransactionEJB.jar.dodeploy

                20:32:56,735 INFO  [org.xnio] (MSC service thread 1-4) XNIO Version 3.0.10.GA-redhat-1

                20:32:56,737 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)

                20:32:56,739 INFO  [org.xnio.nio] (MSC service thread 1-4) XNIO NIO Implementation Version 3.0.10.GA-redhat-1

                20:32:56,761 INFO  [org.jboss.remoting] (MSC service thread 1-4) JBoss Remoting version (unknown)

                20:32:56,828 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 42) JBAS013171: Activating Security Subsystem

                20:32:56,834 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 46) JBAS015537: Activating WebServices Extension

                20:32:56,852 INFO  [org.jboss.as.security] (MSC service thread 1-5) JBAS013170: Current PicketBox version=4.0.19.SP8-redhat-1

                20:32:56,862 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 37) JBAS011800: Activating Naming Subsystem

                20:32:56,880 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 29) JBAS010280: Activating Infinispan subsystem.

                20:32:56,888 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

                20:32:56,899 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 44) JBAS010153: Node identifier property is set to the default value. Please make sure it is unique.

                20:32:56,905 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 35) JBAS012605: Activated the following JSF Implementations: [main, 1.2]

                20:32:56,950 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (IronJacamar 1.0.26.Final-redhat-1)

                20:32:56,977 INFO  [org.jboss.as.naming] (MSC service thread 1-5) JBAS011802: Starting Naming Service

                20:32:56,977 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-5) JBAS015400: Bound mail session [java:jboss/mail/Default]

                20:32:57,249 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010403: Deploying JDBC-compliant driver class com.microsoft.sqlserver.jdbc.SQLServerDriver (version 4.0)

                20:32:57,295 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) JBWEB003001: Coyote HTTP/1.1 initializing on : http-localhost/127.0.0.1:8080

                20:32:57,321 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) JBWEB003000: Coyote HTTP/1.1 starting on: http-localhost/127.0.0.1:8080

                20:32:57,431 INFO  [org.jboss.ws.common.management] (MSC service thread 1-3) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.3.0.Final-redhat-3

                20:32:57,497 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) JBAS015012: Started FileSystemDeploymentService for directory C:\Users\AnasAlsubh\EAP-6.3.0-R\jboss-eap-6.3\standalone\deployments

                20:32:57,509 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "jdbc-xa.rar" (runtime-name: "jdbc-xa.rar")

                20:32:57,521 INFO  [org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on 127.0.0.1:4447

                20:32:57,522 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "jdbc-local.rar" (runtime-name: "jdbc-local.rar")

                20:32:57,529 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "EnterpriseTransaction.war" (runtime-name: "EnterpriseTransaction.war")

                20:32:57,530 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "EnterpriseTransactionEJB.jar" (runtime-name: "EnterpriseTransactionEJB.jar")

                20:32:57,571 INFO  [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on 127.0.0.1:9999

                20:32:57,589 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) JBAS010400: Bound data source [java:jboss/datasources/MSSQLDS]

                20:32:57,590 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

                20:32:57,771 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.module.service."deployment.EnterpriseTransactionEJB.jar".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.EnterpriseTransactionEJB.jar".main: JBAS018759: Failed to load module: deployment.EnterpriseTransactionEJB.jar:main

                    at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]

                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_05]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_05]

                    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_05]

                Caused by: org.jboss.modules.ModuleLoadException: Error loading module from C:\Users\AnasAlsubh\EAP-6.3.0-R\jboss-eap-6.3\modules\com\microsoft\sqlServer\main\module.xml

                    at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:155) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:132) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.modules.LocalModuleFinder$1.run(LocalModuleFinder.java:154) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.modules.LocalModuleFinder$1.run(LocalModuleFinder.java:148) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_05]

                    at org.jboss.modules.LocalModuleFinder.findModule(LocalModuleFinder.java:148) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.modules.ModuleLoader.findModule(ModuleLoader.java:455) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:358) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:305) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.modules.ModuleLoader.preloadExportedModule(ModuleLoader.java:316) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:329) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.as.server.moduleservice.ServiceModuleLoader.preloadModule(ServiceModuleLoader.java:150) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

                    at org.jboss.modules.Module.addPaths(Module.java:1036) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.modules.Module.link(Module.java:1406) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.modules.Module.relinkIfNecessary(Module.java:1434) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:242) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:70) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

                    ... 5 more

                Caused by: org.jboss.modules.xml.XmlPullParserException: Invalid/mismatched module name (expected com.microsoft.sqlServer:main) (position: START_TAG seen ...odule xmlns="urn:jboss:module:1.1" name="com.microsoft.sqlserver">... @2:69)

                    at org.jboss.modules.ModuleXmlParser.invalidModuleName(ModuleXmlParser.java:192) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.modules.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:370) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.modules.ModuleXmlParser.parseDocument(ModuleXmlParser.java:219) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:153) [jboss-modules.jar:1.3.3.Final-redhat-1]

                    ... 21 more

                 

                20:32:57,874 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-1) IJ020001: Required license terms for file:/C:/Users/AnasAlsubh/EAP-6.3.0-R/jboss-eap-6.3/standalone/tmp/vfs/temp/temp52e16c99c0d85572/content-e7322523c3862507/contents/

                20:32:57,900 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-8) IJ020001: Required license terms for file:/C:/Users/AnasAlsubh/EAP-6.3.0-R/jboss-eap-6.3/standalone/tmp/vfs/temp/temp52e16c99c0d85572/content-53ae874b53b9818/contents/

                20:32:57,912 INFO  [org.jboss.web] (ServerService Thread Pool -- 52) JBAS018210: Register web context: /EnterpriseTransaction

                20:32:57,989 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "jdbc-local.rar" (runtime-name : "jdbc-local.rar")

                20:32:57,989 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "jdbc-xa.rar" (runtime-name : "jdbc-xa.rar")

                20:32:57,989 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "EnterpriseTransaction.war" (runtime-name : "EnterpriseTransaction.war")

                20:32:57,993 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "EnterpriseTransactionEJB.jar" (runtime-name : "EnterpriseTransactionEJB.jar")

                20:32:57,995 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report

                JBAS014777:   Services which failed to start:      service jboss.module.service."deployment.EnterpriseTransactionEJB.jar".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.EnterpriseTransactionEJB.jar".main: JBAS018759: Failed to load module: deployment.EnterpriseTransactionEJB.jar:main

                 

                20:32:58,265 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management

                20:32:58,265 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990

                20:32:58,265 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.3.0.GA (AS 7.4.0.Final-redhat-19) started (with errors) in 2894ms - Started 275 of 315 services (2 services failed or missing dependencies, 65 services are lazy, passive or on-demand)

                20:39:27,245 INFO  [org.jboss.as.naming] (Remoting "anasalsubh-pc" task-9) JBAS011806: Channel end notification received, closing channel Channel ID 7901417d (inbound) of Remoting connection 796f05d1 to /127.0.0.1:53564

                21:20:16,297 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "sqljdbc4.jar" (runtime-name: "sqljdbc4.jar")

                21:20:16,423 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010403: Deploying JDBC-compliant driver class com.microsoft.sqlserver.jdbc.SQLServerDriver (version 4.0)

                21:20:16,605 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018559: Deployed "sqljdbc4.jar" (runtime-name : "sqljdbc4.jar")

                21:20:16,606 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report

                JBAS014777:   Services which failed to start:      service jboss.module.service."deployment.EnterpriseTransactionEJB.jar".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.EnterpriseTransactionEJB.jar".main: JBAS018759: Failed to load module: deployment.EnterpriseTransactionEJB.jar:main

                 

                21:20:41,650 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "mysql-connector-java-5.1.23-bin.jar" (runtime-name: "mysql-connector-java-5.1.23-bin.jar")

                21:20:41,696 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)

                21:20:41,856 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018559: Deployed "mysql-connector-java-5.1.23-bin.jar" (runtime-name : "mysql-connector-java-5.1.23-bin.jar")

                21:20:41,857 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report

                JBAS014777:   Services which failed to start:      service jboss.module.service."deployment.EnterpriseTransactionEJB.jar".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.EnterpriseTransactionEJB.jar".main: JBAS018759: Failed to load module: deployment.EnterpriseTransactionEJB.jar:main

                 

                21:42:48,447 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015010: The deployment scanner found a directory named META-INF that was not inside a directory whose name ends with .ear, .jar, .rar, .sar or .war. This is likely the result of unzipping an archive directly inside the C:\Users\AnasAlsubh\EAP-6.3.0-R\jboss-eap-6.3\standalone\deployments directory, which is a user error. The META-INF directory will not be scanned for deployments, but it is possible that the scanner mayfind other files from the unzipped archive and attempt to deploy them, leading to errors.

                • 5. Re: javax.naming.NameNotFoundException: jboss/datasources/ExampleDS -- service jboss.naming.context.java.jboss.exported.jboss.datasources.ExampleDS
                  miteshmanani

                  Hello,

                   

                  are you trying to lookup to datasource outside jboss or remote ? if yes, its been answered here..

                  Cannot lookup datasource remotely in Jboss 7.10 final

                  • 6. Re: javax.naming.NameNotFoundException: jboss/datasources/ExampleDS -- service jboss.naming.context.java.jboss.exported.jboss.datasources.ExampleDS
                    aalsobeh

                    Jboss 7 does not support remote lookup datasource. Is Wildfly too?

                     

                    Can you help me to know how can make a local lookup datasources?

                     

                    I'm trying to build distributed transaction processing system using Application server and JTA. So can you advice me about what kind of tools, application servers, or frameworks they could help me have a completed DTPS?

                    • 7. Re: javax.naming.NameNotFoundException: jboss/datasources/ExampleDS -- service jboss.naming.context.java.jboss.exported.jboss.datasources.ExampleDS
                      wdfink

                      WildFly is a renaming of JBossAS.

                      It is not possible for an external process to use the datasource pool. You need to handle your own connections.

                      • 8. Re: javax.naming.NameNotFoundException: jboss/datasources/ExampleDS -- service jboss.naming.context.java.jboss.exported.jboss.datasources.ExampleDS
                        miteshmanani

                        Even wildfly doesnt.

                        For local datasource Lookup the Code should be Quite simple...

                         

                        try {

                        InitialContext context = new InitialContext(properties);

                        DataSource datasource = (DataSource) context.lookup("java:/<datasourcename>");

                        Connection con =  datasource.getConnection();

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

                        ...........

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

                        }catch(Exception e) { e.printStackTrace(); }

                             finally {

                        // close the connection

                        }