Category Archives: How to Fix

SQL Error: 1452, SQLState: 23000

There was a problem when I encountered the modulation code today, that is, After I deleted all the records of the database, I registered through the registration page of the front page.
But SQL Error: 1452, SQLState: 23000; Other errors are as follows:
[tomcat HTTP — – 5] WARN org. Hibernate. Engine. The JDBC. Spi. SqlExceptionHelper – SQL Error: 1452, SQLState: 23000
the 2017-03-31 12:27:35 [tomcat HTTP — – 5] WARN org. Hibernate. Engine. The JDBC. Spi. SqlExceptionHelper – SQL Error: 1452, SQLState: 23000
2017-03-31 12:27:35 [tomcat-http–5] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper – Cannot add or update a child row: a foreign key constraint fails (`chatwork`.`user_role`, CONSTRAINT `FK_02dcca8f72554a62bdec8067a49` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`))
2017-03-31 12:27:35 [tomcat-http–5] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper – Cannot add or update a child row: a foreign key constraint fails (`chatwork`.`user_role`, CONSTRAINT `FK_02dcca8f72554a62bdec8067a49` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`))
2017-03-31 12:27:35 [tomcat-http–5] ERROR org.hibernate.engine.jdbc.batch.internal.BatchingBatch – HHH000315: Exception executing batch [could not perform addBatch]
2017-03-31 12:27:35 [tomcat-http–5] ERROR org.hibernate.engine.jdbc.batch.internal.BatchingBatch – HHH000315: Exception executing batch [could not perform addBatch]
org.springframework.dao.DataIntegrityViolationException: could not perform addBatch; SQL [insert into user_role (nickName, role_id) values (?, ?)] ; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not perform addBatch
This error occurs because the foreign key is null, so an error is reported. Because it’s a test database, there’s nothing important in it so I just delete the database and restart the project and create the table.
 
 
Solution: first check the relationship of their own table, can be set in the background through the set method, or directly in the database to add this foreign key; One more thing is not to delete the library!!

It’s been pitiful by was. It’s reported in the following webapp.WebApp Logerror srve0293e: [servlet error] – [null] error.

The specific error information is as follows:
 
webapp E com.ibm.ws.webcontainer.webapp.WebApp logError SRVE0293E: [Servlet Error]-[null]: com.ibm.ws.webcontainer.webapp.WebAppErrorReport:
at com.ibm.ws.webcontainer.webapp.WebAppDispatcherContext.sendError(WebAppDispatcherContext.java:624)
at com.ibm.ws.webcontainer.srt.SRTServletResponse.sendError(SRTServletResponse.java:1071)
at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:770)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:505)
 
Who can see the meaning of this error message?I was screwed anyway, and I couldn’t find the answer on the Internet.
 
Now that I know why, let me summarize:
First, a key piece of information is WebApp, indicating that it is an error on the application side itself
Second, the error was not clearly reported, and debugging on websphere was very inconvenient (and time-consuming), and the error was located on the row by printing the log.
(Strangely enough, that line was reported incorrectly, but why wasn’t it caught by the outer try-catch?”And that line looks fine!)
 
How did the Throwable receive a Throwable?M: How did the Throwable receive a Throwable?How did the Throwable receive a Throwable?
That’s right, it turned out to be a Throwable type error because I changed the interface class instead of updating the class file, resulting in a Throwable type error!
 
This is a real bummer… Summary of experience:
1, Some places use Throwable to catch an error. (Depending on the case, is the interface referenced but can’t find the implementation class?)
2, log records should be comprehensive, easy to locate the problem. To avoid having to change the code every time, you can set up a more comprehensive log beforehand, turn it off when you go online, and turn it on when you debug (the switch is placed in the database).
 

mac Error: EACCES: permission denied, mkdir ‘./cache’

My system is MAC. I am typing the following command:

sudo npm install -g aglio

The following problems arise:

npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: Please update to at least constantinople 3.1.1
npm WARN deprecated [email protected]: Deprecated, use jstransformer
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/aglio -> /usr/local/lib/node_modules/aglio/bin/aglio.js

> [email protected] install /usr/local/lib/node_modules/aglio/node_modules/fsevents
> node install

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib'
gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/eric/.node-gyp/8.12.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/aglio/node_modules/fsevents/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/aglio/node_modules/fsevents/.node-gyp'
gyp ERR! System Darwin 18.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" "--module_name=fse" "--module_path=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64" "--napi_version=3" "--node_abi_napi=napi"
gyp ERR! cwd /usr/local/lib/node_modules/aglio/node_modules/fsevents
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/aglio/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:915:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Darwin 18.0.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/aglio/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/aglio/node_modules/fsevents
node-pre-gyp ERR! node -v v8.12.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)

> [email protected] install /usr/local/lib/node_modules/aglio/node_modules/protagonist
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/eric/.node-gyp/8.12.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/aglio/node_modules/protagonist/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/aglio/node_modules/protagonist/.node-gyp'
gyp ERR! System Darwin 18.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/aglio/node_modules/protagonist
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

> [email protected] postinstall /usr/local/lib/node_modules/aglio/node_modules/aglio-theme-olio
> node scripts/setup-cache.js

fs.js:885
  return binding.mkdir(pathModule._makeLong(path),
                 ^

Error: EACCES: permission denied, mkdir './cache'
    at Object.fs.mkdirSync (fs.js:885:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/aglio/node_modules/aglio-theme-olio/scripts/setup-cache.js:14:6)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/aglio/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/aglio/node_modules/protagonist):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/setup-cache.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/eric/.npm/_logs/2019-02-14T00_47_21_128Z-debug.log

According to the research, the correct approach should be:

 sudo npm install -g aglio --unsafe-perm=true --allow-root

And then it’s normal.
reference
[1].Error: EACCES: permission denied, mkdir ‘/root/.nvm/versions/node/……. https://www.jianshu.com/p/6c67a456654b

PHP Error

I encountered this error while using the thinPHP framework is_array function today. You cannot use the return value of a function as an argument

Baidu solution is thinkPHP bug, more reliable said that the PHP version of the problem, 5.4 not, 5.6 is OK, but I use the version of 5.6.

The solution, is_array,empty, is to pass as many variables as possible.

Fatal error C1010: unexpected end of file encountered while looking for precompiled header. Did you forget to add “ා include” StdAfx. H to the source

Fatal Error C1010: Unexpected end of file encountered while looking for precompiled headers. Did you forget to add “#include” stdafx.h “to the source?
Error analysis:
this error occurs because the compiler is looking for a precompiled indicator header (default #include “stdafx.h”) when the file does not end as expected. The header file “stdafx.h” with precompiled instructions was not found.
(because the project of every CPP file attributes the default is to use the precompiled header (/ YU), but add a third party documents not # include “stdafx. H” precompiled directives, so the compiler in the CPP file until the end did not find it)
my this problem occurred in, by means of adding files to add to existing within the MFC one big tuo. H and. CPP file. These.h and.cpp files belong to the standard C++ open source code category and have no deeper relationship with MFC.
Solution: a.

1) in the solution explorer, right-click on the corresponding. CPP file, click “properties”
2) on the left side in the configuration properties, PM on “C/C + +”, click “precompiled header”
3) changes on the right side of the first line of “create/use precompiled header,” option from the “use precompiled header (/ Yu)” to “do not use the precompiled header”
4) note:
2.
(not recommended)
1) in the solution, right click on the project, click on properties
2) in the configuration properties -> c/c++ -> Changing “use the precompiled header (/YU)” to “do not apply the precompiled header”
in the precompiled header will make every compilation process very slow
Refer to the blog: http://blog.csdn.net/zrm_1995/article/details/68490749?locationNum=2& fps=1

Event resolution of component {b3118b2-1f49-48e5-b6f5-bc21caec56fb}

2019/03/31
Component {b31118B2-1F49-48e5-b6f5-bc21CAec56fb} event Load configuration file notification failed, error code is See Tracelogging for error details.
component {b31118b2-1f49-48e5-b6f5-bc21caec56fb} event Unload configuration file notification failed, error code is See Tracelogging for error details.
event ID: 1534
 
Solutions:
Finally found a FIX for 1534 error !
1. Open Regedit and navigate to the following two keys (looking for ProfileNotification)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ profilenob1 HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\ProfileNotification
2. Under profilenokey if you have the TDL key (confirm TDL exists at the next level of ProfileNotification)
3. Export the TDL key at each location (Export TDL backup)
4. Delete the TDL key at each location (right-click TDL-> Permissions – & gt; Advanced – & gt; Owner change to your account confirmation -& GT; Secure add your account for full control confirmation. Reboot PC to verify (Reboot into effect)
Note:
You’ll need take ownership of the TDL Key to be able to delete it.
Works for me like a charm with no downsides.
After this fix the 1534 baragge has stopped in my OS 🙂
 
Refer to https://social.technet.microsoft.com/Forums/en-US/50a24520-2ea6-47e7-995b-c2de46d2401d/user-profile-service-event-1534?forum=win10itpronetworking

[MySQL] the solution of MySQL workbench “error code: 1175”

When performing a batch database update using MySQL Workbench, executing a statement will encounter the following error:
Error Code: 1175 You are using safe… without a WHERE that uses a KEY column
Because MySQL Workbench’s default security Settings do not allow batch table updates. This error is prompted when the SQL statement to be executed is batch update or delete.
The solution is as follows:
Open the Workbench menu [Edit]-> [Preferences…] -> Switch to the [SQL Queries] page -> Remove the [Safe Updates] check -> Click the [OK] button
Finally, just restart the SQL Editor and make a new connection.

Or before I make a query,
Execute the following statement:

SET SQL_SAFE_UPDATES = 0;

error MSB6006: cmd.exe “exited with code 3

Using VS2012 and QT5.5.1, the following error occurred when compiling the example:
C: \ Program Files \ MSBuild \ Microsoft (x86) Cpp \ v4.0 \ V110 \ Microsoft CppCommon. The targets (172, 5) : error MSB6006: “CMD. Exe” have quit, code is 3.
The picture is as follows:

The solution is as follows:

Right-click on the project and select Convert Project to Qt Add-in Project.

ArcGIS desktop experience. Similar to: error 000732 output Geodatabase

Until the release of ArcGIS Desktop 10 SP1
 
1: in the desktop ArcGIS9, inside the Geodatabase (PGDB, FGDB, ArcSDE GDB) create a Table (Table), if the Table name begin with GDB (GDB, gdb1, GDBSDF, gdb_3d, etc.) after creating all could not see the form, and in fact is the existence of this Table, if you create a Table with the same Table will be prompted to exist, can use PGDB open Access to view, create a class there is no problem. There is no problem with ArcGIS10.
Problem analysis: currently, just a guess, because ArcGIS9 GDB Schema are GDB_ table in the beginning, the Schema are invisible to users in ArcCatalog, speculation is likely the GDB to block out the beginning of the table, don’t show, but while streamlining the GDB with ArcGIS10 Schema, but there are still four tables, starting with the GDB ArcGIS10 create tables can be seen, a bit surprised, may ArcGIS10 write these four table table name directly in the dead into the program.
2: when using ArcGIS desktop import export data, because the default using ArcGIS to create objects and other elements of the system will create a ObjectID fields, is a unique identifier, some users will use this ObjectID, may record the corresponding ObjectID to correspond to the specified elements, but in the process of data import and export, especially the import, the user will be very depressed these ObjectID rearrangement, so users will not be able to come here to use the ObjectID, how should do?
The ObjectID is rearranged by the Import/Export tool. It is suggested that users use Copy/Paste directly to the data set or element class object. In this way, ObjectID is not rearranged.
3: In the process of data Import using ArcGIS desktop, take Import as an example, “Output Location” in the Import box prompts a small Red Cross, such path does not exist or error-000732 Error occurs?
Solution: the relative path “Database Connections/Connection to lish. Sde” is modified to the absolute path “C:/Users/gis/AppData/Roaming/ESRI Desktop10.0 ArcCatalog/Connection to lish. Sde”, because the problem some machines have similar problems, some machines have no, the reason is still unknown.
4: When SDE creates or imports data containing the field name “AREA”, the field name is automatically prefixed.
Question: This problem exists in ArcGIS9 software, but not in ArcGIS10, for unknown reasons!
5: When creating a LoadRaster dataset, if the whole Raster was loaded and the InputRaster prompted the Red Cross, the Raster object had to be double-clicked and opened into three bands to be loaded. How could the whole Raster object be loaded without being loaded in the form of bands?
Problem analysis: The default Rand Number selected by the user when creating a RasterDataset was “1”. Setting the Rand Number to “3” would solve the problem.
6: Users are using joins to mount tables (element classes versus normal tables), but sometimes a library cannot be mounted on a non-Windows operating system. What can be done?
Problem analysis: Because the Join is using Ole mechanism for articulated, but the Windows operating system default Ole drive, but not the Windows operating system, so the Windows operating system does not support Ole, which does not support the use of the Join, so users can completely change the way in which different using sde commands to complete (sdetable – o create_view), effect is the same, and taking advantage of sde command to create a view can be saved, read-only, This view can be treated as a read-only element class.
sdetable command reference: http://wenku.baidu.com/view/16c6362acfc789eb172dc8c2.html
7: Use ArcCatalog to export ArcSDE data to PGDB and import it in. Some field ranges change.
Problem analysis: Import field for text, for example, because PGDB is usually Access, the text field’s biggest support for Access to 255, more than the value into the remark field, so if a user ArcSDE text field length is 1000, then imported into the PGDB inside because of greater than 255 into the remark field, then pour into ArcSDE, note field does not record length, directly convert note length to CLOB (in Chinese version is more than 2000 of Oracle database with CLOB storage), so, If the user does not want to encounter this phenomenon during the data import and export, please replace the exported PGDB with FGDB.

8: when using ArcMap or ArcGIS Engine for simple operations such as map enlargement, the following phenomenon occurs: the map is blank, “gsrvr.exe” Error or “Network IO Error” Error is prompted?
Problem analysis: First, check whether the user’s database matches the version of your ArcSDE. This error is typical ArcGIS9.3/9.3.1 and Oracle10.2.0.1 (note the small version number of the database). It is suggested that the database should be Oracle10.2.0.3.
9: In the editing process of using ArcCatalog, when saving data, prompt: “Create: An unexpected failure in Dimension”, OrA-20092: Maximum number of Grids per feature(8000) excplug.Ora-06512: In “SDE_ST_DOMAIN_METHODS” line 1487 and so on.
Problem analysis: ArcGIS defaults that an object cannot exceed 8000 grids, which is a hard and fast rule, so it means that the grid setting of the layer edited by the user is too small or an object edited by the user is too large. Either the user deletes the index, rebuilds the index, or the user edits the grid value and replaces it with a larger grid value.
10: Null character missing at the end of the ArcMap import datagram ORA-01480 STR bound value.
Problem solving: if the user has this problem, the user’s machine configuration should be
operating system: Windows Server 2003/2008 Enterprise x64 SP2
Oracle version 10.2.0.4.0-64bit
ArcSDE version: ArcSDE 9.3.1 for oracle10g64
DeskTop version: 9.3.1
vector storage mode: ST_Geometry
this has no way, if the user’s configuration completely meets the above configuration, congratulations, you are so lucky, this is all encountered by you, as of press ArcGIS9.3.1 also did not solve the problem.
The user could either use a direct connection to derive the data, or use BLOB storage instead of ST_Geometry storage, and presumably more people would choose the first option.
11: ArcMap USES Identify figure to find both length and area are 0?
The user must be using SDO_Geometry geometry to store geometry data. The structure is not at all like the ST_Geometry structure where length and area can be recorded, so this is normal.