Category Archives: Error

How to Solve Error: Cannot find the declaration of element ‘beans’.

Question: org.xml.sax .SAXParseException: cvc-elt.1: Cannot find the declaration of element ‘beans’.

Solution: first, if the exception is encountered in the project, it is usually the problem that the project cannot download to the spring-beans-2.5.xsd file. The version number here varies with the project version.

Here you need to configure the local XSD file as follows:

Find the core package of spring referenced in your project, spring.jar

Open it with a compressed file and find the path

org/springframework/beans/factory/xml/

And configure the XSD file in this path to applicationContext.xml If there are more than one configuration file, all of them will be replaced

That is to say,
is the best choice

classpath:/org/springframework/beans/factory/xml/spring-beans-2.5.xsd

Instead of

http://www.springframework.org/schema/beans/spring-beans-2.5.xsd

Enables the configuration file to be read directly from the local

Reprint address: http://blog.csdn.net/wengang285/article/details/7587264

Method 2:

Modify spring applicationContext.xml Change the name space of the XML file to the following code:

<?xml version=”1.0″ encoding=”utf-8″?>
<!DOCTYPE beans PUBLIC “-//SPRING//DTD BEAN 2.0//EN” ” http://www.springframework.org/dtd/spring-beans-2.0.dtd “>
<beans>

Problem solving address: http://www.myexception.cn/vc-mfc/627052.html

 

The first method seems to have no effect, so I use the second method to solve the problem

Tensorflow C++:You must define TF_LIB_GTL_ALIGNED_CHAR_ARRAY for your compiler

When using the tensorflow C++ API, the error You must define TF_LIB_GTL_ALIGNED_CHAR_ARRAY for your compiler.
The reason is as follows (see reference).

 

If you omit the COMPILER_MSVC definition, you will run into an error saying “You must define TF_LIB_GTL_ALIGNED_CHAR_ARRAY for your compiler.” If you omit the NOMINMAX definition, you will run into a number of errors saying “’(‘: illegal token on right side of ‘::’”. (The reason for this is that <Windows.h> gets included somewhere, and Windows has macros that redefine min and max. These macros are disabled with NOMINMAX.)

Solution 1:
Add at the beginning of the code

#pragma once

#define COMPILER_MSVC
#define NOMINMAX

Solution 2:

Take vs2017 as an example: attribute Manager — > C/C + + –> preprocessor definition

Paste in the following

COMPILER_ MSVC
NOMINMAX

put things right once and for all!

ValueError: Input 0 of node import/save/Assign was passed float from import/beta1_power:0 incompatib

Exception encountered while importing optimized frozen graph.

# read pb into graph_def
with tf.gfile.GFile(pb_file, "rb") as f:
    graph_def = tf.GraphDef()
    graph_def.ParseFromString(f.read())

# import graph_def
with tf.Graph().as_default() as graph:
    tf.import_graph_def(graph_def)

Get exception in this line:

tf.import_ graph_ def(graph_ def)

ValueError: Input 0 of node import/save/Assign was passed float from import/beta1_ power:0 incompatible with expected float_ ref.

The solution: make sure your_ The file format is correct (similar to this), and try to_ graph_ Set some values in the ‘name’ parameter of def() to try to override the default value of ‘import’, as follows:

import tensorflow as tf

from tensorflow.python.platform import gfile
model_path="/tmp/frozen/dcgan.pb"

# read graph definition
f = gfile.FastGFile(model_path, "rb")
gd = graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())

# fix nodes
for node in graph_def.node:
    if node.op == 'RefSwitch':
        node.op = 'Switch'
        for index in xrange(len(node.input)):
            if 'moving_' in node.input[index]:
                node.input[index] = node.input[index] + '/read'
    elif node.op == 'AssignSub':
        node.op = 'Sub'
        if 'use_locking' in node.attr: del node.attr['use_locking']

# import graph into session
tf.import_graph_def(graph_def, name='')
tf.train.write_graph(graph_def, './', 'good_frozen.pb', as_text=False)
tf.train.write_graph(graph_def, './', 'good_frozen.pbtxt', as_text=True)

Solution: configuration of multiple front ends separated from front end and back end of nginx

1. Business scenarios

According to the business requirements, the front-end code needs to distinguish between the main business code and the sub business code.

2. Solutions

Routing is based on the root of the relative path.

3. Configuration file

  server {
        listen       9207;
        server_name  192.168.30.158;
        root /home/qdfinance/apps/pages/insure_wx/;

        #Front-end dependent business code pages are routed with relative paths to root/h5
        location /h5/ {
          root    /home/qdfinance/apps/pages/insure_wx_h5/;
          add_header Cache-Control "no-cache, no-store";
          rewrite ^/h5/(.*)$ /index.html  break;
        }
		#Reverse proxy tomcat service
        location/{
           proxy_set_header Host $host:$server_port;
           proxy_pass   http://192.168.80.192:8098/;
           root /home/qdfinance/apps/pages/insure_wx/;
           error_page 404 /index.html;
        }
		#Front-end main business code page
        location   =/{
          root /home/qdfinance/apps/pages/insure_wx/;
          add_header Cache-Control "no-cache, no-store";
        }
        location /index.html {
          root  /home/qdfinance/apps/pages/insure_wx/;
          add_header Cache-Control "no-cache, no-store";
        }
        location /statich5/ {
           root /home/qdfinance/apps/pages/insure_wx_h5/; 
        } 
  
        location /static/ {
          root  /home/qdfinance/apps/pages/insure_wx/;
        }
        location /detail/ {
          rewrite ^/(.*)$ /index.html last;
        }
		location /me {
          rewrite ^/(.*)$ /index.html last;
        }
        location /login/ {
          rewrite ^/(.*)$ /index.html last;
        }
        location /customer {
          rewrite ^/(.*)$ /index.html last;
        }
        location /customer-add {
          rewrite ^/(.*)$ /index.html last;
        }
        location /subscribe {
          rewrite ^/(.*)$ /index.html last;
        }
        location /order {
          rewrite ^/(.*)$ /index.html last;
        }
        location /order-detail {
          rewrite ^/(.*)$ /index.html last;
        }
        location /main {
          rewrite ^/(.*)$ /index.html last;
        }
        location /auth {
          rewrite ^/(.*)$ /index.html last;
        }
        location /policy {
          rewrite ^/(.*)$ /index.html last;
        }
        location /intellect {
          rewrite ^/(.*)$ /index.html last;
        }
		location /intellectanswerlist {
          rewrite ^/(.*)$ /index.html last;
        }
		location /immed {
          rewrite ^/(.*)$ /index.html last;
        }
        location /docking {
          rewrite ^/(.*)$ /index.html last;
        }
		location /success {

          rewrite ^/(.*)$ /index.html last;
        }
		location /error {
          rewrite ^/(.*)$ /index.html last;
        }
    }

How to Solve Gradle Error: Plugin with id ‘jetty’ not found.

In a web project, jetty is used. When building the project with gradle, I found the prompt Plugin with id’jetty’ not found. That is, the plug-in could not be found.

The Groovy code is as follows:

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'jetty'
 
repositories {
	mavenCentral()
}
 
dependencies {
	providedCompile 'javax.servlet:servlet-api:2.5',
					'javax.servlet.jsp:jsp-api:2.1'
	runtime 'javax.servlet:jstl:1.1.2',
			'taglibs:standard:1.1.2'
}

The prompt is as follows

FAILURE: Build failed with an exception.

* Where:
Build file ‘H:\gradleCode\test\build.gradle’ line: 3

* What went wrong:
A problem occurred evaluating root project ‘test’.
> Plugin with id ‘jetty’ not found.

* Try:
Run with –stacktrace option to get the stack trace. Run with –info or –debug option
to get more log output. Run with –scan to get full insights.

* Get more help at https://help.gradle.org

I went to the official website and found a post https://discuss.gradle.org/t/gradle2-still-cant-specify-jetty-version/5069

It is said that jetty cannot specify a specific version in Gradle 1.x, but my hint is that this plug-in is not found at all, I am very confused. . . .

Someone in the post said that I recommend a third-party library gretty. I tried it and it succeeded.

If you are using Gradle version 2.1 or higher, just these few lines of code will do.

plugins {
  id "org.akhikhl.gretty" version "2.0.0"
}

Otherwise, write a few more lines:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.org.akhikhl.gretty:gretty:2.0.0"
  }
}
 
apply plugin: "org.akhikhl.gretty"

This is my build.gradle:

apply plugin: 'java'
apply plugin: 'war'
buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.org.akhikhl.gretty:gretty:2.0.0"
  }
}
 
apply plugin: "org.akhikhl.gretty"
repositories {
	jcenter()
}
 
dependencies {
	providedCompile 'javax.servlet:servlet-api:2.5',
					'javax.servlet.jsp:jsp-api:2.1'
	runtime 'javax.servlet:jstl:1.1.2',
			'taglibs:standard:1.1.2'
}

The results of the operation are as follows:

gradle build

 

Download https://plugins.gradle.org/m2/gradle/plugin/org/akhikhl/gretty/gretty/2.0.0/gr
etty-2.0.0.pom
Download https://plugins.gradle.org/m2/org/akhikhl/gretty/gretty-core/2.0.0/gretty-core
-2.0.0.pom
Download https://plugins.gradle.org/m2/org/eclipse/jetty/jetty-util/8.1.8.v20121106/jet
ty-util-8.1.8.v20121106.pom
Download https://plugins.gradle.org/m2/org/eclipse/jetty/jetty-project/8.1.8.v20121106/
jetty-project-8.1.8.v20121106.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-loader-tool
s/1.5.4.RELEASE/spring-boot-loader-tools-1.5.4.RELEASE.pom
Download https://plugins.gradle.org/m2/org/eclipse/jetty/jetty-parent/20/jetty-parent-2
0.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-tools/1.5.4
.RELEASE/spring-boot-tools-1.5.4.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-parent/1.5.
4.RELEASE/spring-boot-parent-1.5.4.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-dependencie
s/1.5.4.RELEASE/spring-boot-dependencies-1.5.4.RELEASE.pom
Download https://plugins.gradle.org/m2/com/fasterxml/jackson/jackson-bom/2.8.8/jackson-
bom-2.8.8.pom
Download https://plugins.gradle.org/m2/com/fasterxml/jackson/jackson-parent/2.8/jackson
-parent-2.8.pom
Download https://plugins.gradle.org/m2/com/fasterxml/oss-parent/27/oss-parent-27.pom
Download https://plugins.gradle.org/m2/org/apache/logging/log4j/log4j-bom/2.7/log4j-bom
-2.7.pom
Download https://plugins.gradle.org/m2/org/springframework/spring-framework-bom/4.3.9.R
ELEASE/spring-framework-bom-4.3.9.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/data/spring-data-releasetrai
n/Ingalls-SR4/spring-data-releasetrain-Ingalls-SR4.pom
Download https://plugins.gradle.org/m2/org/springframework/data/build/spring-data-build
/1.9.4.RELEASE/spring-data-build-1.9.4.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/integration/spring-integrati
on-bom/4.3.10.RELEASE/spring-integration-bom-4.3.10.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/security/spring-security-bom
/4.2.3.RELEASE/spring-security-bom-4.2.3.RELEASE.pom
Download https://plugins.gradle.org/m2/org/codehaus/groovy/groovy/2.4.11/groovy-2.4.11.
pom
Download https://plugins.gradle.org/m2/org/codehaus/groovy/groovy-json/2.4.11/groovy-js
on-2.4.11.pom
Download https://plugins.gradle.org/m2/commons-cli/commons-cli/1.2/commons-cli-1.2.pom
Download https://plugins.gradle.org/m2/commons-configuration/commons-configuration/1.10
/commons-configuration-1.10.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/11/commons-par
ent-11.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-lang3/3.3.2/commons-l
ang3-3.3.2.pom
Download https://plugins.gradle.org/m2/org/apache/servicemix/bundles/org.apache.service
mix.bundles.bcprov-jdk16/1.46_3/org.apache.servicemix.bundles.bcprov-jdk16-1.46_3.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/32/commons-par
ent-32.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/33/commons-par
ent-33.pom
Download https://plugins.gradle.org/m2/org/apache/servicemix/bundles/bundles-pom/8/bund
les-pom-8.pom
Download https://plugins.gradle.org/m2/org/apache/apache/13/apache-13.pom
Download https://plugins.gradle.org/m2/org/apache/servicemix/servicemix-pom/5/servicemi
x-pom-5.pom
Download https://plugins.gradle.org/m2/org/apache/apache/4/apache-4.pom
Download https://plugins.gradle.org/m2/commons-io/commons-io/2.4/commons-io-2.4.pom
Download https://plugins.gradle.org/m2/org/apache/apache/7/apache-7.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-devtools/1.
3.3.RELEASE/spring-boot-devtools-1.3.3.RELEASE.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/25/commons-par
ent-25.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-parent/1.3.
3.RELEASE/spring-boot-parent-1.3.3.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-dependencie
s/1.3.3.RELEASE/spring-boot-dependencies-1.3.3.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/spring-framework-bom/4.2.5.R
ELEASE/spring-framework-bom-4.2.5.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/data/spring-data-releasetrai
n/Gosling-SR4/spring-data-releasetrain-Gosling-SR4.pom
Download https://plugins.gradle.org/m2/org/springframework/data/build/spring-data-build
/1.7.4.RELEASE/spring-data-build-1.7.4.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/integration/spring-integrati
on-bom/4.2.5.RELEASE/spring-integration-bom-4.2.5.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/security/spring-security-bom
/4.0.3.RELEASE/spring-security-bom-4.0.3.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/spring-core/4.3.9.RELEASE/sp
ring-core-4.3.9.RELEASE.pom
Download https://plugins.gradle.org/m2/commons-lang/commons-lang/2.6/commons-lang-2.6.p
om
Download https://plugins.gradle.org/m2/commons-logging/commons-logging/1.1.1/commons-lo
gging-1.1.1.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/17/commons-par
ent-17.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/5/commons-pare
nt-5.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-autoconfigu
re/1.3.3.RELEASE/spring-boot-autoconfigure-1.3.3.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot/1.3.3.RELEA
SE/spring-boot-1.3.3.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/spring-context/4.2.5.RELEASE
/spring-context-4.2.5.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/spring-expression/4.2.5.RELE
ASE/spring-expression-4.2.5.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/spring-aop/4.2.5.RELEASE/spr
ing-aop-4.2.5.RELEASE.pom
Download https://plugins.gradle.org/m2/org/springframework/spring-beans/4.2.5.RELEASE/s
pring-beans-4.2.5.RELEASE.pom
Download https://plugins.gradle.org/m2/aopalliance/aopalliance/1.0/aopalliance-1.0.pom
Download https://plugins.gradle.org/m2/commons-logging/commons-logging/1.2/commons-logg
ing-1.2.pom
Download https://plugins.gradle.org/m2/org/apache/commons/commons-parent/34/commons-par
ent-34.pom
Download https://plugins.gradle.org/m2/gradle/plugin/org/akhikhl/gretty/gretty/2.0.0/gr
etty-2.0.0.jar
Download https://plugins.gradle.org/m2/org/akhikhl/gretty/gretty-core/2.0.0/gretty-core
-2.0.0.jar
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-loader-tool
s/1.5.4.RELEASE/spring-boot-loader-tools-1.5.4.RELEASE.jar
Download https://plugins.gradle.org/m2/org/eclipse/jetty/jetty-util/8.1.8.v20121106/jet
ty-util-8.1.8.v20121106.jar
Download https://plugins.gradle.org/m2/org/codehaus/groovy/groovy/2.4.11/groovy-2.4.11.
jar
Download https://plugins.gradle.org/m2/commons-cli/commons-cli/1.2/commons-cli-1.2.jar
Download https://plugins.gradle.org/m2/commons-configuration/commons-configuration/1.10
/commons-configuration-1.10.jar
Download https://plugins.gradle.org/m2/commons-io/commons-io/2.4/commons-io-2.4.jar
Download https://plugins.gradle.org/m2/org/apache/commons/commons-lang3/3.3.2/commons-l
ang3-3.3.2.jar
Download https://plugins.gradle.org/m2/org/apache/servicemix/bundles/org.apache.service
mix.bundles.bcprov-jdk16/1.46_3/org.apache.servicemix.bundles.bcprov-jdk16-1.46_3.jar
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-autoconfigu
re/1.3.3.RELEASE/spring-boot-autoconfigure-1.3.3.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-devtools/1.
3.3.RELEASE/spring-boot-devtools-1.3.3.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/spring-context/4.2.5.RELEASE
/spring-context-4.2.5.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/boot/spring-boot/1.3.3.RELEA
SE/spring-boot-1.3.3.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/spring-aop/4.2.5.RELEASE/spr
ing-aop-4.2.5.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/spring-beans/4.2.5.RELEASE/s
pring-beans-4.2.5.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/spring-expression/4.2.5.RELE
ASE/spring-expression-4.2.5.RELEASE.jar
Download https://plugins.gradle.org/m2/org/springframework/spring-core/4.3.9.RELEASE/sp
ring-core-4.3.9.RELEASE.jar
Download https://plugins.gradle.org/m2/commons-logging/commons-logging/1.2/commons-logg
ing-1.2.jar
Download https://plugins.gradle.org/m2/commons-lang/commons-lang/2.6/commons-lang-2.6.j
ar
Download https://plugins.gradle.org/m2/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
Download https://plugins.gradle.org/m2/org/codehaus/groovy/groovy-json/2.4.11/groovy-js
on-2.4.11.jar
Download https://jcenter.bintray.com/javax/websocket/javax.websocket-api/1.0/javax.webs
ocket-api-1.0.pom
Download https://jcenter.bintray.com/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.pom
Download https://jcenter.bintray.com/javax/servlet/servlet-api/2.5/servlet-api-2.5.pom
Download https://jcenter.bintray.com/javax/servlet/javax.servlet-api/3.1.0/javax.servle
t-api-3.1.0.pom
Download https://jcenter.bintray.com/javax/websocket/javax.websocket-all/1.0/javax.webs
ocket-all-1.0.pom
Download https://jcenter.bintray.com/net/java/jvnet-parent/3/jvnet-parent-3.pom
Download https://jcenter.bintray.com/net/java/jvnet-parent/4/jvnet-parent-4.pom
Download https://jcenter.bintray.com/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar
Download https://jcenter.bintray.com/javax/websocket/javax.websocket-api/1.0/javax.webs
ocket-api-1.0.jar
Download https://jcenter.bintray.com/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.jar
Download https://jcenter.bintray.com/javax/servlet/javax.servlet-api/3.1.0/javax.servle
t-api-3.1.0.jar
Download https://jcenter.bintray.com/javax/servlet/jstl/1.1.2/jstl-1.1.2.pom
Download https://jcenter.bintray.com/taglibs/standard/1.1.2/standard-1.1.2.pom
Download https://jcenter.bintray.com/javax/servlet/jstl/1.1.2/jstl-1.1.2.jar
Download https://jcenter.bintray.com/taglibs/standard/1.1.2/standard-1.1.2.jar
BUILD SUCCESSFUL in 1m 5s
2 actionable tasks: 2 executed

How to Solve Error:options.query cannot be used with loaders

Original code:

 test: /(\.jsx|\.js)$/,

 loaders:["babel-loader","eslint-loader"] ,

 options:{
     cacheDirectory:true
 },
 exclude: /node_modules/,

Error: error:options.query cannot be used with loaders
as follows:

Write picture description here

solve:

 test: /(\.jsx|\.js)$/,
 use:[
      {loader:"eslint-loader"},
      {
          loader:"babel-loader",
          options:{//options、queryCannot be used with loader arrays
              cacheDirectory:true//Use cache to improve performance and babel is slow
          },
      }
  ],
  exclude: /node_modules/,

Abnormal [System.InvalidOperationException: custom type mapping for ‘xxx’ is not specified or is not a solution

In the use of C # code to get data from Oracle database, but because it is an object-oriented way, the model object in C # is also established in Oracle, and the corresponding mapping should be done in the Oracle connection code of C #.

When running, this exception is thrown:

ex=System.InvalidOperationException: Custom type mapping not specified with 'dataSource='xxxxxxx' schemaName='xxx' typeName='xxx' or the mapping is invalid
   at Oracle.DataAccess.Types.OracleUdt.GetFactory(OracleUdtDescriptor udtDesc)
   at Oracle.DataAccess.Client.OracleParameter.SetUDTFromArray(OracleConnection conn, Object array, Int32 i)
   at Oracle.DataAccess.Client.OracleParameter.PreBind_Collection(OracleConnection conn)
   at Oracle.DataAccess.Client.OracleParameter.PreBind(OracleConnection conn, IntPtr errCtx, Int32 arraySize)
   at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
   at Oracle.DataAccess.Client.OracleDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
   at HCC.Base.Comm.Dao.OraHelper.ExecuteDataTableSp(String dbkey, String procName, List`1 prams) 

Through various searches, it is found that the source of the problem lies in accidentally writing the udttypename wrong in the mapping code, which leads to this exception. Correct the spelling of udttypename to make the code work properly.

 

[Solved] ORA-21525: attribute number or (collection element at index) string violated its constraints

Exception: 

ORA-21525: attribute number or (collection element at index) string violated its constraints

Cause: Attribute value or collection element value violated its constraint.

Action: Change the value of the attribute or collection element such that it meets its constraints. The constraints are specified as part of the attribute or collection element’s schema information.

 

Error reason:

When passing data to stored procedures in C #, the user-defined object of Oracle is used. However, when passing in, some obj fields will throw this exception if the length of the value finally passed in is greater than that of the type definition. For example, this time type number (3) was passed in 1100

 

as like as two peas, it will probably have other problems, and it will also throw out this exception, which is not exactly the same as this encounter, but as a reference for solving problems.

[Solved] The type or namespace name ‘Service’ does not exist Error

The reason for this exception may be that the corresponding assembly is not introduced into the project. Generally speaking, the problem is solved after the required assembly is introduced. Sometimes there is a strange problem. For example, project B is a class library. Project a refers to the class of project B, such as userservice. Project B is also introduced into the reference of project A. However, when compiling in project a, an error is reported, saying that the type or namespace name ‘userservice’ does not exist in the namespace ‘xxx’ (are you missing an assembly reference?)

Now, for example, is there anything related to warning

The referenced assembly ” XXX.Service.dll ” could not be resolved because it has a dependency on ” System.ServiceModel.Web , Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ which is not in the currently targeted framework “.NETFramework,Version=v4.0, Profile=Client”. Please remove references to assemblies not in the targeted framework or consider retargeting your project.

That is to say, because the Framework version used by project a and project B is different, the class of a cannot be used in project B. At this point, as long as the Framework version of the project is reset to make the two projects consistent, the problem is solved.

The execution of ExecuteNonQuery by oraclecommand is suspended

string sql = "INSERT INTO TempTable (A, B, C) VALUES ('2222222', '1111111', 'RRR')";
OracleCommand cmd = new OracleCommand(sql, connection);
cmd.ExecuteNonQuery();

 

When executing this code, the first insertion failed. When stop debug restarts, it is found that the program runs to cmd.ExecuteNonQuery It’s stuck when I’m in. The reason for this is Oracle’s block mechanism.

If session “A” inserts a row in a table with a primary key, session “A” will block ANY other session attempting to insert the same primary key until session “A” commits or rolls back the insert. All other attempts to insert will “hang”.

At this point, I change the primary key 2222222 of SQL statement into 33333333 in the code, and then I can insert it smoothly. This indicates that this operation will be blocked only when the primary key is the same. Because when 2222222 was inserted, the program ended unexpectedly, but the Oracle transaction was not committed or rolled back, so this primary key was locked. Note that it’s just the primary key of this value.

there is another problem here, that is, when I open SQL developer and execute the primary key statement of 2222222, the execution will be completed smoothly without blocking. Now, when I execute SQL statements with code, the blocking phenomenon will still occur. But when I restart vs, create a new project and write these codes, it is also equivalent to another program to execute the insert statement, which will also get stuck. May be related to the. Net provider used?Because you are using the same provider, it is stuck. Because SQL developer doesn’t use this provider, it won’t get stuck?It’s just a guess.

This kind of lock is called tmlock, or row transaction lock. You can use SQL statements to check whether there is such a lock
or not

SELECT sid, id1 FROM v$lock WHERE TYPE=’TM’

SID ID1
76 14197

SELECT * FROM dba_ objects WHERE object_ id = 14197;

OBJECT_ NAME
——————————————————————————————————————————–
TemTable

 

How to release this TM lock?row transaction lock

Just execute a commit command in the SQL developer UI.