tomcat server sql exception - kotlin

I have an app that runs the Tomcat server. I use IntelliJ on my machine and run it from there when I do tests.
Running it many times, all works, and suddenly server do not go up well, and I see the following in log:
com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1: BasicResourcePool$AcquireTask: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask#1ab64513 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: Unexpected exception encountered during query.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2664)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1557)
at com.mysql.jdbc.ConnectionImpl.loadServerVariables(ConnectionImpl.java:3868)
at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3407)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2384)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2153)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.GeneratedConstructorAccessor38.newInstance(Unknown Source)
I have no clue what happened since I did not change anything related to JDBC or SQL. I tried to replace kotlin version (upgrade) and returned right away, but I don't know if it has anything to do with the exception, and how can I solve it.
checking the connection to the database from IntelliJ DB pane - connected successfully.
I will be thankful if someone has a clue what could go wrong.

Related

SCCM - Task sequence with application failure

I have been having some issues lately when including applications in task sequences. When running any task sequence that contains applications, it automatically fails, and says "The referenced package cannot be found." I've checked my distribution points and boundary groups, and verified the application content is distributed. When checking the logs, it just states it failed to find an application, I track down the application it's referencing, and redistribute, or even remove it from the task sequence, and try running it again, I get the same error, except for the next application content ID's. When adding packages to a task sequence, it seems to run successfully. Has anyone else encountered this?
EDIT: I've also been seeing 'content hash value mismatch' errors in the logs.
Any help is greatly appreciated. Some extra info:
I have already restored the site server VM, rebuilt the distribution point.
Failed to find CCM_ApplicationCIAssignment object for AdvertID="***2017A", ModelName="ScopeId_E6E2F6FB-692F-4938-8AC6-146644EAE93F/Application_ce95b2ac-bf5a-4de2-b930-6f9b74b7dfd0"
"Failed to resolve selected task sequence dependencies. Code(0x80040104)"

Talend tCreateTable error: NullPointerException

Trying to create a table in a local instance of SQL Server Mgmt Studio using Talend with the ultimate goal of setting up a direct Salesforce-SSMS connection for ETL.
I've managed to load the data from SFDC into SSMS, but only by first manually creating the tables, manually mapping the schema in a tMap, and then running my job.
I'd like to now create the tables in SSMS with a tCreateTable component, and then use the AutoMap feature to map fields.
However, I'm getting a Null Pointer Exception error that makes no sense to me. Debugging line 370 shows that my dbSchema_tCreateTable_1 object is null, but I don't understand why. I've defined it from repository. Below are some pics of my setup:
Sample Schema
Error Message and Job Design
Line 370 and suspect in Red
I know my db connection is good because I've already pushed data to existing tables, but for the life of me (and 2 of my java engineers) I can't figure this out. I've got 5 days of experience with Talend so apologies if I'm making a dumb mistake. Any help would be appreciated!
edit: Component view of tCreateTable
edit 2: Component view of tFixedFlowInput
edit 3: Component view of tMSSqlOutput
edit 4: tMSSqlConnection
On first job (provided on Error Message and Job Design) NPE occur because of connection still not created (is null) when tCreateTable tried to call null.executeStatement()
You can modify your first job put tMsSQLConnection -> OnSubjobOK -> tCreateTable
OR remove connection element at all and set connection parameters to tCreateTable.
If it doesn't help, answer please on following questions:
Share please exception stacktrace and error message occurs when you use second job (connection -> tFixedFlowInput - tMSSQLOutput)
What version of studio (Open Studio or enterprise and version) have you used?
If it is not the latest (6.5.1) could you upgrade it?
If it is, could you export your job and share it? (i.e. on talend bug tracker)
P.S. You can try to debug job by yourself, select Run Job -> Debug Run -> Java Debug
Using eclipse debug view you can find out why the NPE occur.

Error importing a static pool workstation

I'm re-importing my workstations but the static pool workstation: give me back the following error:
AWSJCS011E An internal error has occurred. The error is the following: "AWKRAE015E A requested resource is unknown. The following error was returned:"AWKRRP018E Unable to find source or target resources for the creation or update of a relationship
does anyone know what that means?
That message means a problem occurred while looking for a workstation into the system. In your scenario, you should make sure that all the agents beloging to the pool are up and running and correctly linked.
In addition to that, for every agent, you should also check the AgentID matches with the one you can find in the respective JobManager.ini file.
I hope this can help!

SQLCODE=-514 SQLSTATE=26501 occurred when I fnished the rebind operator

I want to make sure the new procedure valid, insteading of the DB2 always query by the cache pool, I have to rebind the database (db2rbind command). And then I deploy the application on WebSphere. BUT, when I login to the application, the error occurs:
The cursor "SQL_CURSN200C4" is not in a prepared state..SQLCODE=-514 SQLSTATE=26501,DRIVER=3.65.97
further more, the most weird thing is that the error just occurred only once. It will not never occur after this time, and the application runs very well. I'm so curious about how it occurs and the reason why it only occurs only once.
ps: my DB2 version is 10.1 Enterprise Server Edition.
and the sql which the error stack point to is very simple just like:
select * from table where 1=1 and field_name="123" with ur
Unless you configure otherwise (statementCacheSize=0) or manually use setPoolable(false) in your application, WebSphere Application Server data sources cache and reuse PreparedStatements. A rebind can cause statements in the cache to become invalid. Fortunately, WebSphere Application Server has built-in knowledge of the -514 error code and will purge the bad statement from the cache in response to an occurrence of this error, so that the invalidated prepared statement does not continue to be reused and cause additional errors to the application. You might be running into this situation, which could explain how the error occurs just once after the rebind.

SSMS 2012 System.OutOfMemoryException (client side) and SQL Prompt (debug info incl)

Some background: I've been encountering this memory exception within SSMS 2012 since it was released coupled with Red Gate's SQLPrompt (this exception never happens in my SSMS 2008R2 on the same laptop).
I was originally encountering these exceptions daily (SSMS2012 and SQLPrompt) which forces me to close and reopen SSMS (along with everything I was working on). Months ago I stumbled upon a support thread that pointed possible add-on's as being the cause so I uninstalled my only add-on (SQL Prompt, but did not uninstall the rest of the developer's bundle) and went many months without a single exception much less the System.OutOfMemoryException exception.
Once SP1 was released for 2012 I applied it and reinstalled SQL Prompt again (the latest version) to see if maybe the issue had been addressed and within 7 hours of development time I was greeted again with the infamous System.OutOfMemoryException.
Through out all of this I've been opening tickets with Red Gate and submitting debug logs where they see the exception but since the memory exception doesn't explicitly list SQLPrompt they won't escalate the issue to the development team. Prior to this specific exception SQL Prompt however is throwing numerous exceptions (some listed below) within the SSMS 2012 IDE (Visual Studio 2010). I believe that the memory exception is symptomatic of an issue with how SQL Prompt manages cached data and eats up the available memory for SSMS which eventually throws an exception as a result.
I've learn how to defer this issue and how to reproduce it and it is directly related to two variables:
Connecting and working on multiple instances in SSMS (Object Explorer and Query windows). I.e. Connected to 7 instances netted the exception within 2-3 hours.
Returning result sets from multiple instances. This includes queries used by SSMS to return information to the IDE and results returned to the individual query windows.
The more instances I'm connected to the fast the exception is raised which leads me SQL Prompt's caching all of the object information per instances. Once the memory exception is raised the situation degrades until SSMS crashes completely (unless I close it first).
What I am after is how to collect more/better information to submit to Red Gate to correct this issue. This is where I need your help.
Laptop: HP Elite book 8440
RAM: 6GB
Current OS:
Win 7 Enterprise Ed Sp1
Here are some of exceptions caused by SQL Prompt:
System.ArgumentOutOfRangeException "Specified argument was out of the range of valid values."
Microsoft.VisualStudio.Text.Implementation.BinaryStringRebuilder.GetLineNumberFromPosition(N/A,N/A)
Microsoft.VisualStudio.Text.Implementation.TextSnapshot.GetLineFromPosition(Microsoft.VisualStudio.Text.Implementation.TextSnapshot,N/A)
Microsoft.VisualStudio.Editor.Implementation.VsTextBufferAdapter.GetLineIndexOfPosition(N/A,System.Int32,System.Int32&,System.Int32&)
RedGate.SQLPrompt.CommonVS.Editor.VSScriptProvider.PositionFromIndex(RedGate.SQLPrompt.CommonVS.Editor.VSScriptProvider,System.Int32)
RedGate.SqlPrompt.Metadata.Script.ScriptProviderBase.GetText(RedGate.SQLPrompt.CommonVS.Editor.VSScriptProvider,System.Int32,System.Int32)
RedGate.SqlPrompt.Engine.NewEngine.SqlPromptEngine.GetCandidates(RedGate.SqlPrompt.Engine.NewEngine.SqlPromptEngine,System.Int32)
RedGate.SqlPrompt.Engine.PromptEngineEmulator.get_GetSuggestions(RedGate.SqlPrompt.Engine.PromptEngineEmulator)
RedGate.SqlPrompt.Engine.AutoCompleter.m_FilterChanged(RedGate.SqlPrompt.Engine.AutoCompleter,RedGate.SqlPrompt.Engine.PromptEngineEmulator,System.EventArgs)
RedGate.SqlPrompt.Engine.PromptEngineEmulator.OnFilterChanged(RedGate.SqlPrompt.Engine.PromptEngineEmulator)
RedGate.SqlPrompt.Engine.PromptEngineEmulator.set_Index(RedGate.SqlPrompt.Engine.PromptEngineEmulator,System.Int32)
RedGate.SqlPrompt.Engine.PromptEngineEmulator.set_CaretPosition(RedGate.SqlPrompt.Engine.PromptEngineEmulator,N/A)
RedGate.SQLPrompt.CommonUI.Editor.EditorWindowBase.SetEngineCaretPosition(RedGate.SQLPrompt.SSMSUI.SSMSEditorWindow,N/A)
RedGate.SQLPrompt.CommonUI.Editor.EditorWindowBase.UpdateUIPrompts(RedGate.SQLPrompt.SSMSUI.SSMSEditorWindow)
RedGate.SQLPrompt.CommonVS.Editor.VSEditorWindow.OnTextViewCommandExec(RedGate.SQLPrompt.SSMSUI.SSMSEditorWindow,RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor,RedGate.SQLPrompt.CommonVS.Editor.CommandExecEventArgs)
RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor.AfterCommandExecute(RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor,RedGate.SQLPrompt.CommonVS.Editor.CommandExecEventArgs)
RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor..(RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor.)
RedGate.SQLPrompt.CommonUI.Utils.ErrorDialog.Do(System.Action)
RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor.(RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor,System.Guid&,System.Uint32,System.Uint32,System.IntPtr,System.IntPtr)
RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor..(RedGate.SQLPrompt.CommonVS.Editor.TextViewMonitor.,System.Guid&,System.Uint32,System.Uint32,System.IntPtr,System.IntPtr)
Microsoft.VisualStudio.Editor.Implementation.CommandChainNode.Exec(N/A,N/A,N/A,N/A,N/A,N/A)
System.ArgumentException 00:05:14.7510000 "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
#mMc.#JQub.#OQub(#mMc.#JQub,N/A,System.Uint32,#mMc.#k3ub&)
#mMc.#JQub.#z26.#8Di(#mMc.#JQub.#z26)
RedGate.SQLSourceControl.Engine.SmartAssembly.ExceptionReporting.ErrorReporterBase.Do(RedGate.SQLSourceControl.CommonUI.Forms.ErrorDialog,System.Action,System.Predicate`1<System.Exception>,System.Boolean)
RedGate.SQLSourceControl.Engine.SmartAssembly.ExceptionReporting.ErrorReporterBase.Do(RedGate.SQLSourceControl.CommonUI.Forms.ErrorDialog,System.Action)
RedGate.SQLSourceControl.CommonUI.Forms.ErrorDialog.Do(System.Action)
And here is the Memory Exception:
System.OutOfMemoryException <null>
System.Text.StringBuilder.set_Capacity(System.Text.StringBuilder,N/A)
Microsoft.SqlServer.Management.QueryExecution.QEDiskStorageView.set_MaxNumBytesToDisplay(N/A,N/A)
Microsoft.SqlServer.Management.QueryExecution.QEDiskDataStorage.GetStorageView(N/A)
Microsoft.SqlServer.Management.QueryExecution.QEResultSet.StartRetrievingData(Microsoft.SqlServer.Management.QueryExecution.QEResultSet,System.Int32,N/A)
Microsoft.SqlServer.Management.QueryExecution.ResultSetAndGridContainer.StartRetrievingData(N/A,N/A,N/A)
Microsoft.SqlServer.Management.QueryExecution.ResultsToGridBatchConsumer.OnNewResultSet(Microsoft.SqlServer.Management.QueryExecution.ResultsToGridBatchConsumer,N/A,N/A)
Microsoft.SqlServer.Management.QueryExecution.QESQLBatch.ProcessResultSet(Microsoft.SqlServer.Management.QueryExecution.QESQLBatch,N/A)
Microsoft.SqlServer.Management.QueryExecution.QESQLBatch.DoBatchExecution(Microsoft.SqlServer.Management.QueryExecution.QESQLBatch,System.Data.SqlClient.SqlConnection,N/A)
Microsoft.SqlServer.Management.QueryExecution.QESQLBatch.Execute(N/A,N/A,N/A)
Microsoft.SqlServer.Management.QueryExecution.QEOLESQLExec.DoBatchExecution(Microsoft.SqlServer.Management.QueryExecution.QEOLESQLExec,Microsoft.SqlServer.Management.QueryExecution.QESQLBatch)
Microsoft.SqlServer.Management.QueryExecution.QESQLExec.ExecuteBatchCommon(Microsoft.SqlServer.Management.QueryExecution.QEOLESQLExec,N/A,N/A,System.Boolean&)
Microsoft.SqlServer.Management.QueryExecution.QEOLESQLExec.ExecuteBatchHelper(N/A,N/A,N/A,N/A)
Microsoft.SqlServer.Management.QueryExecution.QEOLESQLExec.ProcessBatch(N/A,N/A,N/A)
.BatchParser.ThunkCommandExecuter.ProcessBatch(N/A,N/A,N/A)
Again, to be clear, I don't know if the other exceptions are related or not but the memory exception only happens with SQL Prompt installed.
Thanks for your assistance!
At this point RedGate has finally admitted the issue is that the SQL Prompt plug-in is working in-process with the 32-bit SSMS client and eventually chokes the memory resulting in the out-of-memory exception.
Their response to a fix for this would be "maybe" in a year or so which, when you are paying for annual support, is a slap in the face. I've since refused to pay for further support for 2 existing Tool-belt licenses over this issue, an issue that I have fought with since 2012, until they correct this. If this is affecting you then, and if you can, do the same and vote with your wallet to motivate them to make this fix a higher priority.
If and when that day comes I will update this answer post with the version information of the corrected build of SQL Prompt that no longer operates within the 32-bit memory space of SSMS.exe.
What works for me is Disabling Code suggestions in SQL prompt, then I can run the same query and then get the results.
I can then Enable Code suggestions in SQL prompt and the error stays away for a while.
Can you try limiting the number of columns as described in this post and see if it helps?
http://redgate.uservoice.com/forums/94413-sql-prompt-feature-suggestions/suggestions/1364757-disable-sql-prompt-on-certain-databases