You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/12/25 08:04:21 UTC

[GitHub] [skywalking] arronbin opened a new issue #6080: mssql error

arronbin opened a new issue #6080:
URL: https://github.com/apache/skywalking/issues/6080


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [ ] Bug
   - [ ] Requirement
   - [ ] Feature or performance improvement
   
   ___
   ### Question
   - What do you want to know?
   
   ___
   ### Bug
   - Which version of SkyWalking, OS, and JRE?
   
   - Which company or project?
   
   - What happened?
   If possible, provide a way to reproduce the error. e.g. demo application, component version.
   
   ___
   ### Requirement or improvement
   - Please describe your requirements or improvement suggestions.
   Caused by: org.apache.ibatis.executor.ExecutorException: Error preparing statement. Cause: java.lang.ClassCastException: org.apache.skywalking.apm.plugin.jdbc.trace.SWPreparedStatement cannot be cast to com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement
   at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:97)
   at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:59)
   at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:85)
   at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49)
   at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
   at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
   at sun.reflect.GeneratedMethodAccessor405.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:498)
   at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
   at com.sun.proxy.$Proxy320.update(Unknown Source)
   at sun.reflect.GeneratedMethodAccessor405.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:498)
   at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
   at com.sun.proxy.$Proxy320.update(Unknown Source)
   ... 290 more
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] zifeihan commented on issue #6080: mssql error

Posted by GitBox <gi...@apache.org>.
zifeihan commented on issue #6080:
URL: https://github.com/apache/skywalking/issues/6080#issuecomment-751310687


   Received, I will test and fix the bug as soon as possible.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] zifeihan commented on issue #6080: mssql error

Posted by GitBox <gi...@apache.org>.
zifeihan commented on issue #6080:
URL: https://github.com/apache/skywalking/issues/6080#issuecomment-751559894


   > @zifeihan Debug finds that it is affected by the dynamic data source, but SkyWalking happend an error that affects the rollback of the main process transaction
   
   Can you help us provide a simple demo to reproduce this bug? So that I can fix this problem as soon as possible.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on issue #6080: mssql error

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6080:
URL: https://github.com/apache/skywalking/issues/6080#issuecomment-751203745


   I am not familiar with the ibatis codes, why it is trying to casting?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] zifeihan commented on issue #6080: mssql error

Posted by GitBox <gi...@apache.org>.
zifeihan commented on issue #6080:
URL: https://github.com/apache/skywalking/issues/6080#issuecomment-754544389


   > CREATE TABLE [dbo].[DEMO] (
   > [Id] bigint NOT NULL IDENTITY(1,1) ,
   > [CODE] varchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
   > CONSTRAINT [PK__DEMO__3214EC27BF799427] PRIMARY KEY ([Id])
   > )
   > ON [PRIMARY]
   > GO
   > 
   > DBCC CHECKIDENT(N'[dbo].[DEMO]', RESEED, 8)
   > GO
   > 
   > package com.demo.microservice.test;
   > 
   > import java.sql.Connection;
   > import java.sql.DriverManager;
   > import java.sql.PreparedStatement;
   > import java.sql.Statement;
   > 
   > /**
   > 
   > * @auther: arronbin
   > * @Date: 2021/1/5
   > * @description:
   >   */
   >   public class MssqlTest {
   >   public static void main(String [] args)
   >   {
   >   Connection conn = null;
   >   PreparedStatement p = null;
   >   try {
   >   Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
   >   conn = DriverManager.getConnection(
   >   "jdbc:sqlserver://ip:1433;databasename=TestDB", "XX",
   >   "XX");
   >   p = conn.prepareStatement("insert into demo(code)values(?)",
   >   Statement.RETURN_GENERATED_KEYS);
   >   p.setString(1, "test");
   >   p.executeUpdate();
   >   }catch (Exception e){
   >   System.out.println(e.getMessage());
   >   }finally {
   >   try {
   >   p.close();
   >   conn.close();
   >   }catch (Exception e){
   >   ```
   >      }
   >   }
   >   ```
   >   
   >   
   >   }
   > 
   > }
   > 
   > Similar to #554
   > @zifeihan @wu-sheng
   
   @arronbin Thank you very much, I will fix it as soon as possible.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] arronbin commented on issue #6080: mssql error

Posted by GitBox <gi...@apache.org>.
arronbin commented on issue #6080:
URL: https://github.com/apache/skywalking/issues/6080#issuecomment-754430829


   CREATE TABLE [dbo].[DEMO] (
   [Id] bigint NOT NULL IDENTITY(1,1) ,
   [CODE] varchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
   CONSTRAINT [PK__DEMO__3214EC27BF799427] PRIMARY KEY ([Id])
   )
   ON [PRIMARY]
   GO
   
   DBCC CHECKIDENT(N'[dbo].[DEMO]', RESEED, 8)
   GO
   
   
   package com.homedo.microservice.test;
   
   import java.sql.Connection;
   import java.sql.DriverManager;
   import java.sql.PreparedStatement;
   import java.sql.Statement;
   
   /**
    * @Auther: arronbin
    * @Date: 2021/1/5
    * @Description:
    */
   public class MssqlTest {
   
   
       public static void main(String [] args)
       {
           Connection conn = null;
           PreparedStatement p = null;
          try {
              Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
              conn = DriverManager.getConnection(
                      "jdbc:sqlserver://172.16.220.115:1433;databasename=TestDB", "Test",
                      "HMDTest321");
               p = conn.prepareStatement("insert into demo(code)values(?)",
                              Statement.RETURN_GENERATED_KEYS);
              p.setString(1, "test");
              p.executeUpdate();
          }catch (Exception e){
              System.out.println(e.getMessage());
          }finally {
             try {
                 p.close();
                 conn.close();
             }catch (Exception e){
   
             }
          }
       }
   
   
   }
   
   
   Similar to https://github.com/apache/skywalking/issues/554
   @zifeihan @wu-sheng 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on issue #6080: mssql error

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6080:
URL: https://github.com/apache/skywalking/issues/6080#issuecomment-751203864


   Could you provide a demo app to reproduce the error?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] arronbin commented on issue #6080: mssql error

Posted by GitBox <gi...@apache.org>.
arronbin commented on issue #6080:
URL: https://github.com/apache/skywalking/issues/6080#issuecomment-751553162


   @zifeihan Debug finds that it is affected by the dynamic data source, but SkyWalking happend an error that affects the rollback of the main process transaction


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] arronbin edited a comment on issue #6080: mssql error

Posted by GitBox <gi...@apache.org>.
arronbin edited a comment on issue #6080:
URL: https://github.com/apache/skywalking/issues/6080#issuecomment-754430829


   CREATE TABLE [dbo].[DEMO] (
   [Id] bigint NOT NULL IDENTITY(1,1) ,
   [CODE] varchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
   CONSTRAINT [PK__DEMO__3214EC27BF799427] PRIMARY KEY ([Id])
   )
   ON [PRIMARY]
   GO
   
   DBCC CHECKIDENT(N'[dbo].[DEMO]', RESEED, 8)
   GO
   
   
   package com.homedo.microservice.test;
   
   import java.sql.Connection;
   import java.sql.DriverManager;
   import java.sql.PreparedStatement;
   import java.sql.Statement;
   
   /**
    * @Auther: arronbin
    * @Date: 2021/1/5
    * @Description:
    */
   public class MssqlTest {
   
   
       public static void main(String [] args)
       {
           Connection conn = null;
           PreparedStatement p = null;
          try {
              Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
              conn = DriverManager.getConnection(
                      "jdbc:sqlserver://ip:1433;databasename=TestDB", "XX",
                      "XX");
               p = conn.prepareStatement("insert into demo(code)values(?)",
                              Statement.RETURN_GENERATED_KEYS);
              p.setString(1, "test");
              p.executeUpdate();
          }catch (Exception e){
              System.out.println(e.getMessage());
          }finally {
             try {
                 p.close();
                 conn.close();
             }catch (Exception e){
   
             }
          }
       }
   
   
   }
   
   
   Similar to https://github.com/apache/skywalking/issues/554
   @zifeihan @wu-sheng 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng closed issue #6080: mssql error

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #6080:
URL: https://github.com/apache/skywalking/issues/6080


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] zifeihan commented on issue #6080: mssql error

Posted by GitBox <gi...@apache.org>.
zifeihan commented on issue #6080:
URL: https://github.com/apache/skywalking/issues/6080#issuecomment-751425770


   > Please answer these questions before submitting your issue.
   > 
   > * Why do you submit this issue?
   > * [ ]  Question or discussion
   > * [ ]  Bug
   > * [ ]  Requirement
   > * [ ]  Feature or performance improvement
   > 
   > ### Question
   > * What do you want to know?
   > 
   > ### Bug
   > * Which version of SkyWalking, OS, and JRE?
   > * Which company or project?
   > * What happened?
   >   If possible, provide a way to reproduce the error. e.g. demo application, component version.
   > 
   > ### Requirement or improvement
   > * Please describe your requirements or improvement suggestions.
   >   Caused by: org.apache.ibatis.executor.ExecutorException: Error preparing statement. Cause: java.lang.ClassCastException: org.apache.skywalking.apm.plugin.jdbc.trace.SWPreparedStatement cannot be cast to com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement
   >   at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:97)
   >   at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:59)
   >   at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:85)
   >   at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49)
   >   at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
   >   at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
   >   at sun.reflect.GeneratedMethodAccessor405.invoke(Unknown Source)
   >   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   >   at java.lang.reflect.Method.invoke(Method.java:498)
   >   at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
   >   at com.sun.proxy.$Proxy320.update(Unknown Source)
   >   at sun.reflect.GeneratedMethodAccessor405.invoke(Unknown Source)
   >   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   >   at java.lang.reflect.Method.invoke(Method.java:498)
   >   at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
   >   at com.sun.proxy.$Proxy320.update(Unknown Source)
   >   ... 290 more
   
   @arronbin Sorry, I did not reproduce this problem, Could you provide a demo app to reproduce the problem?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] arronbin edited a comment on issue #6080: mssql error

Posted by GitBox <gi...@apache.org>.
arronbin edited a comment on issue #6080:
URL: https://github.com/apache/skywalking/issues/6080#issuecomment-754430829


   CREATE TABLE [dbo].[DEMO] (
   [Id] bigint NOT NULL IDENTITY(1,1) ,
   [CODE] varchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
   CONSTRAINT [PK__DEMO__3214EC27BF799427] PRIMARY KEY ([Id])
   )
   ON [PRIMARY]
   GO
   
   DBCC CHECKIDENT(N'[dbo].[DEMO]', RESEED, 8)
   GO
   
   
   package com.demo.microservice.test;
   
   import java.sql.Connection;
   import java.sql.DriverManager;
   import java.sql.PreparedStatement;
   import java.sql.Statement;
   
   /**
    * @Auther: arronbin
    * @Date: 2021/1/5
    * @Description:
    */
   public class MssqlTest {
   
   
       public static void main(String [] args)
       {
           Connection conn = null;
           PreparedStatement p = null;
          try {
              Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
              conn = DriverManager.getConnection(
                      "jdbc:sqlserver://ip:1433;databasename=TestDB", "XX",
                      "XX");
               p = conn.prepareStatement("insert into demo(code)values(?)",
                              Statement.RETURN_GENERATED_KEYS);
              p.setString(1, "test");
              p.executeUpdate();
          }catch (Exception e){
              System.out.println(e.getMessage());
          }finally {
             try {
                 p.close();
                 conn.close();
             }catch (Exception e){
   
             }
          }
       }
   
   
   }
   
   
   Similar to https://github.com/apache/skywalking/issues/554
   @zifeihan @wu-sheng 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org