issue with XADatasource in sqlserver.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

issue with XADatasource in sqlserver.

Dignesh
Hi,
I am using TomEE 7.0.2

I am configuring the XAdatasources in TomEE. I was able to do it successfully in Oracle and PostgreSQL. I am facing some issues with it in Sqlserver.

Below is my resource configuration in tomee.xml file.

<Resource id="jdbc/dignesh" type="DataSource">
                XaDataSource Xa/ds
                UserName ****
                Password ****
                PasswordCipher ****
        </Resource>

For postgres :-

<Resource id="Xa/ds" class-name="org.postgresql.xa.PGXADataSource">
                Url *****
                DataSourceCreator = dbcp
        </Resource>

For Oracle :-
<Resource id="XA/Datasource" class-name="oracle.jdbc.xa.client.OracleXADataSource">
                Url *****
                DataSourceCreator = dbcp
        </Resource>

For SQlserver :-

        <Resource class-name="com.microsoft.sqlserver.jdbc.SQLServerXADataSource" id="XA/Datasource">
                Url *****
                DataSourceCreator = dbcp
        </Resource>

So the above configurations work fine in oracle and postgres. In sqlserver when I start TomEE it is giving me the connection exceptions.When I revert back to non xadatsource it is working fine. Is there any extra configuration that needs to be done in sqlserver or is it the approach which i am using is incorrect. can any one please help me on this.

Below is the error when i start the server

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 10.6.32.25, port 2300 has failed. Error: Connection timed out: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:130)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1195)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(SQLServerConnection.java:1054)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:758)
        at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
        at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:310)
        at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:203)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:718)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:650)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:143)
        at org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEConnectionPool.<init>(TomEEDataSourceCreator.java:221)
        at org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource.createPool(TomEEDataSourceCreator.java:154)
        at org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource.<init>(TomEEDataSourceCreator.java:131)
        at org.apache.tomee.jdbc.TomEEDataSourceCreator.pool(TomEEDataSourceCreator.java:68)
        at org.apache.openejb.resource.jdbc.DataSourceFactory.create(DataSourceFactory.java:216)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.xbean.recipe.ReflectionUtil$StaticFactory.create(ReflectionUtil.java:997)
        at org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:276)
        at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
        at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
        at org.apache.openejb.assembler.classic.Assembler.doCreateResource(Assembler.java:2969)
        at org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:2802)
        at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:574)
        at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:483)
        at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:307)
        at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:247)
        at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:168)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:395)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:108)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:606)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:629)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
media ->  14:27:23,517 ERROR [TomEEDataSourceCreator$TomEEDataSource] Can't create DataSource
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 10.6.32.25, port 2300 has failed. Error: Connection timed out: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:130)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1195)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(SQLServerConnection.java:1054)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:758)
        at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
        at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:310)
        at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:203)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:718)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:650)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)
        at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:143)
        at org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEConnectionPool.<init>(TomEEDataSourceCreator.java:221)
        at org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource.createPool(TomEEDataSourceCreator.java:154)
        at org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource.<init>(TomEEDataSourceCreator.java:131)
        at org.apache.tomee.jdbc.TomEEDataSourceCreator.pool(TomEEDataSourceCreator.java:68)
        at org.apache.openejb.resource.jdbc.DataSourceFactory.create(DataSourceFactory.java:216)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.xbean.recipe.ReflectionUtil$StaticFactory.create(ReflectionUtil.java:997)
        at org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:276)
        at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
        at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
        at org.apache.openejb.assembler.classic.Assembler.doCreateResource(Assembler.java:2969)
        at org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:2802)
        at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:574)
        at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:483)
        at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:307)
        at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:247)
        at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:168)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:395)
        at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:108)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:606)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:629)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with XADatasource in sqlserver.

Romain Manni-Bucau
can you run ./bin/tomee.sh setters -c com.microsoft.sqlserver.jdbc.
SQLServerXADataSource

Don't think there is a "Url" config on that class


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-03-29 11:11 GMT+02:00 Dignesh <[hidden email]>:

> Hi,
> I am using TomEE 7.0.2
>
> I am configuring the XAdatasources in TomEE. I was able to do it
> successfully in Oracle and PostgreSQL. I am facing some issues with it in
> Sqlserver.
>
> Below is my resource configuration in tomee.xml file.
>
> <Resource id="jdbc/dignesh" type="DataSource">
>                 XaDataSource Xa/ds
>                 UserName ****
>                 Password ****
>                 PasswordCipher ****
>         </Resource>
>
> For postgres :-
>
> <Resource id="Xa/ds" class-name="org.postgresql.xa.PGXADataSource">
>                 Url *****
>                 DataSourceCreator = dbcp
>         </Resource>
>
> For Oracle :-
> <Resource id="XA/Datasource"
> class-name="oracle.jdbc.xa.client.OracleXADataSource">
>                 Url *****
>                 DataSourceCreator = dbcp
>         </Resource>
>
> For SQlserver :-
>
>         <Resource class-name="com.microsoft.sqlserver.jdbc.
> SQLServerXADataSource"
> id="XA/Datasource">
>                 Url *****
>                 DataSourceCreator = dbcp
>         </Resource>
>
> So the above configurations work fine in oracle and postgres. In sqlserver
> when I start TomEE it is giving me the connection exceptions.When I revert
> back to non xadatsource it is working fine. Is there any extra
> configuration
> that needs to be done in sqlserver or is it the approach which i am using
> is
> incorrect. can any one please help me on this.
>
> Below is the error when i start the server
>
> com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to
> the host 10.6.32.25, port 2300 has failed. Error: Connection timed out:
> connect. Please verify the connection properties and check that a SQL
> Server
> instance is running on the host and accepting TCP/IP connections at the
> port, and that no firewall is blocking TCP connections to the port.
>         at
> com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(
> SQLServerException.java:130)
>         at
> com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(
> SQLServerConnection.java:1195)
>         at
> com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(
> SQLServerConnection.java:1054)
>         at
> com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(
> SQLServerConnection.java:758)
>         at
> com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(
> SQLServerDriver.java:842)
>         at
> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(
> PooledConnection.java:310)
>         at
> org.apache.tomcat.jdbc.pool.PooledConnection.connect(
> PooledConnection.java:203)
>         at
> org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(
> ConnectionPool.java:718)
>         at
> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(
> ConnectionPool.java:650)
>         at
> org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)
>         at
> org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:143)
>         at
> org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEConnectionPool.<init>(
> TomEEDataSourceCreator.java:221)
>         at
> org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource.createPool(
> TomEEDataSourceCreator.java:154)
>         at
> org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource.<init>(
> TomEEDataSourceCreator.java:131)
>         at
> org.apache.tomee.jdbc.TomEEDataSourceCreator.pool(
> TomEEDataSourceCreator.java:68)
>         at
> org.apache.openejb.resource.jdbc.DataSourceFactory.create(
> DataSourceFactory.java:216)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 57)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:606)
>         at
> org.apache.xbean.recipe.ReflectionUtil$StaticFactory.
> create(ReflectionUtil.java:997)
>         at
> org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:276)
>         at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
>         at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
>         at
> org.apache.openejb.assembler.classic.Assembler.doCreateResource(Assembler.
> java:2969)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createResource(Assembler.java:2802)
>         at
> org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(
> Assembler.java:574)
>         at
> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:483)
>         at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
>         at org.apache.openejb.OpenEJB.init(OpenEJB.java:307)
>         at
> org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:247)
>         at
> org.apache.tomee.catalina.ServerListener.lifecycleEvent(
> ServerListener.java:168)
>         at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(
> LifecycleBase.java:94)
>         at
> org.apache.catalina.util.LifecycleBase.setStateInternal(
> LifecycleBase.java:395)
>         at
> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:108)
>         at org.apache.catalina.startup.Catalina.load(Catalina.java:606)
>         at org.apache.catalina.startup.Catalina.load(Catalina.java:629)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 57)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:606)
>         at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
> media ->  14:27:23,517 ERROR [TomEEDataSourceCreator$TomEEDataSource]
> Can't
> create DataSource
> com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to
> the host 10.6.32.25, port 2300 has failed. Error: Connection timed out:
> connect. Please verify the connection properties and check that a SQL
> Server
> instance is running on the host and accepting TCP/IP connections at the
> port, and that no firewall is blocking TCP connections to the port.
>         at
> com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(
> SQLServerException.java:130)
>         at
> com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(
> SQLServerConnection.java:1195)
>         at
> com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(
> SQLServerConnection.java:1054)
>         at
> com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(
> SQLServerConnection.java:758)
>         at
> com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(
> SQLServerDriver.java:842)
>         at
> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(
> PooledConnection.java:310)
>         at
> org.apache.tomcat.jdbc.pool.PooledConnection.connect(
> PooledConnection.java:203)
>         at
> org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(
> ConnectionPool.java:718)
>         at
> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(
> ConnectionPool.java:650)
>         at
> org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:468)
>         at
> org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:143)
>         at
> org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEConnectionPool.<init>(
> TomEEDataSourceCreator.java:221)
>         at
> org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource.createPool(
> TomEEDataSourceCreator.java:154)
>         at
> org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource.<init>(
> TomEEDataSourceCreator.java:131)
>         at
> org.apache.tomee.jdbc.TomEEDataSourceCreator.pool(
> TomEEDataSourceCreator.java:68)
>         at
> org.apache.openejb.resource.jdbc.DataSourceFactory.create(
> DataSourceFactory.java:216)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 57)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:606)
>         at
> org.apache.xbean.recipe.ReflectionUtil$StaticFactory.
> create(ReflectionUtil.java:997)
>         at
> org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:276)
>         at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
>         at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
>         at
> org.apache.openejb.assembler.classic.Assembler.doCreateResource(Assembler.
> java:2969)
>         at
> org.apache.openejb.assembler.classic.Assembler.
> createResource(Assembler.java:2802)
>         at
> org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(
> Assembler.java:574)
>         at
> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:483)
>         at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
>         at org.apache.openejb.OpenEJB.init(OpenEJB.java:307)
>         at
> org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:247)
>         at
> org.apache.tomee.catalina.ServerListener.lifecycleEvent(
> ServerListener.java:168)
>         at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(
> LifecycleBase.java:94)
>         at
> org.apache.catalina.util.LifecycleBase.setStateInternal(
> LifecycleBase.java:395)
>         at
> org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:108)
>         at org.apache.catalina.startup.Catalina.load(Catalina.java:606)
>         at org.apache.catalina.startup.Catalina.load(Catalina.java:629)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 57)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:606)
>         at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/issue-with-XADatasource-in-sqlserver-tp4681379.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with XADatasource in sqlserver.

Dignesh

C:\dignesh\TomEE\apache-tomee-plus-7.0.2\bin>tomee.bat setters -c com.microsoft.sqlserver.jdbc.SQLServerXADataSource
- ApplicationName
- DatabaseName
- Description
- Encrypt
- FailoverPartner
- HostNameInCertificate
- InstanceName
- IntegratedSecurity
- LastUpdateCount
- LockTimeout
- LogWriter
- LoginTimeout
- PacketSize
- Password
- PortNumber
- ResponseBuffering
- SelectMethod
- SendStringParametersAsUnicode
- ServerName
- TrustServerCertificate
- TrustStore
- TrustStorePassword
- URL
- User
- WorkstationID
- XopenStates
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with XADatasource in sqlserver.

Romain Manni-Bucau
did you check you can connect on that url (telnet host port)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-03-29 11:25 GMT+02:00 Dignesh <[hidden email]>:

>
> C:\dignesh\TomEE\apache-tomee-plus-7.0.2\bin>tomee.bat setters -c
> com.microsoft.sqlserver.jdbc.SQLServerXADataSource
> - ApplicationName
> - DatabaseName
> - Description
> - Encrypt
> - FailoverPartner
> - HostNameInCertificate
> - InstanceName
> - IntegratedSecurity
> - LastUpdateCount
> - LockTimeout
> - LogWriter
> - LoginTimeout
> - PacketSize
> - Password
> - PortNumber
> - ResponseBuffering
> - SelectMethod
> - SendStringParametersAsUnicode
> - ServerName
> - TrustServerCertificate
> - TrustStore
> - TrustStorePassword
> - URL
> - User
> - WorkstationID
> - XopenStates
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/issue-with-XADatasource-in-sqlserver-tp4681379p4681381.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with XADatasource in sqlserver.

Dignesh
This post was updated on .
Yes. I am able to connect .

If I configure to Non XA datasource it is working fine.
I am able to get it work with below configuration

<Resource id="jdbc/dignesh" type="DataSource">
                JdbcDriver com.microsoft.sqlserver.jdbc.SQLServerDriver
                JdbcUrl ****
                UserName ****
                Password ***
                JtaManaged false
        </Resource>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with XADatasource in sqlserver.

Romain Manni-Bucau
depending the xadatasource impl you can need to repeat jdbcurl/username etc
on the pool itself


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-03-29 11:32 GMT+02:00 Dignesh <[hidden email]>:

> Yes. I am able to connect .
>
> If I configure to Non XA datasource it is working fine.
> I am able to get it work with below configuration
>
> <Resource id="jdbc/dignesh" type="DataSource">
>                 JdbcDriver com.microsoft.sqlserver.jdbc.SQLServerDriver
>                 JdbcUrl ****
>                 UserName OTMM
>                 Password ***
>                 JtaManaged false
>         </Resource>
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/issue-with-XADatasource-in-sqlserver-tp4681379p4681383.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with XADatasource in sqlserver.

Dignesh
Can you please provide me an example. I am not able to get it work though I pass the url/username etc in pool itself.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with XADatasource in sqlserver.

Dignesh
In reply to this post by Dignesh
Hi Romain,

I resolved the issue somehow. I recreated the ear , deleted the tmp etc...

I see a different issue now. Do I need to enable something in Sqlserver ? Or is there any other configuration that needs to be done in tomee.

Mar 30, 2017 3:28:34 PM org.apache.geronimo.transaction.manager.TransactionImpl enlistResource
WARNING: Unable to enlist XAResource  XAResourceID:1, errorCode: -3
javax.transaction.xa.XAException: com.microsoft.sqlserver.jdbc.SQLServerException: Failed to create the XA control connection. Error: Could not find stored procedure 'master..xp_sqljdbc_xa_init'..
        at com.microsoft.sqlserver.jdbc.SQLServerXAResource.DTC_XA_Interface(SQLServerXAResource.java:640)
        at com.microsoft.sqlserver.jdbc.SQLServerXAResource.start(SQLServerXAResource.java:672)
        at org.apache.geronimo.transaction.manager.TransactionImpl.enlistResource(TransactionImpl.java:209)
        at org.apache.openejb.resource.jdbc.managed.local.ManagedConnection.invoke(ManagedConnection.java:134)
        at com.sun.proxy.$Proxy82.prepareStatement(Unknown Source)
        at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:159)
        at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:183)
        at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:157)

Thank you very much.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with XADatasource in sqlserver.

Jonathan Gallimore-4
Hi

To use XA with SQL Server, there's a DLL you need to copy on your SQL
Server machine itself, some stored procedures that need to be imported, and
MSDTC needs to be configured.

Hopefully this will help,
https://msdn.microsoft.com/en-us/library/aa342335.aspx, but let us know if
not and I'll try and put some better instructions together.

Jon

On Thu, Mar 30, 2017 at 10:56 AM, Dignesh <[hidden email]> wrote:

> Hi Romain,
>
> I resolved the issue somehow. I recreated the ear , deleted the tmp etc...
>
> I see a different issue now. Do I need to enable something in Sqlserver ?
> Or
> is there any other configuration that needs to be done in tomee.
>
> Mar 30, 2017 3:28:34 PM
> org.apache.geronimo.transaction.manager.TransactionImpl enlistResource
> WARNING: Unable to enlist XAResource  XAResourceID:1, errorCode: -3
> javax.transaction.xa.XAException:
> com.microsoft.sqlserver.jdbc.SQLServerException: Failed to create the XA
> control connection. Error: Could not find stored procedure
> 'master..xp_sqljdbc_xa_init'..
>         at
> com.microsoft.sqlserver.jdbc.SQLServerXAResource.DTC_XA_
> Interface(SQLServerXAResource.java:640)
>         at
> com.microsoft.sqlserver.jdbc.SQLServerXAResource.start(
> SQLServerXAResource.java:672)
>         at
> org.apache.geronimo.transaction.manager.TransactionImpl.enlistResource(
> TransactionImpl.java:209)
>         at
> org.apache.openejb.resource.jdbc.managed.local.ManagedConnection.invoke(
> ManagedConnection.java:134)
>         at com.sun.proxy.$Proxy82.prepareStatement(Unknown Source)
>         at
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(
> StatementPreparerImpl.java:159)
>         at
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl$
> StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:
> 183)
>         at
> org.hibernate.engine.jdbc.internal.StatementPreparerImpl.
> prepareQueryStatement(StatementPreparerImpl.java:157)
>
> Thank you very much.
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/issue-with-XADatasource-in-sqlserver-tp4681379p4681392.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>



--
Jonathan Gallimore
http://twitter.com/jongallimore
http://www.tomitribe.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with XADatasource in sqlserver.

Dignesh
Thank you Jonathan.

I was trying the same thing,after a bit of research in google :).
Just curious to know, I haven't done this extra configuration when using JBoss as app server and it worked fine for xa datasources. Why the TomEE needs this extra configuration ?

Thank you very much.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with XADatasource in sqlserver.

Jonathan Gallimore-4
I haven't ever tried this config in JBoss, so in truth, I don't know. I'd
need to look at a specific config in JBoss probably with a debugger to know
for sure. I originally discovered these steps from an IBM website, so I
don't think this requirement is unique to TomEE.

If you can share your JBoss config (with security details like passwords
etc redacted), I'm happy to look and try and suggest the equivalent in
TomEE, or find out why there's a difference.

Jon

On Thu, Mar 30, 2017 at 12:00 PM, Dignesh <[hidden email]> wrote:

> Thank you Jonathan.
>
> I was trying the same thing,after a bit of research in google :).
> Just curious to know, I haven't done this extra configuration when using
> JBoss as app server and it worked fine for xa datasources. Why the TomEE
> needs this extra configuration ?
>
> Thank you very much.
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/issue-with-XADatasource-in-sqlserver-tp4681379p4681397.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>



--
Jonathan Gallimore
http://twitter.com/jongallimore
http://www.tomitribe.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with XADatasource in sqlserver.

Dignesh
Thank you Jonathan,
I got it worked by running the xa scripts and doing the configuration in sqlserver.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: issue with XADatasource in sqlserver.

Dignesh
Hi,

I keep getting the below error in log with with oracle as database. Any idea why i am seeing the below error ?

org.apache.geronimo.transaction.manager.TransactionImpl enlistResource
WARNING: Unable to enlist XAResource oracle.jdbc.driver.T4CXAResource@45004e41, errorCode: 4
oracle.jdbc.xa.OracleXAException
        at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1033)
        at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:240)
        at org.apache.geronimo.transaction.manager.TransactionImpl.enlistResource(TransactionImpl.java:202)
        at org.apache.openejb.resource.jdbc.managed.local.ManagedConnection.invoke(ManagedConnection.java:134)
        at com.sun.proxy.$Proxy82.getAutoCommit(Unknown Source)
        at org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.setAutoCommit(AttributeRestoringConnectionInvocationHandler.java:90)
        at org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.invoke(AttributeRestoringConnectionInvocationHandler.java:66)
        at com.sun.proxy.$Proxy82.setAutoCommit(Unknown Source)
        at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:799)
        at org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(JobStoreCMT.java:235)
        at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJobsAndTriggers(JobStoreSupport.java:1323)
        at org.quartz.core.QuartzScheduler.scheduleJobs(QuartzScheduler.java:1056)
        at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:1066)
        at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:286)
Loading...