facebook

Trying to connect to a JBoss datasource from web app.

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #228828 Reply

    Eamon_Skelly
    Member

    Hello,
    I have been trying to connect to a JBoss datasource from a MyEclipse web project for many days now. I have set up the datasource exactly as it describes in the JBOSS instructions, but when I try to connect I get the following error:
    javax.naming.NameNotFoundException: jdbc not bound

    When I look in the Jboss-dmx console, my datasource seems to be there. Yet when I try to connect it continually fails. Is there some configuration of the web app that needs to be done to make it work.
    The config files from JBoss are below:

    mssql-ds.xml

    <datasources>
    <local-tx-datasource>
    <jndi-name>DefaultDS</jndi-name>
    <use-java-context>false</use-java-context>
    <connection-url>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pubs;SelectMethod=cursor;</connection-url>
    <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>

    <user-name>testpub</user-name>
    <password>password</password>

    <metadata>
    <type-mapping>MS SQLSERVER2000</type-mapping>
    </metadata>
    </local-tx-datasource>

    </datasources>

    From login-config.xml

    <application-policy name = “MSSqlLDbRealm”>
    <authentication>
    <login-module code = “org.jboss.resource.security.ConfiguredIdentityLoginModule”
    flag = “required”>
    <module-option name = “principal”>sa</module-option>
    <module-option name = “userName”>testpub</module-option>
    <module-option name = “password”>password</module-option>
    <module-option name = “managedConnectionFactoryName”>jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
    </login-module>
    </authentication>
    </application-policy>

    from standardjbosscmp-jdbc.xml

    <defaults>
    <datasource>java:/DefaultDS</datasource>
    <datasource-mapping>MS SQLSERVER2000</datasource-mapping>

    from standardjaws.xml
    <datasource>java:/DefaultDS</datasource>
    <type-mapping>MS SQLSERVER2000</type-mapping>
    <debug>false</debug>

    If anyone could help I’d be most grateful.
    Thanks
    Eamon

    #228835 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev, not a ME issue, this is a JBoss JNDI configuration issue.

    Eamon, please include the actualy line(s) of code you use to connect to the JNDI data source AND the stack trace.

    #228846 Reply

    Eamon_Skelly
    Member

    This is the code I use to connect, as you probably already know it falls over on the line: ds = (DataSource) ctx.lookup(“java:/DefaultDS”);

    public void startUp()
    {
    try {
    ctx = new InitialContext();
    ds = (DataSource) ctx.lookup(“java:/DefaultDS”);
    conn = ds.getConnection();
    } catch (Exception e) {
    System.out.println(“Connecting error! ” + e.toString());

    }

    The stack trace is as follows:
    15:44:35,775 INFO [Server] Starting JBoss (MX MicroKernel)…
    15:44:35,785 INFO [Server] Release ID: JBoss [Zion] 4.0.1sp1 (build: CVSTag=JBoss_4_0_1_SP1 date=200502160314)
    15:44:35,785 INFO [Server] Home Dir: C:\jboss-4.0.1sp1
    15:44:35,785 INFO [Server] Home URL: file:/C:/jboss-4.0.1sp1/
    15:44:35,785 INFO [Server] Library URL: file:/C:/jboss-4.0.1sp1/lib/
    15:44:35,795 INFO [Server] Patch URL: null
    15:44:35,795 INFO [Server] Server Name: default
    15:44:35,795 INFO [Server] Server Home Dir: C:\jboss-4.0.1sp1\server\default
    15:44:35,795 INFO [Server] Server Home URL: file:/C:/jboss-4.0.1sp1/server/default/
    15:44:35,795 INFO [Server] Server Data Dir: C:\jboss-4.0.1sp1\server\default\data
    15:44:35,815 INFO [Server] Server Temp Dir: C:\jboss-4.0.1sp1\server\default\tmp
    15:44:35,815 INFO [Server] Server Config URL: file:/C:/jboss-4.0.1sp1/server/default/conf/
    15:44:35,815 INFO [Server] Server Library URL: file:/C:/jboss-4.0.1sp1/server/default/lib/
    15:44:35,825 INFO [Server] Root Deployment Filename: jboss-service.xml
    15:44:35,825 INFO [Server] Starting General Purpose Architecture (GPA)…
    15:44:36,696 INFO [ServerInfo] Java version: 1.4.2_08,Sun Microsystems Inc.
    15:44:36,696 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.4.2_08-b03,Sun Microsystems Inc.
    15:44:36,696 INFO [ServerInfo] OS-System: Windows 2000 5.0,x86
    15:44:37,698 INFO [Server] Core system initialized
    15:44:41,503 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
    15:44:41,944 INFO [WebService] Using RMI server codebase: http://SG032665:8083/
    15:44:42,494 INFO [NamingService] Started jndi bootstrap jnpPort=1099, rmiPort=1098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
    15:45:12,718 INFO [Embedded] Catalina naming disabled
    15:45:14,891 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
    15:45:15,121 INFO [Catalina] Initialization processed in 2223 ms
    15:45:15,121 INFO [StandardService] Starting service jboss.web
    15:45:15,161 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.0.28
    15:45:15,312 INFO [StandardHost] XML validation disabled
    15:45:15,412 INFO [Catalina] Server startup in 291 ms
    15:45:15,772 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=file:/C:/jboss-4.0.1sp1/server/default/deploy/http-invoker.sar/invoker.war/
    15:45:18,646 INFO [TomcatDeployer] deploy, ctxPath=/ws4ee, warUrl=file:/C:/jboss-4.0.1sp1/server/default/tmp/deploy/tmp44289jboss-ws4ee-exp.war/
    15:45:19,207 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=file:/C:/jboss-4.0.1sp1/server/default/deploy/jbossweb-tomcat50.sar/ROOT.war/
    15:45:20,149 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=file:/C:/jboss-4.0.1sp1/server/default/deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
    15:45:30,684 INFO [MailService] Mail Service bound to java:/Mail
    15:45:31,895 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.1sp1/server/default/deploy/jboss-local-jdbc.rar
    15:45:32,526 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.1sp1/server/default/deploy/jboss-xa-jdbc.rar
    15:45:34,099 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.1sp1/server/default/deploy/jms/jms-ra.rar
    15:45:34,599 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.1sp1/server/default/deploy/mail-ra.rar
    15:45:35,731 INFO [ConnectionFactoryBindingService] Bound connection factory for resource adapter for ConnectionManager ‘jboss.jca:name=JmsXA,service=ConnectionFactoryBinding to JNDI name ‘java:JmsXA’
    15:45:36,582 INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager ‘jboss.jca:name=DefaultDS,service=DataSourceBinding to JNDI name ‘DefaultDS’
    15:45:40,448 INFO [TomcatDeployer] deploy, ctxPath=/TestJNDI, warUrl=file:/C:/jboss-4.0.1sp1/server/default/deploy/TestJNDI.war/
    15:45:41,559 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=file:/C:/jboss-4.0.1sp1/server/default/deploy/jmx-console.war/
    15:45:42,010 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=file:/C:/jboss-4.0.1sp1/server/default/deploy/management/web-console.war/
    15:45:46,306 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
    MBeans waiting for other MBeans:
    ObjectName: jboss.mq:service=InvocationLayer,type=HTTP
    state: CONFIGURED
    I Depend On: jboss.mq:service=Invoker
    jboss.web:service=WebServer

    Depends On Me:
    ObjectName: jboss.mq.destination:name=testTopic,service=Topic
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager
    jboss.mq:service=SecurityManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=securedTopic,service=Topic
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager
    jboss.mq:service=SecurityManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=testDurableTopic,service=Topic
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager
    jboss.mq:service=SecurityManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=testQueue,service=Queue
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager
    jboss.mq:service=SecurityManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=A,service=Queue
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=B,service=Queue
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=C,service=Queue
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=D,service=Queue
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=ex,service=Queue
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager

    Depends On Me:
    ObjectName: jboss.mq:service=Invoker
    state: CONFIGURED
    I Depend On: jboss.mq:service=TracingInterceptor

    Depends On Me: jboss.mq:service=InvocationLayer,type=HTTP
    jboss.mq:service=InvocationLayer,type=JVM
    jboss.mq:service=InvocationLayer,type=UIL2

    ObjectName: jboss.mq:service=TracingInterceptor
    state: CONFIGURED
    I Depend On: jboss.mq:service=SecurityManager

    Depends On Me: jboss.mq:service=Invoker

    ObjectName: jboss.mq:service=SecurityManager
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager

    Depends On Me: jboss.mq.destination:name=testTopic,service=Topic
    jboss.mq.destination:name=securedTopic,service=Topic
    jboss.mq.destination:name=testDurableTopic,service=Topic
    jboss.mq.destination:name=testQueue,service=Queue
    jboss.mq:service=TracingInterceptor
    jboss.mq.destination:name=DLQ,service=Queue

    ObjectName: jboss.mq.destination:name=DLQ,service=Queue
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager
    jboss.mq:service=SecurityManager

    Depends On Me:
    ObjectName: jboss.mq:service=InvocationLayer,type=JVM
    state: CONFIGURED
    I Depend On: jboss.mq:service=Invoker

    Depends On Me:
    ObjectName: jboss.mq:service=DestinationManager
    state: CONFIGURED
    I Depend On: jboss.mq:service=MessageCache
    jboss.mq:service=PersistenceManager
    jboss.mq:service=StateManager

    Depends On Me: jboss.mq.destination:name=testTopic,service=Topic
    jboss.mq.destination:name=securedTopic,service=Topic
    jboss.mq.destination:name=testDurableTopic,service=Topic
    jboss.mq.destination:name=testQueue,service=Queue
    jboss.mq.destination:name=A,service=Queue
    jboss.mq.destination:name=B,service=Queue
    jboss.mq.destination:name=C,service=Queue
    jboss.mq.destination:name=D,service=Queue
    jboss.mq.destination:name=ex,service=Queue
    jboss.mq:service=SecurityManager
    jboss.mq.destination:name=DLQ,service=Queue

    ObjectName: jboss.mq:service=InvocationLayer,type=UIL2
    state: CONFIGURED
    I Depend On: jboss.mq:service=Invoker

    Depends On Me:

    MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
    ObjectName: jboss.mq:service=StateManager
    state: NOTYETINSTALLED
    I Depend On:
    Depends On Me: jboss.mq:service=DestinationManager

    15:45:46,927 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
    15:45:47,708 INFO [ChannelSocket] JK2: ajp13 listening on /0.0.0.0:8009
    15:45:47,788 INFO [JkMain] Jk running ID=0 time=0/330 config=null
    15:45:47,848 INFO [Server] JBoss (MX MicroKernel) [4.0.1sp1 (build: CVSTag=JBoss_4_0_1_SP1 date=200502160314)] Started in 1m:10s:942ms
    15:46:07,046 INFO [STDOUT] Connecting error! javax.naming.NameNotFoundException: jdbc not bound

    Thanks for your help
    Eamon

    #228852 Reply

    haobaba1
    Member

    try

    
    
    <datasources>
    <local-tx-datasource>
    <jndi-name>jdbc/MSsqlDataSource</jndi-name>
    <use-java-context>false</use-java-context>
    <connection-url>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pubs;SelectMethod=cursor;</connection-url>
    <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
    
    <user-name>testpub</user-name>
    <password>password</password>
    
    <metadata>
    <type-mapping>MS SQLSERVER2000</type-mapping>
    </metadata>
    </local-tx-datasource> 
    
    
    
    public void startUp()
    {
    try {
    ctx = new InitialContext();
    ds = (DataSource) ctx.lookup("java:jdbc/MSsqlDataSource");
    conn = ds.getConnection();
    } catch (Exception e) {
    System.out.println("Connecting error! " + e.toString());
    
    } 
    
    

    The hsqldb-ds.xml has a DefaultDS defined in it already.

    #228853 Reply

    Eamon_Skelly
    Member

    That seems to do the trick. I should have asked earlier instead of bashing my head against a brick wall. Thanks for your help.
    😀

    #229060 Reply

    Eamon_Skelly
    Member

    Hello, The solution I was given above fixed my problem on my laptop PC, oddly enough with MySQL, but when I got back to work and tried to apply it to my desktop PC with Microsoft SQL server I was getting the aforementioned problem. I have included everything from the current PC.

    12:39:37,131 INFO [Server] Starting JBoss (MX MicroKernel)…
    12:39:37,131 INFO [Server] Release ID: JBoss [Zion] 4.0.1sp1 (build: CVSTag=JBoss_4_0_1_SP1 date=200502160314)
    12:39:37,141 INFO [Server] Home Dir: C:\jboss-4.0.1sp1
    12:39:37,141 INFO [Server] Home URL: file:/C:/jboss-4.0.1sp1/
    12:39:37,141 INFO [Server] Library URL: file:/C:/jboss-4.0.1sp1/lib/
    12:39:37,141 INFO [Server] Patch URL: null
    12:39:37,141 INFO [Server] Server Name: default
    12:39:37,141 INFO [Server] Server Home Dir: C:\jboss-4.0.1sp1\server\default
    12:39:37,141 INFO [Server] Server Home URL: file:/C:/jboss-4.0.1sp1/server/default/
    12:39:37,141 INFO [Server] Server Data Dir: C:\jboss-4.0.1sp1\server\default\data
    12:39:37,171 INFO [Server] Server Temp Dir: C:\jboss-4.0.1sp1\server\default\tmp
    12:39:37,171 INFO [Server] Server Config URL: file:/C:/jboss-4.0.1sp1/server/default/conf/
    12:39:37,171 INFO [Server] Server Library URL: file:/C:/jboss-4.0.1sp1/server/default/lib/
    12:39:37,171 INFO [Server] Root Deployment Filename: jboss-service.xml
    12:39:37,181 INFO [Server] Starting General Purpose Architecture (GPA)…
    12:39:37,852 INFO [ServerInfo] Java version: 1.4.2_08,Sun Microsystems Inc.
    12:39:37,852 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.4.2_08-b03,Sun Microsystems Inc.
    12:39:37,852 INFO [ServerInfo] OS-System: Windows 2000 5.0,x86
    12:39:38,513 INFO [Server] Core system initialized
    12:39:41,608 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
    12:39:42,108 INFO [WebService] Using RMI server codebase: http://SG032665:8083/
    12:39:42,429 INFO [NamingService] Started jndi bootstrap jnpPort=1099, rmiPort=1098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
    12:40:09,548 INFO [Embedded] Catalina naming disabled
    12:40:11,220 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
    12:40:11,320 INFO [Catalina] Initialization processed in 1592 ms
    12:40:11,320 INFO [StandardService] Starting service jboss.web
    12:40:11,340 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.0.28
    12:40:11,420 INFO [StandardHost] XML validation disabled
    12:40:11,480 INFO [Catalina] Server startup in 160 ms
    12:40:11,831 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=file:/C:/jboss-4.0.1sp1/server/default/deploy/http-invoker.sar/invoker.war/
    12:40:13,984 INFO [TomcatDeployer] deploy, ctxPath=/ws4ee, warUrl=file:/C:/jboss-4.0.1sp1/server/default/tmp/deploy/tmp6588jboss-ws4ee-exp.war/
    12:40:14,615 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=file:/C:/jboss-4.0.1sp1/server/default/deploy/jbossweb-tomcat50.sar/ROOT.war/
    12:40:15,126 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=file:/C:/jboss-4.0.1sp1/server/default/deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
    12:40:24,159 INFO [MailService] Mail Service bound to java:/Mail
    12:40:25,421 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.1sp1/server/default/deploy/jboss-local-jdbc.rar
    12:40:25,841 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.1sp1/server/default/deploy/jboss-xa-jdbc.rar
    12:40:27,023 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.1sp1/server/default/deploy/jms/jms-ra.rar
    12:40:27,403 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss-4.0.1sp1/server/default/deploy/mail-ra.rar
    12:40:28,365 INFO [ConnectionFactoryBindingService] Bound connection factory for resource adapter for ConnectionManager ‘jboss.jca:name=JmsXA,service=ConnectionFactoryBinding to JNDI name ‘java:JmsXA’
    12:40:28,916 INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager ‘jboss.jca:name=jdbc/MSSQLDS,service=DataSourceBinding to JNDI name ‘jdbc/MSSQLDS’
    12:40:29,016 INFO [TomcatDeployer] deploy, ctxPath=/TestJNDI, warUrl=file:/C:/jboss-4.0.1sp1/server/default/deploy/TestJNDI.war/
    12:40:29,727 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=file:/C:/jboss-4.0.1sp1/server/default/deploy/jmx-console.war/
    12:40:30,157 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=file:/C:/jboss-4.0.1sp1/server/default/deploy/management/web-console.war/
    12:40:32,671 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
    MBeans waiting for other MBeans:
    ObjectName: jboss.ejb:persistencePolicy=database,service=EJBTimerService
    state: CONFIGURED
    I Depend On: jboss.jca:name=DefaultDS,service=DataSourceBinding

    Depends On Me:
    ObjectName: jboss.mq:service=InvocationLayer,type=HTTP
    state: CONFIGURED
    I Depend On: jboss.mq:service=Invoker
    jboss.web:service=WebServer

    Depends On Me:
    ObjectName: jboss:service=KeyGeneratorFactory,type=HiLo
    state: CONFIGURED
    I Depend On: jboss:service=TransactionManager
    jboss.jca:name=DefaultDS,service=DataSourceBinding

    Depends On Me:
    ObjectName: jboss.mq:service=StateManager
    state: CONFIGURED
    I Depend On: jboss.jca:name=DefaultDS,service=DataSourceBinding

    Depends On Me: jboss.mq:service=DestinationManager

    ObjectName: jboss.mq:service=DestinationManager
    state: CONFIGURED
    I Depend On: jboss.mq:service=MessageCache
    jboss.mq:service=PersistenceManager
    jboss.mq:service=StateManager

    Depends On Me: jboss.mq.destination:name=testTopic,service=Topic
    jboss.mq.destination:name=securedTopic,service=Topic
    jboss.mq.destination:name=testDurableTopic,service=Topic
    jboss.mq.destination:name=testQueue,service=Queue
    jboss.mq.destination:name=A,service=Queue
    jboss.mq.destination:name=B,service=Queue
    jboss.mq.destination:name=C,service=Queue
    jboss.mq.destination:name=D,service=Queue
    jboss.mq.destination:name=ex,service=Queue
    jboss.mq:service=SecurityManager
    jboss.mq.destination:name=DLQ,service=Queue

    ObjectName: jboss.mq:service=PersistenceManager
    state: CONFIGURED
    I Depend On: jboss.jca:name=DefaultDS,service=DataSourceBinding

    Depends On Me: jboss.mq:service=DestinationManager

    ObjectName: jboss.mq.destination:name=testTopic,service=Topic
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager
    jboss.mq:service=SecurityManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=securedTopic,service=Topic
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager
    jboss.mq:service=SecurityManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=testDurableTopic,service=Topic
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager
    jboss.mq:service=SecurityManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=testQueue,service=Queue
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager
    jboss.mq:service=SecurityManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=A,service=Queue
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=B,service=Queue
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=C,service=Queue
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=D,service=Queue
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager

    Depends On Me:
    ObjectName: jboss.mq.destination:name=ex,service=Queue
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager

    Depends On Me:
    ObjectName: jboss.mq:service=Invoker
    state: CONFIGURED
    I Depend On: jboss.mq:service=TracingInterceptor

    Depends On Me: jboss.mq:service=InvocationLayer,type=HTTP
    jboss.mq:service=InvocationLayer,type=JVM
    jboss.mq:service=InvocationLayer,type=UIL2

    ObjectName: jboss.mq:service=TracingInterceptor
    state: CONFIGURED
    I Depend On: jboss.mq:service=SecurityManager

    Depends On Me: jboss.mq:service=Invoker

    ObjectName: jboss.mq:service=SecurityManager
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager

    Depends On Me: jboss.mq.destination:name=testTopic,service=Topic
    jboss.mq.destination:name=securedTopic,service=Topic
    jboss.mq.destination:name=testDurableTopic,service=Topic
    jboss.mq.destination:name=testQueue,service=Queue
    jboss.mq:service=TracingInterceptor
    jboss.mq.destination:name=DLQ,service=Queue

    ObjectName: jboss.mq.destination:name=DLQ,service=Queue
    state: CONFIGURED
    I Depend On: jboss.mq:service=DestinationManager
    jboss.mq:service=SecurityManager

    Depends On Me:
    ObjectName: jboss.mq:service=InvocationLayer,type=JVM
    state: CONFIGURED
    I Depend On: jboss.mq:service=Invoker

    Depends On Me:
    ObjectName: jboss.mq:service=InvocationLayer,type=UIL2
    state: CONFIGURED
    I Depend On: jboss.mq:service=Invoker

    Depends On Me:

    MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
    ObjectName: jboss.jca:name=DefaultDS,service=DataSourceBinding
    state: NOTYETINSTALLED
    I Depend On:
    Depends On Me: jboss.ejb:persistencePolicy=database,service=EJBTimerService
    jboss:service=KeyGeneratorFactory,type=HiLo
    jboss.mq:service=StateManager
    jboss.mq:service=PersistenceManager

    12:40:33,302 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
    12:40:33,823 INFO [ChannelSocket] JK2: ajp13 listening on /0.0.0.0:8009
    12:40:33,833 INFO [JkMain] Jk running ID=0 time=0/80 config=null
    12:40:33,903 INFO [Server] JBoss (MX MicroKernel) [4.0.1sp1 (build: CVSTag=JBoss_4_0_1_SP1 date=200502160314)] Started in 55s:850ms
    12:41:13,790 INFO [STDOUT] Connecting error! javax.naming.NameNotFoundException: jdbc not bound

    mssql-ds.xml
    <datasources>
    <local-tx-datasource>
    <jndi-name>jdbc/MSSQLDS</jndi-name>
    <use-java-context>false</use-java-context>
    <connection-url>jdbc:microsoft:sqlserver://170.18.245.10:1433;DatabaseName=Recruitment;SelectMethod=cursor;</connection-url>
    <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
    <user-name>login</user-name>
    <password>password</password>
    <!– sql to call when connection is created
    <new-connection-sql>some arbitrary sql</new-connection-sql>
    –>

    <!– sql to call on an existing pooled connection when it is obtained from pool
    <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
    –>

    <!– corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) –>
    <metadata>
    <type-mapping>MS SQLSERVER2000</type-mapping>
    </metadata>
    </local-tx-datasource>
    </datasources>

    From standardjaws.xml

    <jaws>
    <datasource>java:/MSSQLDS</datasource>
    <type-mapping>MS SQLSERVER2000</type-mapping>

    from standardjbosscmp-jdbc
    <defaults>
    <datasource>java:/MSSQLDS</datasource>

    from login-config.xml
    <application-policy name = “MSSqlLDbRealm”>
    <authentication>
    <login-module code = “org.jboss.resource.security.ConfiguredIdentityLoginModule”
    flag = “required”>
    <module-option name = “principal”>sa</module-option>
    <module-option name = “userName”>login</module-option>
    <module-option name = “password”>password</module-option>
    <module-option name = “managedConnectionFactoryName”>jboss.jca:service=LocalTxCM,name=MSSQLDS</module-option>
    </login-module>
    </authentication>
    </application-policy>

    and of course the java code:

    public void startUp()
    {
    try {
    ctx = new InitialContext();
    ds = (DataSource) ctx.lookup(“java:jdbc/MSSQLDS”);
    conn = ds.getConnection();
    } catch (Exception e) {
    System.out.println(“Connecting error! ” + e.toString());

    }

    I’m probably missing something obvious, but if you can help (again) I’d be very grateful.
    Thanks[/b]

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Trying to connect to a JBoss datasource from web app.

You must be logged in to post in the forum log in