• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data Source Not Found

 
Ned Porter
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having an issue getting my Web Service to locate a Data Source. I am using JBoss 4.0.2, and I have made sure the Data Source File is present in my deploy directory, and I have checked the JMX Console to make sure the Data Source is registered. When JBoss starts it binds the datasource, but for some reason my WebService can not locate the datasource. Any Help you could provide would be greatly Appreciated.

Note that in my Hibernate cfg.xml file I have commented out a direct reference to the database, trying to get the data source file to work. That configuration works properly, however the data source file method does not.

My Hibernate CFG.XML File:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>


<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory name="ExampleHibernateSessionFactory">

<!-- Change these to refer to the appropriate database -->
<property name="db">Oracle</property>
<property name="dialect">org.hibernate.dialect.RdbDialect</property>
<property name="jdbc.batch_size">0</property>

<!-- This should work with an Enterprise deployment... -->
<property name="connection.datasource">java:/LabAuthorizationDS_RDB</property>


<!-- This is used for a WAR deployment

<property name="connection.url">jdbc:rdbThin://stgsy2.crlcorp.com:1702/CLS_DB</property>
<property name="connection.driver_class">oracle.rdb.jdbc.rdbThin.Driver</property>

<property name="connection.username">USERNAME</property>
<property name="connection.password">PASSWORD</property>
-->

<property name="show_sql">true</property>
<property name="use_outer_join">true</property>

<!-- This is being used in the WAR deployment.
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
-->
<!-- This will be used for the enterprise rollout.-->
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>

<mapping resource="com/crlcorp/labauthorization/model/LabAuthorization.hbm.xml"/>
<mapping resource="com/crlcorp/labauthorization/model/SampleAuthorization.hbm.xml"/>
<mapping resource="com/crlcorp/labauthorization/model/SampleState.hbm.xml"/>
<mapping resource="com/crlcorp/labauthorization/model/ClientUser.hbm.xml"/>

</session-factory>

</hibernate-configuration>


My Data Source File:

<?xml version="1.0" encoding="UTF-8"?>

<datasources>
<local-tx-datasource>
<jndi-name>LabAuthorizationDS_RDB</jndi-name>

<connection-url>jdbc:rdbThin://devsys.crlcorp.com:1702/CLS_DB</connection-url>
<driver-class>oracle.rdb.jdbc.rdbThin.Driver</driver-class>

<user-name>USERNAME</user-name>
<password>PASSWORD</password>
<min-pool-size>1</min-pool-size>

<exception-sorter-class-name>
org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
</exception-sorter-class-name>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<new-connection-sql>select 1 from dual</new-connection-sql>
</local-tx-datasource>
</datasources>

The JMX Console Output:

java: Namespace
+- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
+- DefaultDS (class: javax.sql.DataSource)
+- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
+- CRL_WEBSECURE (class: javax.sql.DataSource)
+- CLSDS_RDB_SAMTRK (class: javax.sql.DataSource)
+- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
+- comp (class: javax.naming.Context)
+- LabAuthorizationDS_RDB (class: javax.sql.DataSource)
+- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
+- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
+- jaas (class: javax.naming.Context)
| +- JmsXARealm (class: org.jboss.security.plugins.SecurityDomainContext)
| +- jbossmq (class: org.jboss.security.plugins.SecurityDomainContext)
| +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
+- timedCacheFactory (class: javax.naming.Context)
Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy
+- TransactionPropagationContextExporter (class: org.jboss.tm.TransactionPropagationContextFactory)
+- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)
+- Mail (class: javax.mail.Session)
+- TransactionPropagationContextImporter (class: org.jboss.tm.TransactionPropagationContextImporter)
+- TransactionManager (class: org.jboss.tm.TxManager)

The JBoss Console output when starting:

INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=DataSourceBinding,name=LabAuthorizationDS_RDB to JNDI name 'java:LabAuthorizationDS_RDB'

The JBoss Console output when error occurs:

INFO [STDOUT] [FATAL] DatasourceConnectionProvider - -Could not find datasource: java:/LabAuthorizationDS_RDB <javax.naming.NameNotFoundException: LabAuthorizationDS_RDB not bound>javax.naming.NameNotFoundException: LabAuthorizationDS_RDB not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(Unknown Source)
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:44)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:80)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:362)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
at com.crlcorp.labauthorization.hibernate.AuthorizationManager.getSessionFactory(AuthorizationManager.java:80)
at com.crlcorp.labauthorization.hibernate.AuthorizationManager.getConfiguration(AuthorizationManager.java:56)
at com.crlcorp.labauthorization.hibernate.AuthorizationManager.getSessionFactory(AuthorizationManager.java:80)
at com.crlcorp.labauthorization.hibernate.AuthorizationManager.getClientUser(AuthorizationManager.java:402)
at com.crlcorp.labauthorization.utils.SecurityUtils.isUserAuthorized(SecurityUtils.java:57)
at com.crlcorp.labauthorization.utils.SecurityUtils.isUserAuthorized(SecurityUtils.java:49)
at com.crlcorp.labauthorization.service.AuthorizationImpl.processAuthorizationRequest(AuthorizationImpl.java:76)
at com.crlcorp.labauthorization.service.LabAuthorizationSoapBindingImpl.processAuthorizationRequest(LabAuthorizationSoapBindingImpl.java:23)
at com.crlcorp.labauthorization.service.LabAuthorizationSoapBindingSkeleton.processAuthorizationRequest(LabAuthorizationSoapBindingSkeleton.java:138)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Unknown Source)
16:29:29,306 INFO [STDOUT] Could not create SessionFactory.
16:29:29,306 INFO [STDOUT] Encountered an error setting the configuration lengths.
16:29:29,306 INFO [STDOUT] Could not create SessionFactory.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic