Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Process Manager (Stardust) » SQLException "Invalid Oracle URL specified"(Problems configuring Oracle 11g as XA datasource in Tomcat 6)
SQLException "Invalid Oracle URL specified" [message #778231] Wed, 11 January 2012 20:40 Go to next message
Jan Hendrik Scheufen is currently offline Jan Hendrik Scheufen
Messages: 61
Registered: October 2011
Member

Hi,

I'm setting up a local Stardust installation based on Tomcat 6 and Oracle 11g, but after configuring the Oracle XA datasource in the server.xml, I get the following exception when the application bootstraps.

13:48:43 INFO  [main      ] GlobalParameters          - Loading properties via provider factory ag.carnot.workflow.runtime.spring.web.SpringAppContextPropertiesProviderFactory (priority 4).
13:48:43 INFO  [main      ] ContextPropertiesProvider -   ag.carnot.workflow.runtime.spring.cachedApplicationContext = null
13:48:43 INFO  [main      ] EngineService             - Bootstrapping engine
13:48:43 INFO  [main      ] DebugInterceptor          - --> isolate
13:48:43 ERROR [main      ] MCFConnectionInterceptor  - Error occurred creating ManagedConnection for org.apache.geronimo.connector.outbound.ConnectionInfo@60eb9f0a
javax.resource.spi.ResourceAdapterInternalException: Unable to obtain physical connection to oracle.jdbc.xa.client.OracleXADataSource@2a5b8e8c
	at ag.carnot.db.jca.XaDataSourceMCF.getPhysicalConnection(XaDataSourceMCF.java:67)
	at org.tranql.connector.jdbc.AbstractXADataSourceMCF.createManagedConnection(AbstractXADataSourceMCF.java:64)
	at org.apache.geronimo.connector.outbound.MCFConnectionInterceptor.getConnection(MCFConnectionInterceptor.java:48)
	at org.apache.geronimo.connector.outbound.XAResourceInsertionInterceptor.getConnection(XAResourceInsertionInterceptor.java:41)
	at org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor.internalGetConnection(SinglePoolConnectionInterceptor.java:70)
	at org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor.getConnection(AbstractSinglePoolConnectionInterceptor.java:80)
	at org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor.getConnection(TransactionEnlistingInterceptor.java:46)
	at org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.getConnection(TransactionCachingInterceptor.java:86)
	at org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnection(ConnectionHandleInterceptor.java:43)
	at org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(TCCLInterceptor.java:39)
	at org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:87)
	at org.tranql.connector.jdbc.DataSource.getConnection(DataSource.java:56)
	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:331)
	at ag.carnot.workflow.runtime.spring.SpringSessionInterceptor.invoke(SpringSessionInterceptor.java:75)
	at ag.carnot.workflow.runtime.interceptor.MethodInvocationImpl.proceed(MethodInvocationImpl.java:123)
	at ag.carnot.workflow.runtime.spring.SpringConfigurationInterceptor.invoke(SpringConfigurationInterceptor.java:94)
	at ag.carnot.workflow.runtime.interceptor.MethodInvocationImpl.proceed(MethodInvocationImpl.java:123)
	at ag.carnot.workflow.runtime.beans.interceptors.PropertyLayerProviderInterceptor.invoke(PropertyLayerProviderInterceptor.java:107)
	at ag.carnot.workflow.runtime.interceptor.MethodInvocationImpl.proceed(MethodInvocationImpl.java:123)
	at ag.carnot.workflow.runtime.beans.interceptors.DebugInterceptor.invoke(DebugInterceptor.java:45)
	at ag.carnot.workflow.runtime.interceptor.MethodInvocationImpl.proceed(MethodInvocationImpl.java:123)
	at ag.carnot.workflow.runtime.spring.SpringTxInterceptor$1.doInTransaction(SpringTxInterceptor.java:64)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
	at ag.carnot.workflow.runtime.spring.SpringTxInterceptor.invoke(SpringTxInterceptor.java:49)
	at ag.carnot.workflow.runtime.interceptor.MethodInvocationImpl.proceed(MethodInvocationImpl.java:123)
	at ag.carnot.workflow.runtime.interceptor.MethodInvocationImpl.execute(MethodInvocationImpl.java:61)
	at ag.carnot.workflow.runtime.beans.InvocationManager.invoke(InvocationManager.java:46)
	at $Proxy8.isolate(Unknown Source)
	at ag.carnot.workflow.runtime.spring.AbstractSpringForkingServiceBean$2.doInTransaction(AbstractSpringForkingServiceBean.java:139)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
	at ag.carnot.workflow.runtime.spring.AbstractSpringForkingServiceBean.isolate(AbstractSpringForkingServiceBean.java:128)
	at ag.carnot.workflow.runtime.spring.AbstractSpringForkingServiceBean.afterPropertiesSet(AbstractSpringForkingServiceBean.java:59)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.sql.SQLException: Invalid Oracle URL specified
	at oracle.jdbc.xa.client.OracleXADataSource.getPooledConnection(OracleXADataSource.java:219)
	at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:154)
	at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:99)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
	at $Proxy7.getXAConnection(Unknown Source)
	at ag.carnot.db.jca.XaDataSourceMCF.getPhysicalConnection(XaDataSourceMCF.java:63)
	... 74 more


This is the datasource in the Tomcat's "server.xml":
<Resource name="AuditTrail.DataSource"
            type="oracle.jdbc.xa.client.OracleXADataSource"
            driverClassName="oracle.jdbc.driver.OracleDriver"
            factory="oracle.jdbc.pool.OracleDataSourceFactory"
            url="jdbc:oracle:thin:@localhost:1521:oracle"
            username="xxx"
            password="xxx"
            auth="Container"
            defaultAutoCommit="false"
            maxActive="10"
            maxIdle="2"
            maxWait="5000"/>


And the JNDI lookup from the Spring context file:
   <bean id="carnotXaAuditTrailDataSourceJndi" class="org.springframework.jndi.JndiObjectFactoryBean">
      <property name="jndiName" value="java:comp/env/jdbc/AuditTrail.DataSource" />
   </bean>


I've verified that I can login to the DB via a DB explorer using the exact same JDBC URL and I've already tried different combinations of the URL, but no success.

Any idea what could be wrong?
Re: SQLException "Invalid Oracle URL specified" [message #778246 is a reply to message #778231] Wed, 11 January 2012 22:22 Go to previous message
Jan Hendrik Scheufen is currently offline Jan Hendrik Scheufen
Messages: 61
Registered: October 2011
Member

Issue solved!

It turns out that the API when specifying a OracleDataSourceFactory requires the "user" property and not "username". This differs from the a standard Oracle datasource of type="javax.sql.DataSource" that is used in most examples.

So the correct datasource definition looks like this:

<Resource name="AuditTrail.DataSource"
type="oracle.jdbc.xa.client.OracleXADataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
factory="oracle.jdbc.pool.OracleDataSourceFactory"
url="jdbc:oracle:thin:@localhost:1521:oracle"
user="xxx"
password="xxx"
auth="Container"
defaultAutoCommit="false"
maxActive="10"
maxIdle="2"
maxWait="5000"/>

The WTP plugin in Eclipse did not make it easy to solve this either. I was using the Stardust RAD environment with an embedded Tomcat and a Dynamic Web Project. As I found out, changes to the server.xml are not propagated immediately when simply restarting the Tomcat instance! First "Clean" via the server's context menu and then restarting did the trick!
Previous Topic:No Such Method exception org.apache.xml.serializer.ExtendedContentHandler
Next Topic:Eclipse cannot find ActiveMQ XSD schema and shows validation warnings
Goto Forum:
  


Current Time: Thu Oct 23 08:04:27 GMT 2014

Powered by FUDForum. Page generated in 0.01616 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software